/* ==========================================================================
   Heimaskipti design tokens
   Colours come from the logo: navy (Fjörður) and evening-sun orange (Kvöldsól).
   The sun is an accent only; never use it for text on white (contrast too low).

   Use the role tokens (ink, surface, brand, primary …) in rules, not the raw
   navy: in the dark theme navy stays the header/hero colour but text turns light.
   ========================================================================== */
:root {
	/* Raw brand colours */
	--hs-navy: #0E2A47;
	--hs-navy-rgb: 14, 42, 71;
	--hs-sun: #F29A1F;
	--hs-sun-hover: #E0870C;

	/* Roles: light theme */
	--hs-ink: var(--hs-navy);             /* main text */
	--hs-ink-rgb: var(--hs-navy-rgb);
	--hs-stone: #5A6B7D;                  /* secondary text */
	--hs-snow: #F3F6F9;                   /* page background */
	--hs-surface: #FFFFFF;                /* panels, cards, fields */
	--hs-sky: #E3ECF5;                    /* tinted surface: my home, my bubble rows, selected nav */
	--hs-frost: #D5DEE7;                  /* hairlines and panel borders */
	--hs-field-border: #C4D0DC;           /* form field borders, a step stronger */
	--hs-brand: var(--hs-navy);           /* header and hero band */
	--hs-primary: var(--hs-navy);         /* primary button fill, my chat bubbles */
	--hs-primary-hover: #1A4270;
	--hs-link: var(--hs-navy);
	--hs-link-hover: #1A4270;
	--hs-shadow-rgb: var(--hs-navy-rgb);
	--hs-pending-bg: #FDECD3;
	--hs-pending-border: #F7CF94;
	--hs-ok-ink: #14532D;
	--hs-ok-bg: #DCF2E3;
	--hs-ok-border: #B4E0C2;

	--hs-font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
	--hs-font-body: "Figtree", "Segoe UI", system-ui, sans-serif;

	--hs-page-width: 1120px;
	--hs-page-pad: 2rem;
	--hs-radius: .75rem;

	color-scheme: light;
}

/* Dark theme: the night version of the same harbour. Navy deepens into the page,
   text turns to frost, the sun stays the same orange. Set on <html> by the script in App.razor. */
[data-bs-theme=dark] {
	--hs-ink: #E6EDF5;
	--hs-ink-rgb: 230, 237, 245;
	--hs-stone: #9DB0C3;
	--hs-snow: #0A1726;
	--hs-surface: #11233A;
	--hs-sky: #1A3350;
	--hs-frost: #233D5C;
	--hs-field-border: #34557A;
	--hs-brand: #0E2A47;
	--hs-primary: #3D70A8;
	--hs-primary-hover: #4A7EB8;
	--hs-link: #9CC3EB;
	--hs-link-hover: #C2DAF3;
	--hs-shadow-rgb: 0, 0, 0;
	--hs-pending-bg: #3A2A12;
	--hs-pending-border: #6B4A17;
	--hs-ok-ink: #A7E3BC;
	--hs-ok-bg: #12301F;
	--hs-ok-border: #23573A;

	color-scheme: dark;
}

/* Bootstrap, themed. Repeated for dark because Bootstrap's own [data-bs-theme=dark] block
   sets these too; listing both selectors here (after Bootstrap) makes ours win in both. */
:root,
[data-bs-theme=dark] {
	--bs-body-font-family: var(--hs-font-body);
	--bs-body-bg: var(--hs-surface);
	--bs-body-color: var(--hs-ink);
	--bs-body-color-rgb: var(--hs-ink-rgb);
	--bs-emphasis-color: var(--hs-ink);
	--bs-secondary-color: var(--hs-stone);
	--bs-heading-color: var(--hs-ink);
	--bs-primary: var(--hs-primary);
	--bs-primary-text-emphasis: var(--hs-ink);
	--bs-primary-bg-subtle: var(--hs-sky);
	--bs-primary-border-subtle: var(--hs-frost);
	--bs-link-color: var(--hs-link);
	--bs-link-hover-color: var(--hs-link-hover);
	--bs-border-color: var(--hs-frost);
	--bs-secondary-bg: var(--hs-sky);
	--bs-tertiary-bg: var(--hs-snow);
	--bs-border-radius: .5rem;
	--bs-border-radius-lg: var(--hs-radius);
	--bs-focus-ring-color: rgba(242, 154, 31, .45);
}

:root {
	--bs-primary-rgb: var(--hs-navy-rgb);
	--bs-link-color-rgb: var(--hs-navy-rgb);
	--bs-link-hover-color-rgb: 26, 66, 112;
}

[data-bs-theme=dark] {
	--bs-primary-rgb: 61, 112, 168;
	--bs-link-color-rgb: 156, 195, 235;
	--bs-link-hover-color-rgb: 194, 218, 243;
}

body {
	background-color: var(--hs-snow);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

h1, h2, h3, .h1, .h2, .h3, .h4, .h5 {
	font-family: var(--hs-font-display);
	font-weight: 700;
	letter-spacing: -.01em;
}

h1, .h1 {
	font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.45rem);
	font-weight: 800;
	letter-spacing: -.02em;
}

