:root {
	--bg: #0b1220;
	--bg-elev: #121a2b;
	--bg-soft: #182338;
	--line: rgba(255, 255, 255, 0.1);
	--text: #f4f7fb;
	--muted: #9aacbf;
	--accent: #0ea5a4;
	--accent-2: #f0b429;
	--danger: #ff6b6b;
	--radius: 14px;
	--shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
	--sans: "Segoe UI", "Helvetica Neue", "Noto Sans", sans-serif;
	--display: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
	/* High-contrast form fields — light fill, dark text (readable on dark chrome) */
	--input-bg: #e8eef7;
	--input-text: #0b1220;
	--input-placeholder: #5a6b7d;
	--input-border: #8fa0b5;
	--input-caret: #0b1220;
	--chrome-bg: #1a2740;
	--chrome-border: rgba(232, 238, 247, 0.28);
}

* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	min-height: 100%;
}

body {
	font-family: var(--sans);
	color: var(--text);
	background:
		radial-gradient(1200px 600px at 10% -10%, rgba(14, 165, 164, 0.22), transparent 55%),
		radial-gradient(900px 500px at 90% 0%, rgba(240, 180, 41, 0.12), transparent 50%),
		var(--bg);
}

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

h1,
h2,
h3 {
	font-family: var(--display);
	font-weight: 700;
	letter-spacing: -0.02em;
	margin: 0;
}

h1 {
	font-size: clamp(2rem, 5vw, 3.4rem);
	line-height: 1.05;
}

h2 {
	font-size: 1.35rem;
}

.eyebrow {
	display: inline-block;
	margin: 0 0 0.75rem;
	padding: 0.3rem 0.7rem;
	border-radius: 999px;
	background: rgba(14, 165, 164, 0.15);
	color: #7ee7e4;
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: lowercase;
}

.lede {
	margin: 0.85rem 0 0;
	color: var(--muted);
	font-size: 1.05rem;
	max-width: 34rem;
}

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

.error {
	color: var(--danger);
	margin: 0.75rem 0 0;
	font-size: 0.92rem;
}

.topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1rem 1.25rem;
	border-bottom: 1px solid var(--line);
	backdrop-filter: blur(10px);
	position: sticky;
	top: 0;
	z-index: 20;
	background: rgba(11, 18, 32, 0.75);
}

.brand {
	font-family: var(--display);
	font-size: 1.35rem;
	font-weight: 700;
}

.topnav {
	display: flex;
	align-items: center;
	gap: 0.65rem;
}

.btn {
	appearance: none;
	border: 1px solid var(--line);
	background: var(--bg-soft);
	color: var(--text);
	border-radius: 999px;
	padding: 0.65rem 1.05rem;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	transition: 0.15s ease;
}

.btn:hover {
	border-color: rgba(255, 255, 255, 0.22);
	transform: translateY(-1px);
}

.btn.primary {
	background: linear-gradient(135deg, #0ea5a4, #12827f);
	border-color: transparent;
	color: #041314;
}

.btn.ghost {
	background: transparent;
}

.btn.danger {
	background: rgba(255, 107, 107, 0.12);
	border-color: rgba(255, 107, 107, 0.35);
	color: #ffb4b4;
}

.btn.wide {
	width: 100%;
}

.btn.small {
	padding: 0.4rem 0.75rem;
	font-size: 0.85rem;
}

.hero {
	width: min(720px, calc(100% - 2rem));
	margin: 8vh auto 0;
	padding: 2rem;
	border: 1px solid var(--line);
	border-radius: 28px;
	background: rgba(18, 26, 43, 0.72);
	box-shadow: var(--shadow);
}

.go-form {
	display: flex;
	gap: 0.75rem;
	margin-top: 1.5rem;
}

#go-address,
#browser-url,
input[type="text"],
input[type="password"],
select {
	width: 100%;
	border: 2px solid var(--input-border);
	background: var(--input-bg);
	color: var(--input-text);
	caret-color: var(--input-caret);
	border-radius: 999px;
	padding: 0.9rem 1.15rem;
	font: inherit;
	font-weight: 500;
	outline: none;
	-webkit-text-fill-color: var(--input-text);
}

#go-address::placeholder,
#browser-url::placeholder,
input[type="text"]::placeholder,
input[type="password"]::placeholder {
	color: var(--input-placeholder);
	opacity: 1;
}

#go-address:focus,
#browser-url:focus,
input:focus,
select:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(14, 165, 164, 0.35);
}

