/* =========================================================
   jupilot — app design system
   Graphite surfaces · lime accent · Geist / Geist Mono
   ========================================================= */

:root {
	/* Surfaces */
	--bg: #0b0d11;
	--bg-elev: #0e1015;
	--surface: #12151b;
	--surface-2: #171a21;
	--surface-3: #1d212a;
	--surface-4: #272c36;
	--inset: #0d0f14;

	/* Lines */
	--border: rgba(255, 255, 255, 0.06);
	--border-2: rgba(255, 255, 255, 0.09);
	--border-strong: rgba(255, 255, 255, 0.14);

	/* Text */
	--text: #edf0f4;
	--text-2: #bcc3ce;
	--muted: #8b93a1;
	--dim: #5f6775;

	/* Accent (brand) */
	--accent: #a8e86a;
	--accent-hover: #b9f07f;
	--accent-ink: #0d1606;
	--accent-rgb: 168, 232, 106;
	--accent-bg: rgba(var(--accent-rgb), 0.1);
	--accent-border: rgba(var(--accent-rgb), 0.3);

	/* Semantic */
	--green: #4fd18b;
	--green-rgb: 79, 209, 139;
	--green-bg: rgba(var(--green-rgb), 0.1);
	--red: #f2707a;
	--red-rgb: 242, 112, 122;
	--red-bg: rgba(var(--red-rgb), 0.1);
	--amber: #e8b34f;
	--amber-rgb: 232, 179, 79;
	--amber-bg: rgba(var(--amber-rgb), 0.1);
	--blue: #7aa7ff;
	--blue-rgb: 122, 167, 255;
	--blue-bg: rgba(var(--blue-rgb), 0.1);
	--warn: var(--amber);

	/* Avatar tones */
	--violet: #a78bfa;
	--teal: #2dd4bf;
	--orange: #fb923c;
	--pink: #f472b6;
	--indigo: #818cf8;
	--slate: #94a3b8;

	/* Layout */
	--sidebar: 236px;
	--topbar: 60px;
	--content-max: 1320px;
	--content-pad: clamp(14px, 4vw, 32px);
	--tap: 44px;
	--fs-input: 16px;
	--safe-t: env(safe-area-inset-top, 0px);
	--safe-b: env(safe-area-inset-bottom, 0px);
	--safe-l: env(safe-area-inset-left, 0px);
	--safe-r: env(safe-area-inset-right, 0px);
	--tabbar-h: 56px;
	--press: rgba(255, 255, 255, 0.06);

	/* Spacing */
	--s-1: 4px;
	--s-2: 8px;
	--s-3: 12px;
	--s-4: 16px;
	--s-5: 20px;
	--s-6: 24px;
	--s-8: 32px;
	--s-10: 40px;
	--gap: 16px;
	--pad-x: 18px;

	/* Radius */
	--r-xs: 6px;
	--r-sm: 8px;
	--r: 10px;
	--r-lg: 14px;
	--r-xl: 18px;
	--r-pill: 999px;

	/* Type */
	--fs-2xs: 10.5px;
	--fs-xs: 11px;
	--fs-sm: 12px;
	--fs-md: 13px;
	--fs-base: 14px;
	--fs-lg: 15px;
	--fs-xl: 18px;
	--fs-2xl: 24px;
	--fs-3xl: 30px;
	--lh: 1.5;
	--lh-tight: 1.2;
	--tracking: -0.006em;
	--tracking-tight: -0.022em;
	--tracking-label: 0.06em;

	/* Elevation */
	--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
	--shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04);
	--shadow-lg: 0 32px 80px -16px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.05);
	--ring: 0 0 0 3px rgba(var(--accent-rgb), 0.22);
	--highlight: inset 0 1px 0 rgba(255, 255, 255, 0.03);

	/* Motion */
	--ease: cubic-bezier(0.2, 0.8, 0.2, 1);
	--t: 0.14s var(--ease);
	--t-slow: 0.24s var(--ease);

	/* Fonts */
	--font: "Geist", "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
	--mono: "Geist Mono", "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;
}

/* ---------- Reset ---------- */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	font-size: 16px;
	-webkit-text-size-adjust: 100%;
	color-scheme: dark;
	touch-action: manipulation;
}

* {
	-webkit-tap-highlight-color: transparent;
}

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

body {
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: var(--fs-base);
	font-weight: 400;
	line-height: var(--lh);
	letter-spacing: var(--tracking);
	overflow-x: clip;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	font-feature-settings: "ss01", "cv11";
}

body.is-locked {
	overflow: hidden;
}

h1,
h2,
h3,
h4,
p {
	margin: 0;
}

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

button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
	letter-spacing: inherit;
}

button {
	cursor: pointer;
}

button:disabled {
	cursor: not-allowed;
}

img,
svg {
	display: block;
	max-width: 100%;
}

b,
strong {
	font-weight: 600;
}

code {
	font-family: var(--mono);
}

::selection {
	background: rgba(var(--accent-rgb), 0.3);
	color: var(--text);
}

* {
	scrollbar-width: thin;
	scrollbar-color: var(--surface-4) transparent;
}

*::-webkit-scrollbar {
	width: 10px;
	height: 10px;
}

*::-webkit-scrollbar-track {
	background: transparent;
}

*::-webkit-scrollbar-thumb {
	background: var(--surface-4);
	border: 3px solid transparent;
	border-radius: 99px;
	background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
	background: #353b47;
	background-clip: content-box;
}

:focus {
	outline: none;
}

:focus-visible {
	outline: none;
	box-shadow: var(--ring);
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
	}

	html {
		scroll-behavior: auto !important;
	}

	.skeleton {
		animation: none !important;
	}

	.btn:active,
	.tabbar-item:active,
	[data-href]:active,
	.tabbar-item.is-on {
		transform: none !important;
	}
}

@media (display-mode: standalone) {
	html {
		overscroll-behavior-y: none;
	}
}

/* ---------- Utilities ---------- */

.hidden {
	display: none !important;
}

.is-hidden {
	display: none !important;
}

.mono {
	font-family: var(--mono);
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.01em;
}

.num {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.up {
	color: var(--green) !important;
}

.down {
	color: var(--red) !important;
}

.flat {
	color: var(--muted) !important;
}

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

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

.grow {
	flex: 1 1 auto;
}

.t-clip {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

[hidden] {
	display: none !important;
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.hint {
	color: var(--muted);
	font-size: var(--fs-sm);
	font-weight: 450;
}

a.hint {
	transition: color var(--t);
}

a.hint:hover {
	color: var(--text);
}

.help {
	color: var(--muted);
	font-size: var(--fs-md);
	line-height: 1.55;
	margin: 6px 0 0;
}

.help b {
	color: var(--text-2);
	font-weight: 550;
}

.stack {
	display: flex;
	flex-direction: column;
	gap: var(--gap);
	min-width: 0;
}

.stack-panels {
	display: flex;
	flex-direction: column;
	gap: var(--gap);
	min-width: 0;
}

.form-row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--s-2);
}

.sep {
	width: 1px;
	align-self: stretch;
	background: var(--border-2);
	margin: 4px 2px;
}

/* ---------- App shell ---------- */

.app {
	display: grid;
	grid-template-columns: var(--sidebar) minmax(0, 1fr);
	min-height: 100vh;
}

.sidebar {
	position: sticky;
	top: 0;
	height: 100vh;
	display: flex;
	flex-direction: column;
	background: var(--bg-elev);
	border-right: 1px solid var(--border);
	z-index: 40;
}

.brand {
	display: flex;
	align-items: center;
	gap: 10px;
	height: var(--topbar);
	padding: 0 20px;
	flex-shrink: 0;
	color: var(--accent);
}

.brand-mark {
	width: 22px;
	height: 22px;
	display: grid;
	place-items: center;
	flex-shrink: 0;
	color: var(--accent);
}

.brand-mark svg {
	width: 22px;
	height: 22px;
}

.brand-name {
	font-size: 17px;
	font-weight: 600;
	letter-spacing: -0.035em;
	color: var(--text);
	text-transform: lowercase;
}

.nav {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 8px 12px;
	overflow-y: auto;
}

.nav-label {
	padding: 14px 10px 6px;
	color: var(--dim);
	font-size: var(--fs-2xs);
	font-weight: 600;
	letter-spacing: var(--tracking-label);
	text-transform: uppercase;
}

.nav-label:first-child {
	padding-top: 6px;
}

.nav-link {
	position: relative;
	display: flex;
	align-items: center;
	gap: 11px;
	height: 36px;
	padding: 0 10px;
	border-radius: var(--r-sm);
	color: var(--muted);
	font-size: var(--fs-base);
	font-weight: 500;
	transition: background var(--t), color var(--t);
}

.nav-link svg {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	opacity: 0.85;
}

.nav-link:hover {
	color: var(--text);
	background: rgba(255, 255, 255, 0.03);
}

.nav-link.is-active {
	color: var(--text);
	background: var(--surface-2);
	box-shadow: inset 0 0 0 1px var(--border);
}

.nav-link.is-active svg {
	color: var(--accent);
	opacity: 1;
}

.nav-link.is-active::before {
	content: "";
	position: absolute;
	left: -12px;
	top: 9px;
	bottom: 9px;
	width: 3px;
	border-radius: 0 3px 3px 0;
	background: var(--accent);
}

.sidebar-foot {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 12px;
	border-top: 1px solid var(--border);
}

.side-user {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px;
	border-radius: var(--r-sm);
	transition: background var(--t);
}

.side-user:hover {
	background: rgba(255, 255, 255, 0.03);
}

.side-user > span:last-child {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.side-user .value {
	font-size: var(--fs-md);
	font-weight: 550;
	color: var(--text);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.side-user .label {
	font-size: var(--fs-xs);
	color: var(--dim);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.side-meta,
.logout-link {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	flex-shrink: 0;
	border-radius: var(--r-sm);
	color: var(--dim);
	transition: background var(--t), color var(--t);
}

.side-meta:hover,
.logout-link:hover {
	background: var(--red-bg);
	color: var(--red);
}

.sidebar-scrim {
	display: none;
}

.main {
	min-width: 0;
	display: flex;
	flex-direction: column;
}

/* ---------- Topbar ---------- */

.topbar {
	position: sticky;
	top: 0;
	z-index: 30;
	height: var(--topbar);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--s-3);
	padding: 0 var(--content-pad);
	background: rgba(11, 13, 17, 0.78);
	backdrop-filter: saturate(140%) blur(14px);
	-webkit-backdrop-filter: saturate(140%) blur(14px);
	border-bottom: 1px solid var(--border);
}

.topbar-title {
	min-width: 0;
	font-size: var(--fs-md);
	font-weight: 500;
	color: var(--muted);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mobile-toggle {
	display: none;
	width: 36px;
	height: 36px;
	place-items: center;
	padding: 0;
	border: 1px solid var(--border-2);
	border-radius: var(--r-sm);
	background: var(--surface);
	color: var(--text-2);
}

.mobile-toggle svg {
	width: 18px;
	height: 18px;
}

.top-actions {
	display: flex;
	align-items: center;
	gap: var(--s-3);
	margin-left: auto;
}

.funds {
	display: flex;
	align-items: stretch;
	height: 36px;
	border: 1px solid var(--border-2);
	border-radius: var(--r);
	background: var(--surface);
	box-shadow: var(--highlight);
}

.wallet-chip {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 0 10px 0 12px;
	border-right: 1px solid var(--border);
}

.chip-main {
	display: flex;
	align-items: baseline;
	gap: 7px;
}

.chip-k {
	color: var(--dim);
	font-size: var(--fs-2xs);
	font-weight: 600;
	letter-spacing: var(--tracking-label);
}

.wallet-chip .amt {
	font-family: var(--mono);
	font-size: var(--fs-md);
	font-weight: 500;
	font-variant-numeric: tabular-nums;
	color: var(--text);
}

.wallet-chip.is-warn .chip-k {
	color: var(--amber);
}

.wallet-chip.is-warn .chip-k::before {
	content: "";
	display: inline-block;
	width: 6px;
	height: 6px;
	margin-right: 6px;
	border-radius: 50%;
	background: var(--amber);
	vertical-align: 1px;
	box-shadow: 0 0 0 3px rgba(var(--amber-rgb), 0.16);
}

.fund-info {
	position: relative;
	display: inline-grid;
	place-items: center;
	width: 18px;
	height: 18px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--dim);
	cursor: help;
	transition: color var(--t);
}

.fund-info-ico {
	width: 11px;
	height: 11px;
}

.fund-info:hover,
.fund-info:focus-visible {
	color: var(--text-2);
}

.fund-tip {
	position: absolute;
	top: calc(100% + 12px);
	right: -8px;
	width: 248px;
	padding: 10px 12px;
	border: 1px solid var(--border-2);
	border-radius: var(--r);
	background: var(--surface-3);
	box-shadow: var(--shadow);
	color: var(--text-2);
	font-size: var(--fs-sm);
	font-weight: 450;
	line-height: 1.5;
	letter-spacing: 0;
	text-align: left;
	white-space: normal;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-4px);
	transition: opacity var(--t), transform var(--t), visibility var(--t);
	pointer-events: none;
	z-index: 50;
}

@media (hover: hover) and (pointer: fine) {
	.fund-info:hover .fund-tip,
	.fund-info:focus-visible .fund-tip {
		opacity: 1;
		visibility: visible;
		transform: translateY(0);
	}
}

.fund-info.is-open .fund-tip {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	pointer-events: auto;
}

.btn-deposit {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 3px;
	padding: 0 12px;
	border: 0;
	border-radius: 7px;
	background: var(--accent);
	color: var(--accent-ink);
	font-size: var(--fs-md);
	font-weight: 600;
	transition: background var(--t);
}

.btn-deposit:hover {
	background: var(--accent-hover);
}

.btn-deposit svg {
	width: 14px;
	height: 14px;
}

.top-divider {
	width: 1px;
	height: 20px;
	background: var(--border-2);
}

.menu-btn {
	position: relative;
}

.user-btn {
	display: grid;
	place-items: center;
	padding: 2px;
	border: 1px solid transparent;
	border-radius: 50%;
	background: transparent;
	transition: border-color var(--t);
}

.user-btn:hover,
.user-btn[aria-expanded="true"] {
	border-color: var(--border-strong);
}

/* ---------- Popover ---------- */

.popover {
	position: absolute;
	top: calc(100% + 10px);
	right: 0;
	width: 280px;
	padding: 6px;
	background: var(--surface-2);
	border: 1px solid var(--border-2);
	border-radius: var(--r-lg);
	box-shadow: var(--shadow-lg);
	z-index: 60;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-6px) scale(0.98);
	transform-origin: top right;
	transition: opacity var(--t), transform var(--t), visibility var(--t);
}

.popover.is-open {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.user-pop-head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 10px 12px;
	margin-bottom: 4px;
	border-bottom: 1px solid var(--border);
}

.user-pop-meta {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.user-pop-meta b {
	font-size: var(--fs-base);
	font-weight: 600;
}

.user-pop-meta span {
	color: var(--muted);
	font-size: var(--fs-sm);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.user-pop-menu {
	display: flex;
	flex-direction: column;
	gap: 1px;
}

.user-pop-menu a,
.user-pop-menu button {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 1px;
	width: 100%;
	padding: 8px 10px;
	border: 0;
	border-radius: var(--r-sm);
	background: transparent;
	text-align: left;
	transition: background var(--t);
}

.user-pop-menu a:hover,
.user-pop-menu button:hover {
	background: rgba(255, 255, 255, 0.04);
}

.user-pop-menu b {
	font-size: var(--fs-md);
	font-weight: 550;
}

.user-pop-menu span {
	font-size: var(--fs-sm);
	color: var(--muted);
}

.user-pop-menu .is-danger b {
	color: var(--red);
}

/* ---------- Content ---------- */

.content {
	width: 100%;
	max-width: var(--content-max);
	margin: 0 auto;
	padding: 28px var(--content-pad) 64px;
	animation: page-in 0.32s var(--ease) both;
}

@keyframes page-in {
	from {
		opacity: 0;
		transform: translateY(4px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.page-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: var(--s-4);
	margin-bottom: 24px;
}

.page-head > div:first-child {
	min-width: 0;
}

.page-head h1 {
	font-size: var(--fs-2xl);
	font-weight: 600;
	letter-spacing: var(--tracking-tight);
	line-height: var(--lh-tight);
}

.page-head p {
	margin-top: 6px;
	color: var(--muted);
	font-size: var(--fs-base);
}

.page-head .form-row {
	flex-shrink: 0;
}

.crumbs {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 12px;
	color: var(--dim);
	font-size: var(--fs-sm);
	font-weight: 500;
}

.crumbs a {
	color: var(--muted);
	transition: color var(--t);
}

.crumbs a:hover {
	color: var(--text);
}

.crumbs .crumb-sep {
	color: var(--surface-4);
}

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

.profile-id h1 {
	overflow-wrap: anywhere;
}

.profile-id p {
	margin-top: 4px;
}

/* ---------- Panels ---------- */

.panel {
	position: relative;
	min-width: 0;
	background: var(--surface);
	border: 1px solid var(--border-2);
	border-radius: var(--r-lg);
	box-shadow: var(--highlight);
}

.panel > .table-wrap:last-child,
.panel > table:last-child {
	border-radius: 0 0 var(--r-lg) var(--r-lg);
}

.panel > .table-wrap:not(.is-scroll):last-child,
.panel > table:last-child {
	overflow: hidden;
}

.panel > .table-wrap:not(.is-scroll):first-child,
.panel > table:first-child {
	border-top-left-radius: var(--r-lg);
	border-top-right-radius: var(--r-lg);
	overflow: hidden;
}

.panel > .panel-h:first-child {
	border-top-left-radius: calc(var(--r-lg) - 1px);
	border-top-right-radius: calc(var(--r-lg) - 1px);
}

.panel-h {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--s-3);
	min-height: 54px;
	padding: 10px var(--pad-x);
	border-bottom: 1px solid var(--border);
}

.panel-h h2 {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: var(--fs-lg);
	font-weight: 600;
	letter-spacing: -0.012em;
}

.panel-h .count {
	display: inline-grid;
	place-items: center;
	min-width: 22px;
	height: 20px;
	padding: 0 6px;
	border-radius: var(--r-pill);
	background: var(--surface-3);
	color: var(--muted);
	font-family: var(--mono);
	font-size: var(--fs-xs);
	font-weight: 500;
}

.panel-sub {
	margin-top: 2px;
	color: var(--muted);
	font-size: var(--fs-sm);
	font-weight: 400;
}

.panel-b {
	padding: var(--pad-x);
}

.panel-note.is-sub {
	border-top: 1px solid var(--border);
	color: var(--text-2);
	font-size: var(--fs-sm);
	font-weight: 600;
}

.panel-note {
	padding: 14px var(--pad-x);
	border-bottom: 1px solid var(--border);
	color: var(--muted);
	font-size: var(--fs-md);
}

.split {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--gap);
	align-items: start;
}

@media (min-width: 1480px) {
	.split {
		grid-template-columns: minmax(0, 1fr) 340px;
	}

	.split > .panel:last-child {
		position: sticky;
		top: calc(var(--topbar) + 20px);
	}
}

/* ---------- Tabs (segmented panel header) ---------- */

.tabs {
	display: flex;
	align-items: center;
	gap: 2px;
	padding: 3px;
	border-radius: var(--r);
	background: var(--inset);
	border: 1px solid var(--border);
}

.tab {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	height: 30px;
	padding: 0 12px;
	border: 0;
	border-radius: 7px;
	background: transparent;
	color: var(--muted);
	font-size: var(--fs-md);
	font-weight: 550;
	white-space: nowrap;
	transition: background var(--t), color var(--t);
}

.tab:hover {
	color: var(--text);
}

.tab.is-on {
	background: var(--surface-3);
	color: var(--text);
	box-shadow: var(--shadow-sm), var(--highlight);
}

.tab .count {
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	display: inline-grid;
	place-items: center;
	border-radius: var(--r-pill);
	background: rgba(255, 255, 255, 0.05);
	color: var(--muted);
	font-family: var(--mono);
	font-size: var(--fs-2xs);
	font-weight: 500;
}

.tab.is-on .count {
	background: var(--accent-bg);
	color: var(--accent);
}

.tab-panel[hidden] {
	display: none;
}

/* ---------- Buttons ---------- */

.btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	height: 36px;
	padding: 0 14px;
	border: 1px solid var(--border-2);
	border-radius: var(--r-sm);
	background: var(--surface-2);
	color: var(--text);
	font-size: var(--fs-md);
	font-weight: 550;
	line-height: 1;
	white-space: nowrap;
	box-shadow: var(--highlight);
	transition: background var(--t), border-color var(--t), color var(--t), opacity var(--t), transform 0.06s;
	user-select: none;
}

.btn svg {
	width: 15px;
	height: 15px;
	flex-shrink: 0;
}

.btn:hover {
	background: var(--surface-3);
	border-color: var(--border-strong);
}

.btn:active:not(:disabled) {
	transform: translateY(0.5px);
}

.btn:disabled,
.btn[disabled] {
	opacity: 0.45;
	pointer-events: none;
}

.btn-primary {
	background: var(--accent);
	border-color: transparent;
	color: var(--accent-ink);
	font-weight: 600;
	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover {
	background: var(--accent-hover);
	border-color: transparent;
}

.btn-ghost {
	background: transparent;
	border-color: transparent;
	color: var(--text-2);
	box-shadow: none;
}

.btn-ghost:hover {
	background: rgba(255, 255, 255, 0.04);
	border-color: transparent;
	color: var(--text);
}

.btn-danger {
	background: transparent;
	border-color: rgba(var(--red-rgb), 0.26);
	color: var(--red);
	box-shadow: none;
}

.btn-danger:hover {
	background: var(--red-bg);
	border-color: rgba(var(--red-rgb), 0.42);
}

.btn-sm {
	height: 30px;
	padding: 0 11px;
	border-radius: 7px;
	font-size: var(--fs-sm);
}

.btn-lg {
	height: 44px;
	padding: 0 20px;
	border-radius: var(--r);
	font-size: var(--fs-base);
}

.btn-block {
	display: flex;
	width: 100%;
}

.btn.is-copied {
	border-color: var(--accent-border);
	color: var(--accent);
}

.btn.is-busy {
	color: transparent !important;
	pointer-events: none;
}

.btn.is-busy::after {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 14px;
	height: 14px;
	border: 2px solid currentColor;
	border-radius: 50%;
	border-color: var(--text) var(--text) transparent transparent;
	animation: spin 0.7s linear infinite;
}

.btn-primary.is-busy::after {
	border-color: var(--accent-ink) var(--accent-ink) transparent transparent;
}

.btn-danger.is-busy::after {
	border-color: var(--red) var(--red) transparent transparent;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

.linkish {
	padding: 0;
	border: 0;
	background: none;
	color: var(--accent);
	font-size: var(--fs-sm);
	font-weight: 550;
	transition: color var(--t);
}

.linkish:hover {
	color: var(--accent-hover);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.icon-btn {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: var(--r-sm);
	background: transparent;
	color: var(--muted);
	transition: background var(--t), color var(--t);
}

.icon-btn:hover {
	background: rgba(255, 255, 255, 0.05);
	color: var(--text);
}

.icon-btn svg {
	width: 16px;
	height: 16px;
}

/* ---------- Forms ---------- */

.field {
	display: flex;
	flex-direction: column;
	gap: 7px;
	margin-bottom: var(--s-4);
	min-width: 0;
}

.field:last-child {
	margin-bottom: 0;
}

.lbl-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
}

.lbl-row .lbl {
	margin: 0;
}

.add-bal {
	color: var(--muted);
	font-size: var(--fs-sm);
}

.add-bal b {
	color: var(--text);
	font-family: var(--mono);
	font-weight: 550;
}

.add-size-tools {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-top: 2px;
}

.add-presets,
.add-frac {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.add-size-btn {
	height: 28px;
	padding: 0 10px;
	font-size: var(--fs-sm);
}

.add-size-btn:disabled {
	opacity: 0.38;
	cursor: not-allowed;
}

.lbl {
	color: var(--text-2);
	font-size: var(--fs-md);
	font-weight: 550;
}

.input,
.select {
	width: 100%;
	height: 38px;
	padding: 0 12px;
	border: 1px solid var(--border-2);
	border-radius: var(--r-sm);
	background: var(--inset);
	color: var(--text);
	font-size: var(--fs-base);
	transition: border-color var(--t), box-shadow var(--t), background var(--t);
}

textarea.input {
	height: auto;
	min-height: 84px;
	padding: 10px 12px;
	line-height: 1.5;
	resize: vertical;
}

.input::placeholder {
	color: var(--dim);
}

.input:hover,
.select:hover {
	border-color: var(--border-strong);
}

.input:focus,
.select:focus {
	border-color: var(--accent-border);
	box-shadow: var(--ring);
}

.input:disabled,
.select:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.input[readonly] {
	background: var(--surface-2);
	color: var(--text-2);
}

.input.mono {
	font-size: var(--fs-md);
}

.input[type="number"]::-webkit-inner-spin-button,
.input[type="number"]::-webkit-outer-spin-button {
	opacity: 0.4;
}

.select {
	appearance: none;
	padding-right: 34px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b93a1' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	cursor: pointer;
}

.select option {
	background: var(--surface-2);
}

.input-affix {
	display: flex;
	align-items: stretch;
	height: 38px;
	border: 1px solid var(--border-2);
	border-radius: var(--r-sm);
	background: var(--inset);
	transition: border-color var(--t), box-shadow var(--t);
}

.input-affix:hover {
	border-color: var(--border-strong);
}

.input-affix:focus-within {
	border-color: var(--accent-border);
	box-shadow: var(--ring);
}

.input-affix > span {
	display: grid;
	place-items: center;
	min-width: 42px;
	padding: 0 10px;
	border-right: 1px solid var(--border);
	color: var(--muted);
	font-family: var(--mono);
	font-size: var(--fs-sm);
	font-weight: 500;
}

.input-affix .input {
	height: 100%;
	border: 0;
	background: transparent;
	box-shadow: none;
}

.input-affix.is-suffix > span {
	border-right: 0;
	border-left: 1px solid var(--border);
}

.field-narrow .input-affix {
	max-width: 240px;
}

.check {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	color: var(--text-2);
	font-size: var(--fs-md);
	font-weight: 500;
	cursor: pointer;
	user-select: none;
}

.check input[type="checkbox"],
input[type="checkbox"] {
	appearance: none;
	width: 16px;
	height: 16px;
	margin: 0;
	flex-shrink: 0;
	border: 1.5px solid var(--surface-4);
	border-radius: 5px;
	background: var(--inset);
	display: inline-grid;
	place-items: center;
	cursor: pointer;
	transition: background var(--t), border-color var(--t);
}

input[type="checkbox"]:hover {
	border-color: var(--muted);
}

input[type="checkbox"]::after {
	content: "";
	width: 9px;
	height: 5px;
	margin-top: -2px;
	border-left: 2px solid var(--accent-ink);
	border-bottom: 2px solid var(--accent-ink);
	transform: rotate(-45deg) scale(0);
	transition: transform 0.12s var(--ease);
}

input[type="checkbox"]:checked {
	background: var(--accent);
	border-color: var(--accent);
}

input[type="checkbox"]:checked::after {
	transform: rotate(-45deg) scale(1);
}

input[type="checkbox"]:focus-visible {
	box-shadow: var(--ring);
}

input[type="checkbox"][hidden] {
	display: none;
}

.switch {
	position: relative;
	width: 40px;
	height: 23px;
	flex-shrink: 0;
	padding: 0;
	border: 1px solid var(--border-2);
	border-radius: var(--r-pill);
	background: var(--surface-4);
	transition: background var(--t-slow), border-color var(--t-slow);
}

.switch::after {
	content: "";
	position: absolute;
	top: 2px;
	left: 2px;
	width: 17px;
	height: 17px;
	border-radius: 50%;
	background: var(--text-2);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
	transition: transform var(--t-slow), background var(--t-slow);
}

.switch.is-on {
	background: var(--accent);
	border-color: transparent;
}

.switch.is-on::after {
	transform: translateX(17px);
	background: var(--accent-ink);
}

.seg {
	display: inline-flex;
	gap: 2px;
	padding: 3px;
	border: 1px solid var(--border);
	border-radius: var(--r);
	background: var(--inset);
}

.seg button {
	min-width: 72px;
	height: 30px;
	padding: 0 14px;
	border: 0;
	border-radius: 7px;
	background: transparent;
	color: var(--muted);
	font-size: var(--fs-md);
	font-weight: 550;
	transition: background var(--t), color var(--t);
}

.seg button:hover {
	color: var(--text);
}

.seg button.is-on {
	background: var(--surface-3);
	color: var(--text);
	box-shadow: var(--shadow-sm), var(--highlight);
}

.search-field {
	position: relative;
	display: flex;
	align-items: center;
	min-width: 220px;
	flex: 1 1 240px;
	max-width: 320px;
}

.search-field svg {
	position: absolute;
	left: 12px;
	width: 15px;
	height: 15px;
	color: var(--dim);
	pointer-events: none;
}

.search-field .input {
	position: relative;
	z-index: 1;
	width: 100%;
	padding-left: 36px;
}

.field .search-field {
	flex: none;
	max-width: none;
}

.w-sm {
	width: 116px !important;
	flex: 0 0 auto;
}

/* ---------- Filter / form bar ---------- */

.form-bar {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--s-2);
	margin-bottom: var(--gap);
	padding: 10px;
	border: 1px solid var(--border-2);
	border-radius: var(--r-lg);
	background: var(--surface);
}

.form-bar .select {
	width: auto;
	min-width: 180px;
}

.form-bar .check {
	height: 38px;
	padding: 0 12px;
	border: 1px solid var(--border-2);
	border-radius: var(--r-sm);
	background: var(--inset);
	transition: border-color var(--t);
}

.form-bar .check:hover {
	border-color: var(--border-strong);
}

.form-bar .check:has(input:checked) {
	border-color: var(--accent-border);
	background: var(--accent-bg);
	color: var(--text);
}

.filter-reset {
	margin-left: auto;
}

.filter-note {
	flex-basis: 100%;
	padding: 2px 4px 0;
}

/* ---------- Tables ---------- */

.table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

table.data {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	font-size: var(--fs-base);
}

table.data.fixed {
	table-layout: fixed;
}

table.data.fit {
	table-layout: auto;
}

table.data th {
	height: 40px;
	padding: 0 14px;
	border-bottom: 1px solid var(--border);
	background: rgba(255, 255, 255, 0.012);
	color: var(--dim);
	font-size: var(--fs-2xs);
	font-weight: 600;
	letter-spacing: var(--tracking-label);
	text-align: left;
	text-transform: uppercase;
	white-space: nowrap;
}

table.data th.num {
	text-align: right;
}

table.data th:first-child,
table.data td:first-child {
	padding-left: var(--pad-x);
}

table.data th:last-child,
table.data td:last-child {
	padding-right: var(--pad-x);
}

table.data td {
	padding: 12px 14px;
	border-bottom: 1px solid var(--border);
	vertical-align: middle;
	color: var(--text);
}

table.data td.dim {
	color: var(--dim);
}

table.data td.muted,
table.data td.hint {
	color: var(--muted);
}

table.data td.hint {
	font-weight: 450;
}

table.data td.num {
	font-family: var(--mono);
	font-size: var(--fs-md);
	letter-spacing: -0.01em;
	white-space: nowrap;
}

table.data tbody tr:last-child td {
	border-bottom: 0;
}

table.data tbody tr {
	transition: background var(--t);
}

table.data tbody tr:hover td {
	background: rgba(255, 255, 255, 0.018);
}

table.data tbody tr.is-empty-row:hover td,
table.data tbody tr.is-filter-empty:hover td,
table.data tbody tr#callers-empty:hover td {
	background: transparent;
}

table.data tbody tr[data-caller-row],
table.data tbody tr[data-href] {
	cursor: pointer;
}

table.data tbody tr[data-caller-row]:focus-visible {
	box-shadow: none;
	outline: none;
}

table.data tbody tr[data-caller-row]:focus-visible td {
	background: var(--accent-bg);
}

table.data .cell-action {
	text-align: right;
	white-space: nowrap;
}

table.data .row-actions {
	display: inline-flex;
	align-items: center;
	justify-content: flex-end;
	gap: 6px;
}

table.data td.empty {
	padding: 40px var(--pad-x);
}

.num-pair {
	display: inline-flex;
	align-items: baseline;
	gap: 5px;
	white-space: nowrap;
}

.num-pair .arrow {
	color: var(--surface-4);
	font-family: var(--font);
}

.stack-num {
	display: inline-flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 1px;
	line-height: 1.25;
}

.stack-num small {
	color: var(--dim);
	font-size: var(--fs-xs);
}

/* Market / call cell */

.call-cell {
	min-width: 0;
}

.fixture {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--text);
	font-weight: 500;
	font-family: var(--font);
	font-size: var(--fs-base);
}

.call-sub {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 4px 6px;
	margin-top: 4px;
	color: var(--muted);
	font-family: var(--font);
	font-size: var(--fs-sm);
	line-height: 1.4;
}

.call-sub b {
	max-width: 260px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--text-2);
	font-weight: 550;
}

.call-sub .mono {
	color: var(--dim);
}

.call-by {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--text-2);
	font-weight: 500;
	transition: color var(--t);
}

a.call-by:hover {
	color: var(--accent);
}

.call-by .avatar {
	width: 16px;
	height: 16px;
	border-radius: 5px;
	font-size: 7.5px;
}

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

.dot-sep {
	color: var(--surface-4);
}

.market-link {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	color: var(--accent);
	font-weight: 550;
	transition: color var(--t);
}

.market-link:hover {
	color: var(--accent-hover);
}

.side {
	display: inline-flex;
	align-items: center;
	height: 18px;
	padding: 0 6px;
	border-radius: 5px;
	font-size: var(--fs-2xs);
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	background: var(--surface-3);
	color: var(--text-2);
}

.side.yes {
	background: var(--green-bg);
	color: var(--green);
}

.side.no {
	background: var(--red-bg);
	color: var(--red);
}

.sold-note {
	color: var(--dim);
	font-style: italic;
}

/* ---------- Avatars ---------- */

.avatar {
	display: inline-grid;
	place-items: center;
	width: 28px;
	height: 28px;
	flex-shrink: 0;
	border-radius: 8px;
	background: var(--surface-3);
	color: var(--text-2);
	font-size: 10.5px;
	font-weight: 650;
	letter-spacing: 0.02em;
	line-height: 1;
	text-transform: uppercase;
	user-select: none;
}

.avatar.sm {
	width: 24px;
	height: 24px;
	border-radius: 7px;
	font-size: 9.5px;
}

.avatar.md {
	width: 38px;
	height: 38px;
	border-radius: 10px;
	font-size: 12.5px;
}

.avatar.lg {
	width: 64px;
	height: 64px;
	border-radius: 16px;
	font-size: 20px;
}

.avatar-wrap {
	position: relative;
	display: inline-grid;
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	border-radius: 8px;
	overflow: hidden;
}

.avatar-wrap.sm {
	width: 24px;
	height: 24px;
	border-radius: 7px;
}

.avatar-wrap.md {
	width: 38px;
	height: 38px;
	border-radius: 10px;
}

.avatar-wrap.lg {
	width: 64px;
	height: 64px;
	border-radius: 16px;
}

.avatar-wrap > * {
	grid-area: 1 / 1;
}

.avatar-wrap img {
	position: relative;
	z-index: 1;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 8px;
	background: var(--surface-3);
}

.avatar-wrap.sm img {
	border-radius: 7px;
}

.avatar-wrap.md img {
	border-radius: 10px;
}

.avatar-wrap.lg img {
	border-radius: 16px;
}

.user-btn .avatar-wrap,
.user-pop-head .avatar-wrap,
.side-user .avatar-wrap,
.user-btn .avatar-wrap img,
.user-btn .avatar,
.user-pop-head .avatar-wrap img,
.user-pop-head .avatar,
.side-user .avatar-wrap img,
.side-user .avatar {
	border-radius: 50%;
}

.user-btn .avatar-wrap,
.user-pop-head .avatar-wrap,
.side-user .avatar-wrap {
	overflow: hidden;
}

.avatar.lime {
	background: rgba(var(--accent-rgb), 0.14);
	color: var(--accent);
}

.avatar.amber {
	background: rgba(var(--amber-rgb), 0.14);
	color: var(--amber);
}

.avatar.blue {
	background: rgba(var(--blue-rgb), 0.14);
	color: var(--blue);
}

.avatar.green {
	background: rgba(var(--green-rgb), 0.14);
	color: var(--green);
}

.avatar.violet {
	background: rgba(167, 139, 250, 0.14);
	color: var(--violet);
}

.avatar.slate {
	background: rgba(148, 163, 184, 0.14);
	color: var(--slate);
}

.avatar.teal {
	background: rgba(45, 212, 191, 0.13);
	color: var(--teal);
}

.avatar.orange {
	background: rgba(251, 146, 60, 0.14);
	color: var(--orange);
}

.avatar.pink {
	background: rgba(244, 114, 182, 0.14);
	color: var(--pink);
}

.avatar.indigo {
	background: rgba(129, 140, 248, 0.14);
	color: var(--indigo);
}

.cell-user {
	display: flex;
	align-items: center;
	gap: 11px;
	min-width: 0;
}

.cell-user > span:not(.avatar-wrap):not(.avatar) {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cell-user-link {
	color: inherit;
	text-decoration: none;
	transition: color var(--t);
}

.cell-user-link:hover {
	color: var(--accent);
}

.cell-user-link:hover b {
	color: var(--accent);
}

.who {
	display: flex;
	flex-direction: column;
	min-width: 0;
	line-height: 1.3;
}

.who b {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-weight: 550;
}

.who span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--muted);
	font-size: var(--fs-sm);
}

/* ---------- Badges & chips ---------- */

.badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	height: 20px;
	padding: 0 8px;
	border-radius: var(--r-pill);
	background: var(--surface-3);
	color: var(--text-2);
	font-family: var(--font);
	font-size: var(--fs-xs);
	font-weight: 550;
	letter-spacing: 0;
	line-height: 1;
	white-space: nowrap;
}

.badge-neutral {
	background: rgba(255, 255, 255, 0.05);
	color: var(--text-2);
}

.badge-active {
	background: var(--accent-bg);
	color: var(--accent);
}

.badge-active::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: currentColor;
	box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.18);
}

.badge-paused,
.badge-soon {
	background: rgba(255, 255, 255, 0.05);
	color: var(--muted);
}

.badge-paused::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: currentColor;
}

.badge-warn {
	background: var(--amber-bg);
	color: var(--amber);
}

.badge-ok,
.badge-won,
.badge-claimed,
.badge-copied {
	background: var(--green-bg);
	color: var(--green);
}

.badge-lost {
	background: var(--red-bg);
	color: var(--red);
}

.badge-sold {
	background: var(--blue-bg);
	color: var(--blue);
}

.badge-open {
	background: rgba(255, 255, 255, 0.05);
	color: var(--text-2);
}

.badge-void {
	background: rgba(255, 255, 255, 0.04);
	color: var(--dim);
}

td .badge + .badge {
	margin-left: 4px;
}

.chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.chip {
	display: inline-flex;
	align-items: center;
	height: 24px;
	padding: 0 9px;
	border: 1px solid var(--border);
	border-radius: var(--r-xs);
	background: var(--surface-2);
	color: var(--text-2);
	font-size: var(--fs-sm);
	font-weight: 500;
	white-space: nowrap;
}

.chip.is-good {
	background: var(--green-bg);
	border-color: transparent;
	color: var(--green);
}

.chip.is-bad {
	background: var(--red-bg);
	border-color: transparent;
	color: var(--red);
}

.rank {
	display: inline-grid;
	place-items: center;
	min-width: 28px;
	height: 24px;
	padding: 0 6px;
	border-radius: 7px;
	background: var(--surface-2);
	color: var(--muted);
	font-family: var(--mono);
	font-size: var(--fs-sm);
	font-weight: 500;
}

.rank.is-top {
	background: var(--accent-bg);
	color: var(--accent);
	box-shadow: inset 0 0 0 1px var(--accent-border);
}

.rank.is-none {
	background: transparent;
	color: var(--dim);
}

.form-dots {
	display: inline-flex;
	align-items: center;
	gap: 3px;
}

.form-dots i {
	width: 7px;
	height: 16px;
	border-radius: 2px;
	background: var(--surface-4);
}

.form-dots i.w {
	background: var(--green);
}

.form-dots i.l {
	background: rgba(var(--red-rgb), 0.55);
}

/* ---------- Stats & metrics ---------- */

.ov-metrics {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 12px;
}

.ov-metric,
.stat {
	position: relative;
	min-width: 0;
	padding: 16px 18px;
	border: 1px solid var(--border-2);
	border-radius: var(--r-lg);
	background: var(--surface);
	box-shadow: var(--highlight);
	overflow: hidden;
}

.ov-metric .k,
.stat .k {
	display: flex;
	align-items: center;
	gap: 7px;
	color: var(--muted);
	font-size: var(--fs-sm);
	font-weight: 500;
}

.ov-metric .k svg {
	width: 14px;
	height: 14px;
	color: var(--dim);
}

.ov-metric .v,
.stat .v {
	display: block;
	margin-top: 10px;
	color: var(--text);
	font-family: var(--mono);
	font-size: 22px;
	font-weight: 500;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.03em;
	line-height: 1.15;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	transition: opacity var(--t-slow);
}

.ov-metric .d,
.stat .d {
	margin-top: 6px;
	color: var(--dim);
	font-size: var(--fs-sm);
}

.ov-metric.is-warn,
.stat.is-warn-stat {
	border-color: rgba(var(--amber-rgb), 0.3);
	background: linear-gradient(180deg, rgba(var(--amber-rgb), 0.05), transparent 70%), var(--surface);
}

.ov-metric.is-warn .k,
.stat.is-warn-stat .k {
	color: var(--amber);
}

.ov-metric.is-warn .k svg {
	color: var(--amber);
}

.ov-metric.is-pos .v {
	color: var(--green);
}

.ov-metric.is-neg .v {
	color: var(--red);
}

.grid-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 12px;
}

.grid-stats.cols-3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-stats.cols-4 {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat.is-inset {
	background: var(--inset);
	box-shadow: none;
	border-color: var(--border);
}

.stats-strip {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 12px;
}

.stat.is-hero {
	border-color: var(--accent-border);
	background:
		radial-gradient(120% 140% at 0% 0%, rgba(var(--accent-rgb), 0.09), transparent 60%),
		var(--surface);
}

.stat.is-hero .v {
	font-size: 26px;
}

/* ---------- Alerts ---------- */

.fund-alerts {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.fund-alert {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px 12px;
	padding: 11px 12px 11px 14px;
	border: 1px solid rgba(var(--amber-rgb), 0.24);
	border-radius: var(--r);
	background: rgba(var(--amber-rgb), 0.06);
	color: var(--text);
	font-size: var(--fs-md);
	line-height: 1.45;
}

.fund-alert > span:nth-child(2) {
	flex: 1 1 260px;
	min-width: 0;
	color: var(--text-2);
}

.fund-alert-label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--amber);
	font-size: var(--fs-sm);
	font-weight: 600;
	white-space: nowrap;
}

.fund-alert-label::before {
	content: "";
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.5 2.8 19.5h18.4L12 3.5z'/%3E%3Cpath d='M12 10v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.5 2.8 19.5h18.4L12 3.5z'/%3E%3Cpath d='M12 10v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E") center / contain no-repeat;
}

.fund-alert-actions {
	display: flex;
	gap: 6px;
	margin-left: auto;
}

.fund-alert.is-info {
	border-color: rgba(var(--blue-rgb), 0.22);
	background: rgba(var(--blue-rgb), 0.05);
}

.fund-alert.is-info .fund-alert-label {
	color: var(--blue);
}

.fund-alert.is-info .fund-alert-label::before,
.fund-alert.is-ok .fund-alert-label::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E");
}

.fund-alert.is-ok {
	border-color: rgba(var(--green-rgb), 0.22);
	background: rgba(var(--green-rgb), 0.05);
}

.fund-alert.is-ok .fund-alert-label {
	color: var(--green);
}

.fund-alert.is-error,
.fund-alert.is-danger {
	border-color: rgba(var(--red-rgb), 0.26);
	background: rgba(var(--red-rgb), 0.06);
}

.fund-alert.is-error .fund-alert-label,
.fund-alert.is-danger .fund-alert-label {
	color: var(--red);
}

/* ---------- Empty states ---------- */

.empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 40px var(--pad-x);
	color: var(--muted);
	font-size: var(--fs-md);
	text-align: center;
}

td.empty {
	display: table-cell;
}

.empty a {
	color: var(--accent);
	font-weight: 550;
}

.empty a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 44px 24px 48px;
	text-align: center;
}

.empty-ico {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	margin-bottom: 14px;
	border: 1px solid var(--border-2);
	border-radius: 12px;
	background: var(--surface-2);
	color: var(--muted);
}

.empty-ico svg {
	width: 20px;
	height: 20px;
}

.empty-state h3 {
	font-size: var(--fs-lg);
	font-weight: 600;
	letter-spacing: -0.01em;
}

.empty-state p {
	max-width: 380px;
	margin-top: 6px;
	color: var(--muted);
	font-size: var(--fs-md);
	line-height: 1.55;
}

.empty-state .btn {
	margin-top: 16px;
}

.empty-state.is-compact {
	align-items: flex-start;
	padding: 18px var(--pad-x);
	text-align: left;
}

.empty-state.is-compact p {
	max-width: 640px;
	margin-top: 0;
}

.summary-note {
	margin: 14px 0 16px;
}

/* ---------- Activity feed ---------- */

.feed {
	display: flex;
	flex-direction: column;
	padding: 6px 0;
}

.feed-item {
	position: relative;
	display: grid;
	grid-template-columns: 10px minmax(0, 1fr) auto;
	align-items: start;
	gap: 12px;
	padding: 10px var(--pad-x);
}

.feed-item::before {
	content: "";
	position: absolute;
	left: calc(var(--pad-x) + 4px);
	top: 26px;
	bottom: -10px;
	width: 1px;
	background: var(--border);
}

.feed-item:last-child::before {
	display: none;
}

.feed-dot {
	position: relative;
	z-index: 1;
	width: 9px;
	height: 9px;
	margin-top: 5px;
	border-radius: 50%;
	background: var(--surface-4);
	box-shadow: 0 0 0 3px var(--surface);
}

.feed-dot.up,
.feed-dot.ok {
	background: var(--green);
}

.feed-dot.accent {
	background: var(--accent);
}

.feed-dot.warn {
	background: var(--amber);
}

.feed-dot.down,
.feed-dot.bad {
	background: var(--red);
}

.feed-item b {
	display: block;
	color: var(--text);
	font-size: var(--fs-md);
	font-weight: 550;
	line-height: 1.45;
	overflow-wrap: anywhere;
}

.feed-item .meta {
	margin-top: 2px;
	color: var(--muted);
	font-size: var(--fs-sm);
	line-height: 1.45;
	overflow-wrap: anywhere;
}

.feed-item time {
	padding-top: 1px;
	color: var(--dim);
	font-family: var(--mono);
	font-size: var(--fs-xs);
	white-space: nowrap;
}

/* ---------- Caller cards (My callers) ---------- */

.caller-toolbar {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px 16px;
}

.caller-toolbar .btn:disabled {
	opacity: 0.45;
}

.caller-actionbar {
	position: fixed;
	left: 50%;
	bottom: 20px;
	z-index: 40;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px 16px;
	width: min(720px, calc(100vw - 32px));
	padding: 12px 14px;
	border: 1px solid var(--border-2);
	border-radius: calc(var(--r-lg) + 4px);
	background: var(--surface-3);
	box-shadow: var(--shadow-lg);
	transform: translateX(-50%);
}

.caller-actionbar[hidden] {
	display: none;
}

.caller-actionbar-main,
.caller-actionbar-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.caller-actionbar-count {
	font-size: var(--fs-md);
	font-weight: 600;
}

.caller-actionbar .btn:disabled {
	opacity: 0.45;
}

body.has-caller-bar {
	padding-bottom: 88px;
}

.caller-pick {
	display: grid;
	place-items: center;
	flex-shrink: 0;
	width: 16px;
	height: 16px;
}

.caller-card.is-selected {
	border-color: var(--accent-border);
}

.caller-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: var(--gap);
	align-items: start;
}

.caller-card {
	align-self: start;
	border: 1px solid var(--border-2);
	border-radius: var(--r-lg);
	background: var(--surface);
	box-shadow: var(--highlight);
	overflow: hidden;
	transition: border-color var(--t);
}

.caller-card:hover {
	border-color: var(--border-strong);
}

.caller-card.is-paused .caller-card-h .who b {
	color: var(--text-2);
}

.caller-card-h {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px var(--pad-x);
}

.caller-card-who {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.caller-card-h .cell-user:hover b {
	color: var(--accent);
}

.caller-card-h .who b {
	font-size: var(--fs-lg);
	transition: color var(--t);
}

.kv-list {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1px;
	margin: 0 var(--pad-x);
	border: 1px solid var(--border);
	border-radius: var(--r);
	background: var(--border);
	overflow: hidden;
}

.kv {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 10px 12px;
	background: var(--inset);
}

.kv span {
	color: var(--dim);
	font-size: var(--fs-xs);
	font-weight: 500;
}

.kv b {
	color: var(--text);
	font-size: var(--fs-md);
	font-weight: 500;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.caller-card-cats {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	padding: 12px var(--pad-x) 0;
}

.caller-card-cats .chip {
	height: 22px;
	font-size: var(--fs-xs);
}

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

.caller-card-cats .hint {
	font-size: var(--fs-sm);
}

.caller-card-f {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 12px;
	padding: 10px var(--pad-x);
	border-top: 1px solid var(--border);
}

.caller-card-f form {
	margin: 0;
}

/* ---------- Caller profile ---------- */

.hero {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 16px 24px;
	margin-bottom: 20px;
	padding: 22px 24px;
	border: 1px solid var(--border-2);
	border-radius: var(--r-xl);
	background:
		radial-gradient(80% 140% at 0% 0%, rgba(var(--accent-rgb), 0.06), transparent 55%),
		var(--surface);
	box-shadow: var(--highlight);
	overflow: hidden;
}

.hero-id {
	display: flex;
	align-items: center;
	gap: 18px;
	min-width: 0;
}

.hero-id h1 {
	font-size: var(--fs-3xl);
	font-weight: 600;
	letter-spacing: -0.03em;
	line-height: 1.1;
	overflow-wrap: anywhere;
}

.hero-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 10px;
	color: var(--muted);
	font-size: var(--fs-md);
}

.hero-meta .meta-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 26px;
	padding: 0 10px;
	border: 1px solid var(--border);
	border-radius: var(--r-pill);
	background: var(--inset);
	color: var(--text-2);
	font-size: var(--fs-sm);
	font-weight: 500;
}

.hero-meta .meta-chip b {
	color: var(--text);
	font-family: var(--mono);
	font-weight: 500;
}

.hero-actions {
	display: flex;
	align-items: center;
	gap: 10px;
}

.cat-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.profile-cat-filters {
	margin-bottom: var(--gap);
}

.pill {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	height: 32px;
	padding: 0 12px;
	border: 1px solid var(--border-2);
	border-radius: var(--r-pill);
	background: var(--surface);
	color: var(--text-2);
	font-size: var(--fs-md);
	font-weight: 500;
	transition: background var(--t), border-color var(--t), color var(--t);
}

.pill:hover {
	border-color: var(--border-strong);
	color: var(--text);
}

.pill.is-on {
	border-color: var(--accent-border);
	background: var(--accent-bg);
	color: var(--text);
}

.pill-count {
	color: var(--dim);
	font-family: var(--mono);
	font-size: var(--fs-xs);
}

.pill.is-on .pill-count {
	color: var(--accent);
}

.profile-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--gap);
	align-items: start;
}

@media (min-width: 1240px) {
	.profile-grid.has-side {
		grid-template-columns: minmax(0, 1fr) 400px;
	}

	.profile-grid.has-side > .copy-side {
		display: flex;
		flex-direction: column;
		max-height: calc(100vh - var(--topbar) - 40px);
	}

	.profile-grid.has-side > .copy-side > .panel {
		display: flex;
		flex-direction: column;
		min-height: 0;
	}

	.profile-grid.has-side > .copy-side > .panel:has(.cat-list) {
		flex: 0 1 auto;
	}

	.profile-grid.has-side > .copy-side > .panel:not(:has(.cat-list)) {
		flex: none;
	}

	.profile-grid.has-side .cat-list {
		min-height: 0;
		overflow-y: auto;
		overscroll-behavior: contain;
		scrollbar-width: thin;
	}
}

/* Scorecard: one panel instead of a wall of stat boxes */

.scorecard {
	display: grid;
	grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
	border: 1px solid var(--border-2);
	border-radius: var(--r-xl);
	background:
		radial-gradient(70% 120% at 0% 0%, rgba(var(--accent-rgb), 0.07), transparent 60%),
		var(--surface);
	box-shadow: var(--highlight);
	overflow: hidden;
}

.sc-main {
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding: 22px 24px 0;
	border-right: 1px solid var(--border);
}

.sc-k {
	display: flex;
	align-items: baseline;
	gap: 10px;
	color: var(--muted);
	font-size: var(--fs-sm);
	font-weight: 500;
}

.sc-k span {
	color: var(--dim);
	font-size: var(--fs-xs);
}

.sc-v {
	margin-top: 8px;
	font-family: var(--mono);
	font-size: 40px;
	font-weight: 500;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.04em;
	line-height: 1;
}

.sc-d {
	margin-top: 8px;
	color: var(--dim);
	font-size: var(--fs-sm);
}

.sc-curve {
	display: block;
	width: calc(100% + 48px);
	max-width: none;
	height: 96px;
	margin: 14px -24px 0;
	color: var(--muted);
}

.sc-curve.is-up {
	color: var(--green);
}

.sc-curve.is-down {
	color: var(--red);
}

.sc-line {
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linejoin: round;
}

.sc-zero {
	stroke: var(--border-2);
	stroke-dasharray: 3 4;
	vector-effect: non-scaling-stroke;
}

.sc-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	margin: 0;
}

.sc-grid > div {
	min-width: 0;
	padding: 18px 22px;
	border-bottom: 1px solid var(--border);
}

.sc-grid > div:nth-child(odd) {
	border-right: 1px solid var(--border);
}

.sc-grid > div:nth-last-child(-n + 2) {
	border-bottom: 0;
}

.sc-grid dt {
	color: var(--muted);
	font-size: var(--fs-sm);
	font-weight: 500;
}

.sc-grid dd {
	margin: 8px 0 0;
	font-family: var(--mono);
	font-size: 22px;
	font-weight: 500;
	letter-spacing: -0.03em;
	line-height: 1.1;
	white-space: nowrap;
}

.sc-grid small {
	display: block;
	margin-top: 4px;
	color: var(--dim);
	font-family: var(--mono);
	font-size: var(--fs-xs);
}

.sc-form {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px 14px;
	grid-column: 1 / -1;
	padding: 14px 24px;
	border-top: 1px solid var(--border);
	background: rgba(255, 255, 255, 0.012);
}

.sc-form-k {
	color: var(--muted);
	font-size: var(--fs-sm);
	font-weight: 500;
}

.sc-form b {
	font-family: var(--mono);
	font-weight: 600;
}

.sc-form-d,
.sc-note {
	color: var(--dim);
	font-size: var(--fs-sm);
}

.sc-note {
	margin-left: auto;
	color: var(--amber);
}

.form-dots.is-lg i {
	width: 10px;
	height: 20px;
	border-radius: 3px;
}

.hero-meta .meta-chip.is-live i {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--green);
	box-shadow: 0 0 0 3px rgba(var(--green-rgb), 0.18);
}

/* By category: two-line rows that fit the side column */

.cat-list {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 8px 8px 14px;
}

.cat-row {
	display: flex;
	flex-direction: column;
	gap: 7px;
	width: 100%;
	padding: 10px 12px;
	border: 1px solid transparent;
	border-radius: var(--r);
	background: transparent;
	color: var(--text);
	text-align: left;
	cursor: pointer;
	transition: background var(--t), border-color var(--t);
}

.cat-row:hover {
	background: rgba(255, 255, 255, 0.03);
}

.cat-row.is-on {
	border-color: var(--accent-border);
	background: var(--accent-bg);
}

.cat-row-top {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	min-width: 0;
}

.cat-row-top .name {
	overflow: hidden;
	font-weight: 550;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cat-row.is-on .name {
	color: var(--accent);
}

.cat-row-top b {
	flex: none;
	font-family: var(--mono);
	font-size: var(--fs-md);
	font-weight: 500;
}

.cat-bar {
	position: relative;
	height: 4px;
	border-radius: var(--r-pill);
	background: var(--surface-3);
	overflow: hidden;
}

.cat-bar i {
	position: absolute;
	inset: 0 auto 0 0;
	border-radius: inherit;
	background: var(--green);
}

.cat-bar.is-neg i {
	background: rgba(var(--red-rgb), 0.7);
}

.cat-row-sub {
	overflow: hidden;
	color: var(--dim);
	font-family: var(--mono);
	font-size: var(--fs-xs);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cat-row.is-low {
	opacity: 0.55;
}

/* Empty table: show the message, not column headers */

table.data:has(> tbody > tr:not(.hidden) > td.empty) > thead {
	display: none;
}

.streak-badge {
	display: inline-block;
	margin-left: 4px;
	font-style: normal;
	font-weight: 650;
	color: var(--accent);
}

.streak-badge.is-cold {
	color: var(--red);
}

.jp-onjup-row {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 8px 0;
	font-size: var(--fs-md);
}

.jp-onjup .hint {
	margin: 4px 0 10px;
}

.bar-row {
	display: grid;
	grid-template-columns: minmax(72px, 1.2fr) minmax(28px, 1fr) 52px 44px 60px;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 9px 10px;
	border: 0;
	border-radius: var(--r-sm);
	background: transparent;
	color: var(--text);
	font-size: var(--fs-md);
	text-align: left;
}

.bar-row > span:not(.bar) {
	text-align: right;
	white-space: nowrap;
}

.bar-row > span.name {
	text-align: left;
	overflow: hidden;
	text-overflow: ellipsis;
	font-weight: 500;
}

.bar-row.is-head {
	padding-top: 0;
	padding-bottom: 8px;
	color: var(--dim);
	font-size: var(--fs-2xs);
	font-weight: 600;
	letter-spacing: var(--tracking-label);
	text-transform: uppercase;
}

.bar-row.is-head > span:first-child {
	text-align: left;
}

.bar-row.is-head .mono {
	font-family: var(--font);
}

.bar-row.is-action {
	cursor: pointer;
	transition: background var(--t);
}

.bar-row.is-action:hover,
.bar-row.is-action.is-on {
	background: rgba(255, 255, 255, 0.03);
}

.bar-row.is-action.is-on .name {
	color: var(--accent);
}

.bar {
	position: relative;
	height: 6px;
	border-radius: var(--r-pill);
	background: var(--surface-3);
	overflow: hidden;
}

.bar span {
	position: absolute;
	inset: 0 auto 0 0;
	border-radius: inherit;
	background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.55), var(--accent));
}

.bar-row.is-head .bar {
	background: transparent;
}

/* ---------- Configure ---------- */

.profile-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 340px;
	gap: var(--gap);
	align-items: start;
}

.copy-side {
	position: sticky;
	top: calc(var(--topbar) + 20px);
}

.config-summary .line {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid var(--border);
	font-size: var(--fs-md);
}

.config-summary .line:first-child {
	padding-top: 0;
}

.config-summary .line span {
	color: var(--muted);
}

.config-summary .line b {
	font-weight: 550;
	text-align: right;
}

.config-summary .line b.is-on {
	color: var(--accent);
}

.sum-cats {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	padding: 10px 0 14px;
	border-bottom: 1px solid var(--border);
}

.sum-cats .chip {
	height: 22px;
	font-size: var(--fs-xs);
}

.summary-caller {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 14px 0 16px;
	padding: 10px 12px;
	border: 1px solid var(--border);
	border-radius: var(--r);
	background: var(--inset);
	font-size: var(--fs-sm);
	color: var(--muted);
}

.summary-caller b {
	display: block;
	color: var(--text);
	font-size: var(--fs-md);
	font-weight: 550;
}

.summary-actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.toggle strong {
	font-size: var(--fs-lg);
	font-weight: 600;
}

.toggle .help {
	margin-top: 3px;
}

.section-h {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.section-h h2 {
	font-size: var(--fs-lg);
	font-weight: 600;
	letter-spacing: -0.012em;
}

.section-h p {
	color: var(--muted);
	font-size: var(--fs-sm);
}

.step-num {
	display: inline-grid;
	place-items: center;
	width: 22px;
	height: 22px;
	border-radius: 7px;
	background: var(--surface-3);
	color: var(--muted);
	font-family: var(--mono);
	font-size: var(--fs-xs);
	font-weight: 500;
}

.odds-gate {
	align-self: flex-start;
}

.gate-row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
}

.odds-fields {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 16px;
	transition: opacity var(--t-slow);
}

.odds-fields .field {
	flex: 0 1 200px;
	margin: 0;
}

.odds-fields.is-off {
	opacity: 0.4;
	pointer-events: none;
}

.cat-picker.is-off {
	display: none;
}

.cat-toolbar {
	display: flex;
	align-items: center;
	gap: 4px;
}

.cat-toolbar .hint {
	margin-right: 6px;
}

.cat-search-field {
	margin-bottom: 18px;
	max-width: 420px;
}

.cat-search-empty {
	margin: -6px 0 14px;
}

.cat-block + .cat-block {
	margin-top: 18px;
}

.cat-block-h {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 10px;
	color: var(--text-2);
	font-size: var(--fs-sm);
	font-weight: 600;
}

.cat-toggles {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.cat-toggle {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	height: 32px;
	padding: 0 12px;
	border: 1px solid var(--border-2);
	border-radius: var(--r-sm);
	background: var(--inset);
	color: var(--text-2);
	font-size: var(--fs-md);
	font-weight: 500;
	cursor: pointer;
	user-select: none;
	transition: background var(--t), border-color var(--t), color var(--t);
}

.cat-toggle::before {
	content: "";
	width: 14px;
	height: 14px;
	margin-left: -2px;
	border: 1.5px solid var(--surface-4);
	border-radius: 4px;
	transition: background var(--t), border-color var(--t);
}

.cat-toggle:hover {
	border-color: var(--border-strong);
	color: var(--text);
}

.cat-toggle.is-on {
	border-color: var(--accent-border);
	background: var(--accent-bg);
	color: var(--text);
}

.cat-toggle.is-on::before {
	border-color: var(--accent);
	background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230d1606' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 10px no-repeat;
}

.cat-toggle:focus-within {
	box-shadow: var(--ring);
}

.cat-more {
	margin-top: 20px;
	border: 1px solid var(--border);
	border-radius: var(--r);
	background: var(--inset);
}

.cat-more summary {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	cursor: pointer;
	list-style: none;
	font-size: var(--fs-md);
	font-weight: 550;
	border-radius: var(--r);
	transition: background var(--t);
}

.cat-more summary::-webkit-details-marker {
	display: none;
}

.cat-more summary:hover {
	background: rgba(255, 255, 255, 0.02);
}

.cat-more summary::after {
	content: "";
	width: 14px;
	height: 14px;
	margin-left: auto;
	background-color: var(--muted);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
	transition: transform var(--t-slow);
}

.cat-more[open] summary::after {
	transform: rotate(180deg);
}

.cat-more[open] summary {
	border-bottom: 1px solid var(--border);
	border-radius: var(--r) var(--r) 0 0;
}

.cat-more-body {
	padding: 16px 14px;
}

.cat-more .cat-toggle {
	background: var(--surface);
}

.cat-more .cat-toggle.is-on {
	background: var(--accent-bg);
}

/* ---------- Funds (Account) ---------- */

.fund-balances {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

.fund-card {
	position: relative;
	padding: 20px 22px;
	border: 1px solid var(--border-2);
	border-radius: var(--r-lg);
	background: var(--surface);
	box-shadow: var(--highlight);
	overflow: hidden;
}

.fund-card::after {
	content: "";
	position: absolute;
	top: 0;
	left: 22px;
	right: 22px;
	height: 1px;
	background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.5), transparent);
	opacity: 0.6;
}

.fund-card.is-warn {
	border-color: rgba(var(--amber-rgb), 0.28);
}

.fund-card.is-warn::after {
	background: linear-gradient(90deg, transparent, rgba(var(--amber-rgb), 0.6), transparent);
}

.fund-card-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.fund-role {
	color: var(--muted);
	font-size: var(--fs-md);
	font-weight: 500;
}

.fund-amount {
	margin-top: 12px;
	font-family: var(--mono);
	font-size: 30px;
	font-weight: 500;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.035em;
	line-height: 1.1;
}

.fund-desc {
	margin-top: 10px;
	color: var(--muted);
	font-size: var(--fs-md);
	line-height: 1.55;
}

.wallet-export-row {
	display: flex;
	gap: 8px;
}

.wallet-export-row .input {
	flex: 1 1 auto;
	min-width: 0;
}

/* ---------- Finance ---------- */

.finance-jump {
	position: sticky;
	top: var(--topbar);
	z-index: 20;
	display: flex;
	gap: 4px;
	margin: 0 calc(var(--content-pad) * -1) var(--gap);
	padding: 10px var(--content-pad);
	overflow-x: auto;
	background: rgba(11, 13, 17, 0.86);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--border);
	scrollbar-width: none;
}

.finance-jump::-webkit-scrollbar {
	display: none;
}

.finance-jump a {
	flex-shrink: 0;
	height: 28px;
	padding: 0 11px;
	display: inline-flex;
	align-items: center;
	border-radius: var(--r-pill);
	color: var(--muted);
	font-size: var(--fs-sm);
	font-weight: 500;
	transition: background var(--t), color var(--t);
}

.finance-jump a:hover {
	background: var(--surface-2);
	color: var(--text);
}

.finance .panel,
.finance .grid-stats {
	scroll-margin-top: calc(var(--topbar) + 64px);
}

.finance .grid-stats {
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.finance .panel + .panel,
.finance .grid-stats + .panel,
.finance .fund-alerts + .panel {
	margin-top: var(--gap);
}

.finance .grid-stats + .fund-alerts {
	margin-top: var(--gap);
}

.finance table.data td {
	font-size: var(--fs-md);
}

.finance table.data .hint {
	font-size: var(--fs-sm);
}

.finance .t-clip {
	max-width: 180px;
}

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

.addr-row code {
	color: var(--text-2);
	font-size: var(--fs-sm);
	overflow-wrap: anywhere;
}

/* ---------- Modals ---------- */

.center-overlay {
	position: fixed;
	inset: 0;
	z-index: 70;
	display: grid;
	place-items: center;
	padding: 20px;
	background: rgba(5, 6, 9, 0.66);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	overflow-y: auto;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity var(--t-slow), visibility var(--t-slow);
}

.center-overlay.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

#confirm-modal {
	z-index: 80;
}

.modal {
	position: relative;
	width: 100%;
	max-width: 440px;
	padding: 24px;
	border: 1px solid var(--border-2);
	border-radius: var(--r-xl);
	background: var(--surface-2);
	box-shadow: var(--shadow-lg);
	transform: translateY(8px) scale(0.985);
	transition: transform var(--t-slow);
}

.center-overlay.is-open .modal {
	transform: none;
}

.modal h2 {
	font-size: var(--fs-xl);
	font-weight: 600;
	letter-spacing: -0.02em;
	padding-right: 32px;
}

.modal > .help:first-of-type {
	margin-top: 6px;
}

.modal-x {
	position: absolute;
	top: 16px;
	right: 16px;
}

.modal form {
	margin-top: 18px;
}

.modal-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 22px;
}

.modal-actions.is-split {
	justify-content: space-between;
}

.modal-actions .form-row {
	gap: 8px;
}

.modal-status {
	min-height: 0;
	margin: 0;
}

.modal-status:not(:empty) {
	margin-top: 4px;
	padding: 10px 12px;
	border: 1px solid var(--border);
	border-radius: var(--r-sm);
	background: var(--inset);
	color: var(--text-2);
}

.modal-target {
	margin-top: 14px;
	padding: 12px 14px;
	border: 1px solid var(--border);
	border-radius: var(--r);
	background: var(--inset);
	color: var(--text);
	font-size: var(--fs-md);
	font-weight: 500;
	line-height: 1.45;
	overflow-wrap: anywhere;
}

.modal-target:empty {
	display: none;
}

.modal-warn {
	display: flex;
	gap: 10px;
	margin-top: 14px;
	padding: 11px 12px;
	border: 1px solid rgba(var(--amber-rgb), 0.24);
	border-radius: var(--r);
	background: rgba(var(--amber-rgb), 0.06);
	color: var(--text-2);
	font-size: var(--fs-md);
	line-height: 1.5;
}

.modal-warn svg {
	width: 16px;
	height: 16px;
	margin-top: 2px;
	flex-shrink: 0;
	color: var(--amber);
}

.export-box {
	margin-top: 16px;
}

.export-key {
	position: relative;
}

.export-mask {
	height: 84px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 0 14px;
	border: 1px dashed var(--border-2);
	border-radius: var(--r-sm);
	background: var(--inset);
	color: var(--dim);
	overflow: hidden;
}

