/* MainScript website. Near-black surfaces, hairline borders, a faint grid and soft glows; the script's purple
   as the accent. Everything is a token on :root. */

:root {
	--bg: #070708;
	--bg-raised: #0c0c0e;
	--surface: #111114;
	--surface-hover: #17171b;
	--surface-active: #1d1d22;
	--border: #1f1f25;
	--border-strong: #2c2c34;
	--text: #ececf1;
	--text-muted: #85858e;
	--text-faint: #55555d;
	--accent: #a09ad6;
	--accent-strong: #b8b3ec;
	--accent-soft: rgba(160, 154, 214, 0.12);
	--success: #7fc79b;
	--warning: #d9b673;
	--danger: #e07a7a;
	--info: #7aa8e0;
	--radius: 14px;
	--radius-sm: 9px;
	--font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
	--mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
	color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
	background: var(--bg);
	color: var(--text);
	font: 14px/1.5 var(--font);
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}
/* The faint grid and the glow at the top, behind everything. */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	background-image:
		linear-gradient(to right, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
		linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
	background-size: 64px 64px;
	mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 30%, transparent 80%);
	pointer-events: none;
	z-index: 0;
}
body::after {
	content: "";
	position: fixed;
	top: -340px;
	left: 50%;
	width: 1100px;
	height: 600px;
	transform: translateX(-50%);
	background: radial-gradient(ellipse at center, rgba(160, 154, 214, 0.13), transparent 65%);
	pointer-events: none;
	z-index: 0;
}
#app { position: relative; z-index: 1; min-height: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); }

/* Layout ------------------------------------------------------------------------------------------------ */

.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
	position: sticky;
	top: 0;
	height: 100vh;
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 22px 14px;
	border-right: 1px solid var(--border);
	background: rgba(9, 9, 11, 0.7);
	backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 22px; }
.brand-mark {
	width: 30px;
	height: 30px;
	border-radius: 9px;
	display: grid;
	place-items: center;
	background: linear-gradient(145deg, var(--accent-strong), #6f68b4);
	color: #0b0b10;
	font-weight: 800;
	box-shadow: 0 0 24px rgba(160, 154, 214, 0.35);
}
.brand-name { font-weight: 650; letter-spacing: -0.01em; }
.brand-sub { font-size: 11px; color: var(--text-faint); }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); padding: 16px 12px 6px; }
.nav-link {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	border-radius: var(--radius-sm);
	color: var(--text-muted);
	transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: var(--surface-hover); color: var(--text); }
.nav-link.active { background: var(--surface-active); color: var(--text); }
.nav-link.active::before {
	content: "";
	position: absolute;
	left: 3px;
	top: 50%;
	width: 3px;
	height: 16px;
	transform: translateY(-50%);
	border-radius: 3px;
	background: var(--accent);
}
.nav-link svg { width: 16px; height: 16px; opacity: 0.85; flex: none; }
.sidebar-foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: var(--surface-active);
	border: 1px solid var(--border-strong);
	font-weight: 600;
	font-size: 13px;
	flex: none;
}
.who { min-width: 0; flex: 1; }
.who-name { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-sub { font-size: 12px; color: var(--text-faint); }

.main { min-width: 0; padding: 30px 40px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.page-title { font-size: 26px; font-weight: 650; letter-spacing: -0.025em; margin: 0; }
.page-sub { color: var(--text-muted); margin: 4px 0 0; }
.banner {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 16px;
	margin-bottom: 22px;
	border: 1px solid rgba(217, 182, 115, 0.35);
	background: rgba(217, 182, 115, 0.08);
	border-radius: var(--radius-sm);
	color: var(--warning);
}
.banner .spacer { flex: 1; }
.banner svg { flex: none; }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.split { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }

/* Cards ------------------------------------------------------------------------------------------------- */

.card {
	position: relative;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 40%), var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 20px;
	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 20px 40px -24px rgba(0, 0, 0, 0.6);
}
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card.flush .card-head { padding: 18px 20px 0; }
.card-title { font-weight: 600; font-size: 14px; margin: 0; }
.card-sub { color: var(--text-muted); font-size: 12px; margin: 2px 0 0; }

.stat-label { color: var(--text-muted); font-size: 12px; }
.stat-value { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; margin-top: 6px; }
.stat-caption { font-size: 12px; color: var(--text-faint); margin-top: 2px; }

/* Lists and tables -------------------------------------------------------------------------------------- */

.list { display: flex; flex-direction: column; }
.item {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 13px 20px;
	border-top: 1px solid var(--border);
	transition: background 0.12s;
}
.item:first-child { border-top: 0; }
.item:hover { background: rgba(255, 255, 255, 0.015); }
.item.selected { background: var(--surface-hover); box-shadow: inset 2px 0 0 var(--accent); }
.item.clickable { cursor: pointer; }
.item-main { flex: 1; min-width: 0; }
.item-title { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-text { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.item-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.empty { padding: 34px 20px; text-align: center; color: var(--text-faint); }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 500; font-size: 12px; color: var(--text-faint); padding: 10px 20px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px 20px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255, 255, 255, 0.015); }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); flex: none; }
.dot.on { background: var(--success); box-shadow: 0 0 10px rgba(127, 199, 155, 0.55); }
.badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 550;
	border: 1px solid var(--border-strong);
	color: var(--text-muted);
	white-space: nowrap;
}
.badge.accent { color: var(--accent-strong); border-color: rgba(160, 154, 214, 0.35); background: var(--accent-soft); }
.badge.success { color: var(--success); border-color: rgba(127, 199, 155, 0.3); background: rgba(127, 199, 155, 0.08); }
.badge.warning { color: var(--warning); border-color: rgba(217, 182, 115, 0.3); background: rgba(217, 182, 115, 0.08); }
.badge.danger { color: var(--danger); border-color: rgba(224, 122, 122, 0.3); background: rgba(224, 122, 122, 0.08); }

/* Controls ---------------------------------------------------------------------------------------------- */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	height: 32px;
	padding: 0 13px;
	border-radius: 8px;
	border: 1px solid var(--border-strong);
	background: var(--surface-active);
	cursor: pointer;
	font-size: 13px;
	font-weight: 500;
	white-space: nowrap;
	transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover { background: #24242a; border-color: #3a3a44; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary { background: var(--text); color: #0b0b0e; border-color: var(--text); }
.btn.primary:hover { background: #ffffff; }
.btn.accent { background: var(--accent); color: #0d0c16; border-color: var(--accent); }
.btn.accent:hover { background: var(--accent-strong); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--surface-hover); }
.btn.danger { background: rgba(224, 122, 122, 0.08); color: var(--danger); border-color: rgba(224, 122, 122, 0.3); }
.btn.danger:hover { background: rgba(224, 122, 122, 0.15); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn svg { width: 15px; height: 15px; flex: none; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12px; color: var(--text-muted); }
.input, select.input, textarea.input {
	height: 36px;
	padding: 0 12px;
	border-radius: 9px;
	border: 1px solid var(--border-strong);
	background: var(--bg-raised);
	outline: none;
	transition: border-color 0.15s, box-shadow 0.15s;
	width: 100%;
}
textarea.input { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%); background-position: calc(100% - 16px) 15px, calc(100% - 11px) 15px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }

.switch { position: relative; width: 36px; height: 20px; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-active); border: 1px solid var(--border-strong); transition: background 0.18s, border-color 0.18s; }
.switch span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-muted); transition: transform 0.18s, background 0.18s; }
.switch input:checked + span { background: var(--accent); border-color: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); background: #0d0c16; }

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 4px; background: var(--surface-active); outline: none; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); box-shadow: 0 0 0 1px var(--accent); cursor: pointer; }

.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text-muted); cursor: pointer; font-size: 13px; transition: all 0.15s; }
.pill:hover { color: var(--text); }
.pill.active { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }

/* Settings editor */
.setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 20px; border-top: 1px solid var(--border); }
.setting:first-child { border-top: 0; }
.setting-name { font-weight: 500; }
.setting-key { font-family: var(--mono); font-size: 11px; color: var(--text-faint); }
.setting-control { min-width: 220px; max-width: 320px; flex: none; display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.setting-control .value { font-family: var(--mono); font-size: 12px; color: var(--text-muted); min-width: 44px; text-align: right; }
.kbd { font-family: var(--mono); font-size: 11px; color: var(--text-muted); padding: 2px 7px; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--surface-active); }
.section-title { padding: 12px 20px 2px; font-size: 12px; font-weight: 600; color: var(--text-muted); border-top: 1px solid var(--border); }
.old-settings { border-top: 1px solid var(--border); }
.old-settings > summary { cursor: pointer; padding: 12px 20px; color: var(--text-faint); font-size: 12px; }
.group-title { padding: 14px 20px 8px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); border-top: 1px solid var(--border); background: rgba(255, 255, 255, 0.01); }
.group-title:first-child { border-top: 0; }

/* Charts */
.chart { position: relative; height: 230px; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--border); stroke-dasharray: 3 5; }
.chart .axis { fill: var(--text-faint); font-size: 10px; font-family: var(--mono); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(160, 154, 214, 0.45)); }
.chart .guide { stroke: var(--border-strong); }
.tooltip { position: absolute; pointer-events: none; padding: 6px 10px; border-radius: 8px; background: var(--surface-active); border: 1px solid var(--border-strong); font-size: 12px; white-space: nowrap; transform: translate(-50%, -110%); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); }
.tooltip b { display: block; font-size: 13px; }

/* Inventory */
.inv-gem { width: 28px; height: 28px; border-radius: 7px; background: var(--surface-active); display: grid; place-items: center; flex: none; }
.inv-gem i { width: 12px; height: 12px; transform: rotate(45deg); border-radius: 3px; display: block; box-shadow: 0 0 10px currentColor; }
.inv-toolbar { display: flex; gap: 8px; padding: 0 20px 14px; flex-wrap: wrap; }
.inv-toolbar .input:first-child { flex: 1 1 220px; }
.inv-toolbar select.input { width: auto; flex: 0 1 180px; }
.inv-group { border-top: 1px solid var(--border); }
.inv-group > summary { list-style: none; cursor: pointer; padding: 12px 20px; display: flex; align-items: center; gap: 10px; font-weight: 550; }
.inv-group > summary::-webkit-details-marker { display: none; }
.inv-group > summary::before { content: "›"; color: var(--text-faint); transition: transform 0.15s; display: inline-block; }
.inv-group[open] > summary::before { transform: rotate(90deg); }
.inv-group .inv-group { margin-left: 20px; }
.inv-block { padding: 4px 20px 16px; }
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; max-height: 460px; overflow-y: auto; }
.inv-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 6px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-hover); color: inherit; font: inherit; cursor: pointer; overflow: hidden; min-width: 0; transition: background 0.12s, border-color 0.12s; }
.inv-tile[hidden] { display: none; }
.inv-tile:hover { background: var(--surface-active); }
.inv-tile.selected { border-color: var(--accent); background: var(--accent-soft); }
.inv-tile .inv-gem { width: 48px; height: 48px; border-radius: 9px; }
.inv-tile .inv-gem i { width: 20px; height: 20px; border-radius: 4px; }
.inv-name { font-size: 12px; width: 100%; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-cap { font-size: 11px; color: var(--text-muted); min-height: 14px; width: 100%; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-amount { position: absolute; top: 5px; right: 7px; font-size: 11px; color: var(--text-muted); }
.inv-art { position: relative; }
.inv-badge { position: absolute; right: -6px; bottom: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--bg, #070708); border: 1px solid var(--border); display: grid; place-items: center; font-size: 9px; font-weight: 700; overflow: hidden; }
.inv-badge img { width: 18px; height: 18px; object-fit: contain; }
.inv-details .inv-badge { width: 26px; height: 26px; }
.inv-details .inv-badge img { width: 22px; height: 22px; }
.inv-edge { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; }
.inv-details { display: flex; gap: 14px; align-items: flex-start; margin-top: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.inv-details[hidden] { display: none; }
.inv-details .inv-gem { width: 56px; height: 56px; border-radius: 10px; }
.inv-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 16px; margin-top: 8px; font-size: 13px; }
.inv-fields > div { display: flex; justify-content: space-between; gap: 8px; min-width: 0; }
.inv-fields > div > span:last-child { text-align: right; overflow-wrap: anywhere; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login { width: 100%; max-width: 380px; padding: 30px; }
.login h1 { font-size: 22px; letter-spacing: -0.02em; margin: 18px 0 4px; }
.login form { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }
.error-text { color: var(--danger); font-size: 13px; min-height: 18px; }

/* Modal and toasts */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 50; animation: fade 0.15s; }
.modal { width: 100%; max-width: 420px; animation: pop 0.18s ease-out; }
.modal h3 { margin: 0 0 6px; font-size: 16px; }
.modal p { margin: 0 0 16px; color: var(--text-muted); }
.modal .row { justify-content: flex-end; margin-top: 18px; }
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { min-width: 260px; max-width: 360px; padding: 12px 14px; border-radius: 11px; background: var(--surface-active); border: 1px solid var(--border-strong); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55); animation: pop 0.2s ease-out; }
.toast.danger { border-color: rgba(224, 122, 122, 0.45); }
.toast.success { border-color: rgba(127, 199, 155, 0.45); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(0.98); } }

.skeleton { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-hover), var(--surface-active), var(--surface-hover)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 1100px) {
	.grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.split, .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
	.shell { grid-template-columns: 1fr; }
	.sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--border); padding: 12px 16px; }
	.brand { padding: 0 8px 0 0; }
	.nav-label, .sidebar-foot .who-sub { display: none; }
	.sidebar-foot { margin: 0; border: 0; padding: 0 0 0 8px; }
	.main { padding: 20px 16px 40px; }
	.grid-4 { grid-template-columns: 1fr 1fr; }
	.setting { flex-direction: column; align-items: stretch; }
	.setting-control { max-width: none; min-width: 0; justify-content: flex-start; }
}

