/*
	ONLINE REGISTRATION (native web app screen)

	One stylesheet for online registration in the CompOrganizer web app, the same on every
	competition. The only per-site input is the palette, set as CSS variables on <html> by
	setThemeVariables() in js/main.js:
		--m-bg, --m-text, --m-accent, --m-overlay, --m-btn1, --m-btn2, --m-btn-text
	and html[data-surface="dark" | "light"], worked out from the background color.

	The markup comes from CompOrganizer's own reg pages (/co/online-registration/pages/*.php),
	shared with the full site. This file replaces Bootstrap's CSS and comporganizer.css for
	them, so it also carries the few Bootstrap pieces the pages rely on (modals, tooltips,
	.fade/.show, .text-center) and the show/hide rules the reg JS depends on.
	Everything is scoped to #online-reg, the reg modals, or elements the reg pages create.
*/

:root {
	--m-bg:#fff;
	--m-text:#000;
	--m-accent:#006ca3;
	--m-accent-text:var(--m-accent); /* the accent when it's readable as text, otherwise the text color (set in main.js) */
	--m-overlay:rgba(0,0,0,0.15);
	--m-card-solid:#d9d9d9; /* overlay laid over the background (set in main.js) */
	--m-btn1:#49c1ff;
	--m-btn2:#006ca3;
	--m-btn-text:#fff;

	/* derived from the palette (no extra colors needed per site) */
	--orm-line:color-mix(in srgb, var(--m-text) 18%, transparent);
	--orm-line-strong:color-mix(in srgb, var(--m-text) 35%, transparent);
	--orm-muted:color-mix(in srgb, var(--m-text) 68%, transparent);
	--orm-tint:color-mix(in srgb, var(--m-text) 7%, transparent);
	--orm-field:color-mix(in srgb, var(--m-text) 6%, var(--m-bg));
	--orm-sheet:var(--m-bg);
	--orm-card:var(--m-overlay);
	--orm-btn:linear-gradient(to bottom, var(--m-btn1), var(--m-btn2));
	--orm-chip:color-mix(in srgb, var(--m-btn1) 50%, var(--m-btn2));

	/* fixed meanings, the same everywhere */
	--orm-danger:#d93025;
	--orm-success:#2e8b3d;
	--orm-warning:#e0a000;

	--orm-radius:14px;
	--orm-radius-sm:10px;
	--orm-gutter:16px;
	--orm-tap:46px;
}
html[data-surface="dark"] {color-scheme:dark;}
html[data-surface="light"] {color-scheme:light;}

/* SCREEN */

body.orm-active #heat-counter {display:none !important;}

#online-reg .content.orm-content {
	display:block;
	width:100%;
	max-width:640px;
	margin:0 auto;
	padding:0 var(--orm-gutter) calc(120px + env(safe-area-inset-bottom));
	box-sizing:border-box;
	color:var(--m-text);
	font-size:16px;
	line-height:1.4;
	text-align:left;
}
#online-reg .content.orm-content *,
#online-reg .content.orm-content *::before,
#online-reg .content.orm-content *::after,
.modal, .modal *, .modal *::before, .modal *::after,
#activity-panel, #activity-panel * {box-sizing:border-box;}

#online-reg .orm-content a, .modal a {color:var(--m-accent-text);}
#online-reg .orm-content h2, #online-reg .orm-content h3, .modal h3, .modal h4 {
	color:inherit;
	font-weight:700;
	line-height:1.2;
}
#online-reg .orm-content p {margin:0 0 12px 0;}
.noselect {-webkit-user-select:none; user-select:none;}
.text-center {text-align:center !important;}
#online-reg .orm-content .error, .modal .error, #online-reg .orm-content .errmsg {color:var(--orm-danger);}
#online-reg input[type="checkbox"], .modal input[type="checkbox"] {
	accent-color:var(--m-accent);
	width:18px; height:18px;
	margin:0;
	flex:0 0 auto;
}

#online-reg .orm-unavailable {text-align:center; padding:40px 0 20px;}
#online-reg button.orm-retry {display:block; margin:0 auto;}

/* BUTTONS (overrides the app's global button style inside reg) */

#online-reg .orm-content button, #online-reg .orm-content .button,
.modal button, .modal .button {
	display:inline-flex;
	align-items:center;
	justify-content:center;
	gap:8px;
	height:auto;
	min-height:var(--orm-tap);
	line-height:1.2;
	padding:10px 18px;
	border:none;
	border-radius:var(--orm-radius-sm);
	background:var(--orm-btn);
	color:var(--m-btn-text);
	font-family:inherit;
	font-size:1rem;
	font-weight:600;
	white-space:normal;
	text-align:center;
	text-decoration:none;
	cursor:pointer;
	box-shadow:none;
	-webkit-tap-highlight-color:transparent;
	transition:filter 0.15s ease, opacity 0.15s ease;
}
#online-reg .orm-content button:active, .modal button:active {filter:brightness(0.92);}
#online-reg .orm-content button[disabled], .modal button[disabled],
#online-reg .orm-content button.disabled, .modal button.disabled {opacity:0.5; pointer-events:none;}
#online-reg .orm-content button *, .modal button * {color:inherit;}
#online-reg .orm-content .btn-none, .modal .btn-none {
	background:none;
	border:1.5px solid var(--orm-line-strong);
	color:var(--m-text);
}
#online-reg .orm-content .btn-sm, .modal .btn-sm {min-height:40px; padding:8px 14px; font-size:0.95rem;}
#online-reg .orm-content .btn-lg, .modal .btn-lg {min-height:54px; font-size:1.1rem;}

/* FORM FIELDS */

#online-reg .orm-content input[type="text"], #online-reg .orm-content input[type="email"],
#online-reg .orm-content input[type="password"], #online-reg .orm-content input[type="tel"],
#online-reg .orm-content input[type="number"], #online-reg .orm-content input[type="date"],
#online-reg .orm-content select, #online-reg .orm-content textarea,
.modal input[type="text"], .modal input[type="email"], .modal input[type="password"],
.modal input[type="tel"], .modal input[type="number"], .modal input[type="date"],
.modal select, .modal textarea {
	width:100%;
	min-height:var(--orm-tap);
	margin:0;
	padding:10px 12px;
	border:1px solid var(--orm-line-strong);
	border-radius:var(--orm-radius-sm);
	background-color:var(--orm-field);
	color:var(--m-text);
	font-family:inherit;
	font-size:16px; /* 16px stops iOS zooming in on focus */
	line-height:1.25;
	box-shadow:none;
	-webkit-appearance:none;
	appearance:none;
}
#online-reg .orm-content select, .modal select {
	padding-right:34px;
	background-image:linear-gradient(45deg, transparent 50%, var(--orm-muted) 50%), linear-gradient(135deg, var(--orm-muted) 50%, transparent 50%);
	background-position:calc(100% - 18px) 50%, calc(100% - 13px) 50%;
	background-size:5px 5px, 5px 5px;
	background-repeat:no-repeat;
}
#online-reg .orm-content select option, .modal select option {background-color:var(--m-bg); color:var(--m-text);}
#online-reg .orm-content textarea, .modal textarea {min-height:120px; resize:vertical;}
#online-reg .orm-content input:focus, #online-reg .orm-content select:focus, #online-reg .orm-content textarea:focus,
.modal input:focus, .modal select:focus, .modal textarea:focus {
	outline:none;
	border-color:var(--m-accent);
	box-shadow:0 0 0 3px color-mix(in srgb, var(--m-accent) 30%, transparent);
}
#online-reg .orm-content input.error, #online-reg .orm-content select.error,
.modal input.error, .modal select.error {border-color:var(--orm-danger);}
#online-reg .orm-content ::placeholder, .modal ::placeholder {color:var(--orm-muted); opacity:1;}
.custom-select {position:relative; display:block; width:100%;}

