/*
**
**
**
**
**
** Today
** =================================
**
** The full screen Today briefing (scripts/today.js, templates/sys.today.html), its card in
** the daily summary, and the home button turning into a Today button.
*/

/* The accent colors are registered so the wash glides between them as slides change */
@property --Today-A {
	syntax: "<color>";
	inherits: true;
	initial-value: #6d5efc;
}

@property --Today-B {
	syntax: "<color>";
	inherits: true;
	initial-value: #ff8fb1;
}

/*
** Accents, by name. Sections pick one in teamlyders/sys/today.php.
*/
[data-accent="intro"] {
	--Accent-A: #6d5efc;
	--Accent-B: #ff8fb1;
}

[data-accent="violet"] {
	--Accent-A: #7c4dff;
	--Accent-B: #d36bf5;
}

[data-accent="teal"] {
	--Accent-A: #0fa89a;
	--Accent-B: #3b8cff;
}

[data-accent="coral"] {
	--Accent-A: #f0644f;
	--Accent-B: #f5a14a;
}

[data-accent="rose"] {
	--Accent-A: #e6508c;
	--Accent-B: #b26cf0;
}

[data-accent="meadow"] {
	--Accent-A: #3f9a5b;
	--Accent-B: #c2a23a;
}

[data-accent="outro"] {
	--Accent-A: #ff9f43;
	--Accent-B: #ff6f91;
}

/*
**
** Overlay
** =================================
**
** Grows out of whatever opened it as a circle, and shrinks back into it on close.
*/

#TL-Today {
	--Today-A: var(--Accent-A, #6d5efc);
	--Today-B: var(--Accent-B, #ff8fb1);
	--Today-Base: #f5f5f7;
	--Today-Text: #1d1d1f;
	--Today-Text-2: #6e6e73;
	--Today-Surface: rgba(255, 255, 255, 0.72);
	--Today-Surface-Strong: #fff;
	--Today-Hairline: rgba(0, 0, 0, 0.07);
	--Today-Shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 14px 34px -14px rgba(20, 20, 40, 0.22);
	--Today-Up: #1f9d55;
	--Today-Down: #d93f3f;
	--Today-Spring: cubic-bezier(0.34, 1.4, 0.64, 1);
	--Today-Glide: cubic-bezier(0.32, 0.72, 0, 1);

	position: fixed;
	z-index: 200;
	inset: 0;
	display: grid;
	grid-template-rows: auto minmax(0, 1fr) auto;
	margin: 0;
	padding: 0;
	background-color: var(--Today-Base);
	color: var(--Today-Text);
	font-family: var(--Theme-Font);
	outline: none;
	overflow: hidden;
	clip-path: circle(0px at var(--Today-X, 50%) var(--Today-Y, 50%));
	transition:
		clip-path 420ms cubic-bezier(0.55, 0, 0.1, 1),
		--Today-A 700ms ease,
		--Today-B 700ms ease;
}

#TL-Today[data-theme="dark"] {
	--Today-Base: #0c0d11;
	--Today-Text: #f5f5f7;
	--Today-Text-2: #a1a1a8;
	--Today-Surface: rgba(255, 255, 255, 0.06);
	--Today-Surface-Strong: rgba(255, 255, 255, 0.1);
	--Today-Hairline: rgba(255, 255, 255, 0.09);
	--Today-Shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 18px 40px -18px rgba(0, 0, 0, 0.7);
	--Today-Up: #4ade80;
	--Today-Down: #ff7b72;
}

#TL-Today[data-state="closed"] {
	visibility: hidden;
}

#TL-Today[data-state="open"] {
	clip-path: circle(150vmax at var(--Today-X, 50%) var(--Today-Y, 50%));
	transition:
		clip-path 680ms var(--Today-Glide),
		--Today-A 700ms ease,
		--Today-B 700ms ease;
}

/* Everything inside settles from slightly small as the circle opens */
#TL-Today > .TL-Today-Top,
#TL-Today > .TL-Today-Stage {
	transform: scale(0.94);
	transition: transform 420ms cubic-bezier(0.55, 0, 0.1, 1);
}

#TL-Today[data-state="open"] > .TL-Today-Top,
#TL-Today[data-state="open"] > .TL-Today-Stage {
	transform: none;
	transition: transform 720ms var(--Today-Spring);
}

#TL-Today [data-empty="true"] {
	display: none !important;
}

:where(#TL-Today) button {
	margin: 0;
	padding: 0;
	background: none;
	border: 0;
	font: inherit;
	color: inherit;
	cursor: pointer;
	appearance: none;
	-webkit-tap-highlight-color: transparent;
}

/*
** Color wash: two soft glows in the slide's accent, drifting slowly.
*/
#TL-Today > .TL-Today-Wash {
	position: absolute;
	z-index: 0;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
}

.TL-Today-Orb {
	position: absolute;
	width: 90vmax;
	height: 90vmax;
	border-radius: 50%;
	will-change: transform;
	animation: Today-Drift 18s ease-in-out infinite alternate;
}

