/* TV home, tvOS style. Designed at 1920x1080; 1rem = 16px at that width, so it scales with the
   TV's real CSS viewport (this TV's WebView reports 960x540 at 2x).
   Apple's tvOS numbers: safe area 60 top and bottom, 80 at the sides; 40 between tiles;
   text 29 by default and never under 23. */

@font-face {
  font-family: "Inter"; font-weight: 100 900; font-display: block;
  src: url(fonts/inter-latin-wght-normal.woff2) format("woff2");
}

:root {
  --bg: #0b0b0e;
  --bg-2: #060608;
  --text: #f5f5f7;
  --text-2: rgba(245, 245, 247, 0.62);
  --text-3: rgba(245, 245, 247, 0.42);
  --tile: #1c1c21;
  --warn: #ff9f8a;

  --safe-x: 5rem;        /* 80 */
  --safe-y: 3.75rem;     /* 60 */
  --gap: 2.5rem;         /* 40 */

  --shelf-w: 20rem;      /* 320: Apple's five-column width */
  --shelf-h: 11.25rem;   /* 16:9 */
  --app-w: 11.5rem;      /* 184: Apple's eight-column width */
  --app-h: 6.5rem;       /* 16:9, the shape of an Android TV banner */
  --app-row-gap: 3.5rem;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; }
html { font-size: calc(100vw / 120); background: var(--bg); color: var(--text); }
body {
  width: 100vw; height: 100vh; overflow: hidden;
  background: var(--bg);
  font-family: "Inter", system-ui, sans-serif; font-weight: 450;
  -webkit-font-smoothing: antialiased; letter-spacing: -0.005em;
  cursor: none; user-select: none; -webkit-user-select: none;
}

/* ---------- the photo: full screen, drifting slowly, one place at a time ---------- */
.bg { position: fixed; top: 0; right: 0; bottom: 0; left: 0; overflow: hidden; background: var(--bg); }
.bg img {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 1600ms ease-in-out;
}
.bg img.on { opacity: 1; animation: drift 70s ease-in-out infinite alternate; }
.bg img.show { animation: none; }
@keyframes drift { from { transform: scale(1.02) translate(0, 0); } to { transform: scale(1.1) translate(-1.5%, -1%); } }
.night .bg img { filter: brightness(0.72); }
/* darker at the top for the clock, much darker at the bottom for the apps */
.scrim {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 26%),
    linear-gradient(180deg, rgba(0, 0, 0, 0) 32%, rgba(0, 0, 0, 0.5) 55%, rgba(0, 0, 0, 0.86) 100%);
}

/* ---------- clock, and the focused show's title ---------- */
.top {
  position: fixed; top: var(--safe-y); left: var(--safe-x); right: var(--safe-x); z-index: 2;
  display: flex; justify-content: space-between; align-items: flex-start;
  text-shadow: 0 0.125rem 1.5rem rgba(0, 0, 0, 0.35);
}
.clock { text-align: right; }
.time { font-size: 7rem; line-height: 7rem; font-weight: 250; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
.time small { font-size: 2.25rem; font-weight: 400; letter-spacing: 0; margin-left: 0.5rem; }
.date { margin-top: 0.75rem; font-size: 1.875rem; line-height: 2.25rem; font-weight: 550; }
.place { margin-top: 0.625rem; font-size: 1.4375rem; line-height: 1.875rem; color: rgba(255, 255, 255, 0.66); }
/* quick buttons under the clock, like Apple TV's Control Centre */
.quick { position: relative; display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.25rem; text-shadow: none; }
.qbtns { display: flex; gap: 0.75rem; justify-content: flex-end; }
.quick.none { display: none; }
.qbtn {
  display: flex; align-items: center; gap: 0.625rem; padding: 0.5rem 1.25rem 0.5rem 1rem; border-radius: 2rem;
  font-size: 1.4375rem; line-height: 2rem; font-weight: 600; color: #fff;
  background: rgba(16, 16, 20, 0.46); -webkit-backdrop-filter: blur(1.25rem); backdrop-filter: blur(1.25rem);
  transition: background 200ms var(--ease), color 200ms var(--ease), transform 200ms var(--ease);
}
.qbtn svg { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.qbtn svg .fill { fill: currentColor; stroke: none; }
.qbtn.set { background: rgba(16, 16, 20, 0.66); box-shadow: inset 0 0 0 0.125rem rgba(255, 255, 255, 0.5); }
.qbtn.off { color: rgba(255, 255, 255, 0.55); }
.qbtn.focus { background: #fff; color: #111; transform: scale(1.08); box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.35); }
.sleep-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 0.75rem); gap: 0.5rem; padding: 0.5rem;
  border-radius: 2rem; background: rgba(28, 28, 32, 0.72); -webkit-backdrop-filter: blur(1.5rem); backdrop-filter: blur(1.5rem);
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.45); text-shadow: none;
}
.sleep-menu.on { display: flex; }
.sleep-menu .opt { white-space: nowrap; padding: 0 1.25rem; border-radius: 1.5rem; font-size: 1.4375rem; line-height: 2.75rem; font-weight: 600; color: rgba(255, 255, 255, 0.85); transition: transform 200ms var(--ease); }
.sleep-menu .opt.focus { background: #fff; color: #111; transform: scale(1.08); }
.quick-note { margin-top: 0.5rem; font-size: 1.4375rem; color: var(--warn); min-height: 1.875rem; }

.hero { max-width: 62rem; opacity: 0; transform: translateY(0.5rem); transition: opacity 400ms var(--ease), transform 400ms var(--ease); }
.hero.on { opacity: 1; transform: none; }
.hero h1 { font-size: 3.75rem; line-height: 4.25rem; font-weight: 700; letter-spacing: -0.025em; }
.hero p { margin-top: 0.75rem; font-size: 1.8125rem; line-height: 2.25rem; color: rgba(255, 255, 255, 0.8); }

.home { position: relative; z-index: 1; height: 100vh; }

/* ---------- Keep watching ---------- */
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; height: 2.25rem; margin-bottom: 1.25rem; }
.shelf-head h2 { font-size: 1.875rem; line-height: 2.25rem; font-weight: 620; color: rgba(255, 255, 255, 0.82); letter-spacing: -0.01em; text-shadow: 0 0.125rem 1rem rgba(0, 0, 0, 0.4); }
.status { font-size: 1.4375rem; color: var(--warn); }
/* whose shows: one tab per person, like Apple TV's tab bar */
.shelf-head { justify-content: flex-start; gap: 1.5rem; align-items: center; height: 3rem; }
/* top left, the show title sits under it */
.top-left { display: flex; flex-direction: column; align-items: flex-start; gap: 1.5rem; }
.people.empty, .people.none { display: none; }
.people { display: flex; width: max-content; text-shadow: none; gap: 0.5rem; padding: 0.375rem; border-radius: 2rem; background: rgba(255, 255, 255, 0.12); }
.person {
  font-size: 1.4375rem; line-height: 2.25rem; font-weight: 600; padding: 0 1.25rem; border-radius: 1.5rem;
  color: rgba(255, 255, 255, 0.78); transition: background 200ms var(--ease), color 200ms var(--ease), transform 200ms var(--ease);
}
.person.on { background: #fff; color: #111; }
.person.focus { transform: scale(1.08); box-shadow: 0 0 0 0.1875rem #fff, 0 0.5rem 1.25rem rgba(0, 0, 0, 0.35); }
.person.focus:not(.on) { background: rgba(255, 255, 255, 0.16); color: #fff; }
.shelf-none { font-size: 1.8125rem; line-height: var(--shelf-h); color: rgba(255, 255, 255, 0.7); text-shadow: 0 0.125rem 1rem rgba(0, 0, 0, 0.4); }
.shelf-head .status { margin-left: auto; padding-right: var(--safe-x); }

.shelf { position: absolute; left: var(--safe-x); right: 0; top: 19.25rem; }
.shelf.empty { display: none; }
.shelf-head { padding-right: var(--safe-x); }
.shelf-track { display: flex; gap: var(--gap); transition: transform 280ms var(--ease); }
.shelf-empty {
  max-width: 44rem; padding-top: 0.5rem;
  font-size: 1.8125rem; line-height: 2.5rem; color: var(--text-3); font-weight: 450;
}

/* ---------- tiles and the tvOS focus effect ---------- */
.tile { position: relative; flex: none; transition: transform 240ms var(--ease); }
.face {
  position: relative; width: 100%; height: 100%; overflow: hidden; background: var(--tile);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.35);
  transition: box-shadow 240ms var(--ease);
}
.face img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* the light that slides across a focused tile */
.face::after {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; opacity: 0; pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0) 35%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0) 65%);
  background-size: 250% 100%; background-position: 100% 0;
  transition: opacity 240ms var(--ease);
}
.tile.focus { z-index: 2; }
.tile.focus .face {
  box-shadow: 0 1.75rem 3rem rgba(0, 0, 0, 0.6), 0 0 0 0.0625rem rgba(255, 255, 255, 0.12);
  animation: sway 6s ease-in-out infinite alternate;
}
.tile.focus .face::after { opacity: 1; animation: glint 6s ease-in-out infinite alternate; }
@keyframes sway {
  from { transform: perspective(60rem) rotateX(1.2deg) rotateY(-1.8deg); }
  to { transform: perspective(60rem) rotateX(-1.2deg) rotateY(1.8deg); }
}
@keyframes glint { from { background-position: 100% 0; } to { background-position: 0% 0; } }

