Your home as a live 3D model in the Mac menu bar and on iPhone — lights and ACs via Smart Life, Home Assistant, Philips Hue and Apple Home.
html.mode-editor body { background: var(--bg); overflow: hidden; }
/* place-items from the panel's #app would shrink the editor where block layout honours it (Chrome, Android). */
html.mode-editor #app { padding: 0; display: block; place-items: normal; }
html.mode-editor, html.mode-editor body { user-select: none; }
.editor {
width: 100%;
height: 100%;
display: grid;
grid-template-columns: 268px minmax(0, 1fr) 340px;
grid-template-rows: 54px minmax(0, 1fr) 34px;
grid-template-areas: 'bar bar bar' 'side canvas right' 'foot foot foot';
background:
radial-gradient(70% 50% at 50% 0%, rgba(36, 60, 120, 0.35), transparent 70%),
var(--bg);
font-size: 13px;
}
.bar {
grid-area: bar;
display: flex;
align-items: center;
gap: 14px;
padding: 0 16px;
border-bottom: 1px solid var(--line);
}
.bar-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; color: #cfe0ff; }
.title-input {
flex: 1; min-width: 0; max-width: 360px;
height: 34px; padding: 0 10px; border-radius: 10px;
font: inherit; font-size: 16px; font-weight: 650; color: var(--text);
background: transparent; border: 1px solid transparent; outline: none;
transition: background 160ms, border-color 160ms;
}
.title-input:hover { background: var(--glass); }
.title-input:focus { background: var(--glass); border-color: rgba(120, 175, 255, 0.55); }
.bar-actions { display: flex; gap: 8px; }
.btn {
height: 32px; padding: 0 13px; border-radius: 10px;
display: inline-flex; align-items: center; justify-content: center; gap: 7px;
font-size: 12.5px; font-weight: 600; color: var(--muted);
background: var(--glass); border: 1px solid var(--line);
transition: background 160ms, color 160ms, transform 200ms var(--spring), opacity 160ms;
}
.btn:hover { background: var(--glass-hi); color: var(--text); }
.btn:active { transform: scale(0.96); }
.btn.primary { color: #fff; background: linear-gradient(180deg, #4f97ff, #2f7bf2); border-color: rgba(255, 255, 255, 0.22); }
.btn.primary:hover { background: linear-gradient(180deg, #62a5ff, #3a85f8); }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn.wide { width: 100%; height: 36px; margin-top: 4px; }
/* ---------- sidebar ---------- */
.side { grid-area: side; overflow-y: auto; padding: 10px 10px 16px; border-right: 1px solid var(--line); scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.14) transparent; }
.group {
display: flex; align-items: center; gap: 7px;
margin: 16px 6px 5px;
font-size: 10.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--faint);
}
.group .n { flex: 1; color: rgba(222, 230, 247, 0.22); }
.group .add {
width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; color: var(--muted);
background: var(--glass); border: 1px solid var(--line); transition: background 160ms, color 160ms;
}
.group .add:hover { background: rgba(70, 130, 255, 0.35); color: #fff; }
.row {
width: 100%; min-height: 32px; padding: 0 6px 0 10px; border-radius: 9px;
display: flex; align-items: center; gap: 7px;
text-align: left; color: var(--muted); cursor: pointer;
transition: background 120ms, color 120ms;
}
.row:hover { background: var(--glass); color: var(--text); }
.row.active { background: rgba(70, 130, 255, 0.24); color: #fff; }
.row-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 550; text-transform: capitalize; }
.row-sub { flex: none; max-width: 46%; font-size: 11px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.active .row-sub { color: rgba(255, 255, 255, 0.6); }
.row .linked { color: #6ee7a0; display: grid; }
.row .del { width: 22px; height: 22px; border-radius: 7px; display: none; place-items: center; color: var(--muted); flex: none; }
.row:hover .del { display: grid; }
.row:hover .row-sub { display: none; }
.row .del:hover { background: rgba(255, 90, 80, 0.3); color: #fff; }
.home-row, .tuya-row { height: 36px; font-weight: 600; }
.tuya-row { margin-top: 4px; }
.pill { flex: none; display: inline-flex; align-items: center; height: 19px; padding: 0 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700; color: var(--muted); background: rgba(255, 255, 255, 0.08); white-space: nowrap; }
.pill.on { color: #0b2a17; background: #6ee7a0; }
/* ---------- plan ---------- */
.canvas { grid-area: canvas; position: relative; min-width: 0; min-height: 0; }
.plan { width: 100%; height: 100%; display: block; outline: none; touch-action: none; }
.hint { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; font-size: 11.5px; color: var(--faint); pointer-events: none; }
.p-room rect { stroke: #dfe3ec; stroke-width: 0.11; cursor: move; transition: fill 160ms; }
.p-room:hover rect { filter: brightness(1.2); }
.p-room.sel rect { stroke: #6aa6ff; stroke-width: 0.14; }
.p-label, .p-dim { text-anchor: middle; pointer-events: none; font-family: -apple-system, system-ui, sans-serif; }
.p-label { font-size: 0.3px; font-weight: 650; fill: rgba(255, 255, 255, 0.86); }
.p-dim { font-size: 0.2px; fill: rgba(255, 255, 255, 0.4); }
.p-furn rect { fill: rgba(255, 255, 255, 0.07); stroke: rgba(255, 255, 255, 0.3); stroke-width: 0.025; cursor: move; }
.p-furn .front { stroke: rgba(255, 255, 255, 0.45); stroke-width: 0.05; stroke-linecap: round; fill: none; pointer-events: none; }
.p-furn:hover rect { fill: rgba(255, 255, 255, 0.14); }
.p-furn.sel rect { fill: rgba(90, 150, 255, 0.28); stroke: #6aa6ff; stroke-width: 0.05; }
.p-open { stroke-width: 0.2; stroke-linecap: butt; cursor: move; }
.p-open.door { stroke: #e9a45a; }
.p-open.open { stroke: #0a0e1a; stroke-dasharray: 0.16 0.1; }
.p-open.window { stroke: #6fb0ff; }
.p-open.sel { stroke-width: 0.3; filter: drop-shadow(0 0 0.12px #fff); }
.p-ac rect { fill: #5db2ff; stroke: #0a0e1a; stroke-width: 0.04; cursor: move; }
.p-ac .flow { stroke: #5db2ff; stroke-width: 0.04; stroke-linecap: round; opacity: 0.6; fill: none; pointer-events: none; }
.p-ac.sel rect { stroke: #fff; stroke-width: 0.07; }
.p-light { cursor: move; }
.p-light circle, .p-light rect { fill: #ffb46b; stroke: #0a0e1a; stroke-width: 0.04; }
.p-light .halo { fill: rgba(255, 180, 107, 0.16); stroke: none; }
.p-light:hover .halo { fill: rgba(255, 180, 107, 0.32); }
.p-light.linked circle:not(.halo), .p-light.linked rect { stroke: #6ee7a0; stroke-width: 0.06; }
.p-light.sel circle:not(.halo), .p-light.sel rect { stroke: #fff; stroke-width: 0.08; }
.p-light.sel .halo { fill: rgba(255, 255, 255, 0.2); }
.p-handle { fill: #6aa6ff; stroke: #fff; vector-effect: non-scaling-stroke; stroke-width: 1.5px; }
.p-handle.nw, .p-handle.se, .grab.nw, .grab.se { cursor: nwse-resize; }
.p-handle.ne, .p-handle.sw, .grab.ne, .grab.sw { cursor: nesw-resize; }
.p-handle.n, .p-handle.s, .grab.n, .grab.s { cursor: ns-resize; }
.p-handle.e, .p-handle.w, .grab.e, .grab.w { cursor: ew-resize; }
.hit.grab { fill: transparent; stroke: none; }
.p-guide { stroke: #ff6ad5; stroke-width: 1px; vector-effect: non-scaling-stroke; stroke-dasharray: 5 4; pointer-events: none; }
/* the floor under the one being edited */
.p-ghost { pointer-events: none; }
.p-ghost rect { fill: rgba(255, 255, 255, 0.025); stroke: rgba(160, 190, 255, 0.4); stroke-width: 1px; vector-effect: non-scaling-stroke; stroke-dasharray: 6 5; }
.p-ghost-label { text-anchor: middle; font: 600 0.22px -apple-system, system-ui, sans-serif; fill: rgba(160, 190, 255, 0.38); }
.p-ghost .p-ghost-stairs { fill: rgba(160, 190, 255, 0.12); stroke-dasharray: none; }
.p-ghost-step, .p-ghost-arrow { stroke: rgba(160, 190, 255, 0.5); stroke-width: 1px; vector-effect: non-scaling-stroke; fill: none; }
.p-furn.stairs rect { fill: rgba(217, 212, 203, 0.16); stroke: rgba(255, 255, 255, 0.5); }
.p-stairs-step { stroke: rgba(255, 255, 255, 0.35); stroke-width: 0.02; pointer-events: none; }
.p-stairs-arrow { stroke: #ffd38a; stroke-width: 0.05; stroke-linecap: round; stroke-linejoin: round; fill: none; pointer-events: none; }
.p-furn.stairs.sel rect { fill: rgba(90, 150, 255, 0.28); }
.plan.can-pan, .plan.can-pan * { cursor: grab !important; }
.plan.panning, .plan.panning * { cursor: grabbing !important; }
/* ---------- floors, zoom and the add bar, over the plan ---------- */
.levels {
position: absolute; left: 12px; top: 12px; z-index: 3; max-width: calc(100% - 24px);
display: flex; gap: 3px; padding: 3px; border-radius: 13px; overflow-x: auto; scrollbar-width: none;
background: rgba(16, 21, 36, 0.82); border: 1px solid var(--line);
-webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.levels::-webkit-scrollbar { display: none; }
.level-tab, .level-add {
flex: none; height: 30px; padding: 0 11px; border-radius: 10px; display: inline-flex; align-items: center; gap: 7px;
font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap;
transition: background 160ms, color 160ms, transform 200ms var(--spring);
}
.level-tab:hover, .level-add:hover { background: var(--glass-hi); color: var(--text); }
.level-tab:active, .level-add:active { transform: scale(0.95); }
.level-tab .n { font-size: 10.5px; font-weight: 700; color: var(--faint); }
.level-tab.active { color: #fff; background: rgba(70, 130, 255, 0.5); }
.level-tab.active .n { color: rgba(255, 255, 255, 0.7); }
.level-add { color: #8fbaff; padding: 0 10px; }
.zoom {
position: absolute; right: 12px; bottom: 12px; z-index: 3; display: flex; flex-direction: column; gap: 2px; padding: 3px;
border-radius: 12px; background: rgba(16, 21, 36, 0.82); border: 1px solid var(--line);
-webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.zoom button { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--muted); }
.zoom button:hover { background: var(--glass-hi); color: var(--text); }
.add-bar {
position: absolute; left: 50%; bottom: 12px; z-index: 3; transform: translateX(-50%); max-width: calc(100% - 124px);
display: flex; gap: 2px; padding: 4px; border-radius: 15px; overflow-x: auto; scrollbar-width: none;
background: rgba(16, 21, 36, 0.86); border: 1px solid var(--line); box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
-webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.add-bar::-webkit-scrollbar { display: none; }
.add-bar button {
flex: none; min-width: 56px; height: 50px; padding: 0 8px; border-radius: 11px;
display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
font-size: 10.5px; font-weight: 600; color: var(--muted);
transition: background 140ms, color 140ms, transform 200ms var(--spring);
}
.add-bar button:hover { background: rgba(70, 130, 255, 0.25); color: #fff; }
.add-bar button:active { transform: scale(0.94); }
.empty-card {
position: absolute; left: 50%; top: 50%; z-index: 3; transform: translate(-50%, -50%); width: min(340px, calc(100% - 32px));
padding: 18px; border-radius: 18px; text-align: center;
background: rgba(16, 21, 36, 0.9); border: 1px solid var(--line); box-shadow: 0 16px 40px -14px rgba(0, 0, 0, 0.7);
-webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.empty-card[hidden] { display: none; }
.empty-card b { font-size: 14px; }
.empty-card p { margin: 6px 0 14px; color: var(--muted); line-height: 1.45; }
.empty-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.level-row .icon { flex: none; color: var(--faint); }
.level-row.current .icon { color: #8fbaff; }
.level-row.current .row-name { color: var(--text); }
dl.keys { margin: 0; font-size: 12px; line-height: 1.4; }
dl.keys dt { color: var(--text); font-weight: 600; margin-top: 7px; }
dl.keys dt:first-child { margin-top: 0; }
dl.keys dd { margin: 0; color: var(--muted); }
.btn.danger { color: #ff9a90; }
.btn.danger[data-armed] { color: #fff; background: rgba(220, 60, 50, 0.7); border-color: rgba(255, 120, 110, 0.6); }
/* ---------- right column ---------- */
.right { grid-area: right; display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); }
.preview-wrap { position: relative; flex: none; height: 250px; border-bottom: 1px solid var(--line); background: #0a0e1a; }
.preview, .preview canvas { width: 100%; height: 100%; display: block; }
.preview-error { padding: 16px; font-size: 12px; color: #ffb4a8; }
.chip {
position: absolute; right: 10px; top: 10px;
height: 26px; padding: 0 10px; border-radius: 999px;
display: flex; align-items: center; gap: 6px;
font-size: 11.5px; font-weight: 600; color: var(--muted);
background: rgba(16, 21, 36, 0.8); border: 1px solid var(--line);
backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.chip:hover { color: var(--text); }
.inspector { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px 24px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.14) transparent; user-select: text; -webkit-user-select: text; }
.insp-head h2 { margin: 0; font-size: 16px; font-weight: 650; text-transform: capitalize; }
.insp-head span { display: block; margin-top: 2px; font-size: 11.5px; color: var(--faint); }
.block { margin-top: 18px; }
.block h3, .devices-list h3 { margin: 0 0 8px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--faint); }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.field { display: block; margin-bottom: 8px; min-width: 0; }
.field > span { display: block; margin: 0 0 4px 2px; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.field input:not([type='checkbox']), .field select {
width: 100%; height: 32px; padding: 0 9px; border-radius: 9px;
font: inherit; font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums;
background: rgba(0, 0, 0, 0.28); border: 1px solid var(--line); outline: none;
transition: border-color 140ms, background 140ms;
}
.field select { appearance: none; -webkit-appearance: none; padding-right: 26px; background-image: linear-gradient(45deg, transparent 50%, rgba(255,255,255,.5) 50%), linear-gradient(135deg, rgba(255,255,255,.5) 50%, transparent 50%); background-position: calc(100% - 15px) 14px, calc(100% - 10px) 14px; background-size: 5px 5px; background-repeat: no-repeat; }
.field input:focus, .field select:focus { border-color: rgba(120, 175, 255, 0.7); background: rgba(0, 0, 0, 0.4); }
.field input::placeholder { color: var(--faint); }
.checks .field { display: flex; flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 9px; margin-bottom: 6px; }
.checks .field > span { margin: 0; font-size: 13px; color: var(--text); }
.checks input { width: 16px; height: 16px; accent-color: #3d8bff; }
.note { margin: 6px 2px 0; font-size: 11.5px; line-height: 1.5; color: var(--faint); }
.note.bad { color: #ffb4a8; }
.steps { margin: 0; padding-left: 18px; font-size: 12px; line-height: 1.55; color: var(--muted); }
.steps li { margin-bottom: 6px; }
.devices-list { margin-top: 16px; }
.device { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 6px; border-radius: 11px; background: var(--glass); border: 1px solid var(--line); }
.device div { flex: 1; min-width: 0; }
.device b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.device div span { display: block; font-size: 11px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.22); }
.dot.on { background: #4ade80; box-shadow: 0 0 8px #4ade80; }
/* ---------- footer ---------- */
.foot { grid-area: foot; display: flex; align-items: center; padding: 0 16px; border-top: 1px solid var(--line); }
.status { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status .ok { color: #4ade80; }
.status .dirty { color: var(--warm); }
.status.bad { color: #ffb4a8; }
.toast {
position: fixed; left: 50%; bottom: 52px; z-index: 50;
padding: 10px 16px; border-radius: 12px;
font-size: 12.5px; font-weight: 600;
background: rgba(20, 28, 48, 0.95); border: 1px solid var(--line);
box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
opacity: 0; transform: translate(-50%, 10px); pointer-events: none;
transition: opacity 200ms, transform 300ms var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { border-color: rgba(255, 120, 110, 0.6); color: #ffd2cc; }
.qr { display: grid; place-items: center; margin: 12px 0 4px; }
.qr img { display: block; padding: 10px; border-radius: 16px; background: #fff; image-rendering: pixelated; }
.block .fields .btn { width: 100%; }
.block .device { margin-bottom: 8px; }
.advanced { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); }
.advanced summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.advanced summary:hover { color: var(--text); }
/* ---------- connections ---------- */
.svc-tile {
flex: none; width: var(--size, 34px); height: var(--size, 34px); border-radius: calc(var(--size, 34px) * 0.3);
display: grid; place-items: center; color: #fff;
background:
radial-gradient(120% 120% at 20% 10%, rgba(255, 255, 255, 0.35), transparent 55%),
var(--tint);
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 6px 16px -6px var(--tint);
}
.svc-cards { display: grid; gap: 8px; margin-top: 16px; }
.svc-card {
display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
width: 100%; padding: 12px; border-radius: 14px; text-align: left; color: var(--text); cursor: pointer;
background: var(--glass); border: 1px solid var(--line);
transition: background 160ms, border-color 160ms, transform 220ms var(--spring);
}
.svc-card:hover { background: var(--glass-hi); border-color: rgba(255, 255, 255, 0.16); }
.svc-card:active { transform: scale(0.985); }
.svc-card .svc-tile { grid-row: 1 / 3; }
.svc-card > .icon { grid-row: 1 / 3; grid-column: 3; color: var(--faint); }
.svc-text { min-width: 0; }
.svc-text b { display: block; font-size: 13.5px; font-weight: 650; }
.svc-text span { display: block; margin-top: 1px; font-size: 11.5px; line-height: 1.35; color: var(--faint); }
.svc-status {
grid-column: 2; display: flex; align-items: center; gap: 5px; margin-top: 7px;
font-size: 11px; font-weight: 650; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.svc-status.on { color: #6ee7a0; }
.svc-head { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.svc-head h2 { text-transform: none; }
.back-link {
display: inline-flex; align-items: center; gap: 2px; margin: 0 0 10px -4px; padding: 3px 8px 3px 4px; border-radius: 8px;
font-size: 12px; font-weight: 600; color: #7fb2ff; cursor: pointer;
}
.back-link:hover { background: var(--glass); }
.btn.link { display: inline-flex; align-items: center; gap: 6px; margin-top: 2px; height: 28px; background: transparent; border-color: transparent; color: #7fb2ff; padding: 0 8px; }
.btn.link:hover { background: var(--glass); color: #a8caff; }
.block .device .btn { flex: none; width: auto; height: 28px; padding: 0 12px; }
.note.busy { display: flex; align-items: center; gap: 7px; color: var(--muted); }
.note.busy .icon { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* "Press the button on the bridge" */
.press { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line); margin-bottom: 10px; }
.press b { display: block; font-size: 13px; }
.press div > span { display: block; margin-top: 2px; font-size: 11.5px; color: var(--faint); }
.press-button {
position: relative; flex: none; width: 52px; height: 52px; border-radius: 16px;
background: linear-gradient(160deg, #f4f5f8, #c9ccd6); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.12), 0 6px 18px rgba(0, 0, 0, 0.35);
}
.press-button span {
position: absolute; inset: 13px; border-radius: 50%;
background: radial-gradient(circle at 40% 35%, #ffffff, #dfe3ea 60%, #c3c8d2);
box-shadow: 0 0 0 2px rgba(60, 130, 255, 0.0);
animation: press 1.6s var(--ease) infinite;
}
@keyframes press {
0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(60, 140, 255, 0.55); }
40% { transform: scale(0.9); box-shadow: 0 0 0 3px rgba(60, 140, 255, 0.55); }
70% { box-shadow: 0 0 0 10px rgba(60, 140, 255, 0); }
}
@media (prefers-reduced-motion: reduce) {
.press-button span { animation: none; box-shadow: 0 0 0 3px rgba(60, 140, 255, 0.55); }
.note.busy .icon { animation-duration: 2.4s; }
}
/* ---------- iPhone ---------- */
html.ios.mode-editor body { background: var(--bg); }
.editor.phone {
--safe-top: var(--safe-top-preview, env(safe-area-inset-top, 0px));
--safe-bottom: var(--safe-bottom-preview, env(safe-area-inset-bottom, 0px));
--bar-h: calc(var(--safe-top) + 54px);
--tools-h: calc(var(--safe-bottom) + 62px);
--peek-h: min(40vh, 360px);
position: relative; display: block; height: 100%; overflow: hidden; font-size: 15px;
}
.p-bar {
position: absolute; left: 0; right: 0; top: 0; z-index: 5; height: var(--bar-h);
display: flex; align-items: center; gap: 4px; padding: var(--safe-top) 10px 0;
background: linear-gradient(180deg, rgba(10, 14, 26, 0.96), rgba(10, 14, 26, 0.82));
border-bottom: 1px solid var(--line);
-webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.p-bar .title-input { flex: 1; min-width: 0; max-width: none; height: 40px; font-size: 17px; text-align: center; padding: 0 6px; }
.p-icon {
flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--text);
transition: background 140ms, opacity 140ms, transform 200ms var(--spring);
}
.p-icon:active { background: var(--glass-hi); transform: scale(0.92); }
.p-icon:disabled { opacity: 0.3; }
.p-icon.danger { color: #ff8a80; }
.p-save {
flex: none; height: 36px; min-width: 66px; margin-left: 4px; padding: 0 14px; border-radius: 12px;
font-size: 15px; font-weight: 650; color: #7fb2ff; transition: background 160ms, color 160ms, transform 200ms var(--spring);
}
.p-save.primary { color: #fff; background: linear-gradient(180deg, #4f97ff, #2f7bf2); box-shadow: 0 6px 16px -6px rgba(61, 139, 255, 0.8); }
.p-save:active { transform: scale(0.94); }
.p-save:disabled { opacity: 0.4; }
.editor.phone .canvas {
position: absolute; left: 0; right: 0; top: var(--bar-h); bottom: var(--tools-h);
transition: bottom 320ms var(--ease);
}
.editor.phone[data-sheet='peek'] .canvas { bottom: calc(var(--peek-h) + var(--tools-h) - 12px); }
.editor.phone .plan { position: absolute; inset: 0; }
.editor.phone .hint { bottom: 12px; font-size: 12.5px; padding: 0 20px; transition: opacity 200ms; }
.editor.phone:not([data-sheet='closed']) .hint { opacity: 0; }
.p-preview { position: absolute; inset: 0; display: none; background: #0a0e1a; }
.canvas.show-3d .p-preview { display: block; }
.canvas.show-3d .plan, .canvas.show-3d .p-float, .canvas.show-3d .hint { visibility: hidden; }
.p-preview .chip { top: 12px; right: 12px; height: 32px; padding: 0 12px; font-size: 13px; }
.p-float {
position: absolute; right: 12px; top: 12px; width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center;
color: var(--muted); background: rgba(16, 21, 36, 0.82); border: 1px solid var(--line);
-webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.p-float:active { color: var(--text); transform: scale(0.94); }
.editor.phone .levels { right: auto; max-width: calc(100% - 76px); padding: 3px; border-radius: 14px; }
.editor.phone .level-tab, .editor.phone .level-add { height: 34px; font-size: 13.5px; border-radius: 11px; }
.editor.phone .empty-card { font-size: 14px; }
.editor.phone .empty-actions .btn { height: 40px; font-size: 14px; }
.canvas.show-3d .empty-card { visibility: hidden; }
.canvas.show-3d .levels { z-index: 4; }
.p-issue {
position: absolute; left: 12px; right: 60px; top: 60px; display: none; padding: 9px 12px; border-radius: 12px;
font-size: 13px; line-height: 1.35; color: #ffd2cc; background: rgba(80, 22, 22, 0.88); border: 1px solid rgba(255, 120, 110, 0.5);
}
.p-issue.show { display: block; }
.editor.phone .hit { fill: transparent; stroke: none; }
.editor.phone .p-hit { stroke: transparent; stroke-width: 0.6; }
.editor.phone .p-room rect, .editor.phone .p-furn rect, .editor.phone .p-light, .editor.phone .p-ac rect, .editor.phone .p-open { cursor: default; }
.editor.phone .p-room:hover rect { filter: none; }
.p-tools {
position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; height: var(--tools-h);
display: grid; grid-template-columns: repeat(4, 1fr); padding: 4px 8px var(--safe-bottom);
background: rgba(10, 14, 26, 0.94); border-top: 1px solid var(--line);
-webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
}
.p-tool { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); border-radius: 14px; }
.p-tool:active { color: var(--text); background: var(--glass); }
/* the details sheet */
.p-sheet {
position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; height: var(--peek-h);
display: flex; flex-direction: column;
background: #121828; border-top: 1px solid rgba(255, 255, 255, 0.12); border-radius: 22px 22px 0 0;
box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.55);
transition: height 320ms var(--ease), transform 320ms var(--ease), bottom 320ms var(--ease);
}
.p-sheet[data-state='peek'] { bottom: calc(var(--tools-h) - 12px); box-shadow: 0 -12px 34px rgba(0, 0, 0, 0.45); }
.p-sheet[data-state='peek'] .inspector { padding-bottom: 28px; }
.p-sheet[data-state='closed'] { transform: translateY(105%); }
.p-sheet[data-state='full'] { z-index: 7; height: calc(100% - var(--bar-h) - 6px); }
.p-sheet.dragging { transition: none; }
.p-grip { flex: none; height: 22px; display: grid; place-items: center; touch-action: none; }
.p-grip span { width: 38px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.25); }
.editor.phone .inspector { flex: 1; padding: 0 18px calc(var(--safe-bottom) + 24px); -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.editor.phone .insp-head {
position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 6px; margin: 0 -18px; padding: 0 12px 10px 18px;
background: #121828; touch-action: none;
}
.insp-titles { flex: 1; min-width: 0; }
.editor.phone .insp-head h2 { font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.editor.phone .insp-head span { font-size: 12.5px; }
.p-head-actions { display: flex; gap: 2px; }
.editor.phone .svc-head { position: static; margin: 0; padding: 0; }
.editor.phone .block { margin-top: 20px; }
.editor.phone .block h3, .editor.phone .devices-list h3 { font-size: 11.5px; margin-bottom: 10px; }
.editor.phone .field > span { font-size: 13px; margin-bottom: 6px; }
.editor.phone .field input:not([type='checkbox']), .editor.phone .field select { height: 44px; font-size: 16px; border-radius: 12px; padding: 0 12px; }
.editor.phone .field select { background-position: calc(100% - 17px) 20px, calc(100% - 12px) 20px; padding-right: 30px; }
.editor.phone .fields { gap: 10px; }
.editor.phone .checks .field { min-height: 40px; }
.editor.phone .checks .field > span { font-size: 15px; }
.editor.phone .checks input { width: 22px; height: 22px; }
.editor.phone .note { font-size: 13px; }
.editor.phone .steps { font-size: 14px; }
.editor.phone .btn { height: 44px; font-size: 15px; border-radius: 13px; padding: 0 16px; }
.editor.phone .btn.wide { height: 48px; }
.editor.phone .btn.danger { color: #ff8a80; }
.editor.phone .back-link { font-size: 15px; padding: 6px 10px 6px 4px; margin-bottom: 12px; }
.editor.phone .svc-card { padding: 14px; border-radius: 16px; }
.editor.phone .svc-text b { font-size: 15.5px; }
.editor.phone .svc-text span { font-size: 13px; }
.editor.phone .svc-status { font-size: 12.5px; }
.editor.phone .device { padding: 10px 12px; }
.editor.phone .device b { font-size: 15px; }
.editor.phone .device div span { font-size: 12.5px; }
.editor.phone .tuya-row { height: 48px; padding: 0 12px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line); font-size: 15px; }
/* list, add and confirm sheets */
.p-scrim { position: absolute; inset: 0; z-index: 7; background: rgba(0, 0, 0, 0.45); opacity: 0; pointer-events: none; transition: opacity 240ms; }
.p-scrim.open { opacity: 1; pointer-events: auto; }
.p-modal {
position: absolute; left: 0; right: 0; bottom: 0; z-index: 8; max-height: calc(100% - var(--safe-top) - 40px);
display: flex; flex-direction: column; padding: 0 0 var(--safe-bottom);
background: #141a2b; border-radius: 22px 22px 0 0; border-top: 1px solid rgba(255, 255, 255, 0.12);
transform: translateY(105%); transition: transform 340ms var(--ease); pointer-events: none;
}
.p-modal.open { transform: none; pointer-events: auto; }
.p-modal-head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 8px; }
.p-modal-head b { font-size: 17px; font-weight: 650; }
.p-text { font-size: 16px; font-weight: 600; color: #7fb2ff; padding: 6px 2px; }
.p-list { flex: 1; overflow-y: auto; padding: 0 12px 16px; border: 0; -webkit-overflow-scrolling: touch; }
.p-list .row { min-height: 46px; font-size: 15.5px; padding: 0 12px; }
.p-list .row-sub { font-size: 13px; }
.p-list .row .del { display: none !important; }
.p-list .row:hover .row-sub { display: block; }
.p-list .group { font-size: 12px; margin: 18px 8px 6px; }
.p-list .group .add { width: 30px; height: 30px; border-radius: 10px; }
.p-list .home-row, .p-list .tuya-row { height: 48px; }
.p-add-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 8px 16px 18px; }
.p-add-item {
height: 96px; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px;
font-size: 13px; font-weight: 600; color: var(--text); background: var(--glass); border: 1px solid var(--line);
transition: transform 200ms var(--spring), background 140ms;
}
.p-add-item:active { transform: scale(0.95); background: var(--glass-hi); }
.p-add-item .icon { color: var(--warm); }
.p-confirm .note { padding: 0 18px; font-size: 14px; }
.p-confirm-actions { display: grid; gap: 10px; padding: 16px 18px 18px; }
.editor.phone .toast { bottom: calc(var(--tools-h) + 14px); font-size: 14px; max-width: calc(100% - 40px); text-align: center; z-index: 9; }
.editor.phone[data-sheet='peek'] .toast { bottom: calc(var(--peek-h) + var(--tools-h)); }
/* iPhone Duo open, or any wide window: the details dock on the trailing half, beside the
plan instead of over it, and the item lists open as cards in the middle. */
@media (min-width: 720px) and (min-aspect-ratio: 23/20) {
.editor.phone {
--side-w: min(480px, max(360px, calc(50% - 20px)));
--safe-left: env(safe-area-inset-left, 0px);
--safe-right: env(safe-area-inset-right, 0px);
}
.p-bar { padding-left: max(10px, var(--safe-left)); padding-right: max(10px, var(--safe-right)); }
.editor.phone .canvas { transition: right 320ms var(--ease); }
.editor.phone[data-sheet='peek'] .canvas, .editor.phone[data-sheet='full'] .canvas { bottom: var(--tools-h); right: var(--side-w); }
.p-sheet, .p-sheet[data-state='peek'], .p-sheet[data-state='full'] {
left: auto; right: 0; top: var(--bar-h); bottom: var(--tools-h); z-index: 5; width: var(--side-w); height: auto;
border-radius: 0; border-top: 0; border-left: 1px solid var(--line); box-shadow: none;
}
.p-sheet[data-state='closed'] { transform: translateX(105%); }
.p-sheet .inspector { padding-top: 14px; padding-right: max(18px, var(--safe-right)); }
.p-grip { display: none; }
/* The status bar sits in the top trailing corner of iPhone Duo's open screen, a little
wider than its safe area: the header's buttons keep clear of it. */
.editor.phone .insp-head { padding-top: 4px; padding-right: 30px; touch-action: auto; }
.p-tools { padding-left: max(8px, var(--safe-left)); padding-right: max(8px, var(--safe-right)); }
.p-tools .p-tool { max-width: 160px; justify-self: center; width: 100%; }
.p-modal {
left: 50%; right: auto; bottom: auto; top: 50%; width: min(520px, calc(100% - 40px)); max-height: calc(100% - var(--bar-h) - 40px);
padding-bottom: 6px; border-radius: 22px; border: 1px solid rgba(255, 255, 255, 0.12);
box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
opacity: 0; pointer-events: none; transform: translate(-50%, -46%) scale(0.97);
transition: transform 300ms var(--ease), opacity 200ms ease;
}
.p-modal.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%); }
.editor.phone[data-sheet='peek'] .toast, .editor.phone[data-sheet='full'] .toast { bottom: calc(var(--tools-h) + 14px); left: calc((100% - var(--side-w)) / 2); }
}
@media (prefers-reduced-motion: reduce) {
.p-sheet, .p-modal, .editor.phone .canvas, .p-scrim { transition-duration: 1ms; }
}