/*
 * Theme Name:  SoftGanz Simple — iMed@Home
 * Theme URI: http://www.softganz.com/sharing/simple/
 * Description: Modern UI theme for the iMed@Home module (clean, medical teal).
 *              Loaded by every /imed/* page, and re-imported by
 *              style.imed.psyc.css and style.imed.care.css.
 * Copyright: 2026-2030
 * Version: 3.00
 * Author: SoftGanz by Little Bear
 * Author URI: http://www.softganz.com/
 * Tags: modern, clean, medical, responsive
 */

@import url(/css/layout-fix.css);
@import url(/css/simple.css?v=1);
@import url(/imed/css.imed.css?v=24);
@import url("https://fonts.googleapis.com/css?family=Prompt:200,300,400,600");

/* =====================================================================
 * 1. DESIGN TOKENS
 *    Existing variables are kept untouched (core CSS and sibling themes
 *    depend on them). All new values live in the --imed-* namespace.
 * ===================================================================== */
:root {
	--max-width: 980px;
	--header-height: 64px;
	--bg-color: #f0f8ff --font-color: #444;
	--link-color: #17599c;
	--link-hover-color: #1f84eb;
	--link-white-color: #fff;
	--mainnav-bg-color: var(--bg-color);
	--mainnav-menu-color: #333;
	--mainnav-menu-hover-text-color: #1652cf;
	--mainnav-menu-hover-bg-color: transparent;
	--card-bg-color: #fff;
	--parent-info-background-color: #fff4f4;
	--box-title-bg-color: red;
	--nav-card-bg-color: #b7b7b7;

	/* --- modern UI palette --- */
	--imed-accent: #0e9aa7;
	--imed-accent-strong: #0b7c86;
	--imed-accent-bright: #16b4c2;
	--imed-accent-soft: #c1edf0;
	--imed-accent-softer: #f2fbfc;
	--imed-ink: #16303a;
	--imed-text: #33555c;
	--imed-muted: #6b8a92;
	--imed-surface: #ffffff;
	--imed-surface-alt: #f7fcfd;
	--imed-border: #dce9ec;
	--imed-border-strong: #b9d6db;

	/* --imed-font: "Helvetica Neue", Helvetica, Arial, sans-serif; */
	--imed-font-header: "Prompt", "Helvetica Neue", Helvetica, Arial, sans-serif;
	--imed-radius-sm: 10px;
	--imed-radius-md: 14px;
	--imed-radius-lg: 20px;
	--imed-radius-xl: 28px;
	--imed-radius-pill: 999px;

	--imed-shadow-1:
		0 1px 2px rgba(11, 124, 134, 0.06), 0 2px 8px rgba(11, 124, 134, 0.05);
	--imed-shadow-2:
		0 6px 20px -8px rgba(11, 124, 134, 0.28), 0 2px 6px rgba(11, 124, 134, 0.06);
	--imed-shadow-3:
		0 28px 64px -24px rgba(11, 124, 134, 0.34),
		0 4px 14px rgba(11, 124, 134, 0.08);
	--imed-ring: 0 0 0 4px rgba(14, 154, 167, 0.16);
	--imed-ring-danger: 0 0 0 4px rgba(219, 68, 55, 0.14);

	--imed-page-bg: linear-gradient(
		165deg,
		#f2fbfc 0%,
		#e4f5f7 42%,
		#d8eff5 100%
	);
	--imed-nav-text: #3d626b;
	--imed-surface-translucent: rgba(255, 255, 255, 0.84);
	--imed-hairline: rgba(11, 124, 134, 0.09);
}

.theme-dark {
	--font-color: #a3a3a3;
	--link-color: #d4d4d4;
	--link-hover-color: #b6daff;
	--bg-color: #171717;
	--mainnav-bg-color: var(--bg-color);
	--mainnav-menu-color: #e1e1e1;
	--mainnav-menu-hover-text-color: #1652cf;
	--mainnav-menu-hover-bg-color: transparent;
	--card-bg-color: #373737;
	--parent-info-background-color: #fff4f4;

	/* --- modern UI palette (dark) --- */
	--imed-accent: #35c3d0;
	--imed-accent-strong: #7fe0e8;
	--imed-accent-bright: #5ad4de;
	--imed-accent-soft: #123338;
	--imed-accent-softer: #10222630;
	--imed-ink: #eaf3f5;
	--imed-text: #c6d6da;
	--imed-muted: #94abb1;
	--imed-surface: #1e2a2e;
	--imed-surface-alt: #223034;
	--imed-border: #33474c;
	--imed-border-strong: #48626a;

	--imed-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
	--imed-shadow-2: 0 6px 20px -8px rgba(0, 0, 0, 0.6);
	--imed-shadow-3: 0 28px 64px -24px rgba(0, 0, 0, 0.7);
	--imed-ring: 0 0 0 4px rgba(53, 195, 208, 0.2);
	--imed-ring-danger: 0 0 0 4px rgba(219, 68, 55, 0.22);

	--imed-page-bg: linear-gradient(
		165deg,
		#101a1d 0%,
		#12262a 48%,
		#0e1f23 100%
	);
	--imed-nav-text: #b9cdd2;
	--imed-surface-translucent: rgba(30, 42, 46, 0.86);
	--imed-hairline: rgba(53, 195, 208, 0.14);
}

.module.-car {
	--appbar-background-color: #009231;
	--appbar-text-color: #cfffd3;
	--box-title-bg-color: #009231;
}

/* =====================================================================
 * 2. BASE & TYPOGRAPHY
 * ===================================================================== */
* {
	box-sizing: border-box;
}

body {
	color: var(--font-color);
	/* font-family: var(--imed-font); */
	font-weight: 100;
}
h1,
h2,
h3,
h4 {
	margin: 0;
	padding: 4px 0;
	font-family: var(--imed-font-header);
	line-height: 1.15em;
	font-weight: 500;
	letter-spacing: -0.01em;
}
h2 {
	font-size: 1.7em;
}
h3 {
	font-size: 1.4em;
}
h4 {
	font-size: 1.3em;
}
h5 {
	font-size: 1.1em;
}
h6 {
	font-size: 1em;
}

h2.header {
	text-align: right;
	font-size: 1.2em;
}
header.header {
	margin: 0 0 16px 0;
	background-color: var(--imed-surface);
	border-radius: var(--imed-radius-md);
}

a {
	color: var(--link-color);
}
a:hover {
	color: var(--link-hover-color);
}

:focus-visible {
	outline: 3px solid rgba(14, 154, 167, 0.55);
	outline-offset: 2px;
}

/* =====================================================================
 * 3. LAYOUT & PAGE CHROME
 * ===================================================================== */
.page {
	&.-page {
		margin: 0;
		padding: 0 0 56px 0;
	}

	&.-header {
		height: var(--header-height);
		margin: 0 auto;
		padding: 0;
		background-color: var(--imed-surface-translucent);
		-webkit-backdrop-filter: blur(14px) saturate(150%);
		backdrop-filter: blur(14px) saturate(150%);
		background-repeat: no-repeat;
		position: fixed;
		z-index: 1000;
		top: auto;
		bottom: 0;
		left: 0;
		right: 0;
		align-items: center;
		box-shadow:
			0 1px 0 var(--imed-hairline),
			0 -1px 0 var(--imed-hairline);
		padding-bottom: env(safe-area-inset-bottom);
		font-family: var(--imed-font-header);

		header {
			width: auto;
			height: 40px;
			margin: 0 4px 0 12px;
			padding: 0 0 0 46px;
			overflow: visible;
			background: transparent url(imed-logo.svg) left center no-repeat;
			background-size: 36px 36px;
			text-indent: 0;
			display: none;
			h1 {
				margin: 0;
				padding: 0;
				line-height: 40px;
			}
			h1 > a {
				height: 40px;
				display: flex;
				align-items: center;
			}
			h1 span {
				font-size: 1.9rem;
				font-weight: 500;
				letter-spacing: -0.01em;
				color: var(--imed-accent-strong);
				white-space: nowrap;
			}
		}
		h1 {
			margin: 0;
			padding: 0;
			line-height: var(--header-height);
		}
		h1 > a {
			height: 100%;
			display: block;
		}
		> .wrapper {
			height: var(--header-height);
			display: flex;
			align-items: center;
			margin: 0 auto;
		}
	}

	&.-nav {
		height: 64px;
		> .nav {
			&.-main {
				height: 100%;
				> ul {
					flex: 1;
					justify-content: space-around;
				}
				> ul > li > a {
					color: var(--imed-nav-text);
					padding: 4px 10px;
					line-height: 1.15;
					font-size: 1.35rem;
					display: flex;
					flex-direction: column;
					align-items: center;
					justify-content: center;
					border-radius: var(--imed-radius-sm);
					transition:
						background-color 0.18s ease,
						color 0.18s ease;
					> .icon {
						color: inherit;
						font-size: 2.6rem;
						width: 2.6rem;
						height: 2.6rem;
						margin: 0 auto 2px;
					}
					&:hover,
					&:focus-visible {
						color: var(--imed-accent-strong);
						background-color: var(--imed-accent-soft);
					}
				}
			}
			&.-search {
				> a {
					color: var(--imed-nav-text);
				}
			}
		}
	}

	&.-content {
		margin: 0 auto;
		padding: 0;
	}
	&.-secondary {
		display: none;
	}
	&.-footer {
		display: none;
	}
	.package-footer {
		display: none;
	}
}

