:root {
	--pd-accent: #0f6e56;
	--pd-accent-2: #11a37f;
	--pd-accent-light: #eef8f5;
	--pd-accent-soft: rgba(15, 110, 86, 0.10);
	--pd-border: #d8d8d5;
	--pd-border-soft: #ececea;
	--pd-text: #17201d;
	--pd-muted: #6b6f6d;
	--pd-danger: #a32d2d;
	--pd-danger-soft: rgba(163, 45, 45, 0.08);
	--pd-success: #0f6e56;
	--pd-success-soft: rgba(15, 110, 86, 0.10);
	--pd-warning: #8a5a00;
	--pd-bg: #ffffff;
	--pd-bg-soft: #fafaf9;
	--pd-overlay: rgba(15, 20, 18, 0.58);
	--pd-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
	--pd-radius-lg: 22px;
	--pd-radius-md: 16px;
	--pd-radius-sm: 10px;
}

/* ==========================================================================
   Floating trigger
   ========================================================================== */

#plandose-trigger {
	position: fixed;
	bottom: max(24px, env(safe-area-inset-bottom));
	right: max(24px, env(safe-area-inset-right));
	width: auto;
	min-width: 138px;
	height: 56px;
	box-sizing: border-box;
	border-radius: 999px;
	background: var(--pd-accent);
	color: #ffffff;
	border: none;
	box-shadow: 0 10px 30px rgba(15, 110, 86, 0.38);
	cursor: pointer;
	z-index: 9998;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	padding: 0 20px;
	margin: 0;
	line-height: 1;
	text-decoration: none;
	-webkit-appearance: none;
	appearance: none;
	-webkit-tap-highlight-color: transparent;
	transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
	font-weight: 800;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#plandose-trigger.plandose-pos-bottom_right {
	bottom: max(24px, env(safe-area-inset-bottom));
	right: max(24px, env(safe-area-inset-right));
	top: auto;
	left: auto;
}

#plandose-trigger.plandose-pos-bottom_left {
	bottom: max(24px, env(safe-area-inset-bottom));
	left: max(24px, env(safe-area-inset-left));
	top: auto;
	right: auto;
}

#plandose-trigger.plandose-pos-top_right {
	top: max(24px, env(safe-area-inset-top));
	right: max(24px, env(safe-area-inset-right));
	bottom: auto;
	left: auto;
}

#plandose-trigger.plandose-pos-top_left {
	top: max(24px, env(safe-area-inset-top));
	left: max(24px, env(safe-area-inset-left));
	right: auto;
	bottom: auto;
}

.plandose-trigger-text {
	display: inline-block;
	color: #ffffff;
	font-size: 16px;
	font-weight: 800;
	line-height: 1;
	letter-spacing: 0.01em;
	white-space: nowrap;
	text-transform: none;
	text-shadow: none;
}

#plandose-trigger:hover {
	transform: translateY(-2px);
	filter: brightness(1.03);
	box-shadow: 0 14px 36px rgba(15, 110, 86, 0.48);
}

#plandose-trigger:focus-visible {
	transform: translateY(-1px);
	filter: brightness(1.02);
	outline: none;
	box-shadow:
		0 14px 36px rgba(15, 110, 86, 0.48),
		0 0 0 4px rgba(15, 110, 86, 0.20);
}

#plandose-trigger:active {
	transform: translateY(0);
	filter: brightness(0.98);
}

/* Icon */
.plandose-icon,
.plandose-modal-icon,
.pd-print-brand-icon {
	display: block;
	flex: 0 0 auto;
	background: currentColor;
	mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm0 2a8 8 0 1 1 0 16 8 8 0 0 1 0-16zm-1 3v6.2l4.5 2.6 1-1.7-3.5-2V7h-2z"/></svg>') center / contain no-repeat;
	-webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm0 2a8 8 0 1 1 0 16 8 8 0 0 1 0-16zm-1 3v6.2l4.5 2.6 1-1.7-3.5-2V7h-2z"/></svg>') center / contain no-repeat;
}

.plandose-icon {
	width: 24px;
	height: 24px;
	color: #ffffff;
}

/* ==========================================================================
   Modal
   ========================================================================== */

body.plandose-no-scroll {
	overflow: hidden;
}

#plandose-overlay {
	position: fixed;
	inset: 0;
	background: var(--pd-overlay);
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 22px;
	box-sizing: border-box;
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
}