.browser {
	position: fixed;
	inset: 0;
	z-index: 50;
	display: flex;
	flex-direction: column;
	background: #0b1220;
}

/* Author display:flex must not override the hidden attribute */
.browser[hidden] {
	display: none !important;
}

.browser-bar {
	display: flex;
	gap: 0.5rem;
	align-items: center;
	padding: 0.7rem 0.85rem;
	background: var(--chrome-bg);
	border-bottom: 2px solid var(--chrome-border);
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.browser-bar .btn {
	flex-shrink: 0;
	background: #334d6e;
	border: 1px solid rgba(232, 238, 247, 0.55);
	color: #ffffff;
}

.browser-bar .btn:hover {
	background: #3f5d84;
	border-color: #e8eef7;
}

.browser-bar .btn.primary {
	background: linear-gradient(135deg, #0ea5a4, #12827f);
	border-color: transparent;
	color: #041314;
}

#browser-url {
	flex: 1;
	min-width: 0;
	border-radius: 10px;
	padding: 0.55rem 0.85rem;
	background: var(--input-bg);
	color: var(--input-text);
	border: 2px solid var(--input-border);
}

#browser-url[readonly] {
	cursor: default;
	color: var(--input-text);
	-webkit-text-fill-color: var(--input-text);
	opacity: 1;
}

.browser-stage {
	position: relative;
	flex: 1;
	display: flex;
	min-height: 0;
	background: #e8eef7;
}

#browser-frame {
	border: 0;
	width: 100%;
	flex: 1;
	background: #e8eef7;
}

.browser-loading {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	pointer-events: none;
	background: #e8eef7;
	color: #243552;
	font-weight: 600;
	font-size: 1rem;
	z-index: 1;
}

.browser-loading[hidden] {
	display: none;
}

.page-auth {
	display: grid;
	place-items: center;
	min-height: 100vh;
	padding: 1.5rem;
}

.auth-card {
	width: min(420px, 100%);
	padding: 2rem;
	border-radius: 24px;
	border: 1px solid var(--line);
	background: rgba(18, 26, 43, 0.85);
	box-shadow: var(--shadow);
}

.auth-card form,
.dialog-form {
	display: grid;
	gap: 0.9rem;
	margin-top: 1.25rem;
}

label {
	display: grid;
	gap: 0.4rem;
	font-size: 0.9rem;
	color: var(--muted);
}

.admin-wrap {
	width: min(1100px, calc(100% - 2rem));
	margin: 2rem auto 3rem;
	display: grid;
	gap: 1.25rem;
}

.admin-head h1 {
	font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.panel {
	padding: 1.25rem;
	border-radius: 20px;
	border: 1px solid var(--line);
	background: rgba(18, 26, 43, 0.72);
}

.create-form {
	display: grid;
	grid-template-columns: 1.2fr 1.2fr 0.8fr auto;
	gap: 0.65rem;
	margin-top: 1rem;
}

.table-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0.75rem;
}

.table-wrap {
	overflow-x: auto;
}

table {
	width: 100%;
	border-collapse: collapse;
}

th,
td {
	text-align: left;
	padding: 0.85rem 0.6rem;
	border-bottom: 1px solid var(--line);
	vertical-align: middle;
	font-size: 0.95rem;
}

th {
	color: var(--muted);
	font-weight: 600;
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.badge {
	display: inline-flex;
	align-items: center;
	padding: 0.2rem 0.55rem;
	border-radius: 999px;
	font-size: 0.78rem;
	font-weight: 600;
}

.badge.ok {
	background: rgba(14, 165, 164, 0.15);
	color: #7ee7e4;
}

.badge.off {
	background: rgba(255, 107, 107, 0.12);
	color: #ffb4b4;
}

.badge.role {
	background: rgba(240, 180, 41, 0.14);
	color: #ffd56a;
}

dialog {
	border: 1px solid var(--line);
	border-radius: 18px;
	padding: 0;
	background: var(--bg-elev);
	color: var(--text);
	width: min(420px, calc(100% - 2rem));
}

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

.dialog-form {
	padding: 1.25rem;
}

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

@media (max-width: 720px) {
	.create-form {
		grid-template-columns: 1fr;
	}

	.go-form {
		flex-direction: column;
	}

	.hero {
		margin-top: 4vh;
		padding: 1.35rem;
	}
}