/* @group nav widgets */
.nav {
	&.-page {
		margin: 0 0 4px 0;
	}

	&.-app-menu {
		margin: 0 8px 16px 8px;
		background-color: var(--card-bg-color);
		border-radius: var(--imed-radius-md);
		&.-app-menu {
			> ul {
				display: flex;
				flex-wrap: wrap;
				flex: 1;
			}
			.header {
				flex: 1 0 100%;
				padding: 0;
				margin: 0;
				border-radius: var(--imed-radius-md);
				background-color: transparent;
			}
			.header > h3 {
				padding: 8px;
				margin: 0;
				height: auto;
				line-height: unset;
				font-size: 1.3em;
			}
			.ui-item {
				margin: 8px;
				flex: 0 0 calc(25% - 16px);
				text-align: center;
				background-color: var(--imed-surface);
				border-radius: var(--imed-radius-md);
				position: relative;
				overflow: hidden;
				box-shadow: var(--imed-shadow-1);
				transition:
					background-color 0.18s ease,
					transform 0.18s ease;
			}
			.ui-item:hover {
				background-color: var(--imed-accent-soft);
				transform: translateY(-1px);
			}
			.ui-item > a {
				height: 100%;
				padding: 8px 0;
				display: block;
				font-size: 0.85em;
				color: var(--imed-text);
			}
			.ui-item .icon {
				display: block;
				margin: 0 auto 6px;
				color: var(--imed-accent);
				width: 3.2rem;
				height: 3.2rem;
				font-size: 3.2rem;
				border-radius: 50%;
				padding: 0;
			}
		}
		&.-banner-menu {
			margin: 8px;
			border-radius: var(--imed-radius-md);
			padding: 4px;
			> .ui-action {
				display: flex;
				flex-wrap: wrap;
				justify-content: space-around;
			}
			> .ui-action > .ui-item {
				flex: 1 0 100%;
				margin: 8px 0;
				text-align: center;
				padding: 0;
				position: relative;
			}
			> .ui-action > .ui-item > a {
				width: 100%;
				padding: 10px 0;
				background-color: var(--imed-accent-soft);
				box-shadow: none;
				color: var(--imed-accent-strong);
				border-radius: var(--imed-radius-lg);
				transition: filter 0.18s ease;
			}
			> .ui-action > .ui-item > a:hover {
				filter: brightness(0.96);
			}
			> .ui-action > .ui-item > a > .icon {
				margin: 8px auto;
				display: block;
				color: inherit;
			}
			> .ui-action > .ui-item > a > span {
				display: block;
			}
			.-number {
				position: absolute;
				top: 4px;
				right: 4px;
				background-color: var(--imed-accent);
				color: #fff;
				display: block;
				font-size: 0.8em;
				width: 2em;
				height: 2em;
				line-height: 2em;
				border-radius: 50%;
				pointer-events: none;
			}
		}
	}

	&.-card {
		a,
		.widget-button.-link {
			color: var(--link-color);
		}
		.icon {
			color: var(--link-color);
		}
	}
}
/* @end */

/* Set max page width */
.page.-header .wrapper,
.page.-content,
.page.-footer > .wrapper {
	max-width: var(--max-width);
}
.widget-floatingactionbutton {
	max-width: calc(var(--max-width) - 16px);
}
.colorbox.-full {
	max-width: var(--max-width) !important;
}
/* @end */

.widget-header {
	> .-leading {
		font-family: Prompt;
		font-weight: 400;
		font-size: 1.8rem;
	}
	> .-title {
		> .-title-text {
			font-family: Prompt;
			font-weight: 400;
			font-size: 1.8rem;
		}
	}
}

.widget-sidebar {
	/* พาเลตต์ซอฟต์ 10 สี วนซ้ำตามลำดับปุ่ม (ปุ่มที่ 1 = สีที่ 1) */
	--sidebar-button-1: var(--imed-accent-softer);
	--sidebar-button-2: #e7f3f6;
	--sidebar-button-3: #e2eaf8;
	--sidebar-button-4: #f6efe2;
	--sidebar-button-5: #e6f3e8;
	--sidebar-button-6: #f3e9f6;
	--sidebar-button-7: #e9f4e4;
	--sidebar-button-8: #f6f2e0;
	--sidebar-button-9: #e2f2f6;
	--sidebar-button-10: #f7e8f7;

	.theme-dark & {
		--sidebar-button-1: #123338;
		--sidebar-button-2: #14343a;
		--sidebar-button-3: #1b2b3d;
		--sidebar-button-4: #3a2f22;
		--sidebar-button-5: #1e3524;
		--sidebar-button-6: #33243a;
		--sidebar-button-7: #26361f;
		--sidebar-button-8: #38331f;
		--sidebar-button-9: #16333a;
		--sidebar-button-10: #3a2438;
	}

	/* ลูกตัวแรกของ sidebar คือ .-sidebar-toggle จึงนับเฉพาะ .widget-button
	   ด้วยไวยากรณ์ :nth-child(An+B of S) เพื่อให้ปุ่มแรกได้สีที่ 1 จริง
	   ครอบด้วย :where() เพื่อไม่ให้ specificity สูงจนทับสถานะ -active */
	> .widget-button {
		color: var(--imed-ink);
		> .icon {
			color: inherit;
		}
		&:where(:nth-child(10n + 1 of .widget-button)) {
			background-color: var(--sidebar-button-1);
		}
		&:where(:nth-child(10n + 2 of .widget-button)) {
			background-color: var(--sidebar-button-2);
		}
		&:where(:nth-child(10n + 3 of .widget-button)) {
			background-color: var(--sidebar-button-3);
		}
		&:where(:nth-child(10n + 4 of .widget-button)) {
			background-color: var(--sidebar-button-4);
		}
		&:where(:nth-child(10n + 5 of .widget-button)) {
			background-color: var(--sidebar-button-5);
		}
		&:where(:nth-child(10n + 6 of .widget-button)) {
			background-color: var(--sidebar-button-6);
		}
		&:where(:nth-child(10n + 7 of .widget-button)) {
			background-color: var(--sidebar-button-7);
		}
		&:where(:nth-child(10n + 8 of .widget-button)) {
			background-color: var(--sidebar-button-8);
		}
		&:where(:nth-child(10n + 9 of .widget-button)) {
			background-color: var(--sidebar-button-9);
		}
		&:where(:nth-child(10n + 10 of .widget-button)) {
			background-color: var(--sidebar-button-10);
		}
		/* สถานะ active ต้องชนะสีพาเลตต์ */
		&.-active {
			background-color: var(--imed-accent-soft);
			color: var(--imed-accent-strong);
			font-weight: bold;
			> .icon {
				color: inherit;
			}
		}
	}
}

/* =====================================================================
 * 4. LOGIN SCREEN
 *    Rendered by the core SignForm widget, so the only lever is CSS.
 *    Markup contract (do not rely on ids, they use uniqid()):
 *      .widget-signform > header > h3 > .icon + span
 *      .widget-signform > form.sg-form > .form-item (-label-in, -group)
 *        input.form-text   + label          (username)
 *        span.form-group > input + i.icon.-show-password   (password)
 *        select.form-select.-time           (remember me)
 *        button.btn.-primary.-fill[name="signin"]
 *      .widget-signform > .-more > a.btn.-link           (forgot password)
 *      .widget-signform > .widget-column.-not-member     (register)
 *      .widget-signform > .-guideline > h5 + ul > li     (help text)
 * ===================================================================== */