h1:focus {
	outline: none;
}

:focus-visible {
	outline: 3px solid var(--hs-sun);
	outline-offset: 2px;
}

/* Buttons */
.btn {
	font-weight: 600;
}

.btn-primary {
	--bs-btn-color: #fff;
	--bs-btn-bg: var(--hs-primary);
	--bs-btn-border-color: var(--hs-primary);
	--bs-btn-hover-color: #fff;
	--bs-btn-hover-bg: var(--hs-primary-hover);
	--bs-btn-hover-border-color: var(--hs-primary-hover);
	--bs-btn-active-color: #fff;
	--bs-btn-active-bg: var(--hs-primary-hover);
	--bs-btn-active-border-color: var(--hs-primary-hover);
	--bs-btn-disabled-color: #fff;
	--bs-btn-disabled-bg: var(--hs-stone);
	--bs-btn-disabled-border-color: var(--hs-stone);
	--bs-btn-focus-shadow-rgb: 242, 154, 31;
}

.btn-outline-primary {
	--bs-btn-color: var(--hs-ink);
	--bs-btn-border-color: var(--hs-ink);
	--bs-btn-hover-color: #fff;
	--bs-btn-hover-bg: var(--hs-primary);
	--bs-btn-hover-border-color: var(--hs-primary);
	--bs-btn-active-color: #fff;
	--bs-btn-active-bg: var(--hs-primary);
	--bs-btn-active-border-color: var(--hs-primary);
	--bs-btn-disabled-color: var(--hs-stone);
	--bs-btn-disabled-border-color: var(--hs-frost);
	--bs-btn-focus-shadow-rgb: 242, 154, 31;
}

/* The one warm button: the action that starts a swap */
.btn-swap {
	--bs-btn-color: var(--hs-navy);
	--bs-btn-bg: var(--hs-sun);
	--bs-btn-border-color: var(--hs-sun);
	--bs-btn-hover-color: var(--hs-navy);
	--bs-btn-hover-bg: var(--hs-sun-hover);
	--bs-btn-hover-border-color: var(--hs-sun-hover);
	--bs-btn-active-color: var(--hs-navy);
	--bs-btn-active-bg: var(--hs-sun-hover);
	--bs-btn-active-border-color: var(--hs-sun-hover);
	--bs-btn-focus-shadow-rgb: 14, 42, 71;
}

/* Forms: white fields on the snow page, sun focus ring instead of Bootstrap blue */
.form-control,
.form-select {
	background-color: var(--hs-surface);
	border-color: var(--hs-field-border);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
	border-color: var(--hs-ink);
	box-shadow: 0 0 0 .25rem rgba(242, 154, 31, .35);
}

.form-check-input:checked {
	background-color: var(--hs-primary);
	border-color: var(--hs-primary);
}

.nav-pills {
	--bs-nav-pills-link-active-bg: var(--hs-primary);
}

.nav-link {
	--bs-nav-link-color: var(--hs-ink);
	--bs-nav-link-hover-color: var(--hs-link-hover);
}

.card {
	--bs-card-bg: var(--hs-surface);
}

/* Neutral chips (EN, "Past", "Same town" …) would glare white in the dark theme */
[data-bs-theme=dark] .text-bg-light {
	color: var(--hs-ink) !important;
	background-color: var(--hs-sky) !important;
}

.card {
	--bs-card-border-color: var(--hs-frost);
	--bs-card-border-radius: var(--hs-radius);
	--bs-card-inner-border-radius: calc(var(--hs-radius) - 1px);
}

/* ==========================================================================
   Blazor template defaults
   ========================================================================== */
.valid.modified:not([type=checkbox]) {
	outline: 1px solid #26b050;
}

.invalid {
	outline: 1px solid #e50000;
}

.validation-message {
	color: #c40000;
}

.blazor-error-boundary {
	background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
	padding: 1rem 1rem 1rem 3.7rem;
	color: white;
}

	.blazor-error-boundary::after {
		content: "An error has occurred."
	}

.darker-border-checkbox.form-check-input {
	border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
	color: var(--bs-secondary-color);
	text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
	text-align: start;
}

/* ==========================================================================
   Site header, menu and footer
   ========================================================================== */
.site-header {
	background: var(--hs-brand);
	color: #fff;
}

.site-header-inner {
	max-width: var(--hs-page-width);
	margin: 0 auto;
	padding: .85rem var(--hs-page-pad);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	color: #fff;
	text-decoration: none;
	font-family: var(--hs-font-display);
	font-weight: 800;
	font-size: 1.3rem;
	letter-spacing: -.02em;
}

.brand:hover {
	color: #fff;
}

.brand-tld {
	color: var(--hs-sun);
}

.site-nav {
	display: flex;
	gap: .3rem;
	align-items: center;
}

.site-nav a {
	color: rgba(255, 255, 255, .82);
	text-decoration: none;
}

/* Main menu links: sun-coloured icon + label; the page you are on sits in a light pill */
.nav-item-link {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	padding: .4rem .75rem;
	border: 0;
	border-radius: 999px;
	background: none;
	color: rgba(255, 255, 255, .82);
	font: inherit;
	font-weight: 600;
	font-size: .95rem;
	line-height: 1.2;
	white-space: nowrap;
	text-decoration: none;
	cursor: pointer;
}

