*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
[hidden] { display: none !important; }

html {
	scroll-padding-top: calc(4.75rem + var(--safe-top));
}

body {
	font-family: var(--font);
	background: var(--paper);
	color: var(--ink);
	min-height: 100dvh;
	line-height: 1.42;
	font-size: var(--t-body);
	font-variant-numeric: tabular-nums lining-nums;
	overflow-x: clip;
	overflow-wrap: break-word;
}

a { color: inherit; }

button, input, select {
	font: inherit;
	color: inherit;
	max-width: 100%;
}

button, .tool {
	touch-action: manipulation;
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
}

.top-dock {
	position: sticky;
	top: 0;
	z-index: 20;
	padding: calc(var(--dock-pad) + var(--safe-top)) max(var(--place-gutter), var(--safe-right)) 8px max(var(--place-gutter), var(--safe-left));
	background: linear-gradient(var(--paper) 70%, transparent);
}

.top {
	width: 100%;
	max-width: var(--place-col);
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px 14px;
	background: var(--navy);
	color: var(--ink-on);
	border-radius: var(--r-pill);
	padding: 8px 10px 8px 18px;
	min-height: 56px;
}

.brand {
	font-weight: 700;
	letter-spacing: 0.06em;
	text-decoration: none;
	font-size: 1.38rem;
	line-height: 1;
}

.tools {
	display: flex;
	align-items: center;
	background: var(--navy-2);
	border-radius: var(--r-pill);
	padding: 4px;
}

.tool {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 36px;
	padding: 0 12px;
	border: 0;
	background: transparent;
	color: var(--ink-on);
	text-decoration: none;
	border-radius: var(--r-pill);
	cursor: pointer;
	white-space: nowrap;
	font-size: 0.92rem;
}
.tool svg { width: 14px; height: 14px; display: block; flex: 0 0 auto; }
.tool:hover { background: rgba(255, 255, 255, 0.08); }
.tool:focus-visible { outline: 2px solid var(--ink-on); outline-offset: 2px; }

.place-col {
	width: 100%;
	max-width: var(--place-col);
	margin: 0 auto;
	padding: 12px max(var(--place-gutter), var(--safe-right)) calc(40px + var(--safe-bottom)) max(var(--place-gutter), var(--safe-left));
}

.kicker {
	display: block;
	font-size: var(--t-label);
	font-weight: 600;
	letter-spacing: var(--t-label-track);
	text-transform: uppercase;
	color: var(--ink-muted);
	margin: 0 0 8px;
}

.hero { margin: 8px 0 4px; }
.hero h1 {
	font-size: var(--t-display);
	line-height: var(--t-display-lh);
	font-weight: 700;
	letter-spacing: -0.04em;
	margin: 0;
}
.hero-lead {
	margin: 16px 0 0;
	color: var(--ink-muted);
	max-width: 36rem;
}
.hero-lead a {
	font-weight: 650;
	text-underline-offset: 3px;
}

.panel {
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: var(--r-card);
	padding: var(--panel-pad);
	margin: clamp(12px, 2.5vw, 18px) 0;
}

.panel h2, .examples h2 {
	font-size: var(--t-title);
	font-weight: 700;
	letter-spacing: -0.02em;
	margin: 0 0 10px;
}

.steps {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 14px;
}
.steps li {
	display: grid;
	grid-template-columns: 2rem 1fr;
	gap: 12px;
	align-items: start;
}
.step-n {
	display: grid;
	place-items: center;
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	border: 1px solid var(--line);
	font-weight: 700;
	font-size: 0.85rem;
}
.step-emphasis {
	font-size: 1.05rem;
}
.step-emphasis .step-n {
	background: var(--navy);
	color: var(--ink-on);
	border-color: var(--navy);
}

.examples h2 { max-width: 36rem; }

.example p { margin: 0 0 8px; }
.example p:last-child { margin-bottom: 0; }
.example-when {
	font-weight: 650;
	margin-bottom: 10px;
}
.example-lead { color: var(--ink-muted); }

.state-label {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: var(--t-value);
	line-height: 1;
	font-weight: 700;
	letter-spacing: -0.03em;
	margin: 0 0 12px;
}
.state-mark {
	flex: 0 0 auto;
	width: 14px;
	height: 14px;
}

.example-watch .state-label { color: var(--ink-muted); }
.example-watch .state-mark {
	border: 2px solid currentColor;
	border-radius: 50%;
	background: transparent;
}
.example-warning .state-label { color: var(--warning); }
.example-warning .state-mark {
	background: currentColor;
	clip-path: polygon(50% 0, 100% 100%, 0 100%);
	border-radius: 0;
}

.group-note {
	margin: 0 0 10px;
	color: var(--ink-muted);
	max-width: 36rem;
}

.port-list {
	list-style: none;
	margin: 0 0 22px;
	padding: 0;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 6px 16px;
}
@media (max-width: 520px) {
	.port-list { grid-template-columns: 1fr; }
}
.port-list li {
	min-height: 32px;
	display: flex;
	align-items: center;
}
.port-live { font-weight: 700; }
.port-list-muted,
.port-off {
	color: var(--ink-muted);
}
.port-off { font-style: italic; }

.join-form {
	display: grid;
	gap: 14px;
	margin-top: 14px;
}
.join-form label { display: grid; gap: 6px; }
.join-form .kicker { margin: 0; }

input, select {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--r-card);
	min-height: var(--touch);
	padding: 0 12px;
}

.primary {
	background: var(--navy);
	color: var(--ink-on);
	border: 0;
	border-radius: var(--r-card);
	min-height: var(--touch);
	font-weight: 650;
	padding: 0 16px;
	cursor: pointer;
}
.primary:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

.banner {
	margin: 12px 0 0;
	padding: 10px 12px;
	border-radius: var(--r-mark);
	background: var(--surface);
	border: 1px solid var(--line);
	font-weight: 650;
}
.banner-error { color: var(--warning); }

.foot {
	color: var(--ink-muted);
	padding-top: 8px;
	padding-bottom: calc(32px + var(--safe-bottom));
}
.foot p { margin: 0; max-width: 36rem; }