/* --- 4.1 Login card (shared by every screen that shows a SignForm) --- */
.widget-signform {
	--form-max-width: 100%;
	max-width: 424px;
	margin: 24px auto;
	padding: 30px 28px 26px;
	background-color: var(--imed-surface);
	border: 1px solid var(--imed-border);
	border-radius: var(--imed-radius-xl);
	box-shadow: var(--imed-shadow-2);

	> header > h3 {
		margin: 0 0 22px;
		padding: 0;
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 10px;
		font-size: 1.5rem;
		font-weight: 500;
		color: var(--imed-ink);
		text-align: center;
		> .icon {
			width: 38px;
			height: 38px;
			font-size: 21px;
			line-height: 38px;
			border-radius: 50%;
			background-color: var(--imed-accent-soft);
			color: var(--imed-accent-strong);
			flex: 0 0 auto;
		}
		> span {
			padding: 0;
		}
	}

	/* --- 4.2 Fields --- */
	> .-form {
		max-width: var(--form-max-width);
		margin: 0;
		padding: 0;
		border-radius: var(--imed-radius-md);

		.form-item {
			margin: 0 0 14px;
			padding: 0;
			position: relative;

			> label {
				position: absolute;
				top: 9px;
				left: 18px;
				z-index: 2;
				margin: 0;
				padding: 0;
				/* font-family: var(--imed-font); */
				font-size: 1.2rem;
				font-style: normal;
				font-weight: 400;
				letter-spacing: 0.01em;
				line-height: 1.6;
				color: var(--imed-muted);
				opacity: 1;
				pointer-events: none;
				> .form-required {
					color: #db4437;
					opacity: 0.75;
				}
			}
		}

		.form-text,
		.form-password,
		input[type="password"] {
			width: 100%;
			height: 58px;
			padding: 22px 18px 8px;
			/* font-family: var(--imed-font); */
			font-size: 1.6rem;
			font-weight: 300;
			color: var(--imed-ink);
			background-color: var(--imed-surface-alt);
			border: 1px solid var(--imed-border);
			border-radius: var(--imed-radius-md);
			transition:
				border-color 0.18s ease,
				box-shadow 0.18s ease,
				background-color 0.18s ease;
			&::placeholder {
				color: transparent;
			}
			/* core re-rounds fields on hover/focus (32px), so restate the radius */
			&:hover,
			&:focus,
			&:focus-visible,
			&:active {
				border-radius: var(--imed-radius-md);
			}
			&:hover {
				background-color: var(--imed-surface);
				border-color: var(--imed-border-strong);
			}
			&:focus {
				background-color: var(--imed-surface);
				border-color: var(--imed-accent);
				box-shadow: var(--imed-ring);
				outline: none;
				color: var(--imed-ink);
			}
		}

		/* the label carries the field name, so the placeholder is redundant */
		.form-item.-label-in input::placeholder {
			color: transparent;
		}

		/* kill the peachy "required" border of the core stylesheet */
		.form-text.-require,
		.form-select.-require,
		.form-textarea.-require {
			border-color: var(--imed-border);
			&:hover {
				border-color: var(--imed-border-strong);
			}
			&:focus {
				border-color: var(--imed-accent);
			}
		}

		/* password input + visibility toggle share one visual field:
		   the input keeps the visuals, the group is only a positioning shell.
		   core rounds the group's first/last child, so re-round them here
		   (same specificity, later in the cascade). */
		.form-item > .form-group {
			display: block;
			width: 100%;
			height: auto;
			padding: 0;
			margin: 0;
			position: relative;
			background-color: transparent;
			border: none;
			border-radius: 0;
			> * {
				margin: 0;
			}
			> *:first-child,
			> *:last-child {
				border-radius: var(--imed-radius-md);
			}
			> .icon {
				border-radius: 50%;
			}
			> input {
				width: 100%;
				padding-right: 54px;
			}
		}

		.-show-password {
			position: absolute;
			right: 6px;
			top: 50%;
			transform: translateY(-50%);
			width: 44px;
			height: 44px;
			font-size: 2.2rem;
			line-height: 44px;
			border-radius: 50%;
			color: var(--imed-muted);
			cursor: pointer;
			display: flex;
			align-items: center;
			justify-content: center;
			transition:
				background-color 0.18s ease,
				color 0.18s ease;
			&:hover,
			&:focus-visible {
				background-color: var(--imed-accent-soft);
				color: var(--imed-accent-strong);
			}
		}

		/* remember-me dropdown */
		.form-select {
			width: 100%;
			height: 58px;
			padding: 0 48px 0 18px;
			/* font-family: var(--imed-font); */
			font-size: 1.6rem;
			font-weight: 300;
			color: var(--imed-text);
			background-color: var(--imed-surface-alt);
			border: 1px solid var(--imed-border);
			border-radius: var(--imed-radius-md);
			background-image: url(select-chevron.svg);
			background-position: right 14px center;
			background-repeat: no-repeat;
			background-size: 22px 22px;
			appearance: none;
			-moz-appearance: none;
			cursor: pointer;
			transition:
				border-color 0.18s ease,
				box-shadow 0.18s ease,
				background-color 0.18s ease;
			&:hover {
				background-color: var(--imed-surface);
				border-color: var(--imed-border-strong);
			}
			&:focus {
				background-color: var(--imed-surface);
				border-color: var(--imed-accent);
				box-shadow: var(--imed-ring);
				outline: none;
			}
			&:-moz-focusring {
				color: transparent;
				text-shadow: 0 0 0 var(--imed-text);
			}
		}

		/* --- 4.3 Primary action --- */
		button[name="signin"] {
			width: 100%;
			min-height: 56px;
			padding: 0 20px;
			justify-content: center;
			border-radius: var(--imed-radius-pill);
			background-color: var(--imed-accent);
			background-image: linear-gradient(
				135deg,
				var(--imed-accent-bright) 0%,
				var(--imed-accent) 55%,
				var(--imed-accent-strong) 100%
			);
			color: #fff;
			/* font-family: var(--imed-font); */
			font-size: 1.7rem;
			font-weight: 500;
			box-shadow: 0 12px 24px -12px rgba(11, 124, 134, 0.85);
			transition:
				transform 0.16s ease,
				box-shadow 0.18s ease,
				filter 0.18s ease;
			> span {
				color: #fff;
				padding: 8px 0;
			}
			> .icon {
				color: #fff;
				font-size: 2.1rem;
			}
			&:hover {
				transform: translateY(-1px);
				filter: brightness(1.04);
				box-shadow: 0 16px 30px -12px rgba(11, 124, 134, 0.9);
				color: #fff;
			}
			&:active {
				transform: translateY(0) scale(0.995);
			}
			&:disabled,
			&.-disabled {
				filter: grayscale(0.65) opacity(0.6);
				box-shadow: none;
				transform: none;
				cursor: not-allowed;
			}
		}
	}

	/* --- 4.4 Secondary actions --- */
	> .-more {
		max-width: var(--form-max-width);
		margin: 4px auto 0;
		text-align: center;
		> * {
			margin: 0;
		}
		> a {
			display: inline-flex;
			align-items: center;
			justify-content: center;
			gap: 6px;
			min-height: 44px;
			padding: 0 16px;
			color: var(--imed-accent-strong);
			font-size: 1.45rem;
			border-radius: var(--imed-radius-pill);
			background-color: transparent;
			transition: background-color 0.18s ease;
			> .icon {
				color: inherit;
				font-size: 1.9rem;
			}
			> span {
				padding: 0;
			}
			&:hover {
				background-color: var(--imed-accent-soft);
				color: var(--imed-accent-strong);
			}
		}
	}

	> .widget-column.-not-member {
		max-width: var(--form-max-width);
		margin: 20px auto 0;
		padding-top: 26px;
		position: relative;
		text-align: center;
		&::after {
			content: "";
			position: absolute;
			top: 7px;
			left: 0;
			right: 0;
			height: 1px;
			background-color: var(--imed-border);
			z-index: 0;
		}
		&::before {
			content: "หรือ";
			position: absolute;
			top: 0;
			left: 50%;
			transform: translateX(-50%);
			z-index: 1;
			padding: 0 14px;
			background-color: var(--imed-surface);
			color: var(--imed-muted);
			font-size: 1.25rem;
			line-height: 1.55;
		}
		> .-item > h3 {
			margin: 0 0 10px;
			padding: 0;
			font-size: 1.45rem;
			font-weight: 400;
			color: var(--imed-muted);
		}
		.btn.-link {
			border: 1.5px solid var(--imed-border-strong);
			background-color: var(--imed-surface);
			color: var(--imed-accent-strong);
			border-radius: var(--imed-radius-pill);
			min-height: 52px;
			padding: 0 20px;
			justify-content: center;
			/* font-family: var(--imed-font); */
			font-size: 1.6rem;
			font-weight: 500;
			box-shadow: none;
			transition:
				background-color 0.18s ease,
				border-color 0.18s ease,
				transform 0.16s ease;
			> .icon {
				color: inherit;
				font-size: 2rem;
			}
			> span {
				padding: 0;
			}
			&:hover {
				background-color: var(--imed-accent-soft);
				border-color: var(--imed-accent);
				color: var(--imed-accent-strong);
				transform: translateY(-1px);
			}
		}
	}

	/* --- 4.5 Login help / guideline panel --- */
	> .-guideline {
		margin: 22px 0 0;
		padding: 15px 18px 14px 20px;
		border-radius: var(--imed-radius-sm);
		background-color: var(--imed-accent-softer);
		font-size: 1.25rem;
		line-height: 1.7;
		color: var(--imed-text);
		> h5 {
			margin: 0 0 6px;
			padding: 0;
			font-size: 1.3rem;
			font-weight: 500;
			color: var(--imed-accent-strong);
			letter-spacing: 0;
		}
		> ul {
			margin: 0;
			padding-left: 18px;
		}
		> ul > li {
			margin: 3px 0;
		}
		> ul > li::marker {
			color: var(--imed-accent);
		}
		> ul b,
		> ul strong {
			font-weight: 500;
			color: var(--imed-ink);
		}
	}

	/* --- 4.6 Error state (core adds .-error on failed validation) --- */
	.form-item.-error,
	.form-item:has(.messages.-error) {
		.form-text,
		input[type="password"],
		.form-select {
			border-color: #db4437;
			box-shadow: var(--imed-ring-danger);
		}
		> label {
			color: #db4437;
		}
	}
	.messages.-error {
		margin: 0 0 14px;
		padding: 12px 16px;
		border-radius: var(--imed-radius-sm);
		background-color: rgba(219, 68, 55, 0.08);
		border-left: 3px solid #db4437;
		color: #a3251a;
		font-size: 1.3rem;
	}
}

