:root {
	--ink: #2d2521;
	--muted: #7a6b62;
	--panel: rgba(255, 255, 255, 0.94);
	--blush: #fff6f2;
	--rose: #b94369;
	--rose-dark: #8f284a;
	--terracotta: #d98560;
	--gold: #b99658;
	--line: rgba(74, 55, 45, 0.14);
	--shadow: 0 28px 80px rgba(111, 70, 54, 0.2);
	--content-panel-width: 720px;
}

html,
body {
	margin: 0;
	min-height: 100%;
	color: var(--ink);
	font-family: Arial, Helvetica, sans-serif;
	background:
		radial-gradient(circle at 14% 12%, rgba(255, 255, 255, 0.96) 0, rgba(255, 255, 255, 0.58) 24%, transparent 48%),
		radial-gradient(circle at 86% 8%, rgba(250, 218, 197, 0.7) 0, rgba(250, 218, 197, 0.24) 28%, transparent 54%),
		linear-gradient(145deg, #f7c7b8 0%, #f3a984 39%, #b94369 100%);
}

body,
#outlet {
	min-height: 100vh;
}

.page-shell,
.gallery-shell,
.legal-shell {
	min-height: 100vh;
	display: grid;
	place-items: center;
	align-content: center;
	justify-content: center;
	padding: 20px;
	box-sizing: border-box;
}

.gallery-shell,
.legal-shell {
	place-items: start center;
	align-content: start;
}

.upload-shell,
.audio-shell {
	width: 100%;
	grid-template-columns: minmax(0, var(--content-panel-width));
	justify-items: center;
}

.upload-panel,
.legal-panel {
	width: min(100%, var(--content-panel-width)) !important;
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: 8px;
	box-shadow: var(--shadow);
	padding: clamp(24px, 6vw, 52px);
	text-align: center;
	box-sizing: border-box;
	backdrop-filter: blur(18px);
	position: relative;
	overflow: hidden;
}

.upload-panel > * {
	max-width: 100%;
}

.small-panel {
	width: min(100%, var(--content-panel-width)) !important;
}

.gallery-panel {
	width: min(100%, 1120px);
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: 8px;
	box-shadow: var(--shadow);
	padding: clamp(24px, 6vw, 52px);
	text-align: center;
	box-sizing: border-box;
	backdrop-filter: blur(18px);
	position: relative;
	overflow: hidden;
}

.legal-panel {
	text-align: left;
}

.wedding-logo {
	display: block;
	width: min(60vw, 236px);
	height: auto;
	margin: 0 auto 12px;
	filter: drop-shadow(0 18px 30px rgba(96, 55, 42, 0.14));
}

.gallery-logo {
	display: block;
	width: min(46vw, 180px);
	height: auto;
	margin: 8px auto;
}

h1 {
	margin: 6px 0;
	font-family: Georgia, "Times New Roman", serif;
	font-size: clamp(2rem, 7vw, 3.4rem);
	line-height: 1;
	letter-spacing: 0;
	text-align: center;
	width: 100%;
}

.date-line {
	margin: 0;
	color: var(--rose);
	font-weight: 800;
	text-align: center;
	width: 100%;
}

.intro,
.upload-panel p,
.legal-content,
.empty-state {
	color: var(--muted);
	line-height: 1.55;
}

.intro {
	margin: 14px auto 26px;
	font-size: 1.02rem;
	max-width: 36rem;
}

.name-field,
.photo-upload-control {
	width: 100%;
	text-align: left;
}

.name-field {
	margin-top: 2px;
}

.photo-upload-control {
	margin-top: 14px;
}

.upload-locked {
	opacity: 0.62;
	pointer-events: none;
}

vaadin-button {
	border-radius: 8px;
	font-weight: 800;
}

.photo-upload-button {
	width: 100%;
	min-height: 48px;
	padding-inline: 20px;
	background: linear-gradient(135deg, var(--terracotta), var(--rose));
	color: white;
	box-shadow: none;
}

.photo-upload-button[disabled] {
	background: #e5ddd8;
	color: #8d7c72;
	box-shadow: none;
	cursor: not-allowed;
}

