/**
 * PP Calendario de Eventos — front-end styles.
 * Everything is scoped under .pp-calendar and prefixed pp- to avoid theme
 * collisions in either direction.
 */

.pp-calendar {
	--pp-card-bg: #ffffff;
	--pp-ink: #1c2c42;
	--pp-ink-soft: #5a6b7d;
	/* Secondary text that still has to be read: weekday headers, empty states. */
	--pp-ink-strong: #102A43;
	/* Decorative only - never put text on this, it is 2.45:1 on white. */
	--pp-muted: #9aa7b5;
	--pp-primary: #1d5aa6;
	--pp-primary-strong: #164e8c;
	--pp-primary-050: #eaf1fb;
	--pp-hairline: #e5eaf1;
	--pp-grid-line: #edf1f6;
	/*
	 * Carries white text (chips, CTA button, day counter), so it has to clear
	 * 4.5:1 against white. Same hue and saturation as the original #278bff,
	 * only darker: that one sat at 3.37:1 and failed WCAG AA.
	 */
	--pp-event: #0070F3;
	--pp-event-soft: rgba(0, 112, 243, .10);
	--pp-event-hover: rgba(0, 112, 243, .18);
	/* Same treatment for the agenda date badge, which was #5896CE at 3.15:1. */
	--pp-date-bg: #367AB8;
	--pp-badge-bg: #1d5aa6;
	--pp-badge-ink: #ffffff;
	--pp-shadow: 0 18px 40px -24px rgba(20, 45, 90, .35), 0 2px 6px -2px rgba(20, 45, 90, .10);
	/*
	 * Ceiling for the agenda panel. Both columns run to the height of the
	 * taller one, so without this a day with many events would drag the
	 * calendar up with it and blow the day cells out of proportion. Below
	 * this the panel grows to fill; above it, it scrolls.
	 */
	--pp-agenda-max: 320px;
	--pp-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

	color-scheme: light;
	color: var(--pp-ink);
	font-family: var(--pp-sans);
}

.pp-calendar *,
.pp-calendar *::before,
.pp-calendar *::after {
	box-sizing: border-box;
}

/**
 * Elementor: a Shortcode widget is a flex item with flex-grow:0, so it shrinks
 * to the calendar's natural width instead of filling its container. Let the
 * widget holding our calendar take the full container width.
 */
.elementor-widget-shortcode:has(.pp-calendar) {
	width: 100%;
}

/*
 * Both columns run to the same foot, whichever of the two is the taller. That
 * only reads well once each side nominates something to absorb the slack: on
 * the left the day grid, whose cells simply get taller, and on the right the
 * agenda panel, so the timeline stays its own size and sits at the bottom.
 * Without that the shorter column would stretch and carry a dead gap inside.
 */
.pp-calendar .pp-cal-board {
	display: grid;
	grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
	gap: 44px;
	align-items: stretch;
}

/* ---------- Calendar card ---------- */
/*
 * The day cells scale with this card, not with the viewport (the board is a
 * two-column grid), so the card is the query container for cell density.
 */
.pp-calendar .pp-cal {
	display: flex;
	flex-direction: column;
	background: var(--pp-card-bg);
	border-radius: 20px;
	box-shadow: var(--pp-shadow);
	padding: 22px 22px 18px;
	container-type: inline-size;
	container-name: ppcal;
}

/* The card's share of the slack lands here, spread evenly over the weeks. */
.pp-calendar .pp-cal-grid {
	flex: 1;
	grid-auto-rows: 1fr;
}

.pp-calendar .pp-cal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 14px;
}

.pp-calendar .pp-cal-title {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 600;
	letter-spacing: -0.01em;
	color: var(--pp-primary-strong);
}

.pp-calendar .pp-cal-title .pp-yr {
	color: var(--pp-primary);
	font-weight: 600;
}

.pp-calendar .pp-cal-nav {
	appearance: none;
	border: 0;
	background: transparent;
	color: var(--pp-primary);
	font-size: 1rem;
	line-height: 1;
	padding: 8px 10px;
	border-radius: 0;
	cursor: pointer;
	transition: background .15s ease;
}

.pp-calendar .pp-cal-nav:hover {
	background: var(--pp-primary-050);
}

.pp-calendar .pp-cal-nav:focus-visible {
	outline: 2px solid var(--pp-primary);
	outline-offset: 2px;
}

.pp-calendar .pp-cal-weekdays,
.pp-calendar .pp-cal-grid {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
}

