/*
**
**
**
**
**
** Home Screen
** =================================
**
** The customizable home screen: an iPhone style grid of app icons and widgets.
** Wallpapers live in wallpapers.css. Every rule supports light and dark through
** [data-hs-theme="dark"], which TL.HomeScreen sets on #TL-Home and on its sheets.
*/

/*
**
**
**
**
**
** Design Tokens
** =================================
*/

:root {
	/* Grid geometry - one cell is one app icon, widgets span 2x2, 4x2 and 4x4 cells */
	--HS-Cell: 100px;
	--HS-Gap-X: 36px;
	--HS-Gap-Y: 32px;
	--HS-Span-2-W: calc(var(--HS-Cell) * 2 + var(--HS-Gap-X));
	--HS-Span-4-W: calc(var(--HS-Cell) * 4 + var(--HS-Gap-X) * 3);
	--HS-Span-2-H: calc(var(--HS-Cell) * 2 + var(--HS-Gap-Y));
	--HS-Span-4-H: calc(var(--HS-Cell) * 4 + var(--HS-Gap-Y) * 3);

	/* Space under each tile reserved for its label */
	--HS-Label-Space: 20px;

	/* Motion - a quick spring for most things, a softer one for reflowing tiles */
	--HS-Spring: cubic-bezier(0.2, 1.3, 0.35, 1);
	--HS-Spring-Soft: cubic-bezier(0.25, 1.15, 0.4, 1);
	--HS-Ease-Out: cubic-bezier(0.2, 0.8, 0.2, 1);

	/*
	** Coming & going - a quick dive into an app, a bubbly settle on the way back home,
	** and a springy pop for the icon that catches the app as it lands
	*/
	--HS-Dive: 320ms cubic-bezier(0.32, 0.72, 0, 1);
	--HS-Settle: 560ms cubic-bezier(0.3, 1.4, 0.5, 1);
	--HS-Pop: 520ms cubic-bezier(0.28, 1.65, 0.5, 1);
	--HS-Land: 190ms;
}

#TL-Home,
.HS-Sheet-Drawer {
	--HS-Text: #1d1d1f;
	--HS-Text-2: #5f5f66;
	--HS-Text-3: #8e8e93;
	--HS-Accent: #5b5bd6;
	--HS-Accent-Soft: rgba(91, 91, 214, 0.12);
	--HS-Alert: #e0453a;
	--HS-Good: #23a35a;
	--HS-Hairline: rgba(20, 20, 30, 0.08);
	--HS-Hover: rgba(20, 20, 30, 0.05);

	/* Glass surfaces for widgets, pills and sheets */
	--HS-Glass: rgba(255, 255, 255, 0.68);
	--HS-Glass-Strong: rgba(255, 255, 255, 0.86);
	--HS-Glass-Border: rgba(255, 255, 255, 0.7);
	--HS-Glass-Shadow: 0 14px 34px -14px rgba(30, 30, 60, 0.28), 0 1px 2px rgba(30, 30, 60, 0.06);

	/* App icon squircle */
	--HS-Icon-Fill: linear-gradient(160deg, #ffffff 0%, #f4f4f7 100%);
	--HS-Icon-Shadow: 0 6px 16px -6px rgba(30, 30, 60, 0.32), 0 1px 2px rgba(30, 30, 60, 0.1);
	--HS-Label: #1d1d1f;
	--HS-Label-Shadow: 0 1px 1px rgba(255, 255, 255, 0.45);

	/* Edit controls */
	--HS-Control: rgba(232, 232, 237, 0.94);
	--HS-Control-Ink: #3a3a3c;
}

#TL-Home[data-hs-theme="dark"],
.HS-Sheet-Drawer[data-hs-theme="dark"] {
	--HS-Text: #f5f5f7;
	--HS-Text-2: #b0b0b8;
	--HS-Text-3: #8e8e96;
	--HS-Accent: #9a9bff;
	--HS-Accent-Soft: rgba(154, 155, 255, 0.16);
	--HS-Alert: #ff6b5e;
	--HS-Good: #4cd480;
	--HS-Hairline: rgba(255, 255, 255, 0.09);
	--HS-Hover: rgba(255, 255, 255, 0.07);

	--HS-Glass: rgba(30, 30, 36, 0.58);
	--HS-Glass-Strong: rgba(36, 36, 42, 0.86);
	--HS-Glass-Border: rgba(255, 255, 255, 0.08);
	--HS-Glass-Shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.6), 0 1px 2px rgba(0, 0, 0, 0.3);

	--HS-Icon-Fill: linear-gradient(160deg, #3a3a40 0%, #2a2a2f 100%);
	--HS-Icon-Shadow: 0 8px 18px -8px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.08);
	--HS-Label: #f5f5f7;
	--HS-Label-Shadow: 0 1px 3px rgba(0, 0, 0, 0.45);

	--HS-Control: rgba(72, 72, 78, 0.94);
	--HS-Control-Ink: #f5f5f7;
}

/*
**
**
**
**
**
** Shell
** =================================
*/

/* The wallpaper replaces the classic photo backdrop, in both app themes */
#TL-Home,
body[theme="dark"] #TL-Home {
	background: #eceef4;
}

#TL-Home[data-hs-theme="dark"],
body[theme="dark"] #TL-Home[data-hs-theme="dark"] {
	background: #0e0f15;
}

#TL-Home > .wrapper {
	z-index: 1;
}

/*
** Home screen buttons start from a clean slate rather than the browser's or reset.css's look
** (reset.css gives every button a white background). This matches reset.css's plain `button`
** specificity and loads after it, so it wins there, while every class below still wins here.
*/
:where(.HS-Toolbar, .HS-Tile, .HS-Sheet-Drawer) button {
	margin: 0;
	padding: 0;
	background: none;
	border: 0;
	font: inherit;
	color: inherit;
	-webkit-appearance: none;
	appearance: none;
}

#TL-Home > .wrapper,
#TL-Home .HS-Grid {
	-webkit-user-select: none;
	user-select: none;
}

#TL-Home .apps > .HS-Grid {
	padding: 26px 0 40px 0;
}

/* Toolbar: the app search with the edit button beside it, swapped for the edit actions while editing */

#TL-Home .apps > header.HS-Toolbar {
	position: sticky;
	z-index: 5;
	top: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	height: 50px;
}