/* .form-row / .form-col: label comes after the input in the markup, shown above it here */
#online-reg .form-row, .modal .form-row {
	display:flex;
	flex-direction:row;
	flex-wrap:wrap;
	gap:0 12px;
	margin:0;
}
#online-reg .form-col, .modal .form-col {
	display:flex;
	flex-direction:column-reverse;
	justify-content:flex-end;
	flex:1 1 140px;
	min-width:0;
	margin:0 0 14px 0;
	position:relative;
}
#online-reg .form-row label, .modal .form-row label {
	display:block;
	margin:0 0 5px 2px;
	font-size:0.8rem;
	font-weight:600;
	color:var(--orm-muted);
}
#online-reg .form-col:focus-within label, .modal .form-col:focus-within label {color:var(--m-accent-text);}
#online-reg .form-row label.error, .modal .form-row label.error {color:var(--orm-danger);}
#orv2 .status-A.am-required label:after, #orv2 .status-P.pro-required label:after,
#orv2 .status-B.other-required label:after, #orv2 .status-S.other-required label:after {content:" (required)";}
#orv2 .status-A.am-required label.error:after, #orv2 .status-P.pro-required label.error:after,
#orv2 .status-B.other-required label.error:after, #orv2 .status-S.other-required label.error:after {content:"";}

/* LOADING INDICATOR */

#or-loading-container {position:fixed; left:0; right:0; top:50%; z-index:1100; pointer-events:none; display:flex; justify-content:center;}
#or-loading {
	display:flex;
	align-items:center;
	gap:10px;
	padding:12px 18px;
	border-radius:999px;
	background:rgba(0,0,0,0.75);
	color:#fff;
	font-size:0.95rem;
	backdrop-filter:blur(6px);
	-webkit-backdrop-filter:blur(6px);
}

/* LOGIN */

#online-reg .co-login-window {padding:28px 0 8px;}
#online-reg .co-login-headline {font-size:1.6rem; font-weight:700; margin:0 0 18px; color:var(--m-text);}
#online-reg .co-login-row {display:flex; flex-direction:column; margin-bottom:14px;}
#online-reg .co-login-row label {font-size:0.8rem; font-weight:600; color:var(--orm-muted); margin:0 0 5px 2px;}
#online-reg .co-login-button-container {display:flex; flex-direction:column; gap:10px; margin-top:20px;}
#online-reg .co-login-button-container button {width:100%;}
#online-reg #co-signup-submit {background:none; border:1.5px solid var(--orm-line-strong); color:var(--m-text);}
#online-reg .co-login-forgot {text-align:center; margin:16px 0 0;}
#online-reg .co-login-forgot a {text-decoration:none; font-weight:600;}
#online-reg #co-login-errmsg {margin:10px 0 0; font-weight:600;}
#online-reg #orv2-login-message {
	margin:8px 0 0;
	padding:14px;
	border-radius:var(--orm-radius);
	background:var(--orm-card);
	border:1px solid var(--orm-line);
	font-size:0.95rem;
}
#online-reg #orv2-login-message > :last-child {margin-bottom:0;}

#online-reg .orv2-closed {
	margin:28px 0;
	padding:24px 18px;
	text-align:center;
	border-radius:var(--orm-radius);
	background:var(--orm-card);
	border:1px solid var(--orm-line);
}
#online-reg .orv2-closed h3 {margin:0 0 10px; font-size:1.4rem;}
#online-reg .orv2-closed p:last-child {margin-bottom:0;}

/* SIGN UP (CompRegister in an iframe sheet) */

#co-signup-modal {
	position:fixed;
	inset:0;
	z-index:1060;
	display:flex;
	flex-direction:column;
	justify-content:flex-end;
	background:rgba(0,0,0,0.55);
	transition:opacity 0.25s ease;
}
#co-signup-modal.start-hidden {opacity:0;}
#co-signup-frame {
	display:block;
	width:100%;
	height:calc(100% - 44px - env(safe-area-inset-top));
	border:none;
	border-radius:16px 16px 0 0;
	background:#fff;
	transition:transform 0.25s ease-out;
}
#co-signup-modal.start-hidden #co-signup-frame {transform:translateY(100%);}
.co-signup-close {position:relative; height:0; overflow:visible; z-index:2;}
.co-signup-close span {
	position:absolute;
	right:10px; top:10px;
	width:34px; height:34px;
	display:flex; align-items:center; justify-content:center;
	border-radius:50%;
	background:rgba(0,0,0,0.6);
	color:#fff;
	font-size:1rem;
	cursor:pointer;
}

/* REG MENU (Invoice / Entry Form / Purchases / Log Out): segmented control, sticky under the navbar */

#online-reg .orv2-menu {
	position:sticky;
	top:0;
	z-index:20;
	display:flex;
	align-items:stretch;
	gap:4px;
	margin:0 calc(var(--orm-gutter) * -1) 18px;
	padding:10px var(--orm-gutter);
	background:linear-gradient(var(--orm-card), var(--orm-card)), var(--m-bg);
	border-bottom:1px solid var(--orm-line);
	box-shadow:0 4px 12px rgba(0,0,0,0.12);
}
#online-reg .orv2-menu a {
	flex:1 1 0;
	min-width:0;
	display:flex;
	flex-direction:column;
	align-items:center;
	justify-content:center;
	gap:4px;
	min-height:52px;
	padding:6px 4px;
	border-radius:var(--orm-radius-sm);
	color:var(--m-text);
	opacity:0.8;
	font-size:0.78rem;
	font-weight:600;
	text-decoration:none;
	white-space:nowrap;
	-webkit-tap-highlight-color:transparent;
}
#online-reg .orv2-menu a span {overflow:hidden; text-overflow:ellipsis; max-width:100%; border:none;}
#online-reg .orv2-menu a i {font-size:1.15rem;}
#online-reg .orv2-menu a.selected {background:var(--orm-btn); color:var(--m-btn-text); opacity:1; cursor:default; box-shadow:0 2px 6px rgba(0,0,0,0.2);}
#online-reg .orv2-menu a.logout-link {flex:0 0 48px;}
#online-reg .orv2-menu a.logout-link span {display:none;}
#online-reg #or-menu-message {
	margin:0 0 18px;
	padding:12px 14px;
	border-radius:var(--orm-radius);
	background:var(--orm-card);
	border:1px solid var(--orm-line);
	font-size:0.95rem;
}

/* SECTIONS AND CARDS */

#online-reg .orv2-headline {font-size:1.3rem; font-weight:700; text-align:left; margin:0 0 10px;}
#online-reg .orv2-invoice-container {margin-bottom:26px;}
#online-reg #or-invoice-entries, #online-reg #or-invoice-purchases, #online-reg #or-invoice-payments,
#online-reg #or-invoice-summary, #online-reg #orv2-invoice-gatekeeper,
#online-reg #orv2-entry-form, #online-reg #orv2-purchase-form, #online-reg #new-competitor,
#online-reg .age-restriction-warning {
	--orm-field:color-mix(in srgb, var(--m-text) 6%, var(--m-card-solid)); /* fields follow the card they sit on */
	width:100%;
	padding:14px;
	border-radius:var(--orm-radius);
	background:var(--orm-card);
	border:1px solid var(--orm-line);
}
#online-reg #orv2-invoice-gatekeeper:empty {display:none;}
#online-reg .orv2-invoice-container > button {width:100%; margin-top:10px;}
#online-reg .orv2-empty-content {display:block; text-align:center; padding:18px 0; color:var(--orm-muted);}
#online-reg .orv2-empty-content a {display:block; margin-top:6px; font-weight:600;}

/* INVOICE */

