/**
 * Leave Management — front-end portal.
 *
 * A self-contained, scoped design system (no CSS framework is loaded, so
 * nothing leaks into the host theme). Everything lives under .lms-portal so
 * the portal can drop into a Bricks / Elementor page without the theme and
 * the plugin fighting. Automatic.css custom properties are read where they
 * exist, with our own values as the fallback.
 *
 * Surfaces are solid and flat — one design language shared with the admin.
 * No translucency, no backdrop blur. The look leans on a slate neutral
 * ramp, an indigo accent, soft layered shadows and generous rounding.
 *
 * Buttons are defended against the host theme: every interactive state sets
 * its own colour, so a theme's `a:hover { color }` can never hide the label.
 */

/* ---------------------------------------------------------------------------
   1. Tokens
   --------------------------------------------------------------------------- */

.lms-portal {
	/* Brand — matches the admin's indigo so the whole product reads as one.
	   A site running Automatic.css keeps its own --primary. */
	--lms-primary: var(--primary, #4f46e5);
	--lms-primary-hover: var(--primary-hover, #4338ca);
	--lms-primary-active: #3730a3;
	--lms-primary-tint: var(--primary-ultra-light, #eef2ff);
	--lms-primary-rgb: 79, 70, 229;
	--lms-on-primary: #ffffff;

	/* Surfaces — solid throughout. */
	--lms-surface: var(--white, #ffffff);
	--lms-surface-alt: var(--neutral-ultra-light, #f8fafc);
	--lms-raised: var(--lms-surface);
	--lms-sunken: var(--lms-surface-alt);
	--lms-hairline: rgba(15, 23, 42, .08);
	--lms-border: var(--neutral-light, #e5e7eb);
	--lms-border-strong: #cbd5e1;

	/* Text */
	--lms-text: var(--text-dark, #0f172a);
	--lms-text-soft: #334155;
	--lms-text-muted: var(--neutral-dark, #64748b);

	/* Status */
	--lms-success: var(--success, #16a34a);
	--lms-success-tint: var(--success-ultra-light, #f0fdf4);
	--lms-success-border: #bbf7d0;
	--lms-danger: var(--danger, #dc2626);
	--lms-danger-tint: var(--danger-ultra-light, #fef2f2);
	--lms-danger-border: #fecaca;
	--lms-warning: var(--warning, #d97706);
	--lms-warning-tint: var(--warning-ultra-light, #fffbeb);
	--lms-warning-border: #fde68a;
	--lms-info-tint: var(--info-ultra-light, #eef2ff);

	/* Shape */
	--lms-radius: var(--radius-m, 16px);
	--lms-radius-sm: var(--radius-s, 10px);
	--lms-radius-xs: 8px;
	--lms-radius-pill: 999px;

	/* Depth — layered, soft. */
	--lms-shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .05);
	--lms-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 26px -8px rgba(15, 23, 42, .12);
	--lms-shadow-lg: 0 2px 6px rgba(15, 23, 42, .05), 0 24px 48px -16px rgba(15, 23, 42, .22);
	--lms-ring: 0 0 0 3px rgba(var(--lms-primary-rgb), .22);

	/* Rhythm */
	--lms-gap-xs: var(--space-xs, .5rem);
	--lms-gap-s: var(--space-s, .75rem);
	--lms-gap-m: var(--space-m, 1.25rem);
	--lms-gap-l: var(--space-l, 2rem);

	--lms-ease: cubic-bezier(.4, 0, .2, 1);

	box-sizing: border-box;
	max-width: 68rem;
	margin-inline: auto;
	color: var(--lms-text);
	line-height: 1.55;
	font-size: 16px;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.lms-portal *,
.lms-portal *::before,
.lms-portal *::after {
	box-sizing: inherit;
}

/* ---------------------------------------------------------------------------
   2. Shared primitives
   --------------------------------------------------------------------------- */

/* Every flex child holding text needs min-width:0, or a long unbroken string
   collapses the column to one character wide and text wraps vertically. */
.lms-portal .lms-reqlist__body,
.lms-portal .lms-install__body,
.lms-portal .lms-push__body,
.lms-portal .lms-card__head > div,
.lms-portal .lms-summary__item,
.lms-portal .lms-readonly__value,
.lms-portal .lms-filters__field {
	min-width: 0;
}

.lms-portal p,
.lms-portal span,
.lms-portal li {
	overflow-wrap: break-word;
}

.lms-portal .lms-muted { color: var(--lms-text-muted); }
.lms-portal .lms-dot { margin-inline: .35em; color: var(--lms-text-muted); }

.lms-portal .lms-link {
	color: var(--lms-primary);
	text-decoration: none;
	font-weight: 500;
}

.lms-portal .lms-link:hover { text-decoration: underline; }

.lms-portal .lms-section__title {
	margin: 0 0 var(--lms-gap-s);
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: -.01em;
}

/* One section header for every block on a page, so an overview reads as a
   single stack instead of three components that each invented a heading.
   Title on the left with the product's accent marker, one line of context
   under it, and an optional action pinned to the right. */

/* The portal supplies its own structure and must not inherit the host's.
   Page builders and utility frameworks style bare tags and generic
   wrappers — a Bricks <section> is a centred flex column — which collapses
   every child to its content width and drops a responsive grid to one
   narrow column. So each structural container states its own display and
   width rather than trusting what it is nested inside. Templates use plain
   <div>s for the same reason. */
.lms-portal .lms-sec,
.lms-portal .lms-sec__head,
.lms-portal .lms-sec__titles,
.lms-portal .lms-card,
.lms-portal .lms-balances,
.lms-portal .lms-away__group,
.lms-portal .lms-away__grid,
.lms-portal .lms-allclear,
.lms-portal .lms-empty,
.lms-portal .lms-reqlist,
.lms-portal .lms-card__head,
.lms-portal .lms-card__body,
.lms-portal .lms-card__foot,
.lms-portal .lms-tabs {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

.lms-portal .lms-sec {
	display: block;
	margin-block-end: var(--lms-gap-l);
}

.lms-portal .lms-sec:last-child { margin-block-end: 0; }

/* A card is the last thing in its section; the section owns the gap. */
.lms-portal .lms-sec > .lms-card:last-child { margin-block-end: 0; }

.lms-portal .lms-sec__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--lms-gap-s);
	flex-wrap: wrap;
	margin-block-end: var(--lms-gap-s);
	text-align: start;
}

/* Takes the slack so the action stays pinned right, and wraps to its own
   line on a narrow screen rather than squashing the title. */
.lms-portal .lms-sec__titles { flex: 1 1 14rem; min-width: 0; }

.lms-portal .lms-sec__title {
	display: flex;
	align-items: center;
	gap: .6rem;
	margin: 0;
	font-size: 1.0625rem;
	font-weight: 700;
	letter-spacing: -.015em;
	line-height: 1.3;
}

.lms-portal .lms-sec__title::before {
	content: "";
	width: 4px;
	height: 1.05em;
	border-radius: 3px;
	background: var(--lms-primary);
	flex: none;
}

/* Indented to the title's text, not its accent bar. */
.lms-portal .lms-sec__sub {
	margin: .2rem 0 0;
	padding-inline-start: calc(4px + .6rem);
	font-size: .875rem;
	color: var(--lms-text-muted);
}

.lms-portal .lms-sec__action {
	flex: none;
	color: var(--lms-primary);
	text-decoration: none;
	font-size: .875rem;
	font-weight: 600;
}

.lms-portal .lms-sec__action:hover { text-decoration: underline; }

/* Nothing to show. Deliberately light — an empty state is the absence of
   news, and a tall boxed slab reads as though something has gone wrong. */
.lms-portal .lms-empty {
	margin: 0;
	padding: var(--lms-gap-s) var(--lms-gap-m);
	border: 1px dashed var(--lms-border);
	border-radius: var(--lms-radius-sm);
	background: var(--lms-surface-alt);
	font-size: .875rem;
	color: var(--lms-text-muted);
}

/* The good-news version, when every group in a section is empty at once. */
.lms-portal .lms-allclear {
	display: flex;
	align-items: flex-start;
	gap: var(--lms-gap-s);
	padding: var(--lms-gap-m);
	border: 1px solid var(--lms-success-border);
	border-radius: var(--lms-radius);
	background: var(--lms-success-tint);
}

.lms-portal .lms-allclear__mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	flex: none;
	border-radius: 50%;
	background: var(--lms-success);
	color: #fff;
}

.lms-portal .lms-allclear__body { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.lms-portal .lms-allclear__title { font-weight: 700; letter-spacing: -.01em; color: var(--lms-text); }
.lms-portal .lms-allclear__text { font-size: .875rem; color: var(--lms-text-soft); }

.lms-portal .lms-hr {
	border: 0;
	border-top: 1px solid var(--lms-hairline);
	margin: var(--lms-gap-m) 0;
}

/* ---------------------------------------------------------------------------
   3. Header and tabs
   --------------------------------------------------------------------------- */

.lms-portal .lms-dash__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--lms-gap-m);
	flex-wrap: wrap;
	margin-block-end: var(--lms-gap-m);
}

.lms-portal .lms-dash__title {
	margin: 0;
	font-size: clamp(1.4rem, 4vw, 1.85rem);
	font-weight: 700;
	letter-spacing: -.025em;
	line-height: 1.15;
}

.lms-portal .lms-dash__sub {
	margin: .3rem 0 0;
	color: var(--lms-text-muted);
	font-size: .9375rem;
}

/* Tabs scroll sideways instead of truncating on a phone. */
.lms-portal .lms-tabs {
	display: flex;
	gap: 3px;
	padding: 4px;
	margin-block-end: var(--lms-gap-m);
	border: 1px solid var(--lms-hairline);
	border-radius: var(--lms-radius);
	background: var(--lms-sunken);
	box-shadow: var(--lms-shadow-sm);
	overflow-x: auto;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	scroll-snap-type: x proximity;
}

.lms-portal .lms-tabs::-webkit-scrollbar { display: none; }

.lms-portal .lms-tab {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	flex: 0 0 auto;
	padding: .55rem 1rem;
	border-radius: calc(var(--lms-radius) - 5px);
	color: var(--lms-text-muted);
	font-size: .9375rem;
	font-weight: 550;
	text-decoration: none;
	white-space: nowrap;
	scroll-snap-align: start;
	transition: background .18s var(--lms-ease), color .18s var(--lms-ease), box-shadow .18s var(--lms-ease);
}

.lms-portal .lms-tab:hover {
	color: var(--lms-text);
	background: rgba(15, 23, 42, .045);
}

.lms-portal .lms-tab.is-active {
	color: var(--lms-primary);
	background: var(--lms-surface);
	font-weight: 650;
	box-shadow: var(--lms-shadow-sm);
}


.lms-portal .lms-tab__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.3rem;
	height: 1.3rem;
	padding: 0 .35rem;
	border-radius: var(--lms-radius-pill);
	background: var(--lms-primary);
	color: var(--lms-on-primary);
	font-size: .6875rem;
	font-weight: 700;
	line-height: 1;
}

/* ---------------------------------------------------------------------------
   4. Cards
   --------------------------------------------------------------------------- */

.lms-portal .lms-card {
	display: block;
	position: relative;
	border: 1px solid var(--lms-hairline);
	border-radius: var(--lms-radius);
	background: var(--lms-raised);
	box-shadow: var(--lms-shadow);
	margin-block-end: var(--lms-gap-m);
	overflow: hidden;
}

.lms-portal .lms-card--narrow { max-width: 26rem; margin-inline: auto; }

.lms-portal .lms-card__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--lms-gap-s);
	flex-wrap: wrap;
	padding: var(--lms-gap-m);
	border-bottom: 1px solid var(--lms-hairline);
	background: linear-gradient(180deg, var(--lms-surface), var(--lms-surface-alt));
}

.lms-portal .lms-card__head--row { align-items: center; }

.lms-portal .lms-card__title {
	display: flex;
	align-items: center;
	gap: .6rem;
	margin: 0;
	font-size: 1.0625rem;
	font-weight: 700;
	letter-spacing: -.015em;
}

/* A short accent bar leading each card title — the same premium section
   marker the admin uses. Follows the site's --primary, so it matches the
   host brand. */
.lms-portal .lms-card__title::before {
	content: "";
	width: 4px;
	height: 1.05em;
	border-radius: 3px;
	background: var(--lms-primary);
	flex: none;
}

.lms-portal .lms-card__sub {
	margin: .25rem 0 0;
	color: var(--lms-text-muted);
	font-size: .875rem;
}

.lms-portal .lms-card__body { padding: var(--lms-gap-m); }

.lms-portal .lms-card__foot {
	display: flex;
	align-items: center;
	gap: var(--lms-gap-s);
	flex-wrap: wrap;
	padding: var(--lms-gap-s) var(--lms-gap-m);
	border-top: 1px solid var(--lms-hairline);
	background: var(--lms-surface-alt);
}

/* ---------------------------------------------------------------------------
   5. Buttons — theme-proofed
   Every state pins its own colour and text-decoration so a host theme's
   link styling can never bleed in and hide the label. The colour and the
   coloured fill are marked !important for exactly that reason: this is a
   drop-in surface inside an unknown theme.
   --------------------------------------------------------------------------- */

.lms-portal .lms-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .45rem;
	padding: .62rem 1.1rem;
	min-height: 44px; /* comfortable touch target */
	border: 1px solid var(--lms-border-strong);
	border-radius: var(--lms-radius-sm);
	background: var(--lms-surface);
	color: var(--lms-text);
	font-size: .9375rem;
	font-weight: 600;
	font-family: inherit;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	white-space: nowrap;
	box-shadow: var(--lms-shadow-sm);
	-webkit-appearance: none;
	appearance: none;
	transition: transform .12s var(--lms-ease), background .18s var(--lms-ease),
		border-color .18s var(--lms-ease), box-shadow .18s var(--lms-ease), color .18s var(--lms-ease);
}

/* Lock the default (neutral) button's text colour across every state. */
.lms-portal .lms-btn,
.lms-portal .lms-btn:link,
.lms-portal .lms-btn:visited,
.lms-portal .lms-btn:hover,
.lms-portal .lms-btn:focus,
.lms-portal .lms-btn:active {
	color: var(--lms-text);
	text-decoration: none;
}

.lms-portal .lms-btn:hover {
	background: var(--lms-surface-alt);
	border-color: var(--lms-text-muted);
}

.lms-portal .lms-btn:active { transform: translateY(1px); }

.lms-portal .lms-btn:disabled,
.lms-portal .lms-btn[disabled] {
	opacity: .5;
	cursor: not-allowed;
	transform: none;
}

.lms-portal .lms-btn:focus-visible {
	outline: none;
	box-shadow: var(--lms-ring);
	border-color: var(--lms-primary);
}

/* Primary — the fill follows the host brand (--primary), so the shadow is a
   neutral dark drop rather than tied to one hue. Works whether the brand is
   black, indigo or anything else. */
.lms-portal .lms-btn--primary {
	background: var(--lms-primary) !important;
	border-color: transparent;
	box-shadow: 0 1px 2px rgba(15, 23, 42, .16),
		0 8px 18px -6px rgba(15, 23, 42, .32);
}

.lms-portal .lms-btn--primary:hover { box-shadow: 0 2px 4px rgba(15, 23, 42, .18), 0 12px 24px -8px rgba(15, 23, 42, .38); }

.lms-portal .lms-btn--primary,
.lms-portal .lms-btn--primary:link,
.lms-portal .lms-btn--primary:visited,
.lms-portal .lms-btn--primary:hover,
.lms-portal .lms-btn--primary:focus,
.lms-portal .lms-btn--primary:active {
	color: var(--lms-on-primary) !important;
	text-decoration: none;
}

/* Darken the actual brand fill rather than swapping to a fixed hue, so a
   black brand stays black on hover instead of flashing indigo. */
.lms-portal .lms-btn--primary:hover {
	filter: brightness(.93);
	border-color: transparent;
}

.lms-portal .lms-btn--primary:active { filter: brightness(.88); }

/* Danger */
.lms-portal .lms-btn--danger {
	background: var(--lms-danger) !important;
	border-color: transparent;
	box-shadow: 0 1px 2px rgba(220, 38, 38, .3), 0 6px 16px -4px rgba(220, 38, 38, .35);
}

.lms-portal .lms-btn--danger,
.lms-portal .lms-btn--danger:link,
.lms-portal .lms-btn--danger:visited,
.lms-portal .lms-btn--danger:hover,
.lms-portal .lms-btn--danger:focus,
.lms-portal .lms-btn--danger:active {
	color: #ffffff !important;
	text-decoration: none;
}

.lms-portal .lms-btn--danger:hover { filter: brightness(.94); border-color: transparent; }

/* Ghost / secondary */
.lms-portal .lms-btn--ghost {
	background: transparent;
	border-color: var(--lms-border-strong);
	box-shadow: none;
}

.lms-portal .lms-btn--ghost:hover { background: rgba(15, 23, 42, .045); }


.lms-portal .lms-btn--sm {
	padding: .4rem .8rem;
	min-height: 36px;
	font-size: .875rem;
}

.lms-portal .lms-btn--block { width: 100%; }

/* ---------------------------------------------------------------------------
   6. Forms
   --------------------------------------------------------------------------- */

.lms-portal .lms-form { padding: var(--lms-gap-m); }
.lms-portal .lms-field { margin-block-end: var(--lms-gap-m); }
.lms-portal .lms-field:last-child { margin-block-end: 0; }
.lms-portal .lms-field--inline { display: flex; align-items: center; gap: var(--lms-gap-xs); }

.lms-portal .lms-label {
	display: block;
	margin-block-end: .4rem;
	font-size: .8125rem;
	font-weight: 600;
	letter-spacing: .01em;
	color: var(--lms-text);
}

.lms-portal .lms-input,
.lms-portal select.lms-input,
.lms-portal textarea.lms-input {
	display: block;
	width: 100%;
	max-width: 100%;
	padding: .68rem .85rem;
	min-height: 44px;
	border: 1px solid var(--lms-border-strong);
	border-radius: var(--lms-radius-sm);
	background: var(--lms-surface);
	color: var(--lms-text);
	font-family: inherit;
	font-size: 1rem; /* 16px keeps iOS from zooming the page on focus */
	line-height: 1.4;
	transition: border-color .18s var(--lms-ease), box-shadow .18s var(--lms-ease);
	-webkit-appearance: none;
	appearance: none;
}

.lms-portal textarea.lms-input {
	min-height: 5rem;
	resize: vertical;
}

.lms-portal select.lms-input {
	padding-inline-end: 2.2rem;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 6.5 8 10.5l4-4'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right .75rem center;
	background-size: 1rem;
}

.lms-portal .lms-input:focus {
	outline: none;
	border-color: var(--lms-primary);
	box-shadow: var(--lms-ring);
}

.lms-portal .lms-input::placeholder { color: var(--lms-text-muted); opacity: .8; }

.lms-portal .lms-help {
	margin: .45rem 0 0;
	font-size: .8125rem;
	color: var(--lms-text-muted);
}

.lms-portal .lms-check {
	display: flex;
	align-items: flex-start;
	gap: .6rem;
	font-size: .9375rem;
	cursor: pointer;
}

.lms-portal .lms-check input[type="checkbox"] {
	width: 1.15rem;
	height: 1.15rem;
	margin: .2rem 0 0;
	accent-color: var(--lms-primary);
	flex: none;
}

/* Two-up on desktop, stacked on phones. */
.lms-portal .lms-grid2 {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--lms-gap-s);
}

.lms-portal .lms-readonly {
	padding: var(--lms-gap-xs) var(--lms-gap-m);
	border: 1px solid var(--lms-hairline);
	border-radius: var(--lms-radius-sm);
	background: var(--lms-surface-alt);
	margin-block-end: var(--lms-gap-m);
}

.lms-portal .lms-readonly__row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: var(--lms-gap-s);
	padding-block: .55rem;
}

.lms-portal .lms-readonly__row + .lms-readonly__row { border-top: 1px solid var(--lms-hairline); }
.lms-portal .lms-readonly__label { color: var(--lms-text-muted); font-size: .875rem; flex: none; }
.lms-portal .lms-readonly__value { font-weight: 600; text-align: right; }

/* Live day-count preview on the request form. */
.lms-portal .lms-preview {
	display: flex;
	flex-direction: column;
	gap: .15rem;
	padding: var(--lms-gap-s) var(--lms-gap-m);
	border-radius: var(--lms-radius-sm);
	background: var(--lms-info-tint);
	border: 1px solid rgba(var(--lms-primary-rgb), .22);
	margin-block-end: var(--lms-gap-m);
}

.lms-portal .lms-preview__main { font-weight: 650; }
.lms-portal .lms-preview__note { font-size: .8125rem; color: var(--lms-text-muted); }

.lms-portal .lms-preview[data-tone="error"] {
	background: var(--lms-danger-tint);
	border-color: var(--lms-danger-border);
}

/* ---------------------------------------------------------------------------
   7. Alerts
   --------------------------------------------------------------------------- */

.lms-portal .lms-alert {
	padding: var(--lms-gap-s) var(--lms-gap-m);
	border: 1px solid var(--lms-hairline);
	border-left: 3px solid var(--lms-text-muted);
	border-radius: var(--lms-radius-sm);
	background: var(--lms-surface-alt);
	margin-block-end: var(--lms-gap-m);
	font-size: .9375rem;
}

.lms-portal .lms-alert--success { border-left-color: var(--lms-success); background: var(--lms-success-tint); }
.lms-portal .lms-alert--error { border-left-color: var(--lms-danger); background: var(--lms-danger-tint); }
.lms-portal .lms-alert--warning,
.lms-portal .lms-alert--warn { border-left-color: var(--lms-warning); background: var(--lms-warning-tint); }
.lms-portal .lms-alert--info { border-left-color: var(--lms-primary); background: var(--lms-info-tint); }

/* ---------------------------------------------------------------------------
   8. Balance cards
   --------------------------------------------------------------------------- */

.lms-portal .lms-balances {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
	gap: var(--lms-gap-s);
	margin-block-end: var(--lms-gap-m);
}

.lms-portal .lms-bal {
	position: relative;
	overflow: hidden;
	padding: var(--lms-gap-m);
	border: 1px solid var(--lms-hairline);
	border-radius: var(--lms-radius);
	background: linear-gradient(180deg, var(--lms-surface), var(--lms-surface-alt));
	box-shadow: var(--lms-shadow-sm);
	transition: transform .18s var(--lms-ease), box-shadow .18s var(--lms-ease), border-color .18s var(--lms-ease);
}

/* A soft halo tinted with the leave type's colour gives each tile depth and
   a little identity, without a heavy coloured block. */
.lms-portal .lms-bal::after {
	content: "";
	position: absolute;
	inset-block-start: -34px;
	inset-inline-end: -34px;
	width: 104px;
	height: 104px;
	border-radius: 50%;
	background: var(--lms-bal-color, var(--lms-primary));
	opacity: .10;
	pointer-events: none;
}

.lms-portal .lms-bal:hover { transform: translateY(-3px); box-shadow: var(--lms-shadow); border-color: var(--lms-border); }

.lms-portal .lms-bal__head { display: flex; align-items: center; gap: var(--lms-gap-xs); }

.lms-portal .lms-bal__name {
	font-weight: 600;
	font-size: .9375rem;
	position: relative;
	padding-inline-start: .9rem;
}

.lms-portal .lms-bal__name::before {
	content: "";
	position: absolute;
	inset-inline-start: 0;
	inset-block-start: .42em;
	width: .55rem;
	height: .55rem;
	border-radius: 50%;
	background: var(--lms-bal-color, var(--lms-primary));
}

.lms-portal .lms-bal__figure { display: flex; align-items: baseline; gap: .35rem; margin-block-start: .6rem; }

.lms-portal .lms-bal__num {
	font-size: 2.1rem;
	font-weight: 750;
	letter-spacing: -.035em;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.lms-portal .lms-bal__of { font-size: .8125rem; color: var(--lms-text-muted); }

/* The headline figure is days *available*. Saying so costs one small line
   and removes the only genuine ambiguity on the tile. */
.lms-portal .lms-bal__cap {
	display: block;
	margin-block-start: .15rem;
	font-size: .6875rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--lms-text-muted);
}

.lms-portal .lms-bal__bar {
	height: .45rem;
	margin-block-start: var(--lms-gap-s);
	border-radius: var(--lms-radius-pill);
	background: rgba(15, 23, 42, .08);
	overflow: hidden;
}


.lms-portal .lms-bal__fill {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: var(--lms-bal-color, var(--lms-primary));
	transition: width .5s var(--lms-ease);
}

.lms-portal .lms-bal__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .2rem;
	margin-block-start: .55rem;
	font-size: .8125rem;
	color: var(--lms-text-muted);
}

.lms-portal .lms-bal__pending { color: var(--lms-warning); font-weight: 550; }

/* ---------------------------------------------------------------------------
   9. Request lists
   --------------------------------------------------------------------------- */

.lms-portal .lms-reqlist { list-style: none; margin: 0; padding: 0; }

.lms-portal .lms-reqlist__item {
	display: flex;
	align-items: flex-start;
	gap: var(--lms-gap-s);
	padding: var(--lms-gap-m);
	border-bottom: 1px solid var(--lms-hairline);
	/* Wrapping lets the status row drop to its own line on a phone. */
	flex-wrap: wrap;
	transition: background .12s var(--lms-ease);
}

.lms-portal .lms-reqlist__item:last-child { border-bottom: 0; }
.lms-portal .lms-reqlist__item:hover { background: var(--lms-surface-alt); }

/* Allowed to grow, and allowed to shrink below content width. */
.lms-portal .lms-reqlist__body {
	display: flex;
	flex-direction: column;
	gap: .18rem;
	flex: 1 1 auto;
	min-width: 0;
}

.lms-portal .lms-reqlist__type { font-weight: 650; letter-spacing: -.01em; }
.lms-portal .lms-reqlist__dates { font-size: .875rem; color: var(--lms-text-muted); }

.lms-portal .lms-reqlist__reason {
	font-size: .875rem;
	font-style: italic;
	color: var(--lms-text-muted);
	overflow-wrap: anywhere;
}

.lms-portal .lms-reqlist__meta { font-size: .75rem; color: var(--lms-text-muted); }

/* On phones the status and actions sit under the detail, full width. */
.lms-portal .lms-reqlist__side {
	display: flex;
	align-items: center;
	gap: var(--lms-gap-xs);
	flex-wrap: wrap;
	width: 100%;
	margin-block-start: var(--lms-gap-xs);
}

.lms-portal .lms-swatch {
	width: .65rem;
	height: .65rem;
	margin-block-start: .45rem;
	border-radius: 50%;
	flex: none;
	box-shadow: 0 0 0 2px rgba(255, 255, 255, .6);
}

/* Team availability — one card per person, in the same visual language as
   the balance tiles above them, so the overview reads as a single grid of
   cards rather than tiles followed by a list.

   Each card is a <details>: closed it answers who, what and when; open it
   answers the follow-ups without a page load. No JavaScript is involved —
   the disclosure is native, so it works before scripts run and keeps
   keyboard and screen-reader behaviour for free. */

.lms-portal .lms-away__group + .lms-away__group { margin-block-start: var(--lms-gap-m); }

.lms-portal .lms-away__label {
	display: flex;
	align-items: center;
	gap: var(--lms-gap-xs);
	margin: 0 0 var(--lms-gap-s);
	font-size: .8125rem;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--lms-text-muted);
}

.lms-portal .lms-away__tally {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.35rem;
	height: 1.35rem;
	padding: 0 .4rem;
	border-radius: var(--lms-radius-pill);
	background: var(--lms-primary-tint);
	color: var(--lms-primary);
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: 0;
}

.lms-portal .lms-away__empty {
	margin: 0;
	padding: var(--lms-gap-m);
	border: 1px dashed var(--lms-border);
	border-radius: var(--lms-radius);
	background: var(--lms-surface-alt);
	font-size: .875rem;
	color: var(--lms-text-muted);
}

/* Same grid as the balance tiles, so the two sections line up. */
.lms-portal .lms-away__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
	gap: var(--lms-gap-s);
	align-items: start;
}

.lms-portal .lms-away__card {
	position: relative;
	overflow: hidden;
	border: 1px solid var(--lms-hairline);
	border-radius: var(--lms-radius);
	background: linear-gradient(180deg, var(--lms-surface), var(--lms-surface-alt));
	box-shadow: var(--lms-shadow-sm);
	transition: transform .18s var(--lms-ease), box-shadow .18s var(--lms-ease), border-color .18s var(--lms-ease);
}

/* The leave type's colour as a soft halo, exactly as the balance tiles do. */
.lms-portal .lms-away__card::after {
	content: "";
	position: absolute;
	inset-block-start: -34px;
	inset-inline-end: -34px;
	width: 104px;
	height: 104px;
	border-radius: 50%;
	background: var(--lms-away-color, var(--lms-primary));
	opacity: .10;
	pointer-events: none;
}

.lms-portal .lms-away__card:hover {
	transform: translateY(-3px);
	box-shadow: var(--lms-shadow);
	border-color: var(--lms-border);
}

/* An open card is doing something, so it stops floating and sits flat. */
.lms-portal .lms-away__card[open] {
	transform: none;
	box-shadow: var(--lms-shadow);
	border-color: var(--lms-border);
}

/* The whole face is the click target. The native marker is removed in both
   its standards and WebKit spellings — one alone leaves a stray triangle. */
.lms-portal .lms-away__face {
	display: flex;
	flex-direction: column;
	gap: .2rem;
	padding: var(--lms-gap-m);
	cursor: pointer;
	list-style: none;
	/* Sits above the halo so the click lands on the summary, not the tint. */
	position: relative;
	z-index: 1;
}

.lms-portal .lms-away__face::-webkit-details-marker { display: none; }

.lms-portal .lms-away__face:focus-visible {
	outline: 2px solid var(--lms-primary);
	outline-offset: -3px;
	border-radius: var(--lms-radius);
}

.lms-portal .lms-away__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--lms-gap-xs);
	/* Room for the halo, so a long type name never runs under it. */
	padding-inline-end: 1.2rem;
}

.lms-portal .lms-away__type {
	position: relative;
	padding-inline-start: .9rem;
	font-size: .8125rem;
	font-weight: 600;
	color: var(--lms-text-soft);
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.lms-portal .lms-away__type::before {
	content: "";
	position: absolute;
	inset-inline-start: 0;
	inset-block-start: .42em;
	width: .55rem;
	height: .55rem;
	border-radius: 50%;
	background: var(--lms-away-color, var(--lms-primary));
}

/* The name is the headline, as the day count is on a balance tile. */
.lms-portal .lms-away__who {
	margin-block-start: .45rem;
	font-size: 1.125rem;
	font-weight: 700;
	letter-spacing: -.02em;
	line-height: 1.25;
	color: var(--lms-text);
	overflow-wrap: anywhere;
}

.lms-portal .lms-away__meta {
	font-size: .8125rem;
	color: var(--lms-text-muted);
}

.lms-portal .lms-away__more {
	display: flex;
	align-items: center;
	gap: .3rem;
	margin-block-start: var(--lms-gap-xs);
	font-size: .8125rem;
	font-weight: 650;
	color: var(--lms-primary);
}

/* One label swaps for the other on open, so the card always says what the
   next click will do rather than what state it is in. */
.lms-portal .lms-away__more-close,
.lms-portal .lms-away__card[open] .lms-away__more-open { display: none; }
.lms-portal .lms-away__card[open] .lms-away__more-close { display: inline; }

.lms-portal .lms-away__chev {
	width: .45rem;
	height: .45rem;
	border-inline-end: 2px solid currentColor;
	border-block-end: 2px solid currentColor;
	transform: rotate(45deg) translate(-1px, -1px);
	transition: transform .18s var(--lms-ease);
}

.lms-portal .lms-away__card[open] .lms-away__chev {
	transform: rotate(-135deg) translate(-1px, -1px);
}

.lms-portal .lms-away__detail {
	position: relative;
	z-index: 1;
	padding: 0 var(--lms-gap-m) var(--lms-gap-m);
	border-block-start: 1px solid var(--lms-hairline);
	margin-block-start: -1px;
	padding-block-start: var(--lms-gap-s);
}

/* Label above value, not beside it: a two-column pair inside a 16rem card
   squeezes the value into a ribbon as soon as a reason runs past a few
   words. */
.lms-portal .lms-def { margin: 0; }

.lms-portal .lms-def__key {
	margin: var(--lms-gap-s) 0 0;
	font-size: .6875rem;
	font-weight: 700;
	letter-spacing: .05em;
	text-transform: uppercase;
	color: var(--lms-text-muted);
}

.lms-portal .lms-def__key:first-child { margin-block-start: 0; }

.lms-portal .lms-def__val {
	margin: .1rem 0 0;
	font-size: .875rem;
	color: var(--lms-text);
	overflow-wrap: anywhere;
}

.lms-portal .lms-when {
	display: inline-flex;
	align-items: center;
	flex: none;
	padding: .22rem .6rem;
	border: 1px solid var(--lms-border);
	border-radius: var(--lms-radius-pill);
	background: var(--lms-surface);
	font-size: .75rem;
	font-weight: 650;
	white-space: nowrap;
	color: var(--lms-text-muted);
}

/* Someone is out right now — the one state worth colouring. */
.lms-portal .lms-when--now {
	background: var(--lms-warning-tint);
	border-color: var(--lms-warning-border);
	color: var(--lms-warning);
}

/* ---------------------------------------------------------------------------
   10. Status and approver chips
   --------------------------------------------------------------------------- */

.lms-portal .lms-status {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	padding: .28rem .72rem;
	border-radius: var(--lms-radius-pill);
	font-size: .8125rem;
	font-weight: 650;
	white-space: nowrap;
	border: 1px solid transparent;
}

.lms-portal .lms-status::before {
	content: "";
	width: .4rem;
	height: .4rem;
	border-radius: 50%;
	background: currentColor;
	flex: none;
}

.lms-portal .lms-status--pending { background: var(--lms-warning-tint); color: var(--lms-warning); border-color: var(--lms-warning-border); }
.lms-portal .lms-status--approved { background: var(--lms-success-tint); color: var(--lms-success); border-color: var(--lms-success-border); }
.lms-portal .lms-status--rejected { background: var(--lms-danger-tint); color: var(--lms-danger); border-color: var(--lms-danger-border); }
.lms-portal .lms-status--cancelled { background: var(--lms-surface-alt); color: var(--lms-text-muted); border-color: var(--lms-border); }

/* Approval chain — compact and inline. */
.lms-portal .lms-approvers {
	display: flex;
	flex-wrap: wrap;
	gap: .3rem;
	margin-block-start: .4rem;
}

.lms-portal .lms-approver {
	display: inline-flex;
	align-items: center;
	gap: .3rem;
	max-width: 100%;
	padding: .18rem .55rem;
	border-radius: var(--lms-radius-sm);
	border: 1px solid var(--lms-border);
	background: var(--lms-surface-alt);
	color: var(--lms-text-muted);
	font-size: .75rem;
	line-height: 1.6;
}

.lms-portal .lms-approver strong { font-weight: 650; }
.lms-portal .lms-approver--approved { background: var(--lms-success-tint); border-color: var(--lms-success-border); color: var(--lms-success); }
.lms-portal .lms-approver--rejected { background: var(--lms-danger-tint); border-color: var(--lms-danger-border); color: var(--lms-danger); }

/* ---------------------------------------------------------------------------
   11. Approvals queue
   --------------------------------------------------------------------------- */

.lms-portal .lms-approve {
	flex-direction: column;
	align-items: stretch;
	gap: var(--lms-gap-s);
}

.lms-portal .lms-approve__actions { align-items: stretch; }

.lms-portal .lms-approve__form {
	display: flex;
	flex-direction: column;
	gap: var(--lms-gap-xs);
	width: 100%;
}

.lms-portal .lms-approve__buttons { display: flex; gap: var(--lms-gap-xs); }
.lms-portal .lms-approve__buttons .lms-btn { flex: 1; }

/* ---------------------------------------------------------------------------
   12. Filters, summary, pager
   --------------------------------------------------------------------------- */

.lms-portal .lms-filters {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--lms-gap-s);
	padding: var(--lms-gap-m);
	border: 1px solid var(--lms-hairline);
	border-radius: var(--lms-radius);
	background: var(--lms-surface-alt);
	margin: var(--lms-gap-m);
}

.lms-portal .lms-filters__field { display: flex; flex-direction: column; gap: .3rem; }

.lms-portal .lms-filters__field .lms-label {
	margin: 0;
	font-size: .6875rem;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: var(--lms-text-muted);
}

.lms-portal .lms-filters__actions { display: flex; gap: var(--lms-gap-xs); }
.lms-portal .lms-filters__actions .lms-btn { flex: 1; }

.lms-portal .lms-summary {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--lms-gap-m);
	padding: var(--lms-gap-m);
	margin: var(--lms-gap-m);
	border: 1px solid var(--lms-hairline);
	border-radius: var(--lms-radius);
	background: var(--lms-surface-alt);
}

