/*
  WolfMaster design read: ENERGY 3 / RHYTHM 2 / MOTION 1.
  Auto day/night theme: warm daylight paper for day phases, deep slate for night/lobby; one amber accent marks the primary action or selected target.
*/
:root,
[data-theme="dark"] {
  --bg: #0f1115;
  --surface: #181b22;
  --surface-2: #222631;
  --line: #333948;
  --text: #ece9e2;
  --muted: #a3a9b6;
  --accent: #e3a92c;
  --on-accent: #1a1405;
  --danger: #ef7468;
  --ok: #6fcf8e;
  --banner-bg: #2a1715;
  --banner-fg: #ffd3ce;
  --banner-ok-bg: #14241b;
  --banner-ok-fg: #cdeed9;
  --banner-warn-bg: #2b210d;
  --banner-warn-fg: #fde6b0;
}

[data-theme="light"] {
  --bg: #f6f2ea;
  --surface: #ffffff;
  --surface-2: #ece5d8;
  --line: #d4cbb9;
  --text: #1c1914;
  --muted: #5a5449;
  --accent: #d99316;
  --on-accent: #1a1203;
  --danger: #c43127;
  --ok: #1b7a40;
  --banner-bg: #fdecea;
  --banner-fg: #7a1c15;
  --banner-ok-bg: #e7f6ec;
  --banner-ok-fg: #134e29;
  --banner-warn-bg: #fef4dc;
  --banner-warn-fg: #6b4505;
}

* { box-sizing: border-box; }

html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }

.btn {
  min-height: 48px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 1rem; cursor: pointer;
}
.btn:hover:not(:disabled) { filter: brightness(1.07); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-danger { border-color: var(--danger); color: var(--danger); background: transparent; }
.btn-sm { min-height: 44px; padding: 0 12px; font-size: .9rem; }

.field {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font-size: 1rem;
}
.field::placeholder { color: #7d8493; }

.muted { color: var(--muted); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.banner { border: 1px solid var(--danger); background: var(--banner-bg); color: var(--banner-fg); border-radius: 10px; padding: 12px 14px; font-size: .95rem; }
.banner-ok { border-color: var(--ok); background: var(--banner-ok-bg); color: var(--banner-ok-fg); }
.banner-warn { border-color: var(--accent); background: var(--banner-warn-bg); color: var(--banner-warn-fg); }

.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--muted); }
.dot.on { background: var(--ok); }
.dot.wait { background: var(--accent); }
.dot.off { background: var(--danger); }

.switch {
  position: relative; width: 64px; height: 36px; border-radius: 18px; border: 1px solid var(--line);
  background: var(--surface-2); cursor: pointer; flex: none;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--muted); transition: transform .15s;
}
.switch[aria-checked="true"] { background: #1d3a29; border-color: var(--ok); }
.switch[aria-checked="true"]::after { transform: translateX(28px); background: var(--ok); }

@media (prefers-reduced-motion: reduce) {
  .switch::after { transition: none; }
}
