/* ============================================================
   APL Launcher — a reproduction of the tvOS 17/18 Home Screen
   1920x1080 surface. Measurements taken from Apple TV screenshots:
     dock      : x 42→1878, y 783→1008, radius 46, light glass
     icons     : 250x150, gap 50, radius 20, focus x1.2 with no outline
                 (6 per row; 5 or 7 in Settings: launcher.js sizes() sets the variables below)
     2nd row   : runs off the bottom of the screen (y ≈ 1052)
     status    : time + avatar, top right
   Three states (class on <body>):
     mode-shelf : focus in the dock   -> full-frame Top Shelf
     mode-grid  : focus further down  -> grid moved up, blurred background
     mode-full  : ▲ from the dock     -> full-screen artwork, UI hidden
   ============================================================ */

@font-face { font-family: "SF Pro Display"; font-weight: 400; font-display: swap;
    src: local("SF Pro Display"), url("../fonts/SFPRODISPLAYREGULAR.OTF") format("opentype"); }
@font-face { font-family: "SF Pro Display"; font-weight: 500; font-display: swap;
    src: local("SF Pro Display Medium"), url("../fonts/SFPRODISPLAYMEDIUM.OTF") format("opentype"); }
@font-face { font-family: "SF Pro Display"; font-weight: 700; font-display: swap;
    src: local("SF Pro Display Bold"), url("../fonts/SFPRODISPLAYBOLD.OTF") format("opentype"); }

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --ease: cubic-bezier(0.25, 1, 0.5, 1);   /* tvOS inertia */
    --cols: 6;
    --tile-w: 250px;
    --tile-h: 150px;
    --dock-top: 783px;
    --dock-h: 225px;
    --gap-x: 50px;
    --radius: 20px;
}

html, body {
    width: 1920px;
    height: 1080px;
    overflow: hidden;
    background: #000;
    color: #fff;
    font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    cursor: none;
    user-select: none;
}

/* ===================== TOP SHELF ===================== */
.bg {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    background-color: #000;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transform: scale(1);
    transition: opacity 300ms ease;                  /* FADE_MS in launcher.js */
    will-change: opacity, transform;                 /* layer ready in advance: the fade redraws nothing */
}
.bg.is-active { opacity: 1; }
/* LG draws the page in 4K: a layer kept ready is 32 MB there (8 on Samsung), and its browser gets 250 MB
   for all of them (--force-gpu-mem-available-mb). One per app visited went past it after eight apps (431 MB
   measured on a G5), and the TV left squares of the screen undrawn, black. Only the backdrop on screen is
   kept ready; a fading one keeps its layer for the length of its fade. 209 MB measured after. */
.is-webos .bg { will-change: auto; }
.is-webos .bg.is-active { will-change: opacity, transform; }
/* LG, 4K: what changes on a move has a layer of its own, so a move repaints only that and never the page or
   the whole grid (G5, measured with the inspector's paint events): the title area, the dock (its frosted
   picture changes with each app), every grid tile (the focused one scaled up left the grid layer and was
   repainted into it again, 8 Mpx twice a move), the grid's blurred picture and the hint as they fade.
   Dock 43 -> 57 images a second, moving in the grid 45 -> 55, opening it 33 -> 43. */
.is-webos .shelfinfo, .is-webos .dock, .is-webos .rows .tile { will-change: transform; }
.is-webos .bgblur, .is-webos .hint { will-change: opacity; }
/* The page is the screen: the rows below it made the document 2443 px tall, and each slide of the grid
   resized the page's own layer and repainted it whole (and took 72 MB instead of 32). The body is the
   rows' containing block and clips them; nothing scrolls, everything moves by transform. */
.is-webos body { position: relative; overflow: clip; }
/* The grid's blurred picture fades in faster: two 4K layers blended on each frame of its fade */
.is-webos .bgblur { transition-duration: 250ms; }
/* The Control Center: its dim (a plain colour with Visual Effects off, the default) and its panel each a
   layer. The screen draws a plain colour without painting it; opening no longer repaints a 4K surface. */
.is-webos .cc__dim { will-change: opacity; }
.is-webos .cc__panel { will-change: transform, opacity; }
/* The scrim, a plain gradient, drawn at a quarter of the size and scaled up (webos.js adds is-up once it is
   drawn, so it keeps that size): 2 MB instead of 32, under LG's 250 MB, and nothing to see in a gradient.
   Over the grid it only fades out: its darkening is drawn into the grid's blurred picture (launcher.js
   gridTint), so no 4K background is swapped and one full-screen layer fewer is blended. */
.is-webos .scrim { right: auto; bottom: auto; width: 25%; height: 25%; transform-origin: 0 0; transform: scale(1); will-change: transform, opacity; }
.is-webos .scrim.is-up { transform: scale(4); }
.is-webos .mode-grid .scrim, .is-webos .perf.mode-grid .scrim, .is-webos .theme-light.mode-grid .scrim,
.is-webos .theme-light.perf.mode-grid .scrim { opacity: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.30) 0%, rgba(0,0,0,0) 16%, rgba(0,0,0,0) 50%, rgba(0,0,0,0.55) 70%, rgba(0,0,0,0.92) 86%, #000 100%); }
/* A backdrop picture is an <img> (launcher.js showPicture): a decoded bitmap is
   painted whole, where a CSS background on this layer filled itself in a line at
   a time from the top as it decoded. */
.bg > img {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
}
.bg.is-slide > img { animation: bgSlideImg var(--glass-ms, 460ms) var(--glass-ease, ease) both; }
@keyframes bgSlideImg { from { transform: translateX(40px); } to { transform: translateX(0); } }
.mode-grid .bg.is-slide > img, .perf .bg.is-slide > img, .reduce-motion .bg.is-slide > img { animation: none; }
.bg.is-instant { transition: none; }                 /* shown at once under the one fading out (launcher.js) */
/* A backdrop change slides in as it fades, so a new app, the next title or a
   step along the row all read as one movement. */
.bg.is-slide { animation: bgSlide var(--glass-ms, 460ms) var(--glass-ease, ease) both; }
@keyframes bgSlide {
    /* A move of the picture itself, not of its box: the glass slices the same
       geometry, so it can make the same move and stay lined up. */
    from { opacity: 0; background-position: calc(50% + 40px) 50%; }
    to   { opacity: 1; background-position: 50% 50%; }
}
.mode-grid .bg.is-slide, .perf .bg.is-slide, .reduce-motion .bg.is-slide { animation: none; }

