:root {
  --bg: #0d1117; --panel: #151b23; --panel2: #1c242e; --line: #273140; --text: #e6edf3; --muted: #8b98a8;
  --accent: #38bdf8; --on: #34d399; --off: #6b7685; --warn: #fbbf24; --bad: #f87171;
  font-family: "Paperlogy", "Pretendard", -apple-system, "Apple SD Gothic Neo", "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border-radius: 8px; padding: 7px 12px; border: 1px solid var(--line); background: var(--panel2); white-space: nowrap; }
button:disabled { opacity: .4; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); color: #04121c; font-weight: 600; }
button.ghost { background: transparent; }
button.warn { color: var(--warn); border-color: rgba(251,191,36,.5); background: transparent; }
button.danger { color: var(--bad); border-color: rgba(248,113,113,.5); background: transparent; }
button.sm { padding: 5px 10px; font-size: 12.5px; }
input, select { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; min-width: 0; }
a { color: var(--accent); }
.sub { color: var(--muted); font-size: 12.5px; }
.hint { color: var(--muted); font-size: 12px; }
.spacer { flex: 1; }
header { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 18px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.mark { width: 18px; height: 18px; border-radius: 5px; background: conic-gradient(var(--accent), var(--on), #a78bfa, var(--accent)); }
.tabs { display: flex; gap: 2px; }
.tabs button { border: 0; border-radius: 0; background: transparent; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; }
.tabs button.sel { color: var(--text); border-bottom-color: var(--accent); }
.me { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
main { padding: 18px; max-width: 1280px; margin: 0 auto; }
.bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.bar h2 { margin: 0; font-size: 16px; }
h3 { font-size: 13px; color: var(--muted); margin: 22px 0 8px; }
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.site { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 8px; }
.site.off { opacity: .75; }
.site-head { display: flex; align-items: center; gap: 8px; }
.site-head b { font-size: 15px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--off); flex: none; }
.dot.on { background: var(--on); box-shadow: 0 0 8px var(--on); }
.kv { display: grid; grid-template-columns: 76px 1fr; gap: 3px 8px; font-size: 12.5px; }
.kv span:nth-child(odd) { color: var(--muted); }
.site-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.badge { font-size: 11px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.badge.warn { color: var(--warn); border-color: rgba(251,191,36,.45); }
.empty { color: var(--muted); padding: 30px; text-align: center; border: 1px dashed var(--line); border-radius: 12px; }
.row-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.row-form input { flex: 1; min-width: 180px; }
.chk { display: flex; align-items: center; gap: 6px; font-size: 13px; }
table.grid { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
table.grid th, table.grid td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 13px; }
table.grid th { color: var(--muted); font-weight: 600; font-size: 12px; background: var(--panel2); }
table.grid.small td { font-size: 12px; }
table.grid td .site-checks { display: flex; flex-wrap: wrap; gap: 4px 10px; max-width: 360px; }
.dlg { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 14px; padding: 20px; width: min(560px, 94vw); }
.dlg::backdrop { background: rgba(0,0,0,.6); }
.dlg h3 { color: var(--text); font-size: 16px; margin: 0 0 10px; }
.code { font: 700 24px/1.2 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .08em; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px; text-align: center; margin: 10px 0; user-select: all; }
pre.cmd { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; white-space: pre-wrap; word-break: break-all; font-size: 12px; user-select: all; }
.dlg-bar { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
#toast { position: fixed; right: 16px; bottom: 16px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; opacity: 0; transition: opacity .2s; pointer-events: none; }
#toast.show { opacity: 1; }
/* login */
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login-card { width: min(420px, 100%); display: grid; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px; }
.login-card .brand { font-size: 18px; }
.google { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 11px; border-radius: 10px; background: #fff; color: #1f1f1f; font-weight: 600; text-decoration: none; }
.google .g { font: 700 18px/1 Arial, sans-serif; color: #4285f4; }
.msg { margin: 0; padding: 10px 12px; border-radius: 8px; font-size: 13px; }
.msg.err { background: rgba(248,113,113,.12); color: var(--bad); }
.msg.info { background: rgba(56,189,248,.1); color: var(--accent); }
@media (max-width: 640px) {
  main { padding: 10px; }
  header { padding: 8px 10px; gap: 8px; }
  .site-grid { grid-template-columns: 1fr; }
  table.grid { display: block; overflow-x: auto; }
}
.row-form input[type="checkbox"], .chk input { flex: none; min-width: 0; }

/* privacy page */
.login-card:has(.doc) { max-width: 720px; text-align: left; }
.doc-title { font-size: 20px; margin: 8px 0 4px; }
.doc h2 { font-size: 15px; margin: 18px 0 6px; }
.doc ul { margin: 0; padding-left: 20px; }
.doc li, .doc p { line-height: 1.6; font-size: 14px; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
