:root {
	--bg: #f3f5f7;
	--card: #fff;
	--ink: #14212b;
	--mute: #6b7a86;
	--line: #e3e8ec;
	--brand: #0f766e;
	--brand2: #14a398;
	--brand-ink: #fff;
	--ok: #16a34a;
	--warn: #d97706;
	--bad: #dc2626;
	--okbg: #e7f6ec;
	--warnbg: #fdf1de;
	--badbg: #fdeaea;
	--shadow: 0 2px 12px rgba(20, 33, 43, 0.07);
	--r: 18px;
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #0d1317;
		--card: #161f26;
		--ink: #e8eef2;
		--mute: #8a9aa6;
		--line: #243038;
		--brand: #2dd4bf;
		--brand2: #14a398;
		--brand-ink: #04211e;
		--okbg: #12301d;
		--warnbg: #3a2a0f;
		--badbg: #3b1717;
		--shadow: none;
	}
}
:root[data-theme="dark"] {
	--bg: #0d1317;
	--card: #161f26;
	--ink: #e8eef2;
	--mute: #8a9aa6;
	--line: #243038;
	--brand: #2dd4bf;
	--brand2: #14a398;
	--brand-ink: #04211e;
	--okbg: #12301d;
	--warnbg: #3a2a0f;
	--badbg: #3b1717;
	--shadow: none;
}
* {
	box-sizing: border-box;
	margin: 0;
	-webkit-tap-highlight-color: transparent;
}
html,
body {
	height: 100%;
}
body {
	background: var(--bg);
	color: var(--ink);
	font:
		15px/1.45 system-ui,
		-apple-system,
		"Segoe UI",
		Roboto,
		sans-serif;
	display: flex;
	justify-content: center;
}
#app {
	width: 100%;
	height: 100%;
	position: relative;
	overflow: hidden;
	background: var(--bg);
}
@media (min-width: 500px) {
	#app {
		margin: auto;
		box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
	}
	body {
		align-items: center;
		background: #cfd8dc;
	}
}
button,
input,
select {
	font: inherit;
	color: inherit;
}
button {
	cursor: pointer;
	border: 0;
	background: none;
}
.view {
	position: absolute;
	inset: 0;
	overflow-y: auto;
	display: none;
	padding: calc(env(safe-area-inset-top, 0px) + 18px) 18px 110px;
	animation: in 0.25s ease;
}
.view.on {
	display: block;
}
.view.auth {
	padding-bottom: 30px;
	padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 30px);
}
@keyframes in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}
h1 {
	font-size: 24px;
	letter-spacing: -0.4px;
}
h2 {
	font-size: 17px;
}
.mute {
	color: var(--mute);
	font-size: 13px;
}
.card {
	background: var(--card);
	border-radius: var(--r);
	padding: 16px;
	box-shadow: var(--shadow);
	margin-bottom: 14px;
	border: 1px solid var(--line);
}
.row {
	display: flex;
	align-items: center;
	gap: 12px;
}
.sp {
	justify-content: space-between;
}
.grow {
	flex: 1;
	min-width: 0;
}

/* auth */
.hero {
	padding: 34px 0 22px;
}
.logo {
	width: 54px;
	height: 54px;
	border-radius: 16px;
	background: linear-gradient(135deg, var(--brand), var(--brand2));
	display: grid;
	place-items: center;
	margin-bottom: 18px;
}
.logo svg {
	width: 28px;
	height: 28px;
	stroke: var(--brand-ink);
}
.field {
	margin-bottom: 12px;
}
.field label {
	display: block;
	font-size: 13px;
	color: var(--mute);
	margin-bottom: 5px;
}
.field input {
	width: 100%;
	padding: 13px 14px;
	border-radius: 14px;
	border: 1.5px solid var(--line);
	background: var(--card);
	outline: 0;
}
.field input:focus {
	border-color: var(--brand);
}
.field.err input {
	border-color: var(--bad);
}
.field small {
	display: none;
	color: var(--bad);
	font-size: 12px;
	margin-top: 4px;
}
.field.err small {
	display: block;
}
.btn {
	width: 100%;
	padding: 14px;
	border-radius: 14px;
	background: var(--brand);
	color: var(--brand-ink);
	font-weight: 600;
	margin-top: 6px;
}
.btn.ghost {
	background: transparent;
	color: var(--brand);
	border: 1.5px solid var(--line);
}
.btn:active {
	transform: scale(0.98);
}
.link {
	color: var(--brand);
	font-weight: 600;
}
.center {
	text-align: center;
	margin-top: 16px;
}

