.app {
	min-height: 100%;
	display: flex;
}

/* ---------- sidebar (wide) / rail (medium) ---------- */

.rail {
	position: fixed;
	inset: 0 auto 0 0;
	width: var(--side-w);
	display: flex;
	flex-direction: column;
	padding: 20px 14px 18px;
	gap: 2px;
	border-right: 1px solid var(--line);
	z-index: 40;
	background: var(--bg);
}

.rail-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 4px 10px 22px;
	color: var(--display);
	font-weight: 700;
	font-size: 17px;
	letter-spacing: -0.02em;
}

.rail-mark {
	width: 30px;
	height: 30px;
	border-radius: 9px;
	background: linear-gradient(135deg, color-mix(in srgb, var(--accent-fill) 80%, #ffffff), var(--accent-fill));
	display: grid;
	place-items: center;
	color: #fff;
	flex: none;
	box-shadow: 0 2px 6px color-mix(in srgb, var(--accent) 35%, transparent);
}

.rail-item {
	display: flex;
	align-items: center;
	gap: 11px;
	height: 36px;
	padding: 0 10px;
	border-radius: 8px;
	color: var(--ink-2);
	font-size: 14px;
	font-weight: 500;
	transition:
		color var(--dur-fast) var(--ease),
		background var(--dur-fast) var(--ease);
}

.rail-item:hover {
	color: var(--ink);
	background: var(--surface-2);
}

.rail-item.active {
	color: var(--accent);
	background: var(--accent-dim);
	font-weight: 600;
}

.rail-label {
	white-space: nowrap;
}

.rail-spacer {
	flex: 1;
}

.rail-foot {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 12px 10px 0;
	border-top: 1px solid var(--line);
	font-size: 12px;
	color: var(--ink-3);
}

.net-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 22px;
	padding: 0 8px;
	border-radius: var(--radius-pill);
	background: var(--debt-dim);
	color: var(--debt);
	font-size: 11.5px;
	font-weight: 600;
	white-space: nowrap;
	width: fit-content;
}

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

@media (min-width: 841px) and (max-width: 1099px) {
	.rail {
		width: var(--rail-w);
		align-items: center;
		padding: 22px 0;
		gap: 6px;
	}

	.rail-brand {
		padding: 0 0 18px;
	}

	.rail-brand-name,
	.rail-foot {
		display: none;
	}

	.rail-item {
		width: 56px;
		height: auto;
		min-height: 56px;
		flex-direction: column;
		justify-content: center;
		gap: 5px;
		padding: 0;
		border-radius: 12px;
	}

	.rail-label {
		font-size: 10px;
	}
}

/* ---------- main column ---------- */

.main {
	flex: 1;
	min-width: 0;
	padding-left: var(--side-w);
	display: flex;
	justify-content: center;
}

@media (min-width: 841px) and (max-width: 1099px) {
	.main {
		padding-left: var(--rail-w);
	}
}

.screen {
	width: 100%;
	max-width: 1168px;
	padding: 36px 48px 88px;
}

.screen-narrow {
	max-width: 600px;
}

.screen-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 28px;
	gap: 16px;
	min-height: 36px;
}

.screen-title {
	font-size: 26px;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: var(--display);
	display: flex;
	align-items: center;
	gap: 12px;
}

.two-col {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 360px;
	gap: 48px;
	align-items: start;
}

.two-col.pay {
	grid-template-columns: minmax(0, 1fr) 360px;
}

.two-col.activity {
	grid-template-columns: minmax(0, 1fr) 360px;
}

.two-col .aside {
	display: flex;
	flex-direction: column;
	gap: 28px;
}

/* The working column stacks its cards with one rhythm instead of touching edges. */
.two-col > div:first-child,
.faucet-page {
	display: flex;
	flex-direction: column;
	gap: 16px;
	min-width: 0;
}

.screen > .card + .two-col {
	margin-top: 16px;
}

/* A field inside a card is a section of it, not a second card. */
.card .field {
	background: none;
	box-shadow: none;
	border-radius: 0;
	padding: 12px 0 0;
	border-top: 1px solid var(--line);
}

.card.tight > :first-child {
	border-top: 0;
}

/* ---------- mobile tab bar ---------- */

.tabbar {
	display: none;
	position: fixed;
	inset: auto 0 0 0;
	height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
	padding: 8px 6px calc(env(safe-area-inset-bottom, 0px) + 14px);
	border-top: 1px solid var(--line);
	background: color-mix(in srgb, var(--bg) 94%, transparent);
	backdrop-filter: blur(24px);
	-webkit-backdrop-filter: blur(24px);
	z-index: 40;
}

/* Pay, Receive and Swap own the bottom of a phone screen: back control plus one action. */
.tabbar.flow {
	display: none !important;
}

.tabbar-item {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	color: var(--ink-3);
	font-size: 10.5px;
	letter-spacing: 0.02em;
	transition: color var(--dur-fast) var(--ease);
}

.tabbar-item.active {
	color: var(--accent);
	font-weight: 600;
}

/* ---------- header bits ---------- */

.icon-btn {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	color: var(--ink-2);
	background: var(--surface);
	box-shadow: var(--shadow-card);
	flex: none;
	transition:
		background var(--dur-fast) var(--ease),
		color var(--dur-fast) var(--ease);
}

.icon-btn:hover {
	background: var(--surface-2);
	color: var(--ink);
}

.avatar {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--accent-dim);
	display: grid;
	place-items: center;
	font-weight: 600;
	color: var(--accent);
	flex: none;
	font-size: 13px;
}

.avatar.sm {
	width: 30px;
	height: 30px;
	font-size: 12px;
}

.token-icon {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	font-weight: 700;
	font-size: 13px;
	color: #fff;
	flex: none;
}

.token-icon.sm {
	width: 22px;
	height: 22px;
	font-size: 10px;
}

/* ---------- hero ---------- */

.hero {
	padding: 14px 0 6px;
}

.hero-label {
	font-size: 12px;
	color: var(--ink-2);
	margin-bottom: 6px;
}

.tiers {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	font-size: 14px;
	color: var(--ink-2);
	margin-top: 10px;
	align-items: center;
}

.tiers b {
	color: var(--ink);
	font-weight: 500;
}

.tiers .sw {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 2px;
	margin-right: 6px;
	vertical-align: -1px;
}

