:root {
  --bg: #f4f5f7; --panel: #fff; --text: #16181d; --muted: #6b7280; --line: #e3e5ea;
  --accent: #4f46e5; --accent-text: #fff; --danger: #dc2626; --ok: #16a34a; --soft: #eef0ff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #0f1115; --panel: #181b21; --text: #eceef2; --muted: #9aa1ad; --line: #2a2f38; --accent: #818cf8; --accent-text: #0f1115; --soft: #23264a; }
}
:root[data-theme="dark"] { --bg: #0f1115; --panel: #181b21; --text: #eceef2; --muted: #9aa1ad; --line: #2a2f38; --accent: #818cf8; --accent-text: #0f1115; --soft: #23264a; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); }
header.top { padding: 14px 24px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 10; }
header.top .brand { font-weight: 800; font-size: 17px; letter-spacing: -.2px; text-decoration: none; color: var(--text); }
header.top .spacer { flex: 1; }
header.top .who { color: var(--muted); font-size: 13px; }
@media (max-width: 600px) { header.top { padding: 12px 16px; } header.top .who { display: none; } }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-bottom: 20px; }
.panel h2 { font-size: 15px; margin: 0 0 14px; }
.panel h2 small { font-weight: 400; color: var(--muted); font-size: 12.5px; margin-left: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
.full { grid-column: 1 / -1; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
input, textarea, select { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; font-size: 14px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { resize: vertical; min-height: 64px; }
input[type=color] { padding: 2px; height: 38px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
.btn.small { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.err { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 8px; }
.ok { color: var(--ok); }
.badge { display: inline-block; font-size: 11.5px; padding: 2px 8px; border-radius: 20px; background: var(--soft); color: var(--accent); font-weight: 600; }
.linkbox { font-size: 13.5px; word-break: break-all; background: var(--bg); padding: 9px 11px; border-radius: 8px; border: 1px solid var(--line); }
.prefix-input { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg); }
.prefix-input span { padding: 9px 0 9px 11px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.prefix-input input { border: 0; padding-left: 2px; border-radius: 0; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 12px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #111; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 50; }
.toast.show { opacity: 1; }