#online-reg .or-invoice-content ul {list-style:none; margin:0; padding:0;}
#online-reg .team-entries, #online-reg .recipient-purchases {margin-bottom:20px;}
#online-reg .team-entries:last-child, #online-reg .recipient-purchases:last-child {margin-bottom:0;}
#online-reg .team-header, #online-reg .recipient-header {
	display:flex;
	align-items:flex-start;
	justify-content:space-between;
	gap:10px;
	padding-bottom:8px;
	margin-bottom:4px;
	border-bottom:1px solid var(--orm-line-strong);
}
#online-reg .team-header-names, #online-reg .recipient-name {display:flex; align-items:flex-start; gap:10px; min-width:0; flex:1;}
#online-reg .team-header-names input, #online-reg .recipient-name input {margin-top:2px;}
#online-reg .team-member-name, #online-reg .recipient-name > span {display:flex; flex-direction:column; min-width:0; font-weight:700; color:var(--m-accent-text);}
#online-reg .team-member-name span {overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
#online-reg .team-member-name b {display:none;}
#online-reg .team-subtotal, #online-reg .recipient-subtotal {display:flex; flex-direction:column; align-items:flex-end; flex:0 0 auto; text-align:right;}
#online-reg .team-subtotal small, #online-reg .recipient-subtotal small {font-size:0.7rem; font-weight:700; text-transform:uppercase; letter-spacing:0.04em; color:var(--orm-muted);}
#online-reg .team-subtotal span, #online-reg .recipient-subtotal span {font-weight:700;}

#online-reg .or-invoice-content ul li {
	display:flex;
	align-items:flex-start;
	justify-content:space-between;
	gap:10px;
	padding:10px 0;
	border-bottom:1px solid var(--orm-line);
	cursor:pointer;
	-webkit-tap-highlight-color:transparent;
}
#online-reg .or-invoice-content ul li:last-child {border-bottom:none;}
#online-reg .or-invoice-content ul li > div:nth-child(2) {display:none;} /* status column: too wide for phones */
#online-reg .or-invoice-content ul li > div:last-child {flex:0 0 auto; text-align:right; font-weight:700; white-space:nowrap;}
#online-reg .or-invoice-content ul li.billthem > div:last-child {font-weight:400; font-style:italic; color:var(--orm-muted); white-space:normal; max-width:40%;}
#online-reg .invoice-description {display:flex; flex-wrap:wrap; align-items:flex-start; gap:4px 10px; min-width:0; flex:1;}
#online-reg .invoice-description > span:first-child {display:flex; padding-top:1px;}
#online-reg .invoice-description input {margin-top:1px;}
#online-reg .invoice-description-inner {flex:1; min-width:0; overflow-wrap:anywhere;}
#online-reg .invoice-description-note {flex-basis:100%; padding-left:28px; font-size:0.85rem; font-style:italic; color:var(--orm-muted);}
#online-reg .entry-ctype {
	align-self:center;
	padding:1px 7px;
	border-radius:999px;
	background:var(--m-accent-text);
	color:var(--m-bg);
	font-size:0.7rem;
	font-weight:700;
}
#online-reg .is-solo .entry-ctype {display:none;}
#online-reg .or-invoice-content li.entry-dropped, #online-reg .or-invoice-content li.item-dropped {opacity:0.5;}
#online-reg li.entry-dropped .invoice-description-inner, #online-reg li.item-dropped .invoice-description-inner,
#online-reg li.entry-dropped .entry-subtotal, #online-reg li.item-dropped .purchase-subtotal {text-decoration:line-through;}
#online-reg .purchase-note-icon {font-size:1.1rem; opacity:0.35; padding:0 2px;}
#online-reg .purchase-note-icon.has-notes {opacity:1; color:var(--m-accent-text);}
#online-reg a.or-add-link {display:inline-flex; align-items:center; gap:8px; margin-top:10px; font-weight:600; text-decoration:none;}

/* payments: shown as date + method on the left, amount on the right (No., Type and Receipt # are hidden) */
#online-reg #or-invoice-payments .or-invoice-content ul li {
	display:grid;
	grid-template-columns:1fr auto;
	gap:2px 12px;
	cursor:default;
}
#online-reg #or-invoice-payments .or-invoice-content ul li:first-child {display:none;} /* column headings */
#online-reg #or-invoice-payments .or-invoice-content ul li > div {display:none; text-align:left; font-weight:400;}
#online-reg #or-invoice-payments .or-invoice-content ul li > div:nth-child(2) {display:block; grid-column:1; grid-row:1; font-weight:600;}
#online-reg #or-invoice-payments .or-invoice-content ul li > div:nth-child(4) {display:block; grid-column:1; grid-row:2; font-size:0.85rem; color:var(--orm-muted);}
#online-reg #or-invoice-payments .or-invoice-content ul li > div:nth-child(6) {display:block; grid-column:2; grid-row:1 / span 2; align-self:center; text-align:right; font-weight:700;}

/* summary */
#online-reg #or-invoice-summary .or-invoice-content ul li {cursor:default; padding:8px 0; border-bottom:1px dashed var(--orm-line);}
#online-reg #or-invoice-summary .or-invoice-content ul li > div {display:block;}
#online-reg #or-invoice-summary .or-invoice-content ul li > div:nth-child(2) {display:block;}
#online-reg #or-invoice-summary .or-invoice-content ul {margin-bottom:10px;}
#online-reg #or-invoice-summary .or-payment-container {text-align:center; margin:20px 0 0;}
#online-reg #or-invoice-summary .or-payment-container h1 {display:inline-flex; align-items:flex-start; margin:0 0 14px; font-size:3rem; line-height:1; font-weight:800;}
#online-reg #or-invoice-summary .or-payment-container h1 small {font-size:1.4rem; margin-top:4px;}
#online-reg #or-invoice-summary .or-payment-container button {width:100%;}
#online-reg .or-payment-buttons {display:flex; flex-direction:column; gap:10px;}
#online-reg #or-payment-message, #online-reg .card-fee-message, #online-reg .custom-payment-message {font-size:0.85rem; color:var(--orm-muted); margin-top:14px;}

/* gatekeeper (late-stage requests) */
#online-reg #orv2-invoice-gatekeeper p.gk-intro {display:flex; gap:12px; font-size:0.9rem; margin:0 0 12px;}
#online-reg .gatekeeper-warning-icon {font-size:1.5rem; color:var(--orm-warning); flex-shrink:0;}
#online-reg ul.gk-request-list {list-style:none; margin:0; padding:0;}
#online-reg li.gk-request {display:flex; flex-wrap:wrap; gap:8px 12px; padding:10px 0; border-top:1px solid var(--orm-line);}
#online-reg .gk-request-main {display:flex; gap:10px; flex:1 1 100%; min-width:0;}
#online-reg .gk-request-type {flex-shrink:0; min-width:46px; padding:2px 8px; border-radius:6px; font-size:0.75rem; font-weight:700; text-align:center; color:#fff;}
#online-reg .gk-request-type.gk-add {background:var(--orm-success);}
#online-reg .gk-request-type.gk-drop {background:var(--orm-danger);}
#online-reg .gk-request-text {min-width:0; overflow-wrap:anywhere;}
#online-reg .gk-request-event {font-weight:600;}
#online-reg .gk-request-meta, #online-reg .gk-request-note {font-size:0.85rem; color:var(--orm-muted); margin-top:3px;}
#online-reg .gk-request-note {font-style:italic;}
#online-reg .gk-request-side {display:flex; align-items:center; justify-content:space-between; width:100%; padding-left:56px;}
#online-reg .gk-request-status {font-size:0.9rem; font-weight:700;}
#online-reg .gk-status-0 .gk-request-status {color:var(--orm-warning);}
#online-reg .gk-status-1 .gk-request-status {color:var(--orm-success);}
#online-reg .gk-status-2 .gk-request-status {color:var(--orm-danger);}
#online-reg .orm-content button.gk-withdraw {min-height:34px; padding:4px 12px; font-size:0.8rem; background:none; border:1px solid var(--orm-line-strong); color:var(--m-text);}