.pp-calendar .pp-cal-weekdays {
	border-bottom: 1px solid var(--pp-hairline);
	padding-bottom: 10px;
	margin-bottom: 2px;
}

.pp-calendar .pp-cal-weekdays span {
	text-align: center;
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.07em;
	color: var(--pp-ink-strong);
	text-transform: uppercase;
}

/*
 * The classic ruled grid, so each weekday reads as its own column. A rounded
 * tile pressed flat against those lines looks like a mistake, so the cell
 * carries the padding that insets the tile and lets the curve sit clear of
 * them. The lines stay on --pp-grid-line: present, never loud.
 */
.pp-calendar .pp-cal-cell {
	min-width: 0;
	padding: 3px;
	border-right: 1px solid var(--pp-grid-line);
	border-bottom: 1px solid var(--pp-grid-line);
}

.pp-calendar .pp-cal-grid .pp-cal-cell:nth-child(7n) {
	border-right: 0;
}

.pp-calendar .pp-cal-cell.is-empty {
	background: transparent;
}

.pp-calendar .pp-cal-day {
	all: unset;
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 4px;
	box-sizing: border-box;
	width: 100%;
	height: 100%;
	min-height: 72px;
	overflow: hidden;
	/*
	 * The tile is what gets rounded. The day number stays square on purpose:
	 * its circle was removed on request and is not coming back.
	 */
	border-radius: 10px;
	padding: 6px 5px 6px 8px;
	cursor: pointer;
	color: var(--pp-ink);
	font-size: 0.92rem;
	font-weight: 500;
	font-variant-numeric: tabular-nums;
	transition: background .15s ease, color .15s ease;
}

.pp-calendar .pp-cal-num {
	display: inline-flex;
	align-self: flex-start;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 22px;
	height: 22px;
	line-height: 1;
}

.pp-calendar .pp-cal-day:hover {
	background: var(--pp-primary-050);
}

.pp-calendar .pp-cal-day:focus-visible {
	outline: 2px solid var(--pp-primary);
	outline-offset: -2px;
}

/* Today: a ring around the number only, so it never competes with a fill. */
.pp-calendar .pp-cal-day.is-today .pp-cal-num {
	box-shadow: inset 0 0 0 2px var(--pp-event);
	font-weight: 700;
}

/* Days that hold events: tinted ground, carrying the chip or the counter. */
.pp-calendar .pp-cal-day.has-events {
	background: var(--pp-event-soft);
}

.pp-calendar .pp-cal-day.has-events:hover {
	background: var(--pp-event-hover);
}