.photo-upload-control.is-uploading {
	pointer-events: none;
	opacity: 0.82;
}

vaadin-notification-card[theme~="success"]::part(overlay) {
	border: 1px solid rgba(185, 67, 105, 0.24);
	border-radius: 8px;
	background: linear-gradient(135deg, var(--terracotta), var(--rose));
	box-shadow: 0 24px 70px rgba(111, 70, 54, 0.28);
	color: white;
	font-weight: 900;
	text-align: center;
}

.rubric-nav {
	width: 100%;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	margin-top: 24px;
	padding-top: 18px;
	border-top: 1px solid rgba(74, 55, 45, 0.12);
}

.rubric-link {
	display: grid;
	gap: 4px;
	min-height: 72px;
	align-content: center;
	padding: 12px 10px;
	border: 1px solid rgba(185, 67, 105, 0.16);
	border-radius: 8px;
	background: rgba(255, 246, 242, 0.78);
	color: var(--rose-dark);
	text-align: center;
	text-decoration: none;
	transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.rubric-link:hover {
	background: #fff6f2;
	border-color: rgba(185, 67, 105, 0.36);
	transform: translateY(-1px);
}

.rubric-title {
	font-weight: 800;
	line-height: 1.15;
}

.rubric-subtitle {
	color: var(--muted);
	font-size: 0.78rem;
	font-weight: 700;
	line-height: 1.2;
}

.upload-hint,
.upload-status {
	width: 100%;
	margin: 8px 0 4px;
	padding: 12px 14px;
	border: 1px solid rgba(185, 67, 105, 0.18);
	border-radius: 8px;
	background: var(--blush);
	color: var(--rose-dark);
	font-size: 0.92rem;
	font-weight: 800;
	line-height: 1.35;
	text-align: center;
	box-sizing: border-box;
}

.upload-status[hidden] {
	display: none;
}

.upload-status[data-mode="busy"] {
	background: #fff6f2;
	color: var(--rose-dark);
}

.upload-status[data-mode="success"] {
	background: rgba(217, 133, 96, 0.18);
	color: #8b4325;
}

.upload-status[data-mode="error"] {
	background: rgba(185, 67, 105, 0.16);
	color: #8f284a;
}

.audio-panel {
	width: min(100%, var(--content-panel-width)) !important;
	padding: clamp(20px, 3.4vw, 34px);
}

.audio-panel .wedding-logo {
	width: min(42vw, 168px);
	margin-bottom: 6px;
}

.audio-panel h1 {
	margin: 4px 0;
	font-size: clamp(2rem, 5vw, 3rem);
}

.audio-panel .intro {
	margin: 10px auto 18px;
	font-size: 0.98rem;
	line-height: 1.42;
}

.audio-panel + .site-footer {
	margin-top: 8px;
}

.audio-recorder {
	width: 100%;
	display: grid;
	gap: 10px;
	margin-top: 12px;
	padding: clamp(14px, 2.6vw, 20px);
	border: 1px solid rgba(185, 67, 105, 0.18);
	border-radius: 8px;
	background:
		linear-gradient(180deg, rgba(255, 246, 242, 0.94), rgba(255, 255, 255, 0.72)),
		radial-gradient(circle at 50% 0%, rgba(217, 133, 96, 0.16), transparent 56%);
	box-sizing: border-box;
}

.audio-timer {
	display: grid;
	place-items: center;
	width: min(100%, 240px);
	min-height: 68px;
	margin: 0 auto;
	border: 1px solid rgba(185, 67, 105, 0.16);
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.72);
	color: var(--rose-dark);
	font-family: Georgia, "Times New Roman", serif;
	font-size: clamp(2.1rem, 6vw, 3.25rem);
	font-weight: 700;
	line-height: 1;
	box-shadow: 0 12px 32px rgba(111, 70, 54, 0.1);
}

.audio-status {
	min-height: 34px;
	display: grid;
	place-items: center;
	color: var(--muted);
	font-weight: 800;
	line-height: 1.35;
	text-align: center;
}

.audio-status:empty {
	display: none;
}

.audio-status[data-mode="success"] {
	color: var(--rose-dark);
}