/* ACTIVITY PANEL (selection bar on the invoice, running totals + Send on the entry form) */

#activity-panel {
	display:none;
	position:fixed;
	left:10px; right:10px;
	bottom:calc(10px + env(safe-area-inset-bottom));
	z-index:900;
	padding:10px 12px;
	border-radius:var(--orm-radius);
	background:var(--m-text);
	color:var(--m-bg);
	box-shadow:0 8px 30px rgba(0,0,0,0.35);
	font-size:0.9rem;
}
body:not(.orm-active) > #activity-panel {display:none !important;}
#activity-panel * {color:var(--m-bg);}
#activity-panel-inner {display:flex; align-items:center; justify-content:space-between; gap:10px; min-height:46px;}
#activity-panel-inner > div {display:flex; align-items:center; gap:6px; line-height:1.15;}
#activity-panel-inner > div:first-child span {font-weight:600;}
#activity-panel strong {
	display:inline-flex; align-items:center; justify-content:center;
	min-width:32px; min-height:32px;
	border-radius:50%;
	background:color-mix(in srgb, var(--m-bg) 22%, transparent);
	font-size:1.1rem;
	font-weight:800;
}
#activity-panel button {
	display:inline-flex; align-items:center; justify-content:center;
	min-height:42px;
	height:auto;
	margin:0;
	padding:8px 14px;
	border:1.5px solid color-mix(in srgb, var(--m-bg) 70%, transparent);
	border-radius:var(--orm-radius-sm);
	background:none;
	font-family:inherit;
	font-size:0.9rem;
	font-weight:700;
	line-height:1.1;
	white-space:nowrap;
}
#activity-panel button i {display:none;}
#activity-panel button.disabled {opacity:0.5;}
#or-invoice-activity-panel-actions {display:none;}
#or-invoice-action-modal-launcher {display:flex; gap:8px;}
#ap-total {display:none;}

/* entry form version: tallies (adds / drops / changes) + Send */
#activity-panel.ap-entry-form #activity-panel-inner > div:first-child {flex:1; justify-content:space-around; gap:0;}
#activity-panel.ap-entry-form label {display:flex; flex-direction:column-reverse; align-items:center; margin:0; padding:0 6px; font-size:0.72rem; font-weight:600; text-transform:uppercase; letter-spacing:0.03em;}
#activity-panel.ap-entry-form strong {background:none; min-height:0; font-size:1.2rem;}
#activity-panel.ap-entry-form button {background:var(--m-bg); color:var(--m-text); border:none; min-width:88px; text-transform:uppercase;}
#activity-panel.ap-entry-form button * {color:var(--m-text);}
#activity-panel.ap-entry-form button span span {display:none;}

@keyframes shadow-pulse {
	0% {box-shadow:0 0 0 0 color-mix(in srgb, var(--m-bg) 35%, transparent);}
	100% {box-shadow:0 0 0 24px transparent;}
}
.shadow-pulse {animation:shadow-pulse 1s infinite;}

/* ENTRY FORM: partnership builder */

#online-reg #team-entries > h3 {font-size:1.1rem; text-align:center; margin:16px 0 10px;}
#online-reg .or-category-tabs {
	display:flex;
	gap:4px;
	margin:0 0 16px;
	padding:4px;
	border-radius:var(--orm-radius);
	background:var(--orm-tint);
	border:1px solid var(--orm-line);
}
#online-reg .orm-content .or-category-tabs .or-category-tab {
	flex:1 1 0;
	min-width:0;
	min-height:40px;
	padding:6px 6px;
	border-radius:var(--orm-radius-sm);
	background:none;
	color:var(--m-text);
	font-size:0.9rem;
}
#online-reg .orm-content .or-category-tabs .or-category-tab {white-space:nowrap;}
#online-reg .orm-content .or-category-tabs .or-category-tab i {opacity:0.7;}
@media (max-width:420px) {
	#online-reg .orm-content .or-category-tabs .or-category-tab i {display:none;}
}
#online-reg .orm-content .or-category-tabs .or-category-tab.selected {background:var(--orm-btn); color:var(--m-btn-text); cursor:default;}
#online-reg .orm-content .or-category-tabs .or-category-tab.selected i {opacity:1;}

#online-reg #team-members, #online-reg #purchase-members {display:flex; flex-direction:column; align-items:stretch; gap:10px; position:relative;}
#online-reg #team-members .team-slot-joiner {display:none;}
#online-reg .orm-content #team-members .team-pill-placeholder {
	position:relative;
	width:100%;
	min-height:50px;
	border-radius:999px;
	background:none;
	border:2px dashed var(--m-accent-text);
	color:var(--m-text);
}
#online-reg #team-members .team-pill-placeholder i {color:var(--m-accent-text);}
#online-reg #team-members .team-pill-placeholder.team-pill-next::after {
	content:"";
	position:absolute;
	inset:-2px;
	border:2px solid var(--m-accent-text);
	border-radius:999px;
	pointer-events:none;
	animation:orm-slot-pulse 1.8s ease-out infinite;
}
@keyframes orm-slot-pulse {
	0% {opacity:0.8; transform:scale(1);}
	70%, 100% {opacity:0; transform:scale(1.05, 1.3);}
}
@media (prefers-reduced-motion: reduce) {
	#online-reg #team-members .team-pill-placeholder.team-pill-next::after {animation:none; opacity:0;}
}

#online-reg .team-pill {
	display:flex;
	align-items:center;
	gap:8px;
	width:100%;
	min-height:50px;
	padding:0 6px;
	border-radius:999px;
	background:var(--orm-btn);
	color:var(--m-btn-text);
	font-weight:600;
	cursor:pointer;
}
#online-reg .team-pill i {
	flex:0 0 36px;
	width:36px; height:36px;
	display:flex; align-items:center; justify-content:center;
	border-radius:50%;
	background:color-mix(in srgb, var(--m-btn-text) 22%, transparent);
	color:var(--m-btn-text);
}
#online-reg .team-pill .team-pill-name {flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--m-btn-text);}
#online-reg .team-pill .team-pill-role {flex:0 0 auto; padding:0 10px; border-left:1px dotted color-mix(in srgb, var(--m-btn-text) 60%, transparent); color:var(--m-btn-text);}
#online-reg #team-members .partner-swapper {
	position:absolute;
	left:calc(50% - 18px);
	top:calc(50% - 18px);
	width:36px; height:36px;
	display:flex; align-items:center; justify-content:center;
	border-radius:50%;
	background:var(--m-bg);
	border:1px solid var(--orm-line-strong);
	color:var(--m-text);
	transform:rotate(90deg);
	cursor:pointer;
	z-index:2;
}

#online-reg .or-builder-hint {display:flex; gap:12px; margin:16px 0 6px;}
#online-reg .or-builder-hint > i {flex:0 0 auto; font-size:1.4rem; color:var(--m-accent-text); margin-top:2px;}
#online-reg .or-builder-hint p {margin:0 0 6px; font-size:0.95rem;}
#online-reg .or-builder-hint p.or-builder-hint-alt {font-size:0.85rem; color:var(--orm-muted);}

#online-reg #team-description-container {display:block; margin:12px 0 18px; text-align:center;}
#online-reg #team-description-container > small {display:block; font-size:0.9rem; line-height:1.5; margin-bottom:4px;}
#online-reg #team-description-container > small a {margin-left:8px; padding-left:8px; border-left:1px dotted currentColor; white-space:nowrap;}
#online-reg #team-description .fa-exclamation-triangle {color:var(--orm-warning); padding-right:6px;}