.nav-item-link:hover {
	color: #fff;
	background: rgba(255, 255, 255, .08);
}

.nav-item-link.active {
	color: #fff;
	background: rgba(255, 255, 255, .13);
}

.nav-icon {
	width: 1.05rem;
	height: 1.05rem;
	flex: none;
	color: var(--hs-sun);
}

.site-nav form {
	margin: 0;
}

.site-nav-prefs {
	margin-left: .5rem;
}

.language-switch {
	border: 1px solid rgba(255, 255, 255, .35);
	border-radius: 1rem;
	padding: .1rem .65rem;
	font-size: .85rem !important;
}

.site-nav-prefs {
	display: flex;
	align-items: center;
	gap: .5rem;
}

/* Light/dark toggle: shows the moon in the light theme and the sun in the dark one */
.theme-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 1.65rem;
	padding: 0;
	color: rgba(255, 255, 255, .82);
	background: none;
	border: 1px solid rgba(255, 255, 255, .35);
	border-radius: 1rem;
	cursor: pointer;
}

.theme-toggle:hover {
	color: #fff;
	border-color: rgba(255, 255, 255, .6);
}

.theme-icon {
	width: .95rem;
	height: .95rem;
}

.theme-icon-sun,
.theme-label-to-light,
[data-bs-theme=dark] .theme-icon-moon,
[data-bs-theme=dark] .theme-label-to-dark {
	display: none;
}

[data-bs-theme=dark] .theme-icon-sun {
	display: block;
}

[data-bs-theme=dark] .theme-label-to-light {
	display: inline;
}

/* The checkbox itself stays .visually-hidden (still keyboard focusable); the label is the visible button */
.menu-toggle {
	display: none;
}

/* The full menu (with icons, and Admin for admins) needs about 1050px; below that it folds into "Valmynd" */
@media (max-width: 1080px) {
	.site-header-inner {
		flex-wrap: wrap;
	}

	.menu-toggle {
		display: inline-flex;
		align-items: center;
		gap: .4rem;
		color: #fff;
		border: 1px solid rgba(255, 255, 255, .35);
		border-radius: .5rem;
		padding: .3rem .7rem;
		font-weight: 600;
		font-size: .9rem;
		cursor: pointer;
		user-select: none;
	}

	.menu-toggle-input:focus-visible + .menu-toggle {
		outline: 3px solid var(--hs-sun);
		outline-offset: 2px;
	}

	.site-nav {
		display: none;
		flex-basis: 100%;
		flex-direction: column;
		align-items: flex-start;
		gap: 0;
		padding: .5rem 0 .25rem;
		border-top: 1px solid rgba(255, 255, 255, .15);
	}

	.site-nav > a,
	.site-nav > form {
		width: 100%;
	}

	.site-nav .nav-item-link {
		width: 100%;
		padding: .6rem .75rem;
	}

	.site-nav-prefs {
		margin: .5rem 0 0 .75rem;
		padding: .25rem 0;
	}

	.menu-toggle-input:checked ~ .site-nav {
		display: flex;
	}
}

main {
	flex: 1 0 auto;
	width: 100%;
	max-width: var(--hs-page-width);
	margin: 0 auto;
	padding: var(--hs-page-pad);
}

.site-footer {
	border-top: 1px solid var(--hs-frost);
	color: var(--hs-stone);
	font-size: .9rem;
}

.site-footer-inner {
	max-width: var(--hs-page-width);
	margin: 0 auto;
	padding: 1.5rem var(--hs-page-pad);
	display: flex;
	flex-wrap: wrap;
	gap: .5rem 1.5rem;
	align-items: center;
	justify-content: space-between;
}

.site-footer .footer-brand {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	color: var(--hs-ink);
	font-family: var(--hs-font-display);
	font-weight: 700;
}

.site-footer p {
	margin: 0;
}

/* ==========================================================================
   Home page
   ========================================================================== */

/* The hero continues the navy header edge to edge. The box-shadow + clip-path pair paints the
   full-bleed background without widening the page (no horizontal scroll). */
.hero {
	position: relative;
	margin-top: calc(-1 * var(--hs-page-pad));
	padding: 2.5rem 0 4.5rem;
	background: var(--hs-brand);
	box-shadow: 0 0 0 100vmax var(--hs-brand);
	clip-path: inset(0 -100vmax);
	color: #fff;
}

.hero h1 {
	color: #fff;
	max-width: 22ch;
	margin-bottom: 1.75rem;
}

.hero .lead {
	max-width: 58ch;
	color: rgba(255, 255, 255, .9);
	font-size: 1.15rem;
}

.hero-more {
	max-width: 62ch;
	color: rgba(255, 255, 255, .72);
}

/* Place pairs: each side stacks its names in one grid cell and they cross-fade in turn,
   while the arrows turn once per change. One 12 s loop, three pairs, 4 s each. */
