:root {
  color-scheme: light dark;
  --bg: #0f1115; --card: #171a21; --fg: #e7e9ee; --muted: #9aa3b2;
  --line: #262b36; --accent: #4f8cff; --danger: #e5484d; --ok: #3fb950;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg);
  font: 15px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
.wrap { max-width: 980px; margin: 0 auto; padding: 28px 20px 60px; }
h1 { font-size: 22px; margin: 0 0 12px; }
h2 { font-size: 16px; margin: 0 0 12px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.error { color: var(--danger); }
.ok { color: var(--ok); }
code, .dest, .ua { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.topbar { display: flex; justify-content: space-between; align-items: baseline; }
.card { background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 18px; margin: 16px 0 26px; }
.grid { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.grid .check { flex-direction: row; align-items: center; gap: 8px; color: var(--fg); }
.grid button, form button { justify-self: start; }
input[type=url], input[type=text], input[type=password], input[type=datetime-local] {
  background: #0c0e12; color: var(--fg); border: 1px solid var(--line);
  border-radius: 7px; padding: 9px 10px; font: inherit; width: 100%; }
button { background: var(--accent); color: #fff; border: 0; border-radius: 7px;
  padding: 9px 14px; font: inherit; cursor: pointer; }
button.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
button:hover { filter: brightness(1.08); }
table { width: 100%; border-collapse: collapse; margin-top: 8px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line);
  vertical-align: top; font-size: 13px; }
th { color: var(--muted); font-weight: 600; }
td.dest { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.ua { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
tr.disabled td { opacity: .5; }
.actions { display: flex; gap: 6px; }
.actions form { margin: 0; }
.actions button { padding: 5px 9px; font-size: 12px; }
.tag { display: inline-block; background: #223; color: #bcd; border-radius: 5px;
  padding: 1px 6px; font-size: 11px; margin: 1px 2px; }
.tag.off { background: #3a2226; color: #f0a; }
.button { display: inline-block; background: var(--accent); color: #fff;
  padding: 10px 18px; border-radius: 8px; }
.dest-box { background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; padding: 12px; word-break: break-all; font-family: ui-monospace, monospace; }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }
