:root {
	/* Backgrounds */
	--bg-primary: #090112;
	--bg-secondary: #51414f;
	--bg-tertiary: #301934;

	/* Text */
	--text-primary: #d6dce5;
	--text-secondary: #9aa4b2;
	--text-faint: rgba(214, 220, 229, 0.55);

	/* Accents (used sparingly) */
	--accent-sensory: #6fa8dc;
	--accent-energy: #d9b36a;
	--accent-gut: #7fb8a6;
	--accent-iron: #b8746a;
	--accent-nd: #9b8ecf;

	/* States */
	--state-stable: #7faf8a;
	--state-strained: #c2a36b;
	--state-unstable: #b07a7a;

	/* Surfaces & lines */
	--line: rgba(255, 255, 255, 0.08);
	--line-soft: rgba(255, 255, 255, 0.05);
	--shadow:
		0 20px 50px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.03);

	/* Radii */
	--r-lg: 14px;
	--r-md: 10px;
	--r-sm: 8px;

	/* Spacing */
	--gap: 14px;
	--pad: 14px;

	/* Typography */
	--font-ui:
		"Inter", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
		sans-serif;
	--font-mono:
		"JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
		"Liberation Mono", "Courier New", monospace;

	/* Motion */
	--ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Optional: reduced motion support */
@media (prefers-reduced-motion: reduce) {
	* {
		animation: none !important;
		transition: none !important;
		scroll-behavior: auto !important;
	}
}

/* =========================
       Base
========================= */
html {
	background: var(--bg-primary);
}

body {
	background:
		linear-gradient(rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.28)),
		url("/assets/background.png");

	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	background-attachment: fixed;

	color: var(--text-primary);
}

* {
	box-sizing: border-box;
}

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

/* =========================
       App Shell
       ========================= */

.app {
	max-width: 1200px;
	margin: 0 auto;
	padding: 18px;
	min-height: 100%;
	display: flex;
	flex-direction: column;
	gap: var(--gap);
}

/* Header */
.topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--gap);
	padding: 10px 12px;
	border-radius: var(--r-lg);
	background: rgba(17, 20, 26, 0.82);
	border: 1px solid var(--line-soft);
	box-shadow:
		0 20px 50px rgba(0, 0, 0, 0.55),
		inset 0 1px 0 rgba(255, 255, 255, 0.025);
	backdrop-filter: blur(8px);
}

.topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--gap);
}

.brand {
	display: flex;
	align-items: center;
	gap: 14px;
	min-width: 0;
}

.brand-title {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;      
}

.brand h1 {
	margin: 0;
	font-size: 1.6rem;
	font-weight: 600;
	background: linear-gradient(90deg, #f78702, #6ec6ff);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.brand-subtitle {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.subtitle {
	color: var(--text-secondary);
	font-size: 0.82rem;
	font-weight: 450;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.status {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--text-secondary);
	font-size: 0.82rem;
	white-space: nowrap;
	flex-shrink: 0;
}

.dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--state-stable);
	box-shadow: 0 0 0 4px rgba(127, 175, 138, 0.1);
}

.pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 10px;
	border-radius: 999px;
	background: rgba(27, 33, 43, 0.75);
	border: 1px solid var(--line);
	color: var(--text-secondary);
}

/* Main 3 panels */
.main {
	flex: 1;
	display: grid;
	grid-template-columns: 1fr 1.25fr 0.9fr;
	gap: var(--gap);
	min-height: 520px;
}

@media (max-width: 980px) {
	.main {
		grid-template-columns: 1fr;
		min-height: auto;
	}
}

/* Panels */
.panel {
	border-radius: var(--r-lg);
	background: rgba(17, 20, 26, 0.82);
	border: 1px solid var(--line-soft);
	backdrop-filter: blur(10px);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	min-height: 320px;
	box-shadow:
		0 30px 60px rgba(0, 0, 0, 0.55),
		inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.panel-header {
	padding: 12px var(--pad);
	border-bottom: 1px solid var(--line-soft);
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	background: linear-gradient(
		to bottom,
		rgba(255, 255, 255, 0.035),
		rgba(255, 255, 255, 0.01)
	);
}

.panel-title {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 0.92rem;
	font-weight: 600;
	letter-spacing: 0.25px;
}

.panel-title .icon {
	width: 26px;
	height: 26px;
	border-radius: 9px;
	display: inline-grid;
	place-items: center;
	background: rgba(27, 33, 43, 0.9);
	border: 1px solid var(--line);
	color: var(--text-primary);
	font-size: 0.95rem;
}

.panel-subtitle {
	color: var(--text-secondary);
	font-size: 0.78rem;
	font-weight: 450;
	margin-top: 4px;
}

.panel-tools {
	display: flex;
	align-items: center;
	gap: 8px;
}

.btn {
	cursor: pointer;
	border: 1px solid var(--line);
	background: rgba(27, 33, 43, 0.82);
	color: var(--text-secondary);
	padding: 7px 10px;
	border-radius: 10px;
	font-size: 0.78rem;
	transition:
		transform 0.18s var(--ease),
		opacity 0.18s var(--ease);
	user-select: none;
}
.btn:hover {
	opacity: 0.95;
	transform: translateY(-1px);
}
.btn:active {
	transform: translateY(0px);
}

.panel-body {
	padding: var(--pad);
	flex: 1;
	display: grid;
	gap: 12px;
	align-content: start;
}

/* Placeholder “viz” canvases */
.viz {
	position: relative;
	border-radius: var(--r-md);
	background: rgba(10, 12, 16, 0.96);
	border: 1px solid var(--line);
	min-height: 260px;
	overflow: hidden;
}

.viz::after {
	content: "";
	position: absolute;
	inset: 0;
	background:
		radial-gradient(
			600px 240px at 15% 20%,
			rgba(155, 142, 207, 0.045),
			transparent 60%
		),
		radial-gradient(
			540px 260px at 70% 25%,
			rgba(155, 142, 207, 0.045),
			transparent 60%
		),
		radial-gradient(
			700px 260px at 50% 90%,
			rgba(217, 179, 106, 0.035),
			transparent 65%
		);
	pointer-events: none;
	opacity: 0.75;
}

.viz-grid {
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(
			to right,
			rgba(255, 255, 255, 0.04) 1px,
			transparent 1px
		),
		linear-gradient(
			to bottom,
			rgba(255, 255, 255, 0.04) 1px,
			transparent 1px
		);
	background-size: 38px 38px;
	opacity: 0.18;
	pointer-events: none;
	mask-image: radial-gradient(circle at 50% 40%, black 35%, transparent 70%);
}

.viz-label {
	position: absolute;
	left: 12px;
	top: 12px;
	color: var(--text-secondary);
	font-family: var(--font-mono);
	font-size: 0.72rem;
	letter-spacing: 0.2px;
	opacity: 0.9;
}

/* Tiny decorative “nodes” */
.node {
	position: absolute;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: rgba(214, 220, 229, 0.55);
	box-shadow: 0 0 0 4px rgba(214, 220, 229, 0.1);
	opacity: 0.9;
}
.node.accent-nd {
	background: var(--accent-nd);
	box-shadow: 0 0 0 6px rgba(155, 142, 207, 0.14);
}
.node.accent-sensory {
	background: var(--accent-sensory);
	box-shadow: 0 0 0 6px rgba(111, 168, 220, 0.14);
}
.node.accent-energy {
	background: var(--accent-energy);
	box-shadow: 0 0 0 6px rgba(217, 179, 106, 0.14);
}
.node.accent-iron {
	background: var(--accent-iron);
	box-shadow: 0 0 0 6px rgba(184, 116, 106, 0.14);
}
.node.accent-gut {
	background: var(--accent-gut);
	box-shadow: 0 0 0 6px rgba(127, 184, 166, 0.14);
}

.node {
	cursor: pointer;
}

.node:focus-visible,
.node:hover {
	outline: 2px solid rgba(255, 255, 255, 0.25);
	outline-offset: 3px;
}

/* Inspector cards */
.card {
	border-radius: var(--r-md);
	background: rgba(17, 20, 26, 0.82);
	border: 1px solid var(--line);
	padding: 12px;
}

.kv {
	display: grid;
	grid-template-columns: 90px 1fr;
	gap: 6px 10px;
	font-size: 0.82rem;
	line-height: 1.45;
}

.k {
	color: var(--text-secondary);
	font-family: var(--font-mono);
	font-size: 0.74rem;
	letter-spacing: 0.2px;
}

.v {
	color: var(--text-primary);
	font-weight: 450;
}

.tagrow {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 10px;
}

.tag {
	font-size: 0.72rem;
	color: var(--text-secondary);
	border: 1px solid var(--line);
	background: rgba(14, 17, 22, 0.35);
	padding: 6px 8px;
	border-radius: 999px;
}

.tag.nd {
	border-color: rgba(155, 142, 207, 0.35);
	color: rgba(155, 142, 207, 0.95);
}
.tag.stable {
	border-color: rgba(127, 175, 138, 0.35);
	color: rgba(127, 175, 138, 0.95);
}
.tag.strained {
	border-color: rgba(194, 163, 107, 0.35);
	color: rgba(194, 163, 107, 0.95);
}

/* Bottom bar */
.bottom {
	margin-top: 1.5rem;
	padding: 1.2rem;
	border-radius: 18px;
	background: linear-gradient(
		180deg,
		rgba(30, 28, 36, 0.85),
		rgba(18, 16, 22, 0.9)
	);
	backdrop-filter: blur(14px);
}

.bottom-inner {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 1.2rem;
}

.bottom-panel {
	background: rgba(0, 0, 0, 0.35);
	border-radius: 14px;
	padding: 1rem;
}

@media (max-width: 980px) {
	.bottom-inner {
		grid-template-columns: 1fr;
	}
}

.section-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 10px;
}

.section-title h3 {
	margin: 0;
	font-size: 0.88rem;
	font-weight: 600;
	letter-spacing: 0.2px;
}

.section-title small {
	color: var(--text-secondary);
	font-size: 0.74rem;
	font-family: var(--font-mono);
}

/* Sliders */
.controls {
	display: grid;
	gap: 10px;
}

.control {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 8px 12px;
	align-items: center;
	padding: 10px 10px;
	border-radius: var(--r-md);
	border: 1px solid var(--line);
	background: rgba(17, 20, 26, 0.82);
}

.control label {
	font-size: 0.82rem;
	font-weight: 450;
}

.control .meta {
	color: var(--text-secondary);
	font-size: 0.72rem;
	font-family: var(--font-mono);
}

input[type="range"] {
	grid-column: 1 / -1;
	width: 100%;
	accent-color: var(--accent-nd);
}

/* Profiles */
.profiles {
	display: grid;
	gap: 10px;
}

.profile-list {
	display: grid;
	gap: 8px;
}

.profile {
	border: 1px solid var(--line);
	background: rgba(17, 20, 26, 0.82);
	border-radius: var(--r-md);
	padding: 10px 10px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	cursor: pointer;
	transition:
		transform 0.18s var(--ease),
		opacity 0.18s var(--ease);
}
.profile:hover {
	opacity: 0.95;
	transform: translateY(-1px);
}
.profile:active {
	transform: translateY(0px);
}

.profile .name {
	font-size: 0.82rem;
	font-weight: 600;
}
.profile .desc {
	font-size: 0.74rem;
	color: var(--text-secondary);
	margin-top: 2px;
}
.profile .chev {
	color: var(--text-secondary);
	font-family: var(--font-mono);
	font-size: 0.82rem;
	opacity: 0.85;
}

/* System Log */
.log {
	border: 1px solid var(--line);
	background: rgba(17, 20, 26, 0.82);
	border-radius: var(--r-md);
	padding: 10px;
	font-family: var(--font-mono);
	font-size: 0.72rem;
	line-height: 1.55;
	color: var(--text-secondary);
	max-height: 350px;
	overflow: auto;
}

.log .info {
	color: rgba(154, 164, 178, 0.95);
}
.log .note {
	color: rgba(155, 142, 207, 0.95);
}
.log .warn {
	color: rgba(194, 163, 107, 0.95);
}
.log .err {
	color: rgba(176, 122, 122, 0.95);
}

/* Footer hint */
.hint {
	margin-top: 8px;
	color: var(--text-faint);
	font-size: 0.75rem;
	line-height: 1.5;
}

/* =========================
   Footer
   ========================= */

.app-footer {
	margin-top: 24px;
	padding: 12px 0;
	color: #0f0f0f;
	text-align: center;
	font-weight: bold;
	font-family: var(--font-mono);
	font-size: 0.9rem;
	letter-spacing: 0.12em;
	border-top: 1px solid var(--line-soft);
}

.app-footer::before {
	content: "[END OF SYSTEM CONTEXT]";
	display: block;
	margin-bottom: 6px;
	font-weight: bold;
	color: #0f0f0f;
	font-size: 0.8rem;
	letter-spacing: 0.3em;
}

.node.active {
	transform: scale(1.15);
	box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.12);
}

.neuron {
	position: absolute;
	width: 10px;
	height: 10px;
	border-radius: 50%;

	background: var(--neuron-color, #6ec6ff);

	box-shadow:
		0 0 6px var(--neuron-color),
		0 0 14px var(--neuron-color);

	opacity: 0;
	transform: scale(0.6);
	animation:
		neuron-in 420ms ease forwards,
		pulse 3.8s ease-in-out infinite;

	animation-delay: 0ms, calc(var(--pulse-offset, 0) * 1ms);
}

@keyframes neuron-in {
	to {
		opacity: 1;
		transform: scale(1);
	}
}

@keyframes pulse {
	0% {
		transform: scale(1);
		opacity: 0.75;
	}
	45% {
		transform: scale(1.55);
		opacity: 1;
	}
	100% {
		transform: scale(1);
		opacity: 0.75;
	}
}

.connection {
	position: absolute;
	height: 1px;
	background: linear-gradient(
		to right,
		transparent,
		rgba(180, 160, 255, 0.55),
		transparent
	);
	transform-origin: left center;
	filter: blur(0.3px);
	opacity: 0.4;
}

.input-viz {
	position: relative;
	padding: 2.2rem 1rem 1rem;
	height: 100%;
	overflow: hidden;
}

#healthInput {
	width: 100%;
	height: 100%;
	resize: none;

	background: transparent;
	border: none;
	outline: none;

	color: var(--text-primary);
	font-family: var(--font-mono);
	font-size: 0.95rem;
	line-height: 1.5;

	overflow-y: auto;
	padding-right: 0.4rem;
}

.input-viz .viz-label {
	position: absolute;
	top: 0.7rem;
	left: 0.9rem;
	font-family: var(--font-mono);
	font-size: 0.75rem;
	letter-spacing: 0.08em;
	opacity: 0.6;
	pointer-events: none;
}

#healthInput::-webkit-scrollbar {
	width: 6px;
}

#healthInput::-webkit-scrollbar-thumb {
	background: rgba(200, 180, 255, 0.25);
	border-radius: 6px;
}

.log-panel {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.log {
	flex: 1;
	overflow-y: auto;
	padding-right: 4px;
}

.log-footer {
	margin-top: 10px;
	display: flex;
	justify-content: flex-end;
}

.export-btn {
	opacity: 0.85;
}

.export-btn:hover {
	opacity: 1;
}

.viz.network-full {
	box-shadow:
		0 0 0 1px rgba(194, 163, 107, 0.4),
		0 0 24px rgba(194, 163, 107, 0.25);
}

.network-overlay {
	position: absolute;
	inset: 0;
	background: rgba(5, 6, 10, 0.72);
	backdrop-filter: blur(6px);
	display: grid;
	place-items: center;
	z-index: 20;
}

.network-overlay-card {
	max-width: 420px;
	padding: 20px 22px;
	border-radius: 16px;
	background: rgba(17, 20, 26, 0.95);
	border: 1px solid var(--line);
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65);
	text-align: center;
}

.network-overlay-card h3 {
	margin: 0 0 10px;
	font-size: 1rem;
	font-weight: 600;
	color: var(--text-primary);
}

.network-overlay-card p {
	margin: 6px 0;
	font-size: 0.82rem;
	line-height: 1.45;
	color: var(--text-secondary);
}

.overlay-actions {
	margin-top: 16px;
	display: flex;
	justify-content: center;
}

.btn-reset-overlay {
	padding: 8px 14px;
	font-size: 0.8rem;
}

.network-overlay[hidden] {
	display: none !important;
}

/* Node hover tooltip */
.node-tooltip {
	position: absolute;
	z-index: 20;
	max-width: 220px;
	padding: 6px 8px;

	background: rgba(15, 18, 24, 0.92);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 8px;

	color: #e6e6f0;
	font-size: 0.72rem;
	line-height: 1.4;

	pointer-events: none;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
	backdrop-filter: blur(6px);
}

/* Selected neuron feedback */
.neuron.selected {
	transform: scale(1.25);
	box-shadow:
		0 0 0 6px rgba(255, 255, 255, 0.12),
		0 0 22px var(--neuron-color);
	z-index: 5;
}

.neuron {
	cursor: pointer;
}

.neuron:focus-visible {
	outline: 2px solid rgba(255, 255, 255, 0.6);
	outline-offset: 4px;
	box-shadow:
		0 0 0 6px rgba(255, 255, 255, 0.15),
		0 0 18px var(--neuron-color);
}

.about-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(8px);
	display: grid;
	place-items: center;
	z-index: 1000;
}

.about-overlay[hidden] {
	display: none !important;
}
.about-card {
	max-width: 560px;
	background: rgba(17, 20, 26, 0.95);
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	padding: 22px;
	box-shadow: var(--shadow);
	color: var(--text-primary);
}

.about-card h2 {
	margin-top: 0;
}

.about-card h3 {
	margin-top: 18px;
	font-size: 0.9rem;
}

.about-card ul {
	padding-left: 18px;
	font-size: 0.82rem;
	color: var(--text-secondary);
}

.about-note {
	margin-top: 14px;
	font-size: 0.78rem;
	color: var(--text-faint);
}

.about-actions {
	margin-top: 18px;
	display: flex;
	justify-content: flex-end;
}

.brand-row {
	display: flex;
	align-items: center;
	gap: 12px;
}

.pill-about {
	font-size: 0.75rem;
	padding: 4px 10px;
	opacity: 0.85;
}

.pill-about:hover {
	opacity: 1;
}

/* ===============================
   CONTEXT PANEL — BASE
================================ */

.context-panel {
	display: flex;
	flex-direction: column;
	height: 260px;
	padding: 14px;
	background: rgba(17, 20, 26, 0.6);
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	box-sizing: border-box;
}

/* Title area */
.context-panel .section-title {
	margin-bottom: 8px;
}

.context-panel h3 {
	margin: 0;
	font-size: 0.95rem;
}

.context-panel small {
	font-size: 0.7rem;
	color: var(--text-faint);
}

/* ===============================
   CONTEXT BODY
================================ */

.context-body {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
}

/* Empty state */
.context-empty {
	font-size: 0.8rem;
	color: var(--text-faint);
	margin-top: 12px;
}

/* ===============================
   SUMMARY TEXT
================================ */

.context-summary {
	margin-bottom: 8px;
}

.context-summary p {
	margin: 0;
	font-size: 0.82rem;
	line-height: 1.5;
	color: var(--text-secondary);
}

/* ===============================
   SCROLLABLE LOG CONTAINER
================================ */

.context-log-list {
	flex: 1;
	overflow-y: auto;
	padding-right: 6px;
	border-top: 1px solid var(--line);
	margin-top: 8px;
}

/* Scrollbar (optional polish) */
.context-log-list::-webkit-scrollbar {
	width: 6px;
}