.hero-swap {
	display: grid;
	grid-template-columns: minmax(0, max-content) auto minmax(0, max-content);
	justify-content: start;
	align-items: center;
	gap: .2em .45em;
	margin: 0 0 1.75rem;
	font-family: var(--hs-font-display);
	font-weight: 800;
	font-size: clamp(1.9rem, 1rem + 3.6vw, 3.6rem);
	line-height: 1.05;
	letter-spacing: -.03em;
}

.hero-swap-side {
	display: grid;
}

/* Left names hug the arrows, so each pair reads as one unit whatever the name lengths */
.hero-swap-side:first-child {
	justify-items: end;
}

.hero-swap-side > span {
	grid-area: 1 / 1;
	opacity: 0;
	animation: hs-place 12s ease-in-out infinite both;
}

.hero-swap-side > span:nth-child(2) {
	animation-delay: 4s;
}

.hero-swap-side > span:nth-child(3) {
	animation-delay: 8s;
}

.hero-swap-arrows {
	width: 1.05em;
	height: 1.05em;
	color: var(--hs-sun);
	animation: hs-turn 12s cubic-bezier(.6, 0, .3, 1) infinite;
}

@keyframes hs-place {
	0% { opacity: 0; transform: translateY(.25em); }
	4%, 30% { opacity: 1; transform: none; }
	34%, 100% { opacity: 0; transform: translateY(-.25em); }
}

@keyframes hs-turn {
	0%, 30% { transform: rotate(0deg); }
	34%, 63% { transform: rotate(180deg); }
	67%, 96% { transform: rotate(360deg); }
	100% { transform: rotate(540deg); }
}

@media (prefers-reduced-motion: reduce) {
	.hero-swap-side > span,
	.hero-swap-arrows {
		animation: none;
	}

	.hero-swap-side > span:first-child {
		opacity: 1;
	}

	.hero-swap-side > span:not(:first-child) {
		visibility: hidden;
	}
}

/* Search sits as a white bar overlapping the bottom edge of the hero */
.search-filters {
	position: relative;
	margin: -2.75rem 0 2.5rem;
	padding: 1rem 1rem 1.15rem;
	background: var(--hs-surface);
	border: 1px solid var(--hs-frost);
	border-radius: var(--hs-radius);
	box-shadow: 0 18px 40px -24px rgba(var(--hs-shadow-rgb), .55);
}

.search-filters .form-label {
	font-weight: 600;
	color: var(--hs-ink);
	margin-bottom: .3rem;
}

.results-heading {
	font-family: var(--hs-font-display);
	font-weight: 700;
	font-size: 1.25rem;
}

/* Listing cards: the photo leads, the frame stays quiet */
.property-card {
	color: inherit;
	background: var(--hs-surface);
	overflow: hidden;
	transition: border-color .15s ease-in-out;
}

.property-card:hover {
	border-color: var(--hs-ink);
}

.property-card-title {
	font-family: var(--hs-font-display);
	font-weight: 700;
	font-size: 1.1rem;
	line-height: 1.25;
}

.property-card-free {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	font-weight: 600;
}

.property-card-free::before {
	content: "";
	width: .5rem;
	height: .5rem;
	border-radius: 50%;
	background: var(--hs-sun);
}

/* Placeholder when a home has no photos yet */
.property-card-image {
	aspect-ratio: 4 / 3;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--hs-sky);
	color: var(--hs-stone);
	font-size: .9rem;
}

img.property-card-image {
	object-fit: cover;
	width: 100%;
}

/* ==========================================================================
   Account pages
   ========================================================================== */
.auth-panel {
	max-width: 27rem;
	margin: 1rem auto 2rem;
	padding: 2rem 2rem 1.5rem;
	background: var(--hs-surface);
	border: 1px solid var(--hs-frost);
	border-radius: var(--hs-radius);
}

.auth-panel .auth-mark {
	color: var(--hs-ink);
	display: block;
	margin-bottom: 1rem;
}

.auth-panel h1 {
	font-size: 1.9rem;
}

.auth-lead {
	color: var(--hs-stone);
	margin-bottom: 1.25rem;
}

.auth-panel .alert {
	margin-bottom: 1rem;
}

.auth-or {
	display: flex;
	align-items: center;
	gap: .75rem;
	color: var(--hs-stone);
	font-size: .9rem;
	margin: 1.25rem 0 .5rem;
}

.auth-or::before,
.auth-or::after {
	content: "";
	flex: 1;
	border-top: 1px solid var(--hs-frost);
}

.auth-links {
	list-style: none;
	padding: 1rem 0 0;
	margin: 1rem 0 0;
	border-top: 1px solid var(--hs-frost);
	font-size: .95rem;
}

.auth-links li + li {
	margin-top: .4rem;
}

@media (max-width: 576px) {
	.auth-panel {
		padding: 1.5rem 1.25rem 1.25rem;
		margin-top: 0;
	}
}

.manage-panel {
	background: var(--hs-surface);
	border: 1px solid var(--hs-frost);
	border-radius: var(--hs-radius);
	padding: 1.5rem;
}

.manage-nav .nav-link {
	border-radius: .5rem;
	padding: .45rem .75rem;
	font-weight: 500;
}

