/* sat.kim design system — Korean-portal clean: white cards on cool gray,
   Toss-blue primary, Naver-green success, Pretendard type, fast and dense. */

:root {
  --bg: #f2f4f7;
  --card: #ffffff;
  --ink: #191f28;
  --ink-2: #4e5968;
  --ink-3: #8b95a1;
  --line: #e5e8eb;
  --blue: #3182f6;
  --blue-dark: #1b64da;
  --blue-soft: #e8f3ff;
  --green: #03c75a;
  --green-soft: #e6f9ef;
  --red: #f04452;
  --red-soft: #fdecee;
  --amber: #f59f00;
  --radius: 16px;
  --shadow: 0 1px 3px rgba(25, 31, 40, 0.06), 0 6px 16px rgba(25, 31, 40, 0.05);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", sans-serif;
  font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }

/* ---------- market voices: theme is data, not copied templates ---------- */
body.voice-army { --blue: #b8232f; --blue-dark: #8f1b24; --blue-soft: #fbeaec; }
body.voice-army h1, body.voice-army h2, body.voice-army .logo { font-family: Oswald, "Pretendard Variable", sans-serif; letter-spacing: 0.2px; }
body.voice-ac { --blue: #012169; --blue-dark: #001647; --blue-soft: #e8edf8; }
body.voice-ac h1, body.voice-ac h2 { font-family: "Playfair Display", Georgia, serif; letter-spacing: 0; }
body.voice-ac .logo { font-family: "Playfair Display", Georgia, serif; }

/* ---------- top bar ---------- */
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.bar { display: flex; align-items: center; gap: 22px; height: 60px; }
.logo { font-weight: 800; font-size: 21px; color: var(--ink); letter-spacing: -0.5px; display: flex; align-items: center; gap: 8px; }
.logo-mark { height: 26px; width: auto; display: block; }
@media (max-width: 640px) { .logo-mark { height: 22px; } }
.logo:hover { text-decoration: none; }
.logo-dot { color: var(--blue); }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { color: var(--ink-2); padding: 7px 12px; border-radius: 9px; font-weight: 600; }
.nav a:hover { background: var(--bg); text-decoration: none; }
.nav a.on { color: var(--blue); background: var(--blue-soft); }
.bar-right { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.langswitch { color: var(--ink-3); font-size: 13px; white-space: nowrap; }
.langswitch a { color: var(--ink-3); font-weight: 600; }
/* phones: two-row header — logo + actions on top, nav on its own scrollable row */
@media (max-width: 640px) {
  .bar { flex-wrap: wrap; height: auto; padding-top: 8px; padding-bottom: 8px; gap: 8px 12px; row-gap: 2px; }
  .logo { font-size: 19px; }
  .bar-right { margin-left: auto; gap: 8px; }
  .bar-right .btn.sm { padding: 6px 10px; font-size: 13px; white-space: nowrap; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; gap: 2px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 6px 10px; font-size: 14px; white-space: nowrap; }
  .nav:empty { display: none; }
}
.langswitch a.on { color: var(--ink); }
.langswitch i { margin: 0 4px; font-style: normal; }
.inline { display: inline; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 12px 20px; font-size: 15px;
  font-weight: 700; cursor: pointer; transition: transform .06s, background .12s;
  font-family: inherit; text-decoration: none !important;
}
.btn:active { transform: scale(0.985); }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-dark); }
.btn.ghost { background: var(--bg); color: var(--ink-2); }
.btn.ghost:hover { background: var(--line); }
.btn.green { background: var(--green); color: #fff; }
.btn.big { padding: 16px 28px; font-size: 17px; border-radius: 14px; }
.btn.sm { padding: 8px 14px; font-size: 13.5px; border-radius: 10px; }
.btn.block { width: 100%; }
/* payment buttons: brand colors are the recognition signal (2x2 grid,
   equal cells; each brand fills its cell, wordmarks centered) */
.paygrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn.pay { height: 46px; display: flex; gap: 0; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; border: none; border-radius: 12px; letter-spacing: -0.2px; }
.btn.kakao { background: #fee500; color: #191600; }
.btn.kakao b { font-weight: 800; }
.btn.kakao .kk { font-weight: 400; }
.kakao-bubble { width: 19px; height: 17px; margin-right: 6px; flex-shrink: 0; }
.btn.naver { background: #03c75a; color: #fff; }
.btn.naver .npay-n { font-weight: 900; font-size: 17px; margin-right: 5px; }
.btn.samsungpay { background: #000; color: #fff; }
.btn.samsungpay b { font-weight: 800; letter-spacing: 0.2px; }
.btn.cardpay { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.google { background: #fff; color: var(--ink); border: 1px solid var(--line); }

/* ---------- cards & layout ---------- */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 26px; margin: 18px 0;
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 760px) { .grid2, .grid3, .grid4 { grid-template-columns: 1fr; } }

h1 { font-size: 30px; letter-spacing: -0.8px; line-height: 1.25; margin: 26px 0 10px; }
h2 { font-size: 21px; letter-spacing: -0.4px; margin: 0 0 12px; }
h3 { font-size: 16px; margin: 0 0 8px; }
.muted { color: var(--ink-3); }
.sub { color: var(--ink-2); font-size: 16px; }

/* ---------- landing v2 ---------- */
.hero2 {
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 34px; align-items: center;
  padding: 56px 0 26px;
}
@media (max-width: 880px) { .hero2 { grid-template-columns: 1fr; } }
.hero2-copy h1 { font-size: 40px; margin: 10px 0 12px; }
@media (max-width: 640px) { .hero2-copy h1 { font-size: 30px; } }
.hero2-legend { display: flex; gap: 18px; margin-top: 18px; color: var(--ink-3); font-size: 13px; font-weight: 600; }
.hero2-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.hero2-viz {
  position: relative; background: linear-gradient(160deg, #eaf3ff, #f6f9ff 60%, #eef6ff);
  border-radius: 22px; box-shadow: var(--shadow); padding: 14px; min-height: 340px;
}
#hero-canvas { width: 100%; height: 340px; display: block; }
.chip {
  position: absolute; background: #fff; border-radius: 999px; padding: 8px 14px;
  font-size: 13px; font-weight: 700; box-shadow: var(--shadow); z-index: 2;
}
.chip-a { top: 20px; left: 22px; color: var(--ink-3); animation: float 5s ease-in-out infinite; }
.chip-b { bottom: 22px; right: 22px; color: var(--blue); animation: float 5s ease-in-out 1.2s infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

.statrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 760px) { .statrow { grid-template-columns: repeat(2, 1fr); } }

.approw-card { padding: 30px 26px; }
.approw { display: flex; justify-content: center; gap: 30px; flex-wrap: wrap; margin-top: 18px; }
.appico { display: flex; flex-direction: column; align-items: center; gap: 9px; color: var(--ink); width: 86px; text-align: center; }
.appico:hover { text-decoration: none; transform: translateY(-3px); transition: transform .12s; }
.appico i {
  width: 60px; height: 60px; border-radius: 18px; display: flex; align-items: center;
  justify-content: center; font-size: 27px; font-style: normal; box-shadow: var(--shadow);
}
.appico b { font-size: 12.5px; }

.cohorts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 16px; }
@media (max-width: 880px) { .cohorts { grid-template-columns: repeat(2, 1fr); } }
.cohort {
  background: linear-gradient(150deg, var(--c1), var(--c2)); color: #fff; border-radius: 16px;
  padding: 20px 18px; display: flex; flex-direction: column; gap: 7px; min-height: 132px;
  box-shadow: var(--shadow); transition: transform .12s;
}
.cohort:hover { transform: translateY(-3px); text-decoration: none; }
.ctag { font-size: 12px; font-weight: 800; opacity: .85; text-transform: uppercase; letter-spacing: .5px; }
.ctitle { font-size: 20px; font-weight: 800; letter-spacing: -0.4px; }
.cbody { font-size: 13px; opacity: .92; line-height: 1.45; }

.newslist { list-style: none; padding: 0; margin: 0; }
.newslist li { padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 14.5px; color: var(--ink-2); }
.newslist li:last-child { border-bottom: 0; }
.supportgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.supportgrid .btn { justify-content: flex-start; }

/* ---------- hero / landing ---------- */
.hero { text-align: center; padding: 64px 0 30px; }
.hero h1 { font-size: 42px; margin-bottom: 14px; }
@media (max-width: 640px) { .hero h1 { font-size: 30px; } }
.hero .sub { max-width: 620px; margin: 0 auto 26px; }
.hero .cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.badge {
  display: inline-block; background: var(--blue-soft); color: var(--blue);
  font-weight: 700; font-size: 13px; border-radius: 999px; padding: 6px 14px; margin-bottom: 18px;
}
.feat h3 { display: flex; align-items: center; gap: 8px; }
.feat .ico { font-size: 22px; }

/* ---------- forms ---------- */
label { display: block; font-weight: 700; font-size: 13.5px; margin: 14px 0 6px; color: var(--ink-2); }
input[type=email], input[type=password], input[type=text], input[type=date], input[type=number], select {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px;
  font-size: 15px; font-family: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.formcard { max-width: 420px; margin: 40px auto; }
.error { background: var(--red-soft); color: var(--red); border-radius: 10px; padding: 10px 14px; font-weight: 600; margin: 12px 0; }
.flash { background: var(--green-soft); color: #0a7f3f; border-radius: 10px; padding: 10px 14px; font-weight: 600; margin: 12px 0; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 13px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- stats ---------- */
.stat { text-align: center; padding: 18px 10px; }
.stat .num { font-size: 30px; font-weight: 800; letter-spacing: -1px; }
.stat .lbl { color: var(--ink-3); font-size: 13px; font-weight: 600; }
.stat.blue .num { color: var(--blue); }
.stat.green .num { color: var(--green); }
.stat.red .num { color: var(--red); }

.bar-meter { background: var(--bg); border-radius: 999px; height: 10px; overflow: hidden; }
.bar-meter > i { display: block; height: 100%; background: var(--blue); border-radius: 999px; }

/* ---------- game surfaces ---------- */
.game { max-width: 720px; margin: 24px auto; }
.qcard { position: relative; }
.qword { font-size: 40px; font-weight: 800; text-align: center; letter-spacing: -1px; margin: 18px 0 6px; }
.qmeta { display: flex; justify-content: space-between; color: var(--ink-3); font-size: 13px; font-weight: 600; }
.qstem { font-size: 17px; margin: 14px 0; }
.qpassage {
  background: var(--bg); border-radius: 12px; padding: 16px 18px; font-size: 15.5px;
  margin: 12px 0; white-space: pre-wrap;
}
.qgraph { display: block; margin: 10px auto; max-width: 100%; }
.choices { display: grid; gap: 10px; margin-top: 16px; }
.choice {
  text-align: left; background: #fff; border: 1.5px solid var(--line); border-radius: 14px;
  padding: 14px 16px; font-size: 15.5px; cursor: pointer; font-family: inherit;
  transition: border-color .1s, background .1s; display: flex; gap: 12px; align-items: baseline;
}
.choice:hover { border-color: var(--blue); background: var(--blue-soft); }
.choice .abc { font-weight: 800; color: var(--ink-3); }
.choice.correct { border-color: var(--green); background: var(--green-soft); }
.choice.correct .abc { color: var(--green); }
.choice.wrong { border-color: var(--red); background: var(--red-soft); }
.choice.wrong .abc { color: var(--red); }
.choice.flash { animation: flashCorrect 0.4s ease 3; }
.choice:disabled { cursor: default; }
@keyframes flashCorrect {
  0%, 100% { background: var(--green-soft); }
  50% { background: #b7f0cf; }
}
.shake { animation: shake .35s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}
.explain { background: var(--blue-soft); border-radius: 10px; padding: 12px 16px; margin-top: 14px; font-size: 14.5px; }
.explain .trick { color: var(--ink-2); margin-top: 8px; font-size: 13.5px; }
.monster { width: 88px; height: 88px; border-radius: 20px; position: absolute; top: -22px; right: 16px; box-shadow: var(--shadow); background: #fff; object-fit: cover; }
.monsterwrap { position: absolute; top: -22px; right: 16px; display: flex; }
.monsterwrap .monster-img { width: 88px; height: 88px; border-radius: 20px; box-shadow: var(--shadow); background: #fff; object-fit: cover; }
.has-two .monsterwrap .monster-img:first-child { margin-right: -26px; transform: rotate(-4deg); z-index: 1; }
.has-two .monsterwrap .monster-img:last-child { transform: rotate(4deg); }
.qbadges { position: absolute; top: 70px; right: 20px; font-size: 17px; z-index: 2; filter: drop-shadow(0 1px 2px rgba(0,0,0,.25)); }
.monster-reveal img + img { margin-left: -18px; transform: rotate(5deg); }
@media (max-width: 640px) { .monster { width: 72px; height: 72px; top: -18px; right: 12px; } .monsterwrap { top: -18px; right: 12px; } .monsterwrap .monster-img { width: 72px; height: 72px; } .qbadges { top: 58px; right: 16px; } .qcard { margin-top: 26px; } .qcard.has-monster { padding-top: 60px; } .qcard.has-two { padding-top: 64px; } }
.qcard.has-monster .qstem { padding-right: 92px; }
@media (max-width: 640px) { .qcard.has-monster .qstem { padding-right: 0; } }
.monster-reveal { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.monster-reveal img { width: 96px; height: 96px; border-radius: 22px; box-shadow: var(--shadow); background: #fff; flex-shrink: 0; }
.monster-reveal b { display: block; font-size: 15px; }
.monster-reveal span { color: var(--ink-2); font-size: 13px; }

.timerbar { display: flex; align-items: center; gap: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.timerbar .clock { font-size: 22px; }
.timerbar.low .clock { color: var(--red); }

/* distraction modal */
.modal-back {
  position: fixed; inset: 0; background: rgba(25,31,40,.45); display: flex;
  align-items: center; justify-content: center; z-index: 50;
}
.modal { background: #fff; border-radius: 18px; padding: 26px; max-width: 380px; text-align: center; }
.modal .btnrow { display: flex; gap: 10px; margin-top: 18px; }
.modal .btnrow .btn { flex: 1; }

/* ---------- tables ---------- */
table.list, table.twoway { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th, table.list td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
table.list th { color: var(--ink-3); font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; }
table.twoway { max-width: 460px; margin: 10px 0; }
table.twoway th, table.twoway td { border: 1px solid var(--line); padding: 7px 12px; text-align: center; }
table.twoway th { background: var(--bg); }
table.twoway td.tot { font-weight: 700; background: var(--bg); }

.pill { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; }
.pill.green { background: var(--green-soft); color: #0a7f3f; }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.pill.amber { background: #fff4d6; color: #9a6700; }
.pill.red { background: var(--red-soft); color: var(--red); }

/* heat strip */
.heat { display: flex; gap: 4px; flex-wrap: wrap; }
.heat .d { width: 26px; height: 26px; border-radius: 6px; background: var(--bg); position: relative; }
.heat .d[data-n="1"] { background: #cfe5ff; }
.heat .d[data-n="2"] { background: #8fc2ff; }
.heat .d[data-n="3"] { background: var(--blue); }

/* code display for linking */
.bigcode { font-size: 38px; font-weight: 800; letter-spacing: 8px; text-align: center; margin: 16px 0; font-variant-numeric: tabular-nums; }
#qr { display: flex; justify-content: center; margin: 12px 0; }
#qr img, #qr canvas { border-radius: 12px; }

/* admin monster hover-zoom: 28px thumb → 400px popup on mouse-over */
/* Hover-zoom without flicker: the wrapper keeps a FIXED 28px footprint (so
   the hover target never collapses when the image pops out) and the popped
   image ignores the pointer (so it can't steal the hover it depends on). */
.monwrap { position: relative; display: inline-block; width: 28px; height: 28px; vertical-align: middle; }
.monwrap img { height: 28px; width: 28px; border-radius: 7px; display: block; cursor: zoom-in; }
.monwrap:hover img {
  position: absolute; height: 400px; width: 400px; top: -186px; left: 36px;
  z-index: 99; background: #fff; border-radius: 24px; box-shadow: 0 12px 40px rgba(25,31,40,.25);
  pointer-events: none;
}

/* admin try-it: question left, live calculator right on desktop */
.try-split { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 18px; align-items: start; }
@media (max-width: 980px) { .try-split { grid-template-columns: 1fr; } }

/* footer */
.foot { border-top: 1px solid var(--line); margin-top: 60px; padding: 26px 0; background: #fff; }
.footrow { display: flex; justify-content: space-between; gap: 16px; color: var(--ink-3); font-size: 13.5px; flex-wrap: wrap; }

/* math helpers */
.frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; margin: 0 2px; }
.frac .num { border-bottom: 1.5px solid currentColor; padding: 0 4px; }
.frac .den { padding: 0 4px; }
.sqrt-in { border-top: 1.5px solid currentColor; }

/* progress dots for mock */
.qnav { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.qnav .dot { width: 26px; height: 26px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--ink-3); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.qnav .dot.done { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
.qnav .dot.cur { background: var(--blue); color: #fff; border-color: transparent; }

/* calculator side panel */
.mock-flex { display: flex; gap: 16px; align-items: flex-start; }
.mock-main { flex: 1; min-width: 0; }
.calc-panel { width: 380px; position: sticky; top: 76px; }
.calc-panel iframe { width: 100%; height: 480px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
@media (max-width: 980px) { .mock-flex { flex-direction: column; } .calc-panel { width: 100%; position: static; } }
