/*
 * GetOnTop — main stylesheet.
 *
 * 1. Fonts and tokens   2. Base      3. Header   4. Hero
 * 5. Notes              6. Builder   7. Private sessions
 * 8. Report dialog and notices      9. Footer   10. Motion   11. Small screens
 */

/* 1. Fonts and tokens ------------------------------------------------ */

@font-face {
	font-family: "Inter";
	src: url("../fonts/inter-latin-var.woff2") format("woff2");
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Roboto Mono";
	src: url("../fonts/roboto-mono-latin-700.woff2") format("woff2");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

/*
 * Arabic script in notes: monospace system fonts stretch it, so these characters (and only these)
 * use the device's own Arabic font. Nothing is downloaded; other scripts keep the note font.
 */
@font-face {
	font-family: "Note Arabic";
	src: local("Segoe UI"), local("SegoeUI"), local("Geeza Pro"), local("GeezaPro"), local("Noto Naskh Arabic"), local("NotoNaskhArabic-Regular"), local("Noto Sans Arabic"), local("Tahoma");
	unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF;
	font-weight: 400;
	font-display: swap;
}

:root {
	color-scheme: light;

	--ontop-paper: #ffffff;
	--ontop-ink: #111111;
	--ontop-muted: #5f6368;
	--ontop-line: #dddddd;
	--ontop-chrome: #111111;
	--ontop-chrome-ink: #ffffff;
	--ontop-chrome-muted: #b3b3b3;

	--ontop-note: #f3f3f3;
	--ontop-note-ink: #000000;
	--ontop-note-muted: #6b6b6b;

	--ontop-accent: #005148;
	--ontop-accent-hover: #003832;
	--ontop-accent-ink: #ffffff;
	--ontop-accent-text: #005148;
	--ontop-error: #b42318;

	/* Brand green from the logo; header band and footer keep it in both modes. */
	--ontop-brand: #005148;
	--ontop-brand-hover: #00665b;
	--ontop-logo-accent-on-dark: #5cc2b3;

	--ontop-stripe: #635bff;
	--ontop-stripe-hover: #5047e5;

	--ontop-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--ontop-mono: "Roboto Mono", "Note Arabic", ui-monospace, Menlo, Consolas, monospace;

	--ontop-width: 672px;
	--ontop-radius: 12px;
	--ontop-header-height: 72px;
	--ontop-sticky-offset: 150px;
	--ontop-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

:root[data-theme="dark"] {
	color-scheme: dark;

	--ontop-paper: #0a0a0a;
	--ontop-ink: #f2f2f2;
	--ontop-muted: #a3a3a3;
	--ontop-line: #2a2a2a;
	--ontop-chrome: #000000;
	--ontop-note: #ececec;
	--ontop-accent-text: #5cc2b3;
	--ontop-error: #ff8a80;
}

/* 2. Base ------------------------------------------------------------ */

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

html {
	scroll-padding-top: calc(var(--ontop-sticky-offset) + 16px);
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--ontop-paper);
	color: var(--ontop-ink);
	font-family: var(--ontop-font);
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	-webkit-tap-highlight-color: transparent;
}

::selection {
	background: var(--ontop-accent);
	color: var(--ontop-accent-ink);
}

a {
	color: inherit;
	text-decoration: none;
}

button,
input,
textarea {
	font: inherit;
	color: inherit;
}

button {
	cursor: pointer;
}

svg {
	display: block;
}

:focus-visible {
	outline: 2px solid var(--ontop-accent-text);
	outline-offset: 3px;
}

[tabindex="-1"]:focus {
	outline: none;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 2000;
	padding: 10px 16px;
	border-radius: 8px;
	background: var(--ontop-accent);
	color: var(--ontop-accent-ink);
	font-weight: 700;
	transform: translateY(-200%);
}

.skip-link:focus {
	transform: none;
}

.site-main {
	min-height: 60vh;
}

/* 3. Header ---------------------------------------------------------- */

.site-header {
	position: sticky;
	top: 0;
	z-index: 1000;
	background: var(--ontop-chrome);
	color: var(--ontop-chrome-ink);
	--ontop-logo-accent: var(--ontop-logo-accent-on-dark);
	--ontop-accent-text: var(--ontop-logo-accent-on-dark); /* focus ring visible on black */
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	width: min(100% - 32px, 1400px);
	min-height: var(--ontop-header-height);
	margin: 0 auto;
}

/* The logo's arrow sits above the letters and ".site" hangs below, so the box is taller than the word. */
.site-logo {
	display: block;
	flex: none;
	padding: 4px 0;
	color: #ffffff;
}

.site-logo__image {
	width: auto;
	height: 52px;
}

.site-header__actions {
	display: flex;
	align-items: center;
	gap: 4px;
}

.icon-button {
	display: inline-grid;
	place-items: center;
	min-width: 44px;
	height: 44px;
	padding: 0 8px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--ontop-chrome-muted);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.04em;
}