.TL-Today-Orb.is-one {
	top: -42vmax;
	left: -30vmax;
	background: radial-gradient(closest-side, color-mix(in srgb, var(--Today-A) 30%, transparent), transparent);
}

.TL-Today-Orb.is-two {
	right: -34vmax;
	bottom: -48vmax;
	background: radial-gradient(closest-side, color-mix(in srgb, var(--Today-B) 26%, transparent), transparent);
	animation-delay: -9s;
}

#TL-Today[data-theme="dark"] .TL-Today-Orb.is-one {
	background: radial-gradient(closest-side, color-mix(in srgb, var(--Today-A) 34%, transparent), transparent);
}

#TL-Today[data-theme="dark"] .TL-Today-Orb.is-two {
	background: radial-gradient(closest-side, color-mix(in srgb, var(--Today-B) 22%, transparent), transparent);
}

#TL-Today[data-state="closed"] .TL-Today-Orb {
	animation-play-state: paused;
}

@keyframes Today-Drift {
	to {
		transform: translate(7vmax, 5vmax) scale(1.08);
	}
}

/*
**
** Top Bar
** =================================
*/

.TL-Today-Top {
	position: relative;
	z-index: 2;
	display: grid;
	grid-template-columns: 1fr minmax(0, 440px) 1fr;
	align-items: center;
	gap: 20px;
	padding: 20px 26px 0;
}

