:root {
  color-scheme: light dark;
  --bg: #f4f5f7; --card: #fff; --fg: #1b1f24; --muted: #6a737d;
  --line: #dfe2e6; --accent: #2f7d4f; --off: #b8bec6; --bad: #c0392b;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14171a; --card: #1e2227; --fg: #e8eaed; --muted: #9aa3ad; --line: #2e343b; --accent: #4cb57a; --off: #4a525b; --bad: #e57368; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.4 system-ui, sans-serif; }
main { max-width: 720px; margin: 0 auto; padding: 16px; }
.muted { color: var(--muted); }
.err { color: var(--bad); font-size: 0.85rem; margin: 4px 0 0; }
header.bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
header.bar h1 { font-size: 1.25rem; margin: 0; flex: 1 1 auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--off); flex: none; }
.dot.on { background: var(--accent); }
.status { font-size: 0.85rem; color: var(--muted); font-weight: normal; }
button, select { font: inherit; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; }
button { cursor: pointer; }
button:disabled { opacity: 0.5; cursor: progress; }
section.room { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 16px; padding: 4px 16px; }
section.room h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 12px 0 4px; }
.dev { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.dev:first-of-type { border-top: 0; }
.dev .name { min-width: 0; overflow-wrap: anywhere; }
.dev .value { color: var(--muted); white-space: nowrap; }
.toggle { width: 52px; height: 30px; padding: 0; border-radius: 15px; position: relative; background: var(--off); border: 0; flex: none; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.toggle[aria-checked="true"] { background: var(--accent); }
.toggle[aria-checked="true"]::after { transform: translateX(22px); }
.login { text-align: center; padding-top: 20vh; }
.login h1 { margin-bottom: 24px; }
.login #gbtn { display: inline-block; min-height: 44px; }
input[type="text"], input[type="email"] { font: inherit; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; width: 100%; min-width: 0; }
.small { font-size: 0.85rem; }
.name .muted { overflow-wrap: anywhere; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.confirm { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
section.manage { padding-bottom: 12px; }
form.invite { display: flex; gap: 8px; flex-wrap: wrap; }
form.invite input { flex: 1 1 180px; }
.card { border-top: 1px solid var(--line); padding: 12px 0; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.card:first-child { border-top: 0; }
.card h3 { font-size: 1rem; margin: 0; overflow-wrap: anywhere; }
.card p { margin: 0; }
.check { display: inline-flex; align-items: center; gap: 6px; overflow-wrap: anywhere; }
fieldset.owners { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; min-width: 0; }
fieldset.owners legend { padding: 0; margin-bottom: 4px; }
button.link { background: none; border: 0; border-radius: 0; padding: 0; text-align: left; overflow-wrap: anywhere; min-width: 0; }
button.link:hover, button.link:focus-visible { text-decoration: underline; }
section.hist { padding-bottom: 12px; }
section.hist .dev { align-items: flex-start; }
section.hist .value { padding-top: 2px; }
button.more { margin-top: 8px; width: 100%; }
button.more[hidden] { display: none; }
