@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable.min.css");
@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap");

:root {
  --bg: #09090b;
  --bg2: #0e0e11;
  --card: #121216;
  --card2: #17171c;
  --line: #222229;
  --line2: #2e2e37;
  --text: #ececf0;
  --dim: #9a9aa6;
  --mute: #63636e;
  --acc: #e0365f;
  --acc2: #ff5a80;
  --accbg: rgba(224, 54, 95, 0.1);
  --ok: #3ccf8e;
  --bad: #ff6b6b;
  --warn: #f2b84b;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Pretendard Variable", Pretendard, system-ui, sans-serif;
  --r: 3px;
  --w: 1180px;
}

* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; }
html[lang=ko] h1, html[lang=ko] h2, html[lang=ko] h3 { word-break: keep-all; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.6 var(--sans); letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--acc); color: #fff; }
.mono, .num { font-family: var(--mono); font-feature-settings: "tnum"; }
.dim { color: var(--dim); }
.mute { color: var(--mute); }
.acc { color: var(--acc2); }
.wrap { max-width: var(--w); margin: 0 auto; padding: 0 24px; }
[hidden] { display: none !important; }

/* ── 머리 ── */
#top {
  position: sticky; top: 0; z-index: 50; height: 56px;
  background: rgba(9, 9, 11, 0.86); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