.export-mask svg {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

.export-mask .mono {
	letter-spacing: 0.08em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: clip;
}

.export-secret {
	min-height: 84px;
	word-break: break-all;
	resize: none;
}

.export-box[data-state="revealed"] .export-mask {
	display: none;
}

.export-box[data-state="copied"] .export-mask {
	border-style: solid;
	border-color: var(--accent-border);
	color: var(--accent);
}

.export-status {
	margin-top: 10px;
	color: var(--muted);
	font-size: var(--fs-sm);
	line-height: 1.5;
}

.export-status:empty {
	display: none;
}

.export-status.is-error {
	color: var(--red);
}

.export-status.is-ok {
	color: var(--accent);
}

.deposit-modal {
	max-width: 480px;
}

.deposit-split {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	margin-top: 18px;
}

.deposit-need {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 12px 14px;
	border: 1px solid var(--border);
	border-radius: var(--r);
	background: var(--inset);
}

.deposit-need b {
	font-family: var(--mono);
	font-size: var(--fs-sm);
	font-weight: 600;
	color: var(--accent);
	letter-spacing: 0.02em;
}

.deposit-need span {
	color: var(--text-2);
	font-size: var(--fs-md);
	line-height: 1.4;
}

.deposit-need em {
	color: var(--dim);
	font-size: var(--fs-sm);
	font-style: normal;
	line-height: 1.4;
}

.deposit-qr {
	display: grid;
	place-items: center;
	margin-top: 18px;
}

.deposit-field {
	margin-top: 18px;
}

.deposit-qr img {
	width: 184px;
	height: 184px;
	padding: 10px;
	border-radius: var(--r-lg);
	background: #fff;
}

.open-calls-modal {
	max-width: 560px;
	padding: 0;
	overflow: hidden;
}

.open-calls-head {
	padding: 24px 24px 0;
}

.open-calls-head p {
	margin-top: 6px;
	color: var(--muted);
	font-size: var(--fs-md);
	line-height: 1.55;
}

.open-calls-meta {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 16px 24px 10px;
	color: var(--muted);
	font-size: var(--fs-sm);
}

.open-calls-meta span {
	margin-right: auto;
	color: var(--text-2);
	font-weight: 550;
}

.open-calls-list {
	max-height: min(46vh, 420px);
	margin: 0;
	padding: 0 12px;
	list-style: none;
	overflow-y: auto;
}

.open-calls-list li + li {
	margin-top: 4px;
}

.open-calls-list label {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border: 1px solid transparent;
	border-radius: var(--r);
	cursor: pointer;
	transition: background var(--t), border-color var(--t);
}

.open-calls-list label:hover {
	background: rgba(255, 255, 255, 0.025);
}

.open-calls-list label:has(input:checked) {
	border-color: var(--accent-border);
	background: var(--accent-bg);
}

.open-calls-main {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.open-calls-main b {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: var(--fs-md);
	font-weight: 550;
}

.open-calls-main span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--muted);
	font-size: var(--fs-sm);
}

.open-calls-prices {
	display: inline-flex;
	align-items: baseline;
	gap: 6px;
	font-size: var(--fs-md);
}

.open-calls-entry {
	color: var(--dim);
}

.open-calls-arrow {
	color: var(--surface-4);
}

.open-calls-now {
	color: var(--text);
}

.open-calls-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 12px;
	padding: 16px 24px;
	border-top: 1px solid var(--border);
	background: var(--surface);
}

.open-pick-table td:first-child,
.open-pick-table th:first-child {
	width: 48px;
}

.open-pick-check {
	display: inline-flex;
}

.open-pick-table tr:has(input:checked) td {
	background: var(--accent-bg);
}

/* ---------- Toast ---------- */

.toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	z-index: 90;
	display: flex;
	align-items: center;
	gap: 10px;
	max-width: min(520px, calc(100vw - 32px));
	padding: 11px 16px 11px 14px;
	border: 1px solid var(--border-2);
	border-radius: var(--r);
	background: var(--surface-3);
	box-shadow: var(--shadow-lg);
	color: var(--text);
	font-size: var(--fs-md);
	font-weight: 500;
	line-height: 1.45;
	opacity: 0;
	visibility: hidden;
	transform: translate(-50%, 10px);
	transition: opacity var(--t-slow), transform var(--t-slow), visibility var(--t-slow);
	pointer-events: none;
}

.toast.is-on {
	opacity: 1;
	visibility: visible;
	transform: translate(-50%, 0);
	pointer-events: auto;
}

.toast::before {
	content: "";
	width: 8px;
	height: 8px;
	flex-shrink: 0;
	border-radius: 50%;
	background: var(--muted);
}

.toast.is-success::before {
	background: var(--green);
	box-shadow: 0 0 0 3px rgba(var(--green-rgb), 0.18);
}

.toast.is-error::before {
	background: var(--red);
	box-shadow: 0 0 0 3px rgba(var(--red-rgb), 0.18);
}

.toast.is-warning::before {
	background: var(--amber);
	box-shadow: 0 0 0 3px rgba(var(--amber-rgb), 0.18);
}

.toast.is-info::before {
	background: var(--blue);
	box-shadow: 0 0 0 3px rgba(var(--blue-rgb), 0.18);
}

.flash-stack {
	display: grid;
	gap: 8px;
	margin: 0 0 16px;
}

.flash {
	padding: 10px 14px;
	border: 1px solid var(--border-2);
	border-radius: var(--r);
	background: var(--surface-2);
	color: var(--text);
	font-size: var(--fs-md);
	font-weight: 500;
	line-height: 1.45;
}

.flash.is-success {
	border-color: rgba(var(--green-rgb), 0.24);
	background: rgba(var(--green-rgb), 0.06);
}

.flash.is-error,
.flash.is-danger {
	border-color: rgba(var(--red-rgb), 0.26);
	background: rgba(var(--red-rgb), 0.06);
}

.flash.is-warning {
	border-color: rgba(var(--amber-rgb), 0.24);
	background: rgba(var(--amber-rgb), 0.06);
}

.flash.is-info {
	border-color: rgba(var(--blue-rgb), 0.22);
	background: rgba(var(--blue-rgb), 0.05);
}

/* ---------- Navigation progress ---------- */

.jp-progress {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1000;
	height: 2px;
	overflow: hidden;
	pointer-events: none;
}

.jp-progress::after {
	content: "";
	display: block;
	width: 40%;
	height: 100%;
	background: linear-gradient(90deg, transparent, var(--accent), transparent);
	transform: translateX(-100%);
}

html.is-navigating .jp-progress::after {
	animation: progress-run 1s var(--ease) infinite;
}

html.is-navigating .content {
	opacity: 0.7;
	transition: opacity 0.2s 0.15s;
}

@keyframes progress-run {
	from {
		transform: translateX(-100%);
	}
	to {
		transform: translateX(260%);
	}
}

/* ---------- Auth ---------- */

.auth {
	position: relative;
	display: grid;
	place-items: center;
	min-height: 100vh;
	padding: 24px;
	overflow: hidden;
}

.auth::before {
	content: "";
	position: absolute;
	inset: -20% -10% auto;
	height: 70%;
	background: radial-gradient(50% 60% at 50% 30%, rgba(var(--accent-rgb), 0.1), transparent 70%);
	pointer-events: none;
}

.auth-card {
	position: relative;
	width: 100%;
	max-width: 400px;
	padding: 32px;
	border: 1px solid var(--border-2);
	border-radius: var(--r-xl);
	background: var(--surface);
	box-shadow: var(--shadow-lg);
}

.auth-brand {
	height: auto;
	padding: 0;
	margin-bottom: 28px;
}

.auth-card h1 {
	font-size: var(--fs-2xl);
	font-weight: 600;
	letter-spacing: var(--tracking-tight);
}

.auth-card > p {
	margin: 8px 0 24px;
	color: var(--muted);
	font-size: var(--fs-base);
	line-height: 1.55;
}

.auth-error {
	margin: 0 0 16px !important;
	padding: 10px 12px;
	border: 1px solid rgba(var(--red-rgb), 0.26);
	border-radius: var(--r-sm);
	background: var(--red-bg);
	color: var(--red) !important;
	font-size: var(--fs-md) !important;
}

.auth-note {
	margin: 0 0 16px !important;
	padding: 10px 12px;
	border: 1px solid var(--border-2);
	border-radius: var(--r-sm);
	background: var(--inset);
	color: var(--text-2) !important;
	font-size: var(--fs-md) !important;
}

.auth-foot {
	margin-top: 20px;
	color: var(--dim);
	font-size: var(--fs-sm);
	line-height: 1.55;
	text-align: center;
}

.auth-foot a {
	color: var(--muted);
}

.auth-foot a:hover {
	color: var(--text);
}

.btn-discord svg {
	width: 18px;
	height: 18px;
}

/* ---------- Responsive ---------- */
/* xs ≤ 400 · sm ≤ 640 · md ≤ 960 · lg ≤ 1280 · xl ≥ 1480 */

.tabbar {
	display: none;
}

.table-wrap.is-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-x: contain;
}

.filters-toggle,
.filter-nums-head,
.filter-nums-apply,
.filter-nums-scrim {
	display: none;
}

.filter-nums {
	display: contents;
}

.more-sheet-links {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 16px;
}

@keyframes shimmer {
	to {
		background-position: -200% 0;
	}
}

.skeleton {
	background: linear-gradient(90deg, var(--surface-2) 20%, var(--surface-3) 50%, var(--surface-2) 80%);
	background-size: 200% 100%;
	animation: shimmer 1.2s linear infinite;
	border-radius: 6px;
	color: transparent !important;
	pointer-events: none;
}

.avatar-wrap {
	background: var(--surface-3);
}

.avatar-wrap img {
	opacity: 0;
	transition: opacity 0.2s var(--ease);
}

.avatar-wrap img.is-in {
	opacity: 1;
}

.ov-metrics.is-refreshing .v {
	border-radius: 6px;
	background: linear-gradient(90deg, var(--surface-2) 20%, var(--surface-3) 50%, var(--surface-2) 80%);
	background-size: 200% 100%;
	animation: shimmer 1.2s linear infinite;
	color: transparent;
}