/* header */
.top {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 18px;
}
.avatar {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--brand), var(--brand2));
	color: var(--brand-ink);
	display: grid;
	place-items: center;
	font-weight: 700;
}
.iconbtn {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: var(--card);
	border: 1px solid var(--line);
	display: grid;
	place-items: center;
	position: relative;
}
.iconbtn svg {
	width: 20px;
	height: 20px;
}
.dot {
	position: absolute;
	top: -3px;
	right: -3px;
	min-width: 18px;
	height: 18px;
	border-radius: 9px;
	background: var(--bad);
	color: #fff;
	font-size: 11px;
	display: grid;
	place-items: center;
	padding: 0 4px;
}
.dot:empty,
.dot[hidden] {
	display: none;
}
svg {
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* dashboard */
.next {
	background: linear-gradient(135deg, var(--brand), var(--brand2));
	color: var(--brand-ink);
	border: 0;
}
.next .mute {
	color: inherit;
	opacity: 0.8;
}
.next .big {
	font-size: 30px;
	font-weight: 700;
	letter-spacing: -0.5px;
	margin: 4px 0 12px;
}
.pill {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 99px;
	font-size: 12px;
	font-weight: 600;
}
.pill.ok {
	background: var(--okbg);
	color: var(--ok);
}
.pill.warn {
	background: var(--warnbg);
	color: var(--warn);
}
.pill.bad {
	background: var(--badbg);
	color: var(--bad);
}
.next .btn {
	background: rgba(255, 255, 255, 0.2);
	color: inherit;
	margin-top: 0;
}
.grid2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}
.stat b {
	display: block;
	font-size: 19px;
	margin-top: 2px;
}
.bar {
	height: 8px;
	border-radius: 99px;
	background: var(--line);
	overflow: hidden;
}
.bar i {
	display: block;
	height: 100%;
	border-radius: 99px;
	background: linear-gradient(90deg, var(--brand), var(--brand2));
	width: 0;
	transition: width 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ring {
	position: relative;
	width: 84px;
	height: 84px;
	flex: none;
}
.ring svg {
	width: 84px;
	height: 84px;
	transform: rotate(-90deg);
	stroke-width: 9;
}
.ring .t {
	stroke: var(--line);
}
.ring .p {
	stroke: var(--brand);
	transition: stroke-dashoffset 1s ease;
}
.ring span {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	font-weight: 700;
}
.sechead {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin: 6px 2px 10px;
}

/* lists */
.seg {
	display: flex;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 14px;
	padding: 4px;
	margin-bottom: 14px;
}
.seg button {
	flex: 1;
	padding: 8px;
	border-radius: 10px;
	font-size: 13px;
	color: var(--mute);
}
.seg button.on {
	background: var(--brand);
	color: var(--brand-ink);
	font-weight: 600;
}
.item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 13px 0;
	border-bottom: 1px solid var(--line);
	width: 100%;
	text-align: left;
}
.item:last-child {
	border: 0;
}
.badge {
	width: 40px;
	height: 40px;
	border-radius: 12px;
	display: grid;
	place-items: center;
	flex: none;
}
.badge svg {
	width: 19px;
	height: 19px;
}
.badge.ok {
	background: var(--okbg);
	color: var(--ok);
}
.badge.warn {
	background: var(--warnbg);
	color: var(--warn);
}
.badge.bad {
	background: var(--badbg);
	color: var(--bad);
}
.badge.info {
	background: var(--line);
	color: var(--mute);
}
.amt {
	font-weight: 600;
	text-align: right;
}