.pp-calendar .pp-cal-chips {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.pp-calendar .pp-cal-chip {
	display: block;
	min-width: 0;
	padding: 3px 5px;
	background: var(--pp-event);
	color: #fff;
	font-size: 0.66rem;
	font-weight: 600;
	line-height: 1.35;
	white-space: nowrap;
	overflow: hidden;
}

.pp-calendar .pp-chip-title {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pp-calendar .pp-cal-more {
	font-size: 0.62rem;
	font-weight: 600;
	/*
	 * This one is text on the day's tinted ground, not a fill, so it needs a
	 * text-grade blue: --pp-event would only reach 3.54:1 over the hover tint.
	 */
	letter-spacing: 0.02em;
	color: var(--pp-primary-strong);
}

/* Selection stays the strongest signal: a solid fill over the tint. */
.pp-calendar .pp-cal-day.is-selected {
	background: var(--pp-primary);
	color: #fff;
	font-weight: 600;
}

.pp-calendar .pp-cal-day.is-selected:hover {
	background: var(--pp-primary);
}

/* Inside the solid fill the chip inverts so it stays legible. */
.pp-calendar .pp-cal-day.is-selected .pp-cal-chip {
	background: rgba(255, 255, 255, .24);
	color: #fff;
}

.pp-calendar .pp-cal-day.is-selected .pp-cal-more {
	color: #fff;
}

.pp-calendar .pp-cal-day.is-selected.is-today .pp-cal-num {
	box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .85);
}

/* ---------- Agenda ---------- */
/*
 * An earlier version made this column `height: 0; min-height: 100%` so the
 * calendar alone would set the board height. It relies on the grid row having
 * a definite size, which it does in isolation and does not inside the theme's
 * container chain - there the panel never got a height to clamp against, so
 * it would not scroll at all. Plain stretch instead: the taller column wins,
 * and the panel's own ceiling keeps that from running away.
 */
.pp-calendar .pp-cal-agenda {
	display: flex;
	flex-direction: column;
	padding-top: 4px;
}

/*
 * A flex item stretches across the cross axis by default, which would pull the
 * date badge from a chip into a full-width bar.
 */
.pp-calendar .pp-cal-date {
	align-self: flex-start;
	display: inline-block;
	background: var(--pp-date-bg);
	color: var(--pp-badge-ink);
	font-weight: 600;
	font-size: 0.98rem;
	padding: 11px 20px;
	border-radius: 0;
	margin-bottom: 22px;
	border-radius: 4px;
}

/*
 * The panel is the column's surface in both states: a quiet day and a busy one
 * are the same designed object, one holding cards and one holding a message.
 * Recessed where the calendar card is raised, which is also the difference
 * between "nothing here" and "nothing loaded".
 *
 * The fill is a flat colour rather than a gradient on purpose. Elementor's
 * background lazy-load drops background-image on every descendant of its
 * fourth container onwards until it marks that container loaded, and its
 * selector outranks this one, so a gradient would not exist for part of the
 * page life.
 */
.pp-calendar .pp-cal-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 14px;
	border: 1px solid var(--pp-hairline);
	border-radius: 16px;
	background-color: #f6f9fd;
	/*
	 * The panel takes whatever the column has left after the badge and the
	 * timeline, and starts scrolling exactly when the cards stop fitting in
	 * it. No fixed ceiling is needed any more: the card's height is the
	 * ceiling.
	 */
	/*
	 * A real ceiling, in pixels. `overflow-y: auto` only ever scrolls against
	 * a definite height, so this is what makes the panel scrollable at all -
	 * with the height inherited from a percentage chain it silently did not.
	 */
	flex: 1 1 auto;
	min-height: 150px;
	max-height: var(--pp-agenda-max);
	overflow-y: auto;
	/* Do not hand the page a scroll the user meant for this list. */
	overscroll-behavior: contain;
	/* Reserve the gutter so picking a busy day does not shift the column. */
	scrollbar-gutter: stable;
	scrollbar-width: thin;
	scrollbar-color: var(--pp-hairline) transparent;
}

.pp-calendar .pp-cal-list:focus-visible {
	outline: 2px solid var(--pp-primary);
	outline-offset: 2px;
}

.pp-calendar .pp-cal-list::-webkit-scrollbar {
	width: 8px;
}

.pp-calendar .pp-cal-list::-webkit-scrollbar-track {
	background: transparent;
}

.pp-calendar .pp-cal-list::-webkit-scrollbar-thumb {
	background: var(--pp-hairline);
	border-radius: 4px;
}

.pp-calendar .pp-cal-list::-webkit-scrollbar-thumb:hover {
	background: var(--pp-muted);
}

/* Each event is a card on the panel, not a row cut off by a hairline. */
.pp-calendar .pp-cal-event {
	display: flex;
	align-items: flex-start;
	gap: 13px;
	padding: 16px 18px;
	border: 0;
	border-radius: 10px;
	background: #ffffff;
	box-shadow: 0 1px 2px rgba(20, 45, 90, .06), 0 10px 22px -18px rgba(20, 45, 90, .55);
}

/*
 * The glyph anchors the card where the accent bar used to. A tinted tile
 * rather than a bare icon, so it reads as part of the card's furniture and
 * not as a control someone could press.
 */
.pp-calendar .pp-event-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 38px;
	height: 38px;
	border-radius: 9px;
	background: var(--pp-event-soft);
	color: var(--pp-event);
}

.pp-calendar .pp-event-icon svg {
	display: block;
	width: 20px;
	height: 20px;
}

/* min-width:0 so a long title wraps instead of widening the card. */
.pp-calendar .pp-event-body {
	flex: 1;
	min-width: 0;
}

.pp-calendar .pp-cal-event h3 {
	margin: 0 0 9px;
	font-size: 1.05rem;
	font-weight: 600;
	color: var(--pp-primary-strong);
	letter-spacing: -0.005em;
}

.pp-calendar .pp-cal-event p {
	margin: 0;
	font-size: 1rem;
	color: var(--pp-ink-soft);
}

/*
 * Scoped through .pp-cal-event so it outweighs the `margin: 0` above, and
 * pre-line so the line breaks the editor typed into the textarea survive.
 */
.pp-calendar .pp-cal-event .pp-cal-desc {
	margin-top: 8px;
	white-space: pre-line;
	color: var(--pp-ink);
}

