:root {
  --bg: #f4f6f5; --surface: #ffffff; --text: #17201c; --muted: #5d6b64; --line: #dde3e0;
  --accent: #0f7a55; --accent-text: #ffffff; --accent-soft: #e3f3ec; --danger: #b42318; --warn-soft: #fff4dc;
  --tg: #229ed9; --radius: 12px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1412; --surface: #171e1b; --text: #e6ece9; --muted: #95a39c; --line: #28322e;
    --accent: #2fb27f; --accent-text: #06120d; --accent-soft: #15301f; --danger: #f2756a; --warn-soft: #2c2614;
    --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text); min-height: 100vh; display: flex; flex-direction: column;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main { width: 100%; max-width: 1040px; margin: 0 auto; padding: 24px 16px 48px; flex: 1; }
h1 { font-size: 26px; line-height: 1.25; margin: 8px 0 16px; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 12px; font-weight: 600; }
p { margin: 0 0 12px; }
a { color: var(--accent); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; max-width: 1040px; width: 100%; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; }
.top-right { display: flex; gap: 8px; align-items: center; }
.foot { text-align: center; padding: 16px; }

button { font: inherit; cursor: pointer; border-radius: 10px; border: 1px solid transparent; padding: 9px 16px; min-height: 40px; }
button:disabled { opacity: .55; cursor: default; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.primary { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.ghost:hover { border-color: var(--muted); }
.link { background: none; border: none; color: var(--accent); padding: 4px 6px; min-height: 0; }
.danger { color: var(--danger); }
.tg { background: var(--tg); color: #fff; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.wide { width: 100%; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }

.auth { max-width: 420px; margin: 24px auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 24px; box-shadow: var(--shadow); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 20px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.tabs { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: 10px; margin-bottom: 16px; }
.tab { flex: 1; background: transparent; color: var(--muted); min-height: 34px; padding: 6px; }
.tab.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
label { display: block; margin-bottom: 12px; }
label > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
input[type=email], input[type=password] {
  width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px; min-height: 42px;
}
.hint { font-size: 13px; color: var(--muted); }
.note { background: var(--warn-soft); border-radius: 10px; padding: 10px 12px; }
.note p:last-child { margin-bottom: 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.wide-card { grid-column: 1 / -1; }
.big { font-size: 30px; font-weight: 700; margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.status { font-size: 18px; font-weight: 650; margin-bottom: 6px; }
.status.ok { color: var(--accent); }
.status.off { color: var(--danger); }
.plan { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; }
.plan b { font-size: 18px; }
.switch { display: flex; align-items: center; gap: 10px; margin: 4px 0 6px; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--accent); }
.list { list-style: none; margin: 0 0 8px; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: none; }
.list .meta { font-size: 13px; color: var(--muted); }
.amount { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.amount.plus { color: var(--accent); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; max-width: calc(100% - 32px); z-index: 10; }
.toast.err { background: var(--danger); color: #fff; }
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); max-width: 420px; width: calc(100% - 32px); padding: 20px; }
dialog::backdrop { background: rgba(0,0,0,.4); }

@media (max-width: 480px) {
  h1 { font-size: 22px; }
  .auth { padding: 22px 16px; margin: 8px auto; }
  .big { font-size: 26px; }
}
