/*
 * Fan Ownership Platform — structural styles only (T54).
 * Typography and colours inherit from the site theme; the two custom
 * properties below fall back to neutral values when the theme does not
 * define them. WCAG 2.1 AA: focus visible, 3:1 UI contrast, reflow-safe.
 */
.prx3-card,
.prx3-form,
.prx3-notice {
	border: 1px solid currentColor;
	border-radius: 8px;
	padding: 1rem 1.25rem;
	margin: 0 0 1rem;
	max-width: 44rem;
}

.prx3-notice--error { border-width: 2px; }
.prx3-notice--success { border-style: dashed; }
.prx3-notice--unavailable { font-style: italic; }

.prx3-button {
	display: inline-block;
	padding: 0.6em 1.2em;
	border: 2px solid currentColor;
	border-radius: 6px;
	background: var(--prx3-primary, #1a1a2e);
	color: #ffffff;
	cursor: pointer;
	font: inherit;
	text-decoration: none;
	min-height: 44px; /* Target size */
	min-width: 44px;
}

.prx3-button--secondary {
	background: transparent;
	color: inherit;
}

.prx3-button--danger { border-style: double; }

.prx3-button:focus-visible,
.prx3-form input:focus-visible,
.prx3-form textarea:focus-visible,
.prx3-chat__form input:focus-visible {
	outline: 3px solid var(--prx3-accent, #e2b007);
	outline-offset: 2px;
}

.prx3-form label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.prx3-form input[type="text"],
.prx3-form input[type="email"],
.prx3-form input[type="password"],
.prx3-form input[type="url"],
.prx3-form textarea {
	width: 100%;
	max-width: 28rem;
	padding: 0.5em;
	border: 1px solid currentColor;
	border-radius: 4px;
	font: inherit;
}

.prx3-badge {
	display: inline-block;
	border: 1px solid currentColor;
	border-radius: 999px;
	padding: 0.1em 0.75em;
	font-size: 0.85em;
}

.prx3-badge--constitutional,
.prx3-badge--stalled { font-weight: 700; }

.prx3-table { border-collapse: collapse; width: 100%; max-width: 34rem; }
.prx3-table th, .prx3-table td { border: 1px solid currentColor; padding: 0.4em 0.8em; text-align: left; }
.prx3-table caption { text-align: left; font-weight: 700; padding-bottom: 0.5em; }

.prx3-ballot__note, .prx3-ballot__rec { font-size: 0.9em; }
.prx3-feedback:empty { display: none; }
.prx3-feedback { font-weight: 600; }

.prx3-match__player { aspect-ratio: 16 / 9; background: #000; border-radius: 8px; overflow: hidden; }
.prx3-match__player iframe, .prx3-match__player video { width: 100%; height: 100%; border: 0; }
.prx3-match__timeline { list-style: none; padding: 0; }
.prx3-match__timeline li { border-left: 3px solid currentColor; margin: 0.35rem 0; padding: 0.15rem 0.75rem; }
.prx3-match__timeline li.prx3-removed { text-decoration: line-through; opacity: 0.7; }

.prx3-chat__messages {
	list-style: none;
	padding: 0.5rem;
	margin: 0 0 0.5rem;
	max-height: 20rem;
	overflow-y: auto;
	border: 1px solid currentColor;
	border-radius: 8px;
}
.prx3-chat__form { display: flex; gap: 0.5rem; }
.prx3-chat__form input { flex: 1; min-width: 0; padding: 0.5em; border: 1px solid currentColor; border-radius: 4px; font: inherit; }

.prx3-videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1rem; }

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
}

@media (prefers-reduced-motion: reduce) {
	.prx3-card, .prx3-button { transition: none; }
}

/* Dashboard tiles (member-facing): brand-driven, keyboard-visible. */
.prx3-tiles {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 12px;
	margin: 16px 0;
}

.prx3-tile {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 16px;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 8px;
	color: inherit;
	text-decoration: none;
	background: rgba(255, 255, 255, 0.6);
}

a.prx3-tile:hover,
a.prx3-tile:focus-visible {
	border-color: var(--prx3-primary, #1a1a2e);
}

a.prx3-tile:focus-visible {
	outline: 3px solid var(--prx3-primary, #1a1a2e);
	outline-offset: 2px;
}

.prx3-tile-label {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	opacity: 0.75;
}

.prx3-tile-value {
	font-size: 1.75rem;
	line-height: 1.1;
	font-variant-numeric: tabular-nums;
	color: var(--prx3-primary, inherit);
}

.prx3-tile-note {
	font-size: 0.75rem;
	opacity: 0.75;
}

/* ---------------- FanPress Chat — WhatsApp-style (FO-234) ---------------- */

.prx3-chat-app {
	--prx3-chat-mine: #dcf8c6;
	--prx3-chat-theirs: #ffffff;
	--prx3-chat-board: #fff3cd;
	max-width: 680px;
}

.prx3-chips {
	margin: 12px 0;
}

.prx3-chat-boards .prx3-chip,
.prx3-chips .prx3-chip {
	display: inline-block;
	border: 1px solid #ccd0d4;
	border-radius: 16px;
	padding: 2px 14px;
	margin: 0 4px 6px 0;
	text-decoration: none;
	font-size: 0.85rem;
	color: inherit;
}

.prx3-chat-boards .prx3-chip.is-on,
.prx3-chips .prx3-chip--active {
	background: var(--prx3-primary, #1a1a2e);
	border-color: var(--prx3-primary, #1a1a2e);
	color: #fff;
}

.prx3-chat-list {
	border: 1px solid #ccd0d4;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
}

.prx3-chat-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	border-top: 1px solid #eceff1;
	text-decoration: none;
	color: inherit;
}

.prx3-chat-row:first-child {
	border-top: 0;
}

.prx3-chat-row:hover {
	background: #f6f7f8;
}

.prx3-chat-row-main {
	flex: 1;
	min-width: 0;
}

.prx3-chat-row-main strong {
	display: block;
}

.prx3-chat-snippet {
	display: block;
	color: #5f6672;
	font-size: 0.85rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.prx3-chat-row-side {
	text-align: right;
	flex-shrink: 0;
}

.prx3-chat-when {
	display: block;
	font-size: 0.75rem;
	color: #5f6672;
}

.prx3-chat-unread {
	display: inline-block;
	min-width: 20px;
	text-align: center;
	background: #25d366;
	color: #fff;
	border-radius: 12px;
	font-size: 0.75rem;
	font-weight: 700;
	padding: 1px 6px;
	margin-top: 4px;
}

.prx3-chat-auto {
	display: inline-block;
	font-size: 0.7rem;
	color: #5f6672;
	border: 1px solid #ccd0d4;
	border-radius: 10px;
	padding: 0 8px;
	margin-top: 4px;
}

.prx3-chat-new {
	margin-top: 14px;
}

.prx3-chat-thread .prx3-chat-scroll {
	background: #e5ddd5;
	border: 1px solid #ccd0d4;
	border-radius: 8px;
	padding: 14px 12px;
	max-height: 60vh;
	overflow-y: auto;
}

.prx3-bubble-row {
	display: flex;
	margin: 6px 0;
}

.prx3-bubble-row--mine {
	justify-content: flex-end;
}

.prx3-bubble {
	max-width: 78%;
	border-radius: 10px;
	padding: 7px 11px;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
	background: var(--prx3-chat-theirs);
}

.prx3-bubble--mine {
	background: var(--prx3-chat-mine);
	border-bottom-right-radius: 2px;
}

.prx3-bubble--theirs {
	border-bottom-left-radius: 2px;
}

.prx3-bubble--board {
	background: var(--prx3-chat-board);
	border-bottom-left-radius: 2px;
}

.prx3-bubble-name {
	display: block;
	font-size: 0.78rem;
	font-weight: 700;
	margin-bottom: 2px;
}

.prx3-bubble-board {
	font-weight: 700;
	font-size: 0.68rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	border: 1px solid currentColor;
	border-radius: 8px;
	padding: 0 6px;
}

.prx3-bubble-text {
	display: block;
	word-wrap: break-word;
}

.prx3-bubble-text p {
	margin: 0;
}

.prx3-bubble-when {
	display: block;
	text-align: right;
	font-size: 0.68rem;
	color: rgba(0, 0, 0, 0.45);
	margin-top: 2px;
}

.prx3-chat-compose {
	display: flex;
	gap: 8px;
	align-items: flex-end;
	margin-top: 10px;
	position: relative;
}

.prx3-chat-compose textarea {
	flex: 1;
	border-radius: 18px;
	padding: 9px 14px;
	resize: none;
}

/* Match/ballot pages: the event chat sits beside the content on wide
   screens (video or ballot left, conversation right), stacking on
   small screens. */
.prx3-event-layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: 24px;
	align-items: start;
}

@media (min-width: 900px) {
	.prx3-event-layout {
		grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr);
	}

	.prx3-event-chat {
		position: sticky;
		top: 24px;
	}

	.prx3-event-chat .prx3-chat-scroll {
		max-height: 70vh;
	}
}

.prx3-ballot__option-desc {
	display: block;
	font-weight: 400;
	font-size: 0.85rem;
	color: #5f6672;
	margin: 2px 0 6px 26px;
}

.prx3-ballot__question img {
	max-width: 100%;
	height: auto;
}

/* FanPress comms round (FO-236) + profiles (FO-235) */
.prx3-bubble-quote {
	display: block;
	border-left: 3px solid rgba(0, 0, 0, 0.25);
	padding: 3px 8px;
	margin-bottom: 4px;
	font-size: 0.8rem;
	opacity: 0.85;
	background: rgba(0, 0, 0, 0.05);
	border-radius: 4px;
}

.prx3-bubble-tools {
	display: block;
	font-size: 0.7rem;
	margin-top: 3px;
	opacity: 0.6;
}

.prx3-chat-pinned {
	background: #fff8e1;
	border: 1px solid #e2b007;
	border-radius: 6px;
	padding: 6px 12px;
	font-size: 0.85rem;
}

.prx3-chat-mute {
	font-size: 0.75rem;
	text-decoration: none;
	margin-left: 8px;
}

.prx3-compose-quoting {
	position: absolute;
	top: -22px;
	left: 14px;
	font-size: 0.75rem;
	color: #5f6672;
}

.prx3-profile__meta {
	color: #5f6672;
}

.prx3-profile__socials .prx3-badge {
	margin-right: 6px;
}

/* ---------------- FanPress Bot ---------------- */
.prx3-bot { --prx3-bot: #1a1a2e; --prx3-bot-bg: #eae6df; display: flex; flex-direction: column; max-width: 420px; height: 460px; border: 1px solid #ccd0d4; border-radius: 12px; overflow: hidden; background: #fff; }
.prx3-bot__head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--prx3-bot); color: #fff; }
.prx3-bot__avatar { border-radius: 50%; object-fit: cover; }
.prx3-bot__scroll { flex: 1; overflow-y: auto; padding: 12px; background-color: var(--prx3-bot-bg); background-size: cover; background-position: center; }
.prx3-bot__form { display: flex; gap: 6px; padding: 8px; border-top: 1px solid #eee; }
.prx3-bot__form input { flex: 1; min-width: 0; padding: 0.55em; border: 1px solid #ccd0d4; border-radius: 18px; font: inherit; }
.prx3-bot .prx3-bubble--theirs { background: #fff; }
.prx3-bot .prx3-bubble--mine { background: var(--prx3-bot); color: #fff; }
.prx3-bot__ticket { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; padding: 10px; background: #fff; border-radius: 8px; }
.prx3-bot__ticket input, .prx3-bot__ticket textarea { padding: 0.5em; border: 1px solid #ccd0d4; border-radius: 6px; font: inherit; }

.prx3-bot-launch { position: fixed; right: 18px; bottom: 18px; z-index: 9999; }
.prx3-bot-launch__btn { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; padding: 0; border: 0; border-radius: 50%; color: #fff; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.25); overflow: hidden; }
.prx3-bot-launch__btn img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.prx3-bot-launch__panel { position: absolute; right: 0; bottom: 68px; width: min(92vw, 420px); box-shadow: 0 8px 30px rgba(0,0,0,.3); border-radius: 12px; }
.prx3-bot__avatar--placeholder { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: #d7dade; color: #6b7177; }
.prx3-bot-glyph { display: block; }