.pp-calendar .pp-cal-btn {
	display: inline-block;
	margin-top: 14px;
	padding: 10px 18px;
	background: var(--pp-event);
	color: #fff;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	transition: background .15s ease;
}

.pp-calendar .pp-cal-btn:hover,
.pp-calendar .pp-cal-btn:focus {
	background: var(--pp-primary-strong);
	color: #fff;
}

.pp-calendar .pp-cal-btn:focus-visible {
	outline: 2px solid var(--pp-primary);
	outline-offset: 2px;
}

/* Time and place on one line under the title, each with its own glyph. */
.pp-calendar .pp-event-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/*
 * A sibling plugin (pp-article.css) styles every `ul li` in the content area
 * as a bulleted article item: a fake bullet drawn as `content: ""` on
 * `li::before`, plus the 1.25rem of padding that makes room for it. Both
 * reached this list, putting a blue dot in front of the time and the place.
 *
 * `list-style: none` cannot touch the dot - it is a generated box, not a list
 * marker - so the box itself is removed, and the indent it was reserving goes
 * with it. The time chip restores its own padding below.
 *
 * Scoped to this list on purpose: the timeline's dots are `li::before` too,
 * and a blanket reset would take those with it.
 */
.pp-calendar .pp-event-meta > li::before {
	content: none;
}

.pp-calendar .pp-event-meta > li {
	padding: 0;
}

.pp-calendar .pp-event-meta li {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	min-width: 0;
	font-size: 0.95rem;
}

.pp-calendar .pp-meta-icon {
	display: inline-flex;
	flex: none;
}

.pp-calendar .pp-meta-icon svg {
	display: block;
	width: 15px;
	height: 15px;
}

.pp-calendar .pp-meta-place {
	color: var(--pp-ink-soft);
}

.pp-calendar .pp-meta-place .pp-meta-icon {
	color: var(--pp-event);
}

/*
 * Still the strongest piece of metadata, and still absent entirely when the
 * event has no hour. The class name is kept from the old badge so any custom
 * CSS targeting it keeps working.
 *
 * The selector deliberately outranks the `> li` padding reset above, which is
 * there to strip the sibling plugin's article indent and would otherwise
 * flatten this chip along with it.
 */
.pp-calendar .pp-event-meta > li.pp-cal-time {
	flex: none;
	padding: 5px 11px;
	border-radius: 4px;
	background: var(--pp-badge-bg);
	color: var(--pp-badge-ink);
	font-weight: 600;
	font-size: 0.88rem;
	font-variant-numeric: tabular-nums;
}

/* Read aloud, never drawn: the labels that tell the glyphs apart. */
.pp-calendar .pp-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* Nothing to scroll and nothing to stack: the message sits in the middle. */
.pp-calendar .pp-cal-list:has(.pp-cal-empty) {
	justify-content: center;
	max-height: none;
	overflow: hidden;
	scrollbar-gutter: auto;
}

/*
 * Empty agenda. A single grey paragraph gave a quiet day the same weight as a
 * loading error, so the state is built as a stack instead: glyph, what is
 * missing, what to do about it. Every line stays on --pp-ink-strong - the tint
 * behind the icon is the only decorative colour, and no text sits on it.
 */
.pp-calendar .pp-cal-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	/*
	 * Kept tight on purpose. Both columns run to the height of the taller
	 * one, so every pixel this state spends is a pixel the calendar card has
	 * to stretch by, and a stretched grid is the first thing that looks
	 * wrong on the board.
	 */
	padding: 30px 16px 26px;
	color: var(--pp-ink-strong);
	font-size: 1rem;
	text-align: center;
}

.pp-calendar .pp-empty-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 54px;
	height: 54px;
	border-radius: 50%;
	/* White on the recessed panel, so the glyph reads as lifted off it. */
	background: #ffffff;
	box-shadow: 0 0 0 1px var(--pp-hairline), 0 8px 18px -12px rgba(20, 45, 90, .5);
	color: var(--pp-event);
}

.pp-calendar .pp-empty-icon svg {
	display: block;
	width: 26px;
	height: 26px;
}

/* The theme's own paragraph margins reach in here, so both lines reset them. */
.pp-calendar .pp-cal-empty .pp-empty-title {
	margin: 0;
	font-size: 1.1rem;
	font-weight: 600;
	letter-spacing: -0.005em;
}

.pp-calendar .pp-cal-empty .pp-empty-hint {
	margin: 0;
	max-width: 34ch;
	line-height: 1.5;
	color: var(--pp-ink-strong);
}