/* person search sheet */
#reg-search-modal .modal-dialog {height:calc(100% - 24px - env(safe-area-inset-top));} /* fixed height: doesn't jump as results change */
#reg-search-modal .modal-content {height:100%;}
#reg-search-modal .modal-body {padding-top:12px;}
#reg-search-container {position:relative; margin:0;}
#reg-search-modal #reg-search {padding-left:40px; padding-right:36px; border-radius:999px;}
#reg-search-container .search-icon, #reg-search-container .search-cancel-icon {
	position:absolute; top:0;
	height:var(--orm-tap);
	display:flex; align-items:center;
	color:var(--orm-muted);
}
#reg-search-container .search-icon {left:14px;}
#reg-search-container .search-cancel-icon {display:none; right:14px; cursor:pointer;}
#reg-search-container.disabled {opacity:0.5; pointer-events:none;}
#reg-search-container.disabled i {display:none;}
#reg-search-results {margin:10px 0 0; max-height:none;}
#reg-search-results ul {list-style:none; margin:0 0 6px; padding:0;}
#reg-search-results ul li {
	display:flex; align-items:center; gap:12px;
	min-height:52px;
	padding:6px 8px;
	border-radius:var(--orm-radius-sm);
	cursor:pointer;
	-webkit-tap-highlight-color:transparent;
}
#reg-search-results ul li:active {background:var(--orm-tint);}
#reg-search-results ul li.person-disabled {opacity:0.4; pointer-events:none;}
#reg-search-results ul li img, #reg-search-results ul li > i {flex:0 0 36px; width:36px; height:36px; border-radius:50%;}
#reg-search-results ul li img {object-fit:cover; background:var(--orm-tint);}
#reg-search-results ul li > i {display:inline-flex; align-items:center; justify-content:center; font-size:1.4rem; color:var(--orm-muted); background:var(--orm-tint);}
#reg-search-results ul li div {flex:1; min-width:0; font-size:0.95rem; line-height:1.25; overflow:hidden; text-overflow:ellipsis;}
#reg-search-results ul li div span {display:block; font-size:0.8rem; color:var(--orm-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
#reg-search-results > div {text-align:center; padding:24px 8px; color:var(--orm-muted);}
.reg-person-tag {
	display:inline-block;
	margin-left:6px;
	padding:1px 7px;
	border-radius:999px;
	border:1px solid var(--m-accent-text);
	color:var(--m-accent-text);
	font-size:0.7rem;
	font-style:normal;
	vertical-align:1px;
}
.reg-search-heading {margin:14px 0 4px 8px; font-size:0.72rem; font-weight:700; text-transform:uppercase; letter-spacing:0.06em; color:var(--orm-muted);}
.reg-search-heading:first-child {margin-top:0;}
.reg-search-prompt, .reg-search-loading {padding:24px 8px; text-align:center; color:var(--orm-muted);}
#reg-search-footer {display:flex; flex-direction:column; align-items:center; gap:6px; margin-top:10px; padding-top:12px; border-top:1px solid var(--orm-line); font-size:0.9rem; text-align:center;}
#reg-search-footer > span {color:var(--orm-muted);}
#reg-search-footer a {font-weight:700; text-decoration:none;}
#reg-search-footer a i {margin-right:6px;}

/* ENTRY FORM: categories, ages, events */

#online-reg #orv2-entry-form:empty {display:none;}
#online-reg #orv2-entry-form {padding:6px 14px 14px;}
#online-reg #orv2-entry-form > h3 {font-size:1.1rem; margin:10px 0 6px;}
#online-reg #orv2-entry-form ul {list-style:none; margin:0; padding:0;}
#online-reg #orv2-entry-form li.orv2-event-category {margin:0; border-bottom:1px solid var(--orm-line);}
#online-reg #orv2-entry-form li.orv2-event-category:last-child {border-bottom:none;}
#online-reg .orv2-ec-header {display:flex; align-items:center; gap:10px; min-height:52px; padding:6px 0; cursor:pointer; -webkit-tap-highlight-color:transparent;}
#online-reg .orv2-ec-header > i.fas {flex:0 0 18px; font-size:1.1rem; text-align:center; transition:transform 0.2s ease;}
#online-reg #orv2-entry-form li.expanded > .orv2-ec-header > i.fa-caret-right {transform:rotate(90deg);}
#online-reg .orv2-ec-header-text {flex:1; min-width:0; font-weight:700; color:var(--m-accent-text);}
#online-reg .orv2-ec-header-badge-container {flex:0 0 auto;}
#online-reg .orv2-ec-header-badge {
	display:inline-block;
	min-width:30px;
	padding:2px 10px;
	border-radius:999px;
	background:var(--orm-tint);
	color:var(--orm-muted);
	font-size:0.85rem;
	font-weight:700;
	text-align:center;
}
#online-reg #orv2-entry-form li.has-entries .orv2-ec-header-badge {background:var(--orm-btn); color:var(--m-btn-text);}
#online-reg .orv2-ec-container {padding:0 0 16px;}
#online-reg .orv2-ec-hint {display:block; margin:0 0 10px 28px; font-size:0.85rem; font-style:italic; color:var(--orm-muted);}

/* age pills */
#online-reg #orv2-entry-form .orv2-ec-ages {display:flex; flex-wrap:wrap; align-items:center; gap:6px;}
#online-reg #orv2-entry-form .orv2-ec-ages > i.fa-question-circle {padding:6px 2px; cursor:pointer; color:var(--orm-muted);}
#online-reg #orv2-entry-form .orv2-ec-ages small {font-size:0.8rem; color:var(--orm-muted); white-space:nowrap;}
#online-reg #orv2-entry-form .orv2-ec-ages ul {display:flex; flex-wrap:wrap; gap:6px; width:100%;}
#online-reg #orv2-entry-form .orv2-ec-ages ul li {
	position:relative;
	display:inline-flex; align-items:center;
	min-height:36px;
	padding:4px 12px;
	border:1.5px solid var(--orm-chip);
	border-radius:999px;
	color:var(--m-text);
	font-size:0.9rem;
	font-weight:600;
	white-space:nowrap;
	overflow:hidden;
	cursor:pointer;
	-webkit-tap-highlight-color:transparent;
}
#online-reg #orv2-entry-form .orv2-ec-ages ul li.has-entries {box-shadow:inset 0 0 0 1px var(--orm-chip);}
#online-reg #orv2-entry-form .orv2-ec-ages ul li.has-entries::before {content:""; position:absolute; inset:0; background:var(--orm-chip); opacity:0.15; pointer-events:none;}
#online-reg #orv2-entry-form .orv2-ec-ages ul li.selected {background:var(--orm-btn); border-color:transparent; color:var(--m-btn-text);}
#online-reg #orv2-entry-form .orv2-ec-ages ul li.selected * {color:var(--m-btn-text);}
#online-reg #orv2-entry-form .orv2-ec-ages ul li.restricted {display:none; opacity:0.4; text-decoration:line-through;}
#online-reg #orv2-entry-form .orv2-ec-ages ul li.restricted.has-entries {display:inline-flex; opacity:1; text-decoration:none;}
#online-reg #orv2-entry-form .orv2-ec-ages ul li.ap-hide-restricted {display:none;}
#online-reg #orv2-entry-form .orv2-ec-ages ul.show-all li.ap-hide-restricted {display:inline-flex;}
#online-reg #orv2-entry-form .orv2-ec-ages ul.show-all li.ap-show-all {display:none;}
#online-reg #orv2-entry-form .orv2-ec-ages ul.show-all li.restricted {display:inline-flex;}
#online-reg #orv2-entry-form .orv2-ec-ages ul li.ap-show-all, #online-reg #orv2-entry-form .orv2-ec-ages ul li.ap-hide-restricted {border-style:dashed; color:var(--orm-muted); font-weight:500;}