.audio-status[data-mode="error"] {
	color: #9f233b;
}

.audio-status[data-mode="busy"] {
	color: var(--ink);
}

.audio-controls {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	width: 100%;
}

.audio-decision-controls {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	width: 100%;
}

vaadin-button.audio-record-button,
vaadin-button.audio-stop-button,
vaadin-button.audio-send-button,
vaadin-button.audio-delete-button,
vaadin-button.audio-next-button {
	width: 100%;
	min-height: 46px;
	padding-inline: 18px;
	box-shadow: none;
}

vaadin-button.audio-record-button,
vaadin-button.audio-stop-button,
vaadin-button.audio-send-button,
vaadin-button.audio-next-button {
	color: white;
}

vaadin-button.audio-next-button {
	display: none;
	margin-top: 12px;
	background: linear-gradient(135deg, var(--terracotta), var(--rose));
}

vaadin-button.audio-record-button {
	background: linear-gradient(135deg, var(--terracotta), var(--rose));
}

vaadin-button.audio-stop-button {
	background: linear-gradient(135deg, var(--rose-dark), var(--rose));
}

vaadin-button.audio-send-button {
	background: linear-gradient(135deg, var(--terracotta), var(--rose));
}

vaadin-button.audio-delete-button {
	border: 1px solid rgba(185, 67, 105, 0.24);
	background: rgba(255, 255, 255, 0.72);
	color: var(--rose-dark);
}

vaadin-button.audio-record-button[disabled],
vaadin-button.audio-stop-button[disabled],
vaadin-button.audio-send-button[disabled],
vaadin-button.audio-delete-button[disabled],
vaadin-button.audio-next-button[disabled] {
	background: #e5ddd8;
	color: #8d7c72;
	box-shadow: none;
	cursor: not-allowed;
}

.audio-preview {
	width: 100%;
}

.audio-preview:empty {
	display: none;
}

.audio-preview audio {
	display: block;
	width: 100%;
	height: 44px;
}

.audio-thank-you-toast,
.photo-upload-toast {
	position: fixed;
	top: 50%;
	left: 50%;
	z-index: 1000;
	width: min(calc(100vw - 32px), 420px);
	padding: 16px 18px;
	border: 1px solid rgba(185, 67, 105, 0.24);
	border-radius: 8px;
	background: linear-gradient(135deg, var(--terracotta), var(--rose));
	box-shadow: 0 24px 70px rgba(111, 70, 54, 0.28);
	color: white;
	font-weight: 900;
	line-height: 1.35;
	text-align: center;
	opacity: 0;
	pointer-events: none;
	transform: translate(-50%, -44%) scale(0.98);
	transition: opacity 180ms ease, transform 180ms ease;
}

.audio-thank-you-toast.is-visible,
.photo-upload-toast.is-visible {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1);
}

.photo-upload-toast.is-error {
	background: linear-gradient(135deg, #8f284a, #6f1d3a);
}

.brand-line {
	color: var(--rose);
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.qr-link,
.back-link {
	min-height: 44px;
	border-radius: 8px;
	background: linear-gradient(135deg, var(--terracotta), var(--rose));
	color: white;
	font-weight: 800;
	text-decoration: none;
	display: inline-grid;
	place-items: center;
	padding: 0 20px;
}

.back-link {
	background: rgba(255, 255, 255, 0.62);
	border: 1px solid rgba(185, 67, 105, 0.22);
	box-shadow: 0 10px 24px rgba(185, 67, 105, 0.10);
	color: var(--rose-dark);
	margin-bottom: 12px;
}

.site-footer {
	display: flex;
	justify-content: center;
	gap: 18px;
	width: min(100%, var(--content-panel-width));
	margin-top: 14px;
	font-size: 0.9rem;
}

.site-footer a {
	color: rgba(255, 255, 255, 0.96);
	font-weight: 800;
	text-decoration: none;
	text-shadow: 0 1px 8px rgba(34, 32, 31, 0.3);
}

.gallery-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 24px;
}

.gallery-header h1 {
	font-size: clamp(2rem, 8vw, 4rem);
}

.gallery-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 14px;
}