.context-log-list::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.12);
	border-radius: 4px;
}

/* ===============================
   LOG ITEMS
================================ */

.context-log-item {
	padding: 8px 0;
	border-bottom: 1px dashed var(--line);
}

.context-log-text {
	font-size: 0.8rem;
	color: var(--text-primary);
}

.context-log-time {
	margin-top: 4px;
	font-size: 0.7rem;
	color: var(--text-faint);
}

.context-panel {
	display: flex;
	flex-direction: column;
	height: 100%;
	min-height: 220px;
	border: 1px solid var(--line);
	border-radius: var(--r-md);
	padding: 12px;
	background: rgba(12, 15, 20, 0.6);
}

.context-body {
	flex: 1;
	overflow-y: auto;
	padding-right: 6px;
}

.context-summary {
	font-size: 0.85rem;
	line-height: 1.55;
	color: var(--text-primary);
}

.context-log-list {
	margin-top: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	max-height: 240px;
	overflow-y: auto;
	padding-right: 6px;
}

.context-log-item {
	padding: 8px 10px;
	border-left: 2px solid var(--accent-soft);
	background: rgba(255, 255, 255, 0.02);
	border-radius: var(--r-sm);
}

.context-log-text {
	font-size: 0.82rem;
	color: var(--text-secondary);
}

.context-log-time {
	font-size: 0.72rem;
	color: var(--text-faint);
	margin-top: 4px;
}

/* ================================
   Additional Notes Panel
   (user-owned, non-analytical)
================================ */

.notes-panel {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.notes-wrap {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* Free text area */
.notes-textarea {
	width: 100%;
	min-height: 220px;
	resize: vertical;

	padding: 12px 14px;

	background: rgba(10, 12, 16, 0.92);
	border: 1px solid var(--line);
	border-radius: var(--r-md);

	color: var(--text-primary);
	font-family: var(--font-inter);
	font-size: 0.82rem;
	line-height: 1.55;

	box-shadow:
		inset 0 0 0 1px rgba(255, 255, 255, 0.02),
		inset 0 8px 20px rgba(0, 0, 0, 0.35);

	transition:
		border-color 0.18s var(--ease),
		box-shadow 0.18s var(--ease),
		background 0.18s var(--ease);
}

.notes-textarea::placeholder {
	color: var(--text-secondary);
	opacity: 0.65;
}

/* Focus state – gentle, not clinical */
.notes-textarea:focus {
	outline: none;
	border-color: rgba(155, 142, 207, 0.6);
	box-shadow:
		0 0 0 2px rgba(155, 142, 207, 0.18),
		inset 0 8px 20px rgba(0, 0, 0, 0.35);
	background: rgba(10, 12, 16, 0.96);
}

/* Footer alignment (reuse log footer look) */
#panelNotes .log-footer {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 4px;
}

/* Slightly soften the hint here */
#panelNotes .hint {
	font-size: 0.72rem;
	color: var(--text-secondary);
	opacity: 0.8;
}

/* ================================
   Brand Logo (Header)
================================ */

.brand-title {
	display: flex;
	align-items: center;
	gap: 10px;
}

.brand-logo {
	width: 104px;
	height: 104px;
	object-fit: contain;

	filter: drop-shadow(0 0 6px rgba(155, 200, 255, 0.35));
	opacity: 0.95;
}

/* Slightly scale down on small screens */
@media (max-width: 520px) {
	.brand-logo {
		width: 28px;
		height: 28px;
	}
}

.brand-title:hover .brand-logo {
	opacity: 1;
	filter: drop-shadow(0 0 8px rgba(155, 200, 255, 0.5));
}

.brand-title h1 {
	margin: 0;
}

/* ================================
   Inline Brand Subtitle
================================ */
.brand-subtitle {
	margin-left: 4px;
}

.brand-subtitle {
	opacity: 0.75;
}

.brand-subtitle {
	color: var(--text-secondary);
	font-size: 0.75rem;
	font-weight: 450;
	opacity: 0.75;
	position: relative;
	top: 1px;

	white-space: nowrap;
}