.TL-Today-Brand {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.TL-Today-Brand > img {
	width: 26px;
	height: 26px;
}

.TL-Today-Close {
	justify-self: end;
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	background-color: var(--Today-Surface);
	border-radius: 50%;
	box-shadow: var(--Today-Shadow);
	transition: transform 320ms var(--Today-Spring);
}

.TL-Today-Close:hover {
	transform: scale(1.08) rotate(90deg);
}

.TL-Today-Close:active {
	transform: scale(0.92);
}

/* Progress: one segment per section, filling as each is reached */
.TL-Today-Progress {
	display: flex;
	gap: 6px;
}

.TL-Today-Step {
	flex: 1;
	height: 4px;
	background-color: var(--Today-Hairline);
	border-radius: 4px;
	overflow: hidden;
}

.TL-Today-Step > i {
	display: block;
	height: 100%;
	background: linear-gradient(90deg, var(--Today-A), var(--Today-B));
	border-radius: inherit;
	transform: scaleX(0);
	transform-origin: 0 50%;
}

.TL-Today-Step[data-state="done"] > i {
	transform: none;
}

.TL-Today-Step[data-state="current"] > i {
	animation: Today-Fill 620ms var(--Today-Glide) both;
}

@keyframes Today-Fill {
	from {
		transform: scaleX(0);
	}
	to {
		transform: none;
	}
}

/*
**
** Stage & Slides
** =================================
**
** Slides share one grid cell, so the incoming slide rises in while the old one lifts away.
*/

.TL-Today-Stage {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template: minmax(0, 1fr) / minmax(0, 1fr);
	padding: 24px 48px;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	touch-action: pan-y;
}

.TL-Today-Slide {
	grid-area: 1 / 1;
	align-self: safe center;
	justify-self: center;
	box-sizing: border-box;
	width: min(1180px, 100%);
	padding: 12px 0 24px;
	animation: Today-In-Forward 600ms var(--Today-Spring) both;
}

.TL-Today-Slide[data-direction="back"] {
	animation-name: Today-In-Back;
}

.TL-Today-Slide.is-leaving {
	pointer-events: none;
	animation: Today-Out-Forward 300ms cubic-bezier(0.4, 0, 1, 1) both;
}

.TL-Today-Slide.is-leaving[data-direction="back"] {
	animation-name: Today-Out-Back;
}

@keyframes Today-In-Forward {
	from {
		opacity: 0;
		transform: translateY(48px) scale(0.97);
	}
}

@keyframes Today-In-Back {
	from {
		opacity: 0;
		transform: translateY(-48px) scale(0.97);
	}
}

@keyframes Today-Out-Forward {
	to {
		opacity: 0;
		transform: translateY(-36px) scale(0.97);
	}
}

@keyframes Today-Out-Back {
	to {
		opacity: 0;
		transform: translateY(36px) scale(0.97);
	}
}

/* Pieces of a slide rise in one after another (--Rise-Index is set as the slide is built) */
.TL-Today-Slide .TL-Today-Rise {
	animation: Today-Rise 680ms var(--Today-Spring) both;
	animation-delay: calc(min(var(--Rise-Index, 0), 12) * 50ms + 70ms);
}

.TL-Today-Slide.is-leaving .TL-Today-Rise {
	animation: none;
}

@keyframes Today-Rise {
	from {
		opacity: 0;
		transform: translateY(22px) scale(0.98);
	}
}

/*
**
** Type
** =================================
*/

.TL-Today-Eyebrow {
	display: block;
	font-size: 13px;
	font-weight: 700;
	color: color-mix(in srgb, var(--Today-A) 80%, var(--Today-Text));
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.TL-Today-Title {
	margin: 10px 0 0;
	font-size: clamp(40px, 6vw, 76px);
	font-weight: 700;
	line-height: 1.02;
	letter-spacing: -0.035em;
}

.TL-Today-Lead {
	margin: 14px 0 0;
	font-size: clamp(18px, 2.1vw, 26px);
	font-weight: 500;
	line-height: 1.3;
	color: var(--Today-Text-2);
	letter-spacing: -0.01em;
}

/*
**
** Buttons
** =================================
*/

.TL-Today-Primary,
.TL-Today-Secondary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	height: 54px;
	padding: 0 28px;
	font-size: 16px;
	font-weight: 600;
	border-radius: 999px;
	transition:
		transform 360ms var(--Today-Spring),
		box-shadow 260ms ease;
}

.TL-Today-Primary {
	background: linear-gradient(135deg, var(--Today-A), var(--Today-B));
	color: #fff;
	box-shadow: 0 14px 30px -12px var(--Today-A);
}

.TL-Today-Secondary {
	background-color: var(--Today-Surface-Strong);
	box-shadow: var(--Today-Shadow);
}

.TL-Today-Primary:hover,
.TL-Today-Secondary:hover {
	transform: translateY(-2px) scale(1.02);
}

.TL-Today-Primary:hover {
	box-shadow: 0 18px 36px -12px var(--Today-A);
}

.TL-Today-Primary:active,
.TL-Today-Secondary:active {
	transform: scale(0.96);
	transition-duration: 120ms;
}

.TL-Today-Primary > svg {
	transition: transform 360ms var(--Today-Spring);
}

.TL-Today-Primary:hover > svg {
	transform: translateX(3px);
}

/*
**
** Intro
** =================================
*/

.TL-Today-Intro,
.TL-Today-Outro {
	width: min(760px, 100%);
}

.TL-Today-Agenda {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 36px 0;
	padding: 0;
	list-style: none;
}

.TL-Today-Agenda-Item {
	display: flex;
	align-items: center;
	gap: 14px;
	max-width: 460px;
	padding: 10px 18px 10px 10px;
	background-color: var(--Today-Surface);
	border-radius: 20px;
	box-shadow: var(--Today-Shadow);
	animation: Today-Rise 640ms var(--Today-Spring) both;
	animation-delay: calc(var(--Agenda-Index, 0) * 70ms + 280ms);
}

.TL-Today-Agenda-Icon,
.TL-Today-Section-Icon {
	display: grid;
	flex: none;
	place-items: center;
	width: 46px;
	height: 46px;
	background-color: color-mix(in srgb, var(--Accent-A, var(--Today-A)) 14%, transparent);
	border-radius: 14px;
}

.TL-Today-Agenda-Icon > img,
.TL-Today-Section-Icon > img {
	width: 32px;
	height: 32px;
}

.TL-Today-Agenda-Name {
	flex: 1;
	font-size: 17px;
	font-weight: 600;
}

.TL-Today-Agenda-Number {
	font-size: 13px;
	font-weight: 600;
	color: var(--Today-Text-2);
	font-variant-numeric: tabular-nums;
}

/*
**
** Section
** =================================
**
** The headline sentence on the left; the day's numbers and the last 14 days on the right.
*/

.TL-Today-Section {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
	align-items: center;
	gap: 56px;
}

.TL-Today-Section.is-loading,
.TL-Today-Section.is-error {
	grid-template-columns: minmax(0, 1fr);
	width: min(760px, 100%);
}

.TL-Today-Section-Head {
	display: flex;
	align-items: center;
	gap: 12px;
}

/* Numbers size themselves to their own box (--Fit-Em is set by TL.Today.FitNumbers) */
.TL-Today-Section > .TL-Today-Headline,
.TL-Today-Stats > .TL-Today-Stat,
.TL-Today-Totals > .TL-Today-Total {
	container-type: inline-size;
}

.TL-Today-Headline > .TL-Today-Hero {
	--Fit-Max: 116px;
}

.TL-Today-Hero {
	margin: 6px 0 0;
	font-size: min(var(--Fit-Max, 116px), calc(97cqi / var(--Fit-Em, 6)));
	font-weight: 700;
	line-height: 1;
	letter-spacing: -0.045em;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	background: linear-gradient(120deg, var(--Today-Text) 45%, color-mix(in srgb, var(--Today-A) 85%, var(--Today-Text)));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

/* No number to lead with, so the sentence itself becomes the headline */
.TL-Today-Headline > .TL-Today-Lead:has(+ .TL-Today-Hero[data-empty="true"]) {
	margin-top: 10px;
	font-size: clamp(34px, 4.6vw, 60px);
	font-weight: 700;
	line-height: 1.06;
	letter-spacing: -0.035em;
	background: linear-gradient(120deg, var(--Today-Text) 45%, color-mix(in srgb, var(--Today-A) 85%, var(--Today-Text)));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	text-wrap: balance;
}

.TL-Today-Changes {
	margin: 18px 0 0;
	font-size: clamp(18px, 2vw, 24px);
	font-weight: 500;
	line-height: 1.35;
	color: var(--Today-Text-2);
	letter-spacing: -0.01em;
}

.TL-Today-Change > b {
	font-weight: 700;
}

/* Good news reads green and bad news red, whichever way the number went */
.TL-Today-Change[data-sentiment="good"] > b {
	color: var(--Today-Up);
}

.TL-Today-Change[data-sentiment="bad"] > b {
	color: var(--Today-Down);
}

.TL-Today-Note {
	margin: 12px 0 0;
	font-size: 14px;
	font-weight: 500;
	color: var(--Today-Text-2);
}

/* Drill in links */
.TL-Today-Links {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 30px;
}

.TL-Today-Link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 42px;
	padding: 0 18px;
	background-color: var(--Today-Surface-Strong);
	font-size: 14px;
	font-weight: 600;
	border-radius: 999px;
	box-shadow: var(--Today-Shadow);
	transition:
		transform 340ms var(--Today-Spring),
		background-color 200ms ease,
		color 200ms ease;
}

.TL-Today-Link > svg {
	color: var(--Today-A);
	transition:
		transform 340ms var(--Today-Spring),
		color 200ms ease;
}

.TL-Today-Link:hover {
	background-color: var(--Today-A);
	color: #fff;
	transform: translateY(-2px);
}

.TL-Today-Link:hover > svg {
	color: #fff;
	transform: translate(2px, -2px);
}

.TL-Today-Link:active {
	transform: scale(0.96);
}

/* Stats */
.TL-Today-Details {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.TL-Today-Stats {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
}

.TL-Today-Stat,
.TL-Today-Trend {
	box-sizing: border-box;
	background-color: var(--Today-Surface);
	border-radius: 22px;
	box-shadow: var(--Today-Shadow);
}

.TL-Today-Stat {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	min-width: 0;
	padding: 16px 18px;
}

.TL-Today-Stat-Label,
.TL-Today-Total-Label,
.TL-Today-Trend-Label {
	font-size: 13px;
	font-weight: 600;
	color: var(--Today-Text-2);
}

.TL-Today-Stat-Value {
	max-width: 100%;
	font-size: min(30px, calc(97cqi / var(--Fit-Em, 6)));
	font-weight: 700;
	letter-spacing: -0.03em;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Values that are good or bad news on their own, like profit after labor */
.TL-Today-Stat[data-tone="good"] > .TL-Today-Stat-Value,
.TL-Today-Total[data-tone="good"] > .TL-Today-Total-Value {
	color: var(--Today-Up);
}

.TL-Today-Stat[data-tone="bad"] > .TL-Today-Stat-Value,
.TL-Today-Total[data-tone="bad"] > .TL-Today-Total-Value {
	color: var(--Today-Down);
}

.TL-Today-Stat-Caption {
	max-width: 100%;
	font-size: 12.5px;
	font-weight: 500;
	color: var(--Today-Text-2);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Change pills */
.TL-Today-Pill {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-top: 4px;
	padding: 4px 9px;
	background-color: var(--Today-Hairline);
	font-size: 12px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	border-radius: 999px;
	white-space: nowrap;
}

.TL-Today-Pill > i {
	font-style: normal;
	font-weight: 500;
	opacity: 0.75;
}

.TL-Today-Pill[data-sentiment="good"] {
	background-color: color-mix(in srgb, var(--Today-Up) 14%, transparent);
	color: var(--Today-Up);
}

.TL-Today-Pill[data-sentiment="bad"] {
	background-color: color-mix(in srgb, var(--Today-Down) 14%, transparent);
	color: var(--Today-Down);
}

.TL-Today-Pill[data-direction="up"]::before {
	content: "↑";
}

.TL-Today-Pill[data-direction="down"]::before {
	content: "↓";
}

/* The last 14 days */
.TL-Today-Trend {
	padding: 18px 20px 16px;
}

.TL-Today-Trend-Head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
}

.TL-Today-Trend-Range {
	font-size: 12.5px;
	font-weight: 500;
	color: var(--Today-Text-2);
	font-variant-numeric: tabular-nums;
}

.TL-Today-Bars {
	display: flex;
	align-items: flex-end;
	gap: 6px;
	height: 112px;
	margin-top: 16px;
}

.TL-Today-Bar {
	flex: 1;
	height: var(--Bar-Height, 2%);
	min-height: 3px;
	background-color: color-mix(in srgb, var(--Today-A) 26%, transparent);
	border-radius: 6px 6px 3px 3px;
	transform-origin: 50% 100%;
	animation: Today-Bar 720ms var(--Today-Spring) both;
	animation-delay: calc(var(--Bar-Index, 0) * 26ms + 360ms);
}

.TL-Today-Bar[data-current="true"] {
	background: linear-gradient(180deg, var(--Today-B), var(--Today-A));
	box-shadow: 0 8px 18px -8px var(--Today-A);
}

/* Days still to come: empty slots, so it's clear how much of the period is left */
.TL-Today-Bars > .TL-Today-Bar[data-upcoming="true"] {
	box-sizing: border-box;
	background: none;
	border: 1.5px dashed color-mix(in srgb, var(--Today-A) 22%, transparent);
	box-shadow: none;
}

@keyframes Today-Bar {
	from {
		transform: scaleY(0);
	}
}

.TL-Today-Totals {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 14px 18px;
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid var(--Today-Hairline);
}

.TL-Today-Total {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	min-width: 0;
}

.TL-Today-Total-Value {
	max-width: 100%;
	font-size: min(20px, calc(97cqi / var(--Fit-Em, 6)));
	font-weight: 700;
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.TL-Today-Total > .TL-Today-Stat-Caption {
	margin-top: 2px;
}

/*
** People: birthdays and anniversaries, one row each, with today's standing out
*/
.TL-Today-People {
	box-sizing: border-box;
	padding: 18px 20px 12px;
	background-color: var(--Today-Surface);
	border-radius: 22px;
	box-shadow: var(--Today-Shadow);
}

.TL-Today-People > .TL-Today-People-List {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-top: 12px;
}

.TL-Today-People-List > .TL-Today-Person {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto auto;
	align-items: center;
	gap: 12px;
	margin: 0 -10px;
	padding: 8px 10px;
	border-radius: 16px;
	animation: Today-Rise 600ms var(--Today-Spring) both;
}

.TL-Today-People-List > .TL-Today-Person:nth-child(2) {
	animation-delay: 60ms;
}

.TL-Today-People-List > .TL-Today-Person:nth-child(3) {
	animation-delay: 120ms;
}

.TL-Today-People-List > .TL-Today-Person:nth-child(n + 4) {
	animation-delay: 180ms;
}

.TL-Today-People-List > .TL-Today-Person[data-today="true"] {
	background-color: color-mix(in srgb, var(--Today-A) 10%, transparent);
}

.TL-Today-Person > .TL-Today-Person-Photo {
	position: relative;
	width: 42px;
	height: 42px;
	margin: 0;
	background-color: var(--Today-Hairline);
	background-size: cover;
	background-position: center;
	border-radius: 50%;
	box-shadow: 0 0 0 2px var(--Today-Surface-Strong);
}

.TL-Today-Person-Photo > .TL-Photo-Initials {
	width: 100%;
	height: 100%;
}

.TL-Today-Person-Photo .TL-Photo-Initials-Brand {
	top: -3px;
	right: -3px;
	width: 18px;
	height: 18px;
	box-shadow: 0 0 0 2px var(--Today-Surface-Strong);
}

.TL-Today-Person > .TL-Today-Person-Copy {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.TL-Today-Person-Copy > .TL-Today-Person-Name {
	overflow: hidden;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: -0.01em;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.TL-Today-Person-Copy > .TL-Today-Person-What {
	overflow: hidden;
	font-size: 12.5px;
	font-weight: 500;
	color: var(--Today-Text-2);
	white-space: nowrap;
	text-overflow: ellipsis;
}

.TL-Today-Person > .TL-Today-Person-When {
	font-size: 12.5px;
	font-weight: 600;
	color: var(--Today-Text-2);
	white-space: nowrap;
}

.TL-Today-Person[data-today="true"] > .TL-Today-Person-When {
	color: color-mix(in srgb, var(--Today-A) 85%, var(--Today-Text));
}

.TL-Today-Person > .TL-Today-Person-Badge {
	width: 26px;
	height: 26px;
}

/*
** Item rows: anything that isn't a person, such as an animal. An icon tile stands in for the
** photo, and the row's type tints the tile and its When text: red for health concerns,
** amber for weight off goal, neutral for everything else.
*/
.TL-Today-People-List > .TL-Today-Person[data-kind="item"] {
	--Item-Tone: var(--Today-Text-2);
	grid-template-columns: auto minmax(0, 1fr) auto;
}

.TL-Today-People-List > .TL-Today-Person[data-kind="item"][data-type="care"],
.TL-Today-People-List > .TL-Today-Person[data-kind="item"][data-type="swing"] {
	--Item-Tone: var(--Today-Down);
}

.TL-Today-People-List > .TL-Today-Person[data-kind="item"][data-type="medication"] {
	--Item-Tone: #0f8f84;
}

.TL-Today-People-List > .TL-Today-Person[data-kind="item"][data-type="under"],
.TL-Today-People-List > .TL-Today-Person[data-kind="item"][data-type="over"] {
	--Item-Tone: #d08a2c;
}

.TL-Today-Person[data-kind="item"] > .TL-Today-Person-Art {
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	background: linear-gradient(160deg, color-mix(in srgb, var(--Item-Tone) 16%, var(--Today-Surface-Strong)), color-mix(in srgb, var(--Item-Tone) 6%, var(--Today-Surface-Strong)));
	border-radius: 13px;
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--Item-Tone) 14%, transparent);
}

.TL-Today-Person-Art > img {
	width: 26px;
	height: 26px;
}

.TL-Today-Person[data-kind="item"] > .TL-Today-Person-When {
	font-variant-numeric: tabular-nums;
	color: var(--Item-Tone);
}

/* Nobody in the list: a soft, centered illustration instead of a blank card */
.TL-Today-People-List > .TL-Today-People-Empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 18px 12px 14px;
	text-align: center;
	animation: Today-Rise 600ms var(--Today-Spring) both;
}

.TL-Today-People-Empty > .TL-Today-People-Empty-Art {
	display: grid;
	place-items: center;
	width: 72px;
	height: 72px;
	margin-bottom: 10px;
	background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--Today-A) 22%, transparent), transparent 70%);
	border-radius: 50%;
}