.lms-portal .lms-summary__item { display: flex; flex-direction: column; }

.lms-portal .lms-summary__num {
	font-size: 1.5rem;
	font-weight: 750;
	line-height: 1.1;
	letter-spacing: -.025em;
	font-variant-numeric: tabular-nums;
}

.lms-portal .lms-summary__label {
	font-size: .6875rem;
	color: var(--lms-text-muted);
	text-transform: uppercase;
	letter-spacing: .05em;
}

.lms-portal .lms-summary__export { display: flex; flex-wrap: wrap; gap: var(--lms-gap-xs); width: 100%; }
.lms-portal .lms-inline-form { display: inline-block; }

.lms-portal .lms-pager {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--lms-gap-s);
	padding: var(--lms-gap-m);
	border-top: 1px solid var(--lms-hairline);
}

.lms-portal .lms-pager__info { color: var(--lms-text-muted); font-size: .8125rem; }
.lms-portal .lms-pager__nav { display: flex; gap: var(--lms-gap-xs); }

/* ---------------------------------------------------------------------------
   12b. Team leave calendar
   --------------------------------------------------------------------------- */

.lms-portal .lms-cal__nav { display: flex; gap: var(--lms-gap-xs); flex: none; }

.lms-portal .lms-cal__filter {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--lms-gap-xs);
	padding: var(--lms-gap-s) var(--lms-gap-m);
	border-bottom: 1px solid var(--lms-hairline);
	background: var(--lms-surface-alt);
}