.photo-card {
	overflow: hidden;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: #fff;
}

.photo-card img,
.photo-card video {
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	display: block;
	background: #111;
}

.photo-meta {
	display: grid;
	gap: 3px;
	padding: 10px 12px 12px;
	font-size: 0.86rem;
	color: var(--muted);
	text-align: left;
}

.legal-content {
	display: grid;
	gap: 16px;
	margin-top: 22px;
}

.legal-content h2 {
	margin: 0;
	color: var(--ink);
	font-size: 1.05rem;
}

.legal-content p {
	margin: 0;
}

.legal-content a {
	color: var(--rose-dark);
	font-weight: 800;
	text-decoration: none;
}

@media (max-width: 720px) {
	.rubric-nav {
		display: none;
	}
}

@media (min-width: 561px) {
	.upload-shell {
		padding: 10px 20px;
	}

	.upload-shell .upload-panel {
		padding: 34px 42px;
	}

	.upload-shell .wedding-logo {
		width: 132px;
		margin-bottom: 3px;
		filter: drop-shadow(0 10px 20px rgba(96, 55, 42, 0.1));
	}

	.upload-shell h1 {
		margin: 4px 0;
		font-size: clamp(2.2rem, 4.2vw, 2.95rem);
	}

	.upload-shell .date-line {
		font-size: 0.96rem;
	}

	.upload-shell .intro {
		margin: 8px auto 12px;
		font-size: 0.94rem;
		line-height: 1.32;
	}

	.upload-shell .name-field {
		margin-top: 0;
	}

	.upload-shell .photo-upload-control {
		margin-top: 8px;
	}

	.upload-shell .rubric-nav {
		gap: 9px;
		margin-top: 14px;
		padding-top: 12px;
	}

	.upload-shell .rubric-link {
		min-height: 56px;
		padding: 7px 8px;
	}

	.upload-shell .rubric-subtitle {
		font-size: 0.72rem;
	}

	.upload-shell + .site-footer {
		margin-top: 8px;
	}
}

@media (min-width: 561px) and (min-height: 821px) {
	.upload-shell .upload-panel {
		display: flex;
		flex-direction: column;
		justify-content: center;
		min-height: 724px;
	}

	.upload-shell .wedding-logo {
		width: 168px;
		margin-bottom: 8px;
	}
}

@media (min-width: 561px) and (max-height: 820px) {
	.audio-shell {
		padding: 12px 20px;
	}

	.audio-panel {
		padding: 22px 34px;
	}

	.audio-panel .wedding-logo {
		width: 132px;
		margin-bottom: 3px;
	}

	.audio-panel .brand-line {
		font-size: 0.7rem;
	}

	.audio-panel h1 {
		margin: 2px 0;
		font-size: 2.2rem;
	}

	.audio-panel .intro {
		margin: 7px auto 12px;
		font-size: 0.92rem;
		line-height: 1.32;
	}

	.audio-recorder {
		gap: 8px;
		margin-top: 8px;
		padding: 12px;
	}

	.audio-timer {
		min-height: 56px;
		font-size: 2.35rem;
	}

	.audio-status {
		min-height: 28px;
		font-size: 0.88rem;
	}

	vaadin-button.audio-record-button,
	vaadin-button.audio-stop-button,
	vaadin-button.audio-send-button,
	vaadin-button.audio-delete-button {
		min-height: 42px;
	}

	.audio-preview audio {
		height: 38px;
	}
}