.icon-button:hover {
	background: rgba(255, 255, 255, 0.08);
	color: var(--ontop-chrome-ink);
}

.icon-button svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.theme-toggle__moon {
	fill: currentColor;
}

.theme-toggle__sun,
[data-theme="dark"] .theme-toggle__moon {
	display: none;
}

[data-theme="dark"] .theme-toggle__sun {
	display: block;
}

.header-cta {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	margin-left: 8px;
	padding: 0 20px;
	border-radius: 8px;
	background: var(--ontop-brand);
	color: #ffffff;
	font-size: 14px;
	font-weight: 700;
	white-space: nowrap;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.header-cta:hover {
	background: var(--ontop-brand-hover);
}

/* 4. Hero ------------------------------------------------------------ */

/* The brand band under the header: the same green as the logo, in light and dark mode alike. */
.hero {
	position: sticky;
	top: var(--ontop-header-height);
	z-index: 900;
	padding: 12px 16px;
	background: var(--ontop-brand);
	color: #ffffff;
	box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

.hero__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 6px clamp(16px, 3vw, 40px);
	max-width: 1400px;
	margin: 0 auto;
	text-align: center;
}

.hero__slogan {
	margin: 0;
	color: rgba(255, 255, 255, 0.82);
	font-size: clamp(14px, 1.4vw, 16px);
	font-weight: 600;
	letter-spacing: -0.005em;
}

.hero__claim {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 4px 10px;
	margin: 0;
	color: #ffffff;
	font-size: clamp(16px, 1.8vw, 20px);
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

/* The price reads like the notes: black monospace on white. */
.hero__price {
	padding: 3px 10px;
	border-radius: 6px;
	background: #ffffff;
	color: #000000;
	font-family: var(--ontop-mono);
	font-size: 0.92em;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0;
}

/* Private sessions: the notice rides in the sticky hero, so it is on screen at every scroll position. */
.hero--private {
	padding-bottom: 0;
}

.hero__private {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: center;
	gap: 2px 10px;
	margin: 12px -16px 0;
	padding: 7px 16px;
	background: rgba(0, 0, 0, 0.4);
	color: #ffffff;
	font-size: 12px;
	line-height: 1.4;
	text-align: center;
}

.hero__private strong {
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

/* 5. Notes ----------------------------------------------------------- */

.board {
	min-width: 0;
	padding: 28px 0 96px;
}

.board__list {
	display: grid;
	gap: 15px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.board__empty {
	padding: 40px 20px;
	border: 1px dashed var(--ontop-line);
	border-radius: var(--ontop-radius);
	color: var(--ontop-muted);
	text-align: center;
}

.note {
	position: relative;
	height: 155px;
	margin: 0;
	padding: 18px 20px 34px;
	border: 1px solid var(--ontop-line);
	border-radius: var(--ontop-radius);
	background: var(--ontop-note);
	color: var(--ontop-note-ink);
	overflow: hidden;
}

.note__text {
	display: flex;
	flex-direction: column;
	justify-content: center;
	height: 100%;
	font-family: var(--ontop-mono);
	font-size: 18px;
	font-weight: 700;
	line-height: 24px;
	text-align: center;
	overflow-wrap: anywhere;
}

.note__text > div {
	min-height: 24px;
	/* Each line takes the direction of its own text: Arabic and Hebrew read right to left. */
	unicode-bidi: plaintext;
}

.note__rank,
.note__price {
	position: absolute;
	bottom: 8px;
	font-size: 13px;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	line-height: 1;
}

.note__rank {
	left: 14px;
	bottom: 14px;
	color: var(--ontop-note-muted);
}

.note__price {
	right: 14px;
	bottom: 14px;
	color: var(--ontop-accent);
}

.note__push {
	right: 6px;
	bottom: 4px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 32px;
	padding: 0 8px;
	border: 1px solid transparent;
	border-radius: 8px;
	background: transparent;
}

.note__push::after {
	content: "";
	position: absolute;
	inset: -6px -4px;
}

.note__push svg {
	width: 14px;
	height: 14px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.note__push:hover {
	border-color: currentColor;
	background: var(--ontop-paper);
}

.note__meta {
	position: absolute;
	left: 8px;
	bottom: 4px;
	display: flex;
	align-items: center;
	gap: 4px;
	min-height: 32px;
}

.note__meta .note__rank {
	position: static;
	padding: 0 4px 0 6px;
}

.note__private {
	padding: 4px 7px;
	border-radius: 6px;
	background: var(--ontop-note-ink);
	color: var(--ontop-note);
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.06em;
	line-height: 1;
	text-transform: uppercase;
}

.note__report {
	position: relative;
	display: none;
	place-items: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--ontop-note-muted);
}

/* 44 px touch target around the 32 px button. */
.has-dialog .note__report {
	display: grid;
}

.note__report::after {
	content: "";
	position: absolute;
	inset: -6px;
}

.note__report svg {
	width: 15px;
	height: 15px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.note__report:hover {
	background: rgba(0, 0, 0, 0.06);
	color: #b42318;
}

.note__report:focus-visible {
	outline-color: var(--ontop-accent);
}

/* A hidden note never prints its text: these bars stand in for it. */
.note__redacted {
	align-items: center;
	gap: 10px;
}

.note__redacted > div {
	width: 62%;
	height: 12px;
	border-radius: 6px;
	background: var(--ontop-note-ink);
	opacity: 0.18;
	filter: blur(4px);
}

.note__redacted > div:nth-child(2) {
	width: 78%;
}

.note__redacted > div:nth-child(3) {
	width: 44%;
}

.note__hidden-label {
	position: absolute;
	top: 50%;
	left: 50%;
	margin: 0;
	padding: 6px 12px;
	border-radius: 6px;
	background: var(--ontop-error);
	color: #ffffff;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	transform: translate(-50%, -60%);
}

[data-theme="dark"] .note__hidden-label {
	background: #b42318;
}

.note.is-new {
	border-color: var(--ontop-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--ontop-accent) 35%, transparent);
}

/* 6. Builder --------------------------------------------------------- */

.builder {
	display: grid;
	gap: 10px;
	margin-top: 40px;
	padding-top: 8px;
	text-align: center;
}

.builder__brand {
	margin: 0;
	font-size: 32px;
	font-weight: 900;
	letter-spacing: -0.04em;
	line-height: 1;
}

.builder__title {
	margin: 0 0 6px;
	font-size: 28px;
	font-weight: 900;
	letter-spacing: -0.03em;
	line-height: 1.1;
	text-wrap: balance;
}

.builder__form {
	display: grid;
	gap: 10px;
}

.note--editor {
	margin: 0;
	border: 2px solid var(--ontop-accent);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	min-inline-size: 0;
}

.note__lines {
	gap: 0;
}

.note__line {
	width: 100%;
	height: 24px;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: transparent;
	color: var(--ontop-note-ink);
	font: 700 18px/24px var(--ontop-mono);
	text-align: center;
	caret-color: var(--ontop-accent);
}

.note__line:focus-visible {
	outline: 2px solid var(--ontop-accent);
	outline-offset: 0;
	background: rgba(0, 81, 72, 0.08);
}

.note__line[readonly] {
	cursor: default;
}

[data-mode="push"] .note--editor {
	border-style: dashed;
}

.builder__hint {
	margin: -2px 0 6px;
	color: var(--ontop-muted);
	font-size: 12px;
}

.builder__label {
	margin: 4px 0 0;
	font-size: 15px;
	font-weight: 800;
	letter-spacing: -0.01em;
	text-transform: uppercase;
}

.amount-field {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	height: 52px;
	border: 1px solid #c4c4c4;
	border-radius: 8px;
	background: #ffffff;
	color: #000000;
}

.amount-field:focus-within {
	border-color: var(--ontop-accent);
	box-shadow: 0 0 0 3px rgba(0, 81, 72, 0.18);
}

.amount-field__currency {
	font-size: 20px;
	font-weight: 900;
}

.amount-field input {
	width: 7ch;
	padding: 0;
	border: 0;
	background: transparent;
	color: #000000;
	font-size: 20px;
	font-weight: 900;
	font-variant-numeric: tabular-nums;
	outline: none;
	-moz-appearance: textfield;
	appearance: textfield;
}

.amount-field input::-webkit-outer-spin-button,
.amount-field input::-webkit-inner-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

.amount-field input::placeholder {
	color: #6b6b6b;
}

.position {
	display: grid;
	place-items: center;
	min-height: 52px;
	margin: 0;
	padding: 10px 16px;
	border-radius: 8px;
	background: var(--ontop-accent);
	color: var(--ontop-accent-ink);
	font-size: 14px;
	font-weight: 700;
	text-wrap: balance;
}

.position[data-tone="error"] {
	background: var(--ontop-error);
	color: #ffffff;
}

[data-theme="dark"] .position[data-tone="error"] {
	background: #b42318;
}

.consent {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	min-height: 44px;
	padding: 12px 14px;
	border: 1px solid var(--ontop-line);
	border-radius: 8px;
	font-size: 13px;
	line-height: 1.45;
	text-align: left;
	cursor: pointer;
}

.consent:has(.consent__box:checked) {
	border-color: var(--ontop-accent-text);
}

.consent__box {
	flex: none;
	width: 20px;
	height: 20px;
	margin: 0;
	accent-color: var(--ontop-accent);
	cursor: pointer;
}

.consent__box:focus-visible {
	outline: 2px solid var(--ontop-accent-text);
	outline-offset: 2px;
}

.consent a {
	color: var(--ontop-accent-text);
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.pay {
	display: grid;
	gap: 8px;
}

.pay__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 50px;
	padding: 0 14px;
	border: 0;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 700;
	transition: transform 160ms var(--ontop-ease), filter 160ms var(--ontop-ease);
}

.pay__button:active {
	transform: scale(0.98);
}

.pay__button:disabled {
	cursor: progress;
	opacity: 0.6;
}

.pay__hint {
	margin: 0;
	color: var(--ontop-muted);
	font-size: 13px;
	line-height: 1.4;
	text-align: center;
	text-wrap: balance;
}

.pay__button--stripe {
	background: var(--ontop-stripe);
	color: #ffffff;
}

.pay__button--stripe:hover {
	background: var(--ontop-stripe-hover);
}

.pay__button svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.pay__via {
	padding-left: 8px;
	border-left: 1px solid rgba(255, 255, 255, 0.4);
	font-size: 13px;
	font-weight: 600;
}

.invoice-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 46px;
	border: 1.5px solid #000000;
	border-radius: 8px;
	background: #ffffff;
	color: #000000;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
}

.invoice-button:hover {
	background: #f3f3f3;
}

.invoice-button svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.6;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.builder__status {
	min-height: 1.5em;
	margin: 0;
	font-size: 14px;
	font-weight: 700;
}

.builder__status[data-tone="error"] {
	color: var(--ontop-error);
}

.builder__test {
	margin: -6px 0 0;
	color: var(--ontop-muted);
	font-size: 12px;
}

.builder__actions {
	display: grid;
	justify-items: center;
	gap: 6px;
	margin-top: 6px;
}

.builder__cancel {
	min-height: 44px;
	padding: 0 12px;
	border: 0;
	background: transparent;
	color: var(--ontop-accent-text);
	font-size: 14px;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.back-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 200px;
	min-height: 46px;
	padding: 0 24px;
	border-radius: 8px;
	background: var(--ontop-accent);
	color: var(--ontop-accent-ink);
	font-size: 14px;
	font-weight: 800;
	box-shadow: 0 4px 12px rgba(0, 81, 72, 0.3);
}

.back-button:hover {
	background: var(--ontop-accent-hover);
}

.back-button svg {
	width: 16px;
	height: 16px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.board-unavailable,
.not-found {
	padding: 80px 16px;
	text-align: center;
}

.not-found h1 {
	margin: 0 0 8px;
	font-size: clamp(32px, 6vw, 48px);
	font-weight: 900;
	letter-spacing: -0.04em;
}

.not-found p {
	margin: 0 0 24px;
	color: var(--ontop-muted);
}

/* 7. Private sessions ------------------------------------------------ */

.board-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	width: min(100% - 32px, var(--ontop-width));
	margin: 0 auto;
}

.sessions {
	display: grid;
	gap: 12px;
	align-content: start;
	padding-top: 24px;
}

.sessions__title {
	margin: 0;
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0.04em;
	line-height: 1.2;
	text-transform: uppercase;
}

.sessions__lead {
	margin: -8px 0 0;
	color: var(--ontop-muted);
	font-size: 13px;
}

.sessions__buttons {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.sessions__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 50px;
	padding: 0 18px;
	border: 1.5px solid var(--ontop-accent);
	border-radius: 14px;
	font-size: 15px;
	font-weight: 800;
	letter-spacing: -0.01em;
	line-height: 1.15;
	text-align: center;
}

.sessions__button--create {
	background: var(--ontop-accent);
	color: var(--ontop-accent-ink);
}

.sessions__button--create:hover {
	border-color: var(--ontop-accent-hover);
	background: var(--ontop-accent-hover);
}

.sessions__button--create[aria-busy="true"] {
	cursor: progress;
	opacity: 0.7;
}

.sessions__button--join {
	background: #ffffff;
	color: var(--ontop-accent);
}

.sessions__button--join:hover,
.sessions__button--join[aria-expanded="true"] {
	background: #e6f1ef;
}

.sessions__status {
	min-height: 0;
	margin: 0;
	font-size: 13px;
	font-weight: 700;
}

.sessions__status:empty {
	display: none;
}

.sessions__status[data-tone="error"] {
	color: var(--ontop-error);
}

/* Join form (home and "session doesn't exist" page) */
.join {
	display: grid;
	gap: 6px;
	text-align: left;
}

.join[hidden] {
	display: none;
}

.join__label {
	font-size: 13px;
	font-weight: 700;
}

.join__field {
	display: flex;
	min-width: 0;
	border: 1px solid #c4c4c4;
	border-radius: 10px;
	background: #ffffff;
	overflow: hidden;
}

.join__field:focus-within {
	border-color: var(--ontop-accent);
	box-shadow: 0 0 0 3px rgba(0, 81, 72, 0.18);
}

.join__field input {
	flex: 1;
	min-width: 0;
	height: 46px;
	padding: 0 12px;
	border: 0;
	background: transparent;
	color: #000000;
	font: 700 16px/1 var(--ontop-mono);
	letter-spacing: 0.04em;
	text-transform: uppercase;
	outline: none;
}

.join__field input::placeholder {
	color: #767676;
	text-transform: none;
}

.join__field button {
	flex: none;
	min-width: 72px;
	padding: 0 14px;
	border: 0;
	background: var(--ontop-accent);
	color: var(--ontop-accent-ink);
	font-size: 14px;
	font-weight: 800;
}

.join__field button:hover {
	background: var(--ontop-accent-hover);
}

.join__hint {
	margin: 0;
	color: var(--ontop-muted);
	font-size: 12px;
}

.join__hint[data-tone="error"] {
	color: var(--ontop-error);
	font-weight: 700;
}

/* Recent sessions, remembered by this browser only */
.sessions__recent h3 {
	margin: 4px 0 2px;
	color: var(--ontop-muted);
	font-size: 12px;
	font-weight: 700;
}

.sessions__recent ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sessions__recent a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--ontop-accent-text);
	font: 700 14px/1 var(--ontop-mono);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 4px;
}

/* Inside a session: invite the group */
.sessions__back {
	justify-self: start;
	padding-inline: 22px;
}

.invite {
	display: grid;
	gap: 8px;
	padding-top: 6px;
}

.invite__code {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin: 0;
	padding: 2px 2px 2px 14px;
	border: 1px solid var(--ontop-line);
	border-radius: 10px;
}

.invite__value {
	font: 700 18px/1 var(--ontop-mono);
	letter-spacing: 0.06em;
	font-variant-numeric: tabular-nums;
	user-select: all;
}

.invite__reveal {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--ontop-muted);
}

.invite__reveal:hover {
	background: color-mix(in srgb, var(--ontop-ink) 7%, transparent);
	color: var(--ontop-ink);
}

.invite__reveal svg,
.invite__copy svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.invite__eye-off,
.invite__reveal[aria-pressed="true"] .invite__eye {
	display: none;
}

.invite__reveal[aria-pressed="true"] .invite__eye-off {
	display: block;
}

.invite__copy {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 46px;
	padding: 0 16px;
	border: 1.5px solid var(--ontop-accent);
	border-radius: 10px;
	background: #ffffff;
	color: var(--ontop-accent);
	font-size: 14px;
	font-weight: 800;
}

.invite__copy:hover {
	background: #e6f1ef;
}

.invite__copy:not(.invite__copy--link) {
	justify-self: start;
	padding-inline: 4px;
	border-color: transparent;
	background: transparent;
	color: var(--ontop-accent-text);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.invite__copy:not(.invite__copy--link):hover {
	background: transparent;
	color: var(--ontop-ink);
}

/* Session title and closing date */
.session-head {
	margin-bottom: 20px;
	text-align: center;
}

.session-head__title {
	margin: 0;
	font-size: clamp(28px, 4vw, 36px);
	font-weight: 900;
	letter-spacing: -0.03em;
	line-height: 1.1;
}

.session-head__closes {
	max-width: 52ch;
	margin: 6px auto 0;
	color: var(--ontop-muted);
	font-size: 14px;
	text-wrap: balance;
}

.session-head__closes time {
	color: var(--ontop-ink);
	font-weight: 700;
	white-space: nowrap;
}

/* Wrong code, closed session or paused connection */
.session-missing {
	display: grid;
	justify-items: center;
	gap: 16px;
	width: min(100% - 32px, 480px);
	margin: 0 auto;
	padding: 72px 0 96px;
	text-align: center;
}

.session-missing h1 {
	margin: 0;
	font-size: clamp(30px, 6vw, 44px);
	font-weight: 900;
	letter-spacing: -0.03em;
	line-height: 1.05;
	text-wrap: balance;
}

.session-missing p {
	margin: 0;
	color: var(--ontop-muted);
	text-wrap: pretty;
}

.session-missing .join {
	width: 100%;
	margin-top: 8px;
}

@media (min-width: 1180px) {
	.board-layout {
		grid-template-columns: minmax(0, 1fr) var(--ontop-width) minmax(0, 1fr);
		column-gap: 32px;
		width: min(100% - 80px, 1400px);
	}

	.sessions {
		position: sticky;
		top: calc(var(--ontop-sticky-offset) + 28px);
		align-self: start;
		width: 220px;
		padding-top: 28px;
	}

	.sessions__buttons {
		grid-template-columns: 1fr;
	}

	.board {
		grid-column: 2;
		grid-row: 1;
	}
}

/* 8. Report dialog and notices --------------------------------------- */

.report {
	width: min(100% - 32px, 440px);
	max-height: calc(100dvh - 32px);
	padding: 0;
	border: 0;
	border-radius: 16px;
	background: var(--ontop-paper);
	color: var(--ontop-ink);
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
	overscroll-behavior: contain;
}

.report::backdrop {
	background: rgba(0, 0, 0, 0.55);
}

[data-theme="dark"] .report {
	background: #161616;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

.report__form {
	display: grid;
	gap: 14px;
	padding: 24px;
}

.report__title {
	margin: 0;
	font-size: 22px;
	font-weight: 900;
	letter-spacing: -0.03em;
	line-height: 1.15;
}

.report__title span {
	color: var(--ontop-muted);
	font-variant-numeric: tabular-nums;
}

.report__lead {
	margin: -6px 0 0;
	color: var(--ontop-muted);
	font-size: 14px;
	text-wrap: pretty;
}

.report__reasons {
	display: grid;
	gap: 6px;
	margin: 0;
	padding: 0;
	border: 0;
}

.report__reason {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 48px;
	padding: 8px 14px;
	border: 1px solid var(--ontop-line);
	border-radius: 10px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	cursor: pointer;
}

.report__reason:hover {
	border-color: color-mix(in srgb, var(--ontop-ink) 35%, transparent);
}

.report__reason:has(input:checked) {
	border-color: var(--ontop-accent-text);
	background: color-mix(in srgb, var(--ontop-accent-text) 10%, transparent);
}

.report__reason input {
	flex: none;
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--ontop-accent-text);
}

.report__trap {
	position: absolute;
	left: -9999px;
}

.report__status {
	margin: 0;
	font-size: 14px;
	font-weight: 700;
}

.report__status:empty {
	display: none;
}

.report__status[data-tone="error"] {
	color: var(--ontop-error);
}

.report__actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
}

