:root {
  --accent: #2e7d32;
  --rec: #c62828;
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1f2430;
  --muted: #6b7280;
  --border: #e5e7eb;
  --ok: #00897b;
  --warn: #d84315;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(0,0,0,.08);
  font-family: system-ui, "Segoe UI", Roboto, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg:#12151c; --card:#1b2029; --text:#e7eaf0; --muted:#9aa3b2; --border:#2a3140; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
.hidden { display: none !important; }
.wrap { max-width: 780px; margin: 0 auto; padding: 16px; }
h1 { font-size: 22px; margin: 6px 0 14px; }
h2 { font-size: 17px; margin: 0 0 10px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
label { display: block; font-size: 14px; color: var(--muted); margin: 8px 0 4px; }
input, select { width: 100%; padding: 12px; font-size: 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--text); }
button { font-size: 16px; padding: 13px 16px; border: 0; border-radius: 12px; color: #fff; cursor: pointer; width: 100%; margin-top: 10px; font-weight: 600; }
button:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); }
.btn-rec { background: var(--rec); }
.btn-stop { background: #455a64; }
.btn-muted { background: #6b7280; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.row:last-child { border-bottom: 0; }
.row b { text-align: right; }
.muted { color: var(--muted); font-size: 13px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; color: #fff; }
.state-big { font-size: 22px; font-weight: 800; padding: 12px 14px; border-radius: 12px; color: #fff; text-align: center; }
.rec-indicator { font-size: 18px; font-weight: 800; text-align: center; padding: 10px; border-radius: 12px; margin-top: 10px; }
.rec-on { background: var(--rec); color: #fff; }
.rec-off { background: #e0e0e0; color: #333; }
@media (prefers-color-scheme: dark){ .rec-off{ background:#2a3140; color:#cbd5e1; } }
.meter { height: 20px; background: #e0e0e0; border-radius: 8px; overflow: hidden; margin-top: 8px; }
.meter > div { height: 100%; width: 0%; background: linear-gradient(90deg,#43a047,#fbc02d,#e53935); transition: width .2s; }
.alert { padding: 12px; border-radius: 10px; margin-top: 10px; font-size: 14px; }
.alert-warn { background: #fff3e0; color: #7a3b00; border: 1px solid #ffcc80; }
.alert-err { background: #ffebee; color: #8e1616; border: 1px solid #ef9a9a; }
.alert-ok { background: #e8f5e9; color: #1b5e20; border: 1px solid #a5d6a7; }
.code-box { font-size: 30px; letter-spacing: 6px; font-weight: 800; text-align: center; padding: 14px; background: var(--bg); border-radius: 12px; margin: 8px 0; }
.steps { padding-left: 18px; line-height: 1.6; }
.linkbtn { background: none; color: var(--accent); width: auto; padding: 4px 0; font-weight: 600; text-decoration: underline; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #263238; color: #fff; padding: 12px 18px; border-radius: 10px; box-shadow: var(--shadow); opacity: 0; transition: opacity .2s; z-index: 50; max-width: 90%; }
.toast.show { opacity: 1; }
