/* Minsight Console - dark professional finance theme. No external fonts or scripts (strict CSP). */
:root {
  --bg: #0a0e16; --bg2: #0f1522; --panel: #121a2a; --panel2: #16203a; --line: #1f2a40; --line2: #2a3752;
  --text: #e6eaf2; --muted: #8b96ad; --dim: #5b667d;
  --accent: #4f8cff; --accent2: #7aa7ff; --green: #22c55e; --red: #ef4444; --amber: #f59e0b; --purple: #a78bfa;
  --radius: 12px; --shadow: 0 8px 30px rgba(0, 0, 0, .35);
  --mono: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: "Pretendard", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: radial-gradient(1200px 600px at 80% -10%, #16254a 0%, var(--bg) 55%) fixed, var(--bg); color: var(--text); font-family: var(--sans); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .num, .sym, .clock { font-family: var(--mono); font-variant-numeric: tabular-nums; }
h1 { font-size: 22px; margin: 0 0 4px; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 14px; margin: 0 0 12px; color: var(--text); font-weight: 600; letter-spacing: .02em; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
h3 { font-size: 13px; margin: 14px 0 6px; color: var(--muted); font-weight: 600; }
p { margin: 6px 0; }
.muted { color: var(--muted); } .tiny { font-size: 12px; } .dim { color: var(--dim); }
.pos { color: var(--green); } .neg { color: var(--red); }
.empty { color: var(--dim); font-style: italic; padding: 8px 0; margin: 0; }
.count { background: var(--line); color: var(--muted); border-radius: 999px; padding: 0 8px; font-size: 11px; }

/* header */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 20px; padding: 10px 20px; background: rgba(10, 14, 22, .85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; white-space: nowrap; }
.brand em { font-style: normal; color: var(--muted); font-weight: 500; margin-left: 6px; }
.brand:hover { text-decoration: none; }
.mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), #8b5cf6); color: #fff; font-weight: 800; font-family: var(--mono); }
.mark.big { width: 44px; height: 44px; font-size: 22px; border-radius: 12px; }
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.nav a { padding: 6px 12px; border-radius: 8px; color: var(--muted); white-space: nowrap; line-height: 20px; border: 1px solid transparent; }
.nav a:hover { background: var(--panel2); color: var(--text); text-decoration: none; }
.nav a.on { background: rgba(79, 140, 255, .18); color: #dbe7ff; border: 1px solid rgba(79, 140, 255, .45); padding: 5px 11px; }
.who { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.who .user { color: var(--text); font-weight: 600; }
.inline { display: inline; margin: 0; }
.main { max-width: 1440px; margin: 0 auto; padding: 20px; }
.foot { text-align: center; color: var(--dim); font-size: 12px; padding: 24px; }

/* layout */
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 4px 0 18px; flex-wrap: wrap; }
.hero-right { display: flex; gap: 8px; align-items: center; }
.cards { display: grid; gap: 14px; margin-bottom: 18px; }
.cards.three { grid-template-columns: repeat(3, 1fr); }
.grid { display: grid; gap: 14px; margin-bottom: 18px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.grid.kpi-row { grid-template-columns: repeat(5, 1fr); }
.cols.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); overflow: auto; }
.card { background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; color: var(--text); box-shadow: var(--shadow); display: block; }
a.card:hover { text-decoration: none; border-color: var(--line2); transform: translateY(-1px); transition: .15s; }
.center-card.live { border-color: rgba(239, 68, 68, .5); box-shadow: 0 0 0 1px rgba(239, 68, 68, .2), var(--shadow); }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head .name { font-size: 17px; font-weight: 700; flex: 1; }
.card-foot { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.last { color: var(--muted); font-size: 12px; margin-top: 6px; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.kpis .k, .kpi .k { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.kpis strong, .kpi strong { font-size: 18px; font-family: var(--mono); font-weight: 600; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }

.badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; letter-spacing: .04em; }
.badge.live { background: rgba(239, 68, 68, .18); color: #fca5a5; border: 1px solid rgba(239, 68, 68, .5); }
.badge.paper { background: rgba(79, 140, 255, .14); color: #bfd4ff; border: 1px solid rgba(79, 140, 255, .4); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--dim); }
.dot.ok { background: var(--green); box-shadow: 0 0 8px var(--green); } .dot.bad { background: var(--red); box-shadow: 0 0 8px var(--red); } .dot.idle { background: var(--amber); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.amber { background: rgba(245, 158, 11, .15); color: #fcd34d; border: 1px solid rgba(245, 158, 11, .4); }
.chip { display: inline-block; background: var(--line); border-radius: 6px; padding: 0 6px; margin: 1px 2px; font-size: 11px; }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; padding: 6px 8px; border-bottom: 1px solid var(--line2); white-space: nowrap; }
.tbl td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
.tbl.compact td { padding: 4px 8px; }
.tbl tr:hover td { background: rgba(255, 255, 255, .02); }
.tbl .num, .tbl th.num { text-align: right; }
.tbl .wrap { white-space: normal; min-width: 180px; max-width: 520px; }
.tbl .bad-row td { background: rgba(239, 68, 68, .08); }
.side { font-weight: 700; font-size: 11px; padding: 1px 6px; border-radius: 4px; }
.side.long, .side.buy { color: #86efac; background: rgba(34, 197, 94, .12); } .side.short, .side.sell { color: #fca5a5; background: rgba(239, 68, 68, .12); }
.act { font-weight: 700; font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--line); }
.act.entry, .act.enter, .act.buy, .act.long { color: #86efac; } .act.exit, .act.close, .act.sell, .act.short { color: #fca5a5; } .act.wait, .act.hold { color: var(--muted); }
.sev { font-weight: 700; font-size: 11px; } .sev.critical, .sev.emergency { color: var(--red); } .sev.warning, .sev.warn { color: var(--amber); } .sev.info { color: var(--muted); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-word; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 112px 44px 90px 60px 1fr; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); align-items: baseline; font-size: 13px; }
.feed .t { color: var(--muted); font-family: var(--mono); font-size: 12px; } .feed .tag { color: var(--muted); font-size: 11px; } .feed .why { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link { display: inline-block; margin-top: 8px; font-size: 12px; }
.bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 8px 0; }
.bar .fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--purple)); transition: width .4s; }

/* sparkline */
.spark { display: block; background: var(--bg2); border-radius: 8px; border: 1px solid var(--line); }
.spark .zero { stroke: var(--line2); stroke-dasharray: 4 4; }
.spark polyline { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark polyline.up { stroke: var(--green); } .spark polyline.down { stroke: var(--red); }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 6px 0 14px; overflow-x: auto; }
.tabs a { padding: 8px 14px; color: var(--muted); white-space: nowrap; border-bottom: 2px solid transparent; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
.tabpane { display: none; scroll-margin-top: 80px; } .tabpane.on { display: block; }

/* buttons and forms */
.btn { background: var(--panel2); color: var(--text); border: 1px solid var(--line2); border-radius: 8px; padding: 7px 14px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn.wide { width: 100%; }
.btn.ghost { background: transparent; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.warn { border-color: rgba(245, 158, 11, .6); color: #fcd34d; }
.btn.danger { background: rgba(239, 68, 68, .12); border-color: rgba(239, 68, 68, .6); color: #fca5a5; }
.btn.live-btn { background: rgba(34, 197, 94, .12); border-color: rgba(34, 197, 94, .6); color: #86efac; }
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.btn-row form { margin: 0; }
.row-form { display: flex; align-items: center; gap: 10px; margin: 8px 0; flex-wrap: wrap; }
.live-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.live-row form { margin: 0; }
input, select, textarea { background: var(--bg2); color: var(--text); border: 1px solid var(--line2); border-radius: 8px; padding: 7px 10px; font: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 140, 255, .2); }
input.short { width: 70px; }
label { color: var(--muted); font-size: 12px; display: inline-flex; flex-direction: column; gap: 4px; }
label.inline-label { flex-direction: row; align-items: center; gap: 8px; }
.result { border-color: rgba(79, 140, 255, .5); }
.reply { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; white-space: pre-wrap; margin: 0 0 10px; font-size: 13px; }
.rules { margin: 0; padding-left: 18px; color: var(--muted); }
.rules li { margin: 4px 0; }
pre.md { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; white-space: pre-wrap; word-break: break-word; font-size: 12.5px; line-height: 1.55; margin: 6px 0; max-height: 70vh; overflow: auto; }
pre.md.small { font-size: 12px; max-height: 40vh; }
pre.log { background: #05080e; color: #c7d0e0; border: 1px solid var(--line); border-radius: 8px; padding: 12px; font-size: 12px; white-space: pre-wrap; word-break: break-all; max-height: 70vh; overflow: auto; margin: 0; }
.pre { white-space: pre-wrap; color: var(--text); padding: 6px 0; }
details summary { cursor: pointer; color: var(--accent2); }
details { margin: 6px 0; }

/* chat */
.chat .thread { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow: auto; padding: 6px 2px; }
.msg { max-width: 85%; padding: 10px 14px; border-radius: 14px; background: var(--panel2); border: 1px solid var(--line); }
.msg.owner { align-self: flex-end; background: rgba(79, 140, 255, .14); border-color: rgba(79, 140, 255, .35); }
.msg .meta { color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.msg .body { white-space: pre-wrap; word-break: break-word; }
.ask { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 12px; align-items: end; }
.ask textarea { width: 100%; resize: vertical; }
.ask .inline-label { grid-column: 1 / -1; }
.ask.busy { opacity: .6; }
.busy-note { color: var(--amber); font-size: 12px; grid-column: 1 / -1; }

/* login */
.login-body { display: grid; place-items: center; min-height: 100vh; }
.login-card { width: min(380px, 92vw); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); }
.login-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 22px; }
.login-brand strong { display: block; font-size: 18px; } .login-brand span { color: var(--muted); font-size: 12px; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form label { display: flex; }
.error { color: #fca5a5; margin: 0; } .warn { color: #fcd34d; }

@media (max-width: 1100px) {
  .cards.three, .grid.three, .cols.three { grid-template-columns: 1fr 1fr; }
  .grid.kpi-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .main { padding: 12px; }
  .top { padding: 8px 12px; gap: 10px; flex-wrap: wrap; }
  .brand em { display: none; }
  .who { margin-left: auto; }
  .who .clock { display: none; }
  .nav { order: 3; flex: none; width: 100%; padding-bottom: 2px; }
  .cards.three, .grid.two, .grid.three, .cols.three { grid-template-columns: 1fr; }
  .grid.kpi-row { grid-template-columns: 1fr 1fr; }
  .feed li { grid-template-columns: 70px 1fr; }
  .feed .tag, .feed .sym { display: none; }
  .msg { max-width: 100%; }
  .ask { grid-template-columns: 1fr; }
}

/* --- additions (owner review 2026-10-10) ------------------------------------------------------- */
.dot.off { background: var(--dim); box-shadow: none; }
.badge.ok { background: rgba(34, 197, 94, .15); color: #86efac; border: 1px solid rgba(34, 197, 94, .45); }
.badge.off { background: rgba(91, 102, 125, .2); color: var(--muted); border: 1px solid var(--line2); }
.notice { background: rgba(245, 158, 11, .1); border: 1px solid rgba(245, 158, 11, .35); color: #fcd34d; border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; }
.note { color: var(--muted); margin: 8px 0 0; }
.seedline { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 12px; margin: 0 0 12px; padding: 8px 10px; background: rgba(255, 255, 255, .03); border-radius: 8px; border: 1px solid var(--line); }
.seedline .k { color: var(--muted); } .seedline .v { font-family: var(--mono); text-align: right; } .seedline .v.strong { font-weight: 700; font-size: 14px; }
.kpi .k + strong + .k { margin-top: 2px; font-size: 11px; text-transform: none; letter-spacing: 0; }
.result.bad { border-color: rgba(239, 68, 68, .5); }
.otp-label { display: flex; flex-direction: row; align-items: center; gap: 8px; margin: 6px 0 2px; }
.otp-label input { width: 110px; font-family: var(--mono); letter-spacing: .15em; text-align: center; }
form.card { display: block; }
.row-current td { background: rgba(79, 140, 255, .08); }
.tech-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tech-head h2 { margin: 0; }
.tech-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
details.tech > summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; list-style: none; color: var(--text); }
details.tech > summary::-webkit-details-marker { display: none; }
details.tech > summary::before { content: "▸"; color: var(--muted); } details.tech[open] > summary::before { content: "▾"; }
.tech-id { font-family: var(--mono); font-weight: 700; color: var(--accent2); min-width: 60px; }
.tech-name { font-weight: 600; font-size: 15px; }
.tech-summary { color: var(--muted); margin: 10px 0 6px; }
.md-body { white-space: pre-wrap; word-break: break-word; line-height: 1.65; font-size: 13.5px; padding: 10px 12px; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; margin-top: 8px; max-height: 75vh; overflow: auto; }
.notes { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
details.note { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 0; }
details.note > summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--text); }
.note-topic { font-weight: 600; }
.note-statement { margin: 10px 0 4px; line-height: 1.6; }
.tags { margin-top: 8px; }
.pager { display: flex; align-items: center; gap: 12px; justify-content: center; margin-top: 14px; }
.search .grow { flex: 1; min-width: 200px; }
.cards.two { grid-template-columns: 1fr 1fr; }
.upload-form { display: flex; flex-direction: column; gap: 12px; }
.dropzone { border: 2px dashed var(--line2); border-radius: 12px; padding: 28px; text-align: center; color: var(--muted); cursor: pointer; background: var(--bg2); transition: .15s; }
.dropzone.over, .dropzone:hover { border-color: var(--accent); color: var(--text); background: rgba(79, 140, 255, .06); }
.dropzone .hidden-file { display: none; }
.picked { list-style: none; margin: 10px 0 0; padding: 0; color: var(--text); font-size: 12px; text-align: left; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: #1b2a4a; color: #e6eaf2; border: 1px solid rgba(79, 140, 255, .6); border-radius: 10px; padding: 12px 16px; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); transition: .3s; max-width: 340px; font-weight: 600; text-decoration: none; }
.toast.show { opacity: 1; transform: none; }
.toast:hover { text-decoration: none; border-color: var(--accent2); }
.msg.pending .body { color: var(--amber); font-style: italic; }
@media (max-width: 760px) { .cards.two { grid-template-columns: 1fr; } .toasts { left: 16px; right: 16px; } .toast { max-width: none; } }
