.studio-main .view-stage {
	transform-origin: 50% 18%;
	transition: transform 280ms var(--ease-sheet), opacity 200ms ease;
}
.studio-main.has-sheet .view-stage {
	transform: scale(0.965) translateY(-6px);
	opacity: 0.72;
	pointer-events: none;
}

.dock {
	position: fixed;
	left: calc(12px + env(safe-area-inset-left, 0px));
	right: calc(12px + env(safe-area-inset-right, 0px));
	bottom: calc(10px + env(safe-area-inset-bottom, 0px));
	z-index: 32;
	max-width: 340px;
	margin: 0 auto;
	overflow: clip;
	background: var(--dock-bg);
	border: 1.5px solid var(--dock-line);
	border-radius: 999px;
	padding: 5px;
	box-shadow: var(--shadow-elevated);
}
.dock-in {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 4px;
	position: relative;
}
.dock-in[data-idx]::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	z-index: 0;
	border-radius: 999px;
	width: calc((100% - 8px) / 3);
	background: var(--dock-pill-bg);
	border: 1.5px solid var(--dock-pill-border);
	box-shadow: var(--dock-pill-shadow);
	pointer-events: none;
	transform: translateX(calc(var(--dock-idx, 0) * 100% + var(--dock-idx, 0) * 4px));
	transition: transform 300ms var(--ease-spring);
}
.dock-in[data-idx="0"] { --dock-idx: 0; }
.dock-in[data-idx="1"] { --dock-idx: 1; }
.dock-in[data-idx="2"] { --dock-idx: 2; }
.dock-btn {
	position: relative;
	z-index: 1;
	min-height: 48px;
	border: 0;
	background: none;
	border-radius: 999px;
	padding: 4px 6px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	color: var(--muted);
	cursor: pointer;
	transition: transform 100ms var(--ease-out), color 180ms ease;
}
.dock-btn:active { transform: translateY(1.5px); }
.dock-pill {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 22px;
	border-radius: 999px;
	transition: transform 240ms var(--ease-spring);
}
.dock-pill .ico { width: 20px; height: 20px; }
.dock-lbl { font-size: 11px; font-weight: 700; line-height: 1.1; }
.dock-btn.on { color: var(--dock-pill-ink); }
.dock-btn.on .dock-pill { transform: scale(1.04); }

.foot {
	position: fixed;
	left: 0;
	right: 0;
	bottom: calc(76px + env(safe-area-inset-bottom, 0px));
	z-index: 34;
	padding: 0 calc(12px + env(safe-area-inset-right, 0px)) 0 calc(12px + env(safe-area-inset-left, 0px));
	pointer-events: none;
	transition: transform 260ms var(--ease-sheet), opacity 200ms ease;
}
.studio-main.has-sheet .foot {
	transform: translateY(8px) scale(0.975);
	opacity: 0.35;
}
.foot .in {
	pointer-events: auto;
	max-width: 406px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	gap: 12px;
	background: var(--capsule-bg);
	color: var(--capsule-ink);
	border: 1.5px solid var(--capsule-line);
	border-radius: 20px;
	padding: 9px 9px 9px 16px;
	box-shadow: var(--capsule-shadow);
}
.foot .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.foot-top { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.foot-plan { font-size: 12px; font-weight: 700; color: var(--capsule-muted); }
.foot .amt {
	font-size: 20px;
	font-weight: 750;
	color: var(--capsule-ink);
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums;
	display: inline-block;
	transform-origin: left center;
	line-height: 1.15;
}
.foot-usd { font-size: 12px; font-weight: 600; color: var(--capsule-muted); }
.foot .pending { font-size: 13.5px; font-weight: 600; color: var(--capsule-ink); }
.foot-btn {
	min-height: 44px;
	border-radius: 13px;
	padding: 10px 18px;
	white-space: nowrap;
	background: var(--foot-btn-bg);
	border-color: var(--foot-btn-border);
	color: var(--foot-btn-ink);
	box-shadow: var(--foot-btn-shadow);
}

.cd-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	align-self: flex-start;
	font-size: 11.5px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	padding: 2px 9px;
	border-radius: 999px;
	background: var(--capsule-badge-bg);
	border: 1.5px solid var(--capsule-line);
	color: var(--capsule-muted);
}
.sheet .cd-badge { background: var(--surface-2); color: var(--muted); border-color: var(--line-strong); }
.cd-badge b { color: inherit; font-weight: 700; }
.cd-badge.is-urgent { background: var(--warn-weak); color: var(--warn); border-color: var(--warn-line); }
.cd-badge.is-expired { background: var(--err-weak); color: var(--err); border-color: var(--err-line); }