#TL-Home .apps > header.HS-Toolbar > input[name="TL-Apps-Search"] {
	margin: 0;
	width: min(400px, 100%);
	background-color: var(--HS-Glass);
	border-color: var(--HS-Glass-Border);
	color: var(--HS-Text);
	-webkit-backdrop-filter: blur(20px) saturate(1.6);
	backdrop-filter: blur(20px) saturate(1.6);
	transition:
		opacity 220ms ease,
		transform 360ms var(--HS-Spring),
		background-color 280ms ease,
		box-shadow 180ms ease;
}

#TL-Home .apps > header.HS-Toolbar > input[name="TL-Apps-Search"]::placeholder {
	color: var(--HS-Text-3);
}

#TL-Home .apps > header.HS-Toolbar > input[name="TL-Apps-Search"]:focus {
	background-color: var(--HS-Glass-Strong);
}

.HS-Toolbar-Edit {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	padding: 0;
	background-color: var(--HS-Glass);
	border: 2px solid var(--HS-Glass-Border);
	border-radius: 14px;
	cursor: pointer;
	-webkit-backdrop-filter: blur(20px) saturate(1.6);
	backdrop-filter: blur(20px) saturate(1.6);
	transition:
		transform 360ms var(--HS-Spring),
		opacity 220ms ease,
		background-color 200ms ease;
}

.HS-Toolbar-Edit:hover {
	background-color: var(--HS-Glass-Strong);
	transform: translateY(-1px) scale(1.05);
}

.HS-Toolbar-Edit:active {
	transform: scale(0.92);
}

.HS-Toolbar-Edit > img {
	width: 16px;
	height: 16px;
	opacity: 0.72;
}

#TL-Home[data-hs-theme="dark"] .HS-Toolbar-Edit > img,
.HS-Sheet-Drawer[data-hs-theme="dark"] .HS-Pill:not(.is-primary) > img,
#TL-Home[data-hs-theme="dark"] .HS-Pill:not(.is-primary) > img[src*="outline"] {
	filter: invert(1);
}

.HS-Edit-Toolbar {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(-10px) scale(0.94);
	transition:
		opacity 200ms ease,
		transform 420ms var(--HS-Spring),
		visibility 0s linear 200ms;
}

/* Entering edit mode trades the search for the edit actions. Hidden controls also leave the
   accessibility tree, once they've faded out. */
#TL-Home.HS-Editing .apps > header.HS-Toolbar > input[name="TL-Apps-Search"],
#TL-Home.HS-Editing .HS-Toolbar-Edit {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(8px) scale(0.94);
	transition:
		opacity 200ms ease,
		transform 360ms var(--HS-Spring),
		visibility 0s linear 200ms;
}

#TL-Home.HS-Editing .HS-Edit-Toolbar {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: none;
	transition-delay: 0s;
}

/* Pill Buttons - shared by the toolbar and the sheets */

.HS-Pill {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	height: 38px;
	padding: 0 16px;
	background-color: var(--HS-Glass-Strong);
	border: 1px solid var(--HS-Glass-Border);
	font-size: 13.5px;
	color: var(--HS-Text);
	font-weight: 600;
	border-radius: 999px;
	box-shadow: var(--HS-Glass-Shadow);
	cursor: pointer;
	transition:
		transform 320ms var(--HS-Spring),
		background-color 200ms ease,
		box-shadow 200ms ease;
}

/* Only the sticky toolbar has tiles scrolling under it, so only its glass pills blur */
.HS-Toolbar .HS-Pill:not(.is-primary) {
	-webkit-backdrop-filter: blur(20px) saturate(1.6);
	backdrop-filter: blur(20px) saturate(1.6);
}

.HS-Pill:hover {
	transform: translateY(-1px);
}

.HS-Pill:active {
	transform: scale(0.94);
}

.HS-Pill > img {
	width: 16px;
	height: 16px;
}

.HS-Pill.is-primary {
	background: linear-gradient(160deg, #6f72ff, #5650e6);
	border-color: transparent;
	color: #fff;
	box-shadow: 0 8px 20px -8px rgba(86, 80, 230, 0.7);
}

.HS-Pill.is-large {
	height: 46px;
	padding: 0 26px;
	font-size: 15px;
}

/* Daily summary in dark mode */

#TL-Home[data-hs-theme="dark"] .daily-summary > header > h1 {
	color: var(--HS-Text);
}

#TL-Home[data-hs-theme="dark"] .daily-summary > header > h2,
#TL-Home[data-hs-theme="dark"] .daily-summary .zero-results > h3 {
	color: var(--HS-Text-2);
}

#TL-Home[data-hs-theme="dark"] .TL-Message-Preview-Home {
	background-color: rgba(38, 38, 44, 0.86);
	box-shadow: 0 12px 26px -6px rgba(0, 0, 0, 0.5);
}

#TL-Home[data-hs-theme="dark"] .TL-Message-Preview-Home > .sender > figure.app-icon {
	background-color: #3a3a40;
}

#TL-Home[data-hs-theme="dark"] .TL-Message-Preview-Home > header > h1,
#TL-Home[data-hs-theme="dark"] .TL-Message-Preview-Home > .text-body > p {
	color: var(--HS-Text);
}

#TL-Home[data-hs-theme="dark"] .TL-Message-Preview-Home > header > h2 {
	color: var(--HS-Text-2);
}

#TL-Home[data-hs-theme="dark"] .daily-summary::-webkit-scrollbar-thumb {
	background-color: rgba(255, 255, 255, 0.12);
}

/*
**
**
**
**
**
** Grid & Tiles
** =================================
**
** Each tile has three layers so their motion never collides:
**   .HS-Tile         Reflow (FLIP) and the drag placeholder
**   .HS-Tile-Motion  The entrance and the edit mode jiggle
**   content          Press feedback (icon / widget surface)
*/

#TL-Home .HS-Grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, var(--HS-Cell));
	grid-auto-rows: var(--HS-Cell);
	grid-auto-flow: row dense;
	justify-content: center;
	gap: var(--HS-Gap-Y) var(--HS-Gap-X);
}

.HS-Tile {
	position: relative;
	min-width: 0;
	pointer-events: none;
	-webkit-touch-callout: none;
	transition: transform 420ms var(--HS-Spring-Soft);
}

body[data-home="true"] #TL-Home .HS-Tile {
	pointer-events: auto;
}

.HS-Widget[data-size="small"] {
	grid-column: span 2;
	grid-row: span 2;
}

.HS-Widget[data-size="medium"] {
	grid-column: span 4;
	grid-row: span 2;
}