.report__cancel,
.report__send {
	min-height: 46px;
	padding: 0 18px;
	border: 0;
	border-radius: 10px;
	font-size: 15px;
	font-weight: 800;
}

.report__cancel {
	background: transparent;
}

.report__cancel:hover {
	background: color-mix(in srgb, var(--ontop-ink) 7%, transparent);
}

.report__send {
	background: var(--ontop-ink);
	color: var(--ontop-paper);
}

.report__send:disabled {
	cursor: progress;
	opacity: 0.6;
}

.toast {
	position: fixed;
	top: calc(var(--ontop-header-height) + 12px);
	left: 50%;
	z-index: 1100;
	width: max-content;
	max-width: min(100% - 32px, 480px);
	margin: 0;
	padding: 12px 18px;
	border-radius: 12px;
	background: #1f1f1f;
	color: #ffffff;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	text-align: center;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
	transform: translateX(-50%);
	pointer-events: none;
}

[data-theme="dark"] .toast {
	background: #f2f2f2;
	color: #111111;
}

/* 9. Footer ---------------------------------------------------------- */

.site-footer {
	padding: 56px 16px 24px;
	border-top: 3px solid var(--ontop-brand);
	background: var(--ontop-chrome);
	color: var(--ontop-chrome-ink);
	--ontop-logo-accent: var(--ontop-logo-accent-on-dark);
	--ontop-accent-text: var(--ontop-logo-accent-on-dark); /* focus ring visible on black */
}