/* event grid: levels down, dances across; scrolls sideways with the level column pinned */
#online-reg .orv2-ec-event-container {
	position:relative;
	margin:12px -14px 0;
	padding:0 14px;
	overflow-x:auto;
	-webkit-overflow-scrolling:touch;
	scrollbar-width:none;
}
#online-reg .orv2-ec-event-container::-webkit-scrollbar {display:none;}
#online-reg .orv2-ec-event-container table {width:max-content; min-width:100%; border-collapse:separate; border-spacing:4px;}
#online-reg .orv2-ec-event-container .level-description-cell {
	position:sticky; left:-14px; z-index:2;
	min-width:76px; max-width:34vw;
	padding:0 8px 0 0;
	background:var(--m-card-solid); /* opaque copy of the card behind it */
	font-size:0.8rem;
	font-weight:700;
	line-height:1.15;
	text-align:right;
	white-space:normal;
	box-shadow:6px 0 6px -6px rgba(0,0,0,0.35);
}
#online-reg .orv2-ec-event-container table td.orv2-event {
	position:relative;
	min-width:44px;
	height:44px;
	padding:4px 10px;
	border-radius:8px;
	background:var(--orm-tint);
	border:1px solid var(--orm-line);
	font-size:0.95rem;
	font-weight:600;
	text-align:center;
	white-space:nowrap;
	cursor:pointer;
	-webkit-tap-highlight-color:transparent;
}
#online-reg .orv2-ec-event-container table td.orv2-event input[type="checkbox"] {display:none;}
#online-reg .orv2-ec-event-container table td.orv2-event.checked {background:var(--orm-btn); border-color:var(--m-accent); box-shadow:inset 0 0 0 1px var(--m-accent); color:var(--m-btn-text);}
#online-reg .orv2-ec-event-container table td.orv2-event.checked:not(.proficiency-selected)::before {content:"\2713"; margin-right:5px; font-weight:800;}
#online-reg .orv2-ec-event-container table td.orv2-event.checked * {color:var(--m-btn-text);}
#online-reg .orv2-ec-event-container table td.orv2-event.hidden {background:none; border:none; pointer-events:none; display:table-cell !important;}
#online-reg .orv2-ec-event-container table td.orv2-event.hidden > * {display:none;}
#online-reg .orv2-ec-event-container .orv2-event.level-disabled, #online-reg .orv2-ec-event-container .orv2-event.related-disabled,
#online-reg .orv2-ec-event-container .orv2-event.overflow-disabled, #online-reg .orv2-ec-event-container .orv2-event.closed-disabled {opacity:0.25;}
#online-reg .orv2-ec-event-container .orv2-event.related-allowed {opacity:0.6;}
#online-reg .orv2-ec-event-container .orv2-event.checked.proficiency-selected::before, #online-reg .proficiency-icon {
	content:"P";
	display:inline-flex; align-items:center; justify-content:center;
	width:18px; height:18px;
	margin-right:4px;
	border-radius:50%;
	background:var(--m-btn-text);
	color:var(--m-btn2);
	font-size:11px;
	font-weight:800;
	vertical-align:1px;
}
#online-reg .proficiency-icon {background:var(--m-btn2); color:var(--m-btn-text);}
#online-reg .grid-key {display:flex; justify-content:flex-end; align-items:center; gap:16px; margin-top:8px; pointer-events:none; font-size:0.8rem; font-weight:600; color:var(--orm-muted);}
#online-reg .grid-key > div {display:flex; align-items:center; gap:5px; margin:0;}
#online-reg .grid-key input {width:15px; height:15px;}

/* event list (non-grid categories) */
#online-reg .orv2-ec-event-container ul li.orv2-event:not(.is-solo) {
	display:flex; align-items:center; gap:12px;
	min-height:46px;
	padding:8px 4px;
	border-bottom:1px solid var(--orm-line);
	font-size:0.95rem;
	cursor:pointer;
	-webkit-tap-highlight-color:transparent;
}
#online-reg .orv2-ec-event-container ul li.orv2-event:not(.is-solo):last-child {border-bottom:none;}
#online-reg .orv2-ec-event-container ul li.orv2-event input[type="checkbox"] {pointer-events:none;}
#online-reg .solo-list {display:flex; flex-direction:column; gap:6px;}
#online-reg .solo-entry {display:flex; align-items:center; gap:10px; padding:8px 4px; font-size:0.95rem; cursor:pointer;}
#online-reg .solo-entry input[type="checkbox"] {pointer-events:none;}
#online-reg .solo-entry.dropped {opacity:0.5; text-decoration:line-through; pointer-events:none;}
#online-reg .add-solo-link {display:flex; align-items:center; gap:8px; padding:10px 4px; font-weight:700; color:var(--m-accent-text); cursor:pointer;}
#online-reg .entry-form-event-price {opacity:0.8;}

#online-reg .orv2-event .gk-pending-tag {display:inline-block; margin-left:6px; padding:0 6px; border-radius:4px; font-size:0.72rem; font-weight:700; color:#fff; background:var(--orm-warning);}
#online-reg .orv2-event.gk-pending-drop .gk-pending-tag {background:var(--orm-danger);}
#online-reg td.orv2-event.gk-pending-add {box-shadow:inset 0 0 0 2px var(--orm-warning);}
#online-reg td.orv2-event.gk-pending-drop {box-shadow:inset 0 0 0 2px var(--orm-danger);}

#online-reg .age-restriction-warning {display:flex; gap:14px; margin-top:12px;}
#online-reg .age-restriction-warning .fas {font-size:1.8rem; color:var(--orm-warning);}
#online-reg .age-restriction-warning p {font-size:0.9rem;}

/* startup / empty hints */
#online-reg #or-startup-hint, #online-reg #or-empty-hint > div {display:flex; gap:12px; margin:20px 0;}
#online-reg #or-startup-hint i, #online-reg #or-empty-hint i {font-size:1.8rem; color:var(--m-accent-text); flex:0 0 auto;}
#online-reg #or-startup-hint p, #online-reg #or-startup-hint li, #online-reg #or-empty-hint li {font-size:0.9rem;}
#online-reg #orv2-entry-form #or-empty-hint ul {list-style:disc; padding-left:20px;}

/* NEW / EDIT COMPETITOR */

#online-reg #new-competitor {margin:16px 0;}
#online-reg #new-competitor h3 {font-size:1.15rem; margin:4px 0 16px;}
#online-reg #new-competitor p {font-size:0.9rem;}
#online-reg #new-competitor-warning > div {display:flex; gap:12px;}
#online-reg #new-competitor-warning .fa-exclamation-circle {font-size:1.8rem; color:var(--orm-warning); flex:0 0 auto;}
#online-reg #new-competitor .button-container {display:flex; flex-direction:column; gap:10px; margin:18px 0 6px;}
#online-reg #new-competitor .button-container button {width:100%;}
#online-reg #new-competitor-form .button-row {display:flex; flex-direction:column; gap:10px; margin:10px 0 4px;}
#online-reg #new-competitor-form .button-row button {width:100%;}
#online-reg #orv2-csz-row .form-col:first-child {flex-basis:100%;}
#online-reg #orv2-csz-row .form-col:nth-child(2) {flex:1 1 120px;}
#online-reg #orv2-csz-row .form-col:last-child {flex:0 1 110px;}
#online-reg #orv2-birthday-row .form-col {flex:1 1 80px;}
#online-reg #orv2-birthday-row .form-col:first-child {flex:2 1 130px;}
#online-reg #orv2-age-at-comp {border:none; background:none; box-shadow:none; pointer-events:none; padding-left:2px;}
#online-reg #new-competitor-chooser ul {list-style:none; margin:10px 0 0; padding:0;}
#online-reg #new-competitor-chooser ul li {display:flex; align-items:center; gap:14px; min-height:56px; cursor:pointer;}
#online-reg #new-competitor-chooser img, #online-reg #new-competitor-chooser ul li > .fas {flex:0 0 44px; width:44px; height:44px; border-radius:50%; object-fit:cover; border:1px solid var(--orm-line);}
#online-reg #new-competitor-chooser ul li > .fas {display:inline-flex; align-items:center; justify-content:center; font-size:1.3rem; color:var(--orm-muted);}
#online-reg #orv2-reg-error {color:var(--orm-danger); font-weight:600; text-align:center;}