.manage-nav .nav-link.active {
	background: var(--hs-sky);
	color: var(--hs-ink);
	font-weight: 700;
	box-shadow: inset 3px 0 0 var(--hs-sun);
}

/* ==========================================================================
   Photos
   ========================================================================== */
.photo-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(130px, 40%), 1fr));
	gap: .5rem;
}

.photo-tile {
	position: relative;
	margin: 0;
	aspect-ratio: 4 / 3;
	border-radius: .5rem;
	overflow: hidden;
	background: var(--bs-tertiary-bg);
}

.photo-tile img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.photo-cover {
	position: absolute;
	top: .4rem;
	left: .4rem;
	padding: .1rem .5rem;
	border-radius: 1rem;
	background: var(--hs-sun);
	color: var(--hs-navy);
	font-size: .75rem;
	font-weight: 700;
}

/* "Add photos" as the last tile of the grid */
.photo-add {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: .25rem;
	aspect-ratio: 4 / 3;
	padding: .5rem;
	border: 2px dashed var(--hs-field-border);
	border-radius: .5rem;
	color: var(--hs-ink);
	font-weight: 600;
	font-size: .9rem;
	text-align: center;
	cursor: pointer;
}

.photo-add:hover {
	border-color: var(--hs-ink);
	background: var(--hs-snow);
}

.photo-add:focus-within {
	outline: 3px solid var(--hs-sun);
	outline-offset: 2px;
}

.photo-add.is-busy {
	cursor: progress;
	opacity: .75;
}

.photo-add-plus {
	font-size: 1.75rem;
	line-height: 1;
	color: var(--hs-sun);
}

/* ==========================================================================
   My homes and the home form
   ========================================================================== */
.my-homes {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	gap: .75rem;
}

.my-home {
	display: grid;
	grid-template-columns: 9rem minmax(0, 1fr) auto;
	align-items: center;
	gap: 1.1rem;
	padding: .75rem;
	background: var(--hs-surface);
	border: 1px solid var(--hs-frost);
	border-radius: var(--hs-radius);
}

.my-home-photo {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: .5rem;
}

.my-home-nophoto {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--hs-sky);
	color: var(--hs-stone);
	font-size: .8rem;
}

.my-home-title {
	font-size: 1.15rem;
	margin: 0 0 .15rem;
}

.my-home-title a {
	text-decoration: none;
}

.my-home-title a:hover {
	text-decoration: underline;
}

@media (max-width: 576px) {
	.my-home {
		grid-template-columns: 6rem minmax(0, 1fr);
		gap: .75rem;
	}

	.my-home-actions {
		grid-column: 1 / -1;
	}

	.my-home-actions .btn {
		width: 100%;
	}
}

/* Two classes so it wins over .status-pill, which is defined further down */
.status-pill.status-hidden {
	color: #8A1C1C;
	background: #FBE3E3;
	border-color: #F2BDBD;
}

[data-bs-theme=dark] .status-pill.status-hidden {
	color: #F5B5B5;
	background: #3A1A1D;
	border-color: #6B2A30;
}

/* The form reads best in one column of comfortable width */
.form-page {
	max-width: 50rem;
}

.form-section {
	margin: 0 0 1.25rem;
	padding: 1.25rem 1.25rem .5rem;
	background: var(--hs-surface);
	border: 1px solid var(--hs-frost);
	border-radius: var(--hs-radius);
}

/* Bootstrap floats the legend at full width, which keeps it inside the panel instead of on the border */
.form-section > legend {
	margin-bottom: 1rem;
	font-family: var(--hs-font-display);
	font-weight: 700;
	font-size: 1.2rem;
}

.form-section > :last-child {
	margin-bottom: .75rem;
}

.form-section-alt {
	background: var(--hs-sky);
	border-color: var(--hs-sky);
}

.form-optional {
	margin-left: .35rem;
	font-family: var(--hs-font-body);
	font-weight: 500;
	font-size: .85rem;
	color: var(--hs-stone);
}

.date-row {
	display: grid;
	grid-template-columns: 1fr 1fr auto;
	align-items: end;
	gap: .5rem;
	margin-bottom: .6rem;
}

.date-row-remove {
	width: 2.5rem;
}

.form-actions {
	position: sticky;
	bottom: 0;
	z-index: 5;
	margin: 1.5rem 0 0;
	padding: .85rem 1rem;
	background: var(--hs-surface);
	border: 1px solid var(--hs-frost);
	border-radius: var(--hs-radius) var(--hs-radius) 0 0;
	box-shadow: 0 -12px 28px -20px rgba(var(--hs-shadow-rgb), .45);
}

.form-actions-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .75rem 1rem;
}

.danger-zone {
	margin-top: 3rem;
	padding: 1.25rem;
	border: 1px solid var(--bs-danger-border-subtle);
	border-radius: var(--hs-radius);
}

.danger-zone h2 {
	color: var(--bs-danger-text-emphasis);
}

/* ==========================================================================
   Matches and profile
   ========================================================================== */
.page-lead {
	max-width: 65ch;
	color: var(--hs-stone);
	font-size: 1.05rem;
	margin-bottom: 1.75rem;
}