.site-footer__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.15fr);
	gap: 40px clamp(32px, 5vw, 80px);
	align-items: start;
	width: min(100%, 1200px);
	margin: 0 auto;
}

.site-footer h2 {
	margin: 0 0 16px;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
}

.site-footer__logo {
	display: inline-block;
	color: #ffffff;
}

.site-footer__logo-image {
	width: auto;
	height: 52px;
}

.site-footer__slogan {
	margin: 10px 0 0;
	color: var(--ontop-chrome-muted);
	font-size: 14px;
}

.social-links {
	display: flex;
	gap: 10px;
	margin: 24px 0 0;
	padding: 0;
	list-style: none;
}

.social-links a {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 1px solid rgba(255, 255, 255, 0.16);
	border-radius: 50%;
	color: rgba(255, 255, 255, 0.82);
}

.social-links a:hover {
	border-color: var(--ontop-logo-accent-on-dark);
	background: rgba(255, 255, 255, 0.06);
	color: #ffffff;
}

.social-links svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

/* Legal texts: one row each, opened on demand. */
.legal {
	border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.legal:last-child {
	border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.legal__summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 52px;
	padding: 4px 2px;
	list-style: none;
	cursor: pointer;
}

.legal__summary::-webkit-details-marker {
	display: none;
}

.legal__summary::after {
	content: "";
	flex: none;
	width: 8px;
	height: 8px;
	margin-right: 4px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
}

.legal[open] > .legal__summary::after {
	transform: translateY(2px) rotate(-135deg);
}

.site-footer .legal__summary h2 {
	margin: 0;
	color: #e6e6e6;
	font-size: 14px;
	font-weight: 600;
}

.legal__summary:hover h2 {
	color: #ffffff;
}

.legal__summary:focus-visible {
	outline: 2px solid var(--ontop-logo-accent-on-dark);
	outline-offset: 2px;
	border-radius: 4px;
}

.terms-box {
	max-height: 260px;
	margin-bottom: 14px;
	padding: 12px 14px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 8px;
	background: #141414;
	color: #e6e6e6;
	font-size: 13px;
	line-height: 1.55;
	text-align: left;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-color: #444444 transparent;
	scroll-margin-top: calc(var(--ontop-sticky-offset) + 72px);
}

.terms-box:target,
.terms-box:focus-visible {
	outline: 2px solid #5cc2b3;
	outline-offset: 2px;
}

.terms-box a,
.contact-form__notice a {
	color: #5cc2b3;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.terms-box h3 {
	margin: 14px 0 4px;
	color: #ffffff;
	font-size: 13px;
}

.terms-box p,
.terms-box ul {
	margin: 0 0 8px;
}

.terms-box ul {
	padding-left: 18px;
}

.contact-form {
	display: grid;
	gap: 10px;
}

.contact-form input,
.contact-form textarea {
	width: 100%;
	padding: 11px 12px;
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.05);
	color: #ffffff;
	font-size: 16px;
}