/* ---------- bars: one absolute scale ---------- */

.bw {
	position: relative;
	display: block;
	width: 100%;
	overflow: hidden;
}

/* Long money runs off the edge and fades out; a mask works on any surface, tinted or not. */
.bw {
	-webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent);
	mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent);
}

.bar {
	display: flex;
	width: max-content;
	height: 6px;
	gap: 1px;
}

.bar.h4 {
	height: 4px;
}

.bar.h8 {
	height: 8px;
}

.seg {
	flex: none;
	height: 100%;
	/* Any money at all is at least a visible sliver, whatever the scale. */
	min-width: 2px;
	width: calc(var(--u) * var(--ppu) * 1px);
	border-radius: 1.5px;
	transition: width var(--dur-slow) var(--ease);
}

.c-slate {
	background: var(--slate);
}
.c-onchain {
	background: var(--onchain);
}
.c-reserve {
	background: var(--reserve);
}
.c-coll {
	background: var(--coll);
}
.c-risk {
	background: var(--risk);
}
.c-room {
	background: var(--room);
}
.c-credit {
	background: var(--credit);
}
.c-debt {
	background: var(--debt);
}
.c-this {
	background: var(--accent);
}
.c-pend {
	background: repeating-linear-gradient(135deg, var(--reserve) 0 3px, var(--coll-dim) 3px 6px);
}
.c-hold {
	background: repeating-linear-gradient(135deg, var(--hold) 0 3px, var(--hold-dim) 3px 6px);
}

.dbar {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 10px minmax(0, 1fr);
	align-items: center;
	height: 6px;
}

.dbar .half {
	position: relative;
	height: 100%;
	overflow: hidden;
	display: flex;
}

.dbar .half.out {
	justify-content: flex-end;
}

.dbar .half.out {
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 36px);
	mask-image: linear-gradient(90deg, transparent, #000 36px);
}

.dbar .half.in {
	-webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent);
	mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent);
}

.dbar .hold {
	position: absolute;
	top: 0;
	bottom: 0;
	width: calc(var(--u) * var(--ppu) * 1px);
	background: repeating-linear-gradient(135deg, var(--hold) 0 3px, var(--hold-dim) 3px 6px);
	transition: width var(--dur-slow) var(--ease);
}

.dbar .half.out .hold {
	right: 0;
}

.dbar .half.in .hold {
	left: 0;
}

.dbar .notch {
	width: 2px;
	height: 12px;
	background: var(--ink-2);
	border-radius: 1px;
	justify-self: center;
}

.dcap {
	display: flex;
	justify-content: space-between;
	font-size: 12.5px;
	color: var(--ink-3);
	margin-top: 6px;
	font-variant-numeric: tabular-nums;
	gap: 12px;
}

/* ---------- orderbook ---------- */

.book {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.bk-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 6px;
}

.bk-cols {
	display: grid;
	grid-template-columns: 96px 96px 1fr;
	gap: 10px;
	padding: 0 0 4px;
	border-bottom: 1px solid var(--line);
}

.bk-side {
	display: flex;
	flex-direction: column;
}

.bk-row {
	display: grid;
	grid-template-columns: 96px 96px 1fr;
	gap: 10px;
	align-items: center;
	height: 26px;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 6px;
	font: inherit;
	color: var(--ink);
	text-align: left;
}

button.bk-row {
	cursor: pointer;
}

button.bk-row:hover {
	background: var(--surface-2);
}

.bk-row.own .bk-size::after {
	content: ' ·';
	color: var(--accent);
}

.bk-price {
	font-size: 13px;
}

.bk-size {
	font-size: 13px;
	color: var(--ink-2);
}

.bk-bar {
	display: block;
	min-width: 0;
}

.bk-spread {
	padding: 6px 0;
	margin: 2px 0;
	border-top: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
	font-size: 12px;
	color: var(--ink-2);
	text-align: center;
}

.legend {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 18px;
	font-size: 12.5px;
	color: var(--ink-3);
}

.legend i {
	display: inline-block;
	width: 14px;
	height: 5px;
	border-radius: 2px;
	margin-right: 7px;
	vertical-align: middle;
}

/* ---------- rows ---------- */

.row {
	padding: 12px 0;
	border-top: 1px solid var(--line);
	width: 100%;
	text-align: left;
	display: block;
}

.row.first {
	border-top: 0;
}

.row.tappable {
	cursor: pointer;
	border-radius: 10px;
}

.row.tappable:hover {
	background: var(--surface-2);
	margin: 0 -12px;
	padding-left: 12px;
	padding-right: 12px;
	width: calc(100% + 24px);
	border-top-color: transparent;
}

.row.tappable:hover + .row {
	border-top-color: transparent;
}

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

.rt .tx {
	flex: 1;
	min-width: 0;
}

.rt .t {
	font-size: 14px;
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	display: flex;
	align-items: center;
	gap: 8px;
}

.rt .s {
	display: block;
	font-size: 12px;
	color: var(--ink-2);
	margin-top: 2px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.rt .r {
	text-align: right;
	white-space: nowrap;
}

.rt .r .v {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: var(--display);
}

.rt .r .u {
	display: block;
	font-size: 12.5px;
	color: var(--ink-2);
	margin-top: 2px;
}

.rt .chev {
	color: var(--ink-3);
	display: inline-flex;
}

.rb {
	margin-top: 9px;
}

.sub {
	padding: 9px 0 9px 46px;
	border-top: 1px dashed var(--line);
}

.sub .t {
	font-size: 13.5px;
}

.sub .v {
	font-size: 13.5px;
}

.chip {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	height: 20px;
	padding: 0 7px;
	border-radius: var(--radius-pill);
	background: var(--surface-2);
	color: var(--ink-2);
	font-size: 12px;
	font-weight: 500;
	white-space: nowrap;
}

.chip.hub {
	color: var(--accent);
	background: var(--accent-dim);
	font-size: 11px;
	font-weight: 600;
}

/* ---------- sections and cards ---------- */

.sect {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin: 32px 0 8px;
	min-height: 28px;
	gap: 12px;
}

.sect h3,
.sect h2 {
	font-size: 16px;
	font-weight: 650;
	letter-spacing: -0.01em;
	color: var(--display);
	text-transform: none;
}

.sect .more {
	font-size: 13px;
	font-weight: 500;
	color: var(--accent);
}

button.more {
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
	font-size: 13px;
	font-weight: 500;
	color: var(--accent);
	cursor: pointer;
}

button.more:hover {
	color: var(--accent-2);
}

.card {
	background: var(--surface);
	border-radius: 12px;
	padding: 18px 20px;
	box-shadow: var(--shadow-card);
	--fade: var(--surface);
}

.card h3 {
	margin: 0 0 10px;
}

.card h3.caps {
	font-size: 15px;
	font-weight: 650;
	color: var(--display);
}

.card.tight {
	padding: 6px 18px;
}

.kv {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 0;
	font-size: 13.5px;
	align-items: center;
}

.kv .k {
	color: var(--ink-2);
	flex: none;
}

.kv .v {
	font-weight: 500;
	text-align: right;
	min-width: 0;
}

.kv + .kv {
	border-top: 1px solid var(--line);
}

.kv.stack {
	flex-direction: column;
	align-items: stretch;
	gap: 4px;
}

.kv.stack .v {
	text-align: left;
	font-weight: 400;
}

/* ---------- fields ---------- */

.field {
	background: var(--surface);
	border-radius: 12px;
	box-shadow: var(--shadow-card);
	padding: 14px 16px;
	--fade: var(--surface);
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.field-head {
	display: flex;
	justify-content: space-between;
	font-size: 12px;
	color: var(--ink-2);
	gap: 10px;
	align-items: center;
}

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

.field-label {
	font-size: 12px;
	color: var(--ink-2);
}

.input {
	width: 100%;
	min-width: 0;
	background: transparent;
	border: none;
	outline: none;
	padding: 0;
	color: var(--ink);
	font-size: 15px;
}

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

.input.big {
	font-size: 30px;
	font-weight: 600;
	letter-spacing: -0.02em;
	color: var(--display);
	line-height: 1.1;
	font-variant-numeric: tabular-nums;
}

.input.boxed {
	background: var(--surface);
	border: 1px solid var(--line-2);
	border-radius: 8px;
	padding: 10px 12px;
	font-size: 14px;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.03);
	transition:
		border-color var(--dur-fast) var(--ease),
		box-shadow var(--dur-fast) var(--ease);
}

.input.boxed:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-dim);
	outline: none;
}

textarea.input.boxed {
	resize: vertical;
	min-height: 84px;
	font-family: var(--font-mono);
	font-size: 13px;
	line-height: 1.6;
}

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

.flip {
	display: flex;
	justify-content: center;
	margin: -17px 0;
	position: relative;
	z-index: 1;
}

.flip button {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--surface);
	box-shadow: var(--shadow-lift);
	display: grid;
	place-items: center;
	color: var(--accent);
}

/* ---------- pills, pickers, chips ---------- */

.pill {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	height: 34px;
	padding: 0 10px 0 6px;
	border-radius: var(--radius-pill);
	background: var(--surface-2);
	box-shadow: inset 0 0 0 1px var(--line);
	font-weight: 600;
	font-size: 13px;
	flex: none;
	white-space: nowrap;
}

.picker {
	position: relative;
}

.picker-menu {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	min-width: 100%;
	background: var(--surface);
	border-radius: 12px;
	padding: 6px;
	z-index: 30;
	max-height: 320px;
	overflow: auto;
	box-shadow: var(--shadow-lift);
}

.picker-menu.right {
	left: auto;
	right: 0;
}

.picker-option {
	display: flex;
	flex-direction: column;
	gap: 2px;
	width: 100%;
	text-align: left;
	padding: 9px 10px;
	border-radius: 8px;
	min-width: 0;
}

.picker-option:hover,
.picker-option.active {
	background: var(--surface-2);
}

.picker-option .t {
	font-size: 13.5px;
	font-weight: 500;
	display: flex;
	align-items: center;
	gap: 8px;
}

/* ---------- entity switcher ---------- */

/* The identity block on Home and Desk, opened as a picker over the runtime's entities. */
.entity-switch {
	display: flex;
	align-items: center;
	gap: 12px;
	max-width: 100%;
	padding: 4px 10px 4px 4px;
	margin-left: -4px;
	border-radius: 12px;
	font-size: 26px;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: var(--display);
	text-align: left;
	transition: background var(--dur-fast) var(--ease);
}

.entity-switch:hover {
	background: var(--surface-2);
}

.entity-switch .id {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	line-height: 1.2;
	min-width: 0;
}

.entity-switch .n {
	display: flex;
	align-items: center;
	gap: 7px;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.entity-switch .caret {
	color: var(--ink-3);
	display: inline-flex;
}

.entity-switcher-menu {
	min-width: 280px;
}

.chips {
	display: flex;
	gap: 6px;
	overflow-x: auto;
	scrollbar-width: none;
	padding: 2px 0;
}

.chips::-webkit-scrollbar {
	display: none;
}

.chips button {
	height: 28px;
	padding: 0 12px;
	border-radius: var(--radius-pill);
	border: 1px dashed var(--line-2);
	font-size: 12.5px;
	font-weight: 500;
	color: var(--ink-2);
	white-space: nowrap;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.chips button.active {
	background: var(--accent-dim);
	color: var(--accent);
	border: 1px solid transparent;
	font-weight: 600;
}

.segc {
	display: inline-flex;
	background: var(--surface-2);
	border: 1px solid var(--line);
	border-radius: 8px;
	padding: 2px;
}

.segc button {
	height: 24px;
	padding: 0 10px;
	border-radius: 6px;
	font-size: 12px;
	color: var(--ink-2);
	white-space: nowrap;
}

.segc button.active {
	background: var(--surface);
	color: var(--ink);
	font-weight: 600;
	box-shadow: var(--shadow-card);
}

:root[data-theme='light'] .segc {
	background: var(--surface-2);
	border-color: transparent;
}

:root[data-theme='light'] .segc button.active {
	background: var(--surface);
	box-shadow: 0 1px 2px rgba(20, 23, 30, 0.12);
}

.hops {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
	justify-content: flex-end;
	color: var(--ink-3);
}

.hop {
	height: 26px;
	padding: 0 9px;
	border-radius: 8px;
	background: var(--surface-2);
	font-size: 12.5px;
	font-weight: 500;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--ink);
	white-space: nowrap;
}

.hop.me {
	background: var(--accent-dim);
	color: var(--accent);
}

.check {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	font-size: 13px;
	padding: 5px 0;
}

.check .ck {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--coll-dim);
	color: var(--coll);
	display: grid;
	place-items: center;
	flex: none;
	margin-top: 1px;
}