/* PURCHASES */

#online-reg #orv2-purchase-form {padding:6px 14px 14px;}
#online-reg #orv2-purchase-form .orv2-ec-header {cursor:default; min-height:44px; border-bottom:1px solid var(--orm-line-strong);}
#online-reg #orv2-purchase-form .orv2-ec-header-text i {margin-right:8px;}
#online-reg #orv2-purchase-form > ul {list-style:none; margin:4px 0 20px; padding:0;}
#online-reg #orv2-purchase-form > ul > li {display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; padding:10px 0; border-bottom:1px solid var(--orm-line);}
#online-reg #orv2-purchase-form > ul > li:last-child {border-bottom:none;}
#online-reg #orv2-purchase-form .pi-name {flex:1 1 100%; min-width:0;}
#online-reg #orv2-purchase-form .pi-name div {font-weight:700;}
#online-reg #orv2-purchase-form .pi-name small {display:block; margin-top:3px; font-size:0.8rem; color:var(--orm-muted);}
#online-reg #orv2-purchase-form .pi-price {flex:1; font-weight:700;}
#online-reg #orv2-purchase-form .pi-qty {
	display:inline-flex; align-items:center; justify-content:center;
	min-width:54px; height:40px;
	border:1px solid var(--orm-line-strong);
	border-right:none;
	border-radius:var(--orm-radius-sm) 0 0 var(--orm-radius-sm);
	font-weight:700;
	cursor:pointer;
}
#online-reg #orv2-purchase-form .qty-0 span {font-weight:400; opacity:0.35;}
#online-reg .orm-content #orv2-purchase-form .pi-edit-button {min-height:40px; height:40px; padding:0 14px; margin:0; border-radius:0 var(--orm-radius-sm) var(--orm-radius-sm) 0; font-size:0.85rem;}
#online-reg #purchases-for {text-align:center; margin:0 0 16px; font-weight:700;}
#online-reg #recipient-picker-container {display:flex; flex-direction:column; gap:6px; margin:10px 0 16px;}
#online-reg #recipient-picker-container span {font-size:0.85rem; font-weight:600; color:var(--orm-muted);}

/* MODALS (Bootstrap's modal JS, styled here as bottom sheets) */

.modal {
	position:fixed;
	inset:0;
	z-index:1050;
	display:none;
	overflow:hidden;
	outline:0;
	color:var(--m-text);
	font-size:16px;
	line-height:1.4;
	text-align:left;
}
.modal-open .modal {overflow-x:hidden; overflow-y:auto;}
.modal-backdrop {position:fixed; inset:0; z-index:1040; background:#000;}
.modal-backdrop.fade {opacity:0; transition:opacity 0.2s linear;}
.modal-backdrop.show {opacity:0.55;}
.modal-dialog {
	position:fixed;
	left:0; right:0; bottom:0;
	width:100%;
	max-width:640px;
	max-height:calc(100% - 24px - env(safe-area-inset-top));
	margin:0 auto;
	display:flex;
	flex-direction:column;
	pointer-events:none;
}
.modal.fade .modal-dialog {transform:translateY(100%); transition:transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);}
.modal.show .modal-dialog {transform:none;}
.modal-content {
	position:relative;
	border-top:1px solid var(--orm-line);
	display:flex;
	flex-direction:column;
	width:100%;
	max-height:100%;
	pointer-events:auto;
	background:var(--orm-sheet);
	border-radius:18px 18px 0 0;
	box-shadow:0 -10px 40px rgba(0,0,0,0.4);
	outline:0;
	overflow:hidden;
}
.modal-content::before {
	content:"";
	position:absolute;
	left:calc(50% - 20px); top:7px;
	width:40px; height:5px;
	border-radius:3px;
	background:var(--orm-line-strong);
}
.modal-header {
	display:flex;
	align-items:center;
	justify-content:space-between;
	gap:12px;
	flex:0 0 auto;
	padding:20px 16px 12px;
	border-bottom:1px solid var(--orm-line);
	background:none;
	box-shadow:none;
}
.modal-title {display:flex; align-items:center; gap:10px; margin:0; font-size:1.15rem; font-weight:700; line-height:1.25; color:var(--m-text);}
.modal-title i {color:var(--m-accent-text); font-size:1.15rem;}
.modal-close {
	flex:0 0 auto;
	width:34px; height:34px;
	display:flex; align-items:center; justify-content:center;
	border-radius:50%;
	background:var(--orm-tint);
	color:var(--m-text);
	font-size:0.95rem;
	cursor:pointer;
}
.modal-body {flex:1 1 auto; padding:16px; overflow-y:auto; -webkit-overflow-scrolling:touch; overscroll-behavior:contain;}
.modal-body > :last-child {margin-bottom:0;}
.modal-body p {margin:0 0 12px;}
.modal-footer {
	display:flex;
	flex-wrap:wrap;
	align-items:center;
	justify-content:flex-end;
	gap:10px;
	flex:0 0 auto;
	padding:12px 16px calc(12px + env(safe-area-inset-bottom));
	border-top:1px solid var(--orm-line);
}
.modal-footer > button {flex:1 1 auto;}
.modal-body:last-child {padding-bottom:calc(16px + env(safe-area-inset-bottom));}

/* specific sheets */
#orv2-password-reset-modal .orv2-pwr-form-row {display:flex; flex-wrap:wrap; gap:8px; margin-bottom:10px;}
#orv2-password-reset-modal .orv2-pwr-form-row label {flex-basis:100%; margin:0 0 -2px 2px; font-size:0.8rem; font-weight:600; color:var(--orm-muted);}
#orv2-password-reset-modal .orv2-pwr-form-row input {flex:1; min-width:0;}
#orv2-password-reset-modal small {display:block; font-size:0.85rem; color:var(--orm-muted);}
#orv2-password-reset-modal small.error {color:var(--orm-danger);}
#orv2-password-reset-code, #orv2-password-reset-newpw {display:none;}
#orv2-password-reset-newpw .orv2-pwr-form-row button {width:100%;}

#mobile-actions-modal .modal-body {display:flex; flex-direction:column; gap:10px;}
#mobile-actions-modal .modal-body button {width:100%;}
#billto-options, #quantity-options {list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:10px;}
#billto-options li button {width:100%;}
#quantity-options li {display:flex; align-items:center; justify-content:space-between; gap:12px;}
#quantity-options li > div {flex:1; min-width:0;}
#quantity-options li > div.custom-select {flex:0 0 96px;}
#change-event-type-modal .modal-body > div {display:flex; flex-direction:column; gap:10px;}
#change-event-type-modal .modal-body > div button {width:100%;}
#purchase-note-content {height:220px;}
#purchase-notes-modal-buttons {display:flex; justify-content:flex-end; gap:10px; margin-top:12px;}