.contact-form input:hover,
.contact-form textarea:hover {
	border-color: rgba(255, 255, 255, 0.3);
}

.contact-form textarea {
	resize: vertical;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
	color: #a8a8a8;
}

.contact-form input:focus-visible,
.contact-form textarea:focus-visible {
	outline: 2px solid #5cc2b3;
	outline-offset: 1px;
}

.contact-form button {
	justify-self: start;
	min-height: 44px;
	padding: 0 32px;
	border: 0;
	border-radius: 8px;
	background: var(--ontop-brand);
	color: #ffffff;
	font-size: 14px;
	font-weight: 700;
}

.contact-form button:hover {
	background: var(--ontop-brand-hover);
}

.contact-form button:disabled {
	opacity: 0.6;
}

.contact-form__notice {
	margin: 0;
	color: var(--ontop-chrome-muted);
	font-size: 12px;
	line-height: 1.5;
}

.contact-form__trap {
	position: absolute;
	left: -9999px;
}

.contact-form__status {
	min-height: 1.5em;
	margin: 0;
	font-size: 13px;
	font-weight: 700;
}

.contact-form__status[data-tone="ok"] {
	color: #5cc2b3;
}

.contact-form__status[data-tone="error"] {
	color: #ff8a80;
}

.site-footer__bottom {
	width: min(100%, 1200px);
	margin: 48px auto 0;
	padding-top: 20px;
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	color: var(--ontop-chrome-muted);
	font-size: 13px;
	text-align: center;
}

