:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #15171c;
  --muted: #646b78;
  --line: #e3e6eb;
  --accent: #e5322d;
  --accent-ink: #ffffff;
  --ok: #138a4a;
  --warn: #b26b00;
  --radius: 12px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --card: #181b21;
    --text: #e8eaee;
    --muted: #9aa1ad;
    --line: #2a2f38;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}

.brand { display: flex; gap: 10px; align-items: center; font-weight: 700; font-size: 18px; color: inherit; text-decoration: none; }
.logo { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); }

#account { display: flex; gap: 10px; align-items: center; }
#account img { width: 28px; height: 28px; border-radius: 50%; }

main { max-width: 960px; margin: 0 auto; padding: 24px 16px 64px; }

.hero { text-align: center; padding: 80px 0; }
.hero h1 { font-size: clamp(28px, 5vw, 42px); line-height: 1.15; margin: 0 0 16px; }
.hero p { color: var(--muted); max-width: 560px; margin: 0 auto 28px; }

.tabs { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.tabs button {
  border: 0; background: none; color: var(--muted); font: inherit; padding: 10px 14px; cursor: pointer;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.card h2, .card h3 { margin: 0 0 8px; font-size: 17px; }

.row { display: flex; gap: 10px; align-items: center; }
.between { justify-content: space-between; }
.muted, .hint { color: var(--muted); margin: 0; }
.hint { font-size: 13px; }
.error { color: var(--accent); }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid .wide { grid-column: 1 / -1; }
@media (max-width: 700px) { .grid { grid-template-columns: 1fr; } }

label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
label.check { flex-direction: row; align-items: center; color: var(--text); font-size: 15px; }

input, select, textarea {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; width: 100%;
}
input[type="checkbox"] { width: auto; }
textarea { min-height: 80px; resize: vertical; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }

.btn {
  font: inherit; font-weight: 600; border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 8px; padding: 9px 16px; cursor: pointer; text-decoration: none; display: inline-block; white-space: nowrap;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.big { padding: 14px 26px; font-size: 16px; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.danger { color: var(--accent); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
td.actions { text-align: right; white-space: nowrap; }
td.text { word-break: break-word; }
tbody tr:last-child td { border-bottom: 0; }
.empty { color: var(--muted); text-align: center; padding: 24px; }

code { font-family: ui-monospace, Menlo, monospace; font-size: 13px; background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
ul.plain { margin: 0; padding-left: 18px; }
ul.plain li { margin: 4px 0; }

.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); }
.pill.live { color: var(--ok); border-color: currentColor; }
.pill.error { color: var(--warn); border-color: currentColor; }

.switch { position: relative; width: 52px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 99px; cursor: pointer; transition: background .15s; }
.switch span::before { content: ""; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::before { transform: translateX(22px); }

.filter-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.filter-head p { margin: 2px 0 0; }

.legal { max-width: 760px; }
.legal h1 { font-size: 32px; margin: 8px 0 4px; }
.legal h2 { font-size: 20px; margin: 32px 0 8px; }
.legal h3 { font-size: 16px; margin: 20px 0 6px; }
.legal p, .legal li { line-height: 1.65; }
.legal ul { padding-left: 20px; }
.legal a, .site-footer a, .hint a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.legal-links { margin-top: 40px; color: var(--muted); }

.site-footer { text-align: center; color: var(--muted); font-size: 13px; padding: 0 16px 32px; }
.site-footer a { color: var(--muted); }

#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 8px; font-weight: 600;
}