@media (max-width: 560px) {
	html,
	body,
	#outlet {
		width: 100%;
		overflow-x: hidden;
	}

	.audio-thank-you-toast,
	.photo-upload-toast {
		left: 16px;
		right: 16px;
		width: auto;
		max-width: none;
		transform: translateY(-44%) scale(0.98);
	}

	.audio-thank-you-toast.is-visible,
	.photo-upload-toast.is-visible {
		transform: translateY(-50%) scale(1);
	}

	.page-shell,
	.gallery-shell,
	.legal-shell {
		width: 100%;
		padding: 8px;
		grid-template-columns: minmax(0, 1fr);
		justify-content: stretch;
		justify-items: stretch;
	}

	.upload-panel,
	.gallery-panel,
	.legal-panel {
		width: 100%;
		max-width: none;
		padding: 16px;
	}

	.wedding-logo {
		width: min(58vw, 185px);
		margin-bottom: 6px;
	}

	h1 {
		font-size: clamp(1.7rem, 8vw, 2.35rem);
	}

	.gallery-header {
		align-items: stretch;
		flex-direction: column;
	}

	.qr-link {
		width: 100%;
		box-sizing: border-box;
	}

	.rubric-nav {
		grid-template-columns: 1fr;
		gap: 8px;
		margin-top: 18px;
		padding-top: 14px;
	}

	.rubric-link {
		min-height: 58px;
	}

	.audio-controls {
		grid-template-columns: 1fr;
	}

	.audio-panel + .site-footer {
		display: none;
	}

	.audio-panel {
		width: 100%;
		max-width: none;
		justify-self: stretch;
		padding: 14px;
	}

	.audio-panel > *,
	.audio-name-field,
	.audio-recorder,
	.audio-controls,
	.audio-decision-controls,
	.audio-preview,
	vaadin-button.audio-next-button,
	vaadin-button.audio-record-button,
	vaadin-button.audio-stop-button,
	vaadin-button.audio-send-button,
	vaadin-button.audio-delete-button {
		width: 100%;
		max-width: none;
		box-sizing: border-box;
	}

	.audio-panel .wedding-logo {
		width: min(46vw, 145px);
		margin-bottom: 4px;
	}

	.audio-panel .brand-line {
		font-size: 0.7rem;
	}

	.audio-panel h1 {
		margin: 4px 0;
		font-size: clamp(1.45rem, 7vw, 2rem);
	}

	.audio-panel .intro {
		margin: 8px auto 14px;
		font-size: 0.92rem;
		line-height: 1.38;
	}

	vaadin-button.audio-next-button {
		display: block;
		min-height: 44px;
	}

	.audio-panel:not(.audio-step-recording) .audio-recorder {
		display: none;
	}

	.audio-panel.audio-step-recording .audio-name-field,
	.audio-panel.audio-step-recording .audio-next-button,
	.audio-panel.audio-step-recording .intro {
		display: none;
	}

	.audio-recorder {
		gap: 9px;
		margin-top: 10px;
		padding: 12px;
	}

	.audio-timer {
		width: min(100%, 180px);
		min-height: 58px;
		font-size: 2.35rem;
	}

	.audio-status {
		min-height: 34px;
		font-size: 0.9rem;
	}

	.audio-decision-controls {
		grid-template-columns: 1fr;
		gap: 8px;
	}

	vaadin-button.audio-record-button,
	vaadin-button.audio-stop-button,
	vaadin-button.audio-send-button,
	vaadin-button.audio-delete-button,
	vaadin-button.audio-next-button {
		min-height: 44px;
	}

	.audio-preview audio {
		height: 40px;
	}
}

@media (max-width: 560px) and (max-height: 740px) {
	.page-shell {
		align-content: center;
		padding: 6px;
	}

	.audio-panel {
		padding: 10px;
	}

	.audio-panel .wedding-logo {
		width: min(38vw, 112px);
		margin-bottom: 2px;
	}

	.audio-panel .brand-line {
		font-size: 0.66rem;
	}

	.audio-panel h1 {
		margin: 2px 0;
		font-size: clamp(1.25rem, 6.2vw, 1.7rem);
	}

	.audio-panel .intro {
		margin: 6px auto 10px;
		font-size: 0.84rem;
		line-height: 1.28;
	}

	.audio-recorder {
		gap: 7px;
		margin-top: 6px;
		padding: 9px;
	}

	.audio-timer {
		min-height: 48px;
		font-size: 2rem;
	}

	.audio-status {
		min-height: 28px;
		font-size: 0.82rem;
		line-height: 1.22;
	}

	vaadin-button.audio-record-button,
	vaadin-button.audio-stop-button,
	vaadin-button.audio-send-button,
	vaadin-button.audio-delete-button,
	vaadin-button.audio-next-button {
		min-height: 40px;
	}

	.audio-preview audio {
		height: 36px;
	}
}