#top .wrap { display: flex; align-items: center; height: 100%; gap: 28px; max-width: none; padding: 0 22px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 0.16em; font-size: 14px; }
.brand svg { width: 22px; height: 22px; }
#nav { display: flex; gap: 2px; }
#nav a { padding: 6px 11px; color: var(--dim); font-size: 14px; border-radius: var(--r); }
#nav a:hover { color: var(--text); background: var(--card); }
#nav a.on { color: var(--text); box-shadow: inset 0 -2px 0 var(--acc); border-radius: 0; }
.grow { flex: 1; }
#search {
  display: flex; align-items: center; gap: 8px; width: 240px; height: 34px; padding: 0 10px;
  border: 1px solid var(--line); background: var(--bg2); border-radius: var(--r); color: var(--mute); font-size: 13px; cursor: text;
}
#search kbd { margin-left: auto; }
.lang { display: flex; border: 1px solid var(--line); border-radius: var(--r); }
.lang button { height: 30px; padding: 0 8px; border: 0; background: none; color: var(--mute); font: 500 11px var(--mono); cursor: pointer; }
.lang button + button { border-left: 1px solid var(--line); }
.lang button.on { color: var(--text); background: var(--card2); }
.lang button:hover { color: var(--text); }
#search svg { width: 14px; height: 14px; flex: none; }
#search span { white-space: nowrap; }
kbd {
  font: 11px var(--mono); padding: 1px 5px; border: 1px solid var(--line2); border-radius: 2px; color: var(--dim);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 16px; border: 1px solid var(--line2); border-radius: var(--r);
  background: var(--card); font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: border-color .12s, background .12s;
}
.btn:hover { border-color: var(--mute); background: var(--card2); }
.btn.prim { background: var(--acc); border-color: var(--acc); color: #fff; }
.btn.prim:hover { background: var(--acc2); border-color: var(--acc2); }
.btn.ghost { background: transparent; }
.btn.sm { height: 30px; padding: 0 11px; font-size: 13px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn svg { width: 15px; height: 15px; }

/* ── 공통 조각 ── */
.eyebrow { font: 600 11px var(--mono); letter-spacing: 0.18em; color: var(--acc2); text-transform: uppercase; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.hr { height: 1px; background: var(--line); }
.tag {
  display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 6px;
  font: 500 11px var(--mono); color: var(--dim); border: 1px solid var(--line2); border-radius: 2px;
}
.tag.acc { color: var(--acc2); border-color: rgba(224, 54, 95, .45); }
.tag.ok { color: var(--ok); border-color: rgba(60, 207, 142, .4); }
.demo-note {
  display: flex; gap: 8px; align-items: center; padding: 8px 12px; font-size: 13px; color: var(--warn);
  border: 1px solid rgba(242, 184, 75, .3); background: rgba(242, 184, 75, .05); border-radius: var(--r);
}
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--dim); }
.input, select.input {
  height: 38px; padding: 0 12px; border: 1px solid var(--line2); background: var(--bg2);
  border-radius: var(--r); color: var(--text); outline: none; font-size: 14px;
}
.input:focus { border-color: var(--acc); }
/* 직접 그린 select (app.js fancySelect) */
.fx { position: relative; display: block; min-width: 0; }
.fx > select { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.fx-b {
  display: flex; align-items: center; gap: 9px; width: 100%; height: 38px; padding: 0 12px; text-align: left;
  border: 1px solid var(--line2); background: var(--bg2); border-radius: 8px; color: var(--text); font-size: 14px; cursor: pointer;
  transition: border-color .12s, background .12s;
}
.fx-b:hover { border-color: #3a3a45; }
.fx-b:focus-visible, .fx.open .fx-b { outline: none; border-color: var(--acc); }
.fx-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-b em, .fx-l em { font-style: normal; font-size: 12px; color: var(--mute); white-space: nowrap; }
.fx-c { flex: none; color: var(--mute); transition: transform .15s; }
.fx.open .fx-c { transform: rotate(180deg); color: var(--text); }
.fx.sm { display: inline-block; min-width: 110px; }
.fx.sm .fx-b { height: 30px; padding: 0 9px; font-size: 13px; border-radius: 7px; }
.fx-l {
  position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; min-width: 100%; max-height: 300px; overflow: auto;
  margin: 0; padding: 5px; list-style: none; background: var(--card); border: 1px solid var(--line2); border-radius: 10px;
  box-shadow: 0 14px 40px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.3); animation: fxIn .12s ease-out;
}
.fx-l.up { top: auto; bottom: calc(100% + 6px); }
@keyframes fxIn { from { opacity: 0; transform: translateY(-3px); } }
.fx-l li { display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 7px; font-size: 14px; color: var(--dim); cursor: pointer; white-space: nowrap; }
.fx-l li.cur { background: var(--card2); color: var(--text); }
.fx-l li .fx-k { margin-left: auto; flex: none; color: var(--acc2); visibility: hidden; }
.fx-l li.sel { color: var(--text); }
.fx-l li.sel .fx-k { visibility: visible; }
.fx-l li em { margin-left: 4px; }
.fx-b .av, .fx-l .av { border-radius: 5px; }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; }
.av {
  display: inline-grid; place-items: center; width: 26px; height: 26px; flex: none;
  font: 700 11px var(--mono); border-radius: 2px; color: #fff; text-transform: uppercase;
}
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th {
  text-align: left; font-weight: 500; font-size: 12px; color: var(--mute); padding: 10px 14px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.t td { padding: 11px 14px; border-bottom: 1px solid var(--line); }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--card2); }
table.t .r { text-align: right; }
.empty { padding: 40px; text-align: center; color: var(--mute); font-size: 14px; }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 99;
  padding: 10px 16px; background: var(--card2); border: 1px solid var(--line2); border-left: 2px solid var(--acc);
  font-size: 14px; border-radius: var(--r);
}

/* ── 검색 창 ── */
#qk { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.55); display: flex; justify-content: center; padding-top: 12vh; }
#qk .box { width: min(620px, 92vw); max-height: 60vh; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line2); border-radius: var(--r); }
#qk input { height: 52px; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 0 18px; outline: none; font-size: 16px; }
#qk .list { overflow: auto; }
#qk .it { display: flex; align-items: center; gap: 12px; padding: 10px 18px; cursor: pointer; font-size: 14px; }
#qk .it.on { background: var(--card2); box-shadow: inset 2px 0 0 var(--acc); }
#qk .it .mono { margin-left: auto; font-size: 12px; color: var(--mute); }

/* ── 발 ── */
#foot { border-top: 1px solid var(--line); margin-top: 120px; padding: 56px 0 40px; }
#foot .cols { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; }
#foot h4 { margin: 0 0 14px; font-size: 12px; font-weight: 600; color: var(--mute); letter-spacing: .1em; }
#foot a { display: block; color: var(--dim); font-size: 14px; padding: 3px 0; }
#foot a:hover { color: var(--text); }
#foot .legal { margin-top: 48px; display: flex; justify-content: space-between; color: var(--mute); font-size: 12px; }

