:root {
  --bg: #f4f2ee; --card: #ffffff; --text: #1d1d1f; --muted: #6b6b70; --line: #e4e1db;
  --accent: #e8590c; --accent-text: #fff; --ok: #2b8a3e; --warn: #c92a2a;
  --s1: #2f9e44; --s2: #f08c00; --s3: #1c7ed6; --s4: #ae3ec9;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #151517; --card: #1f1f22; --text: #f1f1f3; --muted: #9a9aa2; --line: #303035; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
main { max-width: 760px; margin: 0 auto; padding: 20px 16px 60px; }
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
h1 { font-size: 1.5rem; margin: 0; display: flex; align-items: center; gap: 10px; }
h1 .cube { width: 28px; height: 28px; border-radius: 6px; background: linear-gradient(135deg, #2f9e44, #f08c00 55%, #e03131); }
h2 { font-size: 1.05rem; margin: 0 0 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 16px; }
.status { font-size: .9rem; color: var(--muted); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: var(--muted); }
.dot.on { background: var(--ok); }
label { display: block; font-size: .85rem; color: var(--muted); margin: 10px 0 4px; }
input[type=text], input[type=url], input[type=password] { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--text); font-size: 1rem; }
input[type=range] { width: 100%; accent-color: var(--accent); }
button, .btn { appearance: none; border: 0; border-radius: 9px; padding: 9px 14px; font-size: .95rem; font-weight: 600; cursor: pointer; background: var(--line); color: var(--text); }
button.primary { background: var(--accent); color: var(--accent-text); }
button.danger { background: transparent; color: var(--warn); padding-left: 4px; padding-right: 4px; }
button:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.slot { border-top: 5px solid var(--c); }
.slot .num { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; background: var(--c); color: #fff; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem; margin-right: 8px; }
.drop { margin-top: 12px; border: 2px dashed var(--line); border-radius: 10px; padding: 14px; text-align: center; color: var(--muted); font-size: .9rem; cursor: pointer; }
.drop.over { border-color: var(--accent); color: var(--accent); }
.meta { font-size: .85rem; color: var(--muted); margin-top: 8px; min-height: 1.2em; }
audio { width: 100%; margin-top: 10px; height: 36px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: .95rem; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; }
.vals { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); }
.login { max-width: 360px; margin: 12vh auto; }
.error { color: var(--warn); font-size: .9rem; margin-top: 8px; }