.note {
	background: var(--warn-weak);
	color: var(--warn);
	border: 1.5px solid var(--warn-line);
	border-radius: 14px;
	padding: 10px 13px;
	font-size: 13px;
	font-weight: 600;
	margin: 8px 0;
}
.notice {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	justify-content: space-between;
	background: var(--err-weak);
	border: 1.5px solid var(--err-line);
	color: var(--err);
	border-radius: 16px;
	padding: 10px 13px;
	margin: 0 0 12px;
	box-shadow: 0 2px 0 var(--err-line);
	opacity: 1;
	transform: translateY(0) scale(1);
	transition: opacity 220ms var(--ease-out), transform 240ms var(--ease-out);
	@starting-style {
		opacity: 0;
		transform: translateY(-6px) scale(0.98);
	}
}
.notice-body { min-width: 0; }
.notice-body b, .notice-body span { display: block; overflow-wrap: anywhere; }
.notice-body span { font-size: 13px; color: var(--ink); margin-top: 2px; }
.notice .link { color: var(--err); flex: none; min-height: 32px; }

.ov {
	position: fixed;
	inset: 0;
	background: var(--scrim);
	z-index: 48;
	opacity: 1;
	transition: opacity 240ms var(--ease-out);
	@starting-style { opacity: 0; }
}
.ov.is-closing {
	opacity: 0;
	transition: opacity 160ms var(--ease-out);
	pointer-events: none;
}

.sheet {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 49;
	max-height: 90dvh;
	overflow: auto;
	overscroll-behavior: contain;
	touch-action: pan-y;
	max-width: 460px;
	margin: 0 auto;
	background: var(--sheet-bg);
	border-top: 2px solid var(--line-strong);
	border-radius: 26px 26px 0 0;
	box-shadow: 0 -14px 36px rgba(30, 22, 17, 0.28);
	padding: 9px calc(15px + env(safe-area-inset-right, 0px)) calc(14px + env(safe-area-inset-bottom, 0px)) calc(15px + env(safe-area-inset-left, 0px));
	opacity: 1;
	transform: translateY(0);
	transition: transform 300ms var(--ease-sheet), opacity 220ms var(--ease-out);
	@starting-style {
		opacity: 0;
		transform: translateY(100%);
	}
}
.sheet.is-closing {
	opacity: 0;
	transform: translateY(100%);
	transition: transform 180ms var(--ease-out), opacity 150ms var(--ease-out);
	pointer-events: none;
}
.sheet.is-dragging {
	transition: none;
}

.sheet-grabber {
	position: relative;
	width: 42px;
	height: 5px;
	border-radius: 999px;
	background: var(--line-strong);
	margin: 0 auto 8px;
	touch-action: none;
	cursor: grab;
}
.sheet-grabber::before {
	content: "";
	position: absolute;
	inset: -12px -32px;
}
.sheet-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
	touch-action: none;
	cursor: grab;
}
.sheet h2 { margin: 0; font-size: 17px; letter-spacing: -0.015em; }
.sheet .box { margin-bottom: 8px; padding: 9px 12px; border-radius: 16px; }
.sheet .kv { padding: 2px 0; font-size: 13px; line-height: 1.38; }
.sheet .bind { gap: 5px; margin: 6px 0 0; }
.sheet .bind label { font-size: 12.5px; }
.sheet .bind input { min-height: 42px; padding: 7px 12px; }
.sheet .btn { min-height: 44px; padding: 8px 14px; font-size: 14.5px; }
.sheet .btn-block { margin-top: 7px; }