.HS-Widget[data-size="large"] {
	grid-column: span 4;
	grid-row: span 4;
}

/*
** Coming & Going (see homescreen.motion.js)
**
** Opening an app, the home screen dives into whatever was tapped: each tile is pushed
** out away from it (--HS-Away-X / Y) as it grows and fades, all at once, while the
** tapped tile (.HS-Origin) sinks away under the app growing out of it. Coming home,
** the tiles settle back with a little bounce, in a ripple spreading out from the app's
** icon (--HS-Ripple), or in reading order when there's no icon to return to. The
** origin waits for the app to shrink down onto it, then pops back up to catch it.
*/
.HS-Tile-Motion {
	position: relative;
	width: 100%;
	height: 100%;
	opacity: 0;
	transform: translate(var(--HS-Away-X, 0px), var(--HS-Away-Y, 0px)) scale(1.12);
	transition:
		transform var(--HS-Dive),
		opacity 190ms ease-out;
}

/* Widgets are big already, so they grow less on the way out */
.HS-Widget .HS-Tile-Motion {
	transform: translate(var(--HS-Away-X, 0px), var(--HS-Away-Y, 0px)) scale(1.05);
}

/* The tapped tile hands off to the app quickly; a widget shrinks less than an icon */
.HS-Tile.HS-Origin .HS-Tile-Motion {
	transform: scale(0.68);
	transition:
		transform var(--HS-Dive),
		opacity 130ms ease-out;
}

.HS-Widget.HS-Origin .HS-Tile-Motion {
	transform: scale(0.9);
}

/* :where() keeps this light enough for the drag ghost's own motion to win */
:where(body[data-home="true"]) #TL-Home .HS-Tile-Motion,
.HS-Gallery-Stage .HS-Tile-Motion {
	opacity: 1;
	transform: none;
	transition:
		transform var(--HS-Settle),
		opacity 220ms ease-out;
	transition-delay: var(--HS-Ripple, calc(min(var(--HS-Index, 0), 18) * 12ms));
}

/* The origin pops up just as the app lands on it (.HS-Origin only lasts through the landing) */
:where(body[data-home="true"]) #TL-Home .HS-Tile.HS-Origin .HS-Tile-Motion {
	transition:
		transform var(--HS-Pop),
		opacity 160ms ease-out;
	transition-delay: var(--HS-Land);
}

/* The toolbar dives and settles with the tiles */
#TL-Home .apps > header.HS-Toolbar {
	opacity: 0;
	transform: scale(1.06);
	transition:
		transform var(--HS-Dive),
		opacity 170ms ease-out;
}

body[data-home="true"] #TL-Home .apps > header.HS-Toolbar {
	opacity: 1;
	transform: none;
	transition:
		transform var(--HS-Settle),
		opacity 220ms ease-out;
}

/* Once the dive has played out, the home screen under the app stops being drawn at all */
body:not([data-home="true"]) #TL-Home {
	visibility: hidden;
	transition: visibility 0s linear 340ms;
}

/* The wallpaper drifts in behind everything for depth, without any bounce */
#TL-Home > .HS-Wallpaper-Host > .HS-Wallpaper {
	transform: scale(1.06);
	transition:
		transform var(--HS-Dive),
		opacity 800ms ease;
}

body[data-home="true"] #TL-Home > .HS-Wallpaper-Host > .HS-Wallpaper {
	transform: none;
	transition:
		transform 700ms var(--HS-Ease-Out),
		opacity 800ms ease;
}

.HS-Tile.unmatched-search-result {
	display: none;
}

/* Tile labels sit under the icon or widget */
.HS-Tile-Label {
	position: absolute;
	left: -6px;
	right: -6px;
	bottom: 0;
	overflow: hidden;
	text-align: center;
	white-space: nowrap;
	text-overflow: ellipsis;
	font-size: 12.5px;
	color: var(--HS-Label);
	font-weight: 500;
	line-height: 15px;
	letter-spacing: 0.1px;
	text-shadow: var(--HS-Label-Shadow);
	transition: opacity 200ms ease;
}

/*
**
**
**
**
**
** App Icons
** =================================
*/

.HS-App {
	cursor: pointer;
}

.HS-App-Icon {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto;
	width: calc(var(--HS-Cell) - var(--HS-Label-Space) - 4px);
	aspect-ratio: 1;
	background: var(--HS-Icon-Fill);
	border-radius: 50%;
	box-shadow: var(--HS-Icon-Shadow);
	transition:
		transform 360ms var(--HS-Spring),
		box-shadow 260ms ease;
}

/* The glyph sits small inside its circle so every icon gets generous breathing room */
.HS-App-Icon > img {
	width: 48%;
	height: auto;
	pointer-events: none;
	transition:
		transform 300ms var(--HS-Spring),
		filter 200ms ease;
}

/* A gentle lift on hover, only outside of edit mode */
@media (hover: hover) {
	#TL-Home:not(.HS-Editing) .HS-App:hover .HS-App-Icon {
		transform: translateY(-3px) scale(1.05);
		box-shadow: 0 14px 26px -10px rgba(30, 30, 60, 0.38);
	}

	#TL-Home:not(.HS-Editing) .HS-App:hover .HS-App-Icon > img {
		transform: scale(1.08);
		filter: drop-shadow(0 6px 6px rgba(10, 10, 10, 0.18));
	}
}

.HS-App.HS-Pressing .HS-App-Icon,
#TL-Home:not(.HS-Editing) .HS-App:active .HS-App-Icon {
	transform: scale(0.9);
	transition-duration: 160ms;
}

/* External link and beta locked markers */
.HS-App[data-external="true"] .HS-App-Icon::after,
.HS-App[data-enabled="false"] .HS-App-Icon::after {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	width: 18px;
	height: 18px;
	background-color: #6271ff;
	background-image: url("../resources/icons/outline/link.white.png");
	background-repeat: no-repeat;
	background-size: 12px auto;
	background-position: center;
	border-radius: 50%;
	box-shadow: 0 2px 8px -1px rgba(80, 80, 100, 0.58);
}

.HS-App[data-enabled="false"] .HS-App-Icon::after {
	background-color: #e86450;
	background-image: url("../resources/icons/outline/lock.white.png");
}

/* Live status pill (e.g. inventory) - takes over the label line */
.HS-App-Badge {
	position: absolute;
	left: 50%;
	bottom: -16px;
	padding: 1px 6px;
	text-transform: uppercase;
	font-size: 9.5px;
	color: #fff;
	font-weight: 600;
	line-height: 12px;
	letter-spacing: 0.3px;
	border-radius: 30px;
	transform: translateX(-50%);
	white-space: nowrap;
}