#plandose-overlay[hidden] {
	display: none;
}

#plandose-confirm-close {
	position: fixed;
	inset: 0;
	background: rgba(15, 20, 18, 0.65);
	z-index: 10001;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 22px;
	box-sizing: border-box;
}

.plandose-confirm-box {
	background: #ffffff;
	border-radius: var(--pd-radius-md);
	box-shadow: var(--pd-shadow);
	padding: 22px;
	width: min(420px, 100%);
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.plandose-confirm-box p {
	margin: 0 0 18px;
	font-size: 14px;
	line-height: 1.5;
	color: var(--pd-text);
	text-align: center;
}

.plandose-confirm-actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.plandose-confirm-actions .plandose-btn {
	width: 100%;
}

#plandose-modal {
	background: var(--pd-bg);
	color: var(--pd-text);
	border-radius: var(--pd-radius-lg);
	width: min(760px, 100%);
	max-height: 90vh;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 26px 26px 0;
	position: relative;
	box-shadow: var(--pd-shadow);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	box-sizing: border-box;
}

#plandose-close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 44px;
	height: 44px;
	background: #f4f4f2;
	border: none;
	border-radius: 50%;
	font-size: 21px;
	cursor: pointer;
	line-height: 1;
	color: var(--pd-text);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 3;
	transition: background 0.15s ease, transform 0.15s ease;
}

#plandose-close:hover,
#plandose-close:focus-visible {
	background: #e9e9e6;
	outline: none;
	transform: scale(1.03);
}

#plandose-close:focus-visible {
	box-shadow: 0 0 0 3px rgba(15, 110, 86, 0.18);
}

#plandose-modal-head {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	margin: 0 52px 18px 0;
}

.plandose-modal-icon-wrap {
	width: 44px;
	height: 44px;
	background-color: var(--pd-accent-light);
	border-radius: 15px;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.plandose-modal-icon {
	width: 24px;
	height: 24px;
	color: var(--pd-accent);
}

#plandose-modal-head h2 {
	margin: 0 0 5px;
	font-size: 22px;
	line-height: 1.18;
	font-weight: 900;
	color: var(--pd-text);
	letter-spacing: -0.02em;
}

#plandose-modal-head p {
	margin: 0;
	font-size: 14px;
	line-height: 1.4;
	color: var(--pd-muted);
}

/* ==========================================================================
   PlanDose v2 Wizard
   ========================================================================== */

.plandose-v2 {
	position: relative;
}

