/* ==========================================================================
   OLC Prescription Module — olc-prescription.css
   ========================================================================== */

/* ── CSS Variables (mirrors the main configurator palette) ──────────────── */
:root {
	--olc-rx-primary:    var(--olc-primary,    #2c5f8a);
	--olc-rx-primary-lt: var(--olc-primary-lt, #e8f2fb);
	--olc-rx-accent:     var(--olc-accent,     #1a8a4a);
	--olc-rx-accent-lt:  var(--olc-accent-lt,  #edf7f1);
	--olc-rx-border:     var(--olc-border,     #dde1e7);
	--olc-rx-bg:         var(--olc-bg,         #f8f9fb);
	--olc-rx-text:       var(--olc-text,       #1a1f2e);
	--olc-rx-text-lt:    var(--olc-text-lt, var(--olc-disabled, #6b7280));
	--olc-rx-radius:     8px;
	--olc-rx-danger:     #c0392b;
	--olc-rx-danger-lt:  #fdf2f2;
}

/* ── Structured prescription summary (list / applied card / timeline) ───── */
.olc-rx-summary-details.prescription-details,
.prescription-details.olc-rx-summary-details {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 0.8125rem;
	line-height: 1.45;
	text-align: left;
	width: 100%;
}

.olc-rx-summary-row.prescription-row {
	display: grid;
	grid-template-columns: minmax(100px, 34%) 1fr;
	gap: 6px 12px;
	align-items: baseline;
}

@media (max-width: 520px) {
	.olc-rx-summary-row.prescription-row {
		grid-template-columns: 1fr;
		gap: 2px 0;
	}
}

.olc-rx-summary-label.prescription-label {
	font-weight: 600;
	color: var(--olc-rx-text);
}

.olc-rx-summary-value.prescription-value {
	color: var(--olc-rx-text-lt);
	word-break: break-word;
}

/* Compact summary: per-eye SPH/CYL/AXIS, Prism block, global PD/ADD */
.olc-rx-summary-compact.prescription-details,
.prescription-details.olc-rx-summary-compact {
	display: flex;
	flex-direction: column;
	gap: 8px;
	font-size: 0.8125rem;
	line-height: 1.45;
	text-align: left;
	width: 100%;
}

.olc-rx-summary-compact .olc-rx-summary-line {
	margin: 0 !important;
	color: var(--olc-rx-text-lt);
	word-break: break-word;
}

.olc-rx-summary-compact .olc-rx-summary-k {
	font-weight: 600;
	color: var(--olc-rx-text);
	margin-right: 0.25em;
}

.olc-rx-summary-subhead {
	font-weight: 600;
	color: var(--olc-rx-text);
	margin: 0.35em 0 0.15em;
	font-size: 0.95em;
}

.olc-rx-summary-prism {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.olc-rx-summary-prism .olc-rx-summary-subhead {
	margin-top: 0;
}

.olc-rx-summary-eye-block {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.olc-rx-summary-eye-title {
	font-weight: 600;
	color: var(--olc-rx-text);
}

.olc-rx-summary-eye-line {
	color: var(--olc-rx-text-lt);
	word-break: break-word;
}

.olc-rx-summary-empty-title {
	font-weight: 600;
	color: var(--olc-rx-text);
}

.olc-rx-summary-empty-line {
	color: var(--olc-rx-text-lt);
}

/* ── Prescription name field ────────────────────────────────────────────── */
.olc-rx-name-section {
	margin-bottom: 12px;
}

.olc-rx-name-group label {
	display: flex;
	align-items: baseline;
	gap: 6px;
}

/* .olc-rx-name-footer — removed; name field now lives inside Panel 1 */

.olc-rx-optional {
	font-size: 0.8em;
	font-weight: 400;
	color: var(--olc-rx-text-lt);
	flex-grow: 1;
}

.olc-rx-name-input {
	width: 100%;
}

.olc-rx-field-hint {
	margin: 4px 0 0;
	font-size: 0.8em;
	color: var(--olc-rx-text-lt);
}

/* ── Shared account-page wrapper ────────────────────────────────────────── */
.olc-rx-account-wrap {
	max-width: 860px;
}

/* ── List page header ───────────────────────────────────────────────────── */
.olc-rx-list-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 20px;
}

.olc-rx-list-title,
.olc-rx-edit-title {
	margin: 0;
	font-size: 1.2em;
	font-weight: 600;
	color: var(--olc-rx-text);
}

/* ── Notices ────────────────────────────────────────────────────────────── */
.olc-rx-notice {
	padding: 10px 16px;
	border-radius: var(--olc-rx-radius);
	margin-bottom: 16px;
	font-size: 0.95em;
}

.olc-rx-notice--success {
	background: #f0fdf4;
	border-left: 3px solid var(--olc-rx-accent);
	color: #166534;
}

.olc-rx-notice--error {
	background: var(--olc-rx-danger-lt);
	border-left: 3px solid var(--olc-rx-danger);
	color: var(--olc-rx-danger);
}

/* ── Prescription card grid ─────────────────────────────────────────────── */
.olc-rx-grid {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.olc-rx-grid-item {
	border: 1px solid var(--olc-rx-border, #dde1e7);
	border-radius: var(--olc-rx-radius, 8px);
	overflow: hidden;
	background: #fff;
}

/* ── Row 1: meta bar ─────────────────────────────────────────────────────── */
.olc-rx-item-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px;
	padding: 10px 16px;
	background: var(--olc-rx-bg-alt, #f9fafb);
	border-bottom: 1px solid var(--olc-rx-border, #dde1e7);
	font-size: 0.85em;
}

.olc-rx-item-date {
	font-weight: 600;
	color: var(--olc-rx-text, #1a1f2e);
}

.olc-rx-date-value {
	font-weight: 400;
	color: var(--olc-rx-text, #1a1f2e);
	margin-left: 4px;
}

.olc-rx-item-actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

/* ── Column grid (shared between header + data rows) ────────────────────── */
.olc-rx-item-header,
.olc-rx-item-data {
	display: grid;
	grid-template-columns: 1.5fr 1fr 2.5fr 1fr;
	gap: 0;
}

/* ── Row 2: column headers ───────────────────────────────────────────────── */
.olc-rx-item-header {
	background: var(--olc-rx-bg, #f8f9fb);
	border-bottom: 1px solid var(--olc-rx-border, #dde1e7);
}

.olc-rx-item-header > div {
	padding: 8px 14px;
	font-size: 0.78em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--olc-rx-text-lt, #6b7280);
}

.olc-rx-item-header > div + div {
	border-left: 1px solid var(--olc-rx-border, #dde1e7);
}

/* ── Row 3: data values ──────────────────────────────────────────────────── */
.olc-rx-item-data > div {
	padding: 12px 14px;
	font-size: 0.9em;
	color: var(--olc-rx-text, #1a1f2e);
	word-break: break-word;
}

.olc-rx-item-data > div + div {
	border-left: 1px solid var(--olc-rx-border, #dde1e7);
}

.olc-rx-item-data .olc-rx-col-name strong {
	font-weight: 600;
}

.olc-rx-item-data .olc-rx-col-type {
	color: var(--olc-rx-text-lt, #6b7280);
	font-size: 0.85em;
}

.olc-rx-item-data a {
	color: var(--olc-rx-accent, #1a8a4a);
	text-decoration: none;
}

.olc-rx-item-data a:hover {
	text-decoration: underline;
}

.olc-rx-no-order {
	color: var(--olc-rx-text-lt, #6b7280);
}

/* ── Responsive: stack columns on narrow screens ────────────────────────── */
@media (max-width: 600px) {
	.olc-rx-item-header {
		display: none;
	}

	.olc-rx-item-data {
		grid-template-columns: 1fr;
	}

	.olc-rx-item-data > div {
		border-left: none !important;
		border-top: 1px solid var(--olc-rx-border, #dde1e7);
		padding: 10px 14px;
	}

	.olc-rx-item-data > div:first-child {
		border-top: none;
	}

	.olc-rx-item-data > div::before {
		content: attr(data-label);
		display: block;
		font-size: 0.75em;
		font-weight: 700;
		text-transform: uppercase;
		letter-spacing: 0.05em;
		color: var(--olc-rx-text-lt, #6b7280);
		margin-bottom: 3px;
	}
}

.olc-rx-empty-state {
	padding: 32px;
	text-align: center;
	background: var(--olc-rx-bg);
	border: 1px dashed var(--olc-rx-border);
	border-radius: var(--olc-rx-radius);
	color: var(--olc-rx-text-lt);
}

.olc-rx-no-order {
	color: var(--olc-rx-text-lt);
}

/* ── Edit page header ───────────────────────────────────────────────────── */
.olc-rx-edit-header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 20px;
}

.olc-rx-back-link {
	font-size: 0.88em;
	color: var(--olc-rx-primary);
	text-decoration: none;
}

.olc-rx-back-link:hover {
	text-decoration: underline;
}

/* ── Form shared layout ─────────────────────────────────────────────────── */
.olc-rx-form {
	background: #fff;
	border: 1px solid var(--olc-rx-border);
	border-radius: var(--olc-rx-radius);
	padding: 24px;
}

.olc-rx-section {
	margin-bottom: 24px;
}

.olc-rx-section-title {
	margin: 0 0 6px;
	font-size: 0.95em;
	font-weight: 600;
	color: var(--olc-rx-text);
}

.olc-rx-section-desc {
	margin: 0 0 12px;
	font-size: 0.85em;
	color: var(--olc-rx-text-lt);
}

/* ── SPH / CYL / AXIS — side-by-side eye-group cards ───────────────────── */
.olc-rx-sca-section {
	margin-bottom: 10px;
}

.olc-rx-eyes-row {
	display: flex;
	gap: 10px;
}

.olc-rx-eye-group {
	flex: 1;
	min-width: 0;
	background: var(--olc-rx-bg-alt, #f9fafb);
	border: 1px solid var(--olc-rx-border, #e5e7eb);
	border-radius: var(--olc-rx-radius, 8px);
	padding: 12px 14px 14px;
}

.olc-prism-eye-group {
	flex: 1;
}

.olc-rx-eye-group-title {
	font-size: 0.82em;
	font-weight: 700;
	color: var(--olc-rx-primary);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-bottom: 10px;
}

.olc-rx-eye-group-fields {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 8px;
}

.olc-rx-eye-field-col label {
	display: block;
	font-size: 0.72em;
	font-weight: 600;
	color: var(--olc-rx-text-lt);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-bottom: 4px;
	white-space: nowrap;
}

/* CYL entered but axis still empty — highlight axis + hint */
.olc-rx-eye-field-col--axis-needed .olc-rx-axis-select {
	border-color: var(--olc-rx-primary);
	box-shadow: 0 0 0 2px rgba(44, 95, 138, 0.22);
	background: var(--olc-rx-primary-lt, #e8f2fb);
}

.olc-rx-eye-field-col--axis-needed > label {
	color: var(--olc-rx-primary);
}

.olc-rx-axis-required-hint {
	margin: 6px 0 0;
	font-size: 0.78em;
	line-height: 1.4;
	color: var(--olc-rx-primary);
	font-weight: 600;
}

@media (max-width: 768px) {
	.olc-rx-eyes-row {
		flex-direction: column;
	}
}

/* ── Prism axis rows (inside eye group cards) ───────────────────────────── */
.olc-rx-prism-axis-row {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 10px 0;
}

.olc-rx-prism-axis-row + .olc-rx-prism-axis-row {
	border-top: 1px solid var(--olc-rx-border, #e5e7eb);
}

.olc-rx-prism-axis-label {
	font-size: 0.72em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--olc-rx-text-lt, #6b7280);
}

.olc-rx-prism-axis-fields {
	display: flex;
	gap: 10px;
	align-items: flex-start;
}

.olc-rx-prism-value-col {
	flex: 1 0 auto;
	min-width: 0;
}

.olc-rx-prism-value-col label,
.olc-rx-prism-base-col > label {
	display: block;
	font-size: 0.72em;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--olc-rx-text-lt, #6b7280);
	margin-bottom: 4px;
	white-space: nowrap;
}

.olc-rx-prism-base-col {
	flex: 1;
	min-width: 0;
}

.olc-rx-prism-base-radios {
	display: flex;
	gap: 12px;
	align-items: center;
	padding-top: 6px;
}

.olc-rx-prism-base-radio-label {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 0.85em;
	cursor: pointer;
	user-select: none;
	white-space: nowrap;
}

/* ── Addition (ADD) accordion ───────────────────────────────────────────── */
.olc-rx-add-section {
	margin-bottom: 10px;
}

/* Single shared ADD input — browser handles [hidden] natively; this is a safety net */
.olc-rx-add-single[hidden],
.olc-rx-add-split[hidden] {
	display: none !important;
}

/* "Different ADD for each eye?" toggle */
.olc-rx-add-split-label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 10px;
	font-size: 0.82em;
	color: var(--olc-rx-text-lt, #6b7280);
	cursor: pointer;
	user-select: none;
}

.olc-rx-add-split-label:hover {
	color: var(--olc-rx-text, #1a1f2e);
}

/* Accent colour for all native checkboxes and radio inputs in the prescription form */
.olc-rx-form input[type="checkbox"],
.olc-rx-form input[type="radio"] {
	accent-color: var(--olc-rx-accent, #1a8a4a);
	cursor: pointer;
}

.olc-rx-add-split-toggle {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

/* Shared single field and per-eye split — label above, dropdown below */
.olc-rx-add-field-col label {
	display: block;
	font-size: 0.72em;
	font-weight: 600;
	color: var(--olc-rx-text-lt);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-bottom: 4px;
	white-space: nowrap;
}

/* Split: two side-by-side columns */
.olc-rx-add-split-row {
	display: flex;
	gap: 10px;
}

.olc-rx-add-split-row .olc-rx-add-field-col {
	flex: 1;
	min-width: 0;
}

/* ── ADD + Prism accordions (shared styles) ─────────────────────────────── */
.olc-rx-prism-section {
	margin-bottom: 10px;
}

.olc-rx-add-details,
.olc-rx-prism-details {
	border: 1px solid var(--olc-rx-border);
	border-radius: var(--olc-rx-radius);
	overflow: hidden;
}

.olc-rx-add-summary,
.olc-rx-prism-summary {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	font-size: 0.88em;
	font-weight: 600;
	color: var(--olc-rx-text);
	cursor: pointer;
	list-style: none;
	user-select: none;
	background: var(--olc-rx-bg);
}

.olc-rx-add-summary::-webkit-details-marker,
.olc-rx-prism-summary::-webkit-details-marker { display: none; }

.olc-rx-add-summary::after,
.olc-rx-prism-summary::after {
	content: '›';
	display: inline-block;
	font-size: 1.1em;
	transition: transform .2s;
	color: var(--olc-rx-text-lt);
	flex-shrink: 0;
}

.olc-rx-add-details[open] .olc-rx-add-summary::after,
.olc-rx-prism-details[open] .olc-rx-prism-summary::after {
	transform: rotate(90deg);
}

.olc-rx-add-body,
.olc-rx-prism-body {
	padding: 14px 14px 10px;
	border-top: 1px solid var(--olc-rx-border);
	background: var(--olc-rx-bg);
}

/* ── Field groups ───────────────────────────────────────────────────────── */
.olc-rx-field-group {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.olc-rx-field-group label {
	font-size: 0.78em;
	font-weight: 600;
	color: var(--olc-rx-text-lt);
	text-transform: uppercase;
	letter-spacing: .04em;
}

.olc-rx-field-group label span.olc-rx-optional {
	font-size: 0.78em;
	font-weight: 400;
	color: var(--olc-rx-text-lt);
	text-transform: none;
}

.olc-rx-field {
	padding: 7px 10px !important;
	border: 1px solid var(--olc-rx-border);
	border-radius: 5px;
	font-size: 0.92em;
	background: #fff;
	color: var(--olc-rx-text);
	width: 100%;
	box-sizing: border-box;
	transition: border-color .15s, box-shadow .15s;
}

.olc-rx-field:focus {
	outline: none;
	border-color: var(--olc-rx-primary);
	box-shadow: 0 0 0 3px rgba(44,95,138,.12);
}

/* Select-specific overrides — inherit base .olc-rx-field styles */
select.olc-rx-field,
.olc-rx-select {
	cursor: pointer;
	/* Let the browser render its native dropdown arrow */
	-webkit-appearance: auto;
	appearance: auto;
	/* Extra right padding so text doesn't run under the arrow */
	padding-right: 6px;
}

select.olc-rx-field:focus,
.olc-rx-select:focus {
	outline: none;
	border-color: var(--olc-rx-primary);
	box-shadow: 0 0 0 3px rgba(44,95,138,.12);
}

select.olc-rx-field:disabled,
select.olc-rx-select:disabled {
	opacity: 0.55;
	cursor: not-allowed;
	background: var(--olc-rx-bg, #f8f9fb);
}

.olc-rx-field--sm {
	max-width: 120px;
}

/* ── PD section ─────────────────────────────────────────────────────────── */
.olc-rx-pd-section {
	margin-bottom: 10px;
	padding: 14px 16px;
	background: var(--olc-rx-bg-alt, #f9fafb);
	border: 1px solid var(--olc-rx-border, #e5e7eb);
	border-radius: var(--olc-rx-radius, 8px);
}


/* Label-above layout for PD fields */
.olc-rx-pd-field-col label {
	display: block;
	font-size: 0.72em;
	font-weight: 600;
	color: var(--olc-rx-text-lt);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-bottom: 4px;
	white-space: nowrap;
}

/* Dual PD: two side-by-side columns */
.olc-rx-pd-split-row {
	display: flex;
	gap: 10px;
}

.olc-rx-pd-split-row .olc-rx-pd-field-col {
	flex: 1;
	min-width: 0;
}

/* ── Hidden helper ──────────────────────────────────────────────────────── */
.olc-rx-hidden {
	display: none !important;
}

/* ── Image upload area ──────────────────────────────────────────────────── */
.olc-rx-upload-area {
	display: flex;
	flex-direction: column;
}

.olc-rx-image-input {
	display: block;
	width: 100%;
	padding: 0;
	border: 1px solid var(--olc-rx-border, #dde1e7);
	border-radius: var(--olc-rx-radius, 8px);
	background: var(--olc-rx-bg, #f8f9fb);
	font-size: 0.875em;
	color: var(--olc-rx-text-lt, #6b7280);
	cursor: pointer;
	overflow: hidden;
}

.olc-rx-image-input::file-selector-button {
	background: var(--olc-rx-primary, #2c5f8a);
	color: #fff;
	border: none;
	border-right: 1px solid var(--olc-rx-border, #dde1e7);
	padding: 9px 16px;
	font-size: 1em;
	font-weight: 600;
	cursor: pointer;
	margin-right: 12px;
	transition: background 0.15s;
}

.olc-rx-image-input:hover::file-selector-button {
	background: var(--olc-rx-accent, #1a8a4a);
}

.olc-rx-image-preview {
	position: relative;
	display: inline-block;
}

.olc-rx-image-preview[hidden] {
	display: none;
}

.olc-rx-preview-img {
	max-width: 160px;
	/* max-height: 120px; */
	border: 1px solid var(--olc-rx-border);
	border-radius: 5px;
	display: block;
}

.olc-rx-remove-image-btn {
	position: absolute;
	top: -8px;
	right: -8px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	border: none;
	background: var(--olc-rx-danger);
	color: #fff;
	font-size: 12px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12px;
}

.olc-rx-existing-image {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	font-size: 0.9em;
}

.olc-rx-remove-existing-label {
	display: flex;
	align-items: center;
	gap: 5px;
	cursor: pointer;
	color: var(--olc-rx-danger);
}

/* ── Form actions ───────────────────────────────────────────────────────── */
.olc-rx-form-actions {
	display: flex;
	gap: 10px;
	align-items: center;
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid var(--olc-rx-border);
	flex-wrap: wrap;
}

/* ── Validation message ─────────────────────────────────────────────────── */
.olc-rx-validation-msg {
	margin: 12px 0 0;
	padding: 10px 14px;
	background: var(--olc-rx-danger-lt);
	border-left: 3px solid var(--olc-rx-danger);
	border-radius: 4px;
	color: var(--olc-rx-danger);
	font-size: 0.9em;
}

/* ── Divider ────────────────────────────────────────────────────────────── */
.olc-rx-divider {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 16px 0;
	color: var(--olc-rx-text-lt);
	font-size: 0.85em;
}

.olc-rx-divider::before,
.olc-rx-divider::after {
	content: '';
	flex: 1;
	height: 1px;
	background: var(--olc-rx-border);
}

/* ── Prescription tabs / segmented control ──────────────────────────────── */
.olc-rx-tabs {
	display: flex;
	gap: 8px;
	background: var(--olc-rx-bg-alt, #f9fafb);
	margin-bottom: 16px;
}

.olc-rx-tab-btn {
	flex: 1;
	padding: 8px 12px;
	border: none;
	border-radius: 6px;
	background: transparent;
	color: var(--olc-rx-text-lt, #6b7280);
	font-size: 0.875em;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.15s, color 0.15s, box-shadow 0.15s;
	white-space: nowrap;
	line-height: 1.4;
}

.olc-rx-tab-btn:hover:not(.is-active) {
	background: var(--olc-rx-bg, #fff);
	color: var(--olc-rx-text, #111);
}

.olc-rx-tab-btn.is-active {
	background: var(--olc-rx-accent, #1a7b4f);
	color: #fff;
	box-shadow: 0 1px 3px rgba(0,0,0,.12);
}

.olc-rx-tab-panel[hidden] {
	display: none;
}

/* ── Saved prescription panel (inside configurator) ────────────────────── */
.olc-rx-saved-selector[hidden],
.olc-rx-saved-empty[hidden] {
	display: none;
}

.olc-rx-saved-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	padding: 12px 0;
	text-align: center;
}

.olc-rx-saved-empty p {
	margin: 0;
	color: var(--olc-rx-text-lt, #6b7280);
	font-size: 0.9em;
}

.olc-rx-saved-label {
	display: block;
	font-size: 0.88em;
	font-weight: 600;
	color: var(--olc-rx-text);
	margin: 0 0 10px;
}

/* ── Saved prescriptions timeline (General theme via --olc-rx-* / --olc-*) ─ */
.olc-rx-saved-timeline {
	list-style: none;
	margin: 0 auto;
	padding: 8px 0 0;
	max-width: 42rem;
}

.olc-rx-saved-timeline-status {
	margin: 0;
	padding: 8px 0 4px;
	font-size: 0.9em;
	color: var(--olc-rx-text-lt);
}

.olc-rx-saved-timeline-status--error {
	color: var(--olc-rx-danger, #c0392b);
	font-weight: 500;
}

.olc-rx-saved-timeline-item {
	position: relative;
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0 0 1rem 1rem;
}

.olc-rx-saved-timeline-item:last-child {
	padding-bottom: 0;
}

/* Vertical connector */
.olc-rx-saved-timeline-line {
	position: absolute;
	left: calc(0.25rem - 0.5px);
	top: 0;
	bottom: 0;
	width: 1px;
	background: var(--olc-rx-border);
	opacity: 0.9;
}

.olc-rx-saved-timeline-item:first-child .olc-rx-saved-timeline-line {
	top: 12px;
}

.olc-rx-saved-timeline-item:last-child .olc-rx-saved-timeline-line {
	bottom: auto;
	height: 14px;
}

/* Dot */
.olc-rx-saved-timeline-dot {
	position: absolute;
	left: 0;
	top: 8px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	border: 2px solid var(--olc-rx-primary);
	background: var(--olc-rx-bg-alt, #f9fafb);
	box-sizing: border-box;
}

/* Card: info + actions */
.olc-rx-saved-timeline-card {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--olc-rx-border);
	border-radius: var(--olc-rx-radius, 8px);
	background: var(--olc-surface, #fff);
	box-sizing: border-box;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

@supports not (border-color: color-mix(in srgb, white 50%, black)) {
	.olc-rx-saved-timeline-item:hover .olc-rx-saved-timeline-card {
		border-color: var(--olc-rx-primary);
	}
}

.olc-rx-saved-timeline-body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0;
	text-align: left;
}

.olc-rx-saved-timeline-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-top: 12px;
	padding-top: 10px;
	border-top: 1px solid var(--olc-rx-border);
}

.olc-rx-saved-apply-btn,
.olc-rx-saved-delete-btn {
	margin: 0;
	padding: 8px 14px;
	font-size: 0.8125rem;
	font-weight: 600;
	font-family: inherit;
	line-height: 1.25;
	border-radius: 6px;
	cursor: pointer;
	border: 1px solid transparent;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.olc-rx-saved-apply-btn {
	background: var(--olc-rx-accent);
	border-color: var(--olc-rx-accent);
	color: #fff;
}

.olc-rx-saved-apply-btn:hover:not(:disabled) {
	filter: brightness(0.95);
}

.olc-rx-saved-apply-btn:focus {
	outline: none;
}

.olc-rx-saved-apply-btn:focus-visible {
	outline: 2px solid var(--olc-rx-primary);
	outline-offset: 2px;
}

.olc-rx-saved-delete-btn {
	background: transparent;
	border-color: var(--olc-rx-border);
	color: var(--olc-rx-primary, #2c5f8a);
}

.olc-rx-saved-delete-btn:hover:not(:disabled) {
	background: var(--olc-rx-primary-lt, #e8f2fb);
	border-color: var(--olc-rx-primary, #2c5f8a);
	color: var(--olc-rx-primary, #2c5f8a);
}

.olc-rx-saved-delete-btn:focus {
	outline: none;
}

.olc-rx-saved-delete-btn:focus-visible {
	outline: 2px solid var(--olc-rx-primary, #2c5f8a);
	outline-offset: 2px;
}

.olc-rx-saved-apply-btn:disabled,
.olc-rx-saved-delete-btn:disabled {
	opacity: 0.65;
	cursor: not-allowed;
}

/* Line 1: prescription name */
.olc-rx-saved-timeline-heading {
	display: block;
	margin-top: 2px;
}

.olc-rx-saved-timeline-name {
	display: block;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.35;
	color: var(--olc-rx-text);
}

/* Line 2: date + glasses type badges under the name */
.olc-rx-saved-timeline-badges {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 8px;
	margin-top: 8px;
}

.olc-rx-saved-timeline-date-badge,
.olc-rx-saved-timeline-type-badge {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
	padding: 3px 9px;
	border-radius: 999px;
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.03em;
	line-height: 1.2;
	white-space: nowrap;
}

.olc-rx-saved-timeline-date-badge {
	background: var(--olc-rx-primary-lt, #e8f2fb);
	color: var(--olc-rx-primary);
	border: 1px solid var(--olc-rx-primary);
}

.olc-rx-saved-timeline-type-badge {
	background: var(--olc-rx-bg-alt, #f3f4f6);
	color: var(--olc-rx-text-lt, #4b5563);
	border: 1px solid var(--olc-rx-border, #dde1e7);
}

/* Line 3: prescription summary */
.olc-rx-saved-timeline-summary {
	font-size: 0.8125rem;
	color: var(--olc-rx-text-lt);
	line-height: 1.45;
	margin-top: 10px;
}

.olc-rx-saved-timeline-summary[hidden] {
	display: none !important;
}

/* ── Configurator: rx area (wraps trigger + applied card) ───────────────── */
.olc-rx-area {
	margin-top: 18px;
}

.olc-rx-area[hidden] {
	display: none !important;
}

/* Trigger button — shown when no prescription is applied */
.olc-rx-trigger {
	display: flex;
	align-items: center;
}

.olc-rx-trigger[hidden] {
	display: none !important;
}

.olc-rx-trigger-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 20px;
	border: 2px dashed var(--olc-accent, #1a8a4a);
	border-radius: var(--olc-card-radius, 10px);
	background: var(--olc-rx-primary-lt, #e8f2fb);
	color: var(--olc-accent, #1a8a4a);
	font-size: 0.95em;
	font-weight: 600;
	cursor: pointer;
	transition: background .2s, color .2s, border-style .2s;
}

.olc-rx-trigger-btn:hover,
.olc-rx-trigger-btn:focus-visible {
	background: var(--olc-accent-lt, #e6f4ec);
	border-style: solid;
	outline: none;
	color: var(--olc-rx-primary, #2c5f8a);
}

.olc-rx-trigger-btn .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	line-height: 1;
}

/* Applied card — shown after a prescription is saved / applied */
.olc-rx-applied-card {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding: 12px 16px;
	background: var(--olc-accent-lt, #e6f4ec);
	border: 1.5px solid var(--olc-accent, #1a8a4a);
	border-radius: var(--olc-card-radius, 10px);
	flex-wrap: wrap;
}

.olc-rx-applied-card[hidden] {
	display: none !important;
}

.olc-rx-applied-info {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 1 1 auto;
	min-width: 0;
}

.olc-rx-applied-icon {
	font-size: 22px;
	width: 22px;
	height: 22px;
	color: var(--olc-accent, #1a8a4a);
	flex-shrink: 0;
}

.olc-rx-applied-details {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.olc-rx-applied-title {
	font-size: 0.95em;
	font-weight: 600;
	color: var(--olc-fg, #1a1a1a);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.olc-rx-applied-summary {
	font-size: 0.82em;
	color: var(--olc-muted, #6b7280);
	max-width: 100%;
}

.olc-rx-applied-summary .olc-rx-summary-details,
.olc-rx-applied-summary .olc-rx-summary-compact {
	font-size: inherit;
	color: inherit;
}

.olc-rx-applied-summary .prescription-label {
	color: var(--olc-fg, #1a1a1a);
}

.olc-rx-applied-summary .prescription-value {
	color: var(--olc-muted, #6b7280);
}

.olc-rx-applied-summary .olc-rx-summary-eye-title {
	color: var(--olc-fg, #1a1a1a);
}

.olc-rx-applied-summary .olc-rx-summary-eye-line {
	color: var(--olc-muted, #6b7280);
}

.olc-rx-applied-summary .olc-rx-summary-k {
	color: var(--olc-fg, #1a1a1a);
}

.olc-rx-applied-summary .olc-rx-summary-line {
	color: var(--olc-muted, #6b7280);
	margin: 0 !important;
}

.olc-rx-applied-summary .olc-rx-summary-subhead {
	color: var(--olc-fg, #1a1a1a);
}

.olc-rx-applied-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
}

.olc-rx-change-btn {
	font-size: 0.88em;
	padding: 6px 14px;
}

.olc-rx-remove-btn {
	background: none;
	border: none;
	padding: 4px 0;
	font-size: 0.85em;
	color: var(--olc-rx-primary, #2c5f8a);
	cursor: pointer;
	text-decoration: underline;
	transition: opacity .15s;
}

.olc-rx-remove-btn:hover,
.olc-rx-remove-btn:focus-visible {
	opacity: 0.75;
	outline: none;
}

/* ── Configurator: prescription modal overlay ───────────────────────────── */
.olc-rx-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, .55);
	z-index: 99998;
	display: flex;
	justify-content: center;
	padding: 16px;
	padding-top: 2.25em;
}

.olc-rx-modal-overlay[hidden] {
	display: none;
}

.olc-rx-modal {
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 12px 48px rgba(0, 0, 0, .22);
	width: 100%;
	max-width: 700px;
	max-height: 92vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

/* Header */
.olc-rx-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 24px 14px;
	background: var(--olc-rx-bg-alt, #f9fafb);
	border-bottom: 1px solid var(--olc-rx-border, #e5e7eb);
	flex-shrink: 0;
}

.olc-rx-modal-header h4 {
	margin: 0;
	font-size: 1.1em;
	font-weight: 700;
	color: var(--olc-rx-text, #1a1f2e);
}

.olc-rx-modal-close {
	background: none;
	border: none;
	font-size: 1.3em;
	line-height: 1;
	cursor: pointer;
	color: #6b7280;
	padding: 4px 8px;
	border-radius: 6px;
	transition: background .15s, color .15s;
}

.olc-rx-modal-close:hover,
.olc-rx-modal-close:focus-visible {
	background: #f3f4f6;
	color: #111827;
	outline: none;
}

/* Body (scrollable) */
.olc-rx-modal-body {
	overflow-y: auto;
	padding: 20px 24px;
	flex: 1 1 auto;
}

.olc-rx-modal-body .olc-rx-form {
	border: none;
	padding: 0;
	box-shadow: none;
}

/* Footer */
.olc-rx-modal-footer {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 14px 24px 18px;
	background: var(--olc-rx-bg-alt, #f9fafb);
	border-top: 1px solid var(--olc-rx-border, #e5e7eb);
	flex-shrink: 0;
}

/* Hidden while Saved Prescriptions tab is active (save/skip actions live on manual tab only). */
.olc-rx-modal-footer[hidden] {
	display: none !important;
}

/* Source indicator bar */
.olc-rx-source-bar {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 10px;
	background: var(--olc-accent-lt, #e6f4ec);
	border: 1px solid var(--olc-accent, #1a8a4a);
	border-radius: 6px;
	font-size: 0.82em;
	color: #166534;
}

.olc-rx-source-bar[hidden] { display: none !important; }

.olc-rx-source-label {
	flex: 1;
	font-weight: 500;
}

.olc-rx-source-clear {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 0.9em;
	color: #166534;
	line-height: 1;
	padding: 2px 4px;
	border-radius: 4px;
	opacity: .7;
	transition: opacity .15s;
}

.olc-rx-source-clear:hover { opacity: 1; }

/* Action rows */
.olc-rx-footer-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.olc-rx-footer-actions[hidden] { display: none !important; }

/* "Save as New" is disabled until the form is actually changed */
.olc-rx-footer-loaded [data-mode="new"]:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

/* Ghost button style (Skip in loaded mode) */
.olc-btn-ghost {
	background: none;
	border: none;
	color: var(--olc-rx-text-lt, #6b7280);
	font-size: 0.88em;
	padding: 6px 10px;
	cursor: pointer;
	border-radius: 6px;
	transition: color .15s;
}

.olc-btn-ghost:hover { color: var(--olc-rx-text, #1a1f2e); }

@media (max-width: 768px) {
	.olc-rx-footer-actions {
		flex-direction: column;
		align-items: stretch;
	}

	.olc-rx-footer-actions .olc-btn {
		text-align: center;
		justify-content: center;
	}
}

/* ── Delete confirmation modal ──────────────────────────────────────────── */
.olc-rx-delete-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,.5);
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.olc-rx-delete-overlay[hidden] {
	display: none !important;
}

.olc-rx-delete-modal {
	background: #fff;
	border-radius: 10px;
	padding: 28px 32px;
	max-width: 420px;
	width: 90%;
	box-shadow: 0 8px 32px rgba(0,0,0,.18);
}

.olc-rx-delete-modal h4 {
	margin: 0 0 12px;
	font-size: 1.05em;
	font-weight: 700;
	color: var(--olc-rx-danger);
}

.olc-rx-delete-modal p {
	margin: 0 0 20px;
	color: var(--olc-rx-text);
	font-size: 0.93em;
	line-height: 1.55;
}

.olc-rx-delete-actions {
	display: flex;
	gap: 10px;
	justify-content: flex-end;
}

body.olc-rx-modal-open {
	overflow: hidden;
}

/* ── Add button ─────────────────────────────────────────────────────────── */
.olc-rx-add-btn {
	font-size: 0.9em;
}
