/* The phone in Power Control shows the app's real Smart Home screen (views/v2/power-control.ejs in the MST app).
   These rules are that screen's own styles, with the class names prefixed "ap-" so they cannot touch the website's.
   The screen is laid out 360 wide, as on a phone, and scaled to fit the frame. Sample data only. */
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/unbounded-600.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/manrope-latin.woff2") format("woff2"); }
@font-face { font-family: "DM Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/dm-mono-400.woff2") format("woff2"); }
@font-face { font-family: "DM Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/dm-mono-500.woff2") format("woff2"); }

.screen.app { background: radial-gradient(300px 170px at 15% 4%, #3A2412 0%, transparent 60%), radial-gradient(260px 150px at 100% 6%, #2A1210 0%, transparent 55%), #140E0A; }
.screen.app .sb { color: #F6ECDD; }
.screen.app .sb .island { background: #000; }
.screen.app .home-ind i { background: #F6ECDD; }

.ap-view { --s: .8667; --bg0: #140E0A; --glass: rgba(255, 245, 230, .05); --glass2: rgba(255, 245, 230, .09); --line: rgba(255, 236, 214, .10); --line2: rgba(255, 236, 214, .2);
  --ink: #F6ECDD; --ink2: #B9A58C; --ink3: #7E6B57; --gold: #F5B731; --gold2: #C98A16; --amber: #E67E22; --rose: #E0533F; --mint: #5DBE8A; --red: #C0392B;
  --src: var(--gold); --src-soft: rgba(245, 183, 49, .16);
  --disp: "Unbounded", "Manrope", system-ui, sans-serif; --ui: "Manrope", system-ui, sans-serif; --mono: "DM Mono", ui-monospace, monospace;
  --ease2: cubic-bezier(.22, 1, .36, 1); --spring: cubic-bezier(.34, 1.56, .64, 1);
  position: relative; flex: 1 1 0; min-height: 0; overflow: hidden; color: var(--ink); font-family: var(--ui); font-size: 14px; line-height: 1.5; text-align: left; }
.ap-view.backup { --src: var(--amber); --src-soft: rgba(230, 126, 34, .18); }
.ap-view * { box-sizing: border-box; }
.ap-view button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.ap-view button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.ap-view h2, .ap-view h3, .ap-view h4, .ap-view p { margin: 0; }
.ap-view .num { font-variant-numeric: tabular-nums; }
.ap-view:not(.live) * { animation-play-state: paused !important; }
.ap-layer { position: absolute; left: 0; top: 0; width: 360px; height: calc(100% / var(--s)); transform-origin: 0 0; transform: scale(var(--s)); }
.ap-over { pointer-events: none; }
.ap-over > * { pointer-events: auto; }
.ap { position: relative; padding: 6px 12px 28px; transform: translateY(var(--y, 0px)); transition: transform .8s var(--ease2); }

.ap-top { display: flex; align-items: center; gap: 14px; }
.ap-dev { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); font-weight: 600; font-size: 13px; }
.ap-dev svg { width: 13px; height: 13px; }
.ap-dev small { font-family: var(--mono); font-size: 11px; font-weight: 400; color: var(--ink3); }
.ap-clock { margin-left: auto; font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em; color: var(--ink3); }
.ap-heroes { display: grid; gap: 14px; margin-top: 16px; }
.ap-panel { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: var(--glass); }

.ap-src { display: grid; grid-template-columns: 104px 1fr; gap: 14px; align-items: center; min-height: 168px; padding: 18px 20px 40px; }
.ap-orb { position: relative; width: 104px; height: 104px; }
.ap-orb .l { position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: 50%; opacity: 0; transition: opacity .9s var(--ease2); }
.ap-orb .l.g { background: conic-gradient(from 0deg, var(--gold), var(--gold2), var(--red), var(--gold)); animation: apspin 9s linear infinite; }
.ap-orb .l.b { background: conic-gradient(from 0deg, var(--amber), #D9731E, #FFC98A, var(--amber)); animation: apspin 7s linear infinite; }
.ap-orb.grid .l.g, .ap-orb.backup .l.b { opacity: 1; }
.ap-orb .halo { position: absolute; top: -16px; right: -16px; bottom: -16px; left: -16px; border-radius: 50%; filter: blur(24px); opacity: .5; transition: background .9s; }
.ap-orb.grid .halo { background: var(--gold); }
.ap-orb.backup .halo { background: var(--amber); }
.ap-orb .core { position: absolute; top: 9px; right: 9px; bottom: 9px; left: 9px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #3A2816, var(--bg0) 70%);
  font-family: var(--disp); font-weight: 600; font-size: 10.5px; letter-spacing: .08em; line-height: 1.3; text-align: center; }
.ap-orb .core small { display: block; font-family: var(--mono); font-weight: 400; font-size: 9px; color: var(--ink3); }
@keyframes apspin { to { transform: rotate(360deg); } }
.ap-src h2 { margin: 0 0 4px; font-family: var(--disp); font-size: 14px; font-weight: 600; line-height: 1.5; color: var(--ink); }
.ap-src p { font-size: 12.5px; color: var(--ink2); }
.ap-since { margin-top: 8px; font-family: var(--mono); font-size: 10px; letter-spacing: .02em; line-height: 1.5; color: var(--ink3); }
.ap-flow { position: absolute; left: 20px; right: 20px; bottom: 10px; width: calc(100% - 40px); height: 18px; pointer-events: none; }
.ap-flow path { fill: none; stroke-width: 2; stroke-linecap: round; }
.ap-flow .rail { stroke: var(--line2); }
.ap-flow .dash { stroke: var(--src); stroke-dasharray: 4 12; animation: apflow 1.1s linear infinite; transition: stroke .8s; }
@keyframes apflow { to { stroke-dashoffset: -16; } }

.ap-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-content: center; padding: 20px 18px; }
.ap-stat small { display: block; margin-bottom: 8px; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); }
.ap-stat b { display: block; font-family: var(--disp); font-weight: 600; font-size: 22px; letter-spacing: -.01em; line-height: 1; color: var(--ink); }
.ap-stat b i { margin-left: 5px; font-style: normal; font-family: var(--ui); font-weight: 600; font-size: 12px; color: var(--ink2); }
.ap-stat .sub { margin-top: 8px; font-size: 11.5px; color: var(--ink2); }
.ap-live { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px rgba(93, 190, 138, .18); animation: apbeat 1.6s infinite; }
@keyframes apbeat { 50% { box-shadow: 0 0 0 7px rgba(93, 190, 138, .06); } }

.ap-ai { padding: 18px 20px; border: 1px solid transparent; background: linear-gradient(#211510, #211510) padding-box, linear-gradient(135deg, var(--gold), var(--red), var(--amber)) border-box; }
.ap-ai h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); }
.ap-ai h3 .r { margin-left: auto; font-family: var(--ui); font-size: 12px; letter-spacing: 0; text-transform: none; color: var(--ink2); }
.ap-ai p { margin: 6px 0 10px; font-size: 12.5px; color: var(--ink2); }
.ap-st { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ap-st div { padding: 9px 10px; border-radius: 12px; background: var(--glass); }
.ap-st b { display: block; font-family: var(--disp); font-size: 16px; font-weight: 600; color: var(--ink); }
.ap-st small { font-size: 11px; color: var(--ink3); }

.ap-grid { display: grid; gap: 12px; margin-top: 14px; }
.ap-card { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: var(--glass); cursor: pointer; transition: border-color .2s, box-shadow .3s; }
.ap-card.on { box-shadow: 0 30px 60px -36px var(--src); }
.ap-card.spot { border-color: var(--src); }
.ap-card .sweep { position: absolute; top: 0; left: 0; width: 40%; height: 2px; background: linear-gradient(90deg, transparent, var(--src), transparent); opacity: 0; }
.ap-card.pending .sweep { opacity: 1; animation: apsweep 1s linear infinite; }
@keyframes apsweep { from { left: -40%; } to { left: 100%; } }
.ap-art { position: relative; display: grid; place-items: center; height: 138px; background: radial-gradient(60% 60% at 50% 70%, var(--glowc, rgba(245, 183, 49, .22)) 0%, transparent 70%); transition: background .6s; }
.ap-card.off .ap-art { --glowc: rgba(255, 255, 255, .04); }
.ap-art img { width: 104px; height: 104px; object-fit: contain; filter: drop-shadow(0 16px 18px rgba(0, 0, 0, .55)); transition: filter .4s, opacity .4s, transform .4s var(--ease2); }
.ap-card.on .ap-art img { animation: apbob 4s ease-in-out infinite; }
@keyframes apbob { 50% { transform: translateY(-5px); } }
.ap-card.off .ap-art img { filter: grayscale(.85) brightness(.7); opacity: .5; transform: scale(.94); }
.ap-art .ap-chip { position: absolute; top: 12px; left: 12px; }
.ap-sig { position: absolute; top: 13px; right: 14px; font-family: var(--mono); font-size: 10px; color: var(--ink3); }
.ap-body { display: grid; gap: 9px; padding: 4px 15px 14px; }
.ap-eyebrow { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink3); }
.ap-card h3 { margin: 2px 0 0; font-family: var(--ui); font-size: 16.5px; font-weight: 700; letter-spacing: -.01em; line-height: 1.15; color: var(--ink); }
.ap-row { display: flex; align-items: center; gap: 12px; }
.ap-w { font-family: var(--disp); font-weight: 600; font-size: 21px; letter-spacing: -.01em; line-height: 1; color: var(--ink); }
.ap-w i { margin-left: 4px; font-style: normal; font-family: var(--ui); font-size: 12px; font-weight: 600; color: var(--ink2); }
.ap-kwh { margin-top: 5px; font-size: 11.5px; color: var(--ink3); }
.ap-ring { position: relative; flex: none; width: 40px; height: 40px; margin-left: auto; border-radius: 50%; }
.ap-ring svg { display: block; transform: rotate(-90deg); }
.ap-ring circle { fill: none; stroke-width: 4; }
.ap-ring .bg { stroke: var(--glass2); }
.ap-ring .v { stroke: var(--gold); stroke-linecap: round; stroke-dasharray: 100.5; transition: stroke-dashoffset 1s var(--ease2); }
.ap-ring.warn .v { stroke: var(--amber); }
.ap-ring b { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: grid; place-items: center; font-family: var(--mono); font-size: 9.5px; font-weight: 400; color: var(--ink2); }
.ap-ring.hint { animation: aphint 1.1s var(--ease2) 3; }
@keyframes aphint { 0% { box-shadow: 0 0 0 0 rgba(245, 183, 49, .7); } 100% { box-shadow: 0 0 0 12px rgba(245, 183, 49, 0); } }
.ap-foot { display: flex; align-items: center; gap: 10px; min-height: 30px; font-size: 11.5px; color: var(--ink2); }
.ap-nx { flex: 1; display: flex; align-items: center; gap: 7px; }
.ap-nx::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--ink3); }
.ap-card.warn .ap-nx::before { background: var(--amber); }
.ap-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; line-height: 1.5; white-space: nowrap; }
.ap-chip.on { background: var(--gold); color: #1A120C; }
.ap-chip.off { background: rgba(255, 255, 255, .1); color: var(--ink2); }
.ap-chip.cut { background: var(--rose); color: #fff; }
.ap-chip.warn { background: var(--amber); color: #1A1000; }
.ap-chip.ok { background: rgba(93, 190, 138, .14); color: var(--mint); }
.ap-chip.ai { border: 1px solid var(--line); background: linear-gradient(90deg, rgba(245, 183, 49, .22), rgba(192, 57, 43, .25)); color: var(--ink); }
.ap-chip.adm { background: rgba(255, 255, 255, .08); color: var(--ink2); }
.ap-chip.pend { background: rgba(255, 255, 255, .1); color: var(--ink); animation: apblink 1s infinite; }
@keyframes apblink { 50% { opacity: .45; } }
.ap-sw { position: relative; flex: none; width: 52px; height: 30px; border-radius: 999px; background: rgba(255, 255, 255, .12); transition: background .25s; }
.ap-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .5); transition: transform .32s var(--spring), background .25s; }
.ap-sw[aria-checked="true"] { background: var(--gold); }
.ap-sw[aria-checked="true"]::after { transform: translateX(22px); background: #1A120C; }
.ap-sw.pending::before, .ap-sw.hint::before { content: ""; position: absolute; top: -6px; right: -6px; bottom: -6px; left: -6px; border: 2px solid var(--src); border-radius: 999px; animation: apring 1s ease-out infinite; }
.ap-sw.hint::before { animation-iteration-count: 3; opacity: 0; }
@keyframes apring { from { opacity: .8; transform: scale(.9); } to { opacity: 0; transform: scale(1.25); } }
.ap-sw.xl { width: 104px; height: 56px; }
.ap-sw.xl::after { top: 4px; left: 4px; width: 48px; height: 48px; }
.ap-sw.xl[aria-checked="true"]::after { transform: translateX(48px); }
.ap-sw.sm { width: 38px; height: 22px; }
.ap-sw.sm::after { width: 16px; height: 16px; }
.ap-sw.sm[aria-checked="true"]::after { transform: translateX(16px); }

/* An appliance's sheet */
.ap-scrim { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: rgba(10, 6, 4, .55); opacity: 0; pointer-events: none; transition: opacity .35s; }
.ap-scrim.show { opacity: 1; pointer-events: auto; }
.ap-sheet { position: absolute; top: 8px; right: 8px; bottom: 8px; left: 8px; display: flex; flex-direction: column; gap: 12px; padding: 18px; overflow: hidden; border: 1px solid var(--line2); border-radius: 26px;
  background: linear-gradient(180deg, #241711, #160E0A); transform: translateX(calc(100% + 20px)); visibility: hidden; transition: transform .5s var(--ease2), visibility 0s linear .5s; }
.ap-sheet.show { transform: none; visibility: visible; transition: transform .5s var(--ease2); }
.ap-view .ap-close { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 10px; background: var(--glass); font-size: 18px; line-height: 1; }
.ap-shead { display: flex; align-items: center; gap: 14px; padding-right: 40px; }
.ap-shead .art { flex: none; display: grid; place-items: center; width: 76px; height: 76px; border-radius: 20px; background: radial-gradient(60% 60% at 50% 65%, var(--src-soft), transparent 70%), var(--glass2); }
.ap-shead .art img { width: 60px; height: 60px; object-fit: contain; filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .5)); }
.ap-shead h3 { font-family: var(--ui); font-size: 20px; font-weight: 700; letter-spacing: -.01em; line-height: 1.1; color: var(--ink); }
.ap-shead .sub { margin-top: 4px; font-family: var(--mono); font-size: 10px; letter-spacing: .04em; color: var(--ink3); }
.ap-blk { padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--glass); }
.ap-blk h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); }
.ap-blk h4 .r { margin-left: auto; }
.ap-power { display: flex; align-items: center; gap: 14px; }
.ap-power .lbl { font-family: var(--disp); font-weight: 600; font-size: 14px; color: var(--ink); }
.ap-power .lbl small { display: block; margin-top: 3px; font-family: var(--ui); font-weight: 400; font-size: 12px; color: var(--ink2); }
.ap-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.ap-view .ap-pill { padding: 6px 11px; border: 1px solid var(--line2); border-radius: 999px; font-size: 12px; color: var(--ink2); transition: all .15s; }
.ap-view .ap-pill.on { border-color: var(--src); background: var(--src-soft); color: var(--ink); }
.ap-muted { font-size: 12.5px; color: var(--ink2); }
.ap-muted b { color: var(--ink); font-weight: 600; }
.ap-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--glass2); }
.ap-view .ap-tab { padding: 5px 12px; border-radius: 9px; font-family: var(--ui); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink2); }
.ap-view .ap-tab.on { background: #1F140E; }
.ap-view .ap-tab.on.g { color: var(--gold); }
.ap-view .ap-tab.on.b { color: var(--amber); }
.ap-tl { position: relative; height: 28px; margin: 12px 0 6px; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: linear-gradient(180deg, rgba(245, 183, 49, .22), rgba(245, 183, 49, .08)); }
.ap-tl.b { background: linear-gradient(180deg, rgba(230, 126, 34, .22), rgba(230, 126, 34, .08)); }
.ap-tl i { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, rgba(224, 83, 63, .75) 0 4px, rgba(224, 83, 63, .45) 4px 8px); }
.ap-tl .now { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #fff; box-shadow: 0 0 8px #fff; }
.ap-tlx { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 9.5px; color: var(--ink3); }
.ap-rules { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.ap-rule { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--glass); }
.ap-rule .t { font-size: 13px; font-weight: 600; color: var(--ink); }
.ap-rule .m { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 3px; font-size: 11.5px; color: var(--ink3); }
.ap-empty { padding: 12px; border: 1px dashed var(--line2); border-radius: 14px; font-size: 12.5px; text-align: center; color: var(--ink3); }
.ap-toast { position: absolute; left: 50%; bottom: 18px; max-width: 320px; padding: 10px 16px; border-radius: 12px; background: var(--ink); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); font-size: 13px; font-weight: 600; text-align: center; white-space: nowrap; color: var(--bg0);
  opacity: 0; transform: translateX(-50%) translateY(14px); transition: opacity .25s, transform .3s var(--spring); pointer-events: none; }
.ap-toast.show { opacity: 1; transform: translateX(-50%); }

@media (prefers-reduced-motion: reduce) {
  .ap-view *, .ap-view *::before, .ap-view *::after { animation: none !important; transition: none !important; }
}