/* Launcher */
.launcher-setup { color: var(--text-muted); font-size: 14px; line-height: 1.6; }
.launcher-setup ol { margin: 8px 0 0; padding-left: 20px; }
.launcher-group + .launcher-group { margin-top: 14px; }
.launcher-group-head { display: flex; align-items: center; gap: 8px; font-weight: 550; margin-bottom: 8px; }
.launcher-group-head .btn { margin-left: auto; }
.launcher-accounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.launcher-account { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; min-width: 0; }
.launcher-account.on { border-color: var(--accent); background: var(--accent-soft); }
.launcher-account .item-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.launcher-account input { accent-color: var(--accent); margin: 0; }
.launcher-form { display: grid; gap: 12px; max-width: 560px; }
.launcher-add { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.launcher-add .input:first-child { flex: 0 1 180px; }
.launcher-add .input:nth-child(2) { flex: 1 1 280px; }
.launcher-add .input:nth-child(3) { flex: 0 1 170px; }

/* Control panels and the Scripts page */
.modal.panel { max-width: 560px; max-height: 88vh; overflow-y: auto; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.panel-head p { margin: 2px 0 0; }
.panel-section { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 14px; display: grid; gap: 10px; }
.panel-title { font-weight: 600; font-size: 13px; }
.panel-section .item-text { margin: 0; }
textarea.input.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.5; resize: vertical; min-height: 120px; padding: 10px 12px; height: auto; white-space: pre; tab-size: 4; }
.scripts-layout { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }
.scripts-fields { display: grid; grid-template-columns: 1fr 220px; gap: 12px; }
.list .item.active { background: var(--accent-soft); }
@media (max-width: 900px) { .scripts-layout, .scripts-fields { grid-template-columns: 1fr; } }
.modal.panel .row { justify-content: flex-start; margin-top: 0; flex-wrap: nowrap; }
.modal.panel .row .input { flex: 1 1 auto; min-width: 0; }
.modal.panel .row .btn { flex: none; }
.modal.panel .field { display: grid; gap: 6px; }
.modal.panel .panel-section > .row:last-child:has(> .btn.accent:only-child) { justify-content: flex-end; }

/* Accounts table (account manager) */
.farm-bulk { display: flex; align-items: center; gap: 8px; padding: 0 20px 12px; }
.farm-bulk .item-text { margin-right: auto; }
table.farm td { vertical-align: top; }
table.farm td:first-child, table.farm th:first-child { width: 28px; }
table.farm input[type=checkbox] { accent-color: var(--accent); }
.badge.warning { color: #f5b942; border-color: rgba(245, 185, 66, 0.35); }
table.farm .item-actions { flex-wrap: nowrap; justify-content: flex-end; }
.modal.panel [hidden] { display: none !important; }

/* A small on/off switch */
.switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; vertical-align: middle; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span { width: 32px; height: 18px; border-radius: 999px; background: var(--surface-active); border: 1px solid var(--border); transition: background 0.15s; position: relative; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--text-muted); transition: transform 0.15s, background 0.15s; }
.switch input:checked + span { background: var(--accent); border-color: var(--accent); }
.switch input:checked + span::after { transform: translateX(14px); background: #fff; }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
table.farm td .switch + .item-text { white-space: nowrap; }

/* Priority list (config editor) */
.priority { display: grid; gap: 4px; width: 100%; }
.priority-row { display: grid; grid-template-columns: 18px 1fr auto auto auto; gap: 6px; align-items: center; font-size: 13px; padding: 2px 4px; border-radius: 6px; background: var(--surface-hover); }
.priority-row.off .priority-name { opacity: 0.45; }
.priority-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Drops */
.rarity-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }

/* Admin messages */
.item.notice { align-items: flex-start; }
.notice-text { margin-top: 4px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Game pages */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: -6px 0 18px; overflow-x: auto; }
.tab { padding: 9px 14px; font-size: 13px; color: var(--text-muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.page-head.embedded { margin-bottom: 14px; }
.game-group { display: grid; gap: 2px; }
.game-group-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px 6px; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* Auto play zones */
.zone-layout { grid-template-columns: 320px minmax(0, 1fr); }
.zone-map { position: relative; height: 620px; border: 1px solid var(--border); border-radius: 12px; background: #101014; overflow: hidden; }
.zone-svg { width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: none; }
.zone-svg .zone { cursor: grab; }
.planner-controls { position: absolute; right: 12px; bottom: 44px; display: grid; gap: 6px; }
.planner-hint { position: absolute; left: 12px; bottom: 10px; font-size: 12px; color: var(--text-muted); background: rgba(0, 0, 0, 0.45); padding: 4px 8px; border-radius: 6px; }

/* Macro playback */
.pb { display: grid; gap: 12px; }
.pb-map-wrap { position: relative; }
.playback-map { height: 560px; }
.pb-banner { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); padding: 4px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--text); font-size: 12px; font-weight: 600; }
.pb-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pb-buttons { display: flex; gap: 6px; }
.pb-play { min-width: 64px; }
.pb-caption { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 12px; font-size: 14px; padding: 7px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-hover); }
.pb-count { color: var(--text-muted); font-size: 12px; }
.pb-wave { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.pb-what { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-what.upgrade { color: var(--accent); }
.pb-what.sell { color: #ef4444; }
.pb-unit { transition: opacity 0.2s; }
.macro-unit-img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid; flex: none; background: var(--surface-active); }

/* Macro overview */
.macro-layout { display: grid; gap: 16px; grid-template-columns: 300px minmax(0, 1fr); align-items: start; }
@media (max-width: 1000px) { .macro-layout { grid-template-columns: 1fr; } }
.macro-map { width: 100%; height: 420px; display: block; background: #101014; border: 1px solid var(--border); border-radius: 10px; }
.macro-units { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.macro-unit { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-hover); min-width: 0; }
.macro-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.macro-steps { display: grid; gap: 12px; max-height: 520px; overflow-y: auto; }
.macro-wave-title { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.macro-step { display: flex; justify-content: space-between; gap: 12px; padding: 6px 10px; border-radius: 8px; font-size: 13px; border-left: 2px solid var(--border-strong); }
.macro-step.upgrade { border-left-color: var(--accent); }
.macro-step.sell { border-left-color: #ef4444; }

/* the Roblox account a game page is about, above its tabs */
.account-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: -6px 0 14px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface, transparent); }
.account-bar-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
