/*
 * Praxis23 Online Rezeption frontend shell.
 * Loaded globally for the custom-element host and inside its Shadow DOM.
 */

praxis-reception:not(:defined) {
	display: none !important;
}

html.praxis-reception-open {
	overflow: hidden;
}

:host {
	--pr-primary: #434874;
	--pr-primary-hover: #353a62;
	--pr-primary-soft: rgb(111 164 191 / 13%);
	--pr-accent: #6fa4bf;
	--pr-highlight: #edf6fa;
	--pr-highlight-hover: #e3f1f7;
	--pr-background: #ffffff;
	--pr-surface: #f5f6f7;
	--pr-text: #252742;
	--pr-muted: #5f6475;
	--pr-border: rgb(67 72 116 / 18%);
	--pr-focus: #434874;
	--pr-radius-small: 8px;
	--pr-radius-medium: 16px;
	--pr-radius: 28px;
	--pr-shadow: 0 20px 56px rgb(37 39 66 / 16%), 0 4px 16px rgb(37 39 66 / 10%);
	--pr-panel-width: 440px;
	--pr-launcher-right: max(20px, env(safe-area-inset-right));
	--pr-launcher-bottom: max(20px, env(safe-area-inset-bottom));
	position: fixed;
	z-index: 2147483000;
	top: calc(100dvh - var(--pr-launcher-bottom) - 56px);
	right: var(--pr-launcher-right);
	bottom: auto;
	left: auto;
	box-sizing: border-box;
	font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 16px;
	line-height: 1.5;
	color: var(--pr-text);
	pointer-events: none;
	text-rendering: optimizeLegibility;
	transition:
		top 420ms cubic-bezier(.2, .8, .2, 1),
		right 420ms cubic-bezier(.2, .8, .2, 1);
}

:host *,
:host *::before,
:host *::after {
	box-sizing: border-box;
}

[hidden] {
	display: none !important;
}

button {
	font: inherit;
}

button:disabled {
	cursor: not-allowed;
	opacity: 0.58;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
	outline: 3px solid var(--pr-focus);
	outline-offset: 3px;
}

:host ::selection {
	background: var(--pr-primary);
	color: #fff;
}

svg {
	display: block;
	width: 1.35em;
	height: 1.35em;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.8;
}