.check .ck.todo {
	background: var(--surface-3);
	color: var(--ink-3);
}

/* ---------- buttons ---------- */

.btn {
	height: 44px;
	border-radius: 8px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-weight: 600;
	font-size: 14.5px;
	/* Neutral by default: the accent is reserved for the one action that moves money (.primary). */
	background: var(--surface);
	box-shadow: 0 0 0 1px var(--line-2), 0 1px 1px rgba(0, 0, 0, 0.04);
	color: var(--ink);
	width: 100%;
	transition:
		background var(--dur-fast) var(--ease),
		box-shadow var(--dur-fast) var(--ease),
		opacity var(--dur-fast) var(--ease);
	white-space: nowrap;
}

.btn:hover:not(:disabled) {
	background: var(--surface-2);
}

.btn.primary {
	background: var(--accent-fill);
	color: var(--btn-ink);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.14),
		0 1px 1px rgba(0, 0, 0, 0.12),
		0 2px 5px color-mix(in srgb, var(--accent-fill) 30%, transparent);
}

.btn.primary:hover:not(:disabled) {
	background: var(--accent-fill);
	filter: brightness(1.07);
}

/* Disabled is grey, never a faded accent that still looks pressable. */
.btn.primary:disabled,
.actions.pills .btn.primary:disabled {
	background: var(--surface-3);
	color: var(--ink-3);
	box-shadow: none;
	opacity: 1;
}

.btn.ghost {
	background: var(--surface-2);
	box-shadow: none;
	color: var(--ink);
}

.btn.sm {
	height: 34px;
	font-size: 13px;
	border-radius: 8px;
	width: auto;
	padding: 0 14px;
}

.btn.quiet {
	background: none;
	box-shadow: none;
	color: var(--accent);
	height: auto;
	width: auto;
	font-size: 13px;
	font-weight: 500;
	padding: 2px 0;
}

.btn.quiet:hover:not(:disabled) {
	background: none;
	color: var(--accent-2);
}

.btn.danger {
	background: var(--dispute-dim);
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--dispute) 30%, transparent);
	color: var(--dispute);
}

/* A row of equal flow buttons. */
.actions {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 8px;
	margin: 14px 0 4px;
}

/* Action pills: icon and label on one line, quiet grey, one accent pill for the money move. */
.actions.pills {
	display: flex;
	flex-wrap: wrap;
	margin: 18px 0 6px;
}

.actions.pills .btn {
	width: auto;
	height: 34px;
	padding: 0 14px 0 12px;
	gap: 7px;
	border-radius: var(--radius-pill);
	font-size: 13.5px;
	font-weight: 600;
	/* Tinted with the ink itself, so a pill reads on white, grey or navy surfaces alike. */
	background: color-mix(in srgb, var(--ink) 7%, transparent);
	box-shadow: none;
	color: var(--ink);
}

.actions.pills .btn:hover:not(:disabled) {
	background: color-mix(in srgb, var(--ink) 11%, transparent);
}

.actions.pills .btn.primary {
	background: var(--accent-fill);
	color: var(--btn-ink);
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12), 0 2px 5px color-mix(in srgb, var(--accent-fill) 30%, transparent);
}

.actions.pills .btn.primary:hover:not(:disabled) {
	background: var(--accent-fill);
}

/* ---------- sheet / modal ---------- */

.scrim {
	position: fixed;
	inset: 0;
	background: var(--scrim);
	z-index: 60;
	animation: fade-scrim var(--dur-fast) var(--ease);
}

@keyframes fade-scrim {
	from {
		opacity: 0;
	}
}

.sheet::backdrop { background: var(--scrim); }

.sheet {
	width: auto;
	max-width: none;
	margin: 0;
	padding: 0;
	color: inherit;
	position: fixed;
	z-index: 61;
	background: var(--surface);
	border: 1px solid var(--line-2);
	box-shadow: var(--shadow-sheet);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	--fade: var(--surface);
}

.sheet-grab {
	width: 36px;
	height: 4px;
	border-radius: 2px;
	background: var(--line-2);
	margin: 12px auto 4px;
	flex: none;
}

.sheet-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 22px 0;
}

.sheet-body {
	padding: 10px 22px 26px;
	overflow: auto;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

@media (min-width: 841px) {
	.sheet {
		inset: 50% auto auto 50%;
		transform: translate(-50%, -50%);
		width: min(480px, calc(100vw - 48px));
		max-height: min(720px, calc(100vh - 64px));
		border-radius: var(--radius-l);
		animation: sheet-pop var(--dur-slow) var(--ease);
	}

	.sheet-grab {
		display: none;
	}

	.sheet-header {
		padding-top: 18px;
	}

	@keyframes sheet-pop {
		from {
			opacity: 0;
			transform: translate(-50%, calc(-50% + 12px));
		}
	}
}

@media (max-width: 840px) {
	.sheet {
		inset: auto 0 0 0;
		max-height: 88vh;
		border-radius: 28px 28px 0 0;
		padding-bottom: env(safe-area-inset-bottom, 0px);
		animation: sheet-up var(--dur-slow) var(--ease);
	}

	@keyframes sheet-up {
		from {
			transform: translateY(24px);
			opacity: 0;
		}
	}
}

/* ---------- receipt ---------- */

.rcpt {
	text-align: center;
	padding: 6px 0 4px;
}

.rcpt .ok {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--coll-dim);
	color: var(--coll);
	display: grid;
	place-items: center;
	margin: 0 auto 14px;
}

.rcpt .ok.bad {
	background: var(--dispute-dim);
	color: var(--dispute);
}

.rcpt .a {
	font-size: 36px;
	font-weight: 600;
	letter-spacing: -0.03em;
	margin: 8px 0 4px;
	color: var(--display);
	line-height: 1;
}

.rcpt .a small {
	font-size: 16px;
	color: var(--ink-2);
	font-weight: 500;
	letter-spacing: 0;
}