.plandose-steps {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 8px;
	margin: 0 0 18px;
	padding: 8px;
	border: 1px solid var(--pd-border-soft);
	border-radius: 18px;
	background: linear-gradient(180deg, #ffffff 0%, #fafaf9 100%);
}

.plandose-step-dot {
	position: relative;
	border: none;
	background: transparent;
	cursor: pointer;
	padding: 8px 6px;
	border-radius: 14px;
	font-family: inherit;
	color: var(--pd-muted);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 5px;
	min-width: 0;
	-webkit-tap-highlight-color: transparent;
	transition: background 0.15s ease, color 0.15s ease;
}

.plandose-step-dot span {
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: 1.5px solid var(--pd-border);
	background: #ffffff;
	font-size: 13px;
	font-weight: 900;
	color: var(--pd-muted);
	transition: all 0.15s ease;
}

.plandose-step-dot small {
	display: block;
	width: 100%;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.plandose-step-dot:hover {
	background: var(--pd-accent-light);
	color: var(--pd-accent);
}

.plandose-step-dot.active {
	background: var(--pd-accent-light);
	color: var(--pd-accent);
}

.plandose-step-dot.active span {
	background: var(--pd-accent);
	border-color: var(--pd-accent);
	color: #ffffff;
	box-shadow: 0 6px 16px rgba(15, 110, 86, 0.26);
}

.plandose-step-dot.done span {
	background: var(--pd-accent-soft);
	border-color: rgba(15, 110, 86, 0.30);
	color: var(--pd-accent);
}

.plandose-step-dot:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(15, 110, 86, 0.15);
}

.plandose-step-panel {
	animation: plandoseFadeIn 0.18s ease both;
}

.plandose-step-panel[hidden] {
	display: none !important;
}

@keyframes plandoseFadeIn {
	from {
		opacity: 0;
		transform: translateY(4px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ==========================================================================
   Form
   ========================================================================== */

.plandose-field-patient {
	margin-bottom: 16px;
}

.plandose-section {
	background:
		radial-gradient(circle at top right, rgba(17, 163, 127, 0.08), transparent 34%),
		var(--pd-bg-soft);
	border: 1px solid var(--pd-border);
	border-radius: var(--pd-radius-md);
	padding: 16px;
	margin-bottom: 16px;
}

.plandose-section-title {
	margin: 0 0 13px;
	font-size: 13px;
	font-weight: 900;
	letter-spacing: 0.01em;
	color: var(--pd-accent);
}

.plandose-field {
	margin-bottom: 13px;
}

.plandose-field:last-child {
	margin-bottom: 0;
}

.plandose-field label {
	display: block;
	font-size: 13px;
	font-weight: 750;
	color: #3d4542;
	margin-bottom: 6px;
}

.plandose-field small {
	display: block;
	margin-top: 7px;
	font-size: 12px;
	line-height: 1.35;
	color: var(--pd-muted);
}

.plandose-field input,
.plandose-field select,
.plandose-field textarea {
	width: 100%;
	padding: 12px 14px !important;
	box-sizing: border-box;
	border: 1.5px solid var(--pd-border) !important;
	border-radius: 10px !important;
	font-size: 16px;
	font-family: inherit;
	background: #ffffff;
	color: var(--pd-text);
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.plandose-field select {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%236b6f6d" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 15px;
	padding-right: 40px;
}

.plandose-field textarea {
	resize: vertical;
	min-height: 68px;
}

.plandose-field input:focus,
.plandose-field select:focus,
.plandose-field textarea:focus {
	outline: none;
	border-color: var(--pd-accent);
	box-shadow: 0 0 0 3px rgba(15, 110, 86, 0.14);
	background: #ffffff;
}

.plandose-field-row {
	display: grid;
	grid-template-columns: 1fr 1.45fr;
	gap: 12px;
	margin-bottom: 13px;
}

.plandose-field-row.plandose-dose-row {
	grid-template-columns: 1fr 1fr;
}

.plandose-field-row.plandose-hours-days-row {
	grid-template-columns: 1.6fr 1fr;
}

.plandose-field-row.plandose-hours-days-row.single-col {
	grid-template-columns: 1fr;
}

.plandose-field-row .plandose-field {
	margin-bottom: 0;
}

.plandose-chips {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.plandose-chip {
	flex: 1 1 130px;
	min-width: 0;
	padding: 10px 12px;
	font-size: 14px;
	font-weight: 700;
	text-align: center;
	border-radius: 10px;
	border: 1.5px solid var(--pd-border);
	background: #ffffff;
	color: var(--pd-text);
	cursor: pointer;
	min-height: 42px;
	line-height: 1.2;
	appearance: none;
	-webkit-appearance: none;
	-webkit-tap-highlight-color: transparent;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.plandose-chip-custom {
	flex-grow: 0;
	flex-basis: 200px;
}

.pd-custom-mode-chips .pd-custom-mode-chip {
	flex: 0 1 auto;
	min-height: 36px;
	padding: 7px 14px;
	font-size: 13px;
}

.pd-interval-presets {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 8px;
}

.pd-interval-preset {
	border: 1px solid var(--pd-border);
	background: #ffffff;
	color: var(--pd-muted);
	border-radius: 8px;
	font-size: 11.5px;
	font-weight: 700;
	padding: 6px 10px;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pd-interval-preset:hover,
.pd-interval-preset:active {
	background: var(--pd-accent-light);
	color: var(--pd-accent);
	border-color: var(--pd-accent);
}

.plandose-chip:hover,
.plandose-chip:active {
	border-color: var(--pd-accent);
	color: var(--pd-accent);
	background: var(--pd-accent-light);
	transform: translateY(-1px);
}

.plandose-chip:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(15, 110, 86, 0.15);
}

.plandose-chip.active,
.plandose-chip.active:hover,
.plandose-chip.active:active {
	background: var(--pd-accent);
	color: #ffffff;
	border-color: var(--pd-accent);
	box-shadow: 0 8px 18px rgba(15, 110, 86, 0.22);
}

.plandose-added-wrap,
.plandose-review {
	background: #ffffff;
	border: 1px solid var(--pd-border-soft);
	border-radius: var(--pd-radius-md);
	padding: 15px;
	margin-bottom: 16px;
}

.plandose-review p,
.plandose-preview-head p {
	margin: -4px 0 14px;
	font-size: 13px;
	line-height: 1.45;
	color: var(--pd-muted);
}

/* ==========================================================================
   Medication cards
   ========================================================================== */

.plandose-empty {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 13px;
	line-height: 1.4;
	color: var(--pd-muted);
	text-align: center;
	padding: 18px 12px;
	margin: 0;
	border: 1px dashed var(--pd-border);
	border-radius: 14px;
	background: #fafaf9;
}

.plandose-empty strong {
	color: var(--pd-text);
	font-size: 14px;
}

.plandose-med-card,
.plandose-list-item {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	background: #ffffff;
	border: 1px solid var(--pd-border-soft);
	border-radius: 15px;
	padding: 13px;
	font-size: 14px;
	margin-bottom: 10px;
	gap: 12px;
	box-shadow: 0 8px 20px rgba(20, 30, 26, 0.04);
}

.plandose-med-card:last-child,
.plandose-list-item:last-child {
	margin-bottom: 0;
}

.plandose-med-card-main {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.plandose-med-card-main strong {
	color: var(--pd-text);
	font-size: 15px;
	font-weight: 900;
	line-height: 1.2;
	overflow-wrap: anywhere;
}

.plandose-med-card-main span,
.plandose-list-item span {
	color: #38413e;
	font-size: 13px;
	line-height: 1.35;
	overflow-wrap: anywhere;
}

.plandose-med-card-main small {
	color: var(--pd-muted);
	font-size: 12px;
	line-height: 1.35;
	font-style: italic;
	overflow-wrap: anywhere;
}

.plandose-med-card-actions {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
}

.plandose-mini-btn {
	border: 1px solid var(--pd-border);
	background: #ffffff;
	color: var(--pd-text);
	cursor: pointer;
	font-size: 12px;
	font-weight: 800;
	border-radius: 999px;
	min-height: 32px;
	padding: 6px 10px;
	font-family: inherit;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.plandose-mini-btn:hover,
.plandose-mini-btn:focus-visible {
	background: var(--pd-accent-light);
	color: var(--pd-accent);
	border-color: rgba(15, 110, 86, 0.30);
	outline: none;
}

.plandose-mini-btn-danger {
	width: 32px;
	height: 32px;
	padding: 0;
	font-size: 18px;
	color: var(--pd-danger);
}

.plandose-mini-btn-danger:hover,
.plandose-mini-btn-danger:focus-visible {
	background: var(--pd-danger-soft);
	color: var(--pd-danger);
	border-color: rgba(163, 45, 45, 0.25);
}

.plandose-list-item button {
	border: none;
	background: none;
	cursor: pointer;
	font-size: 18px;
	color: var(--pd-danger);
	width: 32px;
	height: 32px;
	flex-shrink: 0;
	border-radius: 50%;
}

.plandose-list-item button:hover,
.plandose-list-item button:focus-visible {
	background: var(--pd-danger-soft);
	outline: none;
}

/* ==========================================================================
   Buttons / Actionbar
   ========================================================================== */

.plandose-btn {
	border: none;
	border-radius: 10px;
	font-size: 15px;
	font-weight: 850;
	padding: 12px 18px;
	cursor: pointer;
	min-height: 46px;
	width: 100%;
	text-decoration: none;
	font-family: inherit;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	-webkit-tap-highlight-color: transparent;
	transition: transform 0.15s ease, filter 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.plandose-btn:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(15, 110, 86, 0.18);
}

.plandose-btn:disabled,
.plandose-btn.is-loading {
	opacity: 0.62;
	cursor: not-allowed;
	transform: none;
	filter: none;
}

.plandose-btn-secondary {
	background: #ffffff;
	color: var(--pd-accent);
	border: 1.5px solid var(--pd-accent);
}

.plandose-btn-secondary:hover:not(:disabled),
.plandose-btn-secondary:active:not(:disabled) {
	background: var(--pd-accent-light);
	color: var(--pd-accent);
	transform: translateY(-1px);
}

.plandose-btn-primary {
	background: linear-gradient(135deg, var(--pd-accent) 0%, var(--pd-accent-2) 100%);
	color: #ffffff;
	box-shadow: 0 10px 22px rgba(15, 110, 86, 0.24);
}

.plandose-btn-primary:hover:not(:disabled),
.plandose-btn-primary:active:not(:disabled) {
	filter: brightness(1.02);
	color: #ffffff;
	transform: translateY(-1px);
	box-shadow: 0 14px 28px rgba(15, 110, 86, 0.30);
}

.plandose-btn-light {
	background: #f4f4f2;
	color: var(--pd-text);
	border: 1px solid var(--pd-border);
	box-shadow: none;
}

.plandose-btn-light:hover:not(:disabled),
.plandose-btn-light:active:not(:disabled) {
	background: #ececea;
	color: var(--pd-text);
	transform: translateY(-1px);
}

.plandose-actionbar {
	position: sticky;
	bottom: 0;
	margin: 18px -26px 0;
	padding: 16px 26px calc(16px + env(safe-area-inset-bottom));
	background: #ffffff;
	box-shadow: 0 -10px 20px rgba(20, 30, 26, 0.06);
	border-top: 1px solid rgba(216, 216, 213, 0.65);
	z-index: 2;
}

.plandose-actionbar-buttons {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
	align-items: center;
}

.plandose-actionbar-buttons .plandose-btn {
	width: 100%;
}

.plandose-print-counter {
	margin: 0 0 10px;
	font-size: 12.5px;
	color: var(--pd-muted);
	text-align: center;
}

.plandose-print-hint {
	margin: 0 0 10px;
	font-size: 11px;
	color: var(--pd-muted);
	text-align: center;
	line-height: 1.35;
}

#pd-message,
.pd-message {
	font-size: 13px;
	line-height: 1.35;
	min-height: 18px;
	margin: 12px 0;
	text-align: center;
	color: var(--pd-danger);
}

.pd-message-error {
	color: var(--pd-danger);
}

.pd-message-success {
	color: var(--pd-success);
}

/* ==========================================================================
   Preview
   ========================================================================== */

.plandose-preview-area {
	border: 1px solid var(--pd-border);
	border-radius: 18px;
	background: #f4f4f2;
	padding: 14px;
	max-height: 430px;
	overflow: auto;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.plandose-preview-area .pd-print-document {
	background: #ffffff;
	border-radius: 14px;
	padding: 18px;
	box-shadow: 0 12px 28px rgba(20, 30, 26, 0.10);
	transform-origin: top center;
}

.plandose-preview-area .pd-week-table {
	font-size: 12px;
}

/* ==========================================================================
   Guest modal
   ========================================================================== */

.plandose-title-green {
	color: var(--pd-accent);
	font-weight: 900;
}

.plandose-guest-app {
	margin-top: 4px;
}

.plandose-guest {
	position: relative;
	padding: 4px 0 8px;
}

.plandose-guest-freebox {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 15px 16px;
	margin: 0 0 16px;
	border: 1px solid rgba(15, 110, 86, 0.18);
	border-radius: 16px;
	background:
		radial-gradient(circle at top right, rgba(16, 185, 129, 0.16), transparent 38%),
		linear-gradient(135deg, #f0faf6 0%, #ffffff 72%);
	box-shadow: 0 10px 28px rgba(15, 110, 86, 0.08);
}

.plandose-guest-freebox strong {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	color: var(--pd-accent);
	font-size: 14px;
	font-weight: 900;
	line-height: 1.25;
}

.plandose-guest-freebox strong::before {
	content: "🖨️";
	display: inline-grid;
	place-items: center;
	width: 28px;
	height: 28px;
	border-radius: 10px;
	background: rgba(15, 110, 86, 0.10);
	font-size: 15px;
}

.plandose-guest-freebox span {
	display: block;
	color: #3f4b47;
	font-size: 14px;
	line-height: 1.45;
	padding-left: 36px;
}

.plandose-guest-message {
	margin: 0 0 16px;
	font-size: 15px;
	line-height: 1.5;
	color: var(--pd-text);
}

.plandose-guest-points {
	margin: 0 0 20px;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 10px;
}

.plandose-guest-points li {
	position: relative;
	margin: 0;
	padding: 12px 12px 12px 42px;
	border: 1px solid rgba(15, 110, 86, 0.10);
	border-radius: 14px;
	background: #fafaf9;
	font-size: 14.5px;
	line-height: 1.45;
	color: var(--pd-text);
}

.plandose-guest-points li::before {
	content: "✓";
	position: absolute;
	left: 12px;
	top: 12px;
	display: grid;
	place-items: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: rgba(15, 110, 86, 0.11);
	color: var(--pd-accent);
	font-size: 13px;
	font-weight: 900;
}

.plandose-guest-cta {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	text-align: center;
	text-decoration: none;
	border-radius: 14px;
	min-height: 54px;
	font-size: 16px;
	font-weight: 900;
	background: linear-gradient(135deg, #0f6e56 0%, #11a37f 100%);
	box-shadow: 0 14px 28px rgba(15, 110, 86, 0.28);
	transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.plandose-guest-cta::after {
	content: "→";
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.18);
	font-size: 17px;
	line-height: 1;
}

.plandose-guest-cta:hover,
.plandose-guest-cta:focus-visible {
	transform: translateY(-1px);
	filter: brightness(1.02);
	box-shadow: 0 18px 34px rgba(15, 110, 86, 0.34);
}

/* ==========================================================================
   Print document shared styles
   ========================================================================== */

.plandose-preview-area {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: #1a1a1a;
}

.pd-print-document {
	background: #ffffff;
	color: #1a1a1a;
}

.pd-print-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-bottom: 3px solid var(--pd-accent);
	padding-bottom: 12px;
	margin-bottom: 16px;
}

.pd-print-brand {
	display: flex;
	align-items: center;
	gap: 11px;
}

.pd-print-brand-icon {
	width: 30px;
	height: 30px;
	color: var(--pd-accent);
}

.pd-print-brand strong {
	display: block;
	font-size: 20px;
	line-height: 1.1;
	color: var(--pd-accent);
	font-weight: 900;
}

.pd-print-brand span {
	display: block;
	margin-top: 3px;
	font-size: 11px;
	line-height: 1.2;
	color: #777777;
}

.pd-print-intro {
	margin: 0 0 14px;
	padding: 10px 14px;
	border-radius: 10px;
	background: var(--pd-accent-light);
	border: 1px solid rgba(15, 110, 86, 0.16);
	color: #205146;
	font-size: 12.5px;
	font-weight: 700;
	line-height: 1.4;
}

.pd-print-intro strong {
	color: var(--pd-accent);
	font-weight: 900;
}

.pd-info-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-bottom: 18px;
}

.pd-info-box {
	border: 1px solid #d8d8d5;
	border-radius: 10px;
	padding: 11px 13px;
	break-inside: avoid;
	page-break-inside: avoid;
	background: #ffffff;
}

.pd-info-box h3 {
	margin: 0 0 7px;
	font-size: 11px;
	letter-spacing: 0.01em;
	color: var(--pd-accent);
	font-weight: 800;
}

.pd-info-box p {
	margin: 0 0 3px;
	font-size: 12px;
	line-height: 1.3;
}

.pd-info-box .pd-info-name {
	font-size: 14px;
	font-weight: 800;
}

.pd-drugs {
	display: block;
}

.pd-drug-block {
	margin-bottom: 18px;
}

.plandose-drug-title {
	font-size: 13px;
	font-weight: 900;
	margin-bottom: 5px;
	color: var(--pd-accent);
	break-after: avoid;
	page-break-after: avoid;
}

.pd-drug-notes {
	display: inline-block;
	font-size: 11px;
	font-weight: 800;
	color: #6b5300;
	background: #fff6d2;
	border: 1px solid #f0dc86;
	border-radius: 10px;
	padding: 6px 10px;
	margin: 2px 0 8px;
	break-after: avoid;
	page-break-after: avoid;
}

.pd-week-wrap {
	border: 2px solid var(--pd-border);
	border-radius: 10px;
	overflow: hidden;
	margin-bottom: 10px;
	break-inside: avoid;
	page-break-inside: avoid;
}

.pd-week-table {
	border-collapse: collapse;
	width: 100%;
	margin-bottom: 0;
	table-layout: fixed;
	break-inside: avoid;
	page-break-inside: avoid;
	background: #ffffff;
}

.pd-week-table caption {
	text-align: left;
	font-size: 14px;
	font-weight: 900;
	padding: 7px 10px;
	caption-side: top;
	letter-spacing: 0.01em;
}

.pd-week-wrap.pd-week-c1 { border-color: #d6336c; }
.pd-week-wrap.pd-week-c1 caption { color: #c2255c; background: #fde3ec; }
.pd-week-wrap.pd-week-c1 th { background: #fde3ec; color: #7a1a3f; }

.pd-week-wrap.pd-week-c2 { border-color: #1971c2; }
.pd-week-wrap.pd-week-c2 caption { color: #1864ab; background: #e7f3ff; }
.pd-week-wrap.pd-week-c2 th { background: #e7f3ff; color: #0b3d66; }

.pd-week-wrap.pd-week-c3 { border-color: #e8590c; }
.pd-week-wrap.pd-week-c3 caption { color: #d9480f; background: #fff1e0; }
.pd-week-wrap.pd-week-c3 th { background: #fff1e0; color: #7a2e05; }

.pd-week-wrap.pd-week-c4 { border-color: #2f9e44; }
.pd-week-wrap.pd-week-c4 caption { color: #2b8a3e; background: #e6f7e9; }
.pd-week-wrap.pd-week-c4 th { background: #e6f7e9; color: #195023; }

.pd-week-wrap.pd-week-c5 { border-color: #7048e8; }
.pd-week-wrap.pd-week-c5 caption { color: #6741d9; background: #efeafd; }
.pd-week-wrap.pd-week-c5 th { background: #efeafd; color: #3d2680; }

.pd-week-wrap.pd-week-c6 { border-color: #0c8599; }
.pd-week-wrap.pd-week-c6 caption { color: #0b7285; background: #e0f7f9; }
.pd-week-wrap.pd-week-c6 th { background: #e0f7f9; color: #054752; }

.pd-week-table th,
.pd-week-table td {
	border: 1px solid #d2d2ce;
	padding: 5px;
	font-size: 10.5px;
	line-height: 1.2;
	text-align: center;
	vertical-align: middle;
}

.pd-week-table th {
	font-weight: 900;
}

.pd-week-table th:first-child,
.pd-week-table td:first-child {
	width: 15%;
	text-align: left;
	font-weight: 800;
}

.pd-time-cell {
	color: #2b3431;
}

.pd-no-dose {
	color: #c2c5c2;
	background: #fafaf9;
	font-weight: 700;
}

.plandose-box {
	display: inline-block;
	width: 12px;
	height: 12px;
	border: 1.4px solid #555555;
	border-radius: 3px;
	background: #ffffff;
}

.plandose-disclaimer {
	font-size: 9.5px;
	line-height: 1.35;
	color: #555555;
	border-top: 1px solid #d2d2ce;
	margin-top: 14px;
	padding-top: 7px;
}

.pd-print-thanks {
	margin: 12px 0 0;
	font-size: 15px;
	font-weight: 800;
	line-height: 1.4;
	color: var(--pd-accent);
	text-align: center;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 620px) {
	#plandose-overlay {
		padding: 0;
	}

	.plandose-trigger-text {
		display: inline-block;
		font-size: 14px;
	}

	#plandose-trigger {
		width: auto;
		min-width: 118px;
		height: 50px;
		padding: 0 15px;
		gap: 8px;
	}

	.plandose-icon {
		width: 22px;
		height: 22px;
	}

	#plandose-modal {
		width: 100%;
		height: 100%;
		max-height: 100%;
		border-radius: 0;
		padding: 22px 16px 0;
		padding-top: max(22px, env(safe-area-inset-top));
	}

	#plandose-modal-head {
		margin-right: 46px;
	}

	#plandose-modal-head h2 {
		font-size: 19px;
	}

	#plandose-modal-head p {
		font-size: 13px;
	}

	.plandose-steps {
		gap: 4px;
		padding: 6px;
	}

	.plandose-step-dot {
		padding: 7px 3px;
	}

	.plandose-step-dot span {
		width: 26px;
		height: 26px;
		font-size: 12px;
	}

	.plandose-step-dot small {
		font-size: 10px;
	}

	.plandose-field-row {
		grid-template-columns: 1fr 1fr;
	}

	.plandose-med-card,
	.plandose-list-item {
		flex-direction: column;
	}

	.plandose-med-card-actions {
		width: 100%;
		justify-content: flex-end;
	}

	.plandose-actionbar {
		margin: 18px -16px 0;
		padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
	}

	.plandose-actionbar-buttons {
		gap: 6px;
	}

	.plandose-actionbar-buttons .plandose-btn {
		padding: 10px 6px;
		font-size: 12.5px;
		min-height: 42px;
	}

	.plandose-preview-area {
		max-height: 55vh;
		padding: 10px;
	}

	.plandose-preview-area .pd-print-document {
		padding: 14px;
	}

	.pd-info-grid {
		grid-template-columns: 1fr;
	}

	.plandose-guest-freebox {
		align-items: flex-start;
	}

	.plandose-guest-cta {
		min-height: 54px;
	}
}

@media (max-width: 420px) {
	.plandose-field-row {
		grid-template-columns: 1fr;
	}

	.plandose-chips {
		gap: 6px;
	}

	.plandose-chip {
		padding: 9px 12px;
		font-size: 13px;
	}

	.plandose-step-dot small {
		display: none;
	}

	.plandose-step-dot span {
		width: 30px;
		height: 30px;
	}

	.plandose-guest-freebox {
		padding: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	#plandose-trigger,
	#plandose-lang-toggle,
	#plandose-lang-toggle.is-locked::after,
	.plandose-chip,
	.plandose-btn,
	.plandose-guest-cta,
	.plandose-step-dot,
	.plandose-step-panel {
		transition: none;
		animation: none;
	}

	#plandose-trigger:hover,
	#plandose-trigger:focus-visible,
	.plandose-chip:hover,
	.plandose-btn:hover,
	.plandose-guest-cta:hover,
	.plandose-guest-cta:focus-visible {
		transform: none;
	}
}
/* ==========================================================================
   PlanDose — Language toggle (EL/EN, Pro-only)
   Sits top-right inside the modal, just left of the close (×) button.
   ========================================================================== */
#plandose-lang-toggle {
	position: absolute;
	top: 18px;
	right: 64px;
	height: 36px;
	min-width: 44px;
	padding: 0 12px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	box-sizing: border-box;
	background: #fff;
	color: var(--pd-accent);
	border: 1px solid var(--pd-accent-soft);
	border-radius: 999px;
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.02em;
	line-height: 1;
	cursor: pointer;
	z-index: 3;
	transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

#plandose-lang-toggle:hover,
#plandose-lang-toggle:focus-visible {
	background: var(--pd-accent-light);
	border-color: var(--pd-accent);
}

#plandose-lang-toggle:focus-visible {
	outline: 2px solid var(--pd-accent);
	outline-offset: 2px;
}

#plandose-lang-toggle:active {
	transform: translateY(1px);
}

/* Reserve header space so the title never runs under the toggle + ×.
   Two IDs → wins over the base #plandose-modal-head rule regardless of
   source order. */
#plandose-modal #plandose-modal-head {
	margin-right: 128px;
}

/* Locked (non-Pro) state: still clickable, but only reveals a teaser. */
#plandose-lang-toggle.is-locked {
	color: var(--pd-muted);
	border-style: dashed;
}

#plandose-lang-toggle.is-locked:hover,
#plandose-lang-toggle.is-locked:focus-visible {
	background: var(--pd-accent-light);
	border-color: var(--pd-muted);
}

/* Small padlock glyph drawn in CSS (no image dependency). */
.plandose-lang-lock {
	position: relative;
	width: 9px;
	height: 8px;
	margin-left: 1px;
	border: 1.5px solid currentColor;
	border-radius: 2px;
	box-sizing: border-box;
}

.plandose-lang-lock::before {
	content: "";
	position: absolute;
	left: 50%;
	top: -5px;
	width: 5px;
	height: 5px;
	transform: translateX(-50%);
	border: 1.5px solid currentColor;
	border-bottom: none;
	border-radius: 4px 4px 0 0;
	box-sizing: border-box;
}

/* "Available in Pro" hint bubble, revealed briefly on click (show-hint). */
#plandose-lang-toggle.is-locked::after {
	content: attr(data-hint);
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	white-space: nowrap;
	background: var(--pd-text);
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0;
	padding: 6px 10px;
	border-radius: 8px;
	opacity: 0;
	transform: translateY(-4px);
	pointer-events: none;
	transition: opacity 0.15s ease, transform 0.15s ease;
	z-index: 5;
}

#plandose-lang-toggle.is-locked.show-hint::after {
	opacity: 1;
	transform: translateY(0);
}

@media (max-width: 620px) {
	#plandose-lang-toggle {
		top: 14px;
		right: 56px;
		height: 34px;
		min-width: 40px;
		padding: 0 10px;
	}

	#plandose-modal #plandose-modal-head {
		margin-right: 120px;
	}
}