/* Qproov UI — dark-first, tokens on :root. Kept dependency-free for low-bandwidth markets (NFR: initial bundle < 300KB). */
:root {
  --bg: #090a0f;
  --panel: #11131c;
  --panel-2: #171a26;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f3f4f6;
  --muted: #9aa3b2;
  --dim: #6b7280;
  --cyan: #38bdf8;
  --violet: #a78bfa;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --grad: linear-gradient(135deg, #38bdf8 0%, #a78bfa 50%, #34d399 100%);
  --btn: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  --radius: 14px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", "Noto Sans", sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f7f8fb;
    --panel: #ffffff;
    --panel-2: #f1f3f8;
    --line: rgba(15, 23, 42, 0.1);
    --text: #0f172a;
    --muted: #475569;
    --dim: #64748b;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f7f8fb;
  --panel: #ffffff;
  --panel-2: #f1f3f8;
  --line: rgba(15, 23, 42, 0.1);
  --text: #0f172a;
  --muted: #475569;
  --dim: #64748b;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 0.82rem; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

header.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--text); }
.brand img { width: 28px; height: 28px; }
nav.links { display: flex; gap: 20px; font-size: 0.9rem; }
nav.links a { color: var(--muted); }
@media (max-width: 760px) { nav.links { display: none; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 10px; padding: 10px 16px; font: inherit; font-weight: 700; font-size: 0.9rem; cursor: pointer; color: #fff; background: var(--btn); transition: transform 0.15s ease, box-shadow 0.15s ease; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 0 22px rgba(139, 92, 246, 0.4); text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.ghost { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
.btn.sm { padding: 6px 10px; font-size: 0.8rem; border-radius: 8px; }
.btn.ok { background: rgba(52, 211, 153, 0.15); color: var(--green); border: 1px solid rgba(52, 211, 153, 0.35); }
.btn.bad { background: rgba(248, 113, 113, 0.12); color: var(--red); border: 1px solid rgba(248, 113, 113, 0.35); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 860px) { .g2, .g3, .g5 { grid-template-columns: 1fr; } }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); }
.pill.green { color: var(--green); border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.1); }
.pill.violet { color: var(--violet); border-color: rgba(167, 139, 250, 0.35); background: rgba(167, 139, 250, 0.1); }
.pill.amber { color: var(--amber); border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.1); }
.pill.red { color: var(--red); border-color: rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.1); }

input, select, textarea { width: 100%; font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--violet) 60%, transparent); outline-offset: 1px; }
label { display: block; font-size: 0.8rem; color: var(--muted); margin: 10px 0 4px; }

.bar { height: 8px; border-radius: 99px; background: var(--panel-2); position: relative; overflow: hidden; }
.bar .ci { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--violet) 35%, transparent); }
.bar .pt { position: absolute; top: -2px; width: 4px; height: 12px; border-radius: 2px; background: var(--cyan); }

table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.78rem; }
.table-scroll { overflow-x: auto; }

.log { font-family: var(--mono); font-size: 0.76rem; max-height: 320px; overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.log > div { padding: 8px 10px; border-radius: 8px; background: var(--panel-2); border-left: 3px solid var(--line); word-break: break-word; }
.log > .t-prompt { border-left-color: var(--cyan); }
.log > .t-ai_response { border-left-color: var(--violet); }
.log > .t-note { border-left-color: var(--green); }
.log > .t-paste { border-left-color: var(--amber); }

.chat { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow: auto; }
.msg { padding: 10px 12px; border-radius: 10px; white-space: pre-wrap; font-size: 0.88rem; }
.msg.user { background: color-mix(in srgb, var(--cyan) 12%, var(--panel-2)); align-self: flex-end; max-width: 90%; }
.msg.assistant { background: var(--panel-2); max-width: 95%; }

section.block { padding: 72px 0; border-top: 1px solid var(--line); }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.15; margin: 0 0 18px; letter-spacing: -0.02em; }
h2 { font-size: 1.7rem; margin: 0 0 8px; letter-spacing: -0.01em; }
h3 { margin: 0 0 8px; }
.hide { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--line); padding: 10px 16px; border-radius: 10px; z-index: 50; max-width: calc(100vw - 32px); }
footer { border-top: 1px solid var(--line); padding: 32px 0; color: var(--dim); font-size: 0.85rem; }
.check { display: flex; gap: 10px; align-items: flex-start; color: var(--text); font-size: 0.86rem; margin: 8px 0; }
.check input { width: auto; margin-top: 4px; flex: none; }