/* timeline */
.tl {
	position: relative;
	padding-left: 30px;
}
.tl:before {
	content: "";
	position: absolute;
	left: 11px;
	top: 6px;
	bottom: 6px;
	width: 2px;
	background: var(--line);
}
.st {
	position: relative;
	margin-bottom: 16px;
}
.st .node {
	position: absolute;
	left: -30px;
	top: 2px;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--card);
	border: 2px solid var(--line);
	display: grid;
	place-items: center;
}
.st .node svg {
	width: 13px;
	height: 13px;
	stroke-width: 3;
}
.st.done .node {
	background: var(--ok);
	border-color: var(--ok);
	color: #fff;
}
.st.act .node {
	border-color: var(--brand);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 25%, transparent);
}
.st .bar {
	margin-top: 8px;
}

/* settings */
.sw {
	position: relative;
	width: 46px;
	height: 27px;
	border-radius: 99px;
	background: var(--line);
	flex: none;
	transition: 0.2s;
}
.sw:after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 21px;
	height: 21px;
	border-radius: 50%;
	background: #fff;
	transition: 0.2s;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.sw.on {
	background: var(--brand);
}
.sw.on:after {
	left: 22px;
}
.opts {
	display: flex;
	gap: 6px;
}
.opts button {
	padding: 6px 11px;
	border-radius: 9px;
	border: 1px solid var(--line);
	font-size: 13px;
	color: var(--mute);
}
.opts button.on {
	background: var(--brand);
	color: var(--brand-ink);
	border-color: var(--brand);
}

.chips {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	margin: -4px -18px 14px;
	padding: 4px 18px;
	scrollbar-width: none;
}
.chips::-webkit-scrollbar {
	display: none;
}
.chips[hidden] {
	display: none;
}
.chips button {
	flex: none;
	padding: 8px 14px;
	border-radius: 99px;
	background: var(--card);
	border: 1px solid var(--line);
	font-size: 13px;
	color: var(--mute);
	white-space: nowrap;
}
.chips button.on {
	background: var(--brand);
	color: var(--brand-ink);
	border-color: var(--brand);
	font-weight: 600;
}
.utag {
	display: inline-block;
	padding: 1px 7px;
	border-radius: 7px;
	background: var(--line);
	color: var(--mute);
	font-size: 11px;
	font-weight: 600;
	margin-left: 6px;
	vertical-align: 1px;
}
.item .bar {
	height: 6px;
}
/* tabbar */
#tabs {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	display: none;
	background: var(--card);
	border-top: 1px solid var(--line);
	padding: 8px 8px calc(env(safe-area-inset-bottom, 0px) + 8px);
	z-index: 5;
}
#tabs.on {
	display: flex;
}
#tabs button {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
	font-size: 11px;
	color: var(--mute);
	padding: 4px 0;
	position: relative;
}
#tabs svg {
	width: 23px;
	height: 23px;
}
#tabs button.on {
	color: var(--brand);
	font-weight: 600;
}
#tabs .dot {
	top: -2px;
	right: calc(50% - 20px);
}

/* sheet & toast */
#scrim {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	opacity: 0;
	pointer-events: none;
	transition: 0.25s;
	z-index: 8;
}
#scrim.on {
	opacity: 1;
	pointer-events: auto;
}
#sheet {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	background: var(--card);
	border-radius: 24px 24px 0 0;
	padding: 10px 20px calc(env(safe-area-inset-bottom, 0px) + 22px);
	transform: translateY(105%);
	transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
	z-index: 9;
}
#sheet.on {
	transform: none;
}
#sheet .grab {
	width: 40px;
	height: 4px;
	border-radius: 2px;
	background: var(--line);
	margin: 0 auto 16px;
}
.kv {
	display: flex;
	justify-content: space-between;
	padding: 9px 0;
	border-bottom: 1px solid var(--line);
	gap: 14px;
}
.kv span:first-child {
	color: var(--mute);
}
.kv span:last-child {
	text-align: right;
	font-weight: 500;
}
#toast {
	position: absolute;
	left: 50%;
	bottom: 100px;
	transform: translate(-50%, 20px);
	background: var(--ink);
	color: var(--bg);
	padding: 10px 16px;
	border-radius: 12px;
	font-size: 14px;
	opacity: 0;
	pointer-events: none;
	transition: 0.25s;
	z-index: 20;
	white-space: nowrap;
}
#toast.on {
	opacity: 1;
	transform: translate(-50%, 0);
}
.empty {
	text-align: center;
	color: var(--mute);
	padding: 30px 0;
}