@media (max-width: 1280px) {
	.ov-metrics {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.stats-strip {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.profile-layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.copy-side {
		position: static;
	}

	.grid-stats.cols-4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 960px) {
	:root {
		--content-pad: max(20px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
		--pad-x: 16px;
		--gap: 20px;
	}

	.app {
		grid-template-columns: minmax(0, 1fr);
	}

	.sidebar,
	.sidebar-scrim,
	.mobile-toggle {
		display: none !important;
	}

	.topbar {
		padding-top: var(--safe-t);
		padding-left: max(var(--content-pad), var(--safe-l));
		padding-right: max(var(--content-pad), var(--safe-r));
		height: calc(var(--topbar) + var(--safe-t));
		min-height: calc(var(--tap) + var(--safe-t));
	}

	.content {
		padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px);
		padding-left: max(var(--content-pad), var(--safe-l));
		padding-right: max(var(--content-pad), var(--safe-r));
	}

	.tabbar {
		display: flex;
		position: fixed;
		right: 0;
		bottom: 0;
		left: 0;
		z-index: 40;
		height: calc(var(--tabbar-h) + var(--safe-b));
		padding: 0 8px var(--safe-b);
		border-top: 1px solid var(--border);
		background: rgba(11, 13, 16, 0.86);
		backdrop-filter: saturate(140%) blur(16px);
		-webkit-backdrop-filter: saturate(140%) blur(16px);
		overscroll-behavior: contain;
	}

	.tabbar-item {
		flex: 1;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 2px;
		min-height: var(--tabbar-h);
		padding: 6px 4px;
		border: 0;
		background: transparent;
		color: var(--muted);
		font-size: 11px;
		font-weight: 500;
		text-decoration: none;
	}

	.tabbar-item svg {
		width: 22px;
		height: 22px;
	}

	.tabbar-item.is-on {
		color: var(--accent);
	}

	.tabbar-item:active {
		transform: scale(0.98);
		background: var(--press);
	}

	.input,
	.input.mono,
	input.mono,
	.select,
	textarea,
	textarea.input {
		font-size: max(16px, var(--fs-input));
		min-height: var(--tap);
	}

	.input.mono,
	input.mono {
		font-family: var(--mono);
	}

	.input-affix {
		height: var(--tap);
		min-height: var(--tap);
	}

	.btn,
	.btn-sm,
	.icon-btn,
	.linkish,
	.pill,
	.tab,
	.cat-row,
	.filters-toggle,
	.seg button {
		min-height: var(--tap);
	}

	.btn-sm {
		height: var(--tap);
		min-height: var(--tap);
		padding: 0 14px;
	}

	.linkish {
		position: relative;
		padding: 10px 8px;
	}

	.linkish::after {
		content: "";
		position: absolute;
		inset: -8px;
	}

	.icon-btn,
	button.icon-btn,
	.modal-x {
		width: var(--tap);
		height: var(--tap);
		min-width: var(--tap);
		min-height: var(--tap);
	}

	.top-actions {
		min-width: 0;
		gap: 10px;
	}

	.funds {
		height: 36px;
		min-width: 0;
		overflow: hidden;
		border-radius: var(--r);
		align-items: stretch;
	}

	.wallet-chip {
		min-width: 0;
	}

	.wallet-chip .amt {
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.btn-deposit {
		margin: 3px;
		padding: 0 10px;
		height: auto;
		min-height: 0;
		align-self: stretch;
		border-radius: 7px;
		flex: none;
	}

	.user-btn {
		width: 36px;
		height: 36px;
		min-width: 36px;
		min-height: 36px;
		padding: 0;
		border-radius: 50%;
		overflow: hidden;
		flex: none;
	}

	.user-btn .avatar-wrap,
	.user-btn .avatar,
	.user-btn .avatar-wrap img {
		width: 100%;
		height: 100%;
		border-radius: 50%;
	}

	.btn:active,
	.icon-btn:active,
	[data-href]:active,
	tr[data-caller-row]:active,
	.caller-card:active {
		transform: scale(0.98);
		background: var(--press);
	}

	.btn-deposit:active {
		transform: scale(0.98);
		background: var(--accent-hover);
	}

	.center-overlay {
		place-items: end center;
		padding: 0;
		align-items: end;
	}

	.modal {
		width: 100%;
		max-width: none;
		max-height: 92dvh;
		padding: 12px 20px calc(16px + var(--safe-b));
		border-radius: 16px 16px 0 0;
		overflow: auto;
		overscroll-behavior: contain;
		transform: translateY(110%);
	}

	.modal::before {
		content: "";
		display: block;
		width: 36px;
		height: 4px;
		margin: 4px auto 14px;
		border-radius: 99px;
		background: var(--border-strong);
	}

	.center-overlay.is-open .modal {
		transform: none;
	}

	.modal-x {
		top: 18px;
	}

	.modal-actions,
	.modal-actions.is-split,
	.modal-actions .form-row {
		flex-direction: column-reverse;
		align-items: stretch;
		width: 100%;
	}

	.modal-actions .btn,
	.modal-actions.is-split .btn,
	.modal-actions .form-row .btn {
		width: 100%;
		justify-content: center;
	}

	.toast {
		bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px);
	}

	.page-head {
		position: sticky;
		top: calc(var(--topbar) + var(--safe-t) - 1px);
		z-index: 20;
		align-items: center;
		margin: 0 0 20px;
		padding: 14px 0;
		background: rgba(11, 13, 17, 0.88);
		backdrop-filter: blur(12px);
		-webkit-backdrop-filter: blur(12px);
		transition: padding var(--t), gap var(--t);
	}

	.page-head > a.btn,
	.page-head > .form-row {
		align-self: center;
		flex-shrink: 0;
	}

	.page-head.is-stuck {
		padding-top: 8px;
		padding-bottom: 8px;
		border-bottom: 1px solid var(--border);
	}

	.page-head.is-stuck p,
	.page-head.is-stuck .form-row,
	.page-head.is-stuck .hint {
		display: none;
	}

	.page-head h1 {
		font-size: 21px;
	}

	.page-head .form-row {
		width: 100%;
	}

	.scorecard,
	.stats-strip,
	.stats-strip.is-copier {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.sc-main {
		border-right: 0;
		border-bottom: 1px solid var(--border);
	}

	.ov-metrics {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.ov-metrics > .ov-metric:last-child {
		grid-column: 1 / -1;
	}

	.grid-stats.cols-3,
	.grid-stats.cols-4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.fund-balances {
		grid-template-columns: minmax(0, 1fr);
	}

	.top-divider,
	.fund-info {
		display: none;
	}

	.filters-toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-height: var(--tap);
	}

	.filter-nums {
		display: none;
		position: fixed;
		right: 0;
		bottom: 0;
		left: 0;
		z-index: 72;
		flex-direction: column;
		gap: 12px;
		max-height: 92dvh;
		padding: 12px 20px calc(16px + var(--safe-b));
		border-radius: 16px 16px 0 0;
		background: var(--surface-2);
		box-shadow: var(--shadow-lg);
		overscroll-behavior: contain;
	}

	.filter-nums.is-open {
		display: flex;
	}

	.filter-nums-head,
	.filter-nums-apply {
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.filter-nums-apply {
		width: 100%;
		justify-content: center;
		min-height: var(--tap);
	}

	.filter-nums .input,
	.filter-nums .input.w-sm,
	.filter-nums .w-sm {
		width: 100% !important;
		max-width: none;
		flex: none;
	}

	.filter-nums-scrim {
		display: none;
		position: fixed;
		inset: 0;
		z-index: 71;
		background: rgba(5, 6, 9, 0.66);
	}

	.filter-nums-scrim.is-on {
		display: block;
	}

	.form-bar .sep {
		display: none;
	}

	.search-field {
		max-width: none;
		flex: 1 1 100%;
	}

	input[type="number"] {
		appearance: textfield;
		-moz-appearance: textfield;
	}

	input[type="number"]::-webkit-outer-spin-button,
	input[type="number"]::-webkit-inner-spin-button {
		appearance: none;
		margin: 0;
	}

	.tabs,
	.cat-toolbar,
	.seg,
	.cat-pills,
	.profile-cat-filters {
		display: flex;
		gap: 8px;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
		mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
	}

	.tabs::-webkit-scrollbar,
	.cat-toolbar::-webkit-scrollbar,
	.seg::-webkit-scrollbar,
	.cat-pills::-webkit-scrollbar,
	.profile-cat-filters::-webkit-scrollbar {
		display: none;
	}

	.tabs .tab,
	.seg button,
	.cat-pills .pill {
		flex: none;
		scroll-snap-align: start;
		min-height: var(--tap);
	}

	.panel-h {
		position: sticky;
		top: calc(var(--topbar) + var(--safe-t) + 48px);
		z-index: 8;
		background: var(--surface);
	}

	table.data.fixed {
		min-width: 0;
		table-layout: auto;
	}

	.col-form {
		display: none;
	}
}

@media (max-width: 640px) {
	.content {
		padding-top: 24px;
	}

	.ov-metric .v,
	.stat .v {
		font-size: 18px;
	}

	.hero {
		padding: 18px;
	}

	.scorecard {
		grid-template-columns: minmax(0, 1fr);
	}

	.sc-main {
		padding: 18px 16px 0;
	}

	.sc-curve {
		width: calc(100% + 32px);
		margin: 14px -16px 0;
	}

	.sc-grid > div {
		padding: 14px 16px;
	}

	.sc-form {
		padding: 14px 16px;
	}

	.caller-cards {
		grid-template-columns: minmax(0, 1fr);
	}

	.form-bar {
		padding: 12px;
	}

	.hero-id h1 {
		font-size: var(--fs-2xl);
	}

	.hero-actions {
		width: 100%;
	}

	.wallet-chip {
		padding: 0 8px;
	}

	.form-bar .select,
	.form-bar .check {
		flex: 1 1 100%;
	}

	.deposit-split {
		grid-template-columns: minmax(0, 1fr);
	}

	.hide-sm {
		display: none !important;
	}

	.col-form {
		display: none;
	}

	table.data col {
		width: auto !important;
	}

	.table-wrap:not(.is-scroll) {
		overflow: visible;
	}

	.table-wrap:not(.is-scroll) table.data {
		min-width: 0;
		width: 100%;
		table-layout: auto;
	}

	.table-wrap:not(.is-scroll) table.data thead {
		display: none;
	}

	.table-wrap:not(.is-scroll) table.data colgroup {
		display: none;
	}

	.table-wrap:not(.is-scroll) table.data tbody tr {
		display: grid;
		grid-template-columns: auto 1fr auto;
		gap: 8px 12px;
		padding: 16px;
		border-bottom: 1px solid var(--border);
	}

	.table-wrap:not(.is-scroll) table.data tbody tr:last-child {
		border-bottom: 0;
	}

	.table-wrap:not(.is-scroll) table.data tbody td {
		display: block;
		width: auto;
		padding: 0;
		border: 0;
		white-space: normal;
	}

	.table-wrap:not(.is-scroll) table.data tbody td[data-label]:not([data-label=""])::before {
		content: attr(data-label);
		display: block;
		margin-bottom: 2px;
		color: var(--dim);
		font-size: 10px;
		font-weight: 600;
		letter-spacing: 0.04em;
		text-transform: uppercase;
		white-space: nowrap;
	}

	.table-wrap:not(.is-scroll) table.data tbody td.empty {
		grid-column: 1 / -1;
	}

	.table-wrap:not(.is-scroll) table.data tbody tr.is-empty-row,
	.table-wrap:not(.is-scroll) table.data tbody tr.is-filter-empty,
	.table-wrap:not(.is-scroll) table.data tbody tr#callers-empty {
		display: block;
	}

	#callers-body tr[data-caller-row] {
		grid-template-columns: 36px minmax(0, 1fr) auto;
		grid-template-areas:
			"rank who who"
			"wr yield profit"
			"form form action";
		padding: 16px;
	}

	#callers-body tr[data-caller-row] td:nth-child(1) {
		grid-area: rank;
	}

	#callers-body tr[data-caller-row] td:nth-child(2) {
		grid-area: who;
		min-width: 0;
	}

	#callers-body tr[data-caller-row] td:nth-child(3) {
		grid-area: wr;
	}

	#callers-body tr[data-caller-row] td:nth-child(4) {
		grid-area: yield;
	}

	#callers-body tr[data-caller-row] td:nth-child(5) {
		grid-area: profit;
	}

	#callers-body tr[data-caller-row] td:nth-child(6) {
		grid-area: form;
		display: flex;
		align-items: center;
	}

	#callers-body tr[data-caller-row] td:nth-child(7) {
		grid-area: action;
	}

	#callers-body tr[data-caller-row] td:nth-child(1)::before,
	#callers-body tr[data-caller-row] td:nth-child(2)::before {
		display: none;
	}

	#callers-body tr[data-caller-row] td:nth-child(3)::before,
	#callers-body tr[data-caller-row] td:nth-child(4)::before,
	#callers-body tr[data-caller-row] td:nth-child(5)::before {
		display: block;
		white-space: nowrap;
		font-size: 10px;
		letter-spacing: 0.04em;
	}

	#callers-body tr[data-caller-row] .col-form {
		display: flex;
	}

	#callers-body tr[data-caller-row] .stack-num small {
		display: none;
	}

	.table-wrap.is-scroll {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior-x: contain;
		mask-image: linear-gradient(90deg, #000 80%, transparent);
	}

	.bar-row.has-n {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 400px) {
	.wallet-chip:nth-child(2) {
		display: none;
	}

	.wallet-chip .chip-k {
		display: none;
	}

	.btn-deposit {
		padding: 0 8px;
	}
}

@media (min-width: 1480px) {
	:root {
		--content-max: 1400px;
	}
}