.site-footer__credit {
	display: block;
	margin-top: 6px;
	font-size: 12px;
}

.site-footer__credit a {
	color: inherit;
	text-decoration: underline;
	text-decoration-color: rgba(179, 179, 179, 0.45);
	text-underline-offset: 3px;
	transition: color 160ms ease, text-decoration-color 160ms ease;
}

@media (hover: hover) and (pointer: fine) {
	.site-footer__credit a:hover {
		color: var(--ontop-chrome-ink);
		text-decoration-color: currentColor;
	}
}

.site-footer__credit a:focus-visible {
	color: var(--ontop-chrome-ink);
	text-decoration-color: currentColor;
}

/* 10. Motion --------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}

	.note,
	.note__push,
	.note__report,
	.header-cta,
	.icon-button,
	.social-links a,
	.legal__summary::after,
	.contact-form button,
	.back-button,
	.invoice-button,
	.position,
	.sessions__button,
	.invite__copy,
	.report__reason {
		transition: background-color 180ms var(--ontop-ease), border-color 180ms var(--ontop-ease), box-shadow 240ms var(--ontop-ease), transform 160ms var(--ontop-ease);
	}

	.sessions__button:active,
	.invite__copy:active,
	.report__send:active {
		transform: scale(0.97);
	}

	/* Report dialog: rises in quickly, leaves faster. */
	.report,
	.report::backdrop {
		transition: opacity 150ms var(--ontop-ease), transform 150ms var(--ontop-ease), overlay 150ms allow-discrete, display 150ms allow-discrete;
	}

	.report:not([open]) {
		opacity: 0;
		transform: translateY(8px) scale(0.98);
	}

	.report:not([open])::backdrop {
		opacity: 0;
	}

	.report[open] {
		transition-duration: 220ms;
	}

	@starting-style {
		.report[open] {
			opacity: 0;
			transform: translateY(12px) scale(0.98);
		}

		.report[open]::backdrop {
			opacity: 0;
		}
	}

	/* Notice: drops in from under the header and lifts away. */
	.toast {
		transition: opacity 220ms var(--ontop-ease), transform 220ms var(--ontop-ease);
	}

	.toast.is-leaving {
		opacity: 0;
		transform: translate(-50%, -8px);
		transition-duration: 160ms;
	}

	@starting-style {
		.toast {
			opacity: 0;
			transform: translate(-50%, -8px);
		}
	}

	.note:not(.note--editor):hover {
		transform: translateY(-2px);
		box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
	}

	.note.is-new {
		animation: ontop-landed 1.6s var(--ontop-ease) both;
	}

	@keyframes ontop-landed {
		from {
			box-shadow: 0 0 0 12px color-mix(in srgb, var(--ontop-accent) 0%, transparent);
		}

		30% {
			box-shadow: 0 0 0 6px color-mix(in srgb, var(--ontop-accent) 45%, transparent);
		}
	}
}