/* Keep watching tile */
.show { width: var(--shelf-w); height: var(--shelf-h); }
.show .face { border-radius: 0.875rem; }
.show.focus { transform: scale(1.07); }
.show .badge {
  position: absolute; left: 1rem; bottom: 1.25rem; width: 3rem; height: 3rem; border-radius: 0.75rem;
  overflow: hidden; box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.45);
}
.show .badge img { width: 100%; height: 100%; object-fit: cover; }
.show .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 0.375rem; background: rgba(0, 0, 0, 0.45); }
.show .bar i { display: block; height: 100%; background: var(--text); }
.show .no-art {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; align-items: center; justify-content: center; padding: 1.5rem;
  font-size: 2.25rem; font-weight: 650; text-align: center; color: var(--text-2);
}
.caption {
  position: absolute; left: 0; right: 0; top: calc(100% + 1.25rem); opacity: 0;
  transition: opacity 200ms var(--ease); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* the focused show's title is shown large at the top instead */
.show .caption { display: none; }
.caption b { display: block; font-size: 1.8125rem; line-height: 2.25rem; font-weight: 620; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.caption span { display: block; font-size: 1.4375rem; line-height: 1.875rem; color: var(--text-2); }

/* ---------- apps ---------- */
.apps { position: absolute; left: var(--safe-x); right: var(--safe-x); top: 37.5rem; }
.grid {
  display: grid; grid-template-columns: repeat(8, var(--app-w)); grid-auto-rows: var(--app-h);
  column-gap: var(--gap); row-gap: var(--app-row-gap);
}
.app { width: var(--app-w); height: var(--app-h); }
.app .face { border-radius: 0.625rem; }
.app.focus { transform: scale(1.16); }
.app .label {
  position: absolute; left: -2rem; right: -2rem; top: calc(100% + 0.625rem); text-align: center;
  font-size: 1.25rem; line-height: 1.5rem; font-weight: 600; color: var(--text); opacity: 0;
  transition: opacity 200ms var(--ease); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app.focus .label { opacity: 1; }
/* apps without a TV banner: their icon on a soft tile */
.app .face.icon { display: flex; align-items: center; justify-content: center; }
.app .face.icon img { width: 3.75rem; height: 3.75rem; border-radius: 0.875rem; object-fit: cover; }
.app .face.word { display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 650; color: #fff; padding: 0 1rem; text-align: center; }
/* the house's own tiles: computer screen, settings */
.app .face.tool {
  background: linear-gradient(160deg, #2c2c33 0%, #1a1a1f 100%);
  display: flex; align-items: center; justify-content: center;
}
.app .face.tool svg { width: 2.75rem; height: 2.75rem; stroke: var(--text); stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.app.busy .face { animation: none; opacity: 0.6; }

@media (prefers-reduced-motion: reduce) {
  .tile.focus .face, .tile.focus .face::after { animation: none; }
  .tile, .shelf-track, .bg img, .hero { transition: none; }
  .bg img.on { animation: none; }
}

/* ================= Night: the living room's lock screen look =================
   Only applies with html.theme-night. 
   Layers: photo, glass clock, the peak cut out of the photo, scrim, then everything else. */
@font-face {
  font-family: "Antonio"; font-weight: 300; font-display: block;
  src: url(fonts/antonio-latin-300.woff2) format("woff2");
}
/* Five scenes take turns every 20 s. Each scene is its own photo, glass
   clock and cut-out; only the one showing and the one coming next are drawn (.ready), to save memory. */
.scenes { display: none; }
.theme-night .scenes { display: block; position: fixed; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; }
.theme-night .bg { display: none; }
.scene { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: none; opacity: 0; transition: opacity 1600ms ease-in-out; }
.scene.ready { display: block; }
.scene.on { opacity: 1; }
.scene .sbg, .scene .fg { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.scene .shade { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
.gclock {
  position: absolute; left: 0; right: 0; top: 9.375rem; text-align: center; white-space: nowrap;
  font-family: "Antonio", "Arial Narrow", sans-serif; font-weight: 300; font-size: 25rem; line-height: 0.82; letter-spacing: -0.02em;
  filter: drop-shadow(0 0.375rem 1.75rem rgba(0, 0, 0, 0.16));
}
.gclock .fill {
  display: block; padding: 0.2em 0; margin: -0.2em 0; color: transparent;
  -webkit-background-clip: text; background-clip: text; background-size: 100vw 100vh; background-repeat: no-repeat;
}
.gclock .rim { position: absolute; top: 0; right: 0; bottom: 0; left: 0; color: rgba(255, 255, 255, 0.1); -webkit-text-stroke: 0.09rem rgba(255, 255, 255, 0.55); }
.gclock .sheen {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; color: transparent; -webkit-background-clip: text; background-clip: text;
  background-image: linear-gradient(160deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, 0) 70%, rgba(255, 255, 255, 0.22) 100%);
}
/* after 9 pm everything dims a little */
.night .scene .sbg, .night .scene .fg, .night .scene .gclock { filter: brightness(0.72); }
.theme-night .scrim { background: linear-gradient(180deg, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.5) 100%); }

/* 4 Night: the clock behind the peak, pink glass */
.s-night .sbg, .s-night .fg { filter: brightness(0.86); }
.s-night .gclock .fill { filter: brightness(1.15) saturate(1.2); opacity: 0.9; }
.s-night .gclock .rim { color: rgba(255, 200, 215, 0.06); -webkit-text-stroke-color: rgba(255, 215, 225, 0.5); }
/* 1 Golden hour: a little smaller, low enough for the volcano's tip to rise into the digits */
.s-golden .gclock { top: 9.5rem; font-size: 24.375rem; }
/* 2 Waterline: the clock sits on the water (app.js water: the underside of the surface); the part
   under it is blurred like a reflection */
.s-water .shade { background: linear-gradient(180deg, rgba(0, 12, 24, 0.42) 0%, rgba(0, 12, 24, 0.12) 40%, rgba(0, 0, 0, 0) 52%, rgba(0, 20, 40, 0.5) 100%); }
.s-water .gclock { top: 16.75rem; font-size: 26.25rem; filter: drop-shadow(0 0.5rem 1.875rem rgba(0, 20, 40, 0.35)); }
.s-water .gclock.under { filter: blur(0.1375rem); opacity: 0.78; transform: translateX(0.3125rem); }
.s-water .gclock.under .fill { filter: hue-rotate(-8deg) saturate(1.4); }
.s-water .gclock.under .rim { -webkit-text-stroke-color: rgba(170, 240, 255, 0.5); }
/* 3 Fog: a big dark clock on the left, sinking into the misty hills */
.s-fog .gclock { left: 6rem; right: auto; top: 10.75rem; font-size: 29.375rem; text-align: left; filter: none; }
.s-fog .gclock .fill { filter: brightness(0.46) saturate(0.8) contrast(1.1); opacity: 0.8; }
.s-fog .gclock .rim { color: transparent; -webkit-text-stroke-color: rgba(255, 255, 255, 0.6); }
.s-fog .gclock .sheen { display: none; }
/* 5 Rainforest dawn: warm light at the top, the clock low enough for the ridges to cross it */
.s-dawn .shade { background: linear-gradient(180deg, rgba(50, 28, 12, 0.42) 0%, rgba(50, 28, 12, 0) 55%); }
.s-dawn .gclock { top: 14.375rem; filter: drop-shadow(0 0.5rem 2.125rem rgba(60, 30, 10, 0.3)); }

/* glass, as on the lock screen */
.theme-night .people, .theme-night .qbtn, .theme-night .grid, .theme-night .ncard {
  background: rgba(30, 20, 28, 0.32); -webkit-backdrop-filter: blur(1.75rem) saturate(170%); backdrop-filter: blur(1.75rem) saturate(170%);
  box-shadow: inset 0 0 0 0.0625rem rgba(255, 210, 220, 0.16), inset 0 0.0625rem 0 rgba(255, 220, 230, 0.14), 0 1.5rem 3.75rem rgba(0, 0, 0, 0.28);
}
.theme-night .hero, .theme-night .time, .theme-night .place { display: none; }
.theme-night .date {
  position: fixed; left: 0; right: 0; top: 6rem; margin: 0; text-align: center;
  font-size: 2.125rem; line-height: 2.5rem; font-weight: 500; color: #fff;
  text-shadow: 0 0.125rem 1.125rem rgba(0, 0, 0, 0.25); transition: opacity 600ms ease-in-out;
}
.theme-night .date .wx { color: rgba(255, 255, 255, 0.78); font-weight: 400; }
.theme-night .date { white-space: nowrap; }
/* fitDate() in app.js: not enough room between the people switch and the quick buttons */
.theme-night .date.tight .ww, .theme-night .date.tighter .wx { display: none; }
/* the date sits just above each scene's clock; it fades out while the scenes swap */
.theme-night .date.swap { opacity: 0; }
.scene-night .date { color: rgba(255, 232, 238, 0.92); }
.scene-night .date .wx { color: rgba(255, 232, 238, 0.78); }
.scene-golden .date { top: 6.625rem; }
.scene-water .date { top: 13.5rem; }
.scene-dawn .date { top: 11rem; }
.scene-fog .date { left: 6.5rem; right: auto; top: 7.25rem; text-align: left; color: #16201d; text-shadow: none; }
.scene-fog .date .wx { color: rgba(22, 32, 29, 0.72); }
.theme-night .date svg { width: 1.875rem; height: 1.875rem; vertical-align: -0.3rem; margin: 0 0.4rem 0 1rem;
  fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme-night .quick { margin-top: 0; }
/* the saved copy, computer off: app.js leaves out the quick buttons that need the bridge */
/* sleep timer: a round glass button; its label shows only while a timer runs */
.theme-night .qbtn { min-width: 5.5rem; height: 5.5rem; justify-content: center; padding: 0 1.75rem; border-radius: 2.75rem; }
.theme-night .qbtn svg { width: 2.25rem; height: 2.25rem; }
.theme-night .qbtn span { display: none; }
.theme-night .qbtn.set span { display: inline; }
/* the picture button always says which mode the TV is in */
.theme-night #q-picture span { display: inline; }
.theme-night .qbtn.focus { background: #fff; color: #111; }

/* Keep watching: three glass cards */
.theme-night .shelf { top: 40rem; left: var(--safe-x); right: var(--safe-x); }
.theme-night .shelf-head { height: 2.25rem; margin-bottom: 1rem; }
.theme-night .shelf-head h2 { font-size: 1.5625rem; font-weight: 600; color: rgba(255, 255, 255, 0.78); }
.theme-night .shelf-track { gap: 1.375rem; }
.ncard { display: flex; align-items: center; gap: 1.25rem; width: 32.5rem; padding: 1rem; border-radius: 1.875rem; transition: transform 240ms var(--ease), box-shadow 240ms var(--ease); }
.ncard .thumb { width: 10.5rem; height: 5.9375rem; flex: none; border-radius: 1rem; object-fit: cover; background: rgba(255, 255, 255, 0.08); }
.ncard .t { min-width: 0; flex: 1; }
.ncard .nap { display: flex; align-items: center; gap: 0.625rem; font-size: 1.1875rem; line-height: 1.5rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255, 255, 255, 0.58); white-space: nowrap; overflow: hidden; }
.ncard .nap img { width: 1.625rem; height: 1.625rem; border-radius: 0.4375rem; object-fit: cover; }
.ncard b { display: block; margin-top: 0.375rem; font-size: 1.8125rem; line-height: 2.25rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ncard i { display: block; font-style: normal; font-size: 1.3125rem; line-height: 1.75rem; color: rgba(255, 255, 255, 0.78); }
.ncard .nbar { display: block; height: 0.3125rem; margin-top: 0.625rem; border-radius: 0.2rem; background: rgba(255, 255, 255, 0.25); overflow: hidden; }
.ncard .nbar i { height: 100%; background: #fff; }
.ncard.focus { transform: scale(1.05); box-shadow: 0 0 0 0.1875rem #fff, 0 1.25rem 2.5rem rgba(0, 0, 0, 0.45); }

/* the dock */
.theme-night .apps { top: auto; bottom: 2.875rem; left: 50%; right: auto; transform: translateX(-50%); }
.theme-night .grid {
  grid-template-columns: repeat(12, 7rem); grid-auto-rows: 7rem; column-gap: 1.625rem; row-gap: 3rem;
  padding: 1.375rem 1.75rem; border-radius: 2.875rem;
}
.theme-night .app { width: 7rem; height: 7rem; }
/* Apple's app icon corner: a continuous curve (about 22.4% of the width, 60% smoothing). Measured
   against that shape at 400 px: superellipse(1.3) at 26.5% is the closest CSS (0.12% of pixels off),
   plain 22.5% the closest on WebViews without corner-shape (0.2% off). */
.theme-night .app .face { border-radius: 22.5%; }
@supports (corner-shape: superellipse(1.3)) {
.theme-night .app .face { border-radius: 26.5%; corner-shape: superellipse(1.3); }
}
.theme-night .app:not(.focus) .face img { filter: brightness(0.82); }
.theme-night .app.focus { transform: scale(1.16) translateY(-0.625rem); }
.theme-night .app.focus .face { box-shadow: 0 0 0 0.25rem #fff, 0 1.125rem 2.5rem rgba(0, 0, 0, 0.4); }
.theme-night .app .face.tool { background: rgba(255, 255, 255, 0.14); }
.theme-night .app .face.word { font-size: 1.125rem; padding: 0 0.5rem; background: #2a2a30; }
.theme-night .app .label { top: calc(100% + 0.75rem); }
/* More apps: the dock grows into a full list and the cards step aside */
.theme-night.expanded .shelf { display: none; }

@media (prefers-reduced-motion: reduce) {
  .ncard { transition: none; }
}

/* ================= people: a head icon and its list, for three or more ================= */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.people-wrap { position: relative; }
.avatar {
  display: flex; align-items: center; justify-content: center; flex: none; width: 2.25rem; height: 2.25rem; border-radius: 50%;
  font-size: 1.25rem; line-height: 1; font-weight: 700; color: #fff; text-shadow: 0 0.0625rem 0.25rem rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 0 0 0.0625rem rgba(255, 255, 255, 0.28);
}
.people.head { padding: 0.375rem; border-radius: 50%; transition: transform 200ms var(--ease), box-shadow 200ms var(--ease); }
.people.head .avatar { width: 4.75rem; height: 4.75rem; font-size: 2.125rem; }
.theme-night .people.head.focus, .people.head.focus { transform: scale(1.08); box-shadow: 0 0 0 0.1875rem #fff, 0 0.75rem 1.75rem rgba(0, 0, 0, 0.4); }
.people-pop {
  display: none; position: absolute; left: 0; top: calc(100% + 1rem); z-index: 5; min-width: 24rem; padding: 0.625rem;
  border-radius: 2rem; background: rgba(28, 24, 30, 0.62); -webkit-backdrop-filter: blur(1.75rem) saturate(170%); backdrop-filter: blur(1.75rem) saturate(170%);
  box-shadow: inset 0 0 0 0.0625rem rgba(255, 220, 230, 0.16), 0 1.5rem 3.75rem rgba(0, 0, 0, 0.45); text-shadow: none;
}
.people-pop.on { display: block; }
.plist { display: flex; flex-direction: column; gap: 0.25rem; }
.prow {
  display: flex; align-items: center; gap: 1rem; padding: 0.5rem 1.25rem 0.5rem 0.5rem; border-radius: 1.5rem;
  font-size: 1.6875rem; line-height: 2.25rem; color: rgba(255, 255, 255, 0.88);
  transition: transform 200ms var(--ease), background 200ms var(--ease), box-shadow 200ms var(--ease);
}
.prow .avatar { width: 3rem; height: 3rem; font-size: 1.375rem; }
.prow b { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pmark { display: flex; font-style: normal; }
.pmark svg { width: 1.75rem; height: 1.75rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.prow.focus { background: #fff; color: #111; transform: scale(1.04); }
.prow.lifted { transform: scale(1.07) translateX(0.5rem); box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.4); animation: wiggle 0.32s ease-in-out infinite alternate; }
.phint { margin: 0.625rem 0.75rem 0.25rem; font-size: 1.1875rem; line-height: 1.5rem; font-weight: 500; color: rgba(255, 255, 255, 0.62); }

/* ================= moving apps with the TV remote, and new apps ================= */
@keyframes wiggle { from { rotate: -2deg; } to { rotate: 2deg; } }
.app .dot {
  position: absolute; top: -0.375rem; right: -0.375rem; z-index: 2; width: 1.125rem; height: 1.125rem; border-radius: 50%;
  background: #0a84ff; box-shadow: 0 0 0 0.1875rem rgba(0, 0, 0, 0.3);
}
.theme-night .app.lifted, .theme-night .app.lifted.focus { z-index: 3; transform: scale(1.2) translateY(-1.5rem); }
.theme-night .app.lifted .face { animation: wiggle 0.32s ease-in-out infinite alternate; box-shadow: 0 0 0 0.25rem #fff, 0 1.75rem 3rem rgba(0, 0, 0, 0.55); }
.theme-night .app.lifted .face img { filter: none; }
.theme-night.lifting .app:not(.lifted) .face { opacity: 0.7; }
/* while an app is moved (or a hint shows over the dock) the cards step aside, so the hint has the space */
.theme-night .shelf { transition: opacity 240ms var(--ease); }
.theme-night.lifting .shelf, .theme-night.hinting .shelf { opacity: 0; }
.hint { display: none; }
.theme-night .hint.on {
  display: block; position: absolute; left: 50%; bottom: calc(100% + 2.5rem); transform: translateX(-50%); white-space: nowrap;
  padding: 0.625rem 1.5rem; border-radius: 2rem; font-size: 1.4375rem; line-height: 2rem; font-weight: 600; color: #fff;
  background: rgba(30, 20, 28, 0.42); -webkit-backdrop-filter: blur(1.75rem) saturate(170%); backdrop-filter: blur(1.75rem) saturate(170%);
  box-shadow: inset 0 0 0 0.0625rem rgba(255, 210, 220, 0.16), 0 1rem 2.5rem rgba(0, 0, 0, 0.28);
}
@media (prefers-reduced-motion: reduce) {
  .prow.lifted, .theme-night .app.lifted .face { animation: none; }
}

/* ================= the household's own photos as scenes (Home settings, Your photos) =================
   No cut-out and no glass copy: the clock's fill is the photo itself, lifted a little so it reads. */
.s-own .shade { background: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0) 45%); }
.s-own .gclock .fill { filter: brightness(1.4) saturate(1.15); opacity: 0.88; }
.s-own .gclock .rim { -webkit-text-stroke-color: rgba(255, 255, 255, 0.7); }

/* ================= your own scenes (home.my_scenes, made with tools/make-scene.py) =================
   app.js sets --my-top and --my-size (the clock's top and font size, from config.json) on the scene
   and on the page, and the classes: x-left or x-right, f-inter, t-dark on the scene; mine-left,
   mine-right, mine-below, mine-inter, mine-dark on the page for the date. Without them it is the built-in look. */
.s-mine .shade { background: linear-gradient(180deg, rgba(0, 0, 0, 0.22) 0%, rgba(0, 0, 0, 0) 40%); }
.s-mine .gclock { top: var(--my-top, 9.375rem); font-size: var(--my-size, 25rem); }
.s-mine.x-left .gclock { left: 6rem; right: auto; text-align: left; }
.s-mine.x-right .gclock { left: auto; right: 6rem; text-align: right; }
.s-mine.f-inter .gclock { font-family: "Inter", sans-serif; font-weight: var(--my-weight, 600); letter-spacing: -0.05em; line-height: 0.8; }
.s-mine.t-dark .gclock { filter: none; }
.s-mine.t-dark .gclock .fill { filter: brightness(0.46) saturate(0.8) contrast(1.1); opacity: 0.8; }
.s-mine.t-dark .gclock .rim { color: transparent; -webkit-text-stroke-color: rgba(255, 255, 255, 0.6); }
.s-mine.t-dark .gclock .sheen { display: none; }
.scene-mine .date { top: calc(var(--my-top, 9.375rem) - 3.375rem); }
/* below: under the digits' ink, which ends 0.92 of the font size down (Antonio), 0.77 (Inter) */
.scene-mine.mine-below .date { top: calc(var(--my-top, 9.375rem) + var(--my-size, 25rem) * 0.92 + 1rem); }
.scene-mine.mine-below.mine-inter .date { top: calc(var(--my-top, 9.375rem) + var(--my-size, 25rem) * 0.77 + 1rem); }
.scene-mine.mine-left .date { left: 6.5rem; right: auto; text-align: left; }
.scene-mine.mine-right .date { left: auto; right: 6.5rem; text-align: right; }
.scene-mine.mine-dark .date { color: #16201d; text-shadow: none; }
.scene-mine.mine-dark .date .wx { color: rgba(22, 32, 29, 0.72); }

/* ================= the gear tile's menu: Home settings or TV settings ================= */
.gear-pop {
  display: none; position: fixed; z-index: 15; width: max-content; max-width: 42rem; padding: 0.625rem;
  border-radius: 2rem; background: rgba(28, 24, 30, 0.74); -webkit-backdrop-filter: blur(1.75rem) saturate(170%); backdrop-filter: blur(1.75rem) saturate(170%);
  box-shadow: inset 0 0 0 0.0625rem rgba(255, 220, 230, 0.16), 0 1.5rem 3.75rem rgba(0, 0, 0, 0.45); text-shadow: none;
}
.gear-pop.on { display: block; }
/* the same card, centred just above the dock (clear of the clock), for the one-time updates question */
.gear-pop.ask { left: 50%; top: auto; bottom: 14rem; width: 46rem; max-width: 46rem; transform: translateX(-50%); padding: 1.25rem; }
.ask-h { padding: 0.75rem 1rem 1.25rem; }
.ask-h b { display: block; font-size: 2rem; line-height: 2.5rem; font-weight: 640; color: #fff; }
.ask-h small { display: block; margin-top: 0.5rem; font-size: 1.25rem; line-height: 1.75rem; color: rgba(255, 255, 255, 0.7); }
/* the cards step aside while the menu is open, as they do for the move hint */
.theme-night.gearing .shelf { opacity: 0; }

/* hold OK on an app: the same floating card as the gear menu */
.app-pop {
  display: none; position: fixed; z-index: 15; width: max-content; max-width: 42rem; padding: 0.625rem;
  border-radius: 2rem; background: rgba(28, 24, 30, 0.74); -webkit-backdrop-filter: blur(1.75rem) saturate(170%); backdrop-filter: blur(1.75rem) saturate(170%);
  box-shadow: inset 0 0 0 0.0625rem rgba(255, 220, 230, 0.16), 0 1.5rem 3.75rem rgba(0, 0, 0, 0.45); text-shadow: none;
}
.app-pop.on { display: block; }
.theme-night.apping .shelf { opacity: 0; }
.grow {
  display: flex; align-items: center; gap: 1.25rem; padding: 0.875rem 1.75rem 0.875rem 0.875rem; border-radius: 1.5rem;
  color: rgba(255, 255, 255, 0.92); transition: transform 200ms var(--ease), background 200ms var(--ease);
}
.grow + .grow { margin-top: 0.25rem; }
.grow i { display: flex; flex: none; align-items: center; justify-content: center; width: 3.5rem; height: 3.5rem; border-radius: 1rem; background: rgba(255, 255, 255, 0.12); }
.grow svg { width: 2rem; height: 2rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.grow b { display: block; font-size: 1.6875rem; line-height: 2.125rem; font-weight: 620; }
.grow small { display: block; font-size: 1.1875rem; line-height: 1.5rem; color: rgba(255, 255, 255, 0.62); }
.grow.focus { background: #fff; color: #111; transform: scale(1.04); box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.35); }
.grow.focus i { background: rgba(0, 0, 0, 0.07); }
.grow.focus small { color: rgba(0, 0, 0, 0.6); }

/* ================= Home settings: a tvOS style list, sections left, rows right ================= */
/* top/right/bottom/left rather than inset: WebViews before Chrome 87 (still on many Android 9 TVs)
   skip inset, and the list was drawn below the screen where nobody could see it (#26). */
.settings {
  display: none; position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 30; grid-template-columns: 36rem minmax(0, 1fr); column-gap: 4rem;
  padding: var(--safe-y) var(--safe-x); text-shadow: none;
  background: rgba(10, 8, 12, 0.8); -webkit-backdrop-filter: blur(2.5rem) saturate(140%); backdrop-filter: blur(2.5rem) saturate(140%);
}
.settings.on { display: grid; }
/* no blur on older WebViews (before Chrome 76): a near solid ground, so the home does not show through */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
.settings, .smart { background: rgba(10, 8, 12, 0.96); }
}
/* the home underneath stays still while the list is open */
.setting .tile.focus .face, .setting .tile.focus .face::after { animation: none; }
.set-side { display: flex; flex-direction: column; min-height: 0; }
.set-title { margin: 2.25rem 0 2.5rem 1.25rem; font-size: 2.875rem; line-height: 3.75rem; font-weight: 700; letter-spacing: -0.022em; white-space: nowrap; }
.set-secs { display: flex; flex-direction: column; gap: 0.375rem; }
.ssec {
  display: flex; align-items: center; gap: 1.25rem; min-height: 4.75rem; padding: 0.5rem 1.5rem 0.5rem 0.875rem; border-radius: 1.5rem;
  font-size: 1.75rem; line-height: 2.25rem; font-weight: 600; color: rgba(255, 255, 255, 0.76);
  transition: transform 200ms var(--ease), background 200ms var(--ease), box-shadow 200ms var(--ease);
}
.ssec i { display: flex; flex: none; align-items: center; justify-content: center; width: 3.25rem; height: 3.25rem; border-radius: 1rem; background: rgba(255, 255, 255, 0.1); }
.ssec svg { width: 1.875rem; height: 1.875rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ssec.on { background: rgba(255, 255, 255, 0.13); color: #fff; }
.ssec.focus { background: #fff; color: #111; transform: scale(1.04); box-shadow: 0 1rem 2.25rem rgba(0, 0, 0, 0.45); }
.ssec.focus i { background: rgba(0, 0, 0, 0.07); }

.set-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.set-crumb { height: 2rem; margin: 0.75rem 0 0 1.75rem; font-size: 1.3125rem; line-height: 2rem; font-weight: 600; color: rgba(255, 255, 255, 0.5); }
.set-head { margin: 0.25rem 0 1.5rem 1.75rem; font-size: 2.375rem; line-height: 3rem; font-weight: 680; letter-spacing: -0.015em; }
.set-rows {
  position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 0.5rem;
  margin: -1rem -1.75rem; padding: 1rem 1.75rem 3rem; overflow: hidden; scroll-behavior: smooth;
  /* a long list fades out at its edges instead of being cut */
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 1rem, #000 calc(100% - 3rem), transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 1rem, #000 calc(100% - 3rem), transparent 100%);
}
.srow {
  flex: none; display: flex; align-items: center; gap: 1.25rem; min-height: 4.75rem; padding: 0.75rem 1.75rem; border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.08); font-size: 1.75rem; line-height: 2.25rem; color: rgba(255, 255, 255, 0.92);
  transition: transform 200ms var(--ease), background 200ms var(--ease), box-shadow 200ms var(--ease);
}
.srow .sl { flex: 1; min-width: 0; }
.srow .sl b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.srow .sl small { display: block; margin-top: 0.125rem; font-size: 1.25rem; line-height: 1.625rem; color: rgba(255, 255, 255, 0.6); }
.srow .sv { flex: none; max-width: 48%; text-align: right; font-weight: 500; color: rgba(255, 255, 255, 0.62); overflow-wrap: anywhere; }
.srow.focus { background: #fff; color: #111; transform: scale(1.02); box-shadow: 0 1.25rem 2.5rem rgba(0, 0, 0, 0.45); }
.srow.focus .sl small, .srow.focus .sv { color: rgba(0, 0, 0, 0.6); }
.srow.k-info { min-height: 0; padding: 0.5rem 1.75rem; background: none; font-size: 1.4375rem; line-height: 1.875rem; color: rgba(255, 255, 255, 0.68); }
.srow.k-info .sl b { font-weight: 500; }
.srow.k-info .sl small { font-size: 1.25rem; }
.srow.danger .sl b { color: #ff7b72; }
.srow.danger.focus .sl b { color: #c4271b; }
.srow.lifted { transform: scale(1.04) translateX(0.75rem); box-shadow: 0 1.25rem 2.5rem rgba(0, 0, 0, 0.5); animation: wiggle 0.32s ease-in-out infinite alternate; }
.shead { flex: none; margin: 1.125rem 0 0.125rem 1.75rem; font-size: 1.25rem; line-height: 1.75rem; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255, 255, 255, 0.5); }
.shead:first-child { margin-top: 0; }
.smark { display: flex; flex: none; font-style: normal; }
.smark svg { width: 1.875rem; height: 1.875rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.smark.dim { opacity: 0.45; }
.sbox { display: flex; flex: none; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; box-shadow: inset 0 0 0 0.1875rem rgba(255, 255, 255, 0.42); }
.sbox.on { background: #30d158; box-shadow: none; color: #fff; }
.sbox svg { width: 1.375rem; height: 1.375rem; fill: none; stroke: currentColor; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.srow.focus .sbox:not(.on) { box-shadow: inset 0 0 0 0.1875rem rgba(0, 0, 0, 0.32); }
.sicon { flex: none; width: 3rem; height: 3rem; border-radius: 0.75rem; object-fit: cover; }
.sicon.none { display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.14); font-size: 1.375rem; font-weight: 700; }
.sicon.none svg { width: 1.75rem; height: 1.75rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.srow.focus .sicon.none { background: rgba(0, 0, 0, 0.08); }
.sthumb { flex: none; width: 5.5rem; height: 3.125rem; border-radius: 0.625rem; object-fit: cover; background: rgba(255, 255, 255, 0.08); }
.srow .avatar { width: 3rem; height: 3rem; font-size: 1.375rem; }
/* the text box for a place, a name or a photo's address */
.set-type { display: none; flex: none; margin: 0 0 1.25rem; padding: 0.875rem 1.75rem 1rem; border-radius: 1.5rem; background: rgba(255, 255, 255, 0.12); box-shadow: inset 0 0 0 0.1875rem #fff; }
.set-type.on { display: block; }
.set-type-label { display: block; margin-bottom: 0.25rem; font-size: 1.3125rem; line-height: 1.75rem; font-weight: 600; color: rgba(255, 255, 255, 0.7); }
.set-type input {
  width: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: #fff; caret-color: #0a84ff;
  font: inherit; font-size: 2.25rem; line-height: 3rem; font-weight: 500; user-select: text; -webkit-user-select: text;
}
.set-msg { flex: none; min-height: 2rem; margin: 1.5rem 0 0 1.75rem; font-size: 1.4375rem; line-height: 2rem; font-weight: 550; color: #8fd3ff; }
.set-hint { flex: none; margin: 0.25rem 0 0 1.75rem; font-size: 1.25rem; line-height: 1.75rem; color: rgba(255, 255, 255, 0.5); }
@media (prefers-reduced-motion: reduce) {
  .srow, .ssec, .grow { transition: none; }
  .srow.lifted { animation: none; }
  .set-rows { scroll-behavior: auto; }
}

/* ================= Smart home (optional): rooms and scenes through Home Assistant =================
   Only drawn when config.json has a home_assistant section (smarthome.js). Rooms are cards with a
   dial; their four buttons (cooler, warmer, on or off, mode) and the scenes take the remote. */
.smart {
  display: none; position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 30; flex-direction: column;
  padding: var(--safe-y) var(--safe-x); text-shadow: none;
  background: rgba(10, 8, 12, 0.8); -webkit-backdrop-filter: blur(2.5rem) saturate(140%); backdrop-filter: blur(2.5rem) saturate(140%);
}
.smart.on { display: flex; }
.smarting .tile.focus .face, .smarting .tile.focus .face::after { animation: none; }
.sh-title { margin: 2.25rem 0 1.75rem 0.25rem; font-size: 2.875rem; line-height: 3.75rem; font-weight: 700; letter-spacing: -0.022em; }
.sh-head { margin: 0 0 1rem 0.25rem; font-size: 1.25rem; line-height: 1.75rem; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255, 255, 255, 0.5); }
.sh-note { margin: -0.25rem 0 1.25rem 0.25rem; font-size: 1.5rem; line-height: 2.125rem; color: var(--text-2); }
.sh-note.warn { color: var(--warn); }
.sh-view { overflow: hidden; margin: -1rem -1rem 1.75rem; padding: 1rem; }
.sh-rooms { display: flex; gap: 2rem; transition: transform 300ms var(--ease); }
.sh-room {
  flex: 0 0 25.5rem; padding: 1.75rem 1.75rem 1.5rem; border-radius: 2rem; background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 0.0625rem rgba(255, 255, 255, 0.1); transition: background 200ms var(--ease), transform 200ms var(--ease);
}
.sh-room.here { background: rgba(255, 255, 255, 0.14); }
.sh-name { font-size: 1.875rem; line-height: 2.375rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-dial { position: relative; width: 13.5rem; height: 13.5rem; margin: 0.75rem auto 0.25rem; }
.sh-dial svg { width: 100%; height: 100%; transform: rotate(135deg); }
.sh-dial .track { fill: none; stroke: rgba(255, 255, 255, 0.14); stroke-width: 8; stroke-linecap: round; }
.sh-dial .arc { fill: none; stroke: #9fd8ff; stroke-width: 8; stroke-linecap: round; transition: stroke-dasharray 300ms var(--ease), stroke 300ms; }
.sh-room.heat .sh-dial .arc { stroke: #ffb46e; }
.sh-room.off .sh-dial .arc, .sh-room.quiet .sh-dial .arc { stroke: rgba(255, 255, 255, 0.3); }
.sh-val { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.sh-val b { font-family: "Antonio", "Inter", sans-serif; font-size: 5.5rem; line-height: 5.75rem; font-weight: 300; letter-spacing: -0.03em; }
.sh-val span { font-size: 1.3125rem; line-height: 1.75rem; color: var(--text-2); }
.sh-room.off .sh-val b, .sh-room.quiet .sh-val b { color: var(--text-2); }
.sh-now { min-height: 2.125rem; text-align: center; font-size: 1.5rem; line-height: 2.125rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-ctl { display: flex; gap: 0.75rem; justify-content: center; margin-top: 1.25rem; }
.sh-b {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem; min-width: 4rem; height: 4rem; padding: 0 0.875rem;
  border-radius: 2rem; background: rgba(255, 255, 255, 0.12); color: rgba(255, 255, 255, 0.92);
  transition: transform 200ms var(--ease), background 200ms var(--ease), box-shadow 200ms var(--ease);
}
.sh-b i { display: flex; }
.sh-b svg { width: 1.875rem; height: 1.875rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sh-b span { font-size: 1.375rem; line-height: 1.75rem; font-weight: 600; white-space: nowrap; max-width: 8rem; overflow: hidden; text-overflow: ellipsis; }
.sh-room:not(.off):not(.quiet) .sh-power { background: rgba(159, 216, 255, 0.3); }
.sh-room.heat:not(.off):not(.quiet) .sh-power { background: rgba(255, 180, 110, 0.32); }
.smart .sh-room .sh-b.focus { background: #fff; color: #111; transform: scale(1.12); box-shadow: 0 0.75rem 1.75rem rgba(0, 0, 0, 0.45); }
.sh-scenes { display: flex; flex-wrap: wrap; gap: 1.25rem; }
/* five to a line, the same width each, so up and down land where they look like they should */
.sh-scene {
  display: flex; flex: 0 0 20.75rem; align-items: center; gap: 1rem; height: 5rem; padding: 0 1.75rem 0 1rem; border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.92);
  transition: transform 200ms var(--ease), background 200ms var(--ease), box-shadow 200ms var(--ease);
}
.sh-scene i { display: flex; align-items: center; justify-content: center; width: 3.25rem; height: 3.25rem; border-radius: 1rem; background: rgba(255, 255, 255, 0.12); }
.sh-scene svg { width: 1.75rem; height: 1.75rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sh-scene b { min-width: 0; font-size: 1.625rem; line-height: 2.125rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-scene.focus { background: #fff; color: #111; transform: scale(1.06); box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.45); }
.sh-scene.focus i { background: rgba(0, 0, 0, 0.07); }
.sh-msg { min-height: 2rem; margin: auto 0 0 0.25rem; font-size: 1.4375rem; line-height: 2rem; font-weight: 550; color: #8fd3ff; }
.sh-hint { margin: 0.25rem 0 0 0.25rem; font-size: 1.25rem; line-height: 1.75rem; color: rgba(255, 255, 255, 0.5); }
@media (prefers-reduced-motion: reduce) {
  .sh-b, .sh-scene, .sh-room, .sh-rooms, .sh-dial .arc { transition: none; }
}

/* ================= the video background (Home settings, Look; home.video_url) =================
   app.js adds html.has-video once the clip really plays. It sits over the Classic photo and under
   the Night scenes, whose photos and cut-outs step aside so their glass clocks float over the video. */
.bgvid {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; pointer-events: none; transition: opacity 1600ms ease-in-out;
}
.has-video .bgvid { opacity: 1; }
.night .bgvid { filter: brightness(0.72); }
.has-video .scene .sbg, .has-video .scene .fg { display: none; }
/* the clock's fill was the scene's own photo: over a video it is frosted white with a soft shadow,
   so it reads from the couch over a bright sky and a dark night alike */
.has-video .scene .gclock { filter: drop-shadow(0 0.25rem 1.5rem rgba(0, 0, 0, 0.42)) drop-shadow(0 0 0.1875rem rgba(0, 0, 0, 0.3)); }
.has-video .gclock .fill { background-image: none !important; color: rgba(255, 255, 255, 0.72); filter: none; opacity: 1; }
.has-video .s-fog .gclock .fill { color: rgba(255, 255, 255, 0.68); filter: none; opacity: 1; }

/* ================= Glass panels (Home settings, Look, Glass; home.glass) =================
   html.glass: clear, softly blurred panels with a light edge and a highlight along the top, so the
   photo or the video shows through. Night: the dock, the Keep watching cards, the people switch,
   the quick buttons and the date. Classic: the clock sits on a glass card, the plain tiles (App
   Store, Settings, More apps) turn to glass and every tile gets a light edge; the photo stays clear.
   html.glass-lite (On, no blur): the same panels and edges with no blur, for older or slower TVs.
   A TV whose browser cannot blur at all gets the same, by itself (@supports at the end). */
.glass {
  --glass-tint: linear-gradient(160deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.05) 42%, rgba(255, 255, 255, 0.09) 100%), rgba(22, 22, 30, 0.2);
  --glass-solid: linear-gradient(160deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.04) 42%, rgba(255, 255, 255, 0.07) 100%), rgba(24, 24, 32, 0.6);
  --glass-edge: inset 0 0 0 0.0625rem rgba(255, 255, 255, 0.26), inset 0 0.125rem 0.0625rem -0.0625rem rgba(255, 255, 255, 0.6),
    inset 0 -0.0625rem 0 rgba(255, 255, 255, 0.1), 0 1.5rem 3.5rem rgba(0, 0, 0, 0.3);
  --glass-blur: blur(2.25rem) saturate(185%) brightness(1.06);
}
.glass.theme-night .people:not(.focus), .glass.theme-night .qbtn:not(.focus), .glass.theme-night .grid,
.glass.theme-night .ncard:not(.focus), .glass.theme-night .date .dline,
.glass:not(.theme-night) .clock, .glass:not(.theme-night) .people, .glass:not(.theme-night) .qbtn:not(.focus),
.glass:not(.theme-night) .app .face.tool, .glass:not(.theme-night) .app .face.word {
  background: var(--glass-tint); box-shadow: var(--glass-edge);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
/* a focused card keeps its white ring, on glass */
.glass.theme-night .ncard.focus { background: var(--glass-tint); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
/* Night: the date line becomes a small glass pill above the clock */
.glass.theme-night .date .dline { display: inline-block; padding: 0.375rem 1.5rem; border-radius: 1.75rem; }
/* Classic: a glass card behind the clock (the words stay where they were), a light edge on every tile */
.glass:not(.theme-night) .clock { padding: 1.25rem 1.75rem 0.75rem 2.5rem; margin: -1.25rem -1.75rem 0 0; border-radius: 2.25rem; }
.glass:not(.theme-night) .tile:not(.focus) .face { box-shadow: 0 0 0 0.0625rem rgba(255, 255, 255, 0.24), 0 0.75rem 1.75rem rgba(0, 0, 0, 0.35); }
/* On, no blur: the panels stay, a little darker so words still read */
.glass.glass-lite.theme-night .people:not(.focus),
.glass.glass-lite.theme-night .qbtn:not(.focus),
.glass.glass-lite.theme-night .grid,
.glass.glass-lite.theme-night .ncard,
.glass.glass-lite.theme-night .date .dline,
.glass.glass-lite:not(.theme-night) .clock,
.glass.glass-lite:not(.theme-night) .people,
.glass.glass-lite:not(.theme-night) .qbtn:not(.focus),
.glass.glass-lite:not(.theme-night) .app .face.tool,
.glass.glass-lite:not(.theme-night) .app .face.word {
  background: var(--glass-solid); -webkit-backdrop-filter: none; backdrop-filter: none;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
.glass.theme-night .people:not(.focus),
.glass.theme-night .qbtn:not(.focus),
.glass.theme-night .grid,
.glass.theme-night .ncard,
.glass.theme-night .date .dline,
.glass:not(.theme-night) .clock,
.glass:not(.theme-night) .people,
.glass:not(.theme-night) .qbtn:not(.focus),
.glass:not(.theme-night) .app .face.tool,
.glass:not(.theme-night) .app .face.word { background: var(--glass-solid); }
}

/* ================= How clear the glass is (Home settings, Look, How clear; home.glass_amount) =================
   #29: five steps from frosted to very clear, for the glass panels, the glass app icons and the
   clocks. Step 3 is the look 0.6 shipped with. Apple's guidance: the clear material keeps a
   dimming layer under it so what sits on it stays readable, so even step 5 keeps some. */
:root {
  --gi-tint: linear-gradient(160deg, rgba(255, 255, 255, 0.24) 0%, rgba(255, 255, 255, 0.06) 45%, rgba(255, 255, 255, 0.12) 100%), rgba(20, 20, 28, 0.22);
  --gi-blur: blur(1.75rem) saturate(170%);
  --gi-glyph: 0.92;
  --gc-op: 1;
  --lq-fill: 0.85;
  --lq-rim: 0.8;
}
.ga-1 {
  --gi-tint: linear-gradient(160deg, rgba(255, 255, 255, 0.36) 0%, rgba(255, 255, 255, 0.14) 45%, rgba(255, 255, 255, 0.2) 100%), rgba(24, 24, 32, 0.34);
  --gi-blur: blur(2.5rem) saturate(160%); --gi-glyph: 0.97; --lq-fill: 0.95; --lq-rim: 0.85;
}
.ga-2 {
  --gi-tint: linear-gradient(160deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.1) 45%, rgba(255, 255, 255, 0.16) 100%), rgba(22, 22, 30, 0.28);
  --gi-blur: blur(2.125rem) saturate(165%); --gi-glyph: 0.95; --lq-fill: 0.9; --lq-rim: 0.82;
}
.ga-4 {
  --gi-tint: linear-gradient(160deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.035) 45%, rgba(255, 255, 255, 0.08) 100%), rgba(18, 18, 26, 0.16);
  --gi-blur: blur(1rem) saturate(175%); --gi-glyph: 0.9; --gc-op: 0.8; --lq-fill: 0.7; --lq-rim: 0.75;
}
.ga-5 {
  --gi-tint: linear-gradient(160deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.02) 45%, rgba(255, 255, 255, 0.05) 100%), rgba(16, 16, 24, 0.11);
  --gi-blur: blur(0.375rem) saturate(180%); --gi-glyph: 0.88; --gc-op: 0.6; --lq-fill: 0.55; --lq-rim: 0.7;
}
.glass.ga-1 {
  --glass-tint: linear-gradient(160deg, rgba(255, 255, 255, 0.32) 0%, rgba(255, 255, 255, 0.1) 42%, rgba(255, 255, 255, 0.15) 100%), rgba(22, 22, 30, 0.34);
  --glass-blur: blur(3.25rem) saturate(170%) brightness(1.06);
}
.glass.ga-2 {
  --glass-tint: linear-gradient(160deg, rgba(255, 255, 255, 0.26) 0%, rgba(255, 255, 255, 0.075) 42%, rgba(255, 255, 255, 0.12) 100%), rgba(22, 22, 30, 0.27);
  --glass-blur: blur(2.75rem) saturate(178%) brightness(1.06);
}
.glass.ga-4 {
  --glass-tint: linear-gradient(160deg, rgba(255, 255, 255, 0.13) 0%, rgba(255, 255, 255, 0.03) 42%, rgba(255, 255, 255, 0.06) 100%), rgba(22, 22, 30, 0.13);
  --glass-blur: blur(1.25rem) saturate(190%) brightness(1.05);
}
.glass.ga-5 {
  --glass-tint: linear-gradient(160deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.015) 42%, rgba(255, 255, 255, 0.035) 100%), rgba(22, 22, 30, 0.08);
  --glass-blur: blur(0.5rem) saturate(195%) brightness(1.04);
}
/* the frosted clock: steps 4 and 5 let more of the photo through */
.theme-night .scene .gclock { opacity: var(--gc-op); }

/* ================= Glass app icons (Home settings, Look, Glass app icons; home.glass_icons) =================
   Apple's clear icons (#25): the app's symbol in light glass, its own background gone
   (clearicon.js cuts it out once and keeps it), on a glass tile with a soft dimming layer, a rim
   of light along the top and a deeper shadow on the focused app. The focused (or lifted) app shows
   its own icon in colour, so you can always tell what OK will open. An icon that will not split
   cleanly (a photo) is shown grey and half see-through instead. Works with Glass panels on or off. */
.glass-icons .app:not(.focus):not(.lifted) .face:not(.tool) {
  /* !important: the Classic look paints each tile in the app's colour inline */
  background: var(--gi-tint) !important;
  box-shadow: inset 0 0 0 0.0625rem rgba(255, 255, 255, 0.3), inset 0 0.125rem 0.0625rem -0.0625rem rgba(255, 255, 255, 0.7),
    inset 0 -0.0625rem 0 rgba(255, 255, 255, 0.1), 0 0.75rem 1.75rem rgba(0, 0, 0, 0.3);
  -webkit-backdrop-filter: var(--gi-blur); backdrop-filter: var(--gi-blur);
}
.glass-icons .app .face .glyph { display: none; }
.glass-icons .app:not(.focus):not(.lifted) .face.clear > img:not(.glyph) { display: none; }
.glass-icons .app:not(.focus):not(.lifted) .face.clear .glyph {
  display: block; object-fit: contain; opacity: var(--gi-glyph);
  filter: drop-shadow(0 0.0625rem 0.125rem rgba(0, 0, 0, 0.28)) drop-shadow(0 0 0.375rem rgba(0, 0, 0, 0.12));
}
.glass-icons .app:not(.focus):not(.lifted) .face:not(.tool):not(.clear) img {
  filter: grayscale(1) contrast(1.25) brightness(1.1); opacity: 0.55; mix-blend-mode: luminosity;
}
.glass-icons .app .face img { transition: filter 0.2s, opacity 0.2s; }
.glass-icons.glass-lite .app:not(.focus):not(.lifted) .face:not(.tool) { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(36, 36, 44, 0.55) !important; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
.glass-icons .app:not(.focus):not(.lifted) .face:not(.tool) { background: rgba(36, 36, 44, 0.55) !important; }
}

/* ================= Liquid glass clock (Home settings, Look, Clock style; home.clock_style) =================
   #25: the Night clock as clear glass. Through the digits the sharp photo shows, magnified a
   little about the clock's middle (app.js, drawClocks), which is how a thick clear glass bends
   what is behind it; a dark edge just outside the outline and a bright rim give it thickness,
   and a sheen runs down from the top left. Old WebViews draw the same layers (no blur is used).
   Over a video the digits are a pale glass with the same rim, so they still read. */
.gclock .edge { display: none; }
.clock-liquid .scene .gclock .edge {
  display: block; position: absolute; top: 0; right: 0; bottom: 0; left: 0; color: transparent;
  -webkit-text-stroke: 0.7rem rgba(0, 0, 0, 0.16); filter: blur(0.3rem);
}
.clock-liquid .scene .gclock .fill { filter: brightness(1.16) saturate(1.12) contrast(1.04); opacity: var(--lq-fill); }
.clock-liquid .scene .gclock .rim {
  color: transparent; -webkit-text-stroke: 0.16rem rgba(255, 255, 255, var(--lq-rim));
}
.clock-liquid .scene .gclock .sheen {
  display: block;
  background-image: linear-gradient(165deg, rgba(255, 255, 255, 0.62) 0%, rgba(255, 255, 255, 0.08) 26%, rgba(255, 255, 255, 0) 55%, rgba(255, 255, 255, 0) 76%, rgba(255, 255, 255, 0.3) 100%);
}
.clock-liquid .scene .gclock { opacity: 1; filter: drop-shadow(0 0.625rem 1.5rem rgba(0, 0, 0, 0.3)); }
/* light scenes (fog, a light own scene): a darker edge and a slightly darker glass, so the
   digits still stand out from a pale sky at every amount */
.clock-liquid .s-fog .gclock .edge, .clock-liquid .s-mine.t-dark .gclock .edge { -webkit-text-stroke: 0.8rem rgba(0, 0, 0, 0.3); }
.clock-liquid .s-fog .gclock .fill, .clock-liquid .s-mine.t-dark .gclock .fill { filter: brightness(0.82) contrast(1.12) saturate(1.1); opacity: 1; }
.clock-liquid .s-fog .gclock .rim, .clock-liquid .s-mine.t-dark .gclock .rim { -webkit-text-stroke: 0.16rem rgba(255, 255, 255, 0.95); }
.clock-liquid .s-fog .gclock .sheen, .clock-liquid .s-mine.t-dark .gclock .sheen { display: block; }
.clock-liquid.night .scene .gclock { filter: drop-shadow(0 0.625rem 1.5rem rgba(0, 0, 0, 0.3)) brightness(0.8); }
.clock-liquid.has-video .scene .gclock .fill { background-image: none !important; color: rgba(255, 255, 255, 0.2); filter: none; opacity: 1; }
.clock-liquid.has-video .scene .gclock .edge { -webkit-text-stroke-color: rgba(0, 0, 0, 0.22); }

/* a five step amount row in Home settings (How clear) */
.srow .sslide { display: flex; align-items: center; flex: none; margin-left: 1rem; }
.srow .sstep { display: block; width: 1.75rem; height: 0.5rem; margin-left: 0.3125rem; border-radius: 0.25rem; background: rgba(255, 255, 255, 0.2); }
.srow .sstep.on { background: rgba(255, 255, 255, 0.85); }
.srow.focus .sstep { background: rgba(0, 0, 0, 0.14); }
.srow.focus .sstep.on { background: #111; }

/* ================= Older WebViews: no gap in flex boxes (#26) =================
   Before Chrome 84 (still on many Android 9 TVs) gap is skipped in a flex box. app.js sets
   html.no-flex-gap there, and these margins stand in for the gaps people can see. */
.no-flex-gap .quick > * + *, .no-flex-gap .qbtns > * + * { margin-left: 0.75rem; }
.no-flex-gap .qbtn > * + * { margin-left: 0.625rem; }
.no-flex-gap .top-left > * + * { margin-top: 1.5rem; }
.no-flex-gap .people > * + * { margin-left: 0.5rem; }
.no-flex-gap .shelf-track > * + * { margin-left: var(--gap); }
.no-flex-gap.theme-night .shelf-track > * + * { margin-left: 1.375rem; }
.no-flex-gap .ncard > * + * { margin-left: 1.25rem; }
.no-flex-gap .ncard .nap > * + * { margin-left: 0.625rem; }
.no-flex-gap .plist > * + * { margin-top: 0.25rem; }
.no-flex-gap .prow > * + * { margin-left: 1rem; }
.no-flex-gap .grow > * + * { margin-left: 1.25rem; }
.no-flex-gap .set-secs > * + * { margin-top: 0.375rem; }
.no-flex-gap .ssec > * + * { margin-left: 1.25rem; }
.no-flex-gap .set-rows > * + * { margin-top: 0.5rem; }
.no-flex-gap .srow > * + * { margin-left: 1.25rem; }
.no-flex-gap .sh-rooms > * + * { margin-left: 2rem; }
.no-flex-gap .sh-ctl > * + * { margin-left: 0.75rem; }