#confirmation-modal-summary {margin:0 0 12px; max-height:none; overflow:visible;}
#confirmation-modal-summary table {width:100%; border-collapse:collapse;}
#confirmation-modal-summary table tr td {padding:8px 4px; vertical-align:top; border-bottom:1px solid var(--orm-line); font-size:0.9rem; overflow-wrap:anywhere;}
#confirmation-modal-summary table tr td:first-child {width:5.5rem;}
#confirmation-modal-summary table tr td:last-child {text-align:right; font-weight:700; white-space:nowrap;}
#confirmation-modal-summary .conf-action {display:inline-block; width:100%; padding:2px 4px; border:1.5px solid var(--m-accent); border-radius:6px; font-size:0.7rem; font-weight:800; text-align:center; text-transform:uppercase;}
#confirmation-modal-summary .conf-note {font-size:0.85rem; color:var(--orm-muted);}

#team-school-search-container {position:relative;}
#team-school-search-container .fas {position:absolute; left:14px; top:0; height:var(--orm-tap); display:flex; align-items:center; color:var(--orm-muted);}
#team-school-modal #team-school-search {padding-left:40px; border-radius:999px;}
#team-school-search-results {min-height:240px;}
#team-school-search-results ul {list-style:none; margin:12px 0; padding:0;}
#team-school-search-results ul li, #team-school-search-results .no-school {display:flex; align-items:flex-start; gap:10px; padding:8px 0; border-bottom:1px solid var(--orm-line); cursor:pointer;}
#team-school-search-results ul li .school-name {flex:1; font-weight:600;}
#team-school-search-results ul li .school-location {flex:0 1 40%; font-size:0.85rem; color:var(--orm-muted); text-align:right;}
#team-school-search-results i {color:var(--m-accent-text);}

#add-solo-modal .form-col {flex-basis:100%;}
#solo-duration-col {display:flex; flex-direction:row !important; align-items:center; gap:8px;}
#solo-duration-col input {width:70px; text-align:center;}

/* purchase sheet: one row per recipient */
#purchase-modal .modal-body ul {list-style:none; margin:0; padding:0;}
#purchase-modal .modal-body ul li {display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:10px 0; border-bottom:1px solid var(--orm-line);}
#purchase-modal .pm-qty-container {flex:0 0 64px;}
#purchase-modal .pm-qty {text-align:center; padding-left:4px; padding-right:4px;}
#purchase-modal .pm-qty-container.disabled input {pointer-events:none; opacity:0.5;}
#purchase-modal .pm-at {flex:0 0 auto; color:var(--orm-muted);}
#purchase-modal .pm-price {flex:1; font-weight:700;}
#purchase-modal .modal-body ul li i.fa-times {flex:0 0 32px; height:32px; display:flex; align-items:center; justify-content:center; opacity:0.5; cursor:pointer;}
#purchase-modal .pm-recipient, #purchase-modal .pm-notes {flex:1 1 100%; width:100% !important; margin:0;}
#purchase-modal .pm-user-icon {display:none;}
#purchase-modal .pm-add-recipient {display:inline-flex; align-items:center; gap:8px; margin-top:12px; font-weight:700; text-decoration:none;}
#purchase-modal .modal-footer {justify-content:space-between;}
#pm-summary {display:flex; align-items:baseline; gap:6px;}
#pm-summary label {font-size:0.8rem; margin:0; color:var(--orm-muted);}
#pm-summary-total {font-size:1.15rem; font-weight:800;}
#pm-summary-total span {padding:0 6px;}
#purchase-modal .modal-footer > button, #save-purchase-button {flex:0 0 auto;}

/* payment sheet: processor form in an iframe */
#payment-modal .modal-body {position:relative;}
#payment-frame, #payment-form-loader {width:100%; height:240px; border:none;}
#payment-modal.processor-stripe #payment-frame {height:auto; min-height:160px;}
#payment-frame-container {opacity:1; transition:opacity 0.4s ease-in;}
#payment-form-loader {position:absolute; left:0; top:0; z-index:2; opacity:0; padding:24px 16px; pointer-events:none; transition:opacity 0.4s ease-out;}
#payment-form-loader .loading-input {height:48px; border:1px dashed var(--orm-line-strong); border-radius:var(--orm-radius-sm);}
#payment-form-loader .loading-input:nth-child(2) {margin-top:8px;}
#payment-form-loader .loading-button {margin-top:20px; height:var(--orm-tap); border-radius:var(--orm-radius-sm); background:var(--orm-tint);}
#payment-modal .modal-body.form-loading #payment-frame-container {opacity:0;}
#payment-modal .modal-body.form-loading #payment-form-loader {opacity:1; pointer-events:auto;}
#payment-modal.processor-stripe #payment-form-loader .loading-input:nth-child(2) {display:none;}

#invoice-picker-choices {list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:10px;}
#invoice-picker-choices li button {width:100%;}
#invoice-picker-choices li#invoice-picker-cancel {margin-top:10px;}

/* TOOLTIPS (Bootstrap's tooltip JS) */

.tooltip {
	position:absolute;
	z-index:1070;
	display:block;
	margin:0;
	font-size:0.8rem;
	line-height:1.3;
	text-align:left;
	word-wrap:break-word;
	opacity:0;
	pointer-events:none;
}
.tooltip.show {opacity:1;}
.tooltip .arrow {position:absolute; display:block; width:0.8rem; height:0.4rem;}
.tooltip .arrow::before {position:absolute; content:""; border-color:transparent; border-style:solid;}
.bs-tooltip-top, .bs-tooltip-auto[x-placement^="top"] {padding:0.4rem 0;}
.bs-tooltip-top .arrow, .bs-tooltip-auto[x-placement^="top"] .arrow {bottom:0;}
.bs-tooltip-top .arrow::before, .bs-tooltip-auto[x-placement^="top"] .arrow::before {top:0; border-width:0.4rem 0.4rem 0; border-top-color:var(--m-text);}
.bs-tooltip-bottom, .bs-tooltip-auto[x-placement^="bottom"] {padding:0.4rem 0;}
.bs-tooltip-bottom .arrow, .bs-tooltip-auto[x-placement^="bottom"] .arrow {top:0;}
.bs-tooltip-bottom .arrow::before, .bs-tooltip-auto[x-placement^="bottom"] .arrow::before {bottom:0; border-width:0 0.4rem 0.4rem; border-bottom-color:var(--m-text);}
.bs-tooltip-right, .bs-tooltip-auto[x-placement^="right"] {padding:0 0.4rem;}
.bs-tooltip-right .arrow, .bs-tooltip-auto[x-placement^="right"] .arrow {left:0; width:0.4rem; height:0.8rem;}
.bs-tooltip-right .arrow::before, .bs-tooltip-auto[x-placement^="right"] .arrow::before {right:0; border-width:0.4rem 0.4rem 0.4rem 0; border-right-color:var(--m-text);}
.bs-tooltip-left, .bs-tooltip-auto[x-placement^="left"] {padding:0 0.4rem;}
.bs-tooltip-left .arrow, .bs-tooltip-auto[x-placement^="left"] .arrow {right:0; width:0.4rem; height:0.8rem;}
.bs-tooltip-left .arrow::before, .bs-tooltip-auto[x-placement^="left"] .arrow::before {left:0; border-width:0.4rem 0 0.4rem 0.4rem; border-left-color:var(--m-text);}
.tooltip-inner {max-width:260px; padding:8px 10px; border-radius:8px; background:var(--m-text); color:var(--m-bg); text-align:left;}
.tooltip-inner * {color:inherit; font-size:inherit;}

/* Bootstrap's .fade outside modals */
.fade:not(.modal):not(.modal-backdrop) {transition:opacity 0.15s linear;}
.fade:not(.show):not(.modal):not(.modal-backdrop) {opacity:0;}