.rcpt .to {
	font-size: 14px;
	color: var(--ink-2);
}

/* ---------- timeline ---------- */

.tl {
	position: relative;
	padding-left: 22px;
}

.tl::before {
	content: '';
	position: absolute;
	left: 5px;
	top: 10px;
	bottom: 10px;
	width: 1px;
	background: var(--line-2);
}

.tl .ev {
	position: relative;
	padding: 6px 0;
}

.tl .ev::before {
	content: '';
	position: absolute;
	left: -22px;
	top: 11px;
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: var(--surface);
	border: 2px solid var(--ink-3);
}

.tl .ev.done::before {
	background: var(--coll);
	border-color: var(--coll);
}

.tl .ev.now::before {
	border-color: var(--hold);
	animation: pulse 1.4s infinite;
}

.tl .ev.bad::before {
	background: var(--dispute);
	border-color: var(--dispute);
}

.tl .ev .t {
	font-size: 13.5px;
	font-weight: 500;
	display: flex;
	align-items: center;
	gap: 8px;
}

.tl .ev .s {
	font-size: 12px;
	color: var(--ink-2);
}

.tl .ev .tm {
	font-size: 12px;
	color: var(--ink-3);
	font-family: var(--font-mono);
	margin-top: 2px;
}

/* ---------- activity ---------- */

.day {
	margin: 18px 0 2px;
}

.ev-ic {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--surface-2);
	display: grid;
	place-items: center;
	color: var(--ink-2);
	flex: none;
}

.ev-ic.in {
	color: var(--coll);
}
.ev-ic.out {
	color: var(--ink);
}
.ev-ic.swap {
	color: var(--hold);
}
.ev-ic.account {
	color: var(--accent-2);
}
.ev-ic.reserve {
	color: var(--debt);
}

.row.sel {
	background: var(--surface);
	margin: 0 -12px;
	padding: 12px;
	width: calc(100% + 24px);
	border-radius: 12px;
	border-top-color: transparent;
	--fade: var(--surface);
}

.row.sel + .row {
	border-top-color: transparent;
}

/* ---------- settings ---------- */

.setting {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	padding: 14px 0;
	border-top: 1px solid var(--line);
}

.setting.first {
	border-top: 0;
}

.setting .t {
	font-size: 14px;
	font-weight: 500;
}

.setting .s {
	font-size: 12px;
	color: var(--ink-2);
	margin-top: 2px;
}

.switch {
	width: 42px;
	height: 26px;
	border-radius: 13px;
	background: var(--surface-3);
	position: relative;
	flex: none;
	transition: background var(--dur-fast) var(--ease);
}

.switch::after {
	content: '';
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--ink-2);
	transition:
		transform var(--dur-fast) var(--ease),
		background var(--dur-fast) var(--ease);
}

.switch.on {
	background: var(--accent);
}

.switch.on::after {
	transform: translateX(16px);
	background: #fff;
}

.scale-row {
	display: flex;
	align-items: center;
	gap: 14px;
}

.scale-row input[type='range'] {
	flex: 1;
}

.scale-row output {
	font-weight: 600;
	min-width: 96px;
	text-align: right;
	font-variant-numeric: tabular-nums;
}

/* ---------- toasts ---------- */

.toasts {
	position: fixed;
	left: 50%;
	bottom: calc(var(--tabbar-h) + 18px);
	transform: translateX(-50%);
	display: flex;
	flex-direction: column;
	gap: 8px;
	z-index: 80;
	width: min(420px, calc(100vw - 32px));
	pointer-events: none;
}

.toast {
	background: var(--surface-2);
	border: 1px solid var(--line-2);
	border-radius: 12px;
	padding: 12px 16px;
	font-size: 13px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
	animation: fade-in var(--dur-slow) var(--ease);
	overflow-wrap: anywhere;
}

.toast button { pointer-events: auto; }

.toast-danger {
	border-color: color-mix(in srgb, var(--dispute) 40%, transparent);
	color: var(--dispute);
}

@media (min-width: 841px) {
	.toasts {
		bottom: 28px;
		left: calc(var(--rail-w) + (100vw - var(--rail-w)) / 2);
	}
}

/* ---------- gate ---------- */

.gate {
	min-height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 48px 24px 80px;
	gap: 14px;
	text-align: center;
}

.gate-mark {
	margin-bottom: 8px;
	width: 44px;
	height: 44px;
	border-radius: 14px;
	font-size: 20px;
}

.gate-title {
	font-size: 30px;
	font-weight: 600;
	letter-spacing: -0.02em;
	text-wrap: balance;
	color: var(--display);
}

.gate-sub {
	font-size: 15px;
	max-width: 44ch;
	margin-bottom: 18px;
}

.gate-error {
	color: var(--dispute);
	font-size: 13px;
	max-width: 52ch;
	overflow-wrap: anywhere;
	white-space: pre-wrap;
}

.gate-cards {
	display: flex;
	flex-direction: column;
	gap: 8px;
	width: min(440px, 100%);
}

.gate-card {
	display: flex;
	align-items: center;
	gap: 14px;
	text-align: left;
	padding: 14px 16px;
	border-radius: 14px;
	background: var(--surface);
	border: 1px solid var(--line);
	transition: border-color var(--dur-fast) var(--ease);
	width: 100%;
}

.gate-card:hover {
	border-color: var(--line-2);
}

.gate-card > span:nth-child(2) {
	flex: 1;
	min-width: 0;
}

.gate-card-icon {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: var(--surface-2);
	display: grid;
	place-items: center;
	color: var(--accent-2);
	flex: none;
}

.gate-card-title {
	display: block;
	font-size: 14.5px;
	font-weight: 600;
}

.gate-card-sub {
	display: block;
	font-size: 12.5px;
	margin-top: 2px;
}

.gate-sandbox {
	margin-top: 10px;
	color: var(--ink-2);
}

.gate-form {
	display: flex;
	flex-direction: column;
	gap: 14px;
	width: min(440px, 100%);
	text-align: left;
}

.gate-form .field {
	gap: 8px;
}

.gate-form-actions {
	display: flex;
	gap: 10px;
	justify-content: flex-end;
	align-items: center;
	margin-top: 6px;
}

.gate-form-actions .btn {
	width: auto;
	padding: 0 22px;
}

