:root {
  --bg: #0b0b0d;
  --panel: #131316;
  --panel-2: #1a1a1f;
  --line: #26262c;
  --ink: #f2f1ee;
  --ink-2: #a6a49e;
  --ink-3: #6b6962;
  --accent: #db4a33;
  --accent-2: #ef6a52;
  --ok: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--ink); padding: 9px 14px; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover:not(:disabled) { background: #232329; }
.btn:disabled { opacity: .4; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: var(--accent-2); }
.btn.danger { color: #fca5a5; }
.btn.small { padding: 6px 10px; font-size: 13px; border-radius: 8px; }

.input, select.input, textarea.input { width: 100%; background: #0f0f12; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px; outline: none; }
.input:focus { border-color: #4b4b55; }
label.field { display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink-2); white-space: nowrap; }
.pill.live { color: #fecaca; border-color: #5b2620; background: #2a1411; }
.pill.lock { color: #fde68a; border-color: #4d3b16; background: #221a0b; }

.status { display: inline-flex; align-items: center; gap: 6px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); flex: none; }
.status[data-state="connected"]::before { background: var(--ok); }
.status[data-state="failed"]::before { background: var(--bad); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1f1f25; border: 1px solid var(--line);
  padding: 12px 18px; border-radius: 12px; font-size: 14px; z-index: 100; max-width: calc(100vw - 32px); box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.toast.error { border-color: #5b2620; color: #fecaca; }

/* 비밀번호 입력 화면 */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.gate form { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: grid; gap: 14px; }
.gate h1 { font-size: 18px; margin: 0; line-height: 1.4; }
.gate p { margin: 0; color: var(--ink-2); font-size: 14px; }
.gate .err { color: #fca5a5; font-size: 13px; min-height: 1em; }
