:root {
	--ink: #1f2933;
	--muted: #6b7280;
	--line: #d9dee3;
	--accent: #2563eb;
	--danger: #b91c1c;
	--bg: #f9fafb;
	/* the top bar's height */
	--topbar: 3.5rem;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	color: var(--ink);
	background: var(--bg);
}

/* the hidden attribute must win over the flex and grid display rules below */
[hidden] {
	display: none !important;
}

input,
select,
button {
	font: inherit;
	padding: 0.4rem 0.6rem;
	border: 1px solid var(--line);
	border-radius: 6px;
	background: #fff;
	color: var(--ink);
}

button {
	cursor: pointer;
	background: var(--accent);
	color: #fff;
	border-color: var(--accent);
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-weight: 700;
	font-size: 1.25rem;
	color: var(--ink);
	text-decoration: none;
}

.footer {
	text-align: center;
	color: var(--muted);
	font-size: 0.8rem;
	padding: 2rem 1rem;
}

.footer p {
	margin: 0.2rem 0;
}

.footer a {
	color: inherit;
}

.footer .inscription {
	font-size: 0.75rem;
}

/* ─── landing page ─────────────────────────────────────────────────────── */

.landing {
	min-height: 100vh;
	background: var(--bg);
}

.landing-grid {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 4fr);
	align-items: start;
	min-height: 100vh;
}