.gate-factors {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
	gap: 6px;
}

.gate-factor {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 10px 10px;
	border-radius: 10px;
	border: 1px solid var(--line);
	background: var(--surface-2);
	text-align: left;
}

.gate-factor.active {
	border-color: var(--accent);
	background: var(--accent-dim);
}

.gate-factor-tier {
	font-size: 12.5px;
	font-weight: 600;
}

.gate-factor-shards {
	font-size: 12px;
	color: var(--ink-2);
}

.gate-busy {
	display: flex;
	flex-direction: column;
	gap: 12px;
	align-items: center;
	width: min(380px, 100%);
}

.gate-progress {
	width: 100%;
	height: 4px;
	border-radius: 2px;
	background: var(--surface-3);
	overflow: hidden;
}

.gate-progress span {
	display: block;
	height: 100%;
	background: var(--accent);
	transition: width var(--dur-slow) var(--ease);
}

.gate-progress-indeterminate span {
	width: 40%;
	animation: slide 1.4s var(--ease) infinite;
}

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

/* ---------- qr ---------- */

.qr {
	/* Scanners need a light field: plain white on paper, a warm off-white so it does not glare on the dark page. */
	background: #ffffff;
	padding: 12px;
	border-radius: 16px;
	display: inline-block;
	box-shadow: var(--shadow-card);
}

:root[data-theme='dark'] .qr {
	background: #f1eee7;
}

.qr img {
	display: block;
	width: 220px;
	height: 220px;
	border-radius: 8px;
}

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
	.two-col,
	.two-col.pay,
	.two-col.activity {
		grid-template-columns: minmax(0, 1fr);
		gap: 22px;
	}
}

@media (max-width: 840px) {
	/* Keyboard focus and scrollIntoView stop above the fixed tab bar, never under it. */
	html {
		scroll-padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 16px);
	}

	.rail {
		display: none;
	}

	.main {
		padding-left: 0;
	}

	.screen {
		padding: 10px 20px calc(var(--tabbar-h) + 36px);
	}

	.screen-header {
		margin-bottom: 14px;
		min-height: 52px;
	}

	.tabbar {
		display: flex;
	}

	.hero .display {
		font-size: 40px;
	}
}

/* ---------- viewport-only helpers ---------- */

/* !important: these helpers must beat layout rules such as `.two-col .aside { display: flex }`. */
@media (max-width: 1100px) {
	.desktop-only {
		display: none !important;
	}
}

@media (min-width: 1101px) {
	.mobile-only {
		display: none !important;
	}
}

.route-card {
	display: flex;
	flex-direction: column;
	gap: 8px;
	width: 100%;
	text-align: left;
	padding: 12px 14px;
	border-radius: 12px;
	border: 1px solid var(--line);
	background: var(--surface);
}

.route-card.active {
	border-color: var(--accent);
	background: var(--accent-dim);
}

.route-card .meta {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	font-size: 12px;
	color: var(--ink-2);
	font-variant-numeric: tabular-nums;
}

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

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

.mode-card {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
	overflow: hidden;
	text-align: left;
	padding: 10px 12px;
	border-radius: 10px;
	border: 1px solid var(--line);
	background: var(--surface);
	font-size: 13px;
}

.mode-card .v {
	margin-top: 4px;
	font-size: 13px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mode-card.active {
	border-color: var(--accent);
	background: var(--accent-dim);
}

.mode-card .d {
	font-size: 12.5px;
	color: var(--ink-2);
}

.scanner {
	position: relative;
	width: 100%;
	aspect-ratio: 1;
	border-radius: 16px;
	overflow: hidden;
	background: #000;
}

.scanner video {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ⌘K palette */
.palette {
	position: absolute;
	left: 50%;
	top: 12vh;
	transform: translateX(-50%);
	width: min(560px, calc(100vw - 32px));
	background: var(--surface);
	border: 1px solid var(--line-2);
	border-radius: var(--radius-m);
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
	overflow: hidden;
}
.palette-input {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	border-bottom: 1px solid var(--line);
	color: var(--ink-2);
}
.palette-input .input {
	border: 0;
	background: transparent;
	padding: 6px 0;
	font-size: 16px;
}
.palette-list {
	max-height: 50vh;
	overflow-y: auto;
	padding: 6px;
}
.palette-item {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 9px 10px;
	border-radius: 8px;
	text-align: left;
	color: var(--ink);
}
.palette-item .t {
	font-weight: 500;
}
.palette-item .s {
	margin-left: auto;
	color: var(--ink-3);
	font-size: 12px;
}
.palette-item.active {
	background: var(--surface-3);
}

/* Desk: the dense console */
.desk-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 360px;
	gap: 18px;
	align-items: start;
}
.desk-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
	font-variant-numeric: tabular-nums;
}
.desk-table th {
	text-align: right;
	font-weight: 600;
	font-size: 12.5px;
	color: var(--ink-2);
	padding: 8px 10px;
	border-bottom: 1px solid var(--line-2);
	white-space: nowrap;
}
.desk-table th:first-child,
.desk-table td:first-child {
	text-align: left;
}
.desk-table td {
	font-variant-numeric: tabular-nums;
	text-align: right;
	padding: 8px 10px;
	border-bottom: 1px solid var(--line);
	white-space: nowrap;
	color: var(--ink);
}
.desk-table tr.tappable:hover td {
	background: var(--surface-2);
	cursor: pointer;
}
.desk-table td.bar-cell {
	width: 220px;
	padding-right: 0;
}
.desk-table tfoot td {
	font-weight: 600;
	border-top: 1px solid var(--line-2);
	border-bottom: 0;
}
.desk-stat {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 10px;
	margin-bottom: 16px;
}
.desk-stat .card {
	padding: 12px 14px;
	margin: 0;
}
.desk-stat .k {
	font-size: 12.5px;
	font-weight: 500;
	color: var(--ink-2);
}
.desk-stat .v {
	font-size: 22px;
	font-weight: 600;
	margin-top: 2px;
}
.kbd {
	font-family: var(--font-mono);
	font-size: 11px;
	padding: 1px 6px;
	border: 1px solid var(--line-2);
	border-radius: 5px;
	color: var(--ink-2);
}
.desk-grid .card {
	overflow: hidden;
}
.desk-grid .card + .card {
	margin-top: 16px;
}
@media (max-width: 1200px) {
	.desk-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Settings: design sample + swatches inside segmented controls */
.design-sample {
	margin: 12px 0 14px;
	--fade: var(--surface);
}
.segc button .sw {
	display: inline-block;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	margin-right: 6px;
	vertical-align: -1px;
}
/* Guided tour */
/* ---------- guided tour: a spotlight and one card beside it ---------- */

.tour {
	position: fixed;
	inset: 0;
	z-index: 70;
	pointer-events: none;
}

/* The ring dims everything else; clicks still pass through to the page. */
.tour-ring {
	position: absolute;
	border-radius: 14px;
	box-shadow:
		0 0 0 2px var(--accent),
		0 0 0 8px var(--accent-dim),
		0 0 0 100vmax rgba(10, 12, 20, 0.28);
	pointer-events: none;
	transition: all var(--dur-slow) var(--ease);
	animation: tour-pulse 2.4s var(--ease) infinite;
}

.tour-ring.detail {
	box-shadow:
		0 0 0 2px var(--accent),
		0 0 0 8px var(--accent-dim),
		0 0 0 100vmax rgba(10, 12, 20, 0.42);
	animation: none;
}

@keyframes tour-pulse {
	0%,
	100% {
		box-shadow:
			0 0 0 2px var(--accent),
			0 0 0 8px var(--accent-dim),
			0 0 0 100vmax rgba(10, 12, 20, 0.28);
	}
	50% {
		box-shadow:
			0 0 0 2px var(--accent),
			0 0 0 14px transparent,
			0 0 0 100vmax rgba(10, 12, 20, 0.28);
	}
}

.tour-card {
	position: absolute;
	left: 12px;
	right: 12px;
	bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 10px);
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	background: var(--surface);
	border-radius: var(--radius-l);
	padding: 16px 18px;
	box-shadow: var(--shadow-lift);
	pointer-events: auto;
	animation: tour-in var(--dur-slow) var(--ease);
}