@media (max-width: 720px) {
	.brand-subtitle {
		white-space: normal;
		margin-top: 4px;
	}
}

@media (max-width: 480px) {
	.topbar {
		gap: 0.5rem;
	}

	.status {
		display: flex;
		flex-wrap: wrap;
		gap: 0.35rem;
		align-items: center;
	}

	.pill {
		padding: 0.28rem 0.55rem;
		font-size: 0.68rem;
		border-radius: 999px;

		background: rgba(255, 255, 255, 0.05);
		border: 1px solid rgba(255, 255, 255, 0.1);
	}

	.pill span {
		white-space: nowrap;
	}

	.pill .dot {
		width: 0.35rem;
		height: 0.35rem;
		box-shadow: 0 0 4px rgba(76, 255, 154, 0.5);
	}

	.pill[title] {
		opacity: 0.85;
	}
}

@media (max-width: 640px) {
	.topbar {
		flex-direction: column;
		align-items: stretch;
	}

	.brand {
		width: 100%;
		justify-content: space-between;
	}

	.status {
		justify-content: center;
		padding-top: 4px;
	}
}

/* Diagram container */
.howitworks-visual {
	position: relative;
	margin: 1.25rem 0 1.5rem;
	padding: 1rem;
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.03);
}

.zoomable-diagram {
	width: 100%;
	height: auto;
	max-height: 420px;
	object-fit: contain;
	cursor: zoom-in;
}

.zoom-hint {
	position: absolute;
	bottom: 10px;
	right: 12px;

	display: flex;
	align-items: center;
	gap: 6px;

	padding: 6px 10px;
	border-radius: 999px;

	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.02em;

	color: #e5e7eb;
	background: rgba(2, 6, 23, 0.75);
	border: 1px solid rgba(148, 163, 184, 0.25);

	backdrop-filter: blur(6px);
	pointer-events: none;
}

@keyframes zoomPulse {
	0% { opacity: 0.6; }
	50% { opacity: 1; }
	100% { opacity: 0.6; }
}

.zoom-hint {
	animation: zoomPulse 2.5s ease-in-out infinite;
}

/* Lightbox */
.diagram-lightbox {
	position: fixed;
	inset: 0;
	background: rgba(2, 6, 23, 0.92);
	align-items: center;
	justify-content: center;
	z-index: 10000;
	cursor: zoom-out;
	display: none;
}

.diagram-lightbox:not([hidden]) {
	display: flex;
}

.diagram-lightbox img {
	max-width: 96vw;
	max-height: 96vh;
	border-radius: 14px;
	box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
}

.lightbox-close {
	position: fixed;
	top: 14px;
	right: 14px;

	width: 44px;
	height: 44px;

	border-radius: 50%;
	border: none;

	background: rgba(15, 23, 42, 0.9);
	color: #f8fafc;

	font-size: 1.25rem;
	line-height: 1;

	display: flex;
	align-items: center;
	justify-content: center;

	cursor: pointer;
	z-index: 10001;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.lightbox-close:active {
	transform: scale(0.95);
}

/* About overlay should scroll, not trap */
.about-overlay {
	position: fixed;
	inset: 0;
	z-index: 9000;

	display: flex;
	justify-content: center;
	align-items: center;

	padding: 1rem;
	overflow: hidden;
}

/* Card scrolls internally */
.about-card {
	max-height: 90vh;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

/* Mobile close button */
.about-close-top {
	position: fixed;
	top: 14px;
	right: 14px;

	width: 44px;
	height: 44px;

	border-radius: 50%;
	border: none;

	background: rgba(15, 23, 42, 0.95);
	color: #f8fafc;

	font-size: 1.25rem;
	line-height: 1;

	display: flex;
	align-items: center;
	justify-content: center;

	z-index: 9100;
	cursor: pointer;

	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

/* Optional: hide top button on desktop */
@media (min-width: 768px) {
	.about-close-top {
		display: none;
	}
}