.lms-portal .lms-cal__filter .lms-label { margin: 0; }
.lms-portal .lms-cal__filter .lms-input { width: auto; min-width: 12rem; }

/* The grid can be wider than a phone; it scrolls inside the card rather than
   crushing seven columns into no width. */
.lms-portal .lms-cal { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.lms-portal .lms-cal__grid {
	display: grid;
	grid-template-columns: repeat(7, minmax(6.5rem, 1fr));
	min-width: 46rem;
}

.lms-portal .lms-cal__grid--head { min-width: 46rem; }

.lms-portal .lms-cal__wd {
	padding: .5rem .6rem;
	font-size: .6875rem;
	font-weight: 650;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: var(--lms-text-muted);
	text-align: start;
	background: var(--lms-surface-alt);
	border-bottom: 1px solid var(--lms-hairline);
}

.lms-portal .lms-cal__day {
	min-height: 6.5rem;
	padding: .4rem .5rem .5rem;
	border-right: 1px solid var(--lms-hairline);
	border-bottom: 1px solid var(--lms-hairline);
	background: var(--lms-surface);
	display: flex;
	flex-direction: column;
	gap: .3rem;
}

.lms-portal .lms-cal__grid > .lms-cal__day:nth-child(7n) { border-right: 0; }

.lms-portal .lms-cal__day.is-outside { background: var(--lms-surface-alt); }
.lms-portal .lms-cal__day.is-outside .lms-cal__daynum { color: var(--lms-text-muted); opacity: .6; }
.lms-portal .lms-cal__day.is-nonworking { background: repeating-linear-gradient(135deg, transparent, transparent 7px, rgba(15,23,42,.03) 7px, rgba(15,23,42,.03) 8px); }
.lms-portal .lms-cal__day.is-warn { background: var(--lms-warning-tint); }


.lms-portal .lms-cal__daytop { display: flex; align-items: center; justify-content: space-between; gap: .3rem; }

.lms-portal .lms-cal__daynum {
	font-size: .8125rem;
	font-weight: 650;
	font-variant-numeric: tabular-nums;
}

.lms-portal .lms-cal__day.is-today .lms-cal__daynum {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.5rem;
	height: 1.5rem;
	padding: 0 .35rem;
	border-radius: var(--lms-radius-pill);
	background: var(--lms-primary);
	color: var(--lms-on-primary);
}

.lms-portal .lms-cal__count {
	font-size: .6875rem;
	font-weight: 650;
	color: var(--lms-text-muted);
	background: var(--lms-surface-alt);
	border: 1px solid var(--lms-hairline);
	border-radius: var(--lms-radius-pill);
	padding: 0 .4rem;
	line-height: 1.4;
}

.lms-portal .lms-cal__flag {
	font-size: .6875rem;
	font-weight: 700;
	color: var(--lms-warning);
	white-space: nowrap;
}

.lms-portal .lms-cal__holiday {
	font-size: .6875rem;
	font-weight: 600;
	color: var(--lms-text-muted);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.lms-portal .lms-cal__events { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .2rem; }

.lms-portal .lms-cal__event {
	display: flex;
	align-items: center;
	gap: .35rem;
	font-size: .75rem;
	line-height: 1.35;
	padding: .12rem .4rem;
	border-radius: 6px;
	background: var(--lms-surface-alt);
	border: 1px solid var(--lms-hairline);
}

.lms-portal .lms-cal__event--pending { border-style: dashed; opacity: .85; }

.lms-portal .lms-cal__ev-dot { width: .5rem; height: .5rem; border-radius: 50%; flex: none; }

.lms-portal .lms-cal__who {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.lms-portal .lms-cal__more { font-size: .6875rem; color: var(--lms-text-muted); font-weight: 600; padding-inline-start: .4rem; }

.lms-portal .lms-cal__legend { font-size: .8125rem; color: var(--lms-text-soft); gap: var(--lms-gap-m); }
.lms-portal .lms-cal__legend-item { display: inline-flex; align-items: center; gap: .35rem; }

.lms-portal .lms-cal__legend-swatch { width: .7rem; height: .7rem; border-radius: 3px; flex: none; }
.lms-portal .lms-cal__legend-swatch--approved { background: var(--lms-surface-alt); border: 1px solid var(--lms-border-strong); }
.lms-portal .lms-cal__legend-swatch--pending { background: var(--lms-surface-alt); border: 1px dashed var(--lms-border-strong); }

/* ---------------------------------------------------------------------------
   13. Push and install cards
   --------------------------------------------------------------------------- */

/* Both of these are prompts, not content. They sit above everything the
   reader came for, so they stay compact: one line of title, one of detail,
   action on the right. Before this they filled the first screen and pushed
   the actual dashboard below the fold. */
.lms-portal .lms-push,
.lms-portal .lms-install {
	display: flex;
	align-items: center;
	gap: var(--lms-gap-s);
	flex-wrap: wrap;
	padding: var(--lms-gap-s) var(--lms-gap-m);
	border-radius: var(--lms-radius);
	margin-block-end: var(--lms-gap-s);
	box-shadow: none;
}

.lms-portal .lms-push {
	border: 1px solid var(--lms-hairline);
	background: var(--lms-raised);
}

.lms-portal .lms-install {
	border: 1px solid rgba(var(--lms-primary-rgb), .35);
	background: var(--lms-primary-tint);
}

.lms-portal .lms-install[hidden] { display: none; }

.lms-portal .lms-push__body,
.lms-portal .lms-install__body { display: flex; flex-direction: column; gap: .2rem; flex: 1 1 14rem; }

.lms-portal .lms-push__title,
.lms-portal .lms-install__title { font-weight: 650; letter-spacing: -.01em; }

.lms-portal .lms-push__hint,
.lms-portal .lms-install__text { font-size: .8125rem; color: var(--lms-text-muted); }

/* The long-form hint is for someone who has decided to look. Off by default
   on the compact strip; the iOS steps stay, because there the instructions
   are the whole point. */
.lms-portal .lms-push__hint { display: none; }

.lms-portal .lms-push__state {
	font-size: .6875rem;
	text-transform: uppercase;
	letter-spacing: .06em;
	font-weight: 650;
	color: var(--lms-text-muted);
}

/* Once it is on, this collapses to a single confirmation line. */
.lms-portal .lms-push[data-state="on"] {
	border-color: var(--lms-success-border);
	background: var(--lms-success-tint);
	padding: .5rem var(--lms-gap-m);
	align-items: center;
	box-shadow: none;
}

.lms-portal .lms-push[data-state="on"] .lms-push__state { color: var(--lms-success); }
.lms-portal .lms-push[data-state="on"] .lms-push__title,
.lms-portal .lms-push[data-state="on"] .lms-push__hint { display: none; }

.lms-portal .lms-push[data-state="on"] .lms-push__state::before {
	content: "✓ ";
	font-weight: 700;
}

.lms-portal .lms-push[data-state="unsupported"],
.lms-portal .lms-push[data-state="error"] { display: none; }
.lms-portal .lms-push[data-state="blocked"] .lms-push__state { color: var(--lms-danger); }

.lms-portal .lms-install__icon {
	width: 36px;
	height: 36px;
	border-radius: 9px;
	flex: none;
	box-shadow: var(--lms-shadow-sm);
}

.lms-portal .lms-install__note { display: block; margin-block-start: var(--lms-gap-xs); font-size: .75rem; }

.lms-portal .lms-install__text { display: none; }
.lms-portal .lms-install[data-state="ready"] .lms-install__text[data-when="ready"],
.lms-portal .lms-install[data-state="ios"] .lms-install__text[data-when="ios"],
.lms-portal .lms-install[data-state="manual"] .lms-install__text[data-when="manual"],
.lms-portal .lms-install[data-state="installed"] .lms-install__text[data-when="installed"] { display: block; }

.lms-portal .lms-install[data-state="ios"] { align-items: flex-start; padding: var(--lms-gap-m); }

.lms-portal .lms-install__steps { display: flex; flex-direction: column; gap: .4rem; margin-block-start: var(--lms-gap-xs); }
.lms-portal .lms-install__step { display: flex; align-items: center; gap: var(--lms-gap-xs); color: var(--lms-text); }

.lms-portal .lms-install__num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.4rem;
	height: 1.4rem;
	flex: none;
	border-radius: 50%;
	background: var(--lms-primary);
	color: var(--lms-on-primary);
	font-size: .75rem;
	font-weight: 700;
}

.lms-portal .lms-install__actions { display: flex; gap: var(--lms-gap-xs); flex: none; margin-inline-start: auto; }
.lms-portal .lms-install__actions [data-lms-install-button] { display: none; }
.lms-portal .lms-install[data-state="ready"] .lms-install__actions [data-lms-install-button] { display: inline-flex; }
.lms-portal .lms-install[data-state="installed"] { border-color: var(--lms-success-border); background: var(--lms-success-tint); }
.lms-portal .lms-install[data-state="installed"] .lms-install__actions { display: none; }

/* ---------------------------------------------------------------------------
   14. Larger screens
   --------------------------------------------------------------------------- */

@media (min-width: 40rem) {
	.lms-portal .lms-grid2 { grid-template-columns: 1fr 1fr; }

	.lms-portal .lms-reqlist__item { align-items: center; gap: var(--lms-gap-m); }
	.lms-portal .lms-reqlist__item--full { align-items: flex-start; }

	.lms-portal .lms-reqlist__side {
		width: auto;
		flex: none;
		justify-content: flex-end;
		margin-block-start: 0;
	}

	.lms-portal .lms-approve { flex-direction: row; align-items: flex-start; }
	.lms-portal .lms-approve__actions { min-width: 15rem; flex: none; width: auto; margin-block-start: 0; }

	.lms-portal .lms-filters {
		grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
		align-items: end;
	}

	.lms-portal .lms-filters__field--grow { grid-column: span 2; }
	.lms-portal .lms-filters__actions { justify-content: flex-end; }
	.lms-portal .lms-filters__actions .lms-btn { flex: 0 0 auto; }

	.lms-portal .lms-summary__export { width: auto; margin-inline-start: auto; }

	.lms-portal .lms-pager { flex-direction: row; justify-content: space-between; }

}

@media (min-width: 60rem) {
	.lms-portal .lms-form { padding: var(--lms-gap-l); }

	.lms-portal .lms-card__head,
	.lms-portal .lms-card__body { padding: var(--lms-gap-m) var(--lms-gap-l); }

	.lms-portal .lms-reqlist__item { padding: var(--lms-gap-m) var(--lms-gap-l); }

	.lms-portal .lms-filters,
	.lms-portal .lms-summary { margin-inline: var(--lms-gap-l); }
}

/* ---------------------------------------------------------------------------
   15. Motion and print
   --------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.lms-portal *,
	.lms-portal *::before,
	.lms-portal *::after {
		animation-duration: .01ms !important;
		transition-duration: .01ms !important;
	}
}

@media print {
	.lms-portal .lms-tabs,
	.lms-portal .lms-filters,
	.lms-portal .lms-install,
	.lms-portal .lms-push,
	.lms-portal .lms-btn { display: none !important; }

	.lms-portal .lms-card {
		border: 1px solid #ccc;
		box-shadow: none;
		background: #fff;
		break-inside: avoid;
	}

	/* Paper has no disclosure triangle to click, so every absence card
	   prints with its detail showing and without the "Details" prompt. */
	.lms-portal .lms-away__more { display: none !important; }
	.lms-portal .lms-away__card { break-inside: avoid; box-shadow: none; }
	.lms-portal .lms-away__card > *:not(summary) { display: block !important; }
}

/* ---------------------------------------------------------------------------
   16. Report views and breakdowns
   --------------------------------------------------------------------------- */

/* A segmented switch between the request list and the breakdowns. Real links
   rather than scripted tabs, so a filtered breakdown can be bookmarked. */
.lms-portal .lms-views {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	margin: 0 0 var(--lms-gap-s);
	padding: 4px;
	background: var(--lms-sunken);
	border-radius: var(--lms-radius-sm);
	overflow-x: auto;
}

.lms-portal .lms-view {
	padding: .45rem .85rem;
	border-radius: var(--lms-radius-xs);
	color: var(--lms-text-muted);
	text-decoration: none;
	font-size: .8125rem;
	font-weight: 650;
	white-space: nowrap;
	transition: background .12s var(--lms-ease), color .12s var(--lms-ease);
}

.lms-portal .lms-view:hover { background: rgba(255, 255, 255, .7); color: var(--lms-text); }

.lms-portal .lms-view.is-active {
	background: var(--lms-surface);
	color: var(--lms-text);
	box-shadow: var(--lms-shadow-sm);
}

/* A proportion bar. The number sits beside it, so the bar only has to make
   the ranking readable at a glance. */
.lms-portal .lms-bar {
	display: block;
	width: 100%;
	max-width: 18rem;
	height: .4rem;
	margin-block-start: .35rem;
	border-radius: var(--lms-radius-pill);
	background: rgba(15, 23, 42, .08);
	overflow: hidden;
}

.lms-portal .lms-bar__fill {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: var(--lms-primary);
}

.lms-portal .lms-breakdown__figure {
	align-items: baseline;
	gap: .3rem;
}

.lms-portal .lms-breakdown__days {
	font-size: 1.25rem;
	font-weight: 750;
	letter-spacing: -.03em;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.lms-portal .lms-breakdown__unit { font-size: .8125rem; color: var(--lms-text-muted); }

@media (min-width: 40rem) {
	.lms-portal .lms-breakdown__figure {
		width: auto;
		flex: none;
		justify-content: flex-end;
		margin-block-start: 0;
	}
}

/* Calendar subscription. The URL is a credential, so it is shown in a field
   that selects on focus rather than as a link somebody has to highlight. */
.lms-portal .lms-subscribe__url {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: .8125rem;
}

.lms-portal .lms-subscribe__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--lms-gap-xs);
	margin-block-start: var(--lms-gap-s);
}

.lms-portal .lms-subscribe__how { margin-block-start: var(--lms-gap-s); }