.TL-Today-People-Empty-Art > img {
	width: 50px;
	height: 50px;
	animation: Today-Empty-Float 3.6s ease-in-out infinite;
}

.TL-Today-People-Empty > .TL-Today-People-Empty-Title {
	font-size: 16px;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--Today-Text);
}

.TL-Today-People-Empty > .TL-Today-People-Empty-Copy {
	max-width: 30ch;
	font-size: 13.5px;
	line-height: 1.4;
	color: var(--Today-Text-2);
}

@keyframes Today-Empty-Float {
	0%,
	100% {
		transform: translateY(0) rotate(-4deg);
	}
	50% {
		transform: translateY(-4px) rotate(4deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.TL-Today-People-Empty-Art > img {
		animation: none;
	}
}

/* Loading and errors */
.TL-Today-Dots {
	display: flex;
	gap: 8px;
	margin-top: 28px;
}

.TL-Today-Dots > i {
	width: 10px;
	height: 10px;
	background-color: var(--Today-A);
	border-radius: 50%;
	animation: Today-Dot 900ms ease-in-out infinite;
}

.TL-Today-Dots > i:nth-child(2) {
	animation-delay: 150ms;
}

.TL-Today-Dots > i:nth-child(3) {
	animation-delay: 300ms;
}

@keyframes Today-Dot {
	0%,
	100% {
		opacity: 0.3;
		transform: translateY(0);
	}
	50% {
		opacity: 1;
		transform: translateY(-6px);
	}
}

.TL-Today-Section.is-error .TL-Today-Secondary {
	margin-top: 28px;
}

/*
**
** Outro
** =================================
*/

.TL-Today-Outro {
	text-align: center;
}

.TL-Today-Outro-Icon {
	display: inline-grid;
	place-items: center;
	width: 112px;
	height: 112px;
	background-color: var(--Today-Surface-Strong);
	border-radius: 34px;
	box-shadow: var(--Today-Shadow);
}

.TL-Today-Outro-Icon > img {
	width: 76px;
	height: 76px;
	animation: Today-Float 3.2s ease-in-out infinite alternate;
}

@keyframes Today-Float {
	to {
		transform: translateY(-6px) rotate(-4deg);
	}
}

.TL-Today-Outro-Actions {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 36px;
}

/*
**
** Controls
** =================================
**
** Back, position, and next for the sections. The intro and closing slides have their own buttons.
*/

.TL-Today-Controls {
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	padding: 8px 26px 28px;
	transition:
		opacity 220ms ease,
		transform 420ms var(--Today-Spring);
}

#TL-Today:not([data-kind="section"]) .TL-Today-Controls {
	opacity: 0;
	transform: translateY(14px);
	pointer-events: none;
}

.TL-Today-Round {
	display: grid;
	place-items: center;
	width: 46px;
	height: 46px;
	background-color: var(--Today-Surface-Strong);
	border-radius: 50%;
	box-shadow: var(--Today-Shadow);
	transition: transform 320ms var(--Today-Spring);
}

.TL-Today-Next {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 46px;
	padding: 0 22px;
	background-color: var(--Today-Text);
	color: var(--Today-Base);
	font-size: 15px;
	font-weight: 600;
	border-radius: 999px;
	transition: transform 320ms var(--Today-Spring);
}

.TL-Today-Round:hover,
.TL-Today-Next:hover {
	transform: scale(1.05);
}

.TL-Today-Round:active,
.TL-Today-Next:active {
	transform: scale(0.94);
}

.TL-Today-Counter {
	min-width: 56px;
	font-size: 13px;
	font-weight: 600;
	color: var(--Today-Text-2);
	text-align: center;
	font-variant-numeric: tabular-nums;
}

/*
**
** Daily Summary Card
** =================================
*/

.TL-Message-Preview-Home.TL-Today-Card {
	display: flex;
	align-items: center;
	gap: 14px;
	min-height: 0;
	padding: 16px;
	background-color: #6d5efc;
	background-image: linear-gradient(135deg, #6d5efc 0%, #9b5cf6 58%, #f08bb8 120%);
	color: #fff;
	overflow: hidden;
	outline: none;
}

#TL-Home .TL-Message-Preview-Home.TL-Today-Card {
	box-shadow: 0 18px 34px -14px rgba(109, 94, 252, 0.6);
}

/* A soft highlight across the top, like light on glass */
.TL-Today-Card::before {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(120% 80% at 10% 0%, rgba(255, 255, 255, 0.28), transparent 60%);
	pointer-events: none;
}

.TL-Today-Card-Icon {
	position: relative;
	display: grid;
	flex: none;
	place-items: center;
	width: 54px;
	height: 54px;
	background-color: rgba(255, 255, 255, 0.2);
	border-radius: 16px;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.TL-Today-Card-Icon > img {
	width: 36px;
	height: 36px;
	transition: transform 420ms cubic-bezier(0.34, 1.6, 0.64, 1);
}

.TL-Today-Card:hover .TL-Today-Card-Icon > img {
	transform: scale(1.12) rotate(-6deg);
}

.TL-Today-Card-Copy {
	position: relative;
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
	text-align: left;
}

.TL-Today-Card-Eyebrow {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	opacity: 0.8;
}

.TL-Today-Card-Title {
	font-size: 16px;
	font-weight: 700;
	line-height: 20px;
	letter-spacing: -0.01em;
}

.TL-Today-Card-Body {
	font-size: 12.5px;
	line-height: 17px;
	opacity: 0.9;
}

.TL-Today-Card-Go {
	position: relative;
	display: grid;
	flex: none;
	place-items: center;
	width: 34px;
	height: 34px;
	background-color: rgba(255, 255, 255, 0.22);
	border-radius: 50%;
	transition: transform 360ms cubic-bezier(0.34, 1.6, 0.64, 1);
}

.TL-Today-Card:hover .TL-Today-Card-Go {
	transform: translateX(3px) scale(1.06);
}

/*
**
** Home Button
** =================================
**
** While the home screen is showing, the home button becomes the Today button. Until Today
** has been opened that day (data-today="ready"), it glows softly to call attention to itself.
*/

button.option[data-option="home"] > .inner > img {
	transition:
		opacity 200ms ease,
		transform 460ms cubic-bezier(0.34, 1.6, 0.64, 1);
}

body[data-home="true"][data-today] button.option[data-option="home"] > .inner > img:not(.today-glyph) {
	opacity: 0;
	transform: scale(0.4) rotate(-24deg);
}

button.option[data-option="home"] > .inner > img.today-glyph {
	transform: scale(0.4) rotate(-24deg);
}

body[data-home="true"][data-today] button.option[data-option="home"] > .inner > img.today-glyph {
	opacity: 1;
	transform: none;
}

/* The label follows the icon on the desktop navigation */
body[data-home="true"][data-today] #TL-System-Nav > .primary-options > button.option[data-option="home"] > .title-tag:not(.today-tag) {
	display: none;
}

body[data-home="true"][data-today] #TL-System-Nav > .primary-options > button.option[data-option="home"] > .title-tag.today-tag {
	display: inline-block;
}

