:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: #1c1d21;
  --muted: #61656f;
  --border: #d9dce2;
  --accent: #0a62d0;
  --accent-text: #ffffff;
  --danger: #c22f2f;
  --danger-text: #ffffff;
  --notice-bg: #e7f1ff;
  --alert-bg: #fdeaea;
  --badge-bg: #eceef2;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111214;
    --surface: #1c1d21;
    --text: #e9eaee;
    --muted: #9da1ab;
    --border: #33363d;
    --accent: #5a9bf0;
    --accent-text: #0b0c0e;
    --danger: #e36161;
    --danger-text: #0b0c0e;
    --notice-bg: #17283f;
    --alert-bg: #3a1b1b;
    --badge-bg: #2a2c32;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.5; }
a { color: var(--accent); }
h1 { font-size: 1.4rem; margin: 0 0 .5rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
code { font-family: ui-monospace, Consolas, monospace; background: var(--badge-bg); padding: .1rem .35rem; border-radius: 4px; word-break: break-all; }
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding: .75rem 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { font-weight: 700; color: var(--text); text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; }
.small-button { padding: .35rem .9rem; }
.top-action { margin: 0 0 1rem; }
.subnav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin: 0 0 .75rem; }
.subnav a[aria-current="page"] { font-weight: 700; color: var(--text); text-decoration: none; }
.wrap { max-width: 960px; margin: 0 auto; padding: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin: 0 0 1rem; }
.card.narrow { max-width: 440px; margin-left: auto; margin-right: auto; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 0; }
.form { display: flex; flex-direction: column; gap: .75rem; }
.form.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: end; }
label { display: flex; flex-direction: column; gap: .25rem; font-size: .9rem; color: var(--muted); }
input, select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: .55rem .65rem; width: 100%; min-width: 0; }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button, .button { font: inherit; display: inline-block; cursor: pointer; text-decoration: none; text-align: center; background: var(--accent); color: var(--accent-text); border: 1px solid var(--accent); border-radius: 8px; padding: .55rem 1rem; }
button.secondary, .button.secondary { background: transparent; color: var(--accent); }
button.danger { background: var(--danger); border-color: var(--danger); color: var(--danger-text); }
button.link { background: none; border: none; color: var(--accent); padding: 0; text-decoration: underline; }
form.inline { display: inline; margin: 0; }
.alert { background: var(--alert-bg); border: 1px solid var(--danger); border-radius: 8px; padding: .6rem .8rem; }
.notice { background: var(--notice-bg); border: 1px solid var(--accent); border-radius: 8px; padding: .6rem .8rem; }
.services { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .75rem; }
.svc { display: flex; flex-direction: column; gap: .2rem; padding: .9rem; border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text); background: var(--bg); }
.svc:hover { border-color: var(--accent); }
.host { font-size: .8rem; color: var(--accent); word-break: break-all; }
.checks { border: 1px solid var(--border); border-radius: 8px; padding: .5rem .75rem; margin: 0; display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.checks legend { color: var(--muted); font-size: .9rem; padding: 0 .25rem; }
label.check { flex-direction: row; align-items: center; gap: .35rem; color: var(--text); }
label.check input { width: auto; }
.user-head { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; margin-bottom: .25rem; }
.badge { font-size: .78rem; background: var(--badge-bg); color: var(--text); border-radius: 999px; padding: .1rem .55rem; }
.badge.pending { background: var(--notice-bg); }
.badge.disabled { background: var(--alert-bg); }
.status-disabled { opacity: .8; }
.row-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.row-actions form { margin: 0; }
.temp { border-color: var(--accent); }
.secret { font-size: 1.05rem; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
table.audit { border-collapse: collapse; width: 100%; font-size: .875rem; }
table.audit th, table.audit td { text-align: left; padding: .45rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
table.audit th { color: var(--muted); font-weight: 600; white-space: nowrap; }
table.audit td:first-child { white-space: nowrap; }
@media (max-width: 480px) {
  .wrap { padding: 12px 16px; }
  .card { padding: .85rem; }
  .actions .button, .row-actions button { width: 100%; }
  .row-actions form { flex: 1 1 100%; }
}