.HS-App-Badge[data-status="DISABLED"] {
	background-color: #e0382d;
}

.HS-App-Badge[data-status="ENABLED"] {
	background-color: #1b8346;
	animation: HS-Badge-Pulse 2s infinite;
}

@keyframes HS-Badge-Pulse {
	50% {
		background-color: #2fbf6a;
	}
}

/* W2 keeps its signature label */
.HS-App[data-app="w2"] .HS-Tile-Label {
	left: 50%;
	right: auto;
	width: auto;
	min-width: 46px;
	padding: 2px 6px;
	background: linear-gradient(160deg, #38cae5, #07426e);
	text-transform: uppercase;
	font-size: 10px;
	color: #fff;
	line-height: 12px;
	border-radius: 30px;
	text-shadow: none;
	transform: translateX(-50%);
}

/*
**
**
**
**
**
** Widgets
** =================================
*/

.HS-Widget {
	cursor: pointer;
}

/*
** Plain translucent glass with no backdrop blur. The wallpaper is soft already, and a live
** blur would have to be redone for every widget on every frame the wallpaper drifts.
*/
.HS-Widget-Surface {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: var(--HS-Label-Space);
	overflow: hidden;
	background-color: var(--HS-Glass);
	border: 1px solid var(--HS-Glass-Border);
	color: var(--HS-Text);
	border-radius: 24px;
	box-shadow: var(--HS-Glass-Shadow);
	transition:
		transform 360ms var(--HS-Spring),
		box-shadow 260ms ease;
}

.HS-Widget[data-size="large"] .HS-Widget-Surface {
	border-radius: 28px;
}

@media (hover: hover) {
	#TL-Home:not(.HS-Editing) .HS-Grid .HS-Widget:hover .HS-Widget-Surface {
		transform: translateY(-2px);
		box-shadow: 0 22px 40px -18px rgba(30, 30, 60, 0.4);
	}
}

.HS-Widget.HS-Pressing .HS-Widget-Surface,
#TL-Home:not(.HS-Editing) .HS-Widget:active .HS-Widget-Surface {
	transform: scale(0.97);
	transition-duration: 160ms;
}

.HS-Widget-Content {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	padding: 16px;
	text-align: left;
}

.HS-Widget[data-size="small"] .HS-Widget-Content {
	padding: 14px;
}

/* A resized widget softly redraws its content at the new size */
.HS-Widget.HS-Resizing .HS-Widget-Content {
	animation: HS-Content-In 380ms var(--HS-Ease-Out);
}

@keyframes HS-Content-In {
	from {
		opacity: 0;
		transform: scale(0.97);
	}
}

/* Loading placeholder */

.HS-W-Skeleton {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding-top: 4px;
}

/* The placeholder breathes with opacity alone, which never needs repainting */
.HS-W-Skeleton > span {
	display: block;
	height: 12px;
	border-radius: 6px;
	background-color: var(--HS-Hairline);
	animation: HS-Breathe 1.1s ease-in-out infinite alternate;
}

.HS-W-Skeleton > span:nth-child(1) {
	width: 45%;
	height: 14px;
}

.HS-W-Skeleton > span:nth-child(2) {
	width: 80%;
}

.HS-W-Skeleton > span:nth-child(3) {
	width: 62%;
}

@keyframes HS-Breathe {
	to {
		opacity: 0.4;
	}
}

/*
**
**
**
**
**
** Widget Building Blocks
** =================================
**
** Shared pieces widgets compose their layouts from, so every widget feels like part
** of the same family. Widgets add only what's unique to them in their own widget.css.
*/

.HS-W-Header {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	gap: 7px;
	min-width: 0;
}

.HS-W-Header > img {
	flex-shrink: 0;
	width: 20px;
	height: 20px;
}

.HS-W-Title {
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	font-size: 12.5px;
	color: var(--HS-Text-2);
	font-weight: 600;
	letter-spacing: 0.2px;
}

.HS-W-Accessory {
	flex-shrink: 0;
	margin-left: auto;
}

.HS-W-Big {
	font-size: 42px;
	color: var(--HS-Text);
	font-weight: 700;
	line-height: 1;
	letter-spacing: -1.2px;
	font-variant-numeric: tabular-nums;
}

.HS-W-Caption {
	overflow: hidden;
	font-size: 12.5px;
	color: var(--HS-Text-2);
	font-weight: 500;
	line-height: 16px;
	text-overflow: ellipsis;
}

.HS-W-Footer {
	margin-top: auto;
	min-width: 0;
}

.HS-W-List {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 2px;
	margin: 8px -8px 0 -8px;
	min-height: 0;
	overflow: hidden;
}

.HS-W-Row {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	gap: 10px;
	min-width: 0;
	padding: 6px 8px;
	border-radius: 12px;
	transition: background-color 160ms ease;
}

@media (hover: hover) {
	#TL-Home:not(.HS-Editing) .HS-W-Row[data-link]:hover {
		background-color: var(--HS-Hover);
	}
}

.HS-W-Row-Text {
	flex: 1;
	min-width: 0;
}

.HS-W-Row-Text > h4,
.HS-W-Row-Text > p {
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.HS-W-Row-Text > h4 {
	font-size: 13px;
	color: var(--HS-Text);
	font-weight: 600;
	line-height: 17px;
}

.HS-W-Row-Text > p {
	font-size: 12px;
	color: var(--HS-Text-2);
	font-weight: 400;
	line-height: 16px;
}

.HS-W-Row-Meta {
	flex-shrink: 0;
	font-size: 11.5px;
	color: var(--HS-Text-3);
	font-weight: 500;
	white-space: nowrap;
}

.HS-W-Avatar {
	flex-shrink: 0;
	width: 32px;
	height: 32px;
	background-color: var(--HS-Hover);
	background-size: cover;
	background-position: center;
	border-radius: 50%;
}

.HS-W-Avatar .TL-Photo-Initials {
	width: 100%;
	height: 100%;
}

/* The brand logo sits on the photo's edge; tucked in closer than usual to suit the smaller avatars */
.HS-W-Avatar .TL-Photo-Initials-Brand {
	top: -3px;
	right: -3px;
	width: 16px;
	height: 16px;
	box-shadow: 0 0 0 2px var(--HS-Glass-Strong);
}

.HS-W-Chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 2px 8px;
	background-color: var(--HS-Accent-Soft);
	font-size: 11.5px;
	color: var(--HS-Accent);
	font-weight: 600;
	line-height: 16px;
	border-radius: 999px;
	white-space: nowrap;
}