/* same page background on every iMed page */
body.module-imed .page.-page {
	min-height: 100dvh;
	background: var(--imed-page-bg);
}

/* --- 4.7 Login page shell (only when the SignForm *is* the page body) --- */
body.module-imed:has(.page.-main > .widget-container > .widget-signform) {
	.page.-page {
		padding: 0;
		min-height: 100dvh;
		background: var(--imed-page-bg);
		position: relative;
		overflow-x: hidden;
	}

	.page.-content {
		position: relative;
		z-index: 1;
		max-width: none;
		padding: 0;
		background: transparent;
	}

	.page.-main {
		display: grid;
		grid-template-columns: minmax(0, 1fr);
		justify-items: center;
		align-content: start;
		max-width: var(--max-width);
		min-height: calc(100dvh - var(--header-height));
		margin: 0 auto;
		padding: 28px 18px 96px;
	}

	/* brand block (wordmark + illustration) */
	.page.-main::before {
		display: block;
		width: 100%;
		max-width: 424px;
		padding: 0;
		content: "iMed@home";
		font-family: var(--imed-font-header);
		font-size: 3rem;
		font-weight: 600;
		letter-spacing: -0.02em;
		line-height: 1.2;
		color: var(--imed-ink);
		text-align: center;
	}

	/* tagline */
	.page.-main::after {
		display: block;
		width: 100%;
		max-width: 424px;
		margin: 8px 0 20px;
		content: "ดูแลผู้ป่วยที่บ้าน · ร่วมสร้างสังคมไม่ทอดทิ้งกัน";
		/* font-family: var(--imed-font); */
		font-size: 1.5rem;
		line-height: 1.65;
		color: var(--imed-muted);
		text-align: center;
	}

	.page.-main > .widget-container {
		width: 100%;
		max-width: 424px;
	}

	.page.-main > .widget-container > .widget-signform {
		margin: 0 auto;
	}
}

/* --- 4.8 Tablet: keep a compact illustration above the card --- */
@media (min-width: 30em) and (max-width: 52.4999em) {
	/* 480 - 840 */
	body.module-imed:has(.page.-main > .widget-container > .widget-signform) {
		.page.-main::before {
			display: block;
			width: 100%;
			max-width: 400px;
			height: clamp(230px, 36vh, 330px);
			padding: 62px 0 0;
			background:
				url(login-hero.svg) center bottom / auto calc(100% - 150px) no-repeat,
				url(imed-mark.svg) center top / 46px 46px no-repeat;
		}
	}
}

/* --- 4.9 Small phones: keep the artwork small so the form stays reachable --- */
@media (max-width: 29.9999em) {
	body.module-imed:has(.page.-main > .widget-container > .widget-signform) {
		.page.-main {
			padding: 18px 14px 88px;
		}
		.page.-main::before {
			font-size: 2.5rem;
		}
		.page.-main::after {
			margin: 6px 0 16px;
			font-size: 1.4rem;
		}
		.widget-signform {
			padding: 24px 20px 22px;
			border-radius: var(--imed-radius-lg);
		}
		.widget-signform > header > h3 {
			font-size: 1.4rem;
		}
		.widget-signform > .-form .form-text,
		.widget-signform > .-form .form-password,
		.widget-signform > .-form input[type="password"],
		.widget-signform > .-form .form-select {
			height: 54px;
			font-size: 1.55rem;
		}
		.widget-signform > .-form button[name="signin"] {
			min-height: 52px;
			font-size: 1.6rem;
		}
	}
}

/* --- 4.10 Desktop split layout for the login screen --- */
@media (min-width: 52.5em) {
	/* 840/16 = 52.5 */
	body.module-imed:has(.page.-main > .widget-container > .widget-signform) {
		.page.-main {
			grid-template-columns: minmax(0, 1fr) 424px;
			/* the artwork column takes the leftover vertical space */
			grid-template-rows: minmax(0, 1fr) auto;
			column-gap: 56px;
			row-gap: 0;
			justify-items: center;
			align-content: stretch;
			align-items: center;
			padding: 40px 32px 72px;
		}
		.page.-main::before {
			grid-area: 1 / 1;
			align-self: center;
			width: 100%;
			max-width: 460px;
			height: clamp(260px, 50vh, 480px);
			padding: 62px 0 0;
			background:
				url(login-hero.svg) center bottom / auto calc(100% - 150px) no-repeat,
				url(imed-mark.svg) center top / 54px 54px no-repeat;
			font-size: clamp(2.8rem, 3.6vw, 4.2rem);
		}
		.page.-main::after {
			grid-area: 2 / 1;
			align-self: end;
			max-width: 420px;
			margin: 0;
			font-size: 1.65rem;
		}
		.page.-main > .widget-container {
			grid-area: 1 / 2 / span 2 / span 1;
			align-self: center;
			max-width: 424px;
		}
	}
}

/* =====================================================================
 * 5. AUTHENTICATED APP FOUNDATION
 *    The login composition above remains unchanged; these rules apply to
 *    signed-in app pages and keep the iMed shell mobile-first.
 * ===================================================================== */

body.module-imed.-search
	.imed-search-patient
	> .-patient-list
	.widget-listtile {
	margin: 8px 0 0;
	border: 1px solid var(--imed-border);
	border-radius: var(--imed-radius-sm);
	background: var(--imed-surface-alt);
}

