:root {
	--bg: #F4F7F8;
	--card: #FFFFFF;
	--ink: #1A2332;
	--muted: #8A939C;
	--teal: #14B8A6;
	--teal-deep: #0E3F3A;
	--blue: #3B82F6;
	--orange: #F5A524;
	--coral: #EF6B6B;
	--mint: #E6F7F4;
	--line: #E4EAEF;
	--soft: #F5F7F8;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
	margin: 0;
	font-family: Inter, "Segoe UI", sans-serif;
	background: var(--bg);
	color: var(--ink);
	height: 100%;
	overflow: hidden;
}
.app {
	height: 100%;
	max-height: 100%;
	max-width: 520px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	position: relative;
	background: var(--bg);
	overflow: hidden;
	padding-top: env(safe-area-inset-top);
}
.persistbar {
	position: absolute;
	top: calc(14px + env(safe-area-inset-top));
	right: 22px;
	z-index: 12;
	display: flex;
	align-items: center;
	gap: 8px;
}
.persistbar.hide { display: none !important; }
.view { display: none; flex-direction: column; }
.view.on { display: flex; flex: 1; min-height: 0; overflow: hidden; }
.top { flex: 0 0 auto; padding: 14px 112px 8px 22px; }
#view-login .top { padding: 22px; }
#view-chart .top { padding-right: 22px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.greet { font-size: 13px; color: var(--muted); }
.who { font-size: 22px; font-weight: 700; letter-spacing: -.03em; margin-top: 2px; }
.page-title { font-size: 20px; font-weight: 700; letter-spacing: -.03em; }
.iconbtn {
	position: relative;
	width: 40px;
	height: 40px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--card);
	color: var(--teal-deep);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}
.iconbtn.ghost { background: transparent; border-color: transparent; }
.iconbtn.warn { color: var(--coral); border-color: #F8D4D4; }
.iconbtn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--teal-deep);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	font-weight: 600;
	overflow: hidden;
	cursor: pointer;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 48px; height: 48px; font-size: 15px; }
.avatar.sm { width: 42px; height: 42px; }
.search {
	margin-top: 16px;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 10px 14px;
	display: flex;
	align-items: center;
	gap: 10px;
}
.search input {
	border: 0;
	outline: 0;
	flex: 1;
	font: inherit;
	font-size: 14px;
	background: transparent;
	color: var(--ink);
}
.search svg { width: 18px; height: 18px; stroke: var(--muted); fill: none; stroke-width: 1.8; }
.ids { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.moreinfo {
	margin-top: 12px;
	font-size: 12px;
	color: var(--muted);
	background: var(--card);
	border: 1px solid var(--line);
	border-left: 3px solid var(--teal);
	border-radius: 10px;
	padding: 10px 12px;
	line-height: 1.45;
}
.railwrap { padding: 4px 16px 0; flex: 0 0 auto; }
.rail { display: flex; gap: 8px; overflow-x: auto; padding: 6px 6px 10px; }
.rail::-webkit-scrollbar, .scroll::-webkit-scrollbar { display: none; }
.rail button {
	flex: 0 0 40px;
	width: 40px;
	height: 40px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--card);
	color: var(--teal-deep);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}