.setup-steps {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
	gap: .75rem;
	margin-bottom: 2rem;
}

.setup-step {
	padding: 1rem 1.15rem;
	background: var(--hs-surface);
	border: 1px dashed var(--hs-field-border);
	border-radius: var(--hs-radius);
}

.match-section {
	margin-bottom: 2.75rem;
}

.mutual-list {
	display: grid;
	gap: 1rem;
}

/* A mutual match is the best news on the page: the swap pair on a warm-edged card */
.mutual-card {
	padding: 1.15rem;
	background: var(--hs-surface);
	border: 1px solid var(--hs-frost);
	border-left: 4px solid var(--hs-sun);
	border-radius: var(--hs-radius);
}

.match-card .property-card-title a {
	text-decoration: none;
}

.match-card .property-card-title a:hover {
	text-decoration: underline;
}

.person-row {
	padding: .9rem 1.1rem;
}

/* Profile: a section heading that sits where a fieldset legend would */
.form-section-title {
	font-size: 1.2rem;
	margin-bottom: 1rem;
}

.wish-list {
	list-style: none;
	padding: 0;
	margin: .5rem 0 1rem;
	border: 1px solid var(--hs-frost);
	border-radius: var(--hs-radius);
	overflow: hidden;
}

.wish-row {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 1rem;
	padding: .85rem 1rem;
}

.wish-row + .wish-row {
	border-top: 1px solid var(--hs-frost);
}

.wish-row.is-past {
	color: var(--hs-stone);
	background: var(--hs-snow);
}

.wish-editor {
	margin: .5rem 0 1rem;
	padding: 1rem 1.1rem;
	background: var(--hs-sky);
	border-radius: var(--hs-radius);
}

/* Admin: a report */
.report-people {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
	gap: 0 1.25rem;
}

.report-reported {
	border-color: var(--bs-danger-border-subtle);
}

.report-chat {
	margin: 0 0 1.25rem;
	padding: 1rem 1.25rem;
	background: var(--hs-surface);
	border: 1px solid var(--hs-frost);
	border-radius: var(--hs-radius);
}

.report-chat summary {
	font-weight: 600;
	cursor: pointer;
}

/* A review an admin has hidden: still readable, clearly set back */
.admin-review.is-hidden > :not(:first-child),
.admin-review.is-hidden .stars {
	opacity: .6;
}

/* Audit log: the request-list rows without the link hover */
.audit-row {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 1rem;
	padding: .9rem 1.1rem;
}

@media (max-width: 576px) {
	.audit-row {
		flex-direction: column;
		gap: .35rem;
	}

	.audit-row .request-row-status {
		align-items: flex-start;
	}
}

/* ==========================================================================
   Safety, FAQ and terms
   ========================================================================== */
.trust-section {
	margin-top: 3rem;
}

.trust-point h3 {
	font-size: 1.1rem;
	margin-bottom: .5rem;
}

/* FAQ: one panel per question, the same frame as .form-section */
.faq-list {
	display: grid;
	gap: .75rem;
}

.faq-item {
	background: var(--hs-surface);
	border: 1px solid var(--hs-frost);
	border-radius: var(--hs-radius);
}

.faq-item summary {
	padding: 1rem 1.25rem;
	font-family: var(--hs-font-display);
	font-weight: 700;
	font-size: 1.1rem;
	cursor: pointer;
}

.faq-item[open] summary {
	border-bottom: 1px solid var(--hs-frost);
}

.faq-item > :not(summary) {
	margin-left: 1.25rem;
	margin-right: 1.25rem;
}

.faq-item > summary + * {
	margin-top: 1rem;
}

.faq-item > :last-child {
	margin-bottom: 1rem;
}

.footer-links {
	display: flex;
	flex-wrap: wrap;
	gap: .25rem 1.25rem;
}

.site-footer .footer-links a {
	color: var(--hs-stone);
}

.site-footer .footer-links a:hover {
	color: var(--hs-ink);
}

@media (max-width: 576px) {
	.wish-row {
		flex-direction: column;
		gap: .5rem;
	}
}

.photo-actions {
	position: absolute;
	bottom: .35rem;
	right: .35rem;
	display: flex;
	gap: .25rem;
}

.photo-actions .btn {
	padding: 0 .4rem;
	opacity: .9;
}

.property-gallery {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr;
	grid-template-rows: repeat(2, 1fr);
	gap: .5rem;
	height: 380px;
	border-radius: var(--hs-radius);
	overflow: hidden;
}

.property-gallery a {
	display: block;
	overflow: hidden;
	background: var(--bs-tertiary-bg);
}

.property-gallery a:first-child {
	grid-row: span 2;
}

.property-gallery img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .2s;
}

.property-gallery a:hover img {
	transform: scale(1.03);
}

.property-gallery .more {
	position: relative;
}

.property-gallery .more span {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(var(--hs-navy-rgb), .6);
	color: #fff;
	font-weight: 600;
}

.property-gallery.count-1 {
	grid-template-columns: 1fr;
}

.property-gallery.count-1 a:first-child,
.property-gallery.count-2 a {
	grid-row: span 2;
}