.receipt {
	--z: 5px;
	background: var(--surface-2);
	border: 1.5px solid var(--line-strong);
	border-radius: 16px 16px 0 0;
	padding: 9px 12px calc(9px + var(--z));
	margin-bottom: 8px;
	-webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--z)) 100%;
	mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--z)) 100%;
}
.receipt .total { border-top: 1.5px dashed var(--line-strong); margin-top: 5px; padding-top: 6px; font-weight: 700; font-size: 14px; }
.receipt p { margin: 5px 0 0; font-size: 12px; line-height: 1.38; }

.ack {
	display: flex;
	gap: 9px;
	align-items: flex-start;
	font-size: 12.5px;
	line-height: 1.38;
	background: var(--surface);
	border: 1.5px solid var(--line-strong);
	border-radius: 13px;
	padding: 8px 11px;
	margin: 6px 0;
	min-height: 44px;
	cursor: pointer;
	box-shadow: var(--shadow-ctrl);
	transition: transform 100ms var(--ease-out), border-color 160ms ease;
}
.ack:active { transform: translateY(1.5px); }
.ack input { width: 19px; height: 19px; margin: 1px 0 0; flex: none; accent-color: var(--brand); }
.actions { display: flex; gap: 8px; margin-top: 8px; }
.grow-btn { flex: 1; }

.list-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.list-head h2 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.filter-pills { display: flex; gap: 7px; margin-bottom: 12px; overflow-x: auto; padding-bottom: 3px; }
.filter-pill {
	min-height: 36px;
	border-radius: 999px;
	border: 1.5px solid var(--line-strong);
	background: var(--surface);
	color: var(--muted);
	padding: 5px 13px;
	font-size: 13px;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	white-space: nowrap;
	box-shadow: var(--shadow-ctrl);
	transition: transform 100ms var(--ease-out), background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.filter-pill:active { transform: translateY(1.5px); }
.filter-pill.on {
	background: var(--btn-primary-bg);
	border-color: var(--btn-primary-border);
	color: var(--btn-primary-ink);
	box-shadow: var(--btn-primary-shadow);
}
.filter-cnt { font-size: 11.5px; opacity: 0.88; font-variant-numeric: tabular-nums; }

.search-box { position: relative; display: flex; align-items: center; margin-bottom: 12px; }
.search-ico { position: absolute; left: 13px; display: inline-flex; color: var(--subtle); pointer-events: none; z-index: 1; }
#order-search {
	width: 100%;
	min-height: 44px;
	border: 1.5px solid var(--line-strong);
	border-radius: 13px;
	background: var(--surface);
	padding: 8px 40px 8px 38px;
	font-size: 16px;
	box-shadow: var(--shadow-ctrl);
	transition: border-color 160ms ease, background-color 160ms ease;
}
#order-search:focus { border-color: var(--focus-ring); outline: 2px solid var(--brand-ring); outline-offset: 0; }
.search-clear {
	position: absolute;
	right: 7px;
	width: 30px;
	height: 30px;
	border: 1.5px solid var(--line-strong);
	border-radius: 50%;
	background: var(--surface-2);
	color: var(--muted);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: transform 100ms var(--ease-out), color 150ms ease, border-color 150ms ease;
}
.search-clear:active { transform: scale(0.94); }

.skel-list { margin-top: 12px; }
.skel-card {
	background: var(--skel-bg);
	border: 1.5px solid var(--line);
	border-radius: 16px;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 9px;
	box-shadow: var(--shadow-card);
}
.skel-line {
	display: block;
	height: 12px;
	border-radius: 999px;
	background: var(--skel-bar);
	animation: skelPulse 1.5s ease-in-out infinite;
}
@keyframes skelPulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.48; }
}
.skel-w65 { width: 65%; }
.skel-w60 { width: 60%; }
.skel-w55 { width: 55%; }
.skel-w45 { width: 45%; }
.skel-w40 { width: 40%; }
.skel-w35 { width: 35%; }
.spin-wrap { display: inline-flex; }
.spin-wrap.is-spinning { animation: spinSlow 0.9s linear infinite; }
@keyframes spinSlow { to { transform: rotate(360deg); } }