.rail button.on { color: #fff; border-color: transparent; }
.rail button.on.c-teal { background: var(--teal); }
.rail button.on.c-blue { background: var(--blue); }
.rail button.on.c-orange { background: var(--orange); }
.rail button.on.c-coral { background: var(--coral); }
.rail button svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.scroll { flex: 1; min-height: 0; overflow: auto; padding: 8px 22px 96px; }
.card {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 14px;
	margin-bottom: 10px;
	box-shadow: 0 6px 18px rgba(26, 35, 50, .04);
}
.card.sel { border-left: 3px solid var(--teal); }
.card.sel-blue { border-left: 3px solid var(--blue); }
.card.sel-orange { border-left: 3px solid var(--orange); }
.card.muted { color: var(--muted); text-align: center; }
.kicker { font-size: 11px; font-weight: 600; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.name { font-weight: 700; font-size: 16px; letter-spacing: -.02em; color: var(--ink); }
.meta { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.35; }
.meta-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--muted); font-size: 13px; }
.qact { display: flex; gap: 10px; margin-top: 14px; }
.qact button {
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 10px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
}
.qact button.teal { background: var(--teal); }
.qact button.blue { background: var(--blue); }
.qact button.orange { background: var(--orange); }
.qact button.coral { background: var(--coral); }
.qact button svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.qact.textbtn { flex-wrap: wrap; }
.qact.textbtn button {
	width: auto;
	height: auto;
	padding: 8px 12px;
	font-size: 12px;
	font-weight: 600;
	font-family: inherit;
}
.slot { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.slottime { width: 48px; font-size: 13px; font-weight: 600; color: var(--teal-deep); }
.grow { flex: 1; min-width: 0; }
.chev { color: var(--muted); }
.chev svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.modgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.mod {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 14px 12px 12px;
	text-align: left;
	cursor: pointer;
	min-height: 108px;
	position: relative;
	font-family: inherit;
	color: inherit;
	width: 100%;
}
.mod.sm { min-height: 0; padding: 10px; display: flex; align-items: center; gap: 10px; }
.mod.sm .mod-title { font-size: 13px; margin-top: 0; }
.mod.sm .mod-sub { margin-top: 0; }
.mod-ic { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; }
.mod.sm .mod-ic { width: 22px; height: 22px; flex: 0 0 22px; }
.mod-ic.lg { width: 32px; height: 32px; }
.mod-ic svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mod-ic.lg svg { width: 28px; height: 28px; }
.mod.sm .mod-ic svg { width: 20px; height: 20px; }
.mod-ic.teal { color: var(--teal); }
.mod-ic.blue { color: var(--blue); }
.mod-ic.orange { color: var(--orange); }
.mod-ic.coral { color: var(--coral); }
.mod-title { font-size: 15px; font-weight: 700; color: var(--ink); margin-top: 10px; letter-spacing: -.02em; }
.mod-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.dot {
	position: absolute;
	top: 10px;
	right: 10px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 9px;
	background: var(--orange);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
}
.dot.teal { background: var(--teal); }
.dot.coral { background: var(--coral); }
.minirow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.vital { display: flex; gap: 10px; }
.vital .card { flex: 1; text-align: center; margin-bottom: 0; }
.vnum { font-size: 18px; font-weight: 700; letter-spacing: -.03em; }
.listrow { display: flex; align-items: center; gap: 12px; }
.note { font-size: 13px; line-height: 1.5; margin-top: 8px; color: #3a4a47; }
.nav {
	position: fixed;
	left: 50%;
	transform: translateX(-50%);
	width: calc(100% - 36px);
	max-width: 484px;
	bottom: calc(16px + env(safe-area-inset-bottom));
	height: 64px;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 16px;
	display: flex;
	box-shadow: 0 10px 28px rgba(26, 35, 50, .08);
	padding: 6px;
	z-index: 5;
}
.nav.hide { display: none; }
.nav button {
	flex: 1;
	border: 0;
	background: none;
	color: #A8B0B6;
	cursor: pointer;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
}
.nav button .nib {
	width: 36px;
	height: 36px;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
}
.nav button.on .nib { color: #fff; }
.nav button.on.home .nib { background: var(--teal); }
.nav button.on.cal .nib { background: var(--blue); }
.nav button.on.ppl .nib { background: var(--orange); }
.nav button.on.bell .nib { background: var(--coral); }
.nav button svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ndot {
	position: absolute;
	top: 4px;
	right: 4px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--coral);
	border: 2px solid #fff;
	display: none;
}
.ndot.on { display: block; }
.mark { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); flex: 0 0 auto; }
.mark.free { background: #C5D0CC; }
.mark.video { background: var(--blue); }
.mark.orange { background: var(--orange); }
.btn {
	display: block;
	width: 100%;
	margin-top: 12px;
	padding: 14px;
	border: 0;
	border-radius: 10px;
	background: var(--teal-deep);
	color: #fff;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
}
.btn.ghost { background: var(--soft); color: var(--ink); }
.btn.danger { background: var(--coral); }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.field input, .field textarea, .field select {
	width: 100%;
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 11px 12px;
	font: inherit;
	font-size: 15px;
	background: #fff;
}
.field textarea { min-height: 120px; }
#chartbody.noteform-on {
	display: flex;
	flex-direction: column;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
	padding-bottom: 88px;
}
.noteform {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 100%;
}
.noteform-head { flex: 0 0 auto; }
.noteform-body {
	flex: 1 1 auto;
	min-height: 220px;
	display: flex;
	flex-direction: column;
	margin-bottom: 8px;
}
.noteform-body textarea {
	flex: 1 1 auto;
	min-height: 220px;
	height: 100%;
	resize: none;
	overflow-y: auto;
	line-height: 1.45;
}
.loginbox { padding: 56px 22px 24px; }
.loginbox h1 { font-size: 26px; margin: 0 0 8px; }
.loginbox p { color: var(--muted); margin: 0 0 24px; }
.loginmark {
	width: 56px;
	height: 56px;
	border-radius: 16px;
	background: var(--teal-deep);
	margin-bottom: 18px;
	position: relative;
}
.loginmark:after {
	content: '';
	position: absolute;
	left: 50%;
	top: 50%;
	width: 18px;
	height: 18px;
	transform: translate(-50%, -50%);
	background: var(--teal);
	clip-path: polygon(35% 0, 65% 0, 65% 35%, 100% 35%, 100% 65%, 65% 65%, 65% 100%, 35% 100%, 35% 65%, 0 65%, 0 35%, 35% 35%);
}
.daterow { display: flex; align-items: center; gap: 4px; margin-top: 12px; }
.daterow input[type="date"] {
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 8px 10px;
	font: inherit;
	font-size: 13px;
	background: var(--card);
	color: var(--ink);
}
.emptycard { text-align: left; color: var(--muted); }
.emptycard .name { font-size: 15px; color: var(--ink); }
.stickyact {
	position: sticky;
	bottom: 0;
	flex: 0 0 auto;
	background: var(--bg);
	padding-top: 10px;
	padding-bottom: 4px;
	z-index: 2;
}
.formhtml input, .formhtml textarea, .formhtml select {
	max-width: 100%;
}
#toast {
	position: fixed;
	left: 50%;
	transform: translateX(-50%) translateY(20px);
	bottom: 92px;
	background: var(--ink);
	color: #fff;
	padding: 10px 16px;
	border-radius: 10px;
	font-size: 13px;
	opacity: 0;
	pointer-events: none;
	z-index: 20;
	max-width: 86%;
}
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.loader {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(244,247,248,.45);
	z-index: 15;
}
body.LoadingOn .loader { display: block; }
.loader .spin {
	width: 28px;
	height: 28px;
	border: 3px solid var(--line);
	border-top-color: var(--teal);
	border-radius: 50%;
	margin: 40vh auto 0;
	animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hide { display: none !important; }
.acctrow { cursor: pointer; }
.acctlogo { max-width: 120px; max-height: 48px; }
.actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.actions .btn { width: auto; flex: 1; margin-top: 0; padding: 10px; font-size: 13px; }
.PwaUpdateBar {
	display: none;
	position: fixed;
	top: env(safe-area-inset-top);
	left: 0;
	right: 0;
	height: 4px;
	z-index: 90;
	pointer-events: none;
	overflow: hidden;
	background: rgba(20, 184, 166, 0.18);
}
.PwaUpdateBar.on { display: block; }
.PwaUpdateBarSweep {
	position: absolute;
	top: 0;
	left: 0;
	width: 28%;
	height: 100%;
	background: linear-gradient(90deg,
		rgba(20, 184, 166, 0) 0%,
		rgba(20, 184, 166, 0.9) 32%,
		var(--blue) 50%,
		rgba(20, 184, 166, 0.9) 68%,
		rgba(20, 184, 166, 0) 100%);
	box-shadow: 0 0 14px 3px rgba(20, 184, 166, 0.4);
	animation: pwaupdatekitt 0.85s ease-in-out infinite alternate;
}
@keyframes pwaupdatekitt {
	from { transform: translateX(-8%); }
	to { transform: translateX(265%); }
}
