:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #f59e0b;
  --accent-strong: #d97706;
  --danger: #dc2626;
  --radius: 20px;
  --shadow: 0 12px 32px rgba(17,24,39,.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.app-shell { max-width: 720px; min-height: 100vh; margin: 0 auto; padding-bottom: 92px; }
.topbar { position: sticky; top: 0; z-index: 20; display:flex; justify-content:space-between; align-items:center; padding:18px 18px 14px; background:rgba(244,246,248,.94); backdrop-filter: blur(16px); border-bottom:1px solid rgba(229,231,235,.7); }
.topbar h1 { font-size: 20px; line-height: 1.15; margin: 2px 0 0; }
.eyebrow { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
#app { padding: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px; }
.hero { padding: 20px; background: linear-gradient(145deg,#111827,#273449); color: #fff; }
.hero h2 { margin: 8px 0; font-size: 28px; }
.hero p { margin: 0; color: #d1d5db; line-height: 1.45; }
.field { display: grid; gap: 7px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 700; }
.field input, .field select { width:100%; min-height:48px; border:1px solid var(--line); border-radius:14px; padding:0 14px; background:#fff; color:var(--text); }
.btn { min-height: 48px; border:0; border-radius:14px; padding:0 16px; font-weight:800; display:inline-flex; align-items:center; justify-content:center; gap:8px; }
.btn-primary { background: var(--accent); color:#111827; }
.btn-primary:hover { background: var(--accent-strong); color:#fff; }
.btn-secondary { background:#eef2f7; color:#111827; }
.btn-danger { background:#fee2e2; color:#991b1b; }
.btn-block { width:100%; }
.icon-btn { width:42px; height:42px; border-radius:14px; border:1px solid var(--line); background:#fff; font-size:22px; }
.section-title { display:flex; justify-content:space-between; align-items:end; gap:12px; margin: 8px 2px 12px; }
.section-title h2 { margin:0; font-size:22px; }
.section-title p { margin:0; color:var(--muted); font-size:13px; }
.room-row, .group-row { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.room-meta { min-width:0; }
.room-name { font-weight:900; font-size:17px; }
.room-sub { color:var(--muted); font-size:13px; margin-top:3px; }
.row-actions { display:flex; gap:8px; flex-shrink:0; }
.small-btn { min-height:38px; padding:0 12px; border:0; border-radius:12px; background:#eef2f7; font-weight:800; }
.small-btn.danger { color:#991b1b; background:#fee2e2; }
.empty { text-align:center; padding:28px 18px; color:var(--muted); }
.chips { display:flex; flex-wrap:wrap; gap:8px; }
.chip { border:1px solid var(--line); background:#fff; border-radius:999px; padding:10px 14px; font-weight:800; }
.chip.active { border-color:var(--accent); background:#fff7df; }
.slot-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(72px,1fr)); gap:10px; margin:14px 0; }
.slot { min-height:86px; border:2px dashed #cbd5e1; border-radius:16px; background:#f8fafc; padding:8px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; text-align:center; }
.slot.filled { border-style:solid; border-color:#d1d5db; background:#fff; }
.slot-icon { font-size:24px; }
.slot-name { font-size:12px; line-height:1.2; font-weight:800; }
.summary-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; margin-bottom:14px; }
.metric { background:#fff; border:1px solid var(--line); border-radius:16px; padding:14px; }
.metric strong { font-size:24px; display:block; }
.metric span { color:var(--muted); font-size:13px; }
.summary-list { display:grid; gap:10px; }
.summary-item { display:flex; justify-content:space-between; gap:14px; padding:12px 0; border-bottom:1px solid var(--line); }
.summary-item:last-child { border-bottom:0; }
.bottom-nav { position:fixed; left:50%; bottom:0; transform:translateX(-50%); width:min(720px,100%); display:grid; grid-template-columns:repeat(3,1fr); gap:8px; padding:10px 12px calc(10px + env(safe-area-inset-bottom)); background:rgba(255,255,255,.96); backdrop-filter:blur(16px); border-top:1px solid var(--line); z-index:30; }
.nav-btn { min-height:48px; border:0; border-radius:14px; background:transparent; color:var(--muted); font-weight:800; }
.nav-btn.active { background:#111827; color:#fff; }
.modal-backdrop { position:fixed; inset:0; z-index:100; background:rgba(17,24,39,.55); display:flex; align-items:flex-end; }
.modal-sheet { width:min(720px,100%); max-height:82vh; overflow:auto; margin:0 auto; background:#fff; border-radius:24px 24px 0 0; padding:18px; }
.modal-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:14px; }
.modal-header h2 { margin:4px 0 0; }
.device-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }
.device-option { min-height:86px; border:1px solid var(--line); border-radius:16px; background:#fff; padding:12px; text-align:left; }
.device-option strong { display:block; margin-top:8px; }
.device-option span { font-size:24px; }
.share-box { display:grid; gap:10px; }
.notice { background:#fff7df; border:1px solid #fde68a; border-radius:14px; padding:12px; font-size:13px; color:#854d0e; }
.readonly-badge { display:inline-flex; align-items:center; gap:6px; background:#e0f2fe; color:#075985; border-radius:999px; padding:8px 12px; font-size:12px; font-weight:800; margin-bottom:12px; }
@media (min-width: 640px) {
  #app { padding: 22px; }
  .device-grid { grid-template-columns:repeat(3,1fr); }
  .summary-grid { grid-template-columns:repeat(4,1fr); }
}
