:root {
  color-scheme: dark;
  --bg: #0e1116;
  --surface: #161b22;
  --surface-2: #1d232c;
  --line: #262d38;
  --text: #e6edf3;
  --muted: #8b97a6;
  --accent: #4f8cff;
  --accent-soft: #1b2b4d;
  --danger: #f4536b;
  --ok: #2ecc8f;
  --radius: 14px;
  --shell: 480px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: #07090d;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard",
    "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  overscroll-behavior: none;
}

body {
  display: flex;
  justify-content: center;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
@media (min-width: 520px) {
  .shell { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: max(10px, env(safe-area-inset-top)) 14px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar h1 {
  font-size: 16px;
  margin: 0;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar .sub { font-size: 12px; color: var(--muted); }
.topbar .spacer { flex: 1; }

.scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}
.card h2 { font-size: 14px; margin: 0 0 10px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }

label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 6px; }

input, select, textarea, button {
  font: inherit;
  font-family: inherit;
}

input[type="text"], input[type="password"], input[type="number"], select, textarea {
  width: 100%;
  padding: 11px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input::placeholder { color: #5b6675; }

button {
  cursor: pointer;
  border: none;
  border-radius: 10px;
  padding: 11px 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
button:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: default; }
button.ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
button.danger { background: transparent; color: var(--danger); border: 1px solid #4a2430; }
button.tiny { padding: 7px 10px; font-size: 12px; border-radius: 8px; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }
.block { width: 100%; }

.notice {
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  margin: 10px 0 0;
  display: none;
}
.notice.show { display: block; }
.notice.error { background: #3a1c25; color: #ffb3c0; }
.notice.ok { background: #14352a; color: #9df0cd; }

.empty { color: var(--muted); text-align: center; padding: 30px 10px; font-size: 13px; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; padding: 3px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
}
.pill.live { color: var(--ok); border-color: #1d4535; }
.pill.warn { color: #ffc978; border-color: #4a3a1e; }