/*
 * Way out of an empty day. Square corners and a 4px radius to match the time
 * badge, not a pill: the calendar has no pill shapes anywhere else.
 */
.pp-calendar .pp-cal-next {
	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px 9px;
	margin-top: 8px;
	padding: 11px 17px;
	border: 1px solid var(--pp-event-hover);
	border-radius: 4px;
	/* White too: a 10% tint would have disappeared into the panel behind it. */
	background: #ffffff;
	box-shadow: 0 6px 14px -12px rgba(20, 45, 90, .6);
	color: var(--pp-primary-strong);
	font: inherit;
	font-size: 0.95rem;
	line-height: 1.25;
	text-align: left;
	cursor: pointer;
	transition: background .15s ease;
}

.pp-calendar .pp-cal-next:hover,
.pp-calendar .pp-cal-next:focus {
	background: var(--pp-event-hover);
}

.pp-calendar .pp-cal-next:focus-visible {
	outline: 2px solid var(--pp-primary);
	outline-offset: 2px;
}

.pp-calendar .pp-next-label {
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.pp-calendar .pp-next-date {
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.pp-calendar .pp-next-title {
	font-weight: 600;
}

/* ---------- Timeline ---------- */
/*
 * A strip under the agenda holding the nearest events behind and ahead of
 * today. Raised like the event cards, because like them it carries content -
 * the recessed panel above is the ground they sit on.
 */
/*
 * No scroll of its own. The dots hang in the list's left padding, and a
 * scroll box clips on both axes however it was declared, which sliced the
 * white collar off every one of them.
 */
.pp-calendar .pp-cal-timeline {
	flex: none;
	margin-top: 14px;
	padding: 13px 18px 10px;
	border: 1px solid var(--pp-hairline);
	border-radius: 16px;
	background: #ffffff;
	box-shadow: 0 1px 2px rgba(20, 45, 90, .05), 0 12px 26px -22px rgba(20, 45, 90, .5);
}

.pp-calendar .pp-tl-heading {
	margin: 0 0 9px;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--pp-ink-strong);
}

.pp-calendar .pp-tl-list {
	position: relative;
	margin: 0;
	padding: 0 0 0 28px;
	list-style: none;
}

/* The spine, stopping at the first and last dot rather than overshooting. */
.pp-calendar .pp-tl-list::before {
	content: "";
	position: absolute;
	left: 7px;
	top: 14px;
	bottom: 14px;
	width: 2px;
	background: var(--pp-hairline);
}

.pp-calendar .pp-tl-list > li {
	position: relative;
	padding: 1px 0;
}

.pp-calendar .pp-tl-list > li::before {
	content: "";
	position: absolute;
	left: -25px;
	top: 11px;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--pp-muted);
	/* A collar in the card's own colour so the spine does not run through. */
	box-shadow: 0 0 0 3px #ffffff;
}

.pp-calendar .pp-tl-item.is-future::before {
	background: var(--pp-event);
}

/*
 * What is on today is neither behind nor ahead. It sits straight under the
 * marker and borrows its colour, so the group reads as one: a strip that puts
 * "HOY" above an entry dated today is telling the reader that today comes
 * before today.
 */
.pp-calendar .pp-tl-item.is-today::before {
	background: var(--pp-primary-strong);
}

.pp-calendar .pp-tl-item.is-today .pp-tl-date {
	color: var(--pp-primary-strong);
}

.pp-calendar .pp-tl-item.is-today .pp-tl-name {
	font-weight: 600;
}

/*
 * Matched through the same `> li` as the generic dot above: without it that
 * rule carries one more element selector and wins, and today's dot stays grey.
 */
.pp-calendar .pp-tl-list > li.pp-tl-today::before {
	left: -27px;
	top: 9px;
	width: 14px;
	height: 14px;
	/* No collar: it is solid and wide enough to cover the spine by itself. */
	box-shadow: none;
	background: var(--pp-primary-strong);
}

.pp-calendar .pp-tl-link {
	display: flex;
	align-items: baseline;
	gap: 11px;
	width: 100%;
	min-width: 0;
	margin-left: -8px;
	padding: 2px 8px;
	/*
	 * The theme sets white-space: nowrap on buttons. Inherited here it made
	 * every timeline title unbreakable, and their min-content width dragged
	 * the whole board 170px past its container on a phone.
	 */
	white-space: normal;
	border: 0;
	border-radius: 6px;
	background: transparent;
	font: inherit;
	text-align: left;
	cursor: pointer;
	transition: background .15s ease;
}

