:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #14181f;
  --muted: #6b7280;
  --accent: #0b6efd;
  --accent-text: #ffffff;
  --border: #e3e5e9;
  --danger: #d1213d;
  --ok: #12805c;
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f13;
    --card: #171a20;
    --text: #f2f3f5;
    --muted: #9aa1ab;
    --border: #262a32;
    --accent: #3d8bff;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.wrap {
  max-width: 420px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 28px 20px 40px;
  display: flex;
  flex-direction: column;
}

@media (min-width: 600px) {
  .wrap { max-width: 480px; padding-top: 56px; }
}

h1 { font-size: 1.3rem; margin: 0 0 4px; }
.sub { color: var(--muted); font-size: .9rem; margin: 0 0 24px; line-height: 1.4; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: .95rem;
}
.row:last-child { border-bottom: none; }
.row .k { color: var(--muted); }
.row .v { font-weight: 600; text-align: right; }

.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .85rem; }
.status.ok { color: var(--ok); }
.status.bad { color: var(--danger); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }

label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 6px; }

input[type=tel],
input[type=text] {
  width: 100%;
  font-size: 1.1rem;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  margin-bottom: 16px;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input:disabled { color: var(--muted); background: var(--border); cursor: not-allowed; }

button, .btn {
  width: 100%;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: var(--accent-text);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-block;
}
button:active, .btn:active { opacity: .85; }

.error { color: var(--danger); font-size: .85rem; margin: -8px 0 16px; }
.hint { color: var(--muted); font-size: .8rem; margin-top: 8px; line-height: 1.4; }
.attempts { font-size: .8rem; color: var(--muted); text-align: center; margin-top: 4px; }
.footer-link { text-align: center; margin-top: 20px; }
.footer-link a { color: var(--muted); font-size: .85rem; text-decoration: underline; }

.switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: .95rem;
}
.switch-row:last-child { border-bottom: none; }

.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute;
  inset: 0;
  background-color: var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background-color .2s;
}
.switch .slider::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  background-color: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  transition: transform .2s;
}
.switch input:checked + .slider { background-color: var(--ok); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--accent); outline-offset: 2px; }

.gauge-caption { text-align: center; font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.gauge-wrap { position: relative; max-width: 220px; margin: 0 auto; }
.gauge { width: 100%; display: block; }
.gauge-track, .gauge-fill { fill: none; stroke-linecap: round; }
.gauge-track { stroke: var(--border); stroke-width: 16; }
.gauge-fill { stroke: var(--accent); stroke-width: 16; transition: stroke-dashoffset .5s ease; }
.gauge-label { position: absolute; left: 0; right: 0; bottom: 2px; text-align: center; }
.gauge-value { font-size: 1.4rem; font-weight: 700; }
.gauge-total { font-size: .8rem; color: var(--muted); }