@media (prefers-reduced-motion: reduce) {
	.toast {
		transition: opacity 160ms linear;
	}

	.toast.is-leaving {
		opacity: 0;
	}
}

@media (hover: none) {
	.note:not(.note--editor):hover {
		transform: none;
		box-shadow: none;
	}
}

/* 11. Small screens -------------------------------------------------- */

@media (max-width: 1024px) {
	.site-footer__inner {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.site-footer__brand {
		grid-column: 1 / -1;
	}
}

@media (max-width: 600px) {
	:root {
		--ontop-header-height: 64px;
	}

	.site-header__inner {
		width: calc(100% - 24px);
		gap: 8px;
	}

	.site-logo__image {
		height: 36px;
	}

	.header-cta {
		margin-left: 4px;
		padding: 0 14px;
		font-size: 13px;
	}

	.hero__inner {
		gap: 4px 12px;
	}

	.hero__slogan {
		width: 100%;
		font-size: 13px;
	}

	.hero {
		padding: 10px 12px;
	}

	.board-layout {
		width: calc(100% - 24px);
	}

	.sessions {
		padding-top: 18px;
	}

	/* Inside a session the panel folds into two rows: back + invite link, then the code. */
	.sessions--session {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 10px;
	}

	.sessions--session .invite {
		display: contents;
	}

	.sessions--session .sessions__title {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
	}

	.sessions--session .sessions__back,
	.sessions--session .invite__copy--link {
		flex: 1 1 40%;
		min-height: 50px;
		padding-inline: 10px;
	}

	.sessions--session .invite__copy--link {
		order: 1;
	}

	.sessions--session .sessions__back {
		order: 0;
	}

	.sessions--session .invite__code {
		flex: 1 1 auto;
		order: 2;
	}

	.sessions--session .invite__copy:not(.invite__copy--link) {
		flex: none;
		order: 3;
	}

	.hero__private {
		margin-inline: -12px;
	}

	.sessions__button {
		padding: 0 10px;
		font-size: 14px;
	}

	.board {
		padding-top: 20px;
	}

	/* Report dialog becomes a sheet anchored to the bottom, within thumb reach. */
	.report {
		width: 100%;
		max-width: 100%;
		max-height: 88dvh;
		margin: auto 0 0;
		border-radius: 16px 16px 0 0;
	}

	.report__form {
		padding: 22px 16px calc(16px + env(safe-area-inset-bottom));
	}

	.report__actions {
		display: grid;
		grid-template-columns: 1fr 1fr;
	}

	.note {
		padding-inline: 8px;
	}

	/* 40 monospace characters (0.6em each) must fit the card width. */
	.note__text {
		font-size: min(16px, calc((100vw - 48px) / 24));
	}

	/* The fields being typed in stay at 16px, or Safari on iPhone zooms the page in when one is touched; the
	   letters are drawn a little closer instead, so 40 still fit (each takes (100vw - 48px) / 40). */
	.note__line {
		font-size: 16px;
		letter-spacing: min(0px, calc((100vw - 48px) / 40 - 9.6px));
	}

	.site-footer {
		padding-top: 44px;
	}

	.site-footer__inner {
		grid-template-columns: 1fr;
		gap: 36px;
	}
}

@media (max-width: 600px) and (prefers-reduced-motion: no-preference) {
	.report,
	.report::backdrop {
		transition-timing-function: cubic-bezier(0.32, 0.72, 0, 1);
	}

	.report[open] {
		transition-duration: 320ms;
	}

	.report:not([open]) {
		transform: translateY(100%);
	}

	@starting-style {
		.report[open] {
			opacity: 1;
			transform: translateY(100%);
		}
	}
}

@media (max-width: 360px) {
	.site-logo__image {
		height: 30px;
	}

	.icon-button {
		min-width: 40px;
		padding: 0 4px;
	}
}