.property-gallery.count-2 {
	grid-template-columns: 1fr 1fr;
}

.property-gallery.count-3,
.property-gallery.count-4 {
	grid-template-columns: 2fr 1fr;
}

@media (max-width: 576px) {
	.property-gallery {
		grid-template-columns: 1fr !important;
		grid-template-rows: auto;
		height: auto;
	}

	.property-gallery a:not(:first-child) {
		display: none;
	}

	.property-gallery a:first-child {
		aspect-ratio: 4 / 3;
	}
}

.photo-viewer {
	position: fixed;
	inset: 0;
	z-index: 1050;
	background: rgba(6, 18, 31, .92);
	display: flex;
	align-items: center;
	justify-content: center;
}

.photo-viewer img {
	max-width: 92vw;
	max-height: 86vh;
	object-fit: contain;
}

.photo-viewer-close {
	position: absolute;
	top: 1rem;
	right: 1rem;
}

.photo-viewer-prev,
.photo-viewer-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
}

.photo-viewer-prev {
	left: 1rem;
}

.photo-viewer-next {
	right: 1rem;
}

.photo-viewer-count {
	position: absolute;
	bottom: 1rem;
	color: #fff;
	font-size: .9rem;
}

/* ==========================================================================
   Reviews
   ========================================================================== */
.stars {
	color: var(--hs-sun);
	letter-spacing: .05em;
}

.star-input .star {
	border: 0;
	background: none;
	font-size: 1.75rem;
	line-height: 1;
	padding: 0 .1rem;
	color: var(--hs-frost);
	cursor: pointer;
}

.star-input .star.on {
	color: var(--hs-sun);
}

.star-input .star:focus-visible {
	outline: 3px solid var(--hs-ink);
	border-radius: .25rem;
}

.review-item + .review-item {
	border-top: 1px solid var(--bs-border-color);
	padding-top: .75rem;
	margin-top: .75rem;
}

/* ==========================================================================
   Swap requests
   ========================================================================== */
.request-unread {
	border-left: 3px solid var(--hs-sun);
}

.request-unread .fw-semibold {
	font-weight: 700 !important;
}

.unread-divider {
	display: flex;
	align-items: center;
	gap: .5rem;
	color: var(--hs-ink);
	font-size: .8rem;
	font-weight: 600;
}

.unread-divider::before,
.unread-divider::after {
	content: "";
	flex: 1;
	border-top: 2px solid var(--hs-sun);
}

/* Status pills: tinted, never the loud Bootstrap yellow/green. Pending is the only warm one. */
.status-pill {
	display: inline-block;
	padding: .2rem .6rem;
	border-radius: 1rem;
	font-size: .8rem;
	font-weight: 600;
	line-height: 1.3;
	white-space: nowrap;
	color: var(--hs-ink);
	background: var(--hs-snow);
	border: 1px solid var(--hs-frost);
}

.status-pending {
	background: var(--hs-pending-bg);
	border-color: var(--hs-pending-border);
}

.status-accepted {
	color: var(--hs-ok-ink);
	background: var(--hs-ok-bg);
	border-color: var(--hs-ok-border);
}

.status-done {
	background: var(--hs-sky);
	border-color: var(--hs-sky);
}

.status-closed {
	color: var(--hs-stone);
	background: transparent;
}

.count-pill {
	display: inline-block;
	min-width: 1.6em;
	padding: .05em .45em;
	margin-left: .35rem;
	border-radius: 1rem;
	background: var(--hs-sun);
	color: var(--hs-navy); /* dark text on orange in both themes */
	font-size: .8em;
	text-align: center;
	vertical-align: .1em;
}

.empty-state {
	max-width: 60ch;
	padding: 1.5rem;
	background: var(--hs-surface);
	border: 1px dashed var(--hs-field-border);
	border-radius: var(--hs-radius);
}

/* Request list */
.request-list {
	list-style: none;
	padding: 0;
	margin: 0 0 1rem;
	background: var(--hs-surface);
	border: 1px solid var(--hs-frost);
	border-radius: var(--hs-radius);
	overflow: hidden;
}

.request-list li + li {
	border-top: 1px solid var(--hs-frost);
}

.request-row {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 1rem;
	padding: .9rem 1.1rem;
	color: inherit;
	text-decoration: none;
	border-left: 3px solid transparent;
}

.request-row:hover {
	background: var(--hs-snow);
	color: inherit;
}

.request-row.request-unread {
	border-left-color: var(--hs-sun);
}

.request-row-title {
	font-family: var(--hs-font-display);
	font-weight: 700;
	font-size: 1.05rem;
}

.request-row.request-unread .request-row-title {
	font-weight: 800;
}

.request-row-main {
	flex: 1;
	min-width: 0; /* lets long descriptions truncate instead of pushing the status out */
}

.request-row-status {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: .35rem;
	flex-shrink: 0;
}

.request-row-unread {
	font-size: .8rem;
	font-weight: 700;
	color: var(--hs-ink);
}

/* Request page: the two homes either side of the swap arrows */
.swap-pair {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 1rem;
}