@media (max-width: 860px) {
  #nav, #search { display: none; }
  #foot .cols { grid-template-columns: 1fr 1fr; }
  .wrap { padding: 0 16px; }
}

/* ── 품질 패스: 공통 ── */
:root { --ease: cubic-bezier(.2, .7, .2, 1); }
body { font-feature-settings: "ss01", "cv11"; text-rendering: optimizeLegibility; }
.num, .mono { font-variant-numeric: tabular-nums; }
a, button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.input:focus-visible { outline: none; }
.btn { transition: border-color .15s var(--ease), background .15s var(--ease), transform .08s; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.prim { box-shadow: 0 0 0 1px rgba(255,255,255,.04) inset, 0 6px 18px -8px rgba(224,54,95,.55); }
main, .lay { animation: rise .35s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* 눈금 라벨은 산세리프로 — 한·일 글자가 고정폭 글꼴로 찍히면 깨져 보인다 */
.lbl { font: 500 11px var(--sans); color: var(--mute); letter-spacing: .06em; text-transform: uppercase; }
html[lang=ko] .lbl, html[lang=ja] .lbl { letter-spacing: 0; text-transform: none; font-size: 12px; }

/* 뼈대 로딩 */
.sk { position: relative; overflow: hidden; background: var(--card); border-radius: 2px; }
.sk::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.04), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* 차트 말풍선 */
#tip { position: fixed; z-index: 95; pointer-events: none; padding: 7px 10px; background: var(--card2); border: 1px solid var(--line2); border-radius: 2px; font-size: 12px; white-space: nowrap; box-shadow: 0 8px 24px -10px rgba(0,0,0,.8); }
#tip b { font: 600 12px var(--mono); }
#tip .mute { margin-right: 8px; }

/* 모바일 메뉴 */
#menuBtn { display: none; width: 36px; height: 36px; border: 1px solid var(--line2); background: none; border-radius: var(--r); cursor: pointer; place-items: center; }
#menuBtn svg { width: 16px; height: 16px; }
#mnav { position: fixed; inset: 56px 0 auto; z-index: 49; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; display: none; }
#mnav a { display: block; padding: 12px 4px; border-bottom: 1px solid var(--line); font-size: 16px; }
#mnav .lang { margin-top: 14px; width: max-content; }
body.mopen #mnav { display: block; }
@media (max-width: 860px) {
  #menuBtn { display: grid; }
  #top .lang { display: none; }
  #top .wrap { gap: 12px; }
}

/* 상태 점 */
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(60,207,142,.15); }
.dot.off { background: var(--warn); box-shadow: 0 0 0 3px rgba(242,184,75,.15); }

/* 404 */
.nf { min-height: calc(100vh - 56px - 200px); display: grid; place-items: center; text-align: center; }
.nf b { display: block; font: 600 96px var(--mono); letter-spacing: -0.05em; color: var(--line2); }

/* 슬라이더 */
input[type=range] { -webkit-appearance: none; appearance: none; height: 20px; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 2px; background: var(--line2); }
input[type=range]::-moz-range-track { height: 2px; background: var(--line2); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -5px; background: var(--acc); border: 0; border-radius: 0; transform: rotate(45deg); }
input[type=range]::-moz-range-thumb { width: 10px; height: 10px; background: var(--acc); border: 0; border-radius: 0; transform: rotate(45deg); }
input[type=range]::-moz-range-progress { height: 2px; background: var(--acc); }

/* 스크롤바: 얇고 어둡게, 마우스를 올렸을 때만 조금 밝게 */
* { scrollbar-width: thin; scrollbar-color: #2b2b33 transparent; }
*:hover { scrollbar-color: #3d3d47 transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2b2b33; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #45454f; background-clip: padding-box; }
::-webkit-scrollbar-button { display: none; height: 0; width: 0; }
::-webkit-scrollbar-corner { background: transparent; }
