/* Mobile first: base rules are for a ~390 px phone; wider screens only widen containers. */

:root {
  --bg: #0E1311;
  --surface: #131915;
  --surface-2: #141B18;
  --button: #1F2924;
  --line: #2E3A33;
  --line-soft: #222B26;
  --line-strong: #3A4840;
  --text: #E7ECE5;
  --text-2: #B7C2B9;
  --muted: #8E9B91;
  --placeholder: #6F7C72;
  --green: #7BC96F;
  --green-text: #9BDB8E;
  --amber: #F2B544;
  --red: #C86B6B;
  --red-text: #F0C4C4;
  --ok-bg: #1C2E1E; --ok-line: #355A33; --ok-fg: #CFEFC7;
  --warn-bg: #1D1A12; --warn-line: #4A3A1E; --warn-fg: #E4D7B8;
  --err-bg: #2E1C1C; --err-line: #5A2E2E; --err-fg: #F0C4C4;
  --font: Inter, system-ui, sans-serif;
  --display: "Space Grotesk", Inter, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--font);
}
a { color: var(--green-text); }
a:hover { color: #C4EEBA; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }
code, .mono { font-family: var(--mono); }
input::placeholder { color: var(--placeholder); }

/* ---------- Layout ---------- */
.page {
  min-height: 100vh;
  padding: clamp(32px, 9vw, 72px) 16px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
@supports (min-height: 100dvh) { .page { min-height: 100dvh; } }
.column { width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 32px; }
.column--wide { max-width: 720px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row--between { justify-content: space-between; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand img { display: block; width: 24px; height: 24px; }
.brand__name { font-family: var(--display); font-weight: 700; font-size: 28px; letter-spacing: -0.02em; }
.brand__suffix { color: var(--muted); }
.lead { color: var(--text-2); }
.lead strong { color: var(--text); font-weight: 600; }
.small { font-size: 13px; color: var(--muted); }

/* ---------- Status ---------- */
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.status::before { content: ""; width: 8px; height: 8px; background: currentColor; }
.status--online { color: var(--green-text); }
.status--offline { color: #D9A2A2; }
.status--chip { font-size: 13px; padding: 5px 10px; }
.status--chip.status--online { background: var(--ok-bg); }
.status--chip.status--offline { background: var(--err-bg); color: var(--red-text); }

/* ---------- Address ---------- */
.address { margin: 0; border: 1px solid var(--line); background: var(--surface-2); }
.address__row { display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 16px; }
.address__row + .address__row { border-top: 1px solid var(--line); }
.address dt { font-size: 13px; color: var(--muted); width: 76px; flex: none; }
.address dd { margin: 0; flex: 1 1 auto; min-width: 0; font: 700 16px var(--mono); overflow-wrap: anywhere; }
.address__port { color: var(--amber); }

/* ---------- Cards & forms ---------- */
.card { border: 1px solid var(--line); background: var(--surface); }
.card--pad { padding: clamp(20px, 5vw, 28px); display: flex; flex-direction: column; gap: 20px; }
.card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card__head h2 { font-size: 20px; }
.card__note { padding: 12px 20px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); }
.card__note--warn { color: var(--warn-fg); }

.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 14px; font-weight: 600; }
.input {
  font: 500 16px var(--font);
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  padding: 12px 14px;
  min-height: 48px;
  width: 100%;
  border-radius: 0;
}
.input--code { font-family: var(--mono); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.input:focus-visible, .button:focus-visible, .check input:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.field__error { font-size: 13px; color: var(--err-fg); }
.check { display: flex; gap: 12px; align-items: flex-start; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--green); flex: none; }
.check label { font-size: 14px; line-height: 1.55; color: var(--text-2); }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  font: 500 14px var(--font);
  padding: 0 14px;
  min-height: 44px;
  cursor: pointer;
  text-decoration: none;
  border-radius: 0;
}
.button--copy { border: 0; background: var(--button); font-weight: 600; min-width: 84px; }
.button--primary { border: 0; background: var(--green); color: var(--bg); font-weight: 600; font-size: 16px; min-height: 50px; padding: 0 20px; }
.button--primary:hover { color: var(--bg); background: #8BD47F; }
.button--danger { border-color: #6A3A3A; color: var(--red-text); }
.button--danger-solid { border: 0; background: var(--red); color: var(--bg); font-weight: 600; }
.button:disabled { opacity: .38; cursor: not-allowed; }

.notice { padding: 12px 14px; font-size: 14px; line-height: 1.55; border: 1px solid; }
.notice--ok { color: var(--ok-fg); background: var(--ok-bg); border-color: var(--ok-line); }
.notice--warn { color: var(--warn-fg); background: var(--warn-bg); border-color: var(--warn-line); }
.notice--error { color: var(--err-fg); background: var(--err-bg); border-color: var(--err-line); }

.footer { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; }
.footer a { color: var(--muted); display: inline-block; padding: 6px 0; }

/* ---------- Legal pages ---------- */
.prose { color: var(--text-2); line-height: 1.65; }
.prose h1 { color: var(--text); font-size: 28px; margin-bottom: 4px; }
.prose h2 { color: var(--text); font-size: 19px; margin: 28px 0 8px; }
.prose p, .prose ul, .prose ol { margin: 0 0 12px; }
.prose ul, .prose ol { padding-left: 20px; }
.prose li { margin-bottom: 8px; }
.prose strong { color: var(--text); font-weight: 600; }

/* ---------- Admin ---------- */
.topbar { border-bottom: 1px solid var(--line-soft); }
.topbar__inner { max-width: 1160px; margin: 0 auto; padding: 12px 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.topbar .brand img { width: 22px; height: 22px; }
.topbar .brand__name { font-size: 19px; }
.admin { max-width: 1160px; margin: 0 auto; padding: clamp(16px, 4vw, 32px) clamp(12px, 3vw, 24px) 64px; display: flex; flex-direction: column; gap: 24px; }
.stats { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats > div { padding: 14px 20px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.stats dt { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.stats dd { margin: 0; font: 700 18px var(--mono); }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 20px; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.list__main { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.list__title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.list__meta { font-size: 13px; color: var(--muted); }
.list__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.list__actions form { margin: 0; }
.badge { font: 700 11px var(--mono); color: var(--bg); background: var(--amber); padding: 2px 6px; }
.online-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--green-text); }
.online-dot::before { content: ""; width: 7px; height: 7px; background: var(--green); }
.state--active { color: #D3DBD1; }
.state--pending { color: var(--amber); }
.state--banned, .state--rejected { color: #F0A8A8; }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.inline-form .field { flex: 1 1 140px; }
.inline-form .input { min-height: 44px; padding: 0 12px; color-scheme: dark; }
.log { list-style: none; margin: 0; padding: 8px 0; }
.log li { display: flex; gap: 14px; padding: 8px 20px; font-size: 14px; }
.log time { font: 12px var(--mono); color: var(--muted); width: 92px; flex: none; padding-top: 2px; }
.two-col { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.two-col > * { flex: 1 1 340px; min-width: 0; }
details.confirm > summary { list-style: none; }
details.confirm > summary::-webkit-details-marker { display: none; }
.confirm__body { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; padding-top: 8px; }
.confirm__body .input { min-height: 44px; padding: 0 12px; flex: 1 1 180px; }

@media (min-width: 720px) {
  .stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .card__head, .card__note, .list > li, .inline-form, .log li { padding-left: 24px; padding-right: 24px; }
  .stats > div { padding: 18px 24px; }
}