.HS-W-Chip[data-tone="alert"] {
	background-color: rgba(224, 69, 58, 0.12);
	color: var(--HS-Alert);
}

.HS-W-Chip[data-tone="good"] {
	background-color: rgba(35, 163, 90, 0.14);
	color: var(--HS-Good);
}

.HS-W-Empty {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	text-align: center;
}

.HS-W-Empty > img {
	width: 38px;
	height: 38px;
	margin-bottom: 4px;
}

.HS-W-Empty > h4 {
	font-size: 14px;
	color: var(--HS-Text);
	font-weight: 600;
}

.HS-W-Empty > p {
	font-size: 12px;
	color: var(--HS-Text-2);
	line-height: 16px;
}

.HS-W-Empty.is-error > p {
	max-width: 220px;
}

.HS-W-Retry {
	margin-top: 6px;
	padding: 4px 12px;
	background-color: var(--HS-Accent-Soft);
	font-size: 12px;
	color: var(--HS-Accent);
	font-weight: 600;
	border-radius: 999px;
	cursor: pointer;
}

/*
**
**
**
**
**
** Edit Mode
** =================================
*/

/* Tiles jiggle while the home screen is being edited, each slightly out of step */
#TL-Home.HS-Editing .HS-Grid .HS-Tile-Motion {
	animation: HS-Jiggle 300ms ease-in-out infinite;
	animation-delay: var(--HS-Jiggle-Delay, 0ms);
}

#TL-Home.HS-Editing .HS-Grid .HS-Widget .HS-Tile-Motion {
	animation-name: HS-Jiggle-Soft;
	animation-duration: 360ms;
}

@keyframes HS-Jiggle {
	0%,
	100% {
		transform: rotate(-1.6deg);
	}
	50% {
		transform: rotate(1.6deg) translateY(-0.5px);
	}
}

@keyframes HS-Jiggle-Soft {
	0%,
	100% {
		transform: rotate(-0.5deg);
	}
	50% {
		transform: rotate(0.5deg);
	}
}

/* Each jiggling tile gets its own GPU layer so the rotation is composited instead of repainted */
#TL-Home.HS-Editing .HS-Grid .HS-Tile-Motion {
	will-change: transform;
}

/* Dragging on touch screens shouldn't scroll the page while editing */
#TL-Home.HS-Editing .HS-Grid .HS-Tile {
	touch-action: none;
	cursor: grab;
}

/* Remove and widget buttons bloom onto the corners of each tile */

.HS-Tile-Remove,
.HS-Tile-Widgetize {
	position: absolute;
	z-index: 3;
	top: -8px;
	display: block;
	width: 24px;
	height: 24px;
	padding: 0;
	border-radius: 50%;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	cursor: pointer;
	transform: scale(0.2);
	transition:
		transform 380ms var(--HS-Spring),
		opacity 160ms ease,
		visibility 0s linear 160ms;
}

.HS-Tile-Remove {
	left: -8px;
	background-color: var(--HS-Control);
	box-shadow: 0 3px 10px -2px rgba(0, 0, 0, 0.3);
}

.HS-Tile-Remove::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 10px;
	height: 2.5px;
	background-color: var(--HS-Control-Ink);
	border-radius: 2px;
	transform: translate(-50%, -50%);
}

/* App icons are round and narrower than their cell, so their buttons tuck in onto the circle's edge */
.HS-App .HS-Tile-Remove,
.HS-App .HS-Tile-Widgetize {
	top: -2px;
}

.HS-App .HS-Tile-Remove {
	left: calc((var(--HS-Cell) - (var(--HS-Cell) - var(--HS-Label-Space) - 4px)) / 2 - 2px);
}

.HS-Tile-Widgetize {
	right: calc((var(--HS-Cell) - (var(--HS-Cell) - var(--HS-Label-Space) - 4px)) / 2 - 2px);
	background: linear-gradient(160deg, #6f72ff, #5650e6);
	box-shadow: 0 4px 10px -2px rgba(86, 80, 230, 0.6);
}

/* A tiny 2x2 grid glyph - "show as a widget" */
.HS-Tile-Widgetize::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 10px;
	height: 10px;
	background:
		linear-gradient(#fff, #fff) 0 0 / 4px 4px no-repeat,
		linear-gradient(#fff, #fff) 100% 0 / 4px 4px no-repeat,
		linear-gradient(#fff, #fff) 0 100% / 4px 4px no-repeat,
		linear-gradient(#fff, #fff) 100% 100% / 4px 4px no-repeat;
	border-radius: 1px;
	transform: translate(-50%, -50%);
}

#TL-Home.HS-Editing .HS-Grid .HS-Tile-Remove,
#TL-Home.HS-Editing .HS-Grid .HS-App[data-has-widget="true"] .HS-Tile-Widgetize {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: scale(1);
	transition-delay: 0s;
}

.HS-Tile-Remove:active,
.HS-Tile-Widgetize:active {
	transform: scale(0.85) !important;
}

/* Widget size picker - replaces the widget's label while editing */

.HS-Widget-Sizes {
	position: absolute;
	z-index: 3;
	left: 50%;
	bottom: -6px;
	display: flex;
	gap: 4px;
	padding: 3px;
	background-color: var(--HS-Glass-Strong);
	border: 1px solid var(--HS-Glass-Border);
	border-radius: 999px;
	box-shadow: var(--HS-Glass-Shadow);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateX(-50%) scale(0.6);
	transition:
		transform 380ms var(--HS-Spring),
		opacity 160ms ease,
		visibility 0s linear 160ms;
}

.HS-Widget-Sizes:empty {
	display: none;
}

#TL-Home.HS-Editing .HS-Grid .HS-Widget-Sizes {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateX(-50%) scale(1);
	transition-delay: 0s;
}

#TL-Home.HS-Editing .HS-Grid .HS-Widget .HS-Tile-Label {
	opacity: 0;
}

/* Each size option draws the shape of the size it picks */
.HS-Size-Option {
	position: relative;
	display: block;
	width: 26px;
	height: 22px;
	padding: 0;
	font-size: 0;
	color: var(--HS-Text-2);
	border-radius: 999px;
	cursor: pointer;
	transition:
		background-color 200ms ease,
		color 200ms ease,
		transform 260ms var(--HS-Spring);
}

.HS-Size-Option::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 8px;
	height: 8px;
	border: 1.6px solid currentColor;
	border-radius: 3px;
	transform: translate(-50%, -50%);
}