.reception-mark {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.launcher {
	--pr-launcher-drag-x: 0px;
	position: relative;
	left: var(--pr-launcher-drag-x);
	display: inline-flex;
	align-items: center;
	justify-content: flex-start;
	gap: 10px;
	width: min(284px, calc(100vw - 28px));
	height: 56px;
	min-height: 56px;
	padding: 12px 20px 12px 14px;
	border: 1px solid rgb(111 164 191 / 62%);
	border-radius: 999px;
	background: linear-gradient(135deg, rgb(255 255 255 / 78%) 0%, rgb(248 251 252 / 74%) 52%, rgb(237 246 250 / 71%) 100%);
	-webkit-backdrop-filter: blur(16px) saturate(150%);
	backdrop-filter: blur(16px) saturate(150%);
	box-shadow:
		0 18px 46px rgb(37 39 66 / 19%),
		0 4px 14px rgb(67 72 116 / 13%),
		inset 0 1px 0 rgb(255 255 255 / 90%);
	color: var(--pr-primary);
	font-weight: 700;
	cursor: pointer;
	pointer-events: auto;
	touch-action: pan-y;
	-webkit-touch-callout: none;
	user-select: none;
	overflow: hidden;
	transform-origin: bottom right;
	transition:
		left 260ms cubic-bezier(.2, .8, .2, 1),
		transform 420ms cubic-bezier(.2, .8, .2, 1),
		width 360ms cubic-bezier(.2, .8, .2, 1),
		height 360ms cubic-bezier(.2, .8, .2, 1),
		padding 360ms cubic-bezier(.2, .8, .2, 1),
		border-radius 360ms cubic-bezier(.2, .8, .2, 1),
		border-color 180ms ease,
		background-color 180ms ease,
		box-shadow 360ms ease;
}

.launcher::before {
	position: absolute;
	z-index: 0;
	top: -65%;
	bottom: -65%;
	left: -42%;
	width: 34%;
	background: linear-gradient(90deg, transparent, rgb(255 255 255 / 72%), transparent);
	content: '';
	opacity: 0;
	pointer-events: none;
	transform: skewX(-18deg);
}

.launcher::after {
	position: absolute;
	inset: 2px;
	border: 1px solid rgb(255 255 255 / 82%);
	border-radius: inherit;
	content: '';
	pointer-events: none;
}

.launcher__icon,
.launcher__text {
	position: relative;
	z-index: 1;
}

.launcher--attention {
	animation: pr-launcher-attention 1150ms cubic-bezier(.2, .8, .2, 1);
}

.launcher--attention::before {
	animation: pr-launcher-sheen 920ms ease-out 80ms;
}

.launcher:hover {
	border-color: rgb(111 164 191 / 86%);
	background: linear-gradient(135deg, rgb(255 255 255 / 82%) 0%, rgb(243 249 251 / 78%) 48%, rgb(227 241 247 / 76%) 100%);
	box-shadow:
		0 21px 50px rgb(37 39 66 / 23%),
		0 6px 17px rgb(67 72 116 / 15%),
		inset 0 1px 0 #fff;
	transform: translateY(-2px);
}

.launcher:active {
	transform: translateY(0) scale(.985);
}

.launcher__icon,
.brand__mark {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: #fff;
	overflow: hidden;
}

.launcher__icon {
	flex: 0 0 auto;
	border: 1px solid rgb(111 164 191 / 24%);
	box-shadow:
		0 4px 11px rgb(67 72 116 / 12%),
		inset 0 1px 0 #fff;
	transition:
		width 240ms cubic-bezier(.2, .8, .2, 1),
		height 240ms cubic-bezier(.2, .8, .2, 1),
		opacity 160ms ease;
}

.launcher__text {
	display: grid;
	gap: 1px;
	text-align: left;
	letter-spacing: 0.005em;
}

.launcher__label,
.launcher__compact-label {
	grid-area: 1 / 1;
	transition: opacity 180ms ease;
}

.launcher__compact-label {
	visibility: hidden;
	opacity: 0;
	font-size: 14px;
	font-weight: 750;
	letter-spacing: 0.01em;
	white-space: nowrap;
}

.launcher__status {
	color: var(--pr-muted);
	font-size: 0.72rem;
	font-weight: 600;
	opacity: 1;
}

:host([compact]:not([open])) {
	top: calc(100dvh - var(--pr-launcher-bottom) - 172px);
	right: 0;
}

:host([compact]:not([open])) .launcher {
	gap: 0;
	width: 132px;
	height: 40px;
	min-height: 40px;
	justify-content: center;
	padding: 0;
	border: 1px solid rgb(111 164 191 / 76%);
	border-bottom: 0;
	border-radius: 10px 10px 0 0;
	background: linear-gradient(135deg, rgb(250 253 254 / 86%) 0%, rgb(226 240 247 / 80%) 100%);
	box-shadow:
		0 14px 34px rgb(37 39 66 / 22%),
		0 3px 11px rgb(67 72 116 / 15%),
		inset 0 1px 0 rgb(255 255 255 / 88%);
	color: var(--pr-primary);
	transform: rotate(-90deg);
}

:host([compact]:not([open])) .launcher:hover {
	border-color: rgb(111 164 191 / 92%);
	background: linear-gradient(135deg, rgb(255 255 255 / 90%) 0%, rgb(216 235 244 / 84%) 100%);
	transform: rotate(-90deg) translateY(2px);
}

:host([compact]:not([open])) .launcher:active {
	transform: rotate(-90deg) translateY(0) scale(.985);
}

:host([launcher-dragging]) {
	transition: none;
}

:host([launcher-dragging]) .launcher {
	cursor: grabbing;
}

:host([compact]:not([open])) .launcher__icon {
	visibility: hidden;
	width: 0;
	height: 0;
	opacity: 0;
}

:host([compact]:not([open])) .launcher__label,
:host([compact]:not([open])) .launcher__status {
	display: none;
	visibility: hidden;
	opacity: 0;
}

:host([compact]:not([open])) .launcher__text {
	display: grid;
	width: 100%;
	height: 100%;
	place-items: center;
	text-align: center;
}

:host([compact]:not([open])) .launcher__compact-label {
	visibility: visible;
	opacity: 1;
	line-height: 1;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.launcher {
		background: linear-gradient(135deg, #fff 0%, #f8fbfc 52%, #edf6fa 100%);
	}

	.launcher:hover {
		background: linear-gradient(135deg, #fff 0%, #f3f9fb 48%, #e3f1f7 100%);
	}

	:host([compact]:not([open])) .launcher {
		background: linear-gradient(135deg, #fafdfe 0%, #e2f0f7 100%);
	}

	:host([compact]:not([open])) .launcher:hover {
		background: linear-gradient(135deg, #fff 0%, #d8ebf4 100%);
	}
}

.backdrop {
	position: fixed;
	z-index: -1;
	inset: 0;
	background: rgb(37 39 66 / 30%);
	backdrop-filter: blur(2px);
	pointer-events: auto;
	animation: pr-fade-in 160ms ease-out;
}

.dialog {
	position: relative;
	display: grid;
	grid-template-rows: auto minmax(0, 1fr) auto;
	width: min(var(--pr-panel-width), calc(100vw - 40px));
	max-height: min(680px, calc(100dvh - 40px));
	overflow: hidden;
	border: 1px solid rgb(255 255 255 / 72%);
	border-radius: var(--pr-radius);
	background: var(--pr-background);
	box-shadow: var(--pr-shadow);
	pointer-events: auto;
	animation: pr-dialog-in 180ms cubic-bezier(.2, .8, .2, 1);
}

:host([open]:not([expanded])) {
	inset: auto var(--pr-launcher-right) var(--pr-launcher-bottom) auto;
	transition: none;
}

:host([open][expanded]) {
	inset: 24px;
}

:host([open][expanded]) .dialog {
	width: min(1200px, calc(100vw - 48px));
	height: calc(100dvh - 48px);
	max-height: none;
	margin: auto;
}

@media (min-width: 601px) {
	:host([open][expanded]:not([embedded])) .node__meta,
	:host([open][expanded]:not([embedded])) .content__title,
	:host([open][expanded]:not([embedded])) .intro {
		width: 100%;
		max-width: none;
	}
}

:host([open][embedded]:not([expanded])) {
	inset: 24px;
}

:host([embedded]) .dialog {
	width: min(1200px, calc(100vw - 48px));
	height: calc(100dvh - 48px);
	max-height: none;
	margin: auto;
}

:host([embedded]) .expand {
	display: none;
}

@media (min-width: 601px) {
	:host([open][profile-open]:not([expanded])) .dialog {
		height: min(680px, calc(100dvh - 40px));
	}
}

.header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 68px;
	padding: 12px 14px 12px 18px;
	border-bottom: 3px solid var(--pr-accent);
	background: var(--pr-background);
	color: var(--pr-primary);
}

.header--attention {
	animation: pr-header-attention 1150ms cubic-bezier(.2, .8, .2, 1);
}

.brand {
	display: flex;
	align-items: center;
	gap: 11px;
	min-width: 0;
	font-weight: 750;
	letter-spacing: -0.01em;
}

.brand__title {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.brand__debug {
	flex: 0 0 auto;
	padding: 2px 6px;
	border: 1px solid var(--pr-accent);
	border-radius: 999px;
	background: var(--pr-highlight);
	color: var(--pr-primary);
	font-size: 0.62rem;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.header__actions {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
	gap: 4px;
}

.icon-button {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: var(--pr-radius-small);
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.icon-button:hover {
	background: var(--pr-primary-soft);
}

.header .icon-button:focus-visible {
	outline-color: var(--pr-focus);
}

.content {
	overflow: auto;
	padding: 18px clamp(26px, 6vw, 42px) clamp(22px, 4vw, 32px);
	overscroll-behavior: contain;
}

:host([embedded]) .content {
	overflow: hidden;
	padding: 0;
}

:host([embedded]) .footer {
	display: none;
}

:host([embedded]) .site-banner,
:host([embedded]) .message {
	display: none;
}

:host([embedded]) .node-view {
	height: 100%;
}

.embedded-view {
	display: grid;
	grid-template-rows: auto minmax(0, 1fr);
	width: 100%;
	height: 100%;
}

.embedded-view__toolbar {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 5px 10px;
	border-bottom: 1px solid var(--pr-border);
	background: var(--pr-surface);
}

.embedded-view__navigation {
	display: flex;
	align-items: center;
	gap: 5px;
}

.embedded-view__control,
.embedded-view__external {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	min-height: 34px;
	padding: 0;
	border: 1px solid var(--pr-border);
	border-radius: 6px;
	background: var(--pr-background);
	color: var(--pr-primary);
	cursor: pointer;
	box-shadow: 0 1px 2px rgb(37 39 66 / 7%);
}

.embedded-view__control:hover,
.embedded-view__external:hover {
	border-color: var(--pr-primary);
	background: var(--pr-primary-soft);
}

.embedded-view__control svg,
.embedded-view__external svg {
	width: 1.1em;
	height: 1.1em;
}

.embedded-view__title {
	min-width: 0;
	margin: 0;
	color: var(--pr-text);
	font-size: 0.88rem;
	line-height: 1.2;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.embedded-view__title:focus {
	outline: none;
}

.embedded-view__external {
	text-decoration: none;
}

.embedded-view__frame {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 0;
	border: 0;
	background: #fff;
}

.node,
.loading,
.message,
.site-banner {
	width: 100%;
	max-width: 720px;
	margin-inline: auto;
}

.site-banner {
	display: grid;
	gap: 3px;
	margin-bottom: 22px;
	padding: 15px 16px;
	border: 1px solid #d8aa46;
	border-left-width: 5px;
	border-radius: var(--pr-radius-medium);
	background: #fff6da;
	color: #533b08;
}

.site-banner--maintenance {
	border-color: #c66e42;
	background: #fff0e8;
	color: #632d15;
}

.site-banner__title {
	font-size: 0.96rem;
}

.site-banner__message,
.site-banner__detail {
	font-size: 0.86rem;
}

.patient-context {
	display: flex;
	align-items: center;
	margin: 0 2px 0 0;
}

.patient-context:empty {
	display: none;
}

.patient-selector__options {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	align-items: stretch;
	gap: 5px;
}

.patient-selector {
	margin-top: -7px;
}

.patient-selector__prompt {
	margin: 0 0 4px;
	color: var(--pr-text);
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.025em;
}

.patient-selector__hint {
	margin: 5px 0 0;
	color: var(--pr-muted);
	font-size: 0.72rem;
	line-height: 1.35;
}

.patient-selector__option {
	position: relative;
	display: flex;
	min-width: 0;
	cursor: pointer;
}

.patient-selector__option input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.patient-selector__option span {
	--pr-patient-color: var(--pr-primary);
	--pr-patient-soft: rgb(67 72 116 / 10%);
	display: grid;
	width: 100%;
	height: 100%;
	min-height: 40px;
	place-items: center;
	padding: 6px 5px;
	border: 1px solid var(--pr-border);
	border-radius: var(--pr-radius-small);
	border-color: var(--pr-patient-color);
	background: var(--pr-background);
	color: var(--pr-patient-color);
	font-size: 0.76rem;
	font-weight: 750;
	line-height: 1.2;
	text-align: center;
}

.patient-selector__option:hover span {
	background: var(--pr-patient-soft);
}

.patient-selector__option input:checked + span::after {
	content: "✓";
	margin-left: 4px;
	font-size: 0.82rem;
}

.patient-selector__option[data-patient-type="new"] span {
	--pr-patient-color: #3f7089;
	--pr-patient-soft: rgb(111 164 191 / 17%);
}

.patient-selector__option[data-patient-type="substitute"] span {
	--pr-patient-color: #76536f;
	--pr-patient-soft: rgb(118 83 111 / 12%);
}

.patient-selector__option input:checked + span {
	display: flex;
	align-items: center;
	justify-content: center;
	border-color: var(--pr-patient-color);
	background: var(--pr-patient-color);
	box-shadow: 0 4px 12px rgb(37 39 66 / 16%);
	color: #fff;
}

.patient-selector__option input:focus-visible + span {
	outline: 3px solid var(--pr-focus);
	outline-offset: 3px;
}

.patient-selector__option--ack span {
	animation: pr-patient-ack 380ms cubic-bezier(.2, .8, .2, 1);
}

@keyframes pr-patient-ack {
	0% { transform: scale(1); }
	35% {
		transform: scale(.95);
		box-shadow: 0 0 0 4px color-mix(in srgb, var(--pr-patient-color) 24%, transparent);
	}
	70% { transform: scale(1.025); }
	100% { transform: scale(1); }
}

.patient-selector__options--inline {
	margin-top: 0;
	margin-bottom: 0;
}

.patient-selector + .choice-list {
	margin-top: 10px;
}

.node--patient-selection-required .choice--patient-pending {
	opacity: 0.58;
	filter: saturate(0.65);
}

.node--patient-selection-required .choice--patient-pending:hover,
.node--patient-selection-required .choice--patient-pending:focus-visible {
	opacity: 0.82;
}

.patient-selector__options--attention {
	animation: pr-patient-attention 520ms cubic-bezier(.2, .8, .2, 1);
}

@keyframes pr-patient-attention {
	0%, 100% { transform: translateX(0); }
	25% { transform: translateX(-4px); }
	50% { transform: translateX(4px); }
	75% { transform: translateX(-2px); }
}

.patient-summary {
	min-height: 21px;
	padding: 2px 7px;
	border: 1px solid #434874;
	border-radius: 999px;
	background: #434874;
	color: #fff;
	font-size: 0.66rem;
	font-weight: 800;
	line-height: 1.2;
	white-space: nowrap;
	cursor: pointer;
}

.patient-summary[data-patient-type="new"] {
	border-color: #3f7089;
	background: #3f7089;
}

.patient-summary[data-patient-type="substitute"] {
	border-color: #76536f;
	background: #76536f;
}

.patient-summary:hover {
	filter: brightness(.92);
}

.message {
	margin-bottom: 20px;
	padding: 12px 14px;
	border: 1px solid #dfb757;
	border-radius: var(--pr-radius-medium);
	background: #fff7df;
	color: #563f0b;
	font-size: 0.9rem;
}

.message__link {
	color: inherit;
	font-weight: 800;
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}

.honeypot {
	position: fixed !important;
	left: -10000px !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}

.remote-loading {
	display: flex;
	align-items: center;
	gap: 10px;
}

.remote-loading__spinner {
	width: 20px;
	height: 20px;
	flex: 0 0 auto;
	border: 3px solid var(--pr-border);
	border-top-color: var(--pr-primary);
	border-radius: 50%;
	animation: pr-spin 700ms linear infinite;
}

@keyframes pr-spin {
	to { transform: rotate(360deg); }
}

.eyebrow {
	margin: 0 0 8px;
	color: var(--pr-primary);
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.node__meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 8px;
}

.node__meta .eyebrow {
	margin: 0;
}

.content__title {
	margin: 0;
	color: var(--pr-text);
	font-size: clamp(1.65rem, 5vw, 2.15rem);
	line-height: 1.16;
	letter-spacing: -0.035em;
}

.content__title:focus {
	outline: none;
}

.content__title:focus-visible {
	outline: 3px solid var(--pr-focus);
	outline-offset: 5px;
}

.content__title[data-programmatic-focus="true"]:focus-visible {
	outline: none;
}

.intro {
	max-width: 38rem;
	margin: 15px 0 26px;
	color: var(--pr-muted);
	line-height: 1.58;
}

.intro--plain {
	white-space: pre-line;
}

.intro > :first-child {
	margin-top: 0;
}

.intro > :last-child {
	margin-bottom: 0;
}

.intro p,
.intro ul,
.intro ol,
.intro blockquote {
	margin: 0 0 11px;
}

.intro h3,
.intro h4 {
	margin: 15px 0 7px;
	color: var(--pr-text);
	line-height: 1.3;
}

.intro h3 {
	font-size: 1.05rem;
}

.intro h4 {
	font-size: 0.95rem;
}

.intro ul,
.intro ol {
	padding-left: 1.3rem;
}

.intro a {
	color: var(--pr-primary);
	font-weight: 700;
	text-underline-offset: 0.16em;
}

.intro mark,
.intro-highlight {
	padding: 0.08em 0.22em;
	border-radius: 4px;
	background: var(--pr-highlight);
	color: var(--pr-text);
}

.intro-callout {
	display: block;
	margin: 13px 0;
	padding: 10px 12px;
	border-left: 4px solid var(--pr-accent);
	border-radius: 0 var(--pr-radius-small) var(--pr-radius-small) 0;
	background: var(--pr-primary-soft);
	color: var(--pr-text);
}

.intro-warning,
.intro-danger {
	display: block;
	margin: 13px 0;
	padding: 10px 12px;
	border-left: 4px solid #d6a72f;
	border-radius: 0 var(--pr-radius-small) var(--pr-radius-small) 0;
	background: #fff8e5;
	color: #5d4508;
}

.intro-danger {
	border-left-color: #b45454;
	background: #fff1f1;
	color: #702a2a;
}

.intro-primary {
	color: var(--pr-primary);
}

.intro-accent {
	color: var(--pr-accent);
}

.intro-muted {
	color: var(--pr-muted);
}

.intro-center {
	text-align: center;
}

.intro-compact {
	font-size: 0.9rem;
	line-height: 1.45;
}

.choice-list,
.action-list {
	display: grid;
	gap: 11px;
	margin-top: 22px;
}

.choice,
.action-button {
	width: 100%;
	min-height: 52px;
	border: 1px solid var(--pr-border);
	border-radius: var(--pr-radius-medium);
	background: var(--pr-background);
	color: var(--pr-text);
	font-weight: 700;
	text-align: left;
	cursor: pointer;
	transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.choice {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 15px 16px;
}

.choice__icon {
	flex: 0 0 auto;
	color: var(--pr-primary);
}

.choice:hover:not(:disabled),
.action-button:hover:not(:disabled) {
	border-color: var(--pr-primary);
	background: var(--pr-primary-soft);
	box-shadow: 0 5px 14px rgb(37 39 66 / 10%);
	transform: translateY(-1px);
}

.action-button {
	padding: 14px 16px;
	text-align: center;
}

.choice--highlight,
.action-button--highlight {
	border-color: var(--pr-accent);
	background: var(--pr-highlight);
	box-shadow: inset 4px 0 0 var(--pr-accent);
}

.choice--highlight:hover:not(:disabled),
.action-button--highlight:hover:not(:disabled) {
	border-color: var(--pr-accent);
	background: var(--pr-highlight-hover);
	box-shadow: inset 4px 0 0 var(--pr-accent), 0 5px 14px rgb(37 39 66 / 10%);
}

.choice--primary,
.action-button--primary {
	border-color: var(--pr-primary);
	background: var(--pr-primary);
	color: #fff;
}

.choice--primary:hover:not(:disabled),
.action-button--primary:hover:not(:disabled) {
	background: var(--pr-primary-hover);
	color: #fff;
}

.choice--primary .choice__icon {
	color: currentColor;
}

.action-button:disabled {
	background: #e7e8ee;
	color: var(--pr-muted);
}

.action-button.is-loading {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	cursor: wait;
}

.button-spinner {
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: pr-spin 700ms linear infinite;
}

.action-reason {
	display: block;
	margin: -5px 4px 3px;
	color: var(--pr-muted);
	font-size: 0.8rem;
}

.input-form {
	display: grid;
	gap: 20px;
	margin-top: 24px;
}

.field {
	display: grid;
	gap: 7px;
}

.field--repeatable {
	gap: 9px;
}

.field__label--repeatable {
	margin: 0;
}

.repeatable-description {
	margin: -2px 0 1px;
	color: var(--pr-muted);
	font-size: 0.82rem;
	line-height: 1.4;
}

.repeatable-list {
	display: grid;
	gap: 8px;
}

.repeatable-item {
	padding: 10px;
	border: 1px solid var(--pr-border);
	border-radius: var(--pr-radius-small);
	background: #fff;
}

.repeatable-item--file-dropzone {
	transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.repeatable-item--file-dropzone.is-dragover {
	border-color: var(--pr-accent);
	background: #f3f8fb;
	box-shadow: 0 0 0 3px rgb(111 164 191 / 20%);
}

.repeatable-item:nth-child(even) {
	background: #f6f8fa;
}

.repeatable-item__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 8px;
	color: var(--pr-primary);
	font-size: 0.86rem;
}

.repeatable-item__drop-hint {
	margin-left: auto;
	color: var(--pr-muted);
	font-size: 0.7rem;
	font-weight: 500;
}

.repeatable-item__drop-hint + .repeatable-item__remove {
	margin-left: 2px;
}

.repeatable-item__remove {
	padding: 3px 8px;
	border: 1px solid var(--pr-border);
	border-radius: 999px;
	background: transparent;
	color: var(--pr-muted);
	font: inherit;
	font-size: 0.75rem;
	cursor: pointer;
}

.repeatable-item__remove:hover,
.repeatable-item__remove:focus-visible {
	border-color: var(--pr-primary);
	color: var(--pr-primary);
}

.repeatable-item__fields {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 7px;
}

.repeatable-child {
	display: block;
	color: var(--pr-muted);
	font-size: 0.73rem;
	font-weight: 650;
}

.repeatable-child--wide {
	grid-column: 1 / -1;
}

.repeatable-child__label {
	display: block;
	line-height: 1.35;
}

.repeatable-child .field__requirement {
	margin-left: 6px;
}

.repeatable-child .field__control {
	display: block;
	min-height: 40px;
	margin-top: 4px;
	padding: 8px 9px;
	font-size: 0.88rem;
}

.repeatable-child textarea.field__control {
	min-height: 54px;
}

.repeatable-child__add {
	display: inline-flex;
	margin-top: 5px;
	padding: 5px 9px;
	border: 1px dashed var(--pr-border);
	border-radius: var(--pr-radius-small);
	background: transparent;
	color: var(--pr-primary);
	font: inherit;
	font-size: 0.78rem;
	font-weight: 700;
	cursor: pointer;
}

.repeatable-child__add:hover,
.repeatable-child__add:focus-visible {
	border-color: var(--pr-primary);
	background: var(--pr-primary-soft);
}

.repeatable-add {
	justify-self: start;
	margin-top: 2px;
	padding: 7px 11px;
	border: 1px solid var(--pr-primary);
	border-radius: var(--pr-radius-small);
	background: var(--pr-primary-soft);
	color: var(--pr-primary);
	font: inherit;
	font-size: 0.82rem;
	font-weight: 700;
	cursor: pointer;
}

.repeatable-add:hover,
.repeatable-add:focus-visible {
	background: #e4e6f3;
}

.field__label,
.field__fieldset legend {
	padding: 0;
	color: var(--pr-text);
	font-weight: 750;
}

.field__label-text {
	display: inline;
}

.field__requirement {
	display: inline-block;
	margin-left: 7px;
	padding: 1px 6px 2px;
	border-radius: 999px;
	font-size: 0.68rem;
	font-weight: 750;
	letter-spacing: 0.015em;
	line-height: 1.35;
	vertical-align: 0.08em;
}

.field__requirement--required {
	background: var(--pr-primary-soft);
	color: var(--pr-primary);
}

.field__requirement--optional {
	background: #eef0f5;
	color: var(--pr-muted);
}

.field__fieldset {
	display: grid;
	gap: 9px;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.field__control {
	width: 100%;
	min-height: 48px;
	padding: 11px 12px;
	border: 1px solid #aeb2c2;
	border-radius: var(--pr-radius-small);
	background: #fff;
	color: var(--pr-text);
	font: inherit;
}

textarea.field__control {
	min-height: 108px;
	resize: vertical;
}

input[type="file"].field__control {
	padding: 6px 8px;
	cursor: pointer;
}

input[type="file"].field__control::file-selector-button {
	min-height: 34px;
	margin: 0 10px 0 0;
	padding: 6px 11px;
	border: 1px solid rgb(67 72 116 / 28%);
	border-radius: 7px;
	background: var(--pr-highlight);
	color: var(--pr-primary);
	font: inherit;
	font-size: 0.84rem;
	font-weight: 700;
	cursor: pointer;
	transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

input[type="file"].field__control:hover::file-selector-button {
	border-color: var(--pr-accent);
	background: var(--pr-highlight-hover);
}

input[type="file"].field__control:active::file-selector-button {
	background: var(--pr-primary-soft);
}

.field__hint {
	margin: -2px 0 0;
	color: var(--pr-muted);
	font-size: 0.8rem;
	line-height: 1.4;
}

.field__control:focus {
	border-color: var(--pr-primary);
	box-shadow: 0 0 0 3px rgb(67 72 116 / 16%);
	outline: 2px solid transparent;
}

.field__options {
	display: grid;
	gap: 8px;
}

.option-control,
.checkbox-control {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	min-height: 44px;
	padding: 11px 12px;
	border: 1px solid var(--pr-border);
	border-radius: var(--pr-radius-small);
	background: var(--pr-background);
	cursor: pointer;
}

.option-control:hover,
.checkbox-control:hover {
	border-color: var(--pr-primary);
	background: var(--pr-primary-soft);
}

.option-control input,
.checkbox-control input {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	margin: 1px 0 0;
	accent-color: var(--pr-primary);
}

.field__error {
	color: #9b2424;
	font-size: 0.84rem;
	font-weight: 650;
}

.field--error .field__control,
.field--error .option-control,
.field--error .checkbox-control {
	border-color: #b42b2b;
}

.file-summary {
	color: var(--pr-muted);
	font-size: 0.8rem;
	overflow-wrap: anywhere;
}

.input-submit {
	margin-top: 4px;
}

.node--urgent .eyebrow,
.node--error .eyebrow {
	color: #a22b2b;
}

.node--urgent .content__title,
.node--error .content__title {
	color: #731d1d;
}

.node--success .eyebrow {
	color: #176b3a;
}

.profile-save-shortcut {
	display: block;
	width: 100%;
	min-height: 42px;
	margin: -5px 0 11px;
	padding: 9px 12px;
	border: 1px solid var(--pr-border);
	border-radius: var(--pr-radius-small);
	background: #fff;
	color: var(--pr-primary);
	font-size: 0.82rem;
	font-weight: 750;
	text-align: center;
	cursor: pointer;
	transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.profile-save-shortcut:hover {
	border-color: var(--pr-accent);
	background: var(--pr-highlight);
	box-shadow: 0 3px 10px rgb(37 39 66 / 8%);
}

.notice {
	display: grid;
	gap: 4px;
	padding: 18px;
	border: 1px solid rgb(111 164 191 / 45%);
	border-radius: var(--pr-radius-medium);
	background: var(--pr-primary-soft);
	color: var(--pr-text);
}

.notice strong {
	color: var(--pr-primary);
}

.footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 13px 20px;
	border-top: 1px solid var(--pr-border);
	background: var(--pr-surface);
	color: var(--pr-muted);
	font-size: 0.77rem;
}

.footer__navigation {
	display: flex;
	gap: 6px;
}

.nav-button {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	min-height: 42px;
	padding: 8px 10px;
	border: 0;
	border-radius: var(--pr-radius-small);
	background: transparent;
	color: var(--pr-primary);
	font-size: 0.86rem;
	font-weight: 750;
	cursor: pointer;
}

.nav-button:hover:not(:disabled) {
	background: var(--pr-primary-soft);
}

.nav-button svg {
	width: 1.15em;
	height: 1.15em;
}

.footer__profile {
	position: relative;
	display: grid;
	flex: 0 0 42px;
	width: 42px;
	height: 42px;
	padding: 0;
	place-items: center;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--pr-muted);
	cursor: pointer;
}

.footer__profile:hover .footer__profile-icon {
	border-color: var(--pr-accent);
	background: var(--pr-highlight);
	color: var(--pr-primary);
	transform: translateY(-1px);
}

.footer__profile-icon {
	position: relative;
	display: grid;
	width: 35px;
	height: 35px;
	place-items: center;
	border: 1px solid var(--pr-border);
	border-radius: 50%;
	background: #f1f3f5;
	transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.footer__profile-icon > svg {
	width: 19px;
	height: 19px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.8;
}

.footer__profile-mark {
	position: absolute;
	top: -5px;
	right: -6px;
	display: grid;
	width: 13px;
	height: 13px;
	place-items: center;
	border: 2px solid var(--pr-surface);
	border-radius: 50%;
	font-size: 0.58rem;
	font-weight: 900;
	line-height: 1;
}

.footer__profile[data-status="empty"] .footer__profile-mark {
	background: #dce8ee;
	color: #384c59;
}

.footer__profile[data-status="empty"] .footer__profile-mark::before {
	content: "+";
}

.footer__profile[data-status="pending"] .footer__profile-icon {
	border-color: #d1a33f;
	background: #fff7df;
	color: #6f5112;
}

.footer__profile[data-status="pending"] .footer__profile-mark {
	background: #d79b19;
	color: #fff;
}

.footer__profile[data-status="pending"] .footer__profile-mark::before {
	content: "!";
}

.footer__profile[data-status="saved"] .footer__profile-icon {
	border-color: #76a98a;
	background: #e8f3ec;
	color: #276442;
}

.footer__profile[data-status="saved"] .footer__profile-mark {
	background: #3c8158;
	color: #fff;
}

.footer__profile[data-status="saved"] .footer__profile-mark::before {
	content: "✓";
}

.footer__profile[data-status="unavailable"] {
	opacity: 0.72;
}

.footer__profile[data-status="unavailable"] .footer__profile-mark {
	display: none;
}

.footer__profile--attention {
	animation: pr-profile-attention 680ms cubic-bezier(.2, .8, .2, 1);
}

@keyframes pr-profile-attention {
	0%, 100% { transform: translateY(0) scale(1); }
	35% { transform: translateY(-2px) scale(1.08); }
	70% { transform: translateY(0) scale(.98); }
}

.profile-manager {
	position: absolute;
	z-index: 5;
	inset: 0;
	display: grid;
	grid-template-rows: auto minmax(0, 1fr);
	border-radius: inherit;
	background: var(--pr-background);
	overflow: hidden;
}

.profile-manager__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 68px;
	padding: 12px 14px 12px 20px;
	border-bottom: 3px solid var(--pr-accent);
}

.profile-manager__title {
	margin: 0;
	font-size: 1.2rem;
}

.profile-manager__body {
	overflow: auto;
	padding: clamp(22px, 5vw, 36px);
}

.profile-storage-notes {
	margin: 0 0 14px;
	border: 1px solid rgb(67 72 116 / 26%);
	border-radius: var(--pr-radius-small);
	background: var(--pr-highlight);
	color: var(--pr-muted);
	font-size: 0.82rem;
	overflow: hidden;
	box-shadow: 0 2px 7px rgb(37 39 66 / 7%);
	transition: border-color 160ms ease, box-shadow 160ms ease;
}

.profile-storage-notes__summary {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto 12px;
	align-items: center;
	gap: 12px;
	min-height: 54px;
	padding: 8px 13px;
	color: var(--pr-primary);
	cursor: pointer;
	transition: background 160ms ease;
}

.profile-storage-notes__summary::-webkit-details-marker {
	display: none;
}

.profile-storage-notes__summary::marker {
	content: '';
}

.profile-storage-notes__summary::after {
	width: 9px;
	height: 9px;
	border-right: 2px solid currentcolor;
	border-bottom: 2px solid currentcolor;
	content: '';
	transform: rotate(-45deg);
	transition: transform 160ms ease;
}

.profile-storage-notes__summary:hover {
	background: var(--pr-highlight-hover);
}

.profile-storage-notes[open] {
	border-color: rgb(67 72 116 / 38%);
	box-shadow: 0 4px 12px rgb(37 39 66 / 9%);
}

.profile-storage-notes[open] .profile-storage-notes__summary::after {
	transform: rotate(45deg) translate(-2px, -2px);
}

.profile-storage-notes__summary:focus-visible {
	outline: 3px solid var(--pr-focus);
	outline-offset: -3px;
}

.profile-storage-notes__label {
	display: grid;
	gap: 1px;
}

.profile-storage-notes__title {
	font-size: 0.86rem;
	font-weight: 800;
}

.profile-storage-notes__action {
	color: var(--pr-muted);
	font-size: 0.69rem;
	font-weight: 650;
}

.profile-storage-notes__expiry {
	color: var(--pr-muted);
	font-size: 0.74rem;
	font-weight: 650;
	white-space: nowrap;
}

.profile-storage-notes__content {
	padding: 0 12px 11px;
	border-top: 1px solid rgb(67 72 116 / 20%);
	background: #fff;
}

.profile-storage-notes__content ul {
	margin: 10px 0 0;
	padding-left: 1.15rem;
}

.profile-storage-notes__content li + li {
	margin-top: 6px;
}

.profile-form {
	display: grid;
	gap: 12px;
}

.profile-field {
	display: grid;
	grid-template-columns: minmax(150px, .8fr) minmax(0, 1.2fr);
	align-items: center;
	gap: 10px;
}

.profile-field__label {
	font-size: 0.88rem;
	font-weight: 700;
}

.profile-selection {
	margin-top: 4px;
	border: 1px solid var(--pr-border);
	border-radius: var(--pr-radius-small);
	background: #fff;
}

.profile-selection__summary {
	padding: 11px 12px;
	color: var(--pr-primary);
	font-size: 0.88rem;
	font-weight: 750;
	cursor: pointer;
}

.profile-selection__summary:focus-visible {
	outline: 3px solid var(--pr-focus);
	outline-offset: 2px;
}

.profile-selection__hint {
	margin: 0;
	padding: 0 12px 10px;
	color: var(--pr-muted);
	font-size: 0.8rem;
}

.profile-selection__options {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 9px 14px;
	padding: 0 12px 12px;
}

.profile-field__consent {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.88rem;
	font-weight: 700;
	cursor: pointer;
}

.profile-field__consent input {
	width: 19px;
	height: 19px;
	accent-color: var(--pr-primary);
}

.profile-field__current {
	color: var(--pr-muted);
	font-size: 0.88rem;
}

.profile-field__value {
	display: grid;
	gap: 2px;
}

.profile-field__automatic {
	color: var(--pr-muted);
	font-size: 0.72rem;
	line-height: 1.3;
}

.profile-manager__actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 9px;
	margin-top: 8px;
}

.profile-manager__actions .action-button {
	min-height: 42px;
	padding: 9px 10px;
	font-size: 0.84rem;
	white-space: nowrap;
}

.action-button--secondary {
	background: #fff;
	color: var(--pr-primary);
}

.profile-delete {
	min-height: 32px;
	padding: 3px 5px;
	border: 0;
	background: transparent;
	color: #8b2424;
	font-size: 0.8rem;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.profile-manager__data-links {
	display: grid;
	grid-column: 1 / -1;
	justify-items: center;
	gap: 0;
	margin-top: 1px;
}

.profile-privacy-link {
	padding: 1px 5px 3px;
	color: var(--pr-muted);
	font-size: 0.73rem;
	text-decoration-color: rgb(95 100 117 / 42%);
	text-underline-offset: 3px;
}

.profile-privacy-link:hover {
	color: var(--pr-primary);
}

.live-region {
	position: fixed;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

@keyframes pr-fade-in {
	from { opacity: 0; }
}

@keyframes pr-dialog-in {
	from {
		opacity: 0;
		transform: translateY(12px) scale(.985);
	}
}

@keyframes pr-launcher-attention {
	0%, 100% {
		filter: none;
	}
	32% {
		filter: drop-shadow(0 0 7px rgb(111 164 191 / 65%)) drop-shadow(0 0 16px rgb(111 164 191 / 34%));
	}
	66% {
		filter: drop-shadow(0 0 4px rgb(67 72 116 / 38%));
	}
}

@keyframes pr-launcher-sheen {
	0% {
		left: -42%;
		opacity: 0;
	}
	18% {
		opacity: .82;
	}
	76% {
		opacity: .42;
	}
	100% {
		left: 112%;
		opacity: 0;
	}
}

@keyframes pr-header-attention {
	0%, 100% {
		background: var(--pr-background);
		box-shadow: none;
	}
	38% {
		background: var(--pr-highlight);
		box-shadow: inset 0 -3px 0 rgb(111 164 191 / 80%), 0 6px 18px rgb(67 72 116 / 10%);
	}
	70% {
		background: rgb(237 246 250 / 58%);
		box-shadow: inset 0 -3px 0 rgb(111 164 191 / 48%);
	}
}

@media (max-width: 600px) {
	:host {
		--pr-launcher-right: max(14px, env(safe-area-inset-right));
		--pr-launcher-bottom: max(14px, env(safe-area-inset-bottom));
	}

	:host([open]:not([expanded])),
	:host([open][expanded]),
	:host([open][embedded]:not([expanded])),
	:host([open][embedded][expanded]) {
		inset: 0;
	}

	:host([open]) .dialog,
	:host([open][expanded]) .dialog {
		width: 100vw;
		height: 100dvh;
		max-height: none;
		margin: 0;
		border: 0;
		border-radius: 0;
	}

	:host([open]) .header {
		padding-top: max(12px, env(safe-area-inset-top));
	}

	:host([open]) .content {
		padding-right: max(24px, env(safe-area-inset-right));
		padding-bottom: max(30px, env(safe-area-inset-bottom));
		padding-left: max(24px, env(safe-area-inset-left));
	}

	:host([open][embedded]) .content {
		padding: 0;
	}

	:host([open]) .footer {
		padding-bottom: max(13px, env(safe-area-inset-bottom));
	}

	.patient-selector__option span {
		min-height: 40px;
		font-size: 0.72rem;
	}

	.profile-field {
		grid-template-columns: 1fr;
		gap: 5px;
	}

	.profile-selection__options {
		grid-template-columns: 1fr;
	}

	.repeatable-item__fields {
		grid-template-columns: 1fr;
	}

	.repeatable-child--wide {
		grid-column: 1 / -1;
	}

	.profile-manager {
		border-radius: 0;
	}

	.embedded-view__toolbar {
		padding-right: max(8px, env(safe-area-inset-right));
		padding-left: max(8px, env(safe-area-inset-left));
	}

	.embedded-view__title {
		font-size: 0.8rem;
	}

	.expand {
		display: none;
	}
}

@media (max-width: 400px) {
	.repeatable-item__drop-hint {
		display: none;
	}

	:host([open]) .header {
		padding-right: 8px;
		padding-left: 12px;
	}

	:host([open]) .header .brand__mark {
		display: none;
	}

	:host([open]) .brand__title {
		font-size: 0.9rem;
	}

	:host([open]) .patient-summary {
		padding-right: 6px;
		padding-left: 6px;
		font-size: 0.62rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	:host,
	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}

	.launcher--attention {
		animation: none;
		filter: drop-shadow(0 0 7px rgb(111 164 191 / 58%));
	}

	.launcher--attention::before {
		animation: none;
	}

	.header--attention {
		animation: none;
		background: var(--pr-highlight);
		box-shadow: inset 0 -3px 0 rgb(111 164 191 / 68%);
	}
}

@media (forced-colors: active) {
	.launcher,
	.dialog,
	.notice,
	.icon-button {
		border: 1px solid CanvasText;
	}
}