.tour-card.anchored {
	left: auto;
	right: auto;
	bottom: auto;
	width: 420px;
}

@keyframes tour-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
}

.tour-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.tour-head .icon-btn {
	width: 28px;
	height: 28px;
	box-shadow: none;
	background: var(--surface-2);
}

.tour-kicker {
	font-size: 12px;
	font-weight: 600;
	color: var(--accent);
}

.tour-title {
	margin: 6px 0;
	font-size: 17px;
	font-weight: 650;
	letter-spacing: -0.015em;
	color: var(--display);
}

.tour-body {
	margin: 0 0 12px;
	font-size: 13.5px;
	line-height: 1.55;
	color: var(--ink-2);
}

.tour-progress {
	height: 3px;
	margin: 0 0 12px;
	border-radius: 2px;
	background: var(--surface-3);
	overflow: hidden;
}

.tour-progress > span {
	display: block;
	height: 100%;
	border-radius: 2px;
	background: var(--accent);
	transition: width var(--dur-slow) var(--ease);
}

.tour-card .btn.primary.sm {
	pointer-events: auto;
}

/* Mark: the lit layer glows when a frame commits (Logo lit=…). */
.logo-lit {
	filter: drop-shadow(0 0 5px var(--accent));
	animation: logo-lit 900ms ease-out;
}
@keyframes logo-lit {
	from { opacity: 0.2; }
	to { opacity: 1; }
}