.HS-Size-Option[data-size="medium"]::before {
	width: 14px;
}

.HS-Size-Option[data-size="large"]::before {
	width: 11px;
	height: 11px;
}

.HS-Size-Option:hover {
	color: var(--HS-Text);
}

.HS-Size-Option:active {
	transform: scale(0.88);
}

.HS-Size-Option[aria-checked="true"] {
	background-color: var(--HS-Accent);
	color: #fff;
}

/*
**
**
**
**
**
** Drag & Drop
** =================================
*/

/* The tile being dragged leaves an empty slot behind that moves as tiles reflow */
.HS-Tile.HS-Placeholder {
	visibility: hidden;
}

/* The copy that follows the pointer */
.HS-Drag-Ghost {
	position: fixed;
	z-index: 40;
	top: 0;
	left: 0;
	margin: 0;
	pointer-events: none !important;
	transition: none;
	will-change: transform;
}

#TL-Home .HS-Drag-Ghost .HS-Tile-Motion {
	opacity: 1;
	animation: none !important;
	transition: transform 300ms var(--HS-Spring);
	transition-delay: 0ms;
}

#TL-Home .HS-Drag-Ghost.is-lifted .HS-Tile-Motion {
	transform: scale(1.08);
}

.HS-Drag-Ghost.is-lifted .HS-App-Icon,
.HS-Drag-Ghost.is-lifted .HS-Widget-Surface {
	box-shadow: 0 26px 46px -14px rgba(20, 20, 40, 0.45);
}

.HS-Drag-Ghost .HS-Tile-Remove,
.HS-Drag-Ghost .HS-Tile-Widgetize,
.HS-Drag-Ghost .HS-Widget-Sizes {
	opacity: 0 !important;
}

/* Settling back into the grid on release */
.HS-Drag-Ghost.is-dropping {
	transition: transform 300ms var(--HS-Spring-Soft);
}

#TL-Home.HS-Dragging,
#TL-Home.HS-Dragging * {
	cursor: grabbing !important;
}

/* Tiles arriving on the grid pop in, tiles leaving shrink away */
.HS-Tile.HS-Pop-In .HS-Tile-Motion {
	animation: HS-Pop-In 520ms var(--HS-Spring) both !important;
}

@keyframes HS-Pop-In {
	from {
		opacity: 0;
		transform: scale(0.4);
	}
}

.HS-Tile.HS-Vanishing .HS-Tile-Motion {
	animation: HS-Vanish 200ms ease-in both !important;
}

@keyframes HS-Vanish {
	to {
		opacity: 0;
		transform: scale(0.5);
	}
}

/*
**
**
**
**
**
** Sheets
** =================================
**
** The widget gallery and the customize sheet, built on TL.Drawer's "sheet" variant.
*/

/* Near solid rather than blurred - a blur this big under a panel this opaque costs a lot and shows little */
.UI-Drawer-Panel.HS-Sheet {
	background-color: rgba(246, 246, 250, 0.96);
	border-color: rgba(255, 255, 255, 0.7);
	color: var(--HS-Text);
}

.HS-Sheet-Drawer[data-hs-theme="dark"] .UI-Drawer-Panel.HS-Sheet {
	background-color: rgba(28, 28, 32, 0.96);
	border-color: rgba(255, 255, 255, 0.08);
}

.HS-Sheet-Inner {
	display: flex;
	flex-direction: column;
	max-height: min(86vh, 820px);
}

.HS-Sheet-Header {
	position: relative;
	display: flex;
	flex-shrink: 0;
	align-items: flex-start;
	gap: 12px;
	padding: 22px 22px 14px 24px;
}

.HS-Sheet-Grabber {
	position: absolute;
	top: 7px;
	left: 50%;
	width: 38px;
	height: 5px;
	background-color: var(--HS-Hairline);
	border-radius: 3px;
	transform: translateX(-50%);
}

.HS-Sheet-Titles {
	flex: 1;
	min-width: 0;
}

.HS-Sheet-Titles > h2 {
	font-family: var(--Theme-Font);
	font-size: 26px;
	color: var(--HS-Text);
	font-weight: 700;
	line-height: 32px;
	letter-spacing: -0.4px;
}

.HS-Sheet-Titles > p {
	padding-top: 2px;
	font-size: 14px;
	color: var(--HS-Text-2);
	line-height: 19px;
}

.HS-Sheet-Body {
	flex: 1;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	padding: 4px 24px 28px 24px;
	-webkit-overflow-scrolling: touch;
}

/* Segmented control with a sliding thumb (TL.HomeScreen.Customize.SetSegment positions it) */

.HS-Segmented {
	position: relative;
	display: grid;
	grid-auto-columns: 1fr;
	grid-auto-flow: column;
	padding: 3px;
	background-color: rgba(118, 118, 128, 0.14);
	border-radius: 12px;
}

.HS-Sheet-Drawer[data-hs-theme="dark"] .HS-Segmented {
	background-color: rgba(118, 118, 128, 0.26);
}

.HS-Segmented::before {
	content: "";
	position: absolute;
	top: 3px;
	bottom: 3px;
	left: 3px;
	width: calc((100% - 6px) / var(--HS-Segment-Count, 1));
	background-color: #ffffff;
	border-radius: 9px;
	box-shadow: 0 3px 8px -2px rgba(0, 0, 0, 0.18);
	transform: translateX(calc(100% * var(--HS-Segment-Index, 0)));

	/* Quick but without overshoot, so the thumb never pokes past the track's ends */
	transition: transform 340ms cubic-bezier(0.22, 1, 0.36, 1);
}

.HS-Sheet-Drawer[data-hs-theme="dark"] .HS-Segmented::before {
	background-color: #5a5a62;
}

.HS-Segment {
	position: relative;
	z-index: 1;
	height: 34px;
	padding: 0 10px;
	background: transparent;
	border: 0;
	font-size: 13.5px;
	color: var(--HS-Text-2);
	font-weight: 600;
	cursor: pointer;
	transition: color 200ms ease;
}

.HS-Segment[aria-checked="true"] {
	color: var(--HS-Text);
}

/* Sheet sections */

.HS-Section {
	padding: 18px 0 0 0;
}

