:root {
  --bg: #f4f5f8;
  --card: #ffffff;
  --fg: #1c1f24;
  --muted: #6b7280;
  --line: #e4e6eb;
  --accent: #3b5bdb;
  --accent-soft: #e9edff;
  --red: #e03131;
  --red-soft: #ffe8e8;
  --green: #2b8a3e;
  --green-soft: #e6f6ea;
  --yellow: #e67700;
  --yellow-soft: #fff3db;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317; --card: #1a1d23; --fg: #e8eaed; --muted: #9aa0a8; --line: #2a2e36;
    --accent: #7c92ff; --accent-soft: #232a45; --red: #ff6b6b; --red-soft: #3a1f22;
    --green: #69db7c; --green-soft: #1c3324; --yellow: #ffc078; --yellow-soft: #3a2e1c;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--fg);
  font: 15px/1.6 -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.wrap { max-width: 760px; margin: 0 auto; padding: 16px 16px 60px; }
.wrap.wide { max-width: 1160px; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 8px 0 18px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.spacer { flex: 1; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.card h2 { font-size: 16px; margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: 10px; }
label.field { display: block; }
label.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 10px;
  padding: 10px 12px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { min-height: 360px; font-family: ui-monospace, Menlo, monospace; font-size: 13px; line-height: 1.55; }
.btn { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 9px 14px;
  cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; padding: 12px; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px;
  font-size: 13px; font-weight: 600; background: var(--line); }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.pill.ok { background: var(--green-soft); color: var(--green); } .pill.ok .dot { background: var(--green); }
.pill.warn { background: var(--yellow-soft); color: var(--yellow); } .pill.warn .dot { background: var(--yellow); }
.pill.bad { background: var(--red-soft); color: var(--red); } .pill.bad .dot { background: var(--red); }
.notice { border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.notice.error { background: var(--red-soft); color: var(--red); }
.notice.info { background: var(--accent-soft); color: var(--accent); }
.notice.ok { background: var(--green-soft); color: var(--green); }
.hidden { display: none !important; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.table-wrap { overflow-x: auto; }
.center-box { max-width: 400px; margin: 10vh auto 0; }
@media (max-width: 560px) { .card { padding: 16px; } }
