  :root {
    --bg: #f4f5f7; --card: #ffffff; --text: #1c2026; --muted: #6b7380; --line: #e2e5ea;
    --accent: #2563eb; --ok: #16a34a; --warn: #dc2626; --meter: #d9dde3;
  }
  @media (prefers-color-scheme: dark) {
    :root {
      --bg: #14161a; --card: #1e2127; --text: #e8eaee; --muted: #949ca8; --line: #2e333b;
      --accent: #5b8def; --ok: #34c26a; --warn: #f0564f; --meter: #2e333b;
    }
  }
  * { box-sizing: border-box; }
  body { margin: 0; background: var(--bg); color: var(--text);
         font: 15px/1.45 system-ui, "Segoe UI", Roboto, sans-serif; }
  main { max-width: 860px; margin: 0 auto; padding: 16px; display: grid; gap: 14px; }
  header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
  h1 { font-size: 20px; margin: 0; }
  h2 { font-size: 15px; margin: 0 0 10px; }
  .card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
  .status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
  .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
  .dot.on { background: var(--ok); }
  .dot.noise { background: var(--warn); animation: pulse 1s infinite; }
  @keyframes pulse { 50% { opacity: .35; } }
  .row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
  .db { font-variant-numeric: tabular-nums; font-size: 28px; font-weight: 600; min-width: 110px; }
  .db small { font-size: 13px; font-weight: 400; color: var(--muted); }
  .meter { position: relative; height: 18px; background: var(--meter); border-radius: 9px; overflow: hidden; margin-top: 12px; }
  .meter .fill { height: 100%; width: 0; background: var(--ok); transition: width .1s linear; }
  .meter .fill.over { background: var(--warn); }
  .mark { position: relative; height: 0; }
  .mark i { position: absolute; top: -22px; width: 2px; height: 26px; background: var(--text); transform: translateX(-1px); }
  input[type=range] { width: 100%; margin: 10px 0 0; accent-color: var(--accent); }
  .hint { color: var(--muted); font-size: 13px; }
  button, select, input[type=number] {
    font: inherit; color: var(--text); background: var(--card);
    border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px;
  }
  button { cursor: pointer; }
  button:hover { border-color: var(--accent); }
  button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
  button.primary.on { background: var(--warn); border-color: var(--warn); }
  button.small { padding: 3px 9px; font-size: 13px; }
  .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
  label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
  label input, label select { width: 100%; }
  ul { list-style: none; margin: 0; padding: 0; }
  li { padding: 8px 0; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
  li:first-child { border-top: 0; }
  .time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; flex: none; }
  .grow { flex: 1; min-width: 150px; overflow-wrap: anywhere; }
  .scroll { max-height: 300px; overflow-y: auto; }
  audio { height: 34px; width: 260px; max-width: 100%; }
  .badge { font-size: 12px; padding: 1px 7px; border-radius: 10px; background: var(--warn); color: #fff; }
  a { color: var(--accent); }
  .empty { color: var(--muted); padding: 6px 0; }
  .login { max-width: 340px; margin: 15vh auto; display: grid; gap: 12px; }
  .login input { font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; }
  .error { color: var(--warn); }