.HS-Section > h3 {
	padding: 0 0 10px 2px;
	text-transform: uppercase;
	font-size: 12px;
	color: var(--HS-Text-3);
	font-weight: 600;
	letter-spacing: 0.6px;
}

.HS-Section-Note {
	padding: 8px 2px 0 2px;
	font-size: 12.5px;
	color: var(--HS-Text-3);
	line-height: 17px;
}

/* Widget gallery - the list and the detail view slide side by side */

.HS-Gallery {
	overflow: hidden;
}

.HS-Gallery-Track {
	display: grid;
	grid-template-columns: 100% 100%;
	align-items: start;
	transition: transform 480ms var(--HS-Spring-Soft);
}

.HS-Gallery[data-view="detail"] .HS-Gallery-Track {
	transform: translateX(-100%);
}

.HS-Gallery-List,
.HS-Gallery-Detail {
	min-width: 0;
	max-height: 9999px;
	transition:
		opacity 260ms ease,
		max-height 0s linear 0s;
}

/*
** The pane sliding away collapses once it's fully off screen, so the sheet only
** ever scrolls as far as the pane that's showing
*/
.HS-Gallery[data-view="detail"] .HS-Gallery-List,
.HS-Gallery[data-view="list"] .HS-Gallery-Detail {
	max-height: 0;
	overflow: hidden;
	opacity: 0;
	pointer-events: none;
	transition:
		opacity 260ms ease,
		max-height 0s linear 480ms;
}

.HS-Gallery-List {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	align-content: start;
	gap: 10px;
	padding-top: 6px;
}

.HS-Gallery-Card {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px;
	background-color: var(--HS-Glass-Strong);
	border: 1px solid var(--HS-Glass-Border);
	text-align: left;
	border-radius: 18px;
	box-shadow: 0 6px 16px -10px rgba(20, 20, 40, 0.3);
	cursor: pointer;
	transition:
		transform 320ms var(--HS-Spring),
		box-shadow 200ms ease;
	animation: HS-Card-In 460ms var(--HS-Spring) both;
}

.HS-Gallery-Card:nth-child(2) {
	animation-delay: 40ms;
}

.HS-Gallery-Card:nth-child(3) {
	animation-delay: 80ms;
}

.HS-Gallery-Card:nth-child(n + 4) {
	animation-delay: 120ms;
}

@keyframes HS-Card-In {
	from {
		opacity: 0;
		transform: translateY(16px) scale(0.96);
	}
}

.HS-Gallery-Card:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 24px -12px rgba(20, 20, 40, 0.35);
}

.HS-Gallery-Card:active {
	transform: scale(0.97);
}

.HS-Gallery-Card-Icon {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	background: var(--HS-Icon-Fill);
	border-radius: 50%;
	box-shadow: var(--HS-Icon-Shadow);
}

.HS-Gallery-Card-Icon > img {
	width: 58%;
}

.HS-Gallery-Card-Text {
	flex: 1;
	min-width: 0;
}

.HS-Gallery-Card-Text > span {
	text-transform: uppercase;
	font-size: 10.5px;
	color: var(--HS-Text-3);
	font-weight: 600;
	letter-spacing: 0.5px;
}

.HS-Gallery-Card-Text > h3 {
	font-size: 15px;
	color: var(--HS-Text);
	font-weight: 600;
	line-height: 19px;
}

.HS-Gallery-Card-Text > p {
	display: -webkit-box;
	overflow: hidden;
	font-size: 12.5px;
	color: var(--HS-Text-2);
	line-height: 16px;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.HS-Gallery-Card-Chevron {
	flex-shrink: 0;
	width: 14px;
	opacity: 0.4;
}

.HS-Sheet-Drawer[data-hs-theme="dark"] .HS-Gallery-Card-Chevron,
.HS-Sheet-Drawer[data-hs-theme="dark"] .HS-Gallery-Back > img,
.HS-Sheet-Drawer[data-hs-theme="dark"] .HS-Hidden-App > img.plus {
	filter: invert(1);
}

.HS-Gallery-Empty {
	grid-column: 1 / -1;
	padding: 30px 0 20px 0;
	text-align: center;
}

.HS-Gallery-Empty > img {
	width: 64px;
}

.HS-Gallery-Empty > h3 {
	padding-top: 8px;
	font-size: 17px;
	color: var(--HS-Text);
	font-weight: 600;
}

.HS-Gallery-Empty > p {
	font-size: 13px;
	color: var(--HS-Text-2);
}

/* Gallery detail - a live preview of the widget at the chosen size */

.HS-Gallery-Detail-Inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	padding-bottom: 6px;
	text-align: center;
}

.HS-Gallery-Back {
	display: inline-flex;
	align-self: flex-start;
	align-items: center;
	gap: 6px;
	padding: 6px 10px 6px 6px;
	font-size: 13.5px;
	color: var(--HS-Accent);
	font-weight: 600;
	border-radius: 999px;
	cursor: pointer;
	transition: background-color 160ms ease;
}

.HS-Gallery-Back:hover {
	background-color: var(--HS-Hover);
}

.HS-Gallery-Back > img {
	width: 14px;
	opacity: 0.6;
}

.HS-Gallery-Detail-Inner > header > h3 {
	font-size: 20px;
	color: var(--HS-Text);
	font-weight: 700;
}

.HS-Gallery-Detail-Inner > header > p {
	max-width: 420px;
	font-size: 13.5px;
	color: var(--HS-Text-2);
	line-height: 19px;
}

.HS-Gallery-Stage {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: calc(var(--HS-Span-2-H) + 20px);
	transition: min-height 420ms var(--HS-Spring-Soft);
}

.HS-Gallery-Stage[data-size="large"] {
	min-height: calc(var(--HS-Span-4-H) + 20px);
}

.HS-Gallery-Stage .HS-Widget {
	flex-shrink: 0;
	pointer-events: none;
	animation: HS-Preview-In 460ms var(--HS-Spring) both;
}

@keyframes HS-Preview-In {
	from {
		opacity: 0;
		transform: scale(0.9);
	}
}

.HS-Gallery-Stage .HS-Widget[data-size="small"] {
	width: var(--HS-Span-2-W);
	height: var(--HS-Span-2-H);
}

.HS-Gallery-Stage .HS-Widget[data-size="medium"] {
	width: var(--HS-Span-4-W);
	height: var(--HS-Span-2-H);
}

.HS-Gallery-Stage .HS-Widget[data-size="large"] {
	width: var(--HS-Span-4-W);
	height: var(--HS-Span-4-H);
}