.swap-home {
	height: 100%;
	padding: 1rem 1.15rem;
	background: var(--hs-surface);
	border: 1px solid var(--hs-frost);
	border-radius: var(--hs-radius);
}

.swap-home.mine {
	background: var(--hs-sky);
	border-color: var(--hs-sky);
}

.swap-home-title {
	font-size: 1.1rem;
	margin: .15rem 0 .2rem;
}

.swap-home-title a {
	text-decoration: none;
}

.swap-home-title a:hover {
	text-decoration: underline;
}

.swap-pair-arrows {
	width: 2.5rem;
	height: 2.5rem;
	color: var(--hs-sun);
}

@media (max-width: 767px) {
	.swap-pair {
		grid-template-columns: 1fr;
		justify-items: center;
		gap: .5rem;
	}

	.swap-home {
		width: 100%;
	}

	.swap-pair-arrows {
		width: 2rem;
		height: 2rem;
		transform: rotate(90deg);
	}
}

/* Chat: one white panel, bubbles inside, composer at the bottom */
.chat-panel {
	background: var(--hs-surface);
	border: 1px solid var(--hs-frost);
	border-radius: var(--hs-radius);
	padding: 1.25rem;
}

.swap-thread {
	display: flex;
	flex-direction: column;
	gap: .6rem;
	margin-bottom: 1rem;
}

.swap-message {
	max-width: 80%;
	padding: .55rem .85rem;
	border-radius: 1rem 1rem 1rem .25rem;
	background: var(--hs-snow);
}

.swap-message.mine {
	align-self: flex-end;
	border-radius: 1rem 1rem .25rem 1rem;
	background: var(--hs-primary);
	color: #fff;
}

.swap-message-meta {
	font-size: .75rem;
	color: var(--bs-secondary-color);
	margin-bottom: .15rem;
}

.swap-message.mine .swap-message-meta {
	color: rgba(255, 255, 255, .72);
}

.chat-composer {
	display: grid;
	gap: .5rem;
	padding-top: 1rem;
	border-top: 1px solid var(--hs-frost);
}

@media (max-width: 576px) {
	.chat-panel {
		padding: 1rem .85rem;
	}

	.swap-message {
		max-width: 90%;
	}
}

/* ==========================================================================
   Public property page
   ========================================================================== */
.property-text {
	white-space: pre-line;
}

.property-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 1rem;
	flex-wrap: wrap;
	margin-bottom: 1.25rem;
}

.property-meta {
	color: var(--hs-stone);
	font-size: 1.05rem;
}

/* Facts read as one line of figures, divided by hairlines */
.property-facts {
	display: flex;
	flex-wrap: wrap;
	margin: 1.5rem 0 2rem;
	padding: .9rem 0;
	border-top: 1px solid var(--hs-frost);
	border-bottom: 1px solid var(--hs-frost);
}

.property-facts li {
	padding: 0 1.5rem;
	color: var(--hs-stone);
}

.property-facts li:first-child {
	padding-left: 0;
}

.property-facts li + li {
	border-left: 1px solid var(--hs-frost);
}

.property-facts strong {
	font-family: var(--hs-font-display);
	font-size: 1.35rem;
	color: var(--hs-ink);
	margin-right: .25rem;
}

/* Right column: sticks beside the description on wide screens */
@media (min-width: 992px) {
	.property-aside {
		position: sticky;
		top: 1.5rem;
	}
}

.swap-panel {
	padding: 1.25rem;
	background: var(--hs-surface);
	border: 1px solid var(--hs-frost);
	border-radius: var(--hs-radius);
	box-shadow: 0 18px 40px -28px rgba(var(--hs-shadow-rgb), .5);
}

.availability-list {
	list-style: none;
	padding: 0;
	margin: 0 0 1.25rem;
}

.availability-list li {
	display: flex;
	align-items: center;
	gap: .55rem;
	padding: .35rem 0;
	font-weight: 600;
}

.availability-list li::before {
	content: "";
	flex: none;
	width: .5rem;
	height: .5rem;
	border-radius: 50%;
	background: var(--hs-sun);
}

.swap-panel-owner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .35rem .5rem;
	margin-top: 1.25rem;
	padding-top: 1rem;
	border-top: 1px solid var(--hs-frost);
}

.owner-wishes {
	margin-top: 1.5rem;
	padding: 0 .25rem;
}

.inline-arrows {
	width: 1.2em;
	height: 1.2em;
	color: var(--hs-sun);
	vertical-align: -.25em;
	margin-right: .2rem;
}

@media (max-width: 576px) {
	.property-facts li {
		padding: .2rem 1rem .2rem 0;
		border-left: 0 !important;
	}
}

.property-amenities {
	columns: 2;
	padding-left: 1.2rem;
}

@media (max-width: 576px) {
	:root {
		--hs-page-pad: 1rem;
	}

	.hero {
		padding: 1.75rem 0 4rem;
	}

	.hero-swap {
		grid-template-columns: auto;
		justify-items: start;
		gap: .1em;
	}

	.hero-swap-side:first-child {
		justify-items: start;
	}

	.hero-swap-arrows {
		width: 1em;
		height: 1em;
	}

	.property-amenities {
		columns: 1;
	}
}