/* The soft glow that calls attention to an unopened Today */
body[data-home="true"][data-today="ready"] button.option[data-option="home"] > .inner::after {
	content: "";
	position: absolute;
	inset: -3px;
	border: 2px solid #8a6cff;
	border-radius: 11px;
	pointer-events: none;
	animation: Today-Call 2.4s ease-out infinite;
}

@keyframes Today-Call {
	0% {
		opacity: 0.9;
		transform: scale(0.92);
	}
	70%,
	100% {
		opacity: 0;
		transform: scale(1.18);
	}
}

/*
**
** Small Screens
** =================================
*/

@media (max-width: 1000px) {
	.TL-Today-Section {
		grid-template-columns: minmax(0, 1fr);
		gap: 28px;
	}
}

@media (max-width: 640px) {
	/* Clear the notch and status bar on phones */
	#TL-Today > .TL-Today-Top {
		grid-template-columns: auto minmax(0, 1fr) auto;
		gap: 14px;
		padding: calc(14px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) 0 calc(16px + env(safe-area-inset-left));
	}

	#TL-Today > .TL-Today-Top > .TL-Today-Brand > span {
		display: none;
	}

	/* Comfortable thumb targets */
	#TL-Today > .TL-Today-Top > .TL-Today-Close {
		width: 44px;
		height: 44px;
	}

	#TL-Today > .TL-Today-Stage {
		padding: 12px calc(20px + env(safe-area-inset-right)) 16px calc(20px + env(safe-area-inset-left));
	}

	#TL-Today .TL-Today-Section {
		gap: 22px;
	}

	/* The hero still fits its box, just with a smaller ceiling so it stays in proportion */
	#TL-Today .TL-Today-Headline > .TL-Today-Hero {
		--Fit-Max: 64px;
	}

	/* Long names and headings break rather than run off the edge */
	#TL-Today .TL-Today-Headline > .TL-Today-Title,
	#TL-Today .TL-Today-Intro > .TL-Today-Title,
	#TL-Today .TL-Today-Outro > .TL-Today-Title {
		overflow-wrap: anywhere;
	}

	/* The intro's start button, full width within easy reach */
	#TL-Today .TL-Today-Intro > .TL-Today-Primary {
		width: 100%;
	}

	#TL-Today .TL-Today-Agenda {
		margin: 26px 0;
	}

	#TL-Today .TL-Today-Links {
		margin-top: 22px;
	}

	#TL-Today .TL-Today-Link {
		height: 44px;
	}

	#TL-Today .TL-Today-Stats {
		gap: 10px;
	}

	#TL-Today .TL-Today-Stat {
		padding: 14px;
	}

	#TL-Today .TL-Today-Stat > .TL-Today-Stat-Value {
		font-size: min(26px, calc(97cqi / var(--Fit-Em, 6)));
	}

	/* Change pills wrap their label under the percent rather than spilling out of a narrow card */
	#TL-Today .TL-Today-Stat > .TL-Today-Pill,
	#TL-Today .TL-Today-Total > .TL-Today-Pill {
		flex-wrap: wrap;
		max-width: 100%;
		box-sizing: border-box;
		border-radius: 10px;
		white-space: normal;
	}

	#TL-Today .TL-Today-Trend {
		padding: 16px 16px 14px;
	}

	#TL-Today .TL-Today-Bars {
		gap: 4px;
		height: 92px;
	}

	/* Two totals per row instead of one long column */
	#TL-Today .TL-Today-Trend > .TL-Today-Totals {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 14px 12px;
	}

	#TL-Today .TL-Today-People {
		padding: 16px 16px 10px;
	}

	/* Tighter rows so names have room next to the date and badge */
	#TL-Today .TL-Today-People-List > .TL-Today-Person {
		gap: 10px;
		margin: 0 -8px;
		padding: 8px;
	}

	#TL-Today .TL-Today-Person > .TL-Today-Person-Photo {
		width: 38px;
		height: 38px;
	}

	#TL-Today .TL-Today-Person > .TL-Today-Person-Badge {
		width: 22px;
		height: 22px;
	}

	#TL-Today .TL-Today-Person[data-kind="item"] > .TL-Today-Person-Art {
		width: 38px;
		height: 38px;
		border-radius: 12px;
	}

	#TL-Today .TL-Today-Person-Art > img {
		width: 22px;
		height: 22px;
	}

	/* The closing slide's buttons stack full width, within easy reach */
	#TL-Today .TL-Today-Outro-Actions > button {
		flex: 1 1 100%;
	}

	#TL-Today > .TL-Today-Controls {
		padding: 8px 16px calc(18px + env(safe-area-inset-bottom));
	}
}