/*
	.-imed-app-home {
		display: flex;
		align-items: center;
		gap: 8px;
		max-width: 100%;
		padding: 6px 10px;
		border: 1px solid var(--imed-border);
		border-radius: var(--imed-radius-lg);
		background: var(--imed-surface);
		box-shadow: var(--imed-shadow-1);
	}

	.-imed-app-home > img {
		flex: 0 0 40px;
		border-radius: 50%;
	}

	.-imed-app-home .form-text {
		display: flex;
		flex: 1 1 auto;
		align-items: center;
		justify-content: space-between;
		gap: 8px;
		width: auto;
		min-width: 0;
		min-height: 48px;
		padding: 6px 10px;
		border: 0;
		border-radius: var(--imed-radius-lg);
		background: transparent;
		color: var(--imed-ink);
		font-size: 1.35rem;
		line-height: 1.4;
		white-space: normal;
	}

	.-imed-app-home .form-text > span {
		flex: 1 1 auto;
		min-width: 0;
	}

	.-imed-app-home .form-text > .icon {
		flex: 0 0 auto;
	}

		.-imed-app-home {
			align-items: flex-start;
			gap: 4px;
			padding: 6px;
		}

		.-imed-app-home > img {
			flex-basis: 32px;
			width: 32px;
			height: 32px;
		}

		.-imed-app-home .form-text {
			min-height: 44px;
			padding: 4px 6px;
			font-size: 1.25rem;
		}
 */

body.module-imed:not(:has(.widget-signform)) {
	--imed-content-width: 980px;
	--imed-content-gutter: 16px;

	.page.-page {
		min-height: 100dvh;
		background: var(--imed-page-bg);
	}

	.page.-content,
	.page.-main {
		width: 100%;
		max-width: var(--imed-content-width);
		margin-left: auto;
		margin-right: auto;
	}

	.page.-main {
		min-width: 0;
		padding: 0 0 calc(var(--header-height) + 24px);
	}

	.page.-header {
		background-color: var(--imed-surface-translucent);
		box-shadow: 0 -8px 24px rgba(11, 56, 64, 0.08);
		-webkit-backdrop-filter: blur(16px) saturate(150%);
		backdrop-filter: blur(16px) saturate(150%);
	}

	.page.-main .imed-home-banner {
		overflow: hidden;
		border-radius: var(--imed-radius-lg);
		box-shadow: var(--imed-shadow-1);
	}

	.page.-main .imed-home-banner img {
		display: block;
		width: 100%;
		height: auto;
	}

	.page.-main img,
	.page.-main .photoitem.-wide {
		max-width: 100%;
		height: auto;
	}

	.imed-visits {
		min-width: 0;
	}

	.imed-visits .widget-card {
		min-width: 0;
		overflow: hidden;
		border: 1px solid var(--imed-border);
		border-radius: var(--imed-radius-md);
		background: var(--imed-surface);
		box-shadow: var(--imed-shadow-1);
	}

	.page.-main .ui-card.-patient > .ui-item,
	.page.-main .ui-card.-patient > a.ui-item {
		min-width: 0;
		border: 1px solid var(--imed-border);
		border-radius: var(--imed-radius-md);
		background: var(--imed-surface);
		box-shadow: var(--imed-shadow-1);
	}

	.page.-main .ui-card.-patient > .ui-item a,
	.page.-main .ui-card.-patient > a.ui-item {
		min-height: 44px;
	}

	.page.-main :focus-visible {
		outline: 3px solid rgba(14, 154, 167, 0.55);
		outline-offset: 2px;
	}
}

@media (max-width: 767px) {
	/* body.module-imed.-search .imed-chat-box .form-item.-group > .form-group {
		display: flex !important;
		width: 100% !important;
		min-width: 0;
		max-width: 100%;
		overflow: hidden;
	}

	body.module-imed.-search
		.imed-chat-box
		.form-item.-group
		> .form-group
		> .input-prepend,
	body.module-imed.-search
		.imed-chat-box
		.form-item.-group
		> .form-group
		> .input-append {
		position: static;
		flex: 0 0 36px;
		width: 36px;
	}

	body.module-imed.-search
		.imed-chat-box
		.form-item.-group
		> .form-group
		> .input-prepend
		> *,
	body.module-imed.-search
		.imed-chat-box
		.form-item.-group
		> .form-group
		> .input-append
		> * {
		position: static;
	}

	body.module-imed.-search
		.imed-chat-box
		.form-item.-group
		> .form-group
		> input {
		flex: 1 1 auto;
		width: 100%;
		min-width: 0;
	} */

	body.module-imed:not(:has(.widget-signform)) {
		--imed-content-gutter: 12px;
		--header-height: 64px;

		.page.-main {
			padding-top: 0;
			padding-bottom: calc(
				var(--header-height) + env(safe-area-inset-bottom) + 20px
			);
		}

		.page.-header {
			height: calc(var(--header-height) + env(safe-area-inset-bottom));
		}

		.page.-header > .wrapper {
			height: var(--header-height);
		}

		.imed-visits .widget-card > .nav.-card {
			width: 100%;
			min-width: 0;
			flex-wrap: wrap;
			justify-content: flex-start;
			gap: 4px;
			padding: 8px;
		}

		.imed-visits .widget-card > .nav.-card > .-item {
			min-width: 0;
			flex: 1 1 108px;
			margin: 0;
		}

		.imed-visits .widget-card > .nav.-card .widget-button {
			width: 100%;
			min-width: 0;
			min-height: 44px;
			padding: 6px 8px;
			border-radius: var(--imed-radius-sm);
			white-space: normal;
			font-size: 1.25rem;
			line-height: 1.35;
		}

		.imed-visits .widget-card > .nav.-card .icon {
			flex: 0 0 auto;
		}

		.imed-visits .widget-card > .nav.-card .-label {
			display: block;
			min-width: 0;
			padding: 0;
			white-space: normal;
			overflow-wrap: anywhere;
		}
	}
}

/* =====================================================================
 * 6. WIDGETS & COMPONENTS
 * ===================================================================== */

/* For this website only */
.card-item {
	background-color: var(--imed-surface);
	margin: 16px 0;
	border-radius: var(--imed-radius-md);
}
.navbar {
	box-shadow: none;
	border: 1px var(--imed-border) solid;
	border-top: none;
}
.user-register-form legend {
	padding: 8px 16px;
	border-radius: var(--imed-radius-lg);
}

.ui-card > .ui-item {
	background-color: var(--imed-surface);
}
.ui-tag .ui-item {
	border-radius: 4px;
	padding: 2px 16px;
}
.ui-state-disabled.more {
	color: var(--font-color);
	text-align: center;
}

.header.-sub {
	background: var(--imed-accent);
	color: #fff;
	text-align: center;
	font-size: 1.3em;
	border-radius: var(--imed-radius-sm);
}

.inline-edit-item.-radio {
	padding: 4px 16px 8px 16px;
	border: 1px var(--imed-border) solid;
	margin: 0 0 4px 0;
	border-radius: var(--imed-radius-sm);
	background: var(--imed-surface-alt);
	display: block;
}
.inline-edit-item.-radio > label {
	display: block;
}
.imed-visit-qt-menu.-app-menu .ui-item {
	flex: 0 0 calc(100% - 16px);
}

.qrcode {
	text-align: center;
	.-url {
		display: block;
	}
}

.congratulation {
	text-align: center;
	padding: 64px 0;
	&::before {
		content: "";
		display: block;
		height: 200px;
		background-image: url(congratulation.png);
		background-size: contain;
		background-repeat: no-repeat;
		background-position: center center;
		margin: 0 0 16px 0;
	}
}

.login {
	.-guideline {
		font-size: 0.8em;
	}
	.-info p {
		font-size: 0.8em;
	}
	> .-form > .ui-action {
		text-align: center;
		display: block;
		padding: 0 0 32px;
	}
}

/* @group user-register-form */
.user-register-form {
	legend {
		padding: 8px 16px;
		border-radius: var(--imed-radius-lg);
	}
	.user-register-form-account {
		background-color: var(--imed-accent-softer);
		border: 1px var(--imed-accent-soft) solid;
		> legend {
			background-color: var(--imed-accent-soft);
			color: var(--imed-accent-strong);
		}
	}
	.user-register-form-personal {
		background-color: var(--imed-surface-alt);
		border: 1px var(--imed-border) solid;
		> legend {
			background-color: var(--imed-border);
		}
	}
}
/* @end */