/* Generated brand card for apps with no artwork (Tizen icon + name) */
.brandcard {
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 1000px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 70px;
}
.brandcard__icon {
    height: 300px;
    width: 300px;
    object-fit: contain;
    border-radius: 64px;
    filter: drop-shadow(0 20px 50px rgba(0,0,0,0.45));
}
.brandcard__glyph {
    width: 300px;
    height: 300px;
    border-radius: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 30px 70px rgba(0,0,0,0.5);
}
.brandcard__name {
    font-size: 160px;
    font-weight: 700;
    letter-spacing: -3px;
    color: #fff;
    white-space: nowrap;
    max-width: 1100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Grid: the artwork becomes a blurred, darkened background (Vibrancy material) */
.mode-grid .bg { filter: blur(48px) brightness(0.48) saturate(1.4); transform: scale(1.12); }

/* The bottom of the artwork fades to black under the dock, as on tvOS */
.scrim {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg,
            rgba(0,0,0,0.30) 0%, rgba(0,0,0,0) 16%,
            rgba(0,0,0,0) 50%, rgba(0,0,0,0.55) 70%,
            rgba(0,0,0,0.92) 86%, #000 100%);
    transition: opacity 500ms ease;
}
.mode-full .scrim { opacity: 0.25; }
.mode-grid .scrim { opacity: 0.6; }

/* ===================== STATUS PILL ===================== */
.status {
    position: fixed;
    top: 50px;
    right: 57px;
    height: 60px;
    padding: 0 7px 0 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-radius: 30px;
    background: rgba(40, 40, 46, 0.45);
    -webkit-backdrop-filter: blur(30px) saturate(1.6);
    backdrop-filter: blur(30px) saturate(1.6);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
    z-index: 10;
    transition: opacity 400ms ease;
}
.status__clock { font-size: 24px; font-weight: 500; color: rgba(255,255,255,0.95); }
/* The weather before the clock (weather.js): its sky and temperature, the clock's size and colour */
.status__weather { display: inline-flex; align-items: center; gap: 6px; margin-right: 14px; font-size: 24px; font-weight: 500; color: rgba(255,255,255,0.95); }
.status__weather .ico { flex: none; }
.theme-light .status__weather { color: #1d1d1f; }
/* The city picker (weather.js): a field for the screen's keyboard, then the cities found */
.wpick { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 900; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,0.6); }
.wpick.is-open { display: flex; }
.wpick__box { width: 760px; padding: 44px 48px; border-radius: 36px; background: #1c1c1e; color: #fff; }
.wpick__title { margin: 0 0 24px; font-size: 38px; font-weight: 600; }
.wpick__field { box-sizing: border-box; width: 100%; height: 76px; padding: 0 26px; border: 3px solid transparent; border-radius: 18px; background: #2c2c2e; color: #fff; font: inherit; font-size: 30px; outline: none; }
.wpick__field.is-focused { border-color: #fff; }
.wpick__note { margin: 18px 4px 14px; font-size: 22px; color: rgba(255,255,255,0.6); }
.wpick__list { display: flex; flex-direction: column; gap: 10px; }
.wpick__row { display: flex; flex-direction: column; padding: 16px 24px; border-radius: 18px; background: #2c2c2e; transition: transform 160ms ease; }
.wpick__row.is-focused { background: #fff; color: #000; transform: scale(1.03); }
.wpick__name { font-size: 28px; font-weight: 600; }
.wpick__region { font-size: 20px; opacity: 0.7; }
.status__avatar {
    width: 46px; height: 46px; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #ffd9a0, #e58a5c 45%, #6b3fb8 100%);
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.18);
}
.mode-full .status, .mode-grid .status { opacity: 0; }
.status.is-alone { padding-right: 24px; }          /* a single profile: no avatar (profiles.js) */
.status.is-alone .status__avatar { display: none; }

/* ===================== FULL-SCREEN HINT ===================== */
.hint {
    position: fixed;
    left: 0; right: 0;
    top: calc(var(--dock-top) - 79px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 9;
    opacity: 0;
    transition: opacity 400ms ease;
    pointer-events: none;
}
.hint.is-visible { opacity: 1; }
.mode-grid .hint, .mode-full .hint { opacity: 0; }
.hint__chevron {
    width: 18px; height: 18px;
    border-left: 3px solid rgba(255,255,255,0.8);
    border-top: 3px solid rgba(255,255,255,0.8);
    border-radius: 2px;
    transform: rotate(45deg);
}
.hint__text {
    font-size: 22px;
    font-weight: 500;
    color: rgba(255,255,255,0.78);
    text-shadow: 0 1px 10px rgba(0,0,0,0.7);
}

/* Top Shelf movie title and rating: on the left, without touching the hint in the center */
.shelfinfo { position: fixed; left: 90px; top: calc(var(--dock-top) - 215px); width: 1400px; z-index: 9; color: #fff; opacity: 0; pointer-events: none; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85); transition: opacity 220ms ease; }
.shelfinfo.is-visible { opacity: 1; }
.mode-grid .shelfinfo, .has-wdg .shelfinfo { opacity: 0; }
.mode-full .shelfinfo { top: 910px; width: 1200px; }
/* The logo's height is reserved whether it is there or not: the rating and the
   year sit where they will sit, and the logo grows up into its own space instead
   of pushing them down when its file arrives a moment later. */
.shelfinfo__title { min-height: 120px; display: flex; align-items: flex-end; font-size: 44px; font-weight: 700; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The title's own logo, where TMDB has one: never stretched, never above the
   height the name would have taken. */
.shelfinfo__title.is-swap { animation: titleSwap 240ms ease both; }
@keyframes titleSwap {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}
.shelfinfo__logo { display: block; height: 120px; width: auto; max-width: 1320px; object-fit: contain; flex: 0 0 auto; filter: drop-shadow(0 3px 14px rgba(0, 0, 0, 0.8)); opacity: 0; transition: opacity 320ms ease-out; }
.shelfinfo__logo.is-in { opacity: 1; }
.shelfinfo__open { display: none; margin-top: 14px; font-size: 24px; font-weight: 600; color: rgba(255, 255, 255, 0.95); }
.mode-full .shelfinfo.can-open .shelfinfo__open { display: block; }
/* The description, in full screen only (#56): three lines at most, the title moves up to make room */
.shelfinfo__desc { display: none; margin-top: 14px; max-width: 1100px; font-size: 26px; font-weight: 400; line-height: 1.35; color: rgba(255, 255, 255, 0.86);
                   overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; max-height: 106px; white-space: normal; }
.mode-full .shelfinfo.has-desc .shelfinfo__desc { display: -webkit-box; }
.mode-full .shelfinfo.has-desc { top: 780px; }
.shelfinfo__meta { margin-top: 6px; font-size: 26px; font-weight: 500; color: rgba(255, 255, 255, 0.88); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===================== HOME (dock + rows) ===================== */
.home {
    position: absolute;
    left: 0; top: 0;
    width: 1920px;
    height: 1080px;
    z-index: 5;
    transition: transform 200ms var(--ease);
    will-change: transform;
}

.dock {
    position: absolute;
    left: 42px;
    top: var(--dock-top);
    width: 1836px;
    height: var(--dock-h);
    border-radius: 46px;
    background: rgba(118, 118, 128, 0.24);           /* tvOS light glass */
    -webkit-backdrop-filter: blur(50px) saturate(1.8);
    backdrop-filter: blur(50px) saturate(1.8);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.10), inset 0 0 0 1px rgba(255,255,255,0.05);
}
.row0, .rows {
    display: grid;
    grid-template-columns: repeat(var(--cols), var(--tile-w));
    column-gap: var(--gap-x);
}
.row0 { padding: calc((var(--dock-h) - var(--tile-h)) / 2) 43px; }
.rows {
    position: absolute;
    left: 85px;
    top: 1052px;
    row-gap: 90px;                                   /* room for the name under the icon */
}

/* ===================== ICONS ===================== */
.tile {
    position: relative;
    width: var(--tile-w);
    height: var(--tile-h);
    transform: scale(1);
    transition: transform 300ms var(--ease);
}
.tile__card {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: #2a2a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.30);
    transition: box-shadow 300ms var(--ease);
}
/* Light sheen that appears on focus */
.tile__card::after {
    content: "";
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    border-radius: inherit;
    background:
        linear-gradient(165deg, rgba(255,255,255,0.30) 0%, rgba(255,255,255,0.06) 38%, rgba(255,255,255,0) 60%);
    opacity: 0;
    transition: opacity 300ms var(--ease);
    pointer-events: none;
}
.tile__icon {
    height: 68%;
    max-width: 82%;
    object-fit: contain;
}
.tile__letter {
    font-size: 70px;
    font-weight: 700;
    color: #fff;
}
.tile__label {
    position: absolute;
    left: 50%;
    top: calc(100% + 12px);
    transform: translateX(-50%);
    font-size: 24px;
    font-weight: 500;
    white-space: nowrap;
    color: #fff;
    opacity: 0;
    transition: opacity 200ms ease;
    text-shadow: 0 1px 8px rgba(0,0,0,0.6);
    pointer-events: none;
}

/* Focus: elevation (Z axis) — no outline, as on tvOS */
.tile.is-focused { transform: scale(1.2); z-index: 3; }
.tile.is-focused .tile__card { box-shadow: 0 30px 40px -6px rgba(0,0,0,0.65), 0 10px 18px rgba(0,0,0,0.35); }
.tile.is-focused .tile__card::after { opacity: 1; }
.mode-grid .tile.is-focused .tile__label { opacity: 1; }
.tile.is-pressed { transform: scale(1.1); }

/* Black veil when an app opens: immediate feedback while it starts */
.veil { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 90; background: #000; opacity: 0; pointer-events: none; transition: opacity 160ms ease; will-change: opacity; }
.veil.is-on { opacity: 1; }

/* ===================== MISC ===================== */
.toast {
    position: fixed;
    left: 50%;
    top: 640px;
    transform: translateX(-50%);
    padding: 16px 30px;
    border-radius: 18px;
    background: rgba(40,40,46,0.7);
    -webkit-backdrop-filter: blur(30px);
    backdrop-filter: blur(30px);
    font-size: 23px;
    opacity: 0;
    transition: opacity 200ms ease;
    z-index: 50;
}
.toast.is-visible { opacity: 1; }

.boot {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    background: #000;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 500ms ease;
}
.boot.is-hidden { opacity: 0; pointer-events: none; }
/* The mark and a thin line: the start-up has something to show while the
   settings, the profiles and the apps are read (and while a screen puts its
   settings back). One transform on a small element - nothing else moves. */
.boot__mark { display: flex; flex-direction: column; align-items: center; gap: 34px; opacity: 0.92; }
.boot__a {
    font-size: 62px;
    font-weight: 600;
    letter-spacing: 10px;
    margin-right: -10px;
    color: rgba(255, 255, 255, 0.92);
}
.boot__bar {
    position: relative;
    display: block;
    width: 184px;
    height: 3px;
    border-radius: 2px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.14);
}
.boot__bar i {
    position: absolute;
    top: 0; left: 0;
    display: block;
    width: 38%;
    height: 100%;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.86);
    animation: bootLine 1.2s ease-in-out infinite;
}
@keyframes bootLine {
    from { transform: translateX(-110%); }
    to   { transform: translateX(280%); }
}
.reduce-motion .boot__bar i { animation: none; width: 100%; opacity: 0.6; }
/* A start-up that is still going after twenty seconds (launcher.js): the line sits
   still instead of sweeping, so it reads as slow rather than as loading. */
.boot--slow .boot__bar i { animation: none; width: 100%; opacity: 0.3; }

/* ===================== BUILT-IN APPS (Settings, Sources) ===================== */
.vtile {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.vtile--settings { background: linear-gradient(180deg, #e4e4e9 0%, #a3a3ab 100%); color: #3a3a3f; }
.vtile--sources  { background: linear-gradient(180deg, #3d7bf0 0%, #1d47b5 100%); color: #fff; }
.vtile--samsunghome { background: linear-gradient(180deg, #2a4fd6 0%, #1428a0 100%); color: #fff; }
/* The Home app: its own white plate, with the Home Assistant mark in the
   brand's blue. Only the logo differs from the HomeKit tile. */
.vtile--ha-mark { background: #fff; color: #18bcf2; }
.vtile--ha-mark .vtile__ha { width: 92px; height: 92px; display: block; fill: currentColor; }

/* ===================== SETTINGS (tvOS split view) ===================== */
.settings {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 30;
    opacity: 0;
    pointer-events: none;
    transition: opacity 350ms ease;
}
.settings.is-open { opacity: 1; pointer-events: auto; }
.settings__bg {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: linear-gradient(160deg, rgba(36, 84, 168, 0.62), rgba(10, 26, 66, 0.82));
    -webkit-backdrop-filter: blur(70px) saturate(1.5);
    backdrop-filter: blur(70px) saturate(1.5);
}
.settings__title {
    position: absolute;
    top: 62px; left: 0; right: 0;
    text-align: center;
    font-size: 52px;
    font-weight: 700;
    letter-spacing: -0.5px;
}
.settings__hero {
    position: absolute;
    left: 200px;
    top: 230px;
    width: 600px;
}
.settings__card {
    width: 560px;
    height: 560px;
    border-radius: 120px;
    background: rgba(255, 255, 255, 0.55);
    color: rgba(45, 55, 75, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255,255,255,0.6);
}
/* Settings start page: the large Settings icon itself */
.settings__card.is-app { background: none; box-shadow: none; }
.settings__appicon { width: 560px; height: 560px; filter: drop-shadow(0 30px 50px rgba(0, 0, 0, 0.4)); }
.perf .settings__appicon { filter: none; }
.srow__section {
    margin: 22px 0 12px 34px;
    font-size: 21px;
    font-weight: 600;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.58);
}
.settings__desc {
    margin-top: 44px;
    width: 560px;
    font-size: 25px;
    line-height: 1.35;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.78);
    text-align: center;
    min-height: 70px;
}
/* The whole value of an information row the column cuts (settings.js, describe) */
.settings__full { display: block; margin-top: 16px; font-size: 23px; color: rgba(255, 255, 255, 0.62); word-wrap: break-word; }
.settings__path {
    margin-top: 14px;
    width: 560px;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 20px;
    color: rgba(255, 255, 255, 0.55);
    text-align: center;
}
.settings__listwrap {
    position: absolute;
    left: 1040px;
    top: 160px;
    width: 800px;
    height: 880px;
    overflow: hidden;
    padding: 20px 20px 0;
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22px, #000 calc(100% - 40px), transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0, #000 22px, #000 calc(100% - 40px), transparent 100%);
}
.settings__list { transition: transform 300ms var(--ease); }
.settings__listwrap.is-enter-fwd { animation: listIn 320ms var(--ease); }
.settings__listwrap.is-enter-back { animation: listBack 320ms var(--ease); }
@keyframes listIn   { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; } }
@keyframes listBack { from { opacity: 0; transform: translateX(-60px); } to { opacity: 1; } }

.srow {
    display: flex;
    align-items: center;
    height: 72px;
    margin-bottom: 11px;
    padding: 0 30px 0 34px;
    border-radius: 36px;                     /* pill, as in tvOS 26 / 27 */
    background: rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
    font-size: 30px;
    font-weight: 500;
    color: #fff;
    transition: transform 250ms var(--ease), background 200ms ease, box-shadow 250ms ease;
}
.srow__label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srow__value {
    margin-left: 20px;
    color: rgba(255, 255, 255, 0.62);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 380px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.srow__acc { margin-left: 14px; display: flex; color: rgba(255, 255, 255, 0.55); }
.srow__acc:empty { display: none; }
.srow__bar { width: 180px; height: 8px; border-radius: 4px; background: rgba(255,255,255,0.3); overflow: hidden; display: inline-block; }
.srow__bar i { display: block; height: 100%; background: #fff; border-radius: 4px; }
.srow.is-focused {
    background: #fff;
    color: #1d1d1f;
    transform: scale(1.04);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
}
.srow.is-focused .srow__value, .srow.is-focused .srow__acc { color: #6e6e73; }
.srow.is-focused .srow__bar { background: rgba(0,0,0,0.15); }
.srow.is-focused .srow__bar i { background: #1d1d1f; }

/* ===================== CONTROL CENTER (tvOS 26 / 27) =====================
   Glass tiles floating at the top right, over the dimmed Home Screen.
   Selected tile: white, dark text, slightly enlarged. */
.cc {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 35;
    pointer-events: none;
}
.cc.is-open { pointer-events: auto; }
.has-cc .status, .has-cc .hint { opacity: 0; }
.cc__dim {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: linear-gradient(270deg, rgba(0,0,0,0.62) 0%, rgba(0,0,0,0.38) 45%, rgba(0,0,0,0.25) 100%);
    opacity: 0;
    transition: opacity 220ms ease;
}
.cc.is-open .cc__dim { opacity: 1; }
.cc__panel {
    position: absolute;
    top: 32px;
    right: 60px;
    width: 542px;          /* the 494 px grid plus its 24 px insets */
    opacity: 0;
    transform: translateY(-14px) scale(0.97);
    transform-origin: 100% 0;
    transition: opacity 200ms ease, transform 260ms var(--spring, ease);
}
.cc.is-open .cc__panel { opacity: 1; transform: none; }
.cc__head { display: flex; justify-content: space-between; align-items: center; height: 60px; margin-bottom: 12px; padding: 0 6px; }
.cc__time { font-size: 34px; font-weight: 600; letter-spacing: -0.5px; }
.cc__heads { display: flex; gap: 14px; }
.cc__headico, .cc__avatar {
    width: 58px; height: 58px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.cc__headico { background: rgba(120, 128, 146, 0.35); box-shadow: inset 0 1px 0 rgba(255,255,255,0.2); }
.cc__avatar {
    font-size: 26px; font-weight: 700; color: #fff;
    background: radial-gradient(circle at 35% 30%, #7cc4ff, #2f6bdc 55%, #1b2f86 100%);
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.22);
}
.cc__viewport { max-height: 960px; overflow: hidden; padding: 8px 24px 12px; margin: -12px -24px 0; }   /* the grid and its two captions: 955 px, and 32 + 72 + 960 still clears 1080 */
/* One grid for every tile, 494 px wide: 240 + 14 + 240. 240 px is the narrowest
   column the French labels fit in ("Économiseur" needs 140 px at 24 px, in a
   148 px title box); wider than that only makes every tile a longer rectangle. */
.cc__body { display: grid; grid-template-columns: repeat(2, 240px); justify-content: center; gap: 14px; transition: transform 260ms var(--ease); }
/* The power tile is square: two 113 px rows and their 14 px gap are exactly its
   240 px width, and the two tiles beside it fill those rows instead of floating. */
.cc__body--main { grid-template-rows: 113px 113px; }
.cc__body--main > .cc__t--big + .cc__t, .cc__body--main > .cc__t--big + .cc__t + .cc__t { height: 100%; }
.cc__body--audio, .cc__body--pair, .cc__body--airplay { grid-template-columns: 1fr; gap: 12px; }

/* glass: translucent, light edge (perf: opaque, no blur) */
.cc__t {
    position: relative;
    display: flex;
    align-items: center;
    color: #fff;
    background: rgba(118, 126, 146, 0.30);
    -webkit-backdrop-filter: blur(30px) saturate(1.6);
    backdrop-filter: blur(30px) saturate(1.6);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.20), inset 0 0 0 1.5px rgba(255,255,255,0.07), 0 14px 30px rgba(0,0,0,0.22);
    transition: transform 220ms var(--spring, ease), background 150ms ease, color 150ms ease;
}
.cc__t--big {
    grid-row: span 2;
    width: 240px;
    height: 100%;           /* the two 113 px rows it spans */
    border-radius: 44px;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
}
.cc__t--big .cc__title { font-size: 26px; }
/* One cell is 113 px: the two rows under the power tile are 113 + 14 + 113, so a
   pill is exactly one cell tall and two wide, and a circle is one cell square.
   Every tile in the grid then follows the same measure, and each step is half
   the area of the one before it. */
.cc__t--pill { height: 113px; border-radius: 56.5px; gap: 12px; padding: 0 16px; min-width: 0; }
.cc__t--wide { grid-column: span 2; height: 113px; border-radius: 56.5px; gap: 12px; padding: 0 16px; }   /* Screensaver, Settings */
.cc__t--pill .cc__ico { width: 48px; height: 48px; }
.cc__t--pill .cc__title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 24px; }
/* The device name under Wi-Fi or Audio is a label, not a detail to clip. */
.cc__t--pill .cc__sub { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.15; font-size: 19px; }
/* The circles take an equal share of the row, so four of them fill the 494 px
   grid exactly (4 × 113 + 3 × 14); a row of one (Search) is marked solo by
   controlcenter.js and stays a small button. */
.cc__rounds { grid-column: span 2; display: flex; justify-content: center; align-items: center; gap: 14px; height: 113px; padding: 0; }
.cc__t--round { flex: none; width: 113px; height: 113px; border-radius: 50%; justify-content: center; }
.cc__rounds--solo, .cc__rounds--solo .cc__t--round { height: 113px; max-width: 113px; }
.cc__caption { display: block; grid-column: span 2; height: 20px; margin-top: -4px; text-align: center; font-size: 19px; font-weight: 500; line-height: 20px; color: rgba(255,255,255,0.78); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Spans both columns: 240 + 14 + 240 = 494, the width of the grid. */
.cc__t--slider { grid-column: span 2; height: 113px; border-radius: 56.5px; gap: 20px; padding: 0 26px 0 24px; }
.cc__t--row { min-height: 104px; border-radius: 52px; gap: 18px; padding: 14px 30px 14px 22px; }
.cc__ico {
    flex: none;
    width: 62px; height: 62px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.12);
}
.cc__t--row .cc__ico { width: 58px; height: 58px; }
.cc__t--slider .cc__ico { background: none; width: 40px; }
.cc__t.is-on .cc__ico { background: var(--tint, #0a84ff); color: #fff; }
.cc__bigico { display: flex; }
.cc__txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cc__title { font-size: 25px; font-weight: 600; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc__sub { margin-top: 3px; font-size: 21px; color: rgba(255,255,255,0.62); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc__t--row .cc__sub { white-space: normal; line-height: 1.2; }
.cc__check { flex: none; width: 34px; display: flex; justify-content: flex-end; color: #fff; }
.cc__bar { flex: 1; height: 16px; border-radius: 8px; background: rgba(255,255,255,0.2); overflow: hidden; }
.cc__bar i { display: block; height: 100%; background: #fff; border-radius: 8px; transition: width 150ms ease; }
.cc__val { width: 56px; text-align: right; font-size: 25px; font-weight: 600; }
.cc__sheethead { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 8px; font-size: 32px; font-weight: 700; }
.cc__sheethead svg { transform: rotate(180deg); opacity: 0.7; }
.cc__section { padding: 14px 24px 0; font-size: 19px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: rgba(255,255,255,0.55); }

.cc__t.is-focused { background: #f5f5f7; color: #1c1c1e; transform: scale(1.06); box-shadow: 0 20px 44px rgba(0,0,0,0.38); z-index: 1; }
.cc__t--round.is-focused { transform: scale(1.1); }
.cc__t.is-focused .cc__sub { color: #6e6e73; }
.cc__t.is-focused .cc__ico { background: rgba(0,0,0,0.07); }
.cc__t.is-focused.is-on .cc__ico { background: var(--tint, #0a84ff); color: #fff; }
.cc__t--round.is-on { background: var(--tint, #0a84ff); color: #fff; }
.cc__t--round.is-focused.is-on { background: #f5f5f7; color: var(--tint, #0a84ff); }
.cc__t--slider.is-focused .cc__ico { background: none; }
.cc__t.is-focused .cc__bar { background: rgba(0,0,0,0.12); }
.cc__t.is-focused .cc__bar i { background: #1d1d1f; }
.cc__t.is-focused .cc__check { color: #0a84ff; }

/* ===================== SCREEN SAVER (Aerial) ===================== */
.saver {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 60;
    background: #000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1200ms ease;
    overflow: hidden;
}
.saver.is-active { opacity: 1; pointer-events: auto; }
.saver__img {
    position: absolute;
    top: -4%; right: -4%; bottom: -4%; left: -4%;
    background: #000 center / cover no-repeat;
    opacity: 0;
    transition: opacity 2400ms ease;
}
.saver__img.is-on { opacity: 1; }
.saver__img.is-pan-a { animation: panA 16s linear forwards; }
.saver__img.is-pan-b { animation: panB 16s linear forwards; }
@keyframes panA { from { transform: scale(1.02) translate(-1.5%, 0); } to { transform: scale(1.12) translate(1.5%, -1%); } }
@keyframes panB { from { transform: scale(1.12) translate(1%, 1%); } to { transform: scale(1.02) translate(-1%, -1%); } }
.saver.no-motion .saver__img { animation: none; }
.saver__shade { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: linear-gradient(180deg, rgba(0,0,0,0.25), rgba(0,0,0,0) 30%, rgba(0,0,0,0) 70%, rgba(0,0,0,0.45)); }
.saver__time {
    position: absolute;
    top: 60px; right: 90px;
    font-size: 44px;
    font-weight: 500;
    color: rgba(255,255,255,0.9);
    text-shadow: 0 2px 16px rgba(0,0,0,0.6);
}
.saver__label {
    position: absolute;
    left: 90px; bottom: 76px;
    font-size: 30px;
    font-weight: 500;
    color: rgba(255,255,255,0.9);
    text-shadow: 0 2px 14px rgba(0,0,0,0.7);
    opacity: 0;
    transition: opacity 1200ms ease;
}
.saver__label.is-shown { opacity: 1; }
.saver.is-dark .saver__img { opacity: 0 !important; }
/* Centred on the screen: the box itself, one line high (top: 46% put its top there, the digits ~58 px low) */
.saver.is-dark .saver__time { top: 50%; right: auto; left: 0; width: 100%; text-align: center; font-size: 150px; font-weight: 300;
    line-height: 1; transform: translateY(-50%); }
/* The moving clock (screensaver.js, placeClock sets its corner): it fades out, changes corner, fades back in */
.saver.is-moving .saver__time { transition: opacity 900ms ease; }
.saver.is-moving .saver__time.is-away { opacity: 0; }

/* ===================== REDUCE MOTION ===================== */
.reduce-motion *, .reduce-motion *::after { transition-duration: 0ms !important; animation: none !important; }
.reduce-motion .tile.is-focused { transform: none; }

/* ===================== PERFORMANCE MODE (the default on the screen) =====================
   Real-time blur (backdrop-filter, filter: blur) is what made things lag:
   it is replaced by equivalent opaque backgrounds, and shadows are lightened. */
.perf .dock, .perf .status, .perf .settings__bg, .perf .toast {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
.perf .dock { background: rgba(46, 48, 56, 0.86); }
.perf .status { background: rgba(28, 28, 34, 0.8); }
.perf .cc__t { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(58, 62, 74, 0.94); }
.perf .cc__t.is-focused { background: #f5f5f7; }
.perf .cc__dim { background: rgba(0, 0, 0, 0.55); }
.perf .settings__bg { background: linear-gradient(160deg, #2b3446 0%, #171b24 100%); }
.perf .toast { background: rgba(30, 30, 36, 0.96); }
.perf.mode-grid .bg { filter: none; transform: none; }
.perf.mode-grid .scrim { opacity: 1; background: rgba(6, 7, 12, 0.84); }
.perf .tile__card { box-shadow: none; }
.perf .tile.is-focused .tile__card { box-shadow: 0 16px 26px rgba(0, 0, 0, 0.5); }
.perf .tile__card { transition: none; }             /* an animated shadow redraws the tile on every frame */
.perf .tile__icon, .perf .brandcard__icon { filter: none; }
.perf .saver__img.is-pan-a, .perf .saver__img.is-pan-b { animation: none; }

/* ===================== GRID BLURRED BACKGROUND (precomputed) ===================== */
.bgblur {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    overflow: hidden;
    background: #05060a;
    opacity: 0;
    transition: opacity 450ms ease;
}
/* Small image blurred only once, stretched on screen (nothing recomputed live) */
.bgblur__canvas {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 300ms ease;
}
.mode-grid .bgblur { opacity: 1; }
.mode-grid .bg, .perf.mode-grid .bg { filter: none; transform: none; }
.mode-grid .scrim, .perf.mode-grid .scrim { opacity: 1; background: rgba(4, 5, 10, 0.32); }

/* ===================== tvOS-STYLE MOTION ===================== */
:root { --spring: cubic-bezier(0.34, 1.32, 0.64, 1); }   /* slight bounce, like a spring */
.tile { transition: transform 150ms var(--spring); }
#row0 .tile { will-change: transform; }   /* a layer for the dock only: less memory, less work on every frame */

/* ===================== SCREEN SAVER: AERIAL VIDEOS ===================== */
.saver__video {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
    opacity: 0;
    transition: opacity 2400ms ease;
}
.saver__video.is-on { opacity: 1; }
.saver.is-video .saver__shade { background: linear-gradient(180deg, rgba(0,0,0,0.18), rgba(0,0,0,0) 22%, rgba(0,0,0,0) 72%, rgba(0,0,0,0.35)); }

/* ===================== "OK HELD" MENU (as on tvOS) ===================== */
.appmenu {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 40;
    display: none;
    pointer-events: none;
}
.appmenu__panel {
    position: absolute;
    min-width: 560px;
    padding: 12px;
    box-sizing: border-box;
    border-radius: 30px;
    background: rgba(58, 58, 64, 0.72);
    -webkit-backdrop-filter: blur(40px) saturate(170%);
    backdrop-filter: blur(40px) saturate(170%);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: scale(0.9);
    transform-origin: 30% 0;
    transition: opacity 180ms ease, transform 320ms var(--spring, cubic-bezier(.2,.9,.25,1.15));
}
.appmenu.is-above .appmenu__panel { transform-origin: 30% 100%; }
.appmenu.is-open .appmenu__panel { opacity: 1; transform: scale(1); }
.appmenu__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    height: 78px;
    padding: 0 26px 0 30px;
    border-radius: 18px;
    color: #fff;
    font-size: 31px;
    font-weight: 600;
    transition: background 160ms ease, color 160ms ease, transform 220ms ease;
}
.appmenu__icon { display: flex; opacity: 0.9; }
.appmenu__item.is-destructive { color: #ff453a; }
.appmenu__item.is-focused { background: #fff; color: #1d1d1f; transform: scale(1.03); }
.appmenu__item.is-focused.is-destructive { color: #ff3b30; }
.perf .appmenu__panel { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(40, 40, 46, 0.97); }

/* ===================== ALERT (confirmation) ===================== */
.aplalert {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 45;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.62);
    -webkit-backdrop-filter: blur(30px);
    backdrop-filter: blur(30px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
}
.perf .aplalert { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(8, 9, 12, 0.9); }
.aplalert.is-open { opacity: 1; pointer-events: auto; }
.aplalert__box {
    width: 760px;
    text-align: center;
    transform: scale(0.94);
    transition: transform 320ms var(--spring, cubic-bezier(.2,.9,.25,1.15));
}
.aplalert.is-open .aplalert__box { transform: scale(1); }
.aplalert__title { margin: 0 0 18px; font-size: 46px; font-weight: 700; color: #fff; }
.aplalert__msg { margin: 0 0 46px; font-size: 30px; line-height: 1.35; color: rgba(255, 255, 255, 0.62); white-space: pre-line; }
.aplalert__buttons { display: flex; flex-direction: column; align-items: center; gap: 18px; }
/* A QR code under the message (Settings › Support › Support APL Launcher): dark modules on white, sharp */
.aplalert__qr { display: flex; flex-direction: column; align-items: center; margin: -14px 0 40px; }
.aplalert__qr canvas { width: 300px; height: 300px; padding: 22px; border-radius: 34px; background: #fff; image-rendering: pixelated; box-shadow: 0 24px 60px rgba(0,0,0,0.45); }
.aplalert__qrurl { margin-top: 20px; font-size: 26px; font-weight: 600; color: rgba(255,255,255,0.8); }
.aplalert__btn {
    width: 600px;
    height: 86px;
    line-height: 86px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 32px;
    font-weight: 600;
    transition: background 160ms ease, color 160ms ease, transform 240ms var(--spring, ease);
}
.aplalert__btn.is-destructive { color: #ff453a; }
.aplalert__btn.is-focused { background: #fff; color: #1d1d1f; transform: scale(1.06); }
.aplalert__btn.is-focused.is-destructive { color: #ff3b30; }

/* ===================== EDIT HOME SCREEN ===================== */
@keyframes apl-jiggle {
    0%   { transform: rotate(-1.6deg); }
    50%  { transform: rotate(1.6deg); }
    100% { transform: rotate(-1.6deg); }
}
.is-editing .tile.is-moving .tile__card { animation: apl-jiggle 300ms ease-in-out infinite; }

/* Apple's Settings icon */
.vtile--settings .settings-art { filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.18)); }
.settings__card .settings-art { filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.45)); }
.perf .vtile--settings .settings-art, .perf .settings__card .settings-art { filter: none; }

/* ===================== ANIMATED BACKGROUNDS AND AUTOMATIC ICONS ===================== */
@keyframes kenA { from { transform: scale(1.0) translate(0, 0); } to { transform: scale(1.08) translate(-1.2%, -0.8%); } }
@keyframes kenB { from { transform: scale(1.08) translate(1%, -0.6%); } to { transform: scale(1.0) translate(0, 0); } }
.bg.is-motion.is-motion-a { animation: kenA 14s cubic-bezier(.25,.1,.25,1) forwards; }
.bg.is-motion.is-motion-b { animation: kenB 14s cubic-bezier(.25,.1,.25,1) forwards; }
.mode-grid .bg.is-motion { animation-play-state: paused; }
.reduce-motion .bg.is-motion { animation: none; }

/* No fill, no shadow, no sheen: anything drawn behind a transparent icon is a
   rectangle with the icon's outline in the middle of it. */
.tile__card--icon { overflow: hidden; background: transparent !important; box-shadow: none; }
.tile__card--icon::after { content: none; }
/* An app with no catalogue artwork: its real icon is the tile, edge to edge, as
   on tvOS. Kept at 68 % with the card's colour around it, the icon sat inside a
   rectangle of that colour - the plate that was still showing behind the icons.
   The rounded clip of the card shapes it, so the icon needs no frame of its own.
   The App Store icon keeps its own rounded square (it is drawn that way). */
.tile__card--icon .tile__icon { position: relative; z-index: 1; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.tile__card--icon .tile__icon--app { width: 100%; height: 100%; max-width: none; object-fit: cover; border-radius: 0; box-shadow: none; }
/* App Store icon: rounded square like an app, with a soft shadow */
.tile__icon--app { height: 74%; border-radius: 22%; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35); }

/* ===================== SOURCES (Apple TV style) ===================== */
.sources { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 36; opacity: 0; pointer-events: none; transition: opacity 220ms ease; }
.sources.is-open { opacity: 1; pointer-events: auto; }
.sources__dim {
    position: absolute; top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(6, 8, 14, 0.7);
    -webkit-backdrop-filter: blur(40px) saturate(1.4);
    backdrop-filter: blur(40px) saturate(1.4);
}
.perf .sources__dim { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(6, 8, 14, 0.9); }
/* White in both themes, like the cards: Sources keeps its dark veil in the light theme too,
   where the title took the theme's dark text and could hardly be seen. */
.sources__title { position: absolute; top: 120px; left: 0; right: 0; text-align: center; font-size: 56px; font-weight: 700; color: #fff; }
.sources__row { position: absolute; left: 0; right: 0; top: 360px; display: flex; justify-content: center; gap: 44px; padding: 0 96px; }
.sources__row.is-picking { top: 250px; flex-wrap: wrap; gap: 26px 30px; padding: 0 140px; }
/* As wide as 400 px, narrower when the screen has more inputs than fit (4 HDMI ports and AirPlay):
   the row keeps its margins and the focused card (×1.1) stays on screen */
.scard {
    flex: 0 1 400px;
    min-width: 0;
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    color: #fff;
    transition: transform 260ms var(--spring, ease);
}
.scard__art {
    position: relative;
    width: 100%; aspect-ratio: 5 / 3; border-radius: 36px;
    background: #222 center / cover no-repeat;
    box-shadow: 0 14px 30px rgba(0,0,0,0.3);
    transition: transform 260ms var(--spring, ease), box-shadow 260ms ease;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 10px;
}
/* Before Chromium 88 (Tizen 6.0 / 6.5) there is no aspect-ratio: the previous height, a little narrower */
@supports not (aspect-ratio: 5 / 3) {
    .scard__art { height: 240px; }
}
.scard__art--glass {
    background: rgba(118, 126, 146, 0.28);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), inset 0 0 0 1.5px rgba(255,255,255,0.07), 0 14px 30px rgba(0,0,0,0.3);
}
.scard__ico { width: 120px; height: 120px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.12); }
.scard__name { position: relative; z-index: 2; font-size: 32px; font-weight: 700; text-align: center; }
.scard__sub { position: relative; z-index: 2; font-size: 22px; color: rgba(255,255,255,0.6); text-align: center; min-height: 26px; max-width: 100%; }
.sources.is-picking .sources__hint { display: none; }
/* Under Sources, nothing of the Home Screen shows through: no Top Shelf title, dock or rows, clock or hint */
.has-sources .shelfinfo, .has-sources .home, .has-sources .status, .has-sources .hint { opacity: 0; }

/* ===================== SEARCH (search.js) ===================== */
.search { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 36; opacity: 0; pointer-events: none; transition: opacity 220ms ease; }
.search.is-open { opacity: 1; pointer-events: auto; }
.search__dim { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: rgba(6, 8, 14, 0.82); -webkit-backdrop-filter: blur(40px) saturate(1.4); backdrop-filter: blur(40px) saturate(1.4); }
.perf .search__dim { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(6, 8, 14, 0.94); }
.search__field { position: absolute; top: 96px; left: 70px; width: 1100px; height: 96px; padding: 0 20px; box-sizing: border-box; border: 0; border-radius: 22px; outline: none;
    background: transparent; color: #fff; caret-color: #fff; font: inherit; font-size: 64px; font-weight: 600; letter-spacing: -0.5px; transition: background 150ms ease, transform 150ms var(--ease); }
.search__field::placeholder { color: rgba(255, 255, 255, 0.35); }
.search__field.is-focused { background: rgba(255, 255, 255, 0.12); }
.search.is-typing .search__field { background: rgba(255, 255, 255, 0.08); }
.search__results { position: absolute; top: 320px; left: 85px; display: grid; grid-template-columns: repeat(var(--cols, 6), var(--tile-w)); column-gap: var(--gap-x); row-gap: 90px; }
.search__results .tile__label { opacity: 1; }
.search__empty { position: absolute; top: 250px; left: 90px; font-size: 26px; font-weight: 600; color: rgba(255, 255, 255, 0.6); }
.has-search .shelfinfo, .has-search .home, .has-search .status, .has-search .hint { opacity: 0; }
/* Search's hint, top left across from the status pill: a magnifier on the Home Screen, "▲ Search" in full screen.
   Search also has a button in the Control Center (controlcenter.js); this stays, because it is how the Home
   Screen itself says Search is up there. */
.search-hint { position: fixed; top: 50px; left: 42px; z-index: 9; height: 60px; padding: 0 18px; display: flex; align-items: center; gap: 10px; border-radius: 30px;
    background: rgba(26, 28, 36, 0.68); color: rgba(255, 255, 255, 0.9); font-size: 24px; font-weight: 600; transition: opacity 400ms ease; pointer-events: none; }
.search-hint__chevron, .search-hint__text { display: none; }
.search-hint__chevron { width: 13px; height: 13px; margin: 6px 2px 0 4px; border-left: 3px solid currentColor; border-top: 3px solid currentColor; border-radius: 2px; transform: rotate(45deg); }
.mode-full .search-hint__chevron, .mode-full .search-hint__text { display: block; }
.mode-grid .search-hint, .has-wdg .search-hint, .has-cc .search-hint, .has-sources .search-hint, .has-search .search-hint,
.has-settings .search-hint, .has-profiles .search-hint { opacity: 0; }
.theme-light .search-hint { background: rgba(236, 238, 244, 0.7); color: #1c1c1e; }
.scard.is-focused .scard__art { transform: scale(1.1); box-shadow: 0 34px 60px rgba(0,0,0,0.55); }
.scard.is-focused .scard__art--glass { background: #f5f5f7; color: #1c1c1e; }
.scard.is-focused .scard__art--glass .scard__ico { background: rgba(0,0,0,0.07); }
.scard--small { flex: 0 0 240px; width: 240px; gap: 6px; }                     /* six a row: the 16 cards fit in three rows */
.scard--small .scard__art { width: 240px; height: 144px; border-radius: 24px; }
.scard--small .scard__name { font-size: 24px; }
.scard--small .scard__sub { font-size: 18px; min-height: 0; }
.sources__hint { position: absolute; bottom: 130px; left: 0; right: 0; text-align: center; font-size: 24px; color: rgba(255,255,255,0.55); }

/* ===================== PROFILES (Apple TV style) ===================== */
.status__avatar.is-profile { display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; color: #fff; }
.cc__avatar.is-focused { transform: scale(1.18); box-shadow: 0 0 0 4px #fff, 0 10px 24px rgba(0,0,0,0.4); }
.cc__avatar { transition: transform 220ms var(--spring, ease); }
.profiles { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 37; opacity: 0; pointer-events: none; transition: opacity 200ms ease; }
.profiles.is-open { opacity: 1; pointer-events: auto; }
.profiles__dim { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: linear-gradient(270deg, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.6) 40%, rgba(0,0,0,0.35) 100%); }
.profiles__panel { position: absolute; top: 120px; right: 70px; width: 420px; }
.has-profiles .hint, .has-profiles .status { opacity: 0; }
.profiles__grid { display: grid; grid-template-columns: repeat(2, 190px); gap: 26px 40px; justify-content: end; }
.pitem { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pitem__avatar {
    width: 160px; height: 160px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 72px; font-weight: 700; color: #fff;
    box-shadow: 0 14px 30px rgba(0,0,0,0.35);
    transition: transform 240ms var(--spring, ease), box-shadow 240ms ease;
}
.pitem--add .pitem__avatar { background: rgba(118,126,146,0.35); box-shadow: inset 0 1px 0 rgba(255,255,255,0.2); }
.pitem__name { font-size: 26px; font-weight: 600; color: rgba(255,255,255,0.85); }
.pitem__check {
    position: absolute; top: 2px; right: 14px; width: 40px; height: 40px; border-radius: 50%;
    background: #30d158; color: #fff; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.35);
}
.pitem.is-focused .pitem__avatar { transform: scale(1.12); box-shadow: 0 0 0 5px #fff, 0 24px 44px rgba(0,0,0,0.5); }
.pitem.is-focused .pitem__name { color: #fff; }
.profiles__section { margin: 36px 0 14px; text-align: right; font-size: 20px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: rgba(255,255,255,0.6); }
.profiles__section:empty { display: none; }
.profiles__recents { display: grid; grid-template-columns: repeat(3, 120px); gap: 16px; justify-content: end; }
.precent__art {
    display: flex; align-items: center; justify-content: center; width: 120px; height: 72px; border-radius: 14px;
    background: #2a2a2e; overflow: hidden; font-size: 30px; font-weight: 700; color: #fff;
    transition: transform 220ms var(--spring, ease), box-shadow 220ms ease;
}
.precent__art img { height: 70%; }
.precent.is-focused .precent__art { transform: scale(1.15); box-shadow: 0 0 0 3px #fff, 0 16px 30px rgba(0,0,0,0.5); }
.pprompt { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 46; display: flex; align-items: center; justify-content: center; background: rgba(6,8,14,0.85); }
.pprompt__box { width: 760px; text-align: center; }
.pprompt__title { font-size: 44px; font-weight: 700; margin: 0 0 30px; }
.pprompt__input {
    width: 600px; height: 86px; border-radius: 18px; border: 0; outline: none; padding: 0 28px;
    font-family: inherit; font-weight: 600; font-size: 36px; line-height: 1; color: #1c1c1e; background: #f5f5f7; text-align: center;
}
.pprompt__hint { margin-top: 24px; font-size: 24px; color: rgba(255,255,255,0.6); }
/* 3D avatars (Memoji style) */
.pavatar { width: 86%; height: 86%; object-fit: contain; margin-top: 8%; pointer-events: none; }
.status__avatar .pavatar, .cc__avatar .pavatar { margin-top: 10%; }
.apicker { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 47; background: rgba(6, 8, 14, 0.9); display: flex; flex-direction: column; align-items: center; }
.apicker__title { margin: 70px 0 34px; font-size: 48px; font-weight: 700; }
.apicker__scroll { flex: 1; overflow: hidden; padding: 20px 30px 0; margin-top: -20px;
    -webkit-mask-image: linear-gradient(#000 88%, transparent); mask-image: linear-gradient(#000 88%, transparent); }
.apicker__grid { display: grid; grid-template-columns: repeat(10, 132px); gap: 26px 30px; transition: transform 320ms var(--spring, ease); }
.apicker__item {
    width: 132px; height: 132px; border-radius: 50%; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    transition: transform 220ms var(--spring, ease), box-shadow 220ms ease;
}
.apicker__item img { width: 88%; height: 88%; object-fit: contain; margin-top: 10%; }
.apicker__item.is-custom img, .pavatar--memoji { width: 100%; height: 100%; margin-top: 14%; }
.status__avatar .pavatar--memoji, .cc__avatar .pavatar--memoji { margin-top: 14%; }
.apicker__item.is-focused { transform: scale(1.18); box-shadow: 0 0 0 5px #fff, 0 18px 36px rgba(0,0,0,0.5); }
.pitem__avatar { overflow: hidden; }
/* Change Icon (hold OK on an app, launcher.js chooseIcon): the launcher's tiles, Original first.
   A row is 132 + 12 + 30 + 30 = 204 px, launcher.js ROW. */
.ipicker { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 47; background: rgba(6, 8, 14, 0.92); display: flex; flex-direction: column; align-items: center; }
.ipicker__title { margin: 70px 0 34px; max-width: 1600px; font-size: 48px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ipicker__scroll { flex: 1; overflow: hidden; padding: 24px 40px 0; margin-top: -24px;
    -webkit-mask-image: linear-gradient(#000 88%, transparent); mask-image: linear-gradient(#000 88%, transparent); }
.ipicker__grid { display: grid; grid-template-columns: repeat(6, 220px); gap: 30px 40px; transition: transform 320ms var(--spring, ease); }
.ipicker__item { transition: transform 220ms var(--spring, ease); }
.ipicker__art { position: relative; width: 220px; height: 132px; border-radius: 22px; overflow: hidden; display: flex; align-items: center; justify-content: center;
    background: #111 center / cover no-repeat; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4); transition: box-shadow 220ms ease; }
.ipicker__art img { width: 70px; height: 70px; object-fit: contain; }
.ipicker__name { height: 30px; margin-top: 12px; font-size: 22px; font-weight: 500; line-height: 30px; text-align: center; color: rgba(255, 255, 255, 0.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ipicker__item.is-current .ipicker__name { color: rgba(255, 255, 255, 0.9); }
.ipicker__item.is-focused { transform: scale(1.12); }
.ipicker__item.is-focused .ipicker__art { box-shadow: 0 0 0 5px #fff, 0 18px 36px rgba(0, 0, 0, 0.5); }
.ipicker__item.is-focused .ipicker__name { color: #fff; }


/* ===================== FOLDERS ===================== */
.ftile {
    position: absolute; top: 0; right: 0; bottom: 0; left: 0;
    display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr);
    gap: 8px; padding: 20px 22px;
    background: rgba(214, 216, 226, 0.92);
}
.ftile i { display: block; border-radius: 7px; background-position: center; background-size: cover; background-repeat: no-repeat; }
.folder {
    position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 30;
    display: none;
    background: rgba(8, 9, 14, 0.9);
}
.folder.is-open { display: block; }
.folder__title { position: absolute; top: 96px; left: 0; right: 0; text-align: center; font-size: 56px; font-weight: 700; letter-spacing: -0.5px; }
.folder__input { width: 800px; background: none; border: 0; border-bottom: 3px solid currentColor; color: inherit; font: inherit; text-align: center; outline: none; }
.folder__grid {
    position: absolute; top: 260px; left: 85px;
    display: grid; grid-template-columns: repeat(var(--cols), var(--tile-w)); column-gap: var(--gap-x); row-gap: 90px;
}
.folder .tile.is-focused .tile__label { opacity: 1; }

/* ===================== APP SWITCHER ===================== */
.sw {
    position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 32;
    display: none; overflow: hidden;
    background: rgba(6, 7, 12, 0.94);
}
.sw.is-open { display: block; }
.sw__row {
    position: absolute; left: 0; top: 240px;
    display: flex; gap: 70px; align-items: flex-start;
    transition: transform 280ms var(--ease);
    will-change: transform;
}
.sw__card { flex: none; width: 1000px; opacity: 0.55; transform: scale(0.9); transition: transform 240ms var(--ease), opacity 200ms ease; }
.sw__card.is-focused { opacity: 1; transform: none; }
.sw__head { height: 66px; font-size: 34px; font-weight: 600; }
.sw__pic { width: 1000px; height: 562px; border-radius: 28px; box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5); }
.sw__hint { position: absolute; left: 0; right: 0; bottom: 70px; text-align: center; font-size: 26px; color: rgba(255, 255, 255, 0.65); }

/* ===================== SCREEN SAVER: LARGE CLOCK ===================== */
.saver.is-clock .saver__label { display: none; }
.saver.is-clock .saver__time {
    position: absolute; left: 0; right: 0; top: 240px; bottom: auto;
    text-align: center; font-size: 340px; font-weight: 700; line-height: 1; letter-spacing: -6px;
    color: rgba(255, 255, 255, 0.92); text-shadow: 0 8px 60px rgba(0, 0, 0, 0.35);
}

/* ===================== LIGHT MODE ===================== */
.theme-light { color: #1d1d1f; }
.theme-light.mode-grid .scrim, .theme-light.perf.mode-grid .scrim { background: rgba(240, 241, 246, 0.72); }
.theme-light .bgblur { background: #e9eaf0; }
.theme-light .dock, .theme-light.perf .dock { background: rgba(244, 245, 249, 0.88); }
.theme-light .status, .theme-light.perf .status { background: rgba(246, 246, 250, 0.9); color: #1d1d1f; }
.theme-light .tile__label { color: #1d1d1f; text-shadow: none; }
.theme-light .toast, .theme-light.perf .toast { background: rgba(250, 250, 252, 0.97); color: #1d1d1f; }
.theme-light .hint { color: #fff; }
/* Control Center */
.theme-light .cc__dim, .theme-light.perf .cc__dim { background: rgba(232, 233, 240, 0.55); }
.theme-light .cc__t, .theme-light.perf .cc__t { background: rgba(250, 250, 253, 0.94); color: #1c1c1e; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12); }
.theme-light .cc__t.is-focused, .theme-light.perf .cc__t.is-focused { background: #fff; box-shadow: 0 20px 44px rgba(0, 0, 0, 0.26); }
.theme-light .cc__sub { color: #6e6e73; }
.theme-light .cc__ico { background: rgba(0, 0, 0, 0.07); }
.theme-light .cc__t.is-on .cc__ico { background: var(--tint, #0a84ff); color: #fff; }
.theme-light .cc__check { color: #0a84ff; }
.theme-light .cc__bar { background: rgba(0, 0, 0, 0.13); }
.theme-light .cc__bar i { background: #1c1c1e; }
.theme-light .cc__time, .theme-light .cc__sheethead, .theme-light .cc__caption { color: #1d1d1f; }
.theme-light .cc__section { color: #5a5a60; }
.theme-light .cc__headico { background: rgba(255, 255, 255, 0.8); color: #1c1c1e; }
/* Settings */
.theme-light .settings, .theme-light .settings__title { color: #1d1d1f; }
.theme-light .settings__bg, .theme-light.perf .settings__bg { background: linear-gradient(160deg, #eef0f5 0%, #d6d9e2 100%); }
.theme-light .srow { background: rgba(255, 255, 255, 0.62); box-shadow: none; color: #1d1d1f; }
.theme-light .srow.is-focused { background: #fff; }
.theme-light .srow__value, .theme-light .srow__acc { color: #6e6e73; }
.theme-light .srow__bar { background: rgba(0, 0, 0, 0.13); }
.theme-light .srow__bar i { background: #1d1d1f; }
.theme-light .settings__desc, .theme-light .settings__path, .theme-light .srow__section { color: #55555b; }
.theme-light .settings__full { color: #6e6e73; }
/* Menus, folders, switcher */
.theme-light .appmenu__panel { background: rgba(250, 250, 253, 0.97); color: #1d1d1f; }
.theme-light .aplalert__box { background: rgba(250, 250, 253, 0.98); color: #1d1d1f; }
.theme-light .folder { background: rgba(236, 238, 244, 0.94); color: #1d1d1f; }
.theme-light .sw { background: rgba(236, 238, 244, 0.96); color: #1d1d1f; }
.theme-light .sw__hint { color: #55555b; }
/* "Continue Watching" (widgets.js): the whole top of the screen, on a blurred background taken from the image */
/* Nothing at all while there is no card: no extra layer while navigating */
.wdg { display: none; position: fixed; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; }
.wdg.is-on { display: block; animation: wdgIn 240ms ease; }
@keyframes wdgIn { from { opacity: 0; } to { opacity: 1; } }
.mode-grid .wdg { display: none; }
.has-wdg .hint, .has-alert .hint { opacity: 0; }
.wdg__bg { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: linear-gradient(120deg, #20409a 0%, #1476a8 55%, #0f8f96 100%); }
.wdg__blur { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 240ms ease; }
.wdg__row { position: absolute; left: 90px; top: 96px; display: flex; gap: 44px; transition: transform 320ms var(--spring, ease); will-change: transform; }
.wdg__heading { height: 58px; font-size: 28px; font-weight: 600; color: rgba(255, 255, 255, 0.82); }
.wdg__item.is-out .wdg__heading { opacity: 0; }      /* a card cut by the screen's edge: no heading under the clock (widgets.js markOut) */
.wdg__heading { transition: opacity 200ms ease; }
.wdg__card { position: relative; flex: none; width: 800px; height: 450px; border-radius: 26px; overflow: hidden; background: #14161c; color: #fff; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35); transition: transform 240ms var(--spring, ease), box-shadow 240ms ease; will-change: transform; }
.wdg__card.is-focused { transform: scale(1.05); box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55); }
.wdg__pic { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; align-items: center; justify-content: center; padding-bottom: 90px; color: rgba(255, 255, 255, 0.4); background: center / cover no-repeat; }
.wdg__card--channel { background: radial-gradient(70% 80% at 50% 36%, #3a3e4a 0%, #16181f 100%); }
.wdg__card--channel .wdg__pic { box-sizing: border-box; padding: 54px 150px 130px; background-origin: content-box; background-size: contain; background-position: center; }
.wdg__mark { font-size: 96px; font-weight: 700; letter-spacing: -2px; color: #fff; text-align: center; line-height: 1.05; }
.sw__widgets .wdg__card--channel .wdg__pic { padding: 22px 60px 54px; }
.sw__widgets .wdg__mark { font-size: 38px; letter-spacing: 0; }
/* The same room under the text on every card, bar or not: the texts of two cards stay on one line */
.wdg__txt { position: absolute; left: 0; right: 0; bottom: 0; padding: 90px 30px 34px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.8) 62%); }
.wdg__label { display: none; }
.wdg__title { font-size: 34px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wdg__sub { font-size: 24px; color: rgba(255, 255, 255, 0.76); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wdg__bar { position: absolute; left: 30px; right: 30px; bottom: 16px; height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.3); overflow: hidden; }
.wdg__bar i { display: block; height: 100%; border-radius: 4px; background: #fff; }
.wdg__logo { position: absolute; left: 30px; bottom: 96px; max-width: 46%; max-height: 130px; object-fit: contain; object-position: left bottom; filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.55)); }
.wdg__card.is-titled .wdg__title { display: none; }
.wdg-focus #row0 .tile.is-focused { transform: none; }
.wdg-focus #row0 .tile.is-focused .tile__card { box-shadow: none; }
.sw__pic { position: relative; }
.sw__widgets { position: absolute; left: 24px; bottom: 24px; display: flex; gap: 14px; }
.sw__widgets .wdg__card { width: 320px; height: 180px; border-radius: 18px; }
.sw__widgets .wdg__pic { padding-bottom: 40px; }
.sw__widgets .wdg__txt { padding: 26px 14px 20px; }
.sw__widgets .wdg__label { display: block; font-size: 15px; font-weight: 600; color: rgba(255, 255, 255, 0.76); }
.sw__widgets .wdg__title { font-size: 21px; }
.sw__widgets .wdg__sub { font-size: 15px; }
.sw__widgets .wdg__bar { left: 14px; right: 14px; bottom: 8px; height: 5px; }
.sw__widgets .wdg__logo { left: 14px; bottom: 44px; max-height: 50px; }

/* ===================== LIQUID GLASS =====================
   The dock, the Control Center's tiles and the status pill, like tvOS 26: a clear sheet, lightly tinted,
   with light pooling in its top left corner, a thick rim that catches the light where it is lit (top
   left) and again on the far edge (bottom right), a faint glow along its bottom and a soft shadow under
   it. Static gradients and a masked rim, no live blur: the same cost with visual effects off (.perf,
   the default on the screen). Declared last, it overrides the glass above. */
.dock, .perf .dock,
.status, .perf .status,
.search-hint, .perf .search-hint,
.cc__t, .perf .cc__t {
    background:
        radial-gradient(120% 90% at 12% 0%, rgba(255,255,255,0.13) 0%, rgba(255,255,255,0.03) 45%, rgba(255,255,255,0) 70%),
        linear-gradient(180deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.01) 50%, rgba(255,255,255,0.03) 100%),
        rgba(26, 28, 36, 0.40);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.22),         /* the top edge catching the light */
        inset 0 0 14px rgba(255,255,255,0.07),        /* lensing: the glass a little brighter along its edges */
        0 12px 32px rgba(0,0,0,0.24);
}
.dock::before, .status::before, .search-hint::before, .cc__t::before {
    content: "";
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    border-radius: inherit;
    padding: 1px;                                     /* a hairline: the mask keeps only this ring */
    background: linear-gradient(135deg, rgba(255,255,255,0.42) 0%, rgba(255,255,255,0.10) 24%,
                rgba(255,255,255,0.02) 50%, rgba(255,255,255,0.06) 76%, rgba(255,255,255,0.24) 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}
/* The dock: the picture behind it, frosted (launcher.js sets the soft copy and lines it up), under the tint.
   No live blur under it, even with visual effects on: it would be computed and never seen */
.dock, .perf .dock {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background:
        radial-gradient(120% 90% at 12% 0%, rgba(255,255,255,0.13) 0%, rgba(255,255,255,0.03) 45%, rgba(255,255,255,0) 70%),
        linear-gradient(180deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.01) 50%, rgba(255,255,255,0.03) 100%),
        linear-gradient(rgba(26, 28, 36, 0.40), rgba(26, 28, 36, 0.40)),
        var(--glass-img, none) -42px var(--glass-y, -783px) / 1920px 1080px no-repeat;
}
/* Without blur behind them, the Control Center's tiles need more tint than the dock to stay readable */
.cc__t, .perf .cc__t {
    background:
        radial-gradient(120% 90% at 12% 0%, rgba(255,255,255,0.13) 0%, rgba(255,255,255,0.03) 45%, rgba(255,255,255,0) 70%),
        linear-gradient(180deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.01) 50%, rgba(255,255,255,0.03) 100%),
        rgba(26, 28, 36, 0.72);
}
/* The focused tile stays the bright Apple one, with its shadow */
.cc__t.is-focused, .perf .cc__t.is-focused { box-shadow: 0 20px 44px rgba(0,0,0,0.38); }
.cc__t.is-focused::before { opacity: 0; }

/* One right edge for the dock, the status pill and the Control Center; the Home Screen steps back under
   the Control Center (dock, rows and the Top Shelf title), like the status pill and the hint */
.status { right: 42px; }
.cc__panel { right: 42px; }
.home { transition: transform 200ms var(--ease), opacity 220ms ease; }   /* its slide kept */
.has-cc .home, .has-cc .shelfinfo { opacity: 0; }

.theme-light .dock, .theme-light.perf .dock,
.theme-light .status, .theme-light.perf .status,
.theme-light .search-hint, .theme-light.perf .search-hint,
.theme-light .cc__t, .theme-light.perf .cc__t {
    background:
        radial-gradient(120% 90% at 12% 0%, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.55) 45%, rgba(255,255,255,0.35) 70%),
        linear-gradient(180deg, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0.35) 50%, rgba(255,255,255,0.45) 100%),
        rgba(236, 238, 244, 0.30);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), inset 0 0 14px rgba(255,255,255,0.35), 0 10px 28px rgba(0,0,0,0.12);
}
.theme-light .cc__t, .theme-light.perf .cc__t { background-color: rgba(236, 238, 244, 0.6); }
.theme-light .dock::before, .theme-light .status::before, .theme-light .search-hint::before, .theme-light .cc__t::before {
    background: linear-gradient(135deg, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0.35) 25%,
                rgba(0,0,0,0.04) 55%, rgba(255,255,255,0.25) 80%, rgba(255,255,255,0.6) 100%);
}
.theme-light .cc__t.is-focused, .theme-light.perf .cc__t.is-focused { box-shadow: 0 20px 44px rgba(0,0,0,0.26); }
/* The light dock, frosted too (after the light glass above, which it refines) */
.theme-light .dock, .theme-light.perf .dock {
    background:
        radial-gradient(120% 90% at 12% 0%, rgba(255,255,255,0.75) 0%, rgba(255,255,255,0.35) 45%, rgba(255,255,255,0.15) 70%),
        linear-gradient(180deg, rgba(255,255,255,0.35) 0%, rgba(255,255,255,0.18) 50%, rgba(255,255,255,0.25) 100%),
        linear-gradient(rgba(236, 238, 244, 0.45), rgba(236, 238, 244, 0.45)),
        var(--glass-img, none) -42px var(--glass-y, -783px) / 1920px 1080px no-repeat;
}

/* The status pill and the magnifier across from it: more tint than the dock, the time stays readable over a
   bright picture (snow, white posters) */
.status, .perf .status,
.search-hint, .perf .search-hint {
    background:
        radial-gradient(120% 90% at 12% 0%, rgba(255,255,255,0.13) 0%, rgba(255,255,255,0.03) 45%, rgba(255,255,255,0) 70%),
        linear-gradient(180deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.01) 50%, rgba(255,255,255,0.03) 100%),
        rgba(26, 28, 36, 0.68);
}
.theme-light .status, .theme-light.perf .status,
.theme-light .search-hint, .theme-light.perf .search-hint { background-color: rgba(236, 238, 244, 0.7); }
/* The time follows the pill: it kept its white in the light theme, invisible on the pale glass */
.theme-light .status__clock { color: #1d1d1f; }

/* A round button that is on keeps its color (Game Mode green…), with visual effects off too: the glass
   rules above have the same weight and came later */
.cc__t--round.is-on, .perf .cc__t--round.is-on, .theme-light .cc__t--round.is-on, .theme-light.perf .cc__t--round.is-on {
    background: var(--tint, #0a84ff); color: #fff;
}
.cc__t--round.is-focused.is-on, .perf .cc__t--round.is-focused.is-on,
.theme-light .cc__t--round.is-focused.is-on, .theme-light.perf .cc__t--round.is-focused.is-on {
    background: #f5f5f7; color: var(--tint, #0a84ff);
}

/* ===================== LG, 4K: NOTHING PAINTED ON A MOVE =====================
   LG's browser draws on the GPU thread that also puts each frame on screen, so whatever is painted during a
   move takes that time from the frames (a G5: a tile with its blurred shadow 3.5 ms, the clock pill 25 ms,
   a 4K backdrop 30 ms, against 16.6 ms a frame). Here a move changes transforms and opacities of layers that
   already exist, and pictures are composited from their own bitmaps. All behind .is-webos (js/webos.js). */

/* A backdrop picture (an <img>, launcher.js showPicture) is its own layer: a layer made of one image is
   rastered at the image's size (480 x 270 for the generated artwork) and scaled by the GPU, where the
   layer around it was painted in 4K, 8 Mpx for a soft picture. The layer around it has no black of its own
   then, and it is kept for good (it holds nothing): only a card (Settings, Sources) is a 4K layer, kept
   while it is shown. */
.is-webos .bg:has(> img:not(.brandcard__icon)) { background: none !important; will-change: opacity; }
.is-webos .bg > img:not(.brandcard__icon) { will-change: transform; }
/* A card (launcher.js cardBack): its glow is such a picture, and its icon and name are layers the size of
   themselves, so the card's own full-screen layer holds nothing */
.is-webos .brandcard > * { will-change: transform; }

/* What is hidden holds no memory, and what comes back is not painted again. LG gives the page 125 MB of
   tiles (half of --force-gpu-mem-available-mb=250). Past it the browser throws away what isn't on screen
   and paints it again when it returns: with a closed Settings panel still painted in 4K under everything
   (32 MB) and a card kept ready (32 MB), opening the Control Center or the grid repainted the dock, the
   clock, the magnifier and every tile, 100 to 600 ms of GPU each time (a G5).
   - A closed panel is not painted at all (visibility), once its fade is over.
   - What fades out and back keeps its layers while it is out: with will-change its opacity is a change the
     compositor makes alone; without it, each fade rebuilt and repainted everything under it. */
/* Settings: the focused row's white plate and its shadow are one layer sliding from row to row (settings.js
   placePlate), as on tvOS; the row itself only changes the colour of its text, at once. Its background and
   shadow fading on focus repainted its 1736 x 360 layer on every frame of the change (80 ms of GPU a move). */
.is-webos .srow__plate { position: absolute; left: 0; top: 0; width: 100%; height: 72px; border-radius: 36px; background: #fff;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28); opacity: 0; pointer-events: none; will-change: transform, opacity;
    transition: transform 250ms var(--ease), opacity 200ms ease; }
.is-webos .srow__plate.is-on { opacity: 1; }
.is-webos .srow { position: relative; transition: none; }
.is-webos .srow.is-focused, .is-webos .theme-light .srow.is-focused { background: transparent; box-shadow: none; transform: none; }
/* Sources: its dim a layer of its own, a plain colour the screen draws without painting it. Inside the sheet's
   layer it made opening Sources raster a 4K surface (113 ms of GPU on a G5). */
.is-webos .sources__dim { will-change: opacity; }
.is-webos .settings:not(.is-open) { visibility: hidden; transition: opacity 350ms ease, visibility 0s linear 350ms; }
.is-webos .sources:not(.is-open), .is-webos .search:not(.is-open) { visibility: hidden; transition: opacity 220ms ease, visibility 0s linear 220ms; }
.is-webos .profiles:not(.is-open) { visibility: hidden; transition: opacity 200ms ease, visibility 0s linear 200ms; }
.is-webos .boot.is-hidden { visibility: hidden; transition: opacity 500ms ease, visibility 0s linear 500ms; }
.is-webos .home { will-change: transform, opacity; }
.is-webos .status, .is-webos .search-hint, .is-webos .hint { will-change: opacity; }
.is-webos .shelfinfo { will-change: transform, opacity; }

/* A tile: its small shadow never changes and nothing is painted on it on focus. Its large shadow, its sheen
   and its name in the grid are two shared sets of layers (launcher.js focusFx) put where the focus is: they
   have the tile's box and its scale, with the same spring, so they move as one with it. */
.is-webos .tile .tile__card, .is-webos .tile.is-focused .tile__card { box-shadow: 0 4px 10px rgba(0, 0, 0, 0.30); transition: none; }
.is-webos .tile__card::after { content: none; }
.is-webos .home .tile.is-focused .tile__label { opacity: 0; }
.tfx { position: absolute; width: var(--tile-w); height: var(--tile-h); pointer-events: none; opacity: 0; transform: scale(1);
       transition: transform 150ms var(--spring), opacity 160ms ease; will-change: transform, opacity; }
.tfx.is-on { opacity: 1; transform: scale(1.2); }
.tfx--lift > img { position: absolute; left: -80px; top: -80px; width: calc(100% + 160px); height: calc(100% + 160px); max-width: none; }
.tfx--sheen { z-index: 4; border-radius: var(--radius); overflow: hidden; transition: transform 150ms var(--spring), opacity 300ms var(--ease); }
.tfx--sheen > img { display: block; width: 100%; height: 100%; }
.tfx--name { z-index: 2; transition: transform 150ms var(--spring), opacity 200ms ease; }
.tfx--name > span { position: absolute; left: 50%; top: calc(100% + 12px); transform: translateX(-50%); font-size: 24px; font-weight: 500;
                    white-space: nowrap; color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6); }
.theme-light .tfx--name > span { color: #1d1d1f; text-shadow: none; }

/* The clock: its text is a layer, so a new minute doesn't repaint the pill under it (25 ms) */
.is-webos .status__clock { will-change: transform; }

/* The Control Center's tiles: under its pane a tile's own fill and rim are never seen, so the tile paints
   nothing at all there, focused or not: no layer, where each tile's own (fill, blurred shadow, masked rim)
   was 10 ms to paint and 1.2 MB, 15 MB for the twelve of them kept ready. Focus is the pane's plate and the
   text. The soft shadow under a tile goes with it: over the dimmed screen it could hardly be seen. No fade
   of the text colour, which repainted the tile on every frame. */
.is-webos body.glass .cc__t, .is-webos body .cc__t { transition: transform 220ms var(--spring, ease); }
.is-webos .cc__t:has(> .cg__glass.is-on), .is-webos .cc__t.is-focused:has(> .cg__glass.is-on) { background: none; box-shadow: none; }
.is-webos .cc__t:has(> .cg__glass.is-on)::before { content: none; }

/* Settings: the list's fade at its top and bottom was a mask, a second surface the size of the list (22 MB
   with it) drawn again on every frame it scrolled. With Visual Effects off the list is simply cut at its
   edges. With the Settings panel (32 MB) the page then stays under the TV's 125 MB: past it, a band of the
   panel was left unpainted, a black bar (a G5). */
.is-webos .perf .settings__listwrap { -webkit-mask-image: none; mask-image: none; }

/* LG, 4K: the screen blends every full-screen layer on every frame, 8.3 million pixels each, and that was the
   limit on a G5 (the inspector's quads: 37 Mpx a frame at rest on the Home Screen, 67 during a crossfade,
   frames dropped while the GPU caught up). What is covered whole is no longer drawn at all:
   - the page's own black: the TV's window is black already (appinfo.json bgColor), and it was blended under
     every picture;
   - under the Continue cards, once they have faded in (an opaque gradient, then their opaque blurred
     picture, widgets.js wdg-solid): the backdrop, its scrim and the grid's blur;
   - under the cards' blurred picture, their gradient (a layer of its own that only fades, widgets.js);
   - the scrim's empty middle: its bottom half and its top band are two layers, a third of the screen less;
   - the Control Center and Sources while closed: 70 layers the screen kept in every frame (is-gone). */
html.is-webos, .is-webos body { background: transparent; }
.is-webos body.wdg-solid:not(.mode-grid) .bg,
.is-webos body.wdg-solid:not(.mode-grid) .scrim,
.is-webos body.wdg-solid:not(.mode-grid) .scrim-top,
.is-webos body.wdg-solid:not(.mode-grid) .bgblur { visibility: hidden; }
.is-webos .wdg__bg { background: none; }
.is-webos .wdg__bg::before { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0;
    background: linear-gradient(120deg, #20409a 0%, #1476a8 55%, #0f8f96 100%); will-change: opacity; }
.is-webos .wdg--blurred .wdg__bg::before { opacity: 0; }
.is-webos .scrim, .is-webos .mode-grid .scrim, .is-webos .perf.mode-grid .scrim, .is-webos .theme-light.mode-grid .scrim,
.is-webos .theme-light.perf.mode-grid .scrim { top: 50%; height: 12.5%;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.55) 40%, rgba(0,0,0,0.92) 72%, #000 100%); }
.is-webos .scrim-top { position: fixed; top: 0; left: 0; width: 100%; height: 16%; pointer-events: none;
    background: linear-gradient(180deg, rgba(0,0,0,0.30) 0%, rgba(0,0,0,0) 100%);
    transition: opacity 500ms ease; will-change: opacity; }
.is-webos .mode-full .scrim-top { opacity: 0.25; }
.is-webos .mode-grid .scrim-top, .is-webos.is-cc-overlay .scrim-top { opacity: 0; }
.is-webos .cc.is-gone, .is-webos .sources.is-gone { display: none; }

/* The Control Center over the apps (LG's Guide button on a rooted TV, js/webos.js): this page is a window LG
   draws over the app in front, see-through, with nothing but the panel. The app's own picture stays under it. */
html.is-cc-overlay, html.is-cc-overlay body { background: transparent; }
.is-cc-overlay .bg, .is-cc-overlay .bgblur, .is-cc-overlay .scrim, .is-cc-overlay .status, .is-cc-overlay .shelfinfo,
.is-cc-overlay .hint, .is-cc-overlay .home { display: none; }
/* And the start-up screen: LG opens this window as a page of its own over the app in front, so the
   launcher's boot runs again in it and would cover what is playing with a black plate and the mark. */
.is-cc-overlay .boot { display: none; }

/* ---------- Trailer over the full-screen artwork ----------
   A layer of its own, between the pictures and the scrim: the picture under it
   can change without taking the video with it, and the scrim, the dock and the
   title cards stay above exactly as they were. */
.trailerlayer {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 600ms linear;
}

.trailerlayer.is-on { opacity: 1; }

/* Larger than the layer, so the player's own corner branding falls outside the
   frame: the video is cropped at the edges, which nothing in the picture
   notices. The extra height goes to the bottom, where the player keeps its
   progress bar, its title card and the "watch on YouTube" line - 6 % all round
   left those in view, 12 % down the bottom takes them out. */
.trailerlayer {
    overflow: hidden;
}

.trailerlayer > iframe {
    position: absolute;
    top: -6%;
    left: -3%;
    width: 106%;
    height: 118%;
    border: 0;
}

/* ===================== NOTHING DRIFTS UNDER A PANEL ===================== */
/* Nothing drifts while a panel is over the wall: the artwork's slow move was
   costing a full-screen transform every frame behind the Control Center. */
.has-cc .bg.is-motion,
.has-sources .bg.is-motion,
.has-search .bg.is-motion,
.has-settings .bg.is-motion,
.has-profiles .bg.is-motion,
.has-wdg .bg.is-motion { animation-play-state: paused; }