.scene {
	position: sticky;
	top: 0;
	height: 100vh;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	padding: 2.5rem;
	color: #fff;
	background:
		radial-gradient(60% 40% at 20% 20%, rgb(244 114 182 / 25%), transparent 70%),
		radial-gradient(50% 40% at 80% 80%, rgb(96 165 250 / 25%), transparent 70%),
		linear-gradient(160deg, #1e1b4b 0%, #312e81 45%, #0f172a 100%);
}

.scene-art {
	flex: 1;
	min-height: 0;
	width: 100%;
	object-fit: contain;
	object-position: center;
	filter: drop-shadow(0 20px 40px rgb(0 0 0 / 35%));
}

.scene-copy {
	position: relative;
	max-width: 30rem;
	padding: 1.25rem 1.5rem;
	border-radius: 16px;
	background: rgb(15 23 42 / 55%);
	backdrop-filter: blur(6px);
	box-shadow: 0 10px 40px rgb(0 0 0 / 30%);
}

.scene-kicker {
	margin: 0 0 0.5rem;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #c7d2fe;
}

.scene-copy h2 {
	margin: 0 0 0.5rem;
	font-size: 1.6rem;
	line-height: 1.2;
}

.scene-copy p {
	margin: 0;
	color: #e0e7ff;
}

.panel {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 2rem 1.5rem;
	background:
		radial-gradient(40% 30% at 100% 0%, rgb(99 102 241 / 8%), transparent 70%),
		var(--bg);
}

.card {
	width: 100%;
	max-width: 420px;
	padding: 2rem 2rem 1.5rem;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 20px;
	box-shadow: 0 20px 60px rgb(30 41 59 / 10%);
}

.brand-lg {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 1.1rem;
	letter-spacing: 0.02em;
	color: var(--muted);
}

.brand-mark {
	width: 26px;
	height: 26px;
}

.card h1 {
	margin: 1rem 0 0.25rem;
	font-size: 1.9rem;
	letter-spacing: -0.02em;
}

.lede {
	margin: 0 0 1.25rem;
	color: var(--muted);
}

/* the three ways in, one tile each: Google, GitHub, Email */
.methods {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 0.75rem;
	margin: 0 0 1rem;
}

.method {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	align-items: center;
	justify-content: center;
	padding: 1rem 0.5rem;
	color: var(--ink);
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 14px;
	cursor: pointer;
	transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.method img {
	width: 32px;
	height: 32px;
}

.method:hover,
.method[aria-expanded="true"] {
	border-color: var(--accent);
	box-shadow: 0 6px 16px rgb(37 99 235 / 14%);
}

.method:active {
	transform: translateY(1px);
}

.method:focus-visible,
.method:focus-within {
	outline: 3px solid rgb(37 99 235 / 35%);
	outline-offset: 2px;
}

.method.off {
	opacity: 0.45;
	cursor: not-allowed;
	box-shadow: none;
	transform: none;
	border-color: var(--line);
}

/* where Google signs in through its own button (drawn by its script), the button lies unseen over the Google tile and takes its clicks */
.gsi-button {
	position: absolute;
	inset: 0;
	overflow: hidden;
	border-radius: inherit;
	opacity: 0.01;
}

/* Google's button is 200 by 40: three times that covers the tile */
.gsi-button > div {
	transform: scale(3);
	transform-origin: 0 0;
}

.method.off .gsi-button {
	display: none;
}

.email-form[hidden] {
	display: none;
}

.email-form {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.field {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--ink);
}

.field input {
	width: 100%;
	padding: 0.65rem 0.8rem;
	font-weight: 400;
	border-radius: 10px;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgb(37 99 235 / 18%);
}

.password-field {
	position: relative;
	display: block;
}

.password-field input {
	padding-right: 4rem;
}

.password-field .link {
	position: absolute;
	top: 50%;
	right: 0.5rem;
	transform: translateY(-50%);
	font-size: 0.8rem;
}

button.link {
	padding: 0.2rem 0.4rem;
	background: none;
	border: none;
	color: var(--accent);
	font-weight: 600;
}

button.link:hover {
	text-decoration: underline;
}

button.primary {
	margin-top: 0.25rem;
	padding: 0.7rem 1rem;
	font-weight: 600;
	border-radius: 10px;
	background: linear-gradient(135deg, #4f46e5, #2563eb);
	border-color: transparent;
	box-shadow: 0 6px 16px rgb(37 99 235 / 25%);
	transition: transform 0.1s, box-shadow 0.15s;
}

button.primary:hover {
	box-shadow: 0 8px 22px rgb(37 99 235 / 35%);
}

button.primary:active {
	transform: translateY(1px);
}

button:disabled {
	opacity: 0.6;
	cursor: wait;
}

.hint {
	margin: 0;
	font-size: 0.85rem;
	color: var(--muted);
}

.notice {
	margin: 0;
	padding: 0.6rem 0.8rem;
	border-radius: 10px;
	background: #eff6ff;
	color: #1e40af;
	font-size: 0.9rem;
}

.hint[hidden],
.notice[hidden],
.field[hidden] {
	display: none;
}

.switch {
	margin: 0;
	font-size: 0.85rem;
	text-align: center;
	color: var(--muted);
}

.dev-login {
	margin-top: 1.5rem;
	padding: 0.75rem 1rem;
	border: 1px dashed var(--line);
	border-radius: 10px;
	font-size: 0.85rem;
	color: var(--muted);
}

.dev-row {
	display: flex;
	gap: 0.5rem;
	margin-top: 0.5rem;
}

.dev-row input {
	flex: 1;
	min-width: 0;
}

.dev-row button {
	white-space: nowrap;
}

.warning {
	color: var(--danger);
}

.card .warning {
	margin: 0 0 1rem;
	padding: 0.6rem 0.8rem;
	border-radius: 10px;
	background: #fef2f2;
	border: 1px solid #fecaca;
	font-size: 0.9rem;
}

.landing .footer {
	padding: 1.5rem 0 0;
}

/* ─── a page of text ───────────────────────────────────────────────────── */

.prose {
	max-width: 42rem;
	margin: 0 auto;
	padding: 2rem 1.5rem;
	line-height: 1.6;
}

.prose h1 {
	margin: 1.5rem 0 0.5rem;
}

.prose h2 {
	margin: 1.5rem 0 0.25rem;
	font-size: 1.15rem;
}

.prose li {
	margin-bottom: 0.5rem;
}

/* ─── products page ────────────────────────────────────────────────────── */

.topbar {
	position: sticky;
	top: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	gap: 1rem;
	min-height: var(--topbar);
	padding: 0.4rem 1rem;
	background: #fff;
	border-bottom: 1px solid var(--line);
}

.search {
	display: flex;
	flex: 1;
	gap: 0.4rem;
	max-width: 34rem;
	min-width: 0;
}

.search input {
	flex: 1;
	min-width: 0;
}

.reading {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem;
	margin: 0 0 0.75rem;
	font-size: 0.9rem;
	color: var(--muted);
}

.chip {
	padding: 0.15rem 0.6rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: #fff;
	color: var(--ink);
}

.chip-label {
	color: var(--muted);
}

.type-filter {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.9rem;
	color: var(--muted);
}

.whoami {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 0.6rem;
	min-width: 0;
}

.whoami button {
	white-space: nowrap;
}

.avatar {
	width: 28px;
	height: 28px;
	border-radius: 50%;
}

/* the account menu: the avatar and name open it */
.account {
	position: relative;
	min-width: 0;
}

.account-button {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	max-width: 100%;
	border: 0;
	background: transparent;
	color: inherit;
	padding: 0.2rem 0.4rem;
	border-radius: 999px;
}

.account-button span {
	overflow: hidden;
	text-overflow: ellipsis;
}

.account-button .badge {
	flex: none;
}

.account-button:hover,
.account-button[aria-expanded="true"] {
	background: #f3f4f6;
}

.account-menu {
	position: absolute;
	right: 0;
	top: calc(100% + 0.4rem);
	z-index: 20;
	min-width: 18rem;
	padding: 0.75rem 1rem;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 8px;
	box-shadow: 0 6px 20px rgb(0 0 0 / 12%);
}

.account-details {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 0.35rem 1rem;
	margin: 0;
	font-size: 0.9rem;
}

.account-details dt {
	color: var(--muted);
	white-space: nowrap;
}

.account-details dd {
	margin: 0;
	/* an id or an email is never split over two lines: the menu widens instead */
	white-space: nowrap;
}

/* every way the person signs in, under the details */
.account-heading {
	margin: 0.9rem 0 0.5rem;
	padding-top: 0.75rem;
	font-size: 0.85rem;
	border-top: 1px solid var(--line);
}

.account-logins {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.account-login {
	display: flex;
	gap: 0.6rem;
	align-items: flex-start;
}

.login-icon {
	flex: none;
	width: 20px;
	height: 20px;
	margin-top: 0.1rem;
}

.account-login-name {
	display: flex;
	gap: 0.4rem;
	align-items: center;
	font-weight: 600;
	font-size: 0.9rem;
}

.account-login-meta,
.account-note {
	color: var(--muted);
	font-size: 0.8rem;
	/* an id or an email is never split over two lines: the menu widens instead */
	white-space: nowrap;
}

.account-note {
	max-width: 22rem;
	margin: 0.75rem 0 0;
	line-height: 1.4;
	white-space: normal;
}

.badge {
	padding: 0.05rem 0.45rem;
	border-radius: 999px;
	background: #e8eefc;
	color: var(--accent);
	font-size: 0.7rem;
	font-weight: 600;
}

/* on a phone the name is not at the right edge: the panel spans the screen under the top bar */
@media (width <= 600px) {
	.account {
		position: static;
	}

	.account-menu {
		position: fixed;
		top: 3.5rem;
		right: 1rem;
		left: 1rem;
		min-width: 0;
		overflow-x: auto;
	}

	/* the top bar's Settings and Sign out keep only their icons */
	.button-label {
		display: none;
	}
}

.whoami form {
	display: flex;
}

button.with-icon {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}

/* the top bar's Settings and Sign out: quiet, like the account button beside them */
.topbar button.with-icon {
	padding: 0.3rem 0.6rem;
	color: var(--ink);
	background: transparent;
	border: 1px solid var(--line);
	border-radius: 999px;
}

.topbar button.with-icon:hover {
	background: #f3f4f6;
}

/* the admin's Users link: a link that looks like the buttons beside it */
.topbar-link {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.3rem 0.6rem;
	color: var(--ink);
	font-size: 0.9rem;
	text-decoration: none;
	white-space: nowrap;
	border: 1px solid var(--line);
	border-radius: 999px;
}

.topbar-link:hover,
.topbar-link.current {
	background: #f3f4f6;
}

.topbar-link .login-icon {
	margin-top: 0;
}

button.with-icon .login-icon,
.account-button .login-icon {
	margin-top: 0;
}

/* the settings dialog: one field, its hint under it */
.settings {
	width: min(28rem, calc(100vw - 2rem));
	padding: 1.5rem;
	border: none;
	border-radius: 20px;
	background: #fff;
	color: var(--ink);
	box-shadow: 0 20px 60px rgb(30 41 59 / 25%);
}

.settings::backdrop {
	background: rgb(15 23 42 / 45%);
}

.settings h2 {
	margin: 0 0 0.75rem;
	font-size: 1.4rem;
}

.settings label {
	display: block;
	margin-bottom: 0.3rem;
	font-weight: 600;
}

.settings input {
	width: 100%;
}

.settings-hint {
	margin: 0.5rem 0 0;
	font-size: 0.85rem;
	color: var(--muted);
}

.dialog-actions {
	display: flex;
	justify-content: flex-end;
	gap: 0.5rem;
	margin-top: 1.25rem;
}

button.text {
	background: none;
	border-color: transparent;
	color: var(--accent);
}

.content {
	max-width: 1100px;
	margin: 0 auto;
	padding: 1rem 1rem 0;
}

/* the Users page (admins only) */
.page-title {
	margin: 0.5rem 0 0.25rem;
	font-size: 1.4rem;
}

/* a wide table scrolls on its own on a phone, never the page */
.table-scroll {
	overflow-x: auto;
}

.users {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9rem;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 8px;
}

.users th,
.users td {
	padding: 0.5rem 0.75rem;
	text-align: left;
	white-space: nowrap;
	border-top: 1px solid var(--line);
}

.users th {
	font-weight: 600;
	color: var(--muted);
	border-top: 0;
}

.users td.title {
	font-weight: 600;
}

/* a cell of several things in a row (a name and its badge, the sign-in icons): the cell itself stays a table cell */
.users .cell-row {
	display: inline-flex;
	gap: 0.4rem;
	align-items: center;
	vertical-align: middle;
}

.users .cell-row .login-icon {
	margin-top: 0;
}

.count {
	margin: 0 0 0.75rem;
	color: var(--muted);
	font-size: 0.9rem;
}

.empty {
	padding: 2rem 1rem;
	text-align: center;
	color: var(--muted);
}

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

.product-card {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	padding: 0 0 0.75rem;
	overflow: hidden;
	text-align: left;
	background: #fff;
	color: var(--ink);
	border: 1px solid var(--line);
	border-radius: 12px;
}

.product-card:hover,
.product-card:focus-visible {
	border-color: var(--accent);
	box-shadow: 0 6px 18px rgb(30 41 59 / 10%);
}

.product-card img {
	width: 100%;
	aspect-ratio: 3 / 4;
	object-fit: cover;
	background: #eef0f4;
	margin-bottom: 0.4rem;
}

.product-card span {
	padding: 0 0.75rem;
}

.product-type {
	margin: 0;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--muted);
}

.product-name {
	font-weight: 600;
}

.price {
	font-variant-numeric: tabular-nums;
}

.pager {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	margin-top: 1.5rem;
	color: var(--muted);
	font-size: 0.9rem;
}

.product-dialog {
	width: min(820px, calc(100vw - 2rem));
	max-height: calc(100vh - 2rem);
	padding: 1.25rem;
	border: 1px solid var(--line);
	border-radius: 16px;
	color: var(--ink);
	box-shadow: 0 20px 60px rgb(30 41 59 / 25%);
}

.product-dialog::backdrop {
	background: rgb(15 23 42 / 45%);
}

.dialog-close {
	display: flex;
	justify-content: flex-end;
}

.dialog-close button {
	padding: 0 0.5rem;
	font-size: 1.4rem;
	line-height: 1.4;
	background: none;
	border: none;
	color: var(--muted);
}

.product-body {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
	gap: 1.25rem;
}

.product-photo {
	margin: 0;
}

.product-photo img {
	width: 100%;
	border-radius: 10px;
	background: #eef0f4;
}

.product-photo figcaption {
	margin-top: 0.4rem;
	font-size: 0.75rem;
	color: var(--muted);
	overflow-wrap: anywhere;
}

.product-photo a {
	color: inherit;
}

.product-facts h2 {
	margin: 0.2rem 0 0.4rem;
	font-size: 1.4rem;
}

.product-facts .price {
	margin: 0 0 1rem;
	font-size: 1.15rem;
}

.attrs {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9rem;
}

.attrs th,
.attrs td {
	padding: 0.4rem 0;
	text-align: left;
	border-top: 1px solid var(--line);
}

.attrs th {
	width: 45%;
	font-weight: 400;
	color: var(--muted);
}

@media (max-width: 900px) {
	.landing-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.scene {
		position: static;
		height: auto;
		padding: 1.5rem;
	}

	.scene-art {
		flex: none;
		height: 300px;
	}

	.scene-copy h2 {
		font-size: 1.25rem;
	}

	.card {
		padding: 1.5rem 1.25rem;
	}
}

@media (max-width: 640px) {
	.product-body {
		grid-template-columns: minmax(0, 1fr);
	}

	.topbar {
		flex-wrap: wrap;
	}

	.search {
		order: 3;
		flex-basis: 100%;
		max-width: none;
	}

	.type-filter span {
		display: none;
	}
}