.order-card {
	position: relative;
	overflow: hidden;
	padding: 13px 14px 13px 18px;
}
.order-card::before {
	content: "";
	position: absolute;
	left: 0;
	top: 10px;
	bottom: 10px;
	width: 4px;
	border-radius: 0 4px 4px 0;
	background: var(--subtle);
}
.order-card.is-success::before { background: var(--ok); }
.order-card.is-processing::before,
.order-card.is-submitting::before,
.order-card.is-unknown::before { background: var(--warn); }
.order-card.is-failed::before { background: var(--err); }
.order-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.order-email { overflow-wrap: anywhere; font-size: 14.5px; }
.opt .end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.order-amt { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.back-link { margin-bottom: 6px; }

.order-hero {
	position: relative;
	overflow: hidden;
	background: var(--surface);
	border: 1.5px solid var(--line-strong);
	border-radius: var(--radius-card);
	padding: 20px 16px 16px;
	margin-bottom: 12px;
	box-shadow: var(--shadow-card);
}
.hero-ribbon {
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	height: 6px;
	background: linear-gradient(90deg, #D48A1E 0%, #F4C862 100%);
}
.hero-ribbon.success { background: linear-gradient(90deg, #337A50 0%, #6EB384 100%); }
.hero-ribbon.failed { background: linear-gradient(90deg, #B33A2B 0%, #DF7060 100%); }
.hero-ribbon.cancelled { background: linear-gradient(90deg, #877563 0%, #B3A18D 100%); }
.hero-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.hero-ico {
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: var(--ok-weak);
	color: var(--ok);
	border: 1.5px solid var(--ok-ring);
	box-shadow: var(--shadow-ctrl);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
}
.order-hero.failed .hero-ico { background: var(--err-weak); border-color: var(--err-line); color: var(--err); }
.order-hero.submitting .hero-ico,
.order-hero.processing .hero-ico,
.order-hero.unknown .hero-ico { background: var(--warn-weak); border-color: var(--warn-line); color: var(--warn); }
.order-hero.cancelled .hero-ico { background: var(--surface-2); border-color: var(--line-strong); color: var(--muted); }
.hero-body { flex: 1; min-width: 0; }
.done-head { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); overflow-wrap: anywhere; }
.done-head.success { color: var(--ok); }
.done-head.failed { color: var(--err); }
.hero-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.hero-meta { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.hero-actions { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.copy-chip {
	min-height: 30px;
	border-radius: 999px;
	border: 1.5px solid var(--line-strong);
	background: var(--surface-2);
	color: var(--ink);
	padding: 3px 10px;
	font-size: 11.5px;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	cursor: pointer;
	box-shadow: var(--shadow-ctrl);
	transition: transform 100ms var(--ease-out), border-color 150ms ease, background-color 150ms ease;
}
.copy-chip:active { transform: translateY(1.5px); }
.receipt-chip { border-color: var(--brand-ring); color: var(--brand); background: var(--brand-weak); }

.step-track {
	list-style: none;
	margin: 0;
	padding: 12px 0 0;
	border-top: 1.5px dashed var(--line);
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 6px;
}
.step-track li {
	display: flex;
	align-items: center;
	gap: 5px;
	min-width: 0;
	font-size: 12px;
	font-weight: 700;
	color: var(--subtle);
}
.step-track li:not(:last-child)::after {
	content: "";
	flex: 1;
	min-width: 8px;
	height: 2px;
	border-radius: 999px;
	background: var(--line);
}
.step-track li.st-done:not(:last-child)::after { background: var(--ok); }
.step-track li.st-active:not(:last-child)::after {
	background: linear-gradient(90deg, var(--warn) 0%, var(--line) 100%);
}
.st-dot {
	width: 21px;
	height: 21px;
	border-radius: 50%;
	font-size: 11px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--surface-2);
	border: 1.5px solid var(--line-strong);
	flex: none;
}
.st-lbl { white-space: nowrap; }
.step-track .st-done { color: var(--ok); }
.step-track .st-done .st-dot { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.step-track .st-active { color: var(--warn); }
.step-track .st-active .st-dot { background: var(--warn-weak); border-color: var(--warn); color: var(--warn); }
.step-track .st-fail { color: var(--err); }
.step-track .st-fail .st-dot { background: var(--err-weak); border-color: var(--err); color: var(--err); }

.ledger-card { margin-bottom: 16px; }
.tl { list-style: none; margin: 0; padding: 2px 0 0; }
.tl li { position: relative; padding: 0 0 14px 22px; display: flex; flex-direction: column; gap: 2px; }
.tl li:last-child { padding-bottom: 0; }
.tl li::before {
	content: "";
	position: absolute;
	left: 3px;
	top: 6px;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--ok);
}
.tl li:not(:last-child)::after {
	content: "";
	position: absolute;
	left: 7px;
	top: 18px;
	bottom: -3px;
	width: 1.5px;
	background: var(--line-strong);
}
.tl li.wait::before {
	background: var(--warn);
	animation: waitPulse 1.6s ease-in-out infinite;
}
@keyframes waitPulse {
	0%, 100% { opacity: 1; transform: scale(1); }
	50% { opacity: 0.42; transform: scale(0.84); }
}
.tl-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-txt { font-size: 14px; }

.busy { text-align: center; padding: 22px 16px; }
.busy-bar {
	height: 5px;
	width: 76px;
	margin: 0 auto 12px;
	border-radius: 999px;
	background: var(--brand-weak);
	border: 1px solid var(--brand-ring);
	overflow: hidden;
	position: relative;
}
.busy-bar::after {
	content: "";
	position: absolute;
	inset: 0;
	width: 50%;
	border-radius: 999px;
	background: var(--brand);
	animation: slideBusy 1.1s ease-in-out infinite alternate;
}
@keyframes slideBusy { from { transform: translateX(0); } to { transform: translateX(100%); } }

.empty-state { text-align: center; padding: 24px 16px; }
.theme-seg button { flex-direction: row; gap: 6px; }
.set-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.set-ico {
	width: 38px;
	height: 38px;
	border-radius: 12px;
	background: var(--brand-weak);
	border: 1.5px solid var(--brand-ring);
	color: var(--brand);
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.box .set-caption { margin-top: 14px; }

@media (hover: hover) and (pointer: fine) {
	.dock-btn:hover { color: var(--ink); }
	.dock-btn.on:hover { color: var(--dock-pill-ink); }
	.foot-btn:not([disabled]):hover { background: var(--foot-btn-hover); }
	.filter-pill:not(.on):hover { border-color: var(--brand); color: var(--ink); }
	.search-clear:hover { color: var(--ink); border-color: var(--brand); }
	.copy-chip:hover { border-color: var(--brand); background: var(--surface); }
	.ack:hover { border-color: var(--brand); }
}

@media (prefers-reduced-motion: reduce) {
	.studio-main .view-stage {
		transition: opacity 120ms ease;
	}
	.studio-main.has-sheet .view-stage {
		transform: none;
		opacity: 0.78;
	}
	.foot, .dock-in[data-idx]::before, .dock-btn, .dock-pill, .ack, .filter-pill, .search-clear, .copy-chip {
		transition-property: opacity, color, background-color, border-color;
		transition-duration: 120ms;
		transition-timing-function: ease;
	}
	.dock-btn:active, .ack:active, .filter-pill:active, .search-clear:active, .copy-chip:active {
		transform: none;
	}
	.studio-main.has-sheet .foot { transform: none; opacity: 0.4; }
	.dock-btn.on .dock-pill { transform: none; }
	.notice {
		transform: none;
		transition: opacity 120ms ease;
		@starting-style { opacity: 0; transform: none; }
	}
	.ov { transition: opacity 120ms ease; }
	.ov.is-closing { transition: opacity 120ms ease; }
	.sheet {
		transform: translateY(0);
		transition: opacity 120ms ease;
		@starting-style { opacity: 0; transform: translateY(0); }
	}
	.sheet.is-closing {
		transform: translateY(0);
		transition: opacity 120ms ease;
	}
	.spin-wrap.is-spinning, .tl li.wait::before, .busy-bar::after, .skel-line {
		animation: none;
	}
}