/* @group widget-report */
.widget-report {
	--bgcolor-1: var(--imed-accent-softer);
	--bgcolor-2: #e7f3f6;
	--bgcolor-3: #e2eaf8;
	--bgcolor-4: #f6efe2;
	--bgcolor-5: #e6f3e8;
	--bgcolor-6: #f3e9f6;
	--bgcolor-7: #e9f4e4;
	--bgcolor-8: #f6f2e0;
	--bgcolor-9: #e2f2f6;

	.report-output-summary {
		margin: 16px 0;
		> .widget-table th {
			white-space: nowrap;
			border: none;
		}
		> .widget-table > thead > tr:first-child > th:first-child {
			border-bottom: 1px var(--imed-surface) solid;
		}
		> .widget-table > thead > tr:nth-child(2) > th {
			border-bottom: 1px var(--imed-surface) solid;
		}

		> .widget-table tr:hover > td {
			filter: brightness(0.96);
		}

		> .widget-table .-col-set-0 {
			background-color: var(--bgcolor-1);
		}
		> .widget-table .-col-set-1 {
			background-color: var(--bgcolor-2);
		}
		> .widget-table .-col-set-2 {
			background-color: var(--bgcolor-3);
		}
		> .widget-table .-col-set-3 {
			background-color: var(--bgcolor-4);
		}
		> .widget-table .-col-set-4 {
			background-color: var(--bgcolor-5);
		}
		> .widget-table .-col-set-5 {
			background-color: var(--bgcolor-6);
		}
		> .widget-table .-col-set-6 {
			background-color: var(--bgcolor-7);
		}
		> .widget-table .-col-set-7 {
			background-color: var(--bgcolor-8);
		}
		> .widget-table .-col-set-8 {
			background-color: var(--bgcolor-9);
		}
	}
}
/* @end */

/* @group nav colour strips */
.nav {
	&.-banner-menu > .ui-action > .ui-item:nth-child(1) > a {
		background-color: #e4f7e7;
	}
	&.-banner-menu > .ui-action > .ui-item:nth-child(2) > a {
		background-color: #f6e9f7;
	}
	&.-banner-menu > .ui-action > .ui-item:nth-child(3) > a {
		background-color: #e4f1f8;
	}
	&.-banner-menu > .ui-action > .ui-item:nth-child(4) > a {
		background-color: #faf0e2;
	}
	&.-banner-menu > .ui-action > .ui-item:nth-child(5) > a {
		background-color: #eaeffb;
	}
	&.-banner-menu > .ui-action > .ui-item:nth-child(6) > a {
		background-color: #f7e8f7;
	}
	&.-banner-menu > .ui-action > .ui-item:nth-child(7) > a {
		background-color: #e6eff1;
	}
	&.-banner-menu > .ui-action > .ui-item:nth-child(8) > a {
		background-color: #eaf3e4;
	}
	&.-banner-menu > .ui-action > .ui-item:nth-child(9) > a {
		background-color: #f1f2dd;
	}
	&.-banner-menu > .ui-action > .ui-item:nth-child(10) > a {
		background-color: #e6eff1;
	}
	&.-banner-menu > .ui-action > .ui-item:nth-child(11) > a {
		background-color: #eaf3e4;
	}
	&.-banner-menu > .ui-action > .ui-item:nth-child(12) > a {
		background-color: #f1f2dd;
	}
}
/* @end */

/* @group widget-dropbox */
.widget-dropbox {
	> * {
		> .-content {
			background-color: var(--imed-surface);
			opacity: 0.96;
			border-radius: var(--imed-radius-md);
			box-shadow: var(--imed-shadow-2);
			.icon {
				color: var(--link-color);
			}
		}
	}
}
/* @end */

.widget-card {
	background-color: var(--imed-surface);
	border: none;
}

.widget-listtile {
	background-color: var(--imed-surface);
	border: none;
	.-trailing {
		.icon {
			color: var(--link-color);
		}
		.widget-dropbox > a:hover {
			background-color: var(--link-hover-color);
		}
	}
	> .-leading > .profile-photo {
		width: 32px;
		height: 32px;
	}
}

.widget-nav {
	&.-vertical > ul > li > a {
		align-items: center;
	}
}

.widget-appbar {
	--bg-color: var(--imed-accent);
	--text-color: #eafbfc;
	--text-hover-color: #ffffff;
	--trailing-btn-bg-color: rgba(255, 255, 255, 0.18);
	--trailing-btn-bg-color-hover: rgba(255, 255, 255, 0.3);
	--nav-bg-color: var(--bg-color);
	--nav-text-color: var(--text-color);
	--nav-btn-bg-color: var(--trailing-btn-bg-color);
	--nav-btn-hover-color: var(--trailing-btn-bg-color-hover);

	.theme-dark & {
		--bg-color: #14464d;
		--text-color: #d5f2f5;
		--text-hover-color: #ffffff;
		--trailing-btn-bg-color: rgba(255, 255, 255, 0.13);
		--trailing-btn-bg-color-hover: rgba(255, 255, 255, 0.22);
		--nav-bg-color: var(--bg-color);
		--nav-text-color: var(--text-color);
		--nav-btn-bg-color: var(--trailing-btn-bg-color);
		--nav-btn-hover-color: var(--trailing-btn-bg-color-hover);
	}

	height: 4.8rem;
	flex-wrap: nowrap;
	margin-bottom: 8px;
	.widget-dropbox {
		> a {
			box-shadow: none;
			margin-top: 4px;
			padding: 6px;
		}
	}
	> .-title > .-text {
		font-size: 1.1em;
		line-height: 3.8rem;
		font-weight: 500;
	}
	> .-nav {
		flex: 0;
		order: 2;
		padding: 0;
		overflow: initial;
		a {
			padding: 0 6px;
			height: 48px;
			overflow: hidden;
			margin-top: 0;
		}
		a:only-child {
			width: 36px;
			height: 36px;
			padding: 6px;
			margin: 6px;
			border-radius: 50%;
		}
		a > span {
			margin-top: -4px;
			line-height: 1rem;
		}
	}
	> .-trailing {
		order: 3;
		padding-right: 8px;
	}
	.-has-dropbox > .-nav {
		flex: 0;
	}
	> .-dropbox {
		order: 3;
	}

	.widget-button.-with-number {
		padding: 6px;
		> .-label {
			position: absolute;
			top: 0;
			right: 0;
			color: #fff;
			font-size: 1rem;
			background-color: #db4437;
			border-radius: 50%;
			line-height: 1.5rem;
			width: 1.5rem;
			height: 1.5rem;
			text-align: center;
			display: block;
			padding: 0;
		}
	}
}

/* =====================================================================
 * 6. iMed MODULE
 * ===================================================================== */

/* @group patient / care giver vertical menu */
.imed-patient-menu {
	&.-banner-menu {
		padding: 0;
		.-number {
			position: absolute;
			top: 4px;
			right: 4px;
			background-color: var(--imed-accent);
			color: #fff;
			display: block;
			font-size: 0.8em;
			width: 3em;
			height: 3em;
			line-height: 3em;
			border-radius: 50%;
			pointer-events: none;
			text-align: center;
		}
		> ul {
			display: flex;
			justify-content: space-around;
		}
		> ul > li {
			flex: 1 0 100%;
			margin: 8px 0;
			text-align: center;
			padding: 0;
			position: relative;
		}
		> ul > li > .btn {
			width: 100%;
			height: auto;
			padding: 10px 0;
			background-color: var(--imed-accent-soft);
			box-shadow: none;
			color: var(--imed-accent-strong);
			border-radius: var(--imed-radius-lg);
			flex-wrap: wrap;
			transition: filter 0.18s ease;
			&:hover {
				filter: brightness(0.96);
			}
		}
		> ul > li > .btn > .icon {
			margin: 8px auto;
			display: block;
			color: inherit;
			flex: 1 0 100%;
		}
		> ul > li > .btn > span {
			flex: 1 0 100%;
			padding: 0;
		}
		> ul > li > .btn > span.lang-text.-en {
			display: none;
		}
		> ul > li:nth-child(1) > a {
			background-color: #e4f7e7;
		}
		> ul > li:nth-child(2) > a {
			background-color: #f6e9f7;
		}
		> ul > li:nth-child(3) > a {
			background-color: #e4f1f8;
		}
		> ul > li:nth-child(4) > a {
			background-color: #faf0e2;
		}
		> ul > li:nth-child(5) > a {
			background-color: #eaeffb;
		}
		> ul > li:nth-child(6) > a {
			background-color: #f7e8f7;
		}
		> ul > li:nth-child(7) > a {
			background-color: #e6eff1;
		}
		> ul > li:nth-child(8) > a {
			background-color: #eaf3e4;
		}
		> ul > li:nth-child(9) > a {
			background-color: #f1f2dd;
		}
		> ul > li:nth-child(10) > a {
			background-color: #e6eff1;
		}
		> ul > li:nth-child(11) > a {
			background-color: #eaf3e4;
		}
		> ul > li:nth-child(12) > a {
			background-color: #f1f2dd;
		}
	}
}
/* @end */

/* @group imed layout helpers */
.imed-full {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	.imed-box {
		flex: 1 0 100%;
	}
	.imed-app {
		flex: 1;
	}
}
/* @end */

/* @group patient card strip */
.imed-patient-card {
	justify-content: flex-start;
	flex-wrap: nowrap;
	overflow: scroll;
	> .ui-item {
		margin: 8px;
		border-radius: var(--imed-radius-lg);
		position: relative;
		padding: 4px;
		text-align: center;
	}
	span {
		display: block;
		position: absolute;
	}
	.-name {
		bottom: 4px;
		left: 0;
		right: 0;
		font-size: 0.7em;
		height: 1.5em;
		overflow: hidden;
		color: var(--imed-text);
	}
	.-number {
		top: 4px;
		right: 4px;
		width: 2em;
		height: 2em;
		line-height: 2em;
		text-align: center;
		border-radius: 50%;
		background-color: var(--imed-accent-soft);
		color: var(--imed-accent-strong);
		font-size: 0.6em;
	}
	.-photo {
		width: 64px;
		height: 64px;
		margin: 0px auto 8px;
		display: block;
		border-radius: 50%;
		border: 2px var(--imed-border) solid;
	}
}
/* @end */

/* @group notify banner */
.imed-notify {
	margin: 16px 0 8px;
	> .ui-item {
		border-radius: var(--imed-radius-md);
		display: flex;
		justify-content: space-between;
		background-color: #fff0c9;
		border-left: 3px solid #e9a400;
		color: #6b4a00;
		> .detail {
			padding: 16px 8px;
		}
		> .nav.-card {
			margin-right: 8px;
		}
		> .nav.-card a {
			border-radius: var(--imed-radius-pill);
			padding-left: 16px;
			padding-right: 16px;
		}
	}
}
/* @end */

/* @group my note / visit history (used by 26 files) */
.imed-my-note {
	margin: 0;
	> .ui-item > .nav.-card .btn > span {
		display: none;
	}
	&.-need > .ui-item > .header > * {
		flex: 0 0 100%;
	}
	&.-need > .ui-item > .header .poster-photo {
		width: 32px;
		height: 32px;
	}
}
/* @end */

/* @group patient photo header */
.imed-patient-photo-wrapper {
	margin: 0 0 16px;
	padding: 16px 0;
	position: relative;
	background-color: var(--imed-surface);
	border-radius: var(--imed-radius-md);
	> .-patient-photo {
		width: 196px;
		height: 196px;
		margin: 0px auto 32px;
		display: block;
		border-radius: 50%;
		overflow: hidden;
		border: 2px var(--imed-border) solid;
	}
}
/* @end */

/* @group need item */
.imed-need-item {
	.-status-change {
		background-color: #e8eeef;
		color: var(--imed-muted);
		.icon {
			color: #7a8c90;
		}
	}
	&.-urgency-1 .-status-change {
		background-color: #fff7c2;
		color: #6d5a00;
	}
	&.-urgency-5 .-status-change {
		background-color: #ffe9d6;
		color: #7a4300;
	}
	&.-urgency-9 .-status-change {
		background-color: #ffd3d3;
		color: #8a1e1e;
	}
	.-status-done .-status-change {
		background-color: var(--imed-accent);
		color: #fff;
		.icon {
			color: #fff;
		}
	}
	> .-need {
		padding: 8px 16px;
		display: flex;
		flex-direction: row;
		justify-items: center;
		gap: 8px;
	}
	> .-detail {
		padding: 8px 16px;
	}
}
/* @end */

/* @group workflow status pills (class names come from the database) */
.-status-อนุมัติ {
	background-color: #d9f2dc;
}
.-status-เรียบร้อย {
	background-color: #afe3b6;
}
.-status-รออนุมัติ {
	background-color: #f7f5c4;
}
.-status-ไม่อนุมัติ {
	background-color: #ececec;
}
.-status-ยกเลิก {
	background-color: #dddddd;
}
.-status-รอตรวจสอบ {
	background-color: #ffe7e7;
}
/* @end */

body {
	.page.-map {
		top: 0;
	}
	&.-congratulation {
		display: flex;
		justify-content: center;
		align-items: center;
		height: 100vh;
		margin: 0 auto;
		padding: 0;
	}
	&.-screen-risk-sk-form {
		.page.-header {
			display: none;
		}
		.page.-content {
			padding: 0px 0 64px;
		}
	}

	&.module-imed.-softganz-app.-app-theme-dark .widget-appbar > .-nav .ui-item {
		background-color: transparent;
	}
}

/* =====================================================================
 * 7. iMed CAR
 * ===================================================================== */
.module-imed.-car.-module-has-sidebar {
	.widget-sidebar {
		position: fixed;
		top: 2px;
		margin-left: -106px;
	}
	.page.-primary {
		margin-left: 108px;
	}
}

.imed-car-group-list.-vertical > ul > li > a {
	width: 100%;
	flex-direction: column;
	border-radius: 0;
}
.imed-car-group-list.-vertical > ul > li > a > span {
	padding-left: 16px;
}
.imed-car-book-form > .form-container.-type-div {
	margin: 8px 0 32px;
	border-radius: var(--imed-radius-md);
	background-color: var(--imed-surface);
}
.imed-car-book-list {
	padding-bottom: 15rem;
	max-height: calc(100vh - 64px - 48px - 32px);
	overflow: scroll;
}

.imed-car-group-list.-vertical {
	padding: 0 !important;
	gap: 16px;
	.widget-button {
		background-color: var(--imed-accent-soft);
		color: var(--imed-accent-strong);
		flex-wrap: nowrap;
		height: auto;
		border-radius: var(--imed-radius-lg);
		.icon {
			color: inherit;
			font-size: 3rem;
			height: 3rem;
			width: 3rem;
		}
	}
	.widget-button.-primary {
		background-color: var(--imed-accent);
		color: #fff;
		.icon {
			color: #fff;
		}
	}
	> ul {
		box-sizing: border-box;
		width: 70%;
		max-width: 480px;
		margin: 0 auto;
		gap: 16px;
	}
}
.imed-car-group-list.-vertical::before {
	content: "";
	display: block;
	height: 80px;
	width: 100%;
	background-image: url(banner-car-01.png);
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center 0;
	box-sizing: border-box;
}

@media (min-width: 30em) {
	/* 480/16 = 30 */
	.imed-car-group-list.-vertical::before {
		height: 160px;
	}
}

/* =====================================================================
 * 8. SOFTGANZ APP (Android webview)
 *    Kept behaviour-identical to the previous theme.
 * ===================================================================== */