/* Phones on their side: wide but short, so the headline shrinks and the stage scrolls sooner */
@media (max-height: 520px) and (orientation: landscape) {
	#TL-Today > .TL-Today-Top {
		padding-top: calc(10px + env(safe-area-inset-top));
	}

	#TL-Today > .TL-Today-Stage {
		padding: 10px calc(24px + env(safe-area-inset-right)) 10px calc(24px + env(safe-area-inset-left));
	}

	#TL-Today .TL-Today-Headline > .TL-Today-Hero {
		--Fit-Max: 72px;
	}

	#TL-Today .TL-Today-Title {
		font-size: clamp(32px, 5vw, 48px);
	}

	#TL-Today > .TL-Today-Controls {
		padding: 4px 16px calc(10px + env(safe-area-inset-bottom));
	}
}

/*
** Touch screens keep :hover after a tap, which would leave links filled in and buttons
** lifted. They get press feedback from :active instead.
*/
@media (hover: none) {
	#TL-Today .TL-Today-Close:hover:not(:active),
	#TL-Today .TL-Today-Primary:hover:not(:active),
	#TL-Today .TL-Today-Secondary:hover:not(:active),
	#TL-Today .TL-Today-Primary:hover > svg,
	#TL-Today .TL-Today-Link:hover:not(:active),
	#TL-Today .TL-Today-Link:hover > svg,
	#TL-Today .TL-Today-Round:hover:not(:active),
	#TL-Today .TL-Today-Next:hover:not(:active),
	.TL-Today-Card:hover > .TL-Today-Card-Icon > img,
	.TL-Today-Card:hover > .TL-Today-Card-Go {
		transform: none;
	}

	#TL-Today .TL-Today-Primary:hover {
		box-shadow: 0 14px 30px -12px var(--Today-A);
	}

	#TL-Today .TL-Today-Link:hover {
		background-color: var(--Today-Surface-Strong);
		color: inherit;
	}

	#TL-Today .TL-Today-Link:hover > svg {
		color: var(--Today-A);
	}
}

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

@media (prefers-reduced-motion: reduce) {
	#TL-Today,
	#TL-Today[data-state="open"] {
		transition: opacity 200ms ease;
	}

	#TL-Today[data-state="open"] {
		clip-path: none;
	}

	#TL-Today > .TL-Today-Top,
	#TL-Today > .TL-Today-Stage {
		transform: none;
	}

	.TL-Today-Slide,
	.TL-Today-Slide .TL-Today-Rise,
	.TL-Today-Agenda-Item,
	.TL-Today-Bar,
	.TL-Today-Orb,
	.TL-Today-Outro-Icon > img,
	.TL-Today-Step[data-state="current"] > i {
		animation: none;
	}

	.TL-Today-Slide.is-leaving {
		display: none;
	}

	body[data-home="true"][data-today="ready"] button.option[data-option="home"] > .inner::after {
		animation: none;
		opacity: 0.8;
	}
}
