:root {
	--bg: #120f0e;
	--panel: #1c1817;
	--line: #322c2a;
	--text: #f2ece9;
	--muted: #9b8f8a;
	--accent: #f1855b;
	--danger: #e2635f;
}

* {
	box-sizing: border-box;
}

html,
body {
	height: 100%;
}

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

/* ---------- launcher ---------- */

#launcher {
	min-height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1.5rem;
	padding: 2rem 1.25rem;
	text-align: center;
}

#launcher[hidden] {
	display: none;
}

header h1 {
	margin: 0;
	font-size: clamp(2.25rem, 7vw, 3.5rem);
	font-weight: 700;
	letter-spacing: -0.03em;
}

header h1 span {
	color: var(--accent);
	margin-left: 0.35ch;
}

header p {
	margin: 0.5rem 0 0;
	color: var(--muted);
	font-size: 0.95rem;
}

#form {
	display: flex;
	gap: 0.5rem;
	width: min(38rem, 100%);
}

#address {
	flex: 1;
	min-width: 0;
	padding: 0.85rem 1rem;
	border: 1px solid var(--line);
	border-radius: 0.6rem;
	background: var(--panel);
	color: var(--text);
	font-size: 1rem;
	font-family: inherit;
}

#address:focus {
	outline: none;
	border-color: var(--accent);
}

#address::placeholder {
	color: var(--muted);
}

#submit {
	padding: 0.85rem 1.5rem;
	border: none;
	border-radius: 0.6rem;
	background: var(--accent);
	color: var(--bg);
	font-size: 1rem;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
}

#submit:disabled {
	opacity: 0.55;
	cursor: progress;
}

#status {
	margin: 0;
	min-height: 1.2rem;
	color: var(--muted);
	font-size: 0.9rem;
}

#status[data-state="error"] {
	color: var(--danger);
}

#error-detail {
	max-width: min(38rem, 100%);
	max-height: 9rem;
	margin: 0;
	padding: 0.75rem;
	overflow: auto;
	border: 1px solid var(--line);
	border-radius: 0.5rem;
	background: var(--panel);
	color: var(--muted);
	font-size: 0.75rem;
	text-align: left;
	white-space: pre-wrap;
}

footer {
	display: flex;
	gap: 1.25rem;
	font-size: 0.8rem;
}

footer a {
	color: var(--muted);
	text-decoration: none;
}

footer a:hover {
	color: var(--accent);
}

/* ---------- proxied view ---------- */

#viewport {
	position: fixed;
	inset: 0;
	display: flex;
	flex-direction: column;
	background: var(--bg);
}

#viewport[hidden] {
	display: none;
}

#toolbar {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.4rem 0.6rem;
	border-bottom: 1px solid var(--line);
	background: var(--panel);
}

#toolbar button {
	flex: none;
	width: 2rem;
	height: 2rem;
	border: 1px solid var(--line);
	border-radius: 0.4rem;
	background: transparent;
	color: var(--text);
	font-size: 1rem;
	line-height: 1;
	cursor: pointer;
}

#toolbar button:hover {
	border-color: var(--accent);
	color: var(--accent);
}

#current-url {
	flex: 1;
	min-width: 0;
	padding: 0 0.5rem;
	overflow: hidden;
	color: var(--muted);
	font-size: 0.8rem;
	white-space: nowrap;
	text-overflow: ellipsis;
}

#frame {
	flex: 1;
	width: 100%;
	border: none;
	background: #fff;
}
