/* Header, navigation, tiles, cameras, dialog */
.home { position: relative; display: flex; align-items: center; gap: 10px; min-width: 0; margin-right: auto; font-size: 1.5rem; }
.home__badge { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: #dbe5ff; color: var(--blue); }
.home__badge .icon { width: 22px; height: 22px; }
.home__name { font: inherit; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.home select { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; font-size: 1rem; }
.home:focus-within { outline: 2px solid var(--blue); outline-offset: 4px; border-radius: 8px; }

.header__bell { position: relative; display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; }
.dot { position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: #c5221f; }
.avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; }

.rail a { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; }
.rail a:hover { background: rgb(31 31 31 / 0.06); }
.rail a[aria-current="page"] { background: var(--active); color: #001d35; }

.categories { display: grid; grid-template-columns: repeat(4, minmax(0, 146px)); gap: 16px; }
.category { display: flex; flex-direction: column; justify-content: space-between; min-height: 146px; padding: 16px; border-radius: 26px; }
.category .tile__text { flex: none; }
.category--cameras { background: #ecf0ff; }
.category--cameras .icon { color: var(--blue); }
.category--lighting { background: #feefc6; }
.category--lighting .icon { color: #5f4b00; }
.category--wifi { background: #e1f6e0; }
.category--wifi .icon { color: #0d652d; }
.category--climate { background: #ffede5; }
.category--climate .icon { color: #8f3a0a; }

.tile__text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; overflow-wrap: anywhere; }
.tile__name { font-weight: 500; font-size: 0.95rem; }
.tile__status { font-size: 0.82rem; }

.tile { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 86px; padding: 14px 16px; border-radius: 28px; text-align: left; }
.tile:hover, .category:hover { filter: brightness(0.97); }
.tile--plain { background: var(--neutral); }
.tile--thermostat { background: #ffdbcc; color: #8a3a10; }
.tile--lock { background: #d9e2ff; color: var(--blue); }
.tile--light {
  --level: 0%;
  background: linear-gradient(90deg, #fde084 var(--level), #feefc6 var(--level));
  color: #574500;
  touch-action: pan-y;
  user-select: none;
}
.tile--light.is-off { background: var(--neutral); color: var(--ink); }

.camera { position: relative; flex: none; height: 168px; overflow: hidden; border-radius: 26px; background: #2b2d30; color: #fff; }
.camera--tall { height: 396px; }
.camera__view { display: block; width: 100%; height: 100%; }
.camera__view img { width: 100%; height: 100%; object-fit: cover; }
.camera::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(rgb(0 0 0 / 0.35), transparent 35%, transparent 60%, rgb(0 0 0 / 0.5)); }
.camera.is-off img { visibility: hidden; }
.camera__badge, .camera__name { position: absolute; z-index: 1; left: 14px; pointer-events: none; font-size: 0.88rem; }
.camera__badge { top: 14px; display: flex; align-items: center; gap: 10px; }
.camera__badge .icon { width: 22px; height: 22px; }
.camera__name { bottom: 16px; right: 64px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.camera__toggle { position: absolute; z-index: 1; right: 12px; bottom: 12px; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: rgb(32 33 36 / 0.65); color: #fff; }

.section { margin-top: 28px; }
.section:first-child { margin-top: 0; }
.section__title { margin: 0 8px 14px; font-size: 0.95rem; font-weight: 500; }
.favorites { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; gap: 16px; }
.favorites__column { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); align-items: start; gap: 16px; }

.back { display: inline-block; margin-bottom: 18px; padding: 8px; color: var(--blue); }
.empty { padding: 0 8px; color: var(--muted); }
.rows li { display: flex; justify-content: space-between; gap: 16px; padding: 18px 20px; margin-bottom: 8px; background: var(--neutral); border-radius: 22px; }
.rows time { flex: none; color: var(--muted); font-size: 0.85rem; }

.input { flex: 1; min-width: 0; padding: 12px 18px; font-size: 1rem; border: 1px solid #c4c7c5; border-radius: 999px; background: #fff; }
.button { padding: 12px 22px; border-radius: 999px; background: var(--blue); color: #fff; font-weight: 500; }
.button--quiet { background: var(--neutral); color: var(--ink); }
.broadcast { display: flex; flex-wrap: wrap; gap: 10px; max-width: 520px; }

.dialog { margin: auto; width: min(560px, 100% - 32px); padding: 20px; border: 0; border-radius: 28px; color: var(--ink); background: var(--panel); }
.dialog::backdrop { background: rgb(0 0 0 / 0.45); }
.dialog__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.dialog__head h2 { font-size: 1.25rem; font-weight: 500; }
.dialog__head button { display: grid; place-items: center; width: 44px; height: 44px; }
.dialog__feed { width: 100%; max-height: 65dvh; object-fit: contain; border-radius: 18px; }
.stepper { display: flex; justify-content: center; align-items: center; gap: 28px; padding: 12px 0 20px; }
.stepper__value { min-width: 2ch; text-align: center; font-size: 4rem; color: #8a3a10; }
.round { width: 56px; height: 56px; border-radius: 50%; background: #ffdbcc; font-size: 1.8rem; }

.toast { position: fixed; z-index: 30; left: 50%; bottom: 100px; width: max-content; max-width: calc(100% - 32px); padding: 12px 20px; border-radius: 14px; background: #303030; color: #fff; font-size: 0.9rem; overflow-wrap: anywhere; transform: translateX(-50%); opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.toast.is-visible { opacity: 1; }