.gate-stack {
	font-size: 12px;
	margin: -6px 0 18px;
	font-variant-numeric: tabular-nums;
}
.receive-spectrum {
	width: 100%;
	padding: 18px;
	border: 1px solid var(--line-2);
	border-radius: var(--radius-l);
	background: linear-gradient(130deg, color-mix(in srgb, var(--coll) 7%, var(--surface)), color-mix(in srgb, var(--risk) 6%, var(--surface)));
	box-shadow: inset 0 1px 0 color-mix(in srgb, var(--ink) 9%, transparent);
}
.receive-spectrum .field-head { flex-wrap: wrap; gap: 6px; }
.receive-spectrum .note { margin: 10px 0; }
.receive-spectrum input[type='range'] {
	appearance: none; width: 100%; height: 44px; margin: 0;
	background: linear-gradient(90deg, var(--coll), var(--risk)) center / 100% 5px no-repeat;
	cursor: pointer;
}
.receive-spectrum input[type='range']::-webkit-slider-thumb {
	appearance: none; width: 28px; height: 28px; border-radius: 50%;
	background: color-mix(in srgb, var(--surface) 80%, transparent);
	border: 2px solid var(--ink); backdrop-filter: blur(12px);
	box-shadow: 0 2px 10px color-mix(in srgb, var(--ink) 15%, transparent), inset 0 1px 4px var(--line-2);
}
.receive-spectrum input[type='range']::-moz-range-thumb {
	width: 25px; height: 25px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink);
}
.spectrum-ends, .spectrum-amounts { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.spectrum-amounts { flex-wrap: wrap; }
.spectrum-amounts b { display: block; color: var(--ink); margin-top: 4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.spectrum-presets { flex-wrap: wrap; gap: 4px; margin-top: 12px; }
.spectrum-presets .active { color: var(--ink); background: var(--surface-2); }
.spectrum-buffer { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.spectrum-buffer input { min-width: 18px; min-height: 18px; accent-color: var(--risk); }
.receive-spectrum .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }


/* The dispute action reads as the serious, unilateral step it is. */
[data-testid='account-dispute'] {
	border-color: color-mix(in srgb, var(--dispute) 55%, transparent);
	color: var(--dispute);
}
[data-testid='account-dispute']:hover {
	background: color-mix(in srgb, var(--dispute) 12%, transparent);
}


/* Paper: receipts, the sovereignty page and payment requests print as clean documents. */
@media print {
	.rail, .tabbar, .tour, .toasts, .icon-btn, .btn, nav, [data-testid='nav-home'], [data-testid='nav-manage'], [data-testid='nav-settings'], [data-testid='nav-activity'] {
		display: none !important;
	}
	body, .app, .screen, .card, .sheet, .sheet-card {
		background: #fff !important;
		color: #111 !important;
		box-shadow: none !important;
	}
	.two-col { display: block !important; }
	.card, .sheet-card { border: 1px solid #ccc !important; page-break-inside: avoid; }
	a::after { content: ''; }
}

.faucet-page {
	max-width: 640px;
	margin: 0 auto;
}

/* Wallet overview: one headline, actions, then assets and activity. */
.wallet-pending { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; color: var(--hold); font-size: 13px; font-weight: 500; }
.wallet-sections { display: flex; flex-direction: column; }
.wallet-empty { padding: 18px 0; }
.wallet-show-assets { margin-top: 14px; }
.wallet-breakdown { margin-top: 4px; }
.wallet-breakdown > .sect { flex-wrap: wrap; }
.wallet-breakdown-note { display: flex; align-items: center; gap: 7px; margin-top: 10px; font-size: 12px; }
.wallet-connections .avatar { width: 32px; height: 32px; font-size: 13px; }
.wallet-overview .hero-label { display: block; margin: 14px 0 6px; }

/* Entry has one primary action; saved identities stay distinct even with equal names. */
.gate-welcome { gap: 22px; }
.gate-resume { padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.gate-resume h2, .gate-start h2 { font-size: 22px; margin: 8px 0; overflow-wrap: anywhere; }
.gate-resume > .mono { font-size: 12px; }
.gate-resume > .btn, .gate-start > .btn { width: 100%; margin-top: 18px; justify-content: center; }
.gate-start > .muted { font-size: 14px; line-height: 1.6; }
.gate-start .note { display: block; margin-top: 10px; }
.gate-other-wallets { margin-top: 18px; text-align: left; font-size: 13px; }
.gate-wallet-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; width: 100%; text-align: left; border-bottom: 1px solid var(--line); }
.gate-wallet-row span { overflow-wrap: anywhere; }
.gate-entry-actions { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); padding-top: 22px; gap: 18px; }
.gate-entry-action { display: flex; align-items: center; gap: 10px; text-align: left; }
.gate-entry-action strong, .gate-entry-action small { display: block; }
.gate-entry-action strong { font-size: 14px; font-weight: 500; }
.gate-entry-action small { font-size: 12px; color: var(--ink-2); margin-top: 5px; }
.gate-advanced { color: var(--ink-2); font-size: 12px; }
.gate-advanced .btn { margin-top: 12px; }
@media (max-width: 420px) { .gate-entry-actions { grid-template-columns: 1fr; gap: 22px; } }

/* Home fits one shared dollar scale to the actual available widths. */
/* Home fits the scale to its widths, so nothing runs off and nothing fades. */
.wallet-home .bw {
  -webkit-mask-image: none;
  mask-image: none;
}
.wallet-home .bw .bar {
  gap: 0;
}
.wallet-home .bw .seg {
  min-width: 0;
  border-radius: 0;
  transition: none;
}
/* Rounded ends on the run of segments, square joins between them. */
.wallet-home .bw .seg:first-child {
  border-top-left-radius: 99px;
  border-bottom-left-radius: 99px;
}
.wallet-home .bw .seg:last-child {
  border-top-right-radius: 99px;
  border-bottom-right-radius: 99px;
}
.wallet-scale-note {
  font-size: 12px;
  color: var(--ink-3);
}
.wallet-scale-note .more {
  margin-left: 8px;
}
.wallet-home .wallet-sections > section {
  min-width: 0;
}
.wallet-home .wallet-account {
  padding: 16px;
  margin-top: 10px;
  border-radius: 12px;
  border-top: 0;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  --fade: var(--surface);
}
.wallet-account .rt {
  flex-wrap: wrap;
}
.wallet-account .rt .r {
  overflow-wrap: anywhere;
}
.account-funding {
  margin-top: 12px;
}
.account-backing {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--ink-2);
}
.account-backing > span {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 3px;
}
.account-backing b {
  font-weight: 500;
  color: var(--ink);
  margin-left: auto;
  overflow-wrap: anywhere;
}
.account-limits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 12px;
}
.account-limits > span {
  font-size: 12px;
  color: var(--ink-2);
}
.account-limits strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.account-link {
  display: block;
  margin-top: 14px;
  font-size: 12px;
  color: var(--ink-2);
}
.test-money-intro {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
@media (max-width: 760px) {
  .wallet-home .wallet-account {
    padding: 12px;
  }
}
.wallet-account .rt .t {
  flex-wrap: wrap;
  white-space: normal;
  overflow: visible;
}
.wallet-account .rt .s {
  display: block;
  white-space: normal;
}
@media (max-width: 760px) {
  .wallet-account .rt .tx,
  .wallet-account .rt .r {
    flex-basis: 100%;
    text-align: left;
    white-space: normal;
  }
}
/* Guidance uses one compact row of controls; actions stay in the first viewport. */
.tour-head > .tour-chapters {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.tour-head > .tour-chapters select {
  width: 100%;
  max-width: 420px;
  min-width: 0;
  padding: 6px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: 6px;
}
.tour-kicker {
  flex-shrink: 0;
}
.tour-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  flex-wrap: wrap;
}
.tour-example {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}
.tour-example summary {
  cursor: pointer;
}
.tour-value {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
  color: var(--ink);
}
.tour-example p {
  margin: 8px 0;
  max-width: 640px;
}
.tour-inline {
  position: relative;
  inset: auto;
  z-index: auto;
  margin: 0 20px 8px;
  pointer-events: auto;
}
.tour-inline .tour-card.anchored {
  position: relative;
  width: auto;
  inset: auto;
  padding: 10px 14px;
  box-shadow: none;
  border-color: var(--jurisdiction-color);
}
.tour-inline .tour-body {
  margin: 6px 0 8px;
}
.tour-inline .tour-actions {
  margin-left: auto;
}
.main {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}
.main > .jurisdiction-banner,
.main > .tour-inline {
  width: calc(100% - 40px);
  max-width: 1032px;
}
.tutorial-target {
  outline: 2px solid var(--jurisdiction-color, var(--accent));
  outline-offset: 4px;
}
@media (max-width: 600px) {
  .tour-inline {
    margin: 0 12px 8px;
  }
  .tour-head > .tour-chapters {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }
  .tour-inline .tour-head {
    align-items: flex-start;
  }
  .main > .jurisdiction-banner,
  .main > .tour-inline {
    width: calc(100% - 24px);
  }
}