.HS-Gallery-Stage .HS-Tile-Label,
.HS-Gallery-Stage .HS-Tile-Remove,
.HS-Gallery-Stage .HS-Widget-Sizes {
	display: none;
}

.HS-Gallery-Stage .HS-Widget-Surface {
	bottom: 0;
}

.HS-Gallery-Sizes {
	width: min(300px, 100%);
}

/* Wallpaper picker - each option shows the light version with the dark version cut diagonally in */

.HS-Wallpaper-Picker {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
	gap: 14px;
}

.HS-Wallpaper-Option {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 0;
	cursor: pointer;
}

.HS-Wallpaper-Preview {
	position: relative;
	width: 100%;
	aspect-ratio: 3 / 4;
	overflow: hidden;
	border-radius: 18px;
	box-shadow:
		0 8px 20px -10px rgba(20, 20, 40, 0.4),
		0 0 0 1px var(--HS-Hairline);
	transition:
		transform 360ms var(--HS-Spring),
		box-shadow 220ms ease;
}

.HS-Wallpaper-Preview > .HS-Wallpaper[data-hs-theme="dark"] {
	clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

@media (hover: hover) {
	.HS-Wallpaper-Option:hover > .HS-Wallpaper-Preview {
		transform: translateY(-3px);
	}
}

.HS-Wallpaper-Option:active > .HS-Wallpaper-Preview {
	transform: scale(0.95);
}

.HS-Wallpaper-Option[aria-pressed="true"] .HS-Wallpaper-Preview {
	box-shadow:
		0 10px 24px -10px rgba(20, 20, 40, 0.45),
		0 0 0 3px var(--HS-Accent);
}

.HS-Wallpaper-Name {
	font-size: 12.5px;
	color: var(--HS-Text-2);
	font-weight: 600;
}

.HS-Wallpaper-Option[aria-pressed="true"] .HS-Wallpaper-Name {
	color: var(--HS-Accent);
}

/* Hidden apps */

.HS-Hidden-Apps[data-count="0"] {
	display: none;
}

.HS-Hidden-List {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.HS-Hidden-App {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 38px;
	padding: 0 12px 0 6px;
	background-color: var(--HS-Glass-Strong);
	border: 1px solid var(--HS-Glass-Border);
	font-size: 13px;
	color: var(--HS-Text);
	font-weight: 600;
	border-radius: 999px;
	cursor: pointer;
	transition:
		transform 300ms var(--HS-Spring),
		opacity 200ms ease;
}

.HS-Hidden-App:active {
	transform: scale(0.94);
}

.HS-Hidden-App.is-leaving {
	opacity: 0;
	transform: scale(0.6);
}

.HS-Hidden-App > img.icon {
	width: 26px;
	height: 26px;
	padding: 3px;
	box-sizing: border-box;
	background: var(--HS-Icon-Fill);
	border-radius: 50%;
}

.HS-Hidden-App > img.plus {
	width: 11px;
	opacity: 0.5;
}

/* Reset - a two step button so a stray tap can't wipe the layout */

.HS-Reset {
	display: block;
	width: 100%;
	height: 44px;
	background-color: var(--HS-Glass-Strong);
	border: 1px solid var(--HS-Glass-Border);
	font-size: 14px;
	color: var(--HS-Alert);
	font-weight: 600;
	border-radius: 14px;
	cursor: pointer;
	transition:
		background-color 200ms ease,
		color 200ms ease,
		transform 300ms var(--HS-Spring);
}

.HS-Reset:active {
	transform: scale(0.98);
}

.HS-Reset > .armed,
.HS-Reset[data-armed="true"] > .idle {
	display: none;
}

.HS-Reset[data-armed="true"] > .armed {
	display: inline;
}

.HS-Reset[data-armed="true"] {
	background-color: var(--HS-Alert);
	color: #fff;
}

/*
**
**
**
**
**
** Responsive
** =================================
*/

@media only screen and (max-width: 600px) {
	/* Phones get a classic four column home screen that fills the width */
	:root {
		--HS-Gap-X: 22px;
		--HS-Gap-Y: 26px;
		--HS-Cell: calc((100vw - 32px - var(--HS-Gap-X) * 3) / 4);
	}

	/* Cells are sized from the space the grid really has, scrollbars and all */
	#TL-Home .apps {
		container-type: inline-size;
	}

	#TL-Home .apps > .HS-Grid {
		--HS-Cell: calc((100cqw - 32px - var(--HS-Gap-X) * 3) / 4);

		box-sizing: border-box;
		width: 100%;
		justify-content: center;
		padding: 18px 16px 40px 16px;
		grid-template-columns: repeat(4, var(--HS-Cell));
	}

	#TL-Home .apps > header.HS-Toolbar {
		box-sizing: border-box;
		width: 100%;
		padding: 0 16px;
	}

	/* Phone circles are smaller, so the glyph takes a little more of them to stay legible */
	.HS-App-Icon > img {
		width: 54%;
	}

	#TL-Home .apps > header.HS-Toolbar > input[name="TL-Apps-Search"] {
		flex: 1;
		min-width: 0;
	}

	.HS-Edit-Toolbar {
		gap: 6px;
	}

	.HS-Pill {
		padding: 0 13px;
	}

	.HS-Sheet-Header {
		padding: 22px 18px 12px 20px;
	}

	.HS-Sheet-Body {
		padding: 4px 18px 28px 18px;
	}

	.HS-Wallpaper-Picker {
		grid-template-columns: repeat(3, 1fr);
		gap: 10px;
	}
}

/*
**
**
**
**
**
** Reduced Motion
** =================================
*/

@media (prefers-reduced-motion: reduce) {
	.HS-Tile,
	.HS-Tile-Motion,
	#TL-Home .apps > header.HS-Toolbar,
	#TL-Home > .HS-Wallpaper-Host > .HS-Wallpaper,
	.HS-Gallery-Track,
	.HS-Segmented::before {
		transition-duration: 1ms !important;
		transition-delay: 0ms !important;
	}

	/* Without the jiggle, a soft outline shows the home screen is being edited */
	#TL-Home.HS-Editing .HS-Grid .HS-Tile-Motion,
	.HS-W-Skeleton > span {
		animation: none !important;
	}

	#TL-Home.HS-Editing .HS-Grid .HS-App-Icon,
	#TL-Home.HS-Editing .HS-Grid .HS-Widget-Surface {
		outline: 2px dashed var(--HS-Hairline);
		outline-offset: 3px;
	}
}