.pp-calendar .pp-tl-link:hover {
	background: var(--pp-primary-050);
}

.pp-calendar .pp-tl-link:focus-visible {
	outline: 2px solid var(--pp-primary);
	outline-offset: 1px;
}

.pp-calendar .pp-tl-date {
	flex: none;
	min-width: 52px;
	font-size: 0.78rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	color: var(--pp-ink-soft);
}

.pp-calendar .pp-tl-item.is-future .pp-tl-date {
	color: var(--pp-primary-strong);
}

.pp-calendar .pp-tl-name {
	min-width: 0;
	font-size: 0.9rem;
	color: var(--pp-ink);
	white-space: normal;
}

/*
 * What is behind us reads quieter than what is ahead - but quieter still means
 * readable: --pp-ink-soft is 5.48:1 on white, not the decorative --pp-muted.
 */
.pp-calendar .pp-tl-item.is-past .pp-tl-name {
	color: var(--pp-ink-soft);
}

.pp-calendar .pp-tl-today {
	display: flex;
	align-items: center;
	padding: 4px 0;
}

.pp-calendar .pp-tl-label {
	padding: 3px 10px;
	border-radius: 4px;
	background: var(--pp-primary-strong);
	color: #ffffff;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
}

/* ---------- Cell density ---------- */
/*
 * The chip degrades with the calendar card's own width, not the viewport: once
 * the cells are too narrow for a readable title the chip carries nothing worth
 * reading, so it gives way to a plain event count. A container query measures
 * the content box, so this width excludes the card's own 26px (16px on phones)
 * horizontal padding.
 */
@container ppcal (max-width: 430px) {
	.pp-calendar .pp-cal-chips {
		display: none;
	}

	.pp-calendar .pp-cal-day.has-events::after {
		content: attr(data-count);
		position: absolute;
		right: 5px;
		bottom: 5px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-width: 16px;
		height: 16px;
		padding: 0 4px;
		background: var(--pp-event);
		color: #fff;
		font-size: 0.6rem;
		font-weight: 700;
		line-height: 1;
	}

	.pp-calendar .pp-cal-day.is-selected.has-events::after {
		background: #fff;
		color: var(--pp-primary);
	}
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
	/*
	 * minmax(0, 1fr), never a bare 1fr: a bare track refuses to go below the
	 * min-content of what is inside it, so one unbreakable string anywhere in
	 * the column pushes the entire board off the side of the screen.
	 */
	.pp-calendar .pp-cal-board {
		grid-template-columns: minmax(0, 1fr);
		gap: 28px;
	}
	/*
	 * Stacked, the page itself scrolls. A nested scroll region here would trap
	 * touch scrolling inside the list for no benefit, so the cap is lifted and
	 * the agenda simply runs as long as it needs to.
	 */
	/*
	 * Stacked, there is no card to fit inside, so the column goes back to its
	 * own height and nothing is capped or scrolled: a day with ten events
	 * runs as long as it needs to, and so does the timeline.
	 */
	.pp-calendar .pp-cal-list {
		flex: none;
		min-height: 0;
		max-height: none;
		overflow: visible;
		scrollbar-gutter: auto;
	}
}

@media (max-width: 480px) {
	.pp-calendar .pp-cal-board {
		gap: 22px;
	}
	.pp-calendar .pp-cal {
		padding: 20px 16px 16px;
	}
	.pp-calendar .pp-cal-title {
		font-size: 1.15rem;
	}
	.pp-calendar .pp-cal-head {
		margin-bottom: 16px;
	}
	.pp-calendar .pp-cal-day {
		min-height: 58px;
		padding: 6px 4px 6px 8px;
	}
	.pp-calendar .pp-cal-num {
		width: 20px;
		height: 20px;
		font-size: 0.85rem;
	}
	.pp-calendar .pp-cal-date {
		font-size: 0.9rem;
		padding: 10px 16px;
	}
	.pp-calendar .pp-cal-event {
		padding: 18px 0;
		gap: 12px;
	}
	.pp-calendar .pp-cal-event h3 {
		font-size: 0.98rem;
	}
	.pp-calendar .pp-cal-time {
		padding: 7px 10px;
	}
	.pp-calendar .pp-cal-empty {
		padding: 34px 8px 30px;
	}
	.pp-calendar .pp-empty-icon {
		width: 56px;
		height: 56px;
	}
	.pp-calendar .pp-empty-icon svg {
		width: 26px;
		height: 26px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pp-calendar * {
		transition: none !important;
	}
}