.module.-softganz-app {
	margin: 0;
	padding: 0;
	h2 {
		/* font-family: var(--imed-font); */
		font-weight: 500;
		font-size: 1.1em;
	}

	.page {
		&.-header {
			display: none !important;
		}
		&.-footer {
			display: none !important;
		}
		&.-page {
			border: none;
			border-radius: 0;
			margin: 0 auto !important;
			padding: 0 !important;
		}
		&.-content {
			padding: 0;
			max-width: none;
		}
	}

	.package-footer {
		display: none;
	}

	.sg-toolbar.-main {
		margin: 0;
		display: block;
		position: fixed;
		width: 100%;
		height: 48px;
		z-index: 1001;
		border: none;
		top: 0;
		left: 0;
		right: 0;
		margin: 0 auto;
	}

	.toolbar {
		&.-main {
			margin: 0 auto;
			display: block;
			width: 100%;
			height: 47px;
			z-index: 1001;
			position: fixed;
			top: 0;
			left: 0;
			right: 0;
			border-radius: 0;
			border-bottom: 1px var(--imed-border) solid;
			h2 {
				font-size: 1.2em;
			}
		}
	}

	.imed-chat-box.-imed-app-home {
		top: 0;
	}
	.imed-chat-box.-imed-app-home.-fixed {
		top: 0;
	}

	.form-textarea:focus {
		box-shadow: none;
	}
	.nav.-page.-app-icon .ui-item > a {
		font-size: 1.1em;
	}

	.notify-main {
		width: 100%;
		padding: 8px !important;
		top: 0;
		left: 0;
		right: 0;
		max-width: none;
		margin: 0;
		border-radius: 0;
		background-color: #fff0c9;
	}

	.widget-appbar {
		z-index: 1001;
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		.-title {
			font-size: 1.2em;
			> .-text {
				font-weight: 500;
				font-size: 2rem;
			}
		}
	}

	.widget-signform {
		margin: 0 auto;
		height: 100vh;
		width: 100%;
	}
	.login {
		margin: 0 auto;
		max-width: unset;
		width: unset;
		border-radius: 0;
		position: absolute;
		left: 0;
		right: 0;
		bottom: 0;
		top: 0;
		h3 {
			display: none;
		}
	}

	&.-module-has-toolbar .page.-content {
		padding-top: 48px;
	}
}

/* =====================================================================
 * 9. DARK MODE REFINEMENTS
 * ===================================================================== */
.theme-dark {
	.page.-header {
		background-color: var(--imed-surface-translucent);
	}
	.widget-signform {
		background-color: var(--imed-surface);
		border-color: var(--imed-border);
	}
	.widget-signform > .-form {
		.form-text,
		.form-password,
		input[type="password"],
		.form-select {
			background-color: var(--imed-surface-alt);
			color: var(--imed-text);
			border-color: var(--imed-border);
			&:hover {
				background-color: var(--imed-surface);
				border-color: var(--imed-border-strong);
			}
			&:focus {
				background-color: var(--imed-surface);
				border-color: var(--imed-accent);
			}
		}
		.form-item > .form-group {
			background-color: transparent;
		}
		button[name="signin"] {
			background-image: linear-gradient(
				135deg,
				var(--imed-accent-bright) 0%,
				var(--imed-accent) 55%,
				var(--imed-accent-strong) 100%
			);
			color: #06262a;
			> span,
			> .icon {
				color: #06262a;
			}
			box-shadow: 0 12px 26px -14px rgba(0, 0, 0, 0.8);
		}
	}
	.widget-signform > .widget-column.-not-member {
		&::before {
			background-color: var(--imed-surface);
		}
		.btn.-link {
			background-color: transparent;
			border-color: var(--imed-border-strong);
			color: var(--imed-accent);
			&:hover {
				background-color: var(--imed-accent-soft);
				border-color: var(--imed-accent);
			}
		}
	}
	.widget-signform > header > h3 {
		color: var(--imed-ink);
	}
	.widget-signform > .-guideline {
		background-color: var(--imed-accent-soft);
		border-left-color: var(--imed-accent);
		color: var(--imed-text);
		> h5 {
			color: var(--imed-accent-strong);
		}
		> ul b,
		> ul strong {
			color: var(--imed-ink);
		}
	}
	.imed-notify > .ui-item {
		background-color: #3b3011;
		border-left-color: #d9a400;
		color: #f3dfa8;
	}
	.imed-patient-card .-number {
		background-color: var(--imed-accent-soft);
		color: var(--imed-accent);
	}
	.card-item {
		background-color: var(--imed-surface);
	}
}

/* =====================================================================
 * 10. ACCESSIBILITY
 * ===================================================================== */

/* keyboard focus is always visible */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
	outline: 3px solid rgba(14, 154, 167, 0.6);
	outline-offset: 2px;
}

/* nav targets stay comfortably tappable */
.page.-nav > .nav.-main > ul > li > a {
	min-height: 52px;
	min-width: 48px;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}
	.widget-signform > .-form button[name="signin"]:hover {
		transform: none;
	}
	.nav.-app-menu.-app-menu .ui-item:hover {
		transform: none;
	}
}

/* high contrast prefers a solid, non-translucent chrome */
@media (prefers-contrast: more) {
	.page.-header {
		background-color: var(--imed-surface);
		opacity: 1;
	}
	.widget-signform > .-form {
		.form-text,
		.form-password,
		input[type="password"],
		.form-select {
			border-color: var(--imed-ink);
		}
	}
}

/* =====================================================================
 * 11. RESPONSIVE
 * ===================================================================== */
@media (min-width: 21.25em) {
	/* 340/16 = 21.25 */
}

@media (min-width: 22.5em) {
	/* 360/16 = 22.5 */
}

@media (min-width: 30em) {
	/* 480/16 = 30 */
}

@media (min-width: 40em) {
	/* 640/16 = 40 */
	.nav.-main .menu.-main > li.-desktoponly {
		display: block;
	}

	.widget-card {
		border-radius: var(--imed-radius-md);
	}
	.widget-listtile {
		border-radius: var(--imed-radius-md);
	}
}

@media (min-width: 45em) {
	/* 720/16 */
}

@media (min-width: 48em) {
	/* 768/16 = 48 */
}

@media (min-width: 52.5em) {
	/* 840/16 = 52.5 */
	.page {
		&.-header {
			top: 0;
			bottom: auto;
			box-shadow: 0 1px 0 var(--imed-hairline);
			header {
				display: block;
			}
		}
		&.-content {
			margin: 0 auto;
			padding: calc(var(--header-height) + 12px) 0 0 0;
			top: 0px;
			bottom: auto;
		}
		&.-nav > .nav.-main {
			.menu.-main {
				justify-content: start;
				gap: 8px;
			}
			.menu.-main > li > a {
				padding: 4px 24px;
				font-weight: 400;
			}
		}
	}
	.imed-chat-box.-imed-app-home.-fixed {
		top: var(--header-height);
	}

	.module-imed.-car.-module-has-sidebar {
		.widget-sidebar {
			position: fixed;
			top: 64px;
		}
	}
}

@media (min-width: 61.25em) {
	/* 980/16 - Max Width */
	.widget-appbar {
		border-radius: var(--imed-radius-sm);
	}
	.imed-home-banner > img {
		border-radius: var(--imed-radius-md);
	}
}

/* @group mobile app range */
@media screen and (min-width: 24px) and (max-width: 820px) {
	.page.-header header {
		display: none;
	}
	.page.-header header::before {
		content: "";
		display: block;
		height: var(--header-height);
		width: 1px;
	}
	.nav.-main .menu.-main {
		font-size: 1.2rem;
	}
	.page.-content {
		padding: 0 0 var(--header-height) 0;
	}
	.page.-map {
		top: 0;
		bottom: var(--header-height);
		height: calc(100vh - var(--header-height)) !important;
		min-height: calc(100vh - var(--header-height)) !important;
	}
	.module-imed.-app.-module-has-toolbar:not(.-softganz-app) .page.-content {
		padding-top: 0;
	}
	.widget-floatingactionbutton {
		bottom: 5.2rem;
	}
}
/* @end */

/* iPadMini 768 x 1024 PX */
/* iPadAir 820 x 1180 PX */
@media screen and (min-width: 820px) and (max-width: 820px) {
	body {
		font-size: 1.6rem;
	}
}

/* =====================================================================
 * 12. PRINT
 * ===================================================================== */
@media print {
	.page.-header {
		box-shadow: none;
		position: static;
	}
	.page.-header nav {
		display: none;
	}
	.page.-header header {
		float: none;
	}
	.page.-footer {
		display: none;
	}
	.tabs {
		display: none;
	}
	form.search-box.sg-form {
		display: none;
		border: 1px #000 solid;
	}
	.widget-table {
		width: 100%;
	}
	.widget-table > thead > tr > th {
		border: none;
	}

	body.module-imed:has(.page.-main > .widget-container > .widget-signform) {
		.page.-page {
			background: #fff none;
			min-height: auto;
		}
		.page.-page::before,
		.page.-page::after {
			display: none;
		}
		.page.-main {
			display: block;
			padding: 0;
		}
		.page.-main::before {
			background: none;
			padding: 0;
			font-size: 2.2rem;
		}
		.page.-main::after {
			display: none;
		}
	}
}
