:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-2: #1c2230;
  --line: #2a3140;
  --text: #e6edf3;
  --muted: #8b97a7;
  --accent: #f0b429;          /* 큰수/강조 골드 */
  --loc-sell: #3fb950;        /* 초록 = LOC 매도 */
  --limit: #58a6ff;           /* 파랑 = 지정가 매도 */
  --moc: #f85149;             /* 빨강 = MOC 강조 */
  --buy: #d29922;
  --radius: 14px;
  --mono: 'SFMono-Regular', ui-monospace, 'Cascadia Code', Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Pretendard', system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); line-height: 1.5;
  background-image: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(240,180,41,.08), transparent);
}

header.masthead {
  padding: 28px clamp(16px, 4vw, 48px) 20px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap;
}
header.masthead h1 {
  margin: 0; font-size: clamp(1.4rem, 1rem + 2vw, 2.2rem);
  font-weight: 800; letter-spacing: -.02em;
}
header.masthead .tag {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--bg); background: var(--accent);
  padding: 3px 9px; border-radius: 6px; font-weight: 700;
}
header.masthead .sub { color: var(--muted); font-size: .85rem; margin-left: auto; }

main { padding: clamp(16px, 3vw, 36px); max-width: 1280px; margin: 0 auto; }

.grid { display: grid; gap: 18px; grid-template-columns: repeat(12, 1fr); }
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px;
}
.panel h2 {
  margin: 0 0 14px; font-size: .82rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.panel h2::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }

.col-form { grid-column: span 12; }
.col-gate  { grid-column: span 4; }
.col-seed  { grid-column: span 8; }
.col-buy   { grid-column: span 6; }
.col-sell  { grid-column: span 6; }
.col-ladder{ grid-column: span 12; }
@media (max-width: 860px) {
  .col-gate, .col-seed, .col-buy, .col-sell { grid-column: span 12; }
}

/* ---- form ---- */
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.field label { display: block; font-size: .72rem; color: var(--muted); margin-bottom: 4px; letter-spacing: .04em; }
.field input, .field select {
  width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 9px 10px; font-family: var(--mono); font-size: .9rem;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(240,180,41,.15); }
.actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
button {
  font-family: var(--sans); font-weight: 700; font-size: .9rem; cursor: pointer;
  border: 1px solid var(--line); border-radius: 9px; padding: 10px 18px;
  background: var(--surface-2); color: var(--text); transition: transform .08s ease, background .15s;
}
button:hover { background: #232b3a; transform: translateY(-1px); }
button.primary { background: var(--accent); color: #1a1205; border-color: var(--accent); }
button.primary:hover { background: #ffc94d; }
button:active { transform: translateY(0); }

/* ---- gate ---- */
.gate-badge { font-size: 2.4rem; font-weight: 800; letter-spacing: -.02em; }
.gate-YES { color: var(--loc-sell); }
.gate-NO { color: var(--moc); }
.gate-UNKNOWN { color: var(--muted); }
.gate-meta { color: var(--muted); font-size: .85rem; margin-top: 6px; }

/* ---- seed stats ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 14px; }
.stat .k { font-size: .7rem; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; }
.stat .v { font-family: var(--mono); font-size: 1.25rem; font-weight: 700; margin-top: 3px; }
.progress-wrap { margin-top: 8px; height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--moc)); transition: width .4s ease; }

/* ---- order tables ---- */
table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: .9rem; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: .72rem; text-transform: uppercase; padding: 6px 8px; border-bottom: 1px solid var(--line); }
td { padding: 9px 8px; border-bottom: 1px solid rgba(42,49,64,.5); }
tr:last-child td { border-bottom: none; }
.kind { font-size: .68rem; font-weight: 800; padding: 2px 7px; border-radius: 5px; letter-spacing: .05em; }
.kind-LOC { background: rgba(63,185,80,.16); color: var(--loc-sell); }
.kind-LIMIT { background: rgba(88,166,255,.16); color: var(--limit); }
.kind-MOC { background: rgba(248,81,73,.18); color: var(--moc); }
.num { text-align: right; }
.empty { color: var(--muted); font-style: italic; padding: 14px 8px; }

.ladder-scroll { overflow-x: auto; }
.note { color: var(--muted); font-size: .78rem; margin-top: 10px; }
.warn { color: var(--moc); font-weight: 700; }
