/*
 * SpaceBay UI library: shared component styles
 *
 * This file is the one place for the look of components that the portal, the admin
 * and the Pro add-on share (buttons, form fields, choice cards, modal, pill, skeleton,
 * swatches, icon picker, medal, space badge, page header, form error). To change how
 * a component looks everywhere, change it here.
 *
 * Rules for this file
 * - App stylesheets (portal.css, admin.css) only hold layout and screen-specific rules.
 *   They must not redefine a class that is defined here; they may add rules for a
 *   component placed in a particular spot (".sbay-card .sbay-btn") or a modifier that
 *   only one app uses.
 * - Values that differ between the apps go through custom properties. The defaults
 *   in this file are the portal's values (the portal is the public face and the
 *   reference); the admin sets its own in the token block at the top of admin.css
 *   (".sbay-admin { --sbay-btn-radius: 8px; … }"). A new app only has to set tokens.
 * - Never rename a class: the Pro add-on and themes rely on them.
 * - Write plain selectors (".sbay-btn", not ".sbay-app .sbay-btn"). The build adds the
 *   app root in front: vite.config.js (plugin "sbay-scope-styles") turns every selector in the
 *   portal bundle into "#sbay-portal .sbay-btn" (the ID outranks theme styles) and, in the
 *   admin bundle, only the rules of this file into ".sbay-admin .sbay-btn" (outranks the
 *   WordPress admin styles). Selectors that start with html, body, :root or a
 *   ".sbay-layout-" class are left alone.
 * - Dark theme overrides ('.sbay-app[data-sbay-theme="dark"] …') stay with the dark tokens
 *   in portal.css.
 *
 * Table of contents
 * 1. Buttons
 * 2. Form fields and form error
 * 3. Choice cards
 * 4. Swatches and icon picker
 * 5. Modal
 * 6. Pill, medal and space badge
 * 7. Page header
 * 8. Skeleton
 * 9. Space form
 * 10. Icons
 * 11. Brand heading
 */

/* ==========================================================================
   1. Buttons
   Custom properties: --sbay-btn-radius, --sbay-btn-gap, --sbay-btn-ghost-*, --sbay-btn-danger-*,
   --sbay-btn-focus-*, --sbay-btn-disabled-*.
   ========================================================================== */

#sbay-portal .sbay-btn {
	--_bg: var(--sbay-brand);
	--_fg: #ffffff;
	--_bd: var(--sbay-brand);
	--_hover: var(--sbay-brand-strong);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--sbay-btn-gap, 0);
	min-height: 38px;
	padding: 0 16px;
	border: 1px solid var(--_bd);
	border-radius: var(--sbay-btn-radius, 999px);
	background: var(--_bg);
	color: var(--_fg);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

#sbay-portal .sbay-btn:hover:not(:disabled) {
	background: var(--_hover);
}

/* Secondary: a soft brand fill, no outline. */
#sbay-portal .sbay-btn--ghost {
	--_bg: var(--sbay-btn-ghost-bg, var(--sbay-brand-soft));
	--_fg: var(--sbay-btn-ghost-fg, var(--sbay-brand-strong));
	--_bd: var(--sbay-btn-ghost-bd, transparent);
	--_hover: var(--sbay-btn-ghost-hover, var(--sbay-brand-muted));
}

#sbay-portal .sbay-btn--danger {
	--_bg: var(--sbay-btn-danger-bg, #fde8e6);
	--_fg: var(--sbay-btn-danger-fg, #b42318);
	--_bd: var(--sbay-btn-danger-bd, transparent);
	--_hover: var(--sbay-btn-danger-hover, #fbd5d1);
}

#sbay-portal .sbay-btn:disabled,
#sbay-portal .sbay-btn:disabled:hover {
	border-color: var(--sbay-btn-disabled-bd, var(--_bd));
	background: var(--sbay-btn-disabled-bg, var(--_bg));
	color: var(--sbay-btn-disabled-fg, var(--_fg));
	opacity: var(--sbay-btn-disabled-opacity, 1);
	cursor: default;
}

#sbay-portal .sbay-btn:focus-visible {
	background: var(--sbay-btn-focus-bg, var(--_hover));
	box-shadow: inset 0 0 0 2px var(--sbay-btn-focus-ring, rgb(255 255 255 / 0.7));
}

#sbay-portal .sbay-btn--ghost:focus-visible {
	background: var(--sbay-btn-ghost-focus-bg, var(--_hover));
	box-shadow: none;
	color: var(--sbay-btn-ghost-focus-fg, var(--_fg));
}

#sbay-portal .sbay-btn--danger:focus-visible {
	background: var(--sbay-btn-danger-focus-bg, var(--_hover));
	box-shadow: none;
}

/* ==========================================================================
   2. Form fields and form error
   Custom properties: --sbay-field-border, --sbay-field-focus, --sbay-input-*, --sbay-form-error-color.
   ========================================================================== */

#sbay-portal .sbay-field {
	display: grid;
	gap: 6px;
	margin-top: var(--sbay-field-margin-top, 16px);
}

#sbay-portal .sbay-field__label {
	font-weight: 600;
}

#sbay-portal .sbay-field__help {
	margin: 0;
	color: var(--sbay-text-soft);
	font-size: 13px;
}

#sbay-portal .sbay-field-row {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

#sbay-portal .sbay-search__input,
#sbay-portal .sbay-select,
#sbay-portal .sbay-input {
	width: 100%;
	max-width: var(--sbay-input-max-width, none);
	min-height: var(--sbay-input-min-height, 42px);
	padding: var(--sbay-input-padding, 9px 12px);
	border: 1px solid var(--sbay-field-border);
	border-radius: var(--sbay-input-radius, var(--sbay-radius-small));
	background: var(--sbay-surface);
	color: var(--sbay-text);
	font: inherit;
	font-size: 14px;
	line-height: var(--sbay-input-line-height, inherit);
}

#sbay-portal .sbay-select {
	width: auto;
	min-height: 40px;
	padding: 6px 12px;
}

#sbay-portal select.sbay-input,
#sbay-portal select.sbay-select {
	padding-inline-end: 36px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2355625b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-position: right 12px center;
	background-repeat: no-repeat;
	background-size: 16px 16px;
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
}

#sbay-portal [dir="rtl"] select.sbay-input,
#sbay-portal [dir="rtl"] select.sbay-select {
	background-position: left 12px center;
}

#sbay-portal .sbay-search__input:focus,
#sbay-portal .sbay-select:focus,
#sbay-portal .sbay-input:focus {
	border-color: var(--sbay-field-focus);
	background-color: var(--sbay-surface);
	outline: none;
	box-shadow: none;
}

#sbay-portal textarea.sbay-input {
	max-width: 100%;
	resize: vertical;
}

/* A field with fixed text in front (a space address after the community link). The two read as one box;
   a long link is clipped from its start, so the part next to the field always shows. */
#sbay-portal .sbay-input-prefixed {
	display: flex;
	align-items: stretch;
	min-width: 0;
	border: 1px solid var(--sbay-field-border);
	direction: ltr; /* A link reads left to right on every site. */
	border-radius: var(--sbay-input-radius, var(--sbay-radius-small));
	background: var(--sbay-surface);
}

#sbay-portal .sbay-input-prefixed:focus-within {
	border-color: var(--sbay-field-focus);
}

#sbay-portal .sbay-input-prefixed__prefix {
	display: flex;
	flex: 0 1 auto;
	align-items: center;
	max-width: 65%;
	padding-left: 12px;
	overflow: hidden;
	color: var(--sbay-text-soft);
	font-size: 14px;
	white-space: nowrap;
	direction: rtl;
}

#sbay-portal .sbay-input-prefixed__prefix bdi {
	direction: ltr;
}

#sbay-portal .sbay-input-prefixed .sbay-input {
	flex: 1 1 0;
	width: auto;
	min-width: 6em;
	padding-left: 0;
	border: 0;
	background: transparent;
}

/* Borderless writing field (a post title): no border or fill at rest, a soft fill on focus, no ring. */
#sbay-portal .sbay-input.sbay-input--plain {
	padding: 12px 14px;
	border-color: transparent;
	border-radius: 8px;
	background: transparent;
}

#sbay-portal .sbay-input.sbay-input--plain:focus {
	border-color: transparent;
	background: var(--sbay-surface-alt, var(--sbay-surface));
}

#sbay-portal .sbay-form-error {
	margin-top: 16px;
	padding: 10px 14px;
	border-radius: var(--sbay-form-error-radius, var(--sbay-radius-small));
	background: #fde8e6;
	color: var(--sbay-form-error-color, #9f1c13);
	font-weight: 500;
}

/* ==========================================================================
   3. Choice cards
   Custom properties: --sbay-choice-card-padding, --sbay-choice-card-radius,
   --sbay-choice-card-transition, --sbay-choice-cards-columns, --sbay-choice-cards-gap.
   ========================================================================== */

#sbay-portal .sbay-choice-cards {
	display: grid;
	grid-template-columns: repeat(var(--sbay-choice-cards-columns, 3), minmax(0, 1fr));
	gap: var(--sbay-choice-cards-gap, 10px);
}

#sbay-portal .sbay-choice-card {
	position: relative;
	display: grid;
	gap: 4px;
	padding: var(--sbay-choice-card-padding, 14px);
	border-radius: var(--sbay-choice-card-radius, var(--sbay-radius-small));
	background: var(--sbay-fill);
	cursor: pointer;
	transition: var(--sbay-choice-card-transition, none);
}

#sbay-portal .sbay-choice-card:hover {
	background: var(--sbay-fill-strong);
}

#sbay-portal .sbay-choice-card.is-selected {
	background: var(--sbay-brand-soft);
}

#sbay-portal .sbay-choice-card input,
#sbay-portal .sbay-swatch input {
	position: absolute;
	opacity: 0;
}

#sbay-portal .sbay-choice-card:has( :focus-visible ) {
	box-shadow: inset 0 0 0 2px var(--sbay-focus);
}

#sbay-portal .sbay-choice-card__title {
	font-weight: 600;
}

#sbay-portal .sbay-choice-card.is-selected .sbay-choice-card__title {
	color: var(--sbay-brand-strong);
}

#sbay-portal .sbay-choice-card__text {
	color: var(--sbay-text-soft);
	font-size: 13px;
}

@media (max-width: 767px) {
	#sbay-portal .sbay-choice-cards {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 600px) {
	#sbay-portal .sbay-field-row {
		grid-template-columns: 1fr;
	}
}

/* ==========================================================================
   4. Swatches and icon picker
   Custom properties: --sbay-icon-picker-hover-bg, --sbay-icon-picker-hover-fg, --sbay-icon-picker-transition.
   ========================================================================== */

#sbay-portal .sbay-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

#sbay-portal .sbay-swatch {
	position: relative;
	cursor: pointer;
}

#sbay-portal .sbay-swatch__dot {
	display: block;
	width: 28px;
	height: 28px;
	border: 3px solid var(--sbay-surface);
	border-radius: 50%;
	box-shadow: 0 0 0 1px var(--sbay-border);
}

#sbay-portal .sbay-swatch.is-selected .sbay-swatch__dot {
	box-shadow: 0 0 0 2px var(--sbay-text);
}

#sbay-portal .sbay-swatch:has( :focus-visible ) .sbay-swatch__dot {
	border-color: var(--sbay-text);
}

#sbay-portal .sbay-icon-picker {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
	gap: 6px;
	max-height: 184px; /* Four rows; the rest scrolls. */
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 2px; /* Room for the focus ring inside the scroll box. */
}

#sbay-portal .sbay-icon-picker__option {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 40px;
	border-radius: 8px;
	background: var(--sbay-fill);
	color: var(--sbay-text-soft);
	cursor: pointer;
	transition: var(--sbay-icon-picker-transition, none);
}

#sbay-portal .sbay-icon-picker__option svg {
	width: 20px;
	height: 20px;
}

#sbay-portal .sbay-icon-picker__option:hover {
	background: var(--sbay-icon-picker-hover-bg, var(--sbay-fill-strong));
	color: var(--sbay-icon-picker-hover-fg, var(--sbay-text));
}

#sbay-portal .sbay-icon-picker__option.is-selected,
#sbay-portal .sbay-icon-picker__option.is-selected:hover {
	background: var(--sbay-brand);
	color: #ffffff;
}

#sbay-portal .sbay-icon-picker__option input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

#sbay-portal .sbay-icon-picker__option:has( :focus-visible ) {
	box-shadow: inset 0 0 0 2px var(--sbay-surface), inset 0 0 0 4px var(--sbay-text);
}

#sbay-portal .sbay-icon-picker__letter {
	font-size: 15px;
	font-weight: 700;
}

/* ==========================================================================
   5. Modal
   Custom properties: --sbay-modal-z, --sbay-modal-top, --sbay-backdrop, --sbay-modal-radius,
   --sbay-modal-shadow, --sbay-modal-header-padding, --sbay-modal-body-top,
   --sbay-modal-close-size, --sbay-modal-close-radius, --sbay-modal-close-hover,
   --sbay-modal-close-focus-ring.
   No blur on the backdrop.
   ========================================================================== */

#sbay-portal .sbay-modal {
	position: fixed;
	inset: 0;
	z-index: var(--sbay-modal-z, 1000);
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: var(--sbay-modal-top, 48px) 16px 24px;
	overflow-y: auto;
}

#sbay-portal .sbay-modal__backdrop {
	position: fixed;
	inset: 0;
	background: var(--sbay-backdrop, rgba(16, 24, 40, 0.5));
}

#sbay-portal .sbay-modal__dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 480px;
	max-height: var(--sbay-modal-max-height, calc(100vh - 72px));
	max-height: var(--sbay-modal-max-height, calc(100dvh - 72px));
	border-radius: var(--sbay-modal-radius, var(--sbay-radius));
	background: var(--sbay-surface);
	box-shadow: var(--sbay-modal-shadow, 0 20px 60px rgba(16, 24, 40, 0.3));
}

#sbay-portal .sbay-modal__dialog.is-medium {
	max-width: 560px;
}

#sbay-portal .sbay-modal__dialog.is-wide {
	max-width: 720px;
}

#sbay-portal .sbay-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--sbay-modal-header-padding, 16px 24px);
	border-bottom: 1px solid var(--sbay-border);
}

#sbay-portal .sbay-modal__title {
	margin: 0;
	font-size: 18px;
}

#sbay-portal .sbay-modal__close {
	width: var(--sbay-modal-close-size, 34px);
	height: var(--sbay-modal-close-size, 34px);
	border: 0;
	border-radius: var(--sbay-modal-close-radius, 50%);
	background: none;
	color: var(--sbay-text-soft);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}

#sbay-portal .sbay-modal__close:hover,
#sbay-portal .sbay-modal__close:focus-visible {
	background: var(--sbay-modal-close-hover, var(--sbay-fill));
}

#sbay-portal .sbay-modal__close:focus-visible {
	box-shadow: var(--sbay-modal-close-focus-ring, none);
}

#sbay-portal .sbay-modal__body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: var(--sbay-modal-body-top, 4px) 24px 24px;
}

#sbay-portal .sbay-modal__footer {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 8px;
	padding: 14px 24px;
	border-top: 1px solid var(--sbay-border);
}

/* ==========================================================================
   6. Pill, medal and space badge
   Custom properties: --sbay-space-badge-size, --sbay-space-badge-radius, --sbay-space-badge-font,
   --sbay-space-badge-large-size, --sbay-space-badge-large-font.
   ========================================================================== */

#sbay-portal .sbay-pill {
	display: inline-block;
	padding: var(--sbay-pill-padding, 1px 9px);
	border-radius: 999px;
	background: var(--sbay-brand-soft);
	color: var(--sbay-brand-strong);
	font-size: 12px;
	font-weight: 600;
}

#sbay-portal .sbay-pill.is-private {
	background: #fef3c7;
	color: #92400e;
}

#sbay-portal .sbay-pill.is-secret {
	background: #ede9fe;
	color: #5b21b6;
}

#sbay-portal .sbay-pill.is-archived {
	background: #e5e7eb;
	color: #374151;
}

#sbay-portal .sbay-pill.is-cancelled {
	background: #fde8e7;
	color: #b42318;
}

#sbay-portal .sbay-pill.is-soon {
	background: #fff4d6;
	color: #8a4b05;
}

#sbay-portal .sbay-pill.is-going {
	background: var(--sbay-brand-soft);
	color: var(--sbay-brand-strong);
}

#sbay-portal .sbay-pill.is-maybe {
	background: #e8f0fe;
	color: #1d4ed8;
}

#sbay-portal .sbay-pill.is-not_going {
	background: var(--sbay-surface-alt);
	color: var(--sbay-text-soft);
}

#sbay-portal .sbay-medal {
	--sbay-medal: var(--sbay-brand);
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--sbay-medal);
	box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.35);
	color: #ffffff;
}

#sbay-portal .sbay-medal svg {
	width: 55%;
	height: 55%;
}

#sbay-portal .sbay-medal.is-locked {
	background: var(--sbay-surface-alt);
	box-shadow: inset 0 0 0 2px var(--sbay-border);
	color: var(--sbay-text-soft);
}

#sbay-portal .sbay-space-badge {
	--sbay-badge: var(--sbay-brand);
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: var(--sbay-space-badge-size, 32px);
	height: var(--sbay-space-badge-size, 32px);
	border-radius: var(--sbay-space-badge-radius, 9px);
	background: var(--sbay-brand-soft);
	background: color-mix(in srgb, var(--sbay-badge) 13%, var(--sbay-surface));
	color: var(--sbay-badge);
	font-size: var(--sbay-space-badge-font, 14px);
	font-weight: 700;
	line-height: 1;
}

#sbay-portal .sbay-space-badge__icon {
	width: 58%;
	height: 58%;
}

#sbay-portal .sbay-space-badge.has-image {
	overflow: hidden;
	background: var(--sbay-surface-alt);
}

#sbay-portal .sbay-space-badge__image {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: inherit;
	object-fit: cover;
}

#sbay-portal .sbay-space-badge--large {
	width: var(--sbay-space-badge-large-size, 52px);
	height: var(--sbay-space-badge-large-size, 52px);
	border-radius: 14px;
	background: var(--sbay-badge);
	color: #ffffff;
	font-size: var(--sbay-space-badge-large-font, 22px);
}

/* ==========================================================================
   7. Page header
   Custom properties: --sbay-page-header-*.
   ========================================================================== */

#sbay-portal .sbay-page-header {
	display: flex;
	flex-wrap: var(--sbay-page-header-wrap, nowrap);
	align-items: var(--sbay-page-header-align, flex-end);
	justify-content: space-between;
	gap: var(--sbay-page-header-gap, 16px);
	min-height: var(--sbay-page-header-min-height, 0);
	padding: var(--sbay-page-header-padding, 0);
	border-bottom: var(--sbay-page-header-border, 0);
	background: var(--sbay-page-header-bg, transparent);
}

#sbay-portal .sbay-page-header__title {
	margin: 0;
	padding: 0;
	color: var(--sbay-text);
	font-size: var(--sbay-page-header-title-size, 26px);
	font-weight: var(--sbay-page-header-title-weight, 600);
	line-height: var(--sbay-page-header-title-line, 1.25);
}

#sbay-portal .sbay-page-header .sbay-page-header__text {
	margin: var(--sbay-page-header-text-margin, 4px 0 0);
	color: var(--sbay-text-soft);
	font-size: var(--sbay-page-header-text-size, inherit);
}

@media (max-width: 600px) {
	#sbay-portal .sbay-page-header {
		flex-direction: var(--sbay-page-header-narrow-direction, column);
		align-items: var(--sbay-page-header-narrow-align, flex-start);
	}
}

/* ==========================================================================
   8. Skeleton
   One shimmering block (SkeletonBlock.vue). Colours: --sbay-skeleton, --sbay-skeleton-shine.
   ========================================================================== */

#sbay-portal .sbay-skeleton {
	display: block;
	max-width: 100%;
	height: 14px;
	border-radius: 6px;
	background: var(--sbay-skeleton) linear-gradient(90deg, var(--sbay-skeleton) 0%, var(--sbay-skeleton-shine) 50%, var(--sbay-skeleton) 100%) 0 0 / 200% 100% no-repeat;
	animation: sbay-shimmer 1.4s ease-in-out infinite;
}

#sbay-portal .sbay-skeleton--title {
	height: 20px;
	margin-bottom: 8px;
}

#sbay-portal .sbay-skeleton--box {
	height: 40px;
	border-radius: 8px;
}

#sbay-portal .sbay-skeleton--circle {
	border-radius: 50%;
}

@keyframes sbay-shimmer {
	from {
		background-position: 100% 0;
	}

	to {
		background-position: -100% 0;
	}
}

/* ==========================================================================
   9. Space form (SpaceForm.vue)
   ========================================================================== */

#sbay-portal .sbay-space-form__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 8px;
	margin-top: var(--sbay-space-form-actions-top, 20px);
}

#sbay-portal .sbay-space-form__preview {
	display: flex;
	justify-content: center;
	padding-top: var(--sbay-space-form-preview-top, 8px);
}

#sbay-portal .sbay-icon-image {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-top: 10px;
}

#sbay-portal .sbay-icon-image__preview {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin-right: 4px;
	color: var(--sbay-text-soft);
}

#sbay-portal .sbay-icon-image__preview img {
	width: 48px;
	height: 48px;
	border-radius: 10px;
	object-fit: cover;
	background: var(--sbay-fill);
	box-shadow: 0 0 0 1px var(--sbay-border, rgba(0, 0, 0, 0.08));
}

/* ==========================================================================
   10. Icons
   ========================================================================== */

#sbay-portal .sbay-icon {
	flex-shrink: 0;
}

/* ==========================================================================
   11. Brand heading (BrandHeading.vue)
   The community heading: logo, icon and name. Row layouts by default;
   ".is-stacked" centres everything in a column; ".is-compact" is the small row
   of the mobile top bar and the login pages. The tablet icon rail and the sidebar
   container are layout and stay with the sidebar in portal.css.
   ========================================================================== */

#sbay-portal .sbay-brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	color: var(--sbay-text);
	font-weight: 700;
	font-size: 18px;
	text-decoration: none;
}

#sbay-portal .sbay-brand.has-logo {
	gap: 12px;
}

/* A single image keeps no box of its own; an icon and a logo side by side get a small row. */
#sbay-portal .sbay-brand__images {
	display: contents;
}

#sbay-portal .sbay-brand__images.is-pair {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	max-width: 100%;
}

/* In a narrow sidebar the pair shrinks (the logo scales down inside its box) instead of spilling over the edge. */
#sbay-portal .sbay-brand__images.is-pair .sbay-brand__logo {
	flex: 0 1 auto;
	min-width: 0;
}

#sbay-portal .sbay-brand__mark {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	background: linear-gradient(135deg, var(--sbay-leaf), var(--sbay-brand));
	color: #ffffff;
	font-size: 16px;
}

#sbay-portal .sbay-brand__mark.is-icon,
#sbay-portal .sbay-brand__icon {
	width: 40px;
	height: 40px;
}

#sbay-portal .sbay-brand__mark.is-icon {
	font-size: 18px;
}

/* The first letter for text-only headings: only the tablet icon rail shows it. */
#sbay-portal .sbay-brand__mark.is-rail-only {
	display: none;
}

#sbay-portal .sbay-brand__icon {
	display: block;
	flex: 0 0 auto;
	border-radius: 10px;
	object-fit: cover;
}

#sbay-portal .sbay-brand__name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

#sbay-portal .sbay-brand__logo {
	display: block;
	width: auto;
	max-width: 180px;
	height: 32px;
	object-fit: contain;
}

/* Logos are usually made for light backgrounds, so dark mode gives them a light plate. */
#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-brand__logo {
	box-sizing: content-box;
	padding: 3px 8px;
	border-radius: 8px;
	background: #ffffff;
}

#sbay-portal .sbay-brand.is-stacked {
	flex-direction: column;
	justify-content: center;
	gap: 8px;
	max-width: 100%;
	text-align: center;
}

#sbay-portal .sbay-brand.is-stacked .sbay-brand__logo {
	height: 48px;
}

#sbay-portal .sbay-brand.is-stacked .sbay-brand__name {
	max-width: 100%;
	overflow: visible;
	font-size: 16px;
	line-height: 1.25;
	overflow-wrap: anywhere;
	white-space: normal;
}

#sbay-portal .sbay-brand.is-compact .sbay-brand__mark,
#sbay-portal .sbay-brand.is-compact .sbay-brand__icon {
	width: 36px;
	height: 36px;
	font-size: 16px;
}

@media (max-width: 600px) {
	#sbay-portal .sbay-brand__name {
		max-width: 140px;
	}

	#sbay-portal .sbay-brand__logo {
		max-width: 120px;
	}

	#sbay-portal .sbay-brand.is-stacked .sbay-brand__name {
		max-width: 100%;
	}
}
/*
 * SpaceBay portal styles
 *
 * Table of contents
 * 1. Design tokens
 * 2. Dark theme tokens
 * 3. Page and boot screen
 * 4. Base elements inside the app
 * 5. Buttons and icon buttons
 * 6. Top bar
 * 7. User menu
 * 8. Layout shell and sidebar
 * 9. Cards and page content
 * 10. Welcome banner
 * 11. Empty states
 * 12. Page headers, tabs and alerts
 * 13. Spaces: badges, cards, header, actions
 * 14. Members: lists, cards, profile
 * 15. Forms, buttons and modal
 * 16. Sidebar spaces
 * 17. Composer and mentions
 * 18. Posts, media and link previews
 * 19. Comments
 * 20. Profiles, account settings and about
 * 21. Notifications and bell
 * 22. Search
 * 23. Moderation, reports, logo and account notices
 * 24. Accessibility helpers
 * 25. Media queries
 * 26. Login, signup and account security
 *
 * Every selector is scoped to SpaceBay elements (.sbay-*) so the theme
 * and other plugins are not affected.
 */

/* ==========================================================================
   1. Design tokens
   ========================================================================== */

#sbay-portal,
#sbay-portal .sbay-app {
	/* Brand colours come from the Brand colour setting (--sbay-c-*), SpaceBay blue by default. */
	--sbay-brand: var(--sbay-c-brand, #3f22ff);
	--sbay-btn-disabled-bd: transparent;
	--sbay-btn-disabled-bg: var(--sbay-fill);
	--sbay-btn-disabled-fg: var(--sbay-text-soft);
	--sbay-brand-strong: var(--sbay-c-brand-strong, #321bcc);
	--sbay-brand-soft: var(--sbay-c-brand-soft, #e8e4ff);
	--sbay-brand-muted: var(--sbay-c-brand-muted, #c5bdff);
	--sbay-leaf: var(--sbay-c-leaf, #8575f0);
	--sbay-mint: var(--sbay-c-mint, #ece9ff);
	--sbay-bg: #f1f3f6;
	--sbay-surface: #ffffff;
	--sbay-surface-alt: #f2f4f7;
	--sbay-border: #e4e7ec;
	/* Resting border of form fields: stronger than the hairline dividers so fields stay visible. */
	--sbay-field-border: #cfd5de;
	--sbay-field-focus: var(--sbay-brand);
	/* See-through fills for hover and resting controls: they work on the page and on cards alike. */
	--sbay-fill: rgba(16, 24, 40, 0.05);
	--sbay-fill-strong: rgba(16, 24, 40, 0.09);
	--sbay-skeleton: rgba(16, 24, 40, 0.08);
	--sbay-skeleton-shine: rgba(16, 24, 40, 0.03);
	--sbay-text: #1b2230;
	--sbay-text-soft: #5a6372;
	--sbay-focus: #2563eb;
	--sbay-link: var(--sbay-brand);
	--sbay-backdrop: rgba(16, 24, 40, 0.5);
	--sbay-danger: #b42318;
	--sbay-danger-strong: #912018;
	--sbay-danger-text: #ffffff;
	--sbay-radius: 12px;
	--sbay-radius-small: 8px;
	--sbay-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 2px 8px rgba(16, 24, 40, 0.03);
	--sbay-shadow-pop: 0 12px 32px rgba(16, 24, 40, 0.14), 0 2px 6px rgba(16, 24, 40, 0.06);
	--sbay-shadow-focus: 0 3px 12px rgba(16, 24, 40, 0.14), 0 1px 3px rgba(16, 24, 40, 0.1);
	--sbay-topbar-height: 72px;
	--sbay-sidebar-width: 240px;
	--sbay-page-width: 1004px;
	--sbay-gutter: 32px;
	--sbay-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ==========================================================================
   2. Dark theme tokens
   ========================================================================== */

#sbay-portal .sbay-app[data-sbay-theme="dark"] {
	--sbay-brand-soft: var(--sbay-c-dark-soft, #201c56);
	--sbay-brand-muted: var(--sbay-c-dark-muted, #2a1e8c);
	--sbay-leaf: var(--sbay-c-dark-leaf, #8d7ef1);
	--sbay-mint: var(--sbay-c-dark-soft, #201c56);
	--sbay-bg: #0f1217;
	--sbay-surface: #161a21;
	--sbay-surface-alt: #1c212a;
	--sbay-border: #2a303b;
	--sbay-field-border: #3a424f;
	--sbay-field-focus: var(--sbay-leaf);
	--sbay-fill: rgba(255, 255, 255, 0.06);
	--sbay-fill-strong: rgba(255, 255, 255, 0.1);
	--sbay-skeleton: rgba(255, 255, 255, 0.06);
	--sbay-skeleton-shine: rgba(255, 255, 255, 0.12);
	--sbay-text: #e8ebf0;
	--sbay-text-soft: #a6aebb;
	--sbay-focus: #93c5fd;
	--sbay-link: #b4a9ff;
	--sbay-backdrop: rgba(0, 0, 0, 0.65);
	--sbay-danger: #f97066;
	--sbay-danger-strong: #fda29b;
	--sbay-danger-text: #2a0b08;
	--sbay-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
	--sbay-shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.5);
	--sbay-shadow-focus: 0 3px 14px rgba(0, 0, 0, 0.6), 0 1px 3px rgba(0, 0, 0, 0.5);
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-nav__link.is-active,
#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-nav__link.is-active > .sbay-icon,
#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-empty__icon {
	color: var(--sbay-leaf);
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-rich a,
#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-muted a,
#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-chip.is-selected,
#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-action.is-on,
#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-link-button,
#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-bell__all,
#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-button--ghost,
#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-btn--ghost {
	color: var(--sbay-leaf);
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-button--ghost:hover,
#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-btn--ghost:hover:not(:disabled) {
	background: var(--sbay-brand-muted);
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-pill:not(.is-private):not(.is-secret):not(.is-archived) {
	background: var(--sbay-brand-soft);
	color: var(--sbay-leaf);
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-alert,
#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-form-error {
	background: #3b1512;
	color: #fecaca;
}

/* ==========================================================================
   3. Page and boot screen
   ========================================================================== */

.sbay-layout-standalone {
	margin: 0;
	background: #f1f3f6;
}

/* Keeps focused content clear of the sticky top bar. */
html:has(> body.sbay-layout-standalone) {
	scroll-padding-top: 96px;
}

#sbay-portal {
	font-family: var(--sbay-font);
}

#sbay-portal .sbay-portal__boot {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 60vh;
}

#sbay-portal .sbay-portal__spinner {
	width: 36px;
	height: 36px;
	border: 3px solid var(--sbay-brand-muted);
	border-top-color: var(--sbay-brand);
	border-radius: 50%;
	animation: sbay-spin 0.8s linear infinite;
}

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

/* ==========================================================================
   4. Base elements inside the app
   ========================================================================== */

#sbay-portal .sbay-app {
	min-height: 100vh;
	background: var(--sbay-bg);
	color: var(--sbay-text);
	font-family: var(--sbay-font);
	font-size: 15px;
	font-style: normal;
	font-weight: 400;
	letter-spacing: normal;
	line-height: 1.55;
	text-transform: none;
	-webkit-font-smoothing: antialiased;
}

.sbay-layout-theme #sbay-portal .sbay-app {
	min-height: 70vh;
}

#sbay-portal .sbay-app *,
#sbay-portal .sbay-app *::before,
#sbay-portal .sbay-app *::after {
	box-sizing: border-box;
}

#sbay-portal .sbay-app a {
	color: var(--sbay-brand);
}

/*
 * Focus is marked by a fill or an inset border, never a ring: no outline, no
 * outer glow. Mouse clicks show nothing (:focus-visible only).
 */
#sbay-portal .sbay-app :focus {
	outline: none;
}

#sbay-portal .sbay-app :focus-visible {
	outline: none;
	box-shadow: inset 0 0 0 2px var(--sbay-focus);
}

/*
 * Text fields show focus with a brand border, never a ring: no outline and no
 * glow, whatever the browser or the theme adds.
 */
#sbay-portal .sbay-app :is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="submit"], [type="button"], [type="color"]), select, textarea):focus, #sbay-portal .sbay-app :is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="submit"], [type="button"], [type="color"]), select, textarea):focus-visible {
	border-color: var(--sbay-field-focus);
	outline: none;
	box-shadow: none;
}

/* The borderless plain field (post title) keeps no border on focus; only its fill changes. */
#sbay-portal .sbay-app input.sbay-input--plain:focus,
#sbay-portal .sbay-app input.sbay-input--plain:focus-visible {
	border-color: transparent;
}

#sbay-portal .sbay-app h1,
#sbay-portal .sbay-app h2,
#sbay-portal .sbay-app p {
	margin: 0;
}

/*
 * Themes (block themes especially) style h1–h6 globally with their own font,
 * colour, weight and letter spacing. Headings inside the app use the app's
 * own type. :where() keeps this at class strength, so component classes win.
 */
#sbay-portal :where(.sbay-app) :where(h1, h2, h3, h4, h5, h6) {
	margin: 0;
	color: var(--sbay-text);
	font-family: var(--sbay-font);
	font-style: normal;
	font-weight: 600;
	letter-spacing: normal;
	line-height: 1.3;
	text-transform: none;
}

#sbay-portal :where(.sbay-app) :where(h1) {
	font-size: 26px;
}

#sbay-portal :where(.sbay-app) :where(h2) {
	font-size: 20px;
}

#sbay-portal :where(.sbay-app) :where(h3) {
	font-size: 17px;
}

#sbay-portal :where(.sbay-app) :where(h4, h5, h6) {
	font-size: 15px;
}

/*
 * Form controls start from the browser's own defaults, whatever the theme did to
 * bare buttons and inputs. Component classes then style them.
 * The reset is kept at the weakest strength that still beats theme styles (just the ID), so the
 * shared UI library (src/shared/ui.css, one ID + one class) wins over it.
 */
#sbay-portal :where(.sbay-app) :where(button, input, select, textarea, label, legend, fieldset) {
	all: revert;
	box-sizing: border-box;
	font-family: inherit;
	letter-spacing: normal;
	text-transform: none;
}

#sbay-portal .sbay-app [hidden] {
	display: none;
}

/* ==========================================================================
   5. Buttons and icon buttons
   ========================================================================== */

#sbay-portal .sbay-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 38px;
	padding: 0 16px;
	border: 1px solid var(--sbay-brand);
	border-radius: 8px;
	background: var(--sbay-brand);
	color: #ffffff;
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

#sbay-portal .sbay-app .sbay-button {
	color: #ffffff;
}

#sbay-portal .sbay-button:hover {
	background: var(--sbay-brand-strong);
}

/* Secondary buttons: a soft brand fill instead of an outline. */
#sbay-portal .sbay-app .sbay-button--ghost {
	border-color: transparent;
	background: var(--sbay-brand-soft);
	color: var(--sbay-brand-strong);
}

#sbay-portal .sbay-app .sbay-button--ghost:hover {
	background: var(--sbay-brand-muted);
}

#sbay-portal .sbay-button:focus-visible {
	background: var(--sbay-brand-strong);
	box-shadow: inset 0 0 0 2px rgb(255 255 255 / 0.7);
}

#sbay-portal .sbay-app .sbay-button--ghost:focus-visible {
	background: var(--sbay-brand-muted);
	box-shadow: none;
}

#sbay-portal .sbay-icon-button,
#sbay-portal .sbay-avatar-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--sbay-text-soft);
	cursor: pointer;
}

#sbay-portal .sbay-icon-button:hover,
#sbay-portal .sbay-icon-button:focus-visible,
#sbay-portal .sbay-avatar-button:focus-visible {
	background: var(--sbay-brand-soft);
	color: var(--sbay-brand);
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-icon-button:hover,
#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-icon-button:focus-visible {
	color: var(--sbay-leaf);
}

/* ==========================================================================
   6. Top bar
   ========================================================================== */

#sbay-portal .sbay-topbar {
	position: sticky;
	top: var(--sbay-adminbar, 0px);
	z-index: 20;
	height: var(--sbay-topbar-height);
	background: var(--sbay-bg);
}

/* Spans the whole main area: the greeting starts at the page's left edge, the actions sit at the right edge. */
#sbay-portal .sbay-topbar__inner {
	display: flex;
	align-items: center;
	gap: 16px;
	height: 100%;
	padding: 0 var(--sbay-gutter);
}

/* Host themes often give forms, paragraphs and inputs a margin; any margin here pushes an item off the bar's centre line. */
#sbay-portal .sbay-app .sbay-topbar,
#sbay-portal .sbay-app .sbay-topbar__inner,
#sbay-portal .sbay-app .sbay-topbar__inner > *,
#sbay-portal .sbay-app .sbay-topbar__actions > *,
#sbay-portal .sbay-app .sbay-topbar__search input,
#sbay-portal .sbay-app .sbay-greeting__title {
	margin-block: 0 !important;
}

#sbay-portal .sbay-app .sbay-topbar__search {
	padding: 0;
	border: 0;
}

#sbay-portal .sbay-topbar__menu,
#sbay-portal .sbay-app .sbay-brand.sbay-topbar__brand {
	display: none;
}

/* Greeting and actions take equal shares around the search, so the search sits in the middle of the bar. */
#sbay-portal .sbay-greeting {
	flex: 1 1 140px;
	min-width: 0;
}

#sbay-portal .sbay-app .sbay-greeting__title {
	overflow: hidden;
	color: var(--sbay-text);
	font-size: 18px;
	font-weight: 600;
	line-height: 1.35;
	text-overflow: ellipsis;
	white-space: nowrap;
}

#sbay-portal .sbay-app .sbay-greeting__text {
	margin-top: 2px;
	overflow: hidden;
	color: var(--sbay-text-soft);
	font-size: 13px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

#sbay-portal .sbay-topbar__actions {
	display: flex;
	flex: 1 1 140px;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
}

/* ==========================================================================
   7. User menu
   ========================================================================== */

#sbay-portal .sbay-user-menu {
	position: relative;
	display: flex;
}

#sbay-portal .sbay-avatar {
	display: block;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	object-fit: cover;
}

/* The top bar avatar is as tall as the search box and the icon buttons, with no ring. */
#sbay-portal .sbay-avatar-button .sbay-avatar {
	width: 40px;
	height: 40px;
}

#sbay-portal .sbay-avatar-button:hover .sbay-avatar {
	opacity: 0.88;
}

#sbay-portal .sbay-dropdown {
	position: absolute;
	top: calc(100% + 10px);
	inset-inline-end: 0;
	min-width: 240px;
	padding: 8px;
	border-radius: var(--sbay-radius);
	background: var(--sbay-surface);
	box-shadow: var(--sbay-shadow-pop);
}

#sbay-portal .sbay-dropdown__head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 4px;
	padding: 8px 10px 12px;
	border-bottom: 1px solid var(--sbay-border);
}

#sbay-portal .sbay-dropdown__name {
	min-width: 0;
	overflow: hidden;
	font-weight: 600;
	text-overflow: ellipsis;
	white-space: nowrap;
}

#sbay-portal .sbay-app .sbay-dropdown__item {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 2px;
	padding: 9px 10px;
	border-radius: 8px;
	color: var(--sbay-text);
	font-size: 14px;
	text-decoration: none;
}

#sbay-portal .sbay-dropdown__item .sbay-icon {
	color: var(--sbay-text-soft);
}

#sbay-portal .sbay-dropdown__item:hover,
#sbay-portal .sbay-dropdown__item:focus-visible {
	background: var(--sbay-fill);
}

/* ==========================================================================
   8. Layout shell and sidebar
   ========================================================================== */

#sbay-portal .sbay-shell {
	display: flex;
	align-items: stretch;
	min-height: 100vh;
	/* Sidebar, top bar and page share one surface; cards stand out from it. */
	background: var(--sbay-bg);
}

.sbay-layout-theme #sbay-portal .sbay-shell {
	min-height: 70vh;
	border-radius: var(--sbay-radius);
	overflow: clip;
}

#sbay-portal .sbay-sidebar {
	position: sticky;
	top: 0;
	z-index: 21;
	display: flex;
	flex: 0 0 var(--sbay-sidebar-width);
	flex-direction: column;
	width: var(--sbay-sidebar-width);
	height: 100vh;
	background: var(--sbay-bg);
}

/* Inside a theme page the sidebar still stays put while the page scrolls; a long list scrolls inside it. */
.sbay-layout-theme #sbay-portal .sbay-sidebar {
	top: var(--sbay-adminbar, 0px);
	align-self: flex-start;
	height: calc(100vh - var(--sbay-adminbar, 0px));
	height: calc(100dvh - var(--sbay-adminbar, 0px));
}

/* The WordPress admin bar is fixed (46px, then 32px from 783px); sticky parts start below it. */
@media (min-width: 601px) {
	.sbay-layout-theme.admin-bar {
		--sbay-adminbar: 46px;
	}
}

@media (min-width: 783px) {
	.sbay-layout-theme.admin-bar {
		--sbay-adminbar: 32px;
	}
}

/*
 * A theme that hides overflow on the body or a wrapper (Astra and many others set body { overflow-x: hidden })
 * makes that element the scroll container for sticky, so the sidebar scrolls away with the page. In the full-page
 * layout this always bites, because the html element has its own overflow (below), so the body's overflow is no
 * longer handed to the viewport. Clip keeps the same cut-off without a scroll container.
 */
body.sbay-layout-standalone,
body.sbay-layout-theme,
body.sbay-layout-theme :has(#sbay-portal) {
	overflow-x: clip !important;
	overflow-y: visible !important;
}

/* Add-on loading cards (.sbay-card.sbay-skeleton) keep the plain shimmering card they had before the shared skeleton. */
#sbay-portal .sbay-app .sbay-card.sbay-skeleton {
	min-height: 180px;
	border-radius: var(--sbay-radius);
	background: linear-gradient(90deg, var(--sbay-surface) 0%, var(--sbay-surface-alt) 50%, var(--sbay-surface) 100%);
	background-size: 200% 100%;
}

/* The shared brand link sets its text colour, but ".sbay-app a" is more specific than the shared rule. */
#sbay-portal .sbay-app a.sbay-brand {
	color: var(--sbay-text);
}

#sbay-portal .sbay-sidebar__brand {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	height: var(--sbay-topbar-height);
	padding: 0 24px;
}

/* Stacked headings (icon or logo above the name) are taller than the top bar and centred. */
#sbay-portal .sbay-sidebar__brand.is-stacked {
	position: relative;
	justify-content: center;
	height: auto;
	min-height: var(--sbay-topbar-height);
	padding: 20px 24px 12px;
}

#sbay-portal .sbay-sidebar__brand.is-stacked .sbay-sidebar__close {
	position: absolute;
	top: 8px;
	inset-inline-end: 8px;
}

#sbay-portal .sbay-sidebar__close {
	display: none;
}

/* Logo and primary links stay on top, the spaces list scrolls in the middle, the footer stays pinned at the bottom. */
#sbay-portal .sbay-app .sbay-sidebar__primary {
	flex: 0 0 auto;
	padding: 8px 16px 0;
}

/* The scroll bar is transparent until the pointer is over the sidebar; its gutter is always reserved, so nothing shifts. */
#sbay-portal .sbay-sidebar__scroll {
	flex: 1 1 auto;
	min-height: 0;
	padding: 0 6px 12px 16px;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-gutter: stable;
	scrollbar-width: thin;
	scrollbar-color: transparent transparent;
}

#sbay-portal .sbay-sidebar:hover .sbay-sidebar__scroll {
	scrollbar-color: var(--sbay-fill-strong) transparent;
}

#sbay-portal .sbay-sidebar__scroll::-webkit-scrollbar {
	width: 8px;
}

#sbay-portal .sbay-sidebar__scroll::-webkit-scrollbar-thumb {
	border-radius: 4px;
	background: transparent;
}

#sbay-portal .sbay-sidebar:hover .sbay-sidebar__scroll::-webkit-scrollbar-thumb {
	background: var(--sbay-fill-strong);
}

#sbay-portal .sbay-app .sbay-sidebar__foot {
	flex: 0 0 auto;
	padding: 8px 16px 16px;
	box-shadow: 0 -1px 0 var(--sbay-fill);
}

/* The page scroll bar is always there, so the page width never jumps between short and long pages. */
html:has(.sbay-app):not(:has(.sbay-layout-theme)) {
	overflow-y: scroll;
	background: #f1f3f6;
	scrollbar-gutter: stable;
	scrollbar-width: thin;
}

html:has(.sbay-app[data-sbay-theme="dark"]):not(:has(.sbay-layout-theme)) {
	background: #0f1217;
	color-scheme: dark;
}

#sbay-portal .sbay-nav {
	display: grid;
	gap: 2px;
	margin: 0;
	padding: 0;
	list-style: none;
}

#sbay-portal .sbay-app .sbay-nav__link {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 42px;
	padding: 9px 14px;
	border-radius: 8px;
	color: var(--sbay-text);
	font-size: 15px;
	font-weight: 500;
	text-decoration: none;
}

#sbay-portal .sbay-nav__link > .sbay-icon {
	color: var(--sbay-text-soft);
}

#sbay-portal .sbay-nav__link:hover,
#sbay-portal .sbay-nav__link:focus-visible {
	background: var(--sbay-fill);
	color: var(--sbay-text);
}

#sbay-portal .sbay-app .sbay-nav__link.is-active {
	background: var(--sbay-brand-soft);
	color: var(--sbay-brand-strong);
	font-weight: 600;
}

#sbay-portal .sbay-app .sbay-nav__link.is-active > .sbay-icon {
	color: var(--sbay-brand);
}

#sbay-portal .sbay-app .sbay-nav__heading {
	margin: 24px 14px 8px;
	color: var(--sbay-text-soft);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

#sbay-portal .sbay-app .sbay-nav__empty {
	margin: 0 14px;
	color: var(--sbay-text-soft);
	font-size: 13px;
}

#sbay-portal .sbay-scrim {
	display: none;
}

#sbay-portal .sbay-column {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-width: 0;
}

/* The page block is centred in the area right of the sidebar; it stops growing at the page width, so wide screens get margins, not wider text. */
#sbay-portal .sbay-main {
	flex: 1 1 auto;
	width: 100%;
	container: sbay-main / inline-size;
	max-width: calc(var(--sbay-page-width) + 2 * var(--sbay-gutter));
	margin: 0;
	margin-inline: auto;
	padding: 24px var(--sbay-gutter) 56px;
}

#sbay-portal .sbay-main:focus {
	outline: none;
}

/* ==========================================================================
   9. Cards and page content
   ========================================================================== */

#sbay-portal .sbay-page {
	display: grid;
	gap: 20px;
}

#sbay-portal .sbay-card {
	padding: 24px;
	border-radius: var(--sbay-radius);
	background: var(--sbay-surface);
	box-shadow: var(--sbay-shadow);
}

/* ==========================================================================
   10. Welcome banner
   ========================================================================== */

#sbay-portal .sbay-welcome {
	position: relative;
	overflow: hidden;
	min-height: 160px;
	padding: 30px 32px;
	padding-inline-end: 330px;
	border-radius: var(--sbay-radius);
	background:
		radial-gradient(120% 140% at 100% 0%, var(--sbay-mint) 0%, transparent 60%),
		linear-gradient(120deg, var(--sbay-surface) 0%, var(--sbay-brand-soft) 100%);
}

#sbay-portal .sbay-app .sbay-welcome__title {
	position: relative;
	color: var(--sbay-text);
	font-size: 26px;
	font-weight: 700;
	line-height: 1.25;
}

#sbay-portal .sbay-app .sbay-welcome__text {
	position: relative;
	margin-top: 8px;
	color: var(--sbay-text-soft);
}

#sbay-portal .sbay-welcome__art {
	position: absolute;
	inset-block: 0;
	inset-inline-end: 8px;
	width: 310px;
	height: 100%;
}

#sbay-portal .sbay-welcome-art__dot {
	fill: var(--sbay-brand);
	fill-opacity: 0.22;
}

#sbay-portal .sbay-welcome-art__grid {
	opacity: 0.9;
}

#sbay-portal .sbay-welcome-art__glow {
	stop-color: var(--sbay-leaf);
}

#sbay-portal .sbay-welcome-art__ring {
	fill: var(--sbay-surface);
}

#sbay-portal .sbay-welcome-art__card {
	fill: var(--sbay-surface);
	filter: drop-shadow(0 4px 10px rgba(16, 24, 40, 0.12));
}

#sbay-portal .sbay-welcome-art__line {
	fill: var(--sbay-border);
}

#sbay-portal .sbay-welcome-art__line.is-brand {
	fill: var(--sbay-brand-muted);
}

#sbay-portal .sbay-welcome-art__typing {
	fill: var(--sbay-brand);
}

#sbay-portal .sbay-welcome-art__spark {
	fill: var(--sbay-leaf);
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-welcome {
	background:
		radial-gradient(120% 140% at 100% 0%, var(--sbay-brand-muted) 0%, transparent 60%),
		linear-gradient(120deg, var(--sbay-surface) 0%, var(--sbay-brand-soft) 100%);
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-welcome-art__card {
	fill: var(--sbay-surface-alt);
	filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4));
}

@container sbay-main (max-width: 700px) {
	#sbay-portal .sbay-welcome {
		padding-inline-end: 28px;
	}

	#sbay-portal .sbay-welcome__art {
		display: none;
	}
}

/* Feed column (680px at most) with a right rail (300px) */

#sbay-portal .sbay-split {
	display: grid;
	gap: 24px;
	align-items: start;
}

#sbay-portal .sbay-split.has-rail {
	grid-template-columns: minmax(0, 680px) 300px;
}

#sbay-portal .sbay-split__main {
	display: grid;
	gap: 20px;
	min-width: 0;
}

#sbay-portal .sbay-rail {
	display: grid;
	gap: 16px;
	min-width: 0;
}

/* Sticks under the top bar only while it fits the window (PageRail sets the class). */
#sbay-portal .sbay-rail.is-sticky {
	position: sticky;
	top: calc(var(--sbay-topbar-height) + var(--sbay-adminbar, 0px) + 16px);
}

#sbay-portal .sbay-app .sbay-rail-about__text {
	margin: 0 0 12px;
	color: var(--sbay-text);
	font-size: 14px;
	line-height: 1.5;
	overflow-wrap: anywhere;
}

#sbay-portal .sbay-rail-facts {
	display: grid;
	gap: 8px;
	margin: 0;
}

#sbay-portal .sbay-rail-facts > div {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	font-size: 13px;
}

#sbay-portal .sbay-rail-facts dt {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--sbay-text-soft);
}

#sbay-portal .sbay-rail-facts dt .sbay-icon {
	flex-shrink: 0;
}

#sbay-portal .sbay-rail-facts dd {
	margin: 0;
	font-weight: 600;
	text-align: end;
}

#sbay-portal .sbay-app .sbay-rail-about__status {
	margin: 12px 0 0;
	padding: 6px 10px;
	border-radius: 8px;
	background: var(--sbay-brand-soft);
	color: var(--sbay-brand-strong);
	font-size: 13px;
	font-weight: 600;
}

/* Dark mode: brand-strong is too dim on the dark soft chip, so use the lighter leaf tone. */
#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-rail-about__status {
	color: var(--sbay-leaf);
}

/* The info note above the feed and the description in the rail say the same: show one. */
@media (min-width: 1200px) {
	#sbay-portal .sbay-app .sbay-split__main > .sbay-space-info {
		display: none;
	}
}

@media (max-width: 1199px) {
	#sbay-portal .sbay-app .sbay-rail-about__text {
		display: none;
	}
}

#sbay-portal .sbay-rail-card {
	padding: 18px 18px 14px;
}

#sbay-portal .sbay-app .sbay-rail-card__title {
	margin-bottom: 10px;
	font-size: 15px;
	font-weight: 600;
}

#sbay-portal .sbay-rail-list {
	display: grid;
	gap: 2px;
	margin: 0 -8px;
	padding: 0;
	list-style: none;
}

#sbay-portal .sbay-app .sbay-rail-list__link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 7px 8px;
	border-radius: 8px;
	color: var(--sbay-text);
	text-decoration: none;
}

#sbay-portal .sbay-app .sbay-rail-list__link:hover,
#sbay-portal .sbay-app .sbay-rail-list__link:focus-visible {
	background: var(--sbay-fill);
}

#sbay-portal .sbay-rail-list__text {
	display: grid;
	min-width: 0;
}

#sbay-portal .sbay-rail-list__title,
#sbay-portal .sbay-rail-list__meta {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

#sbay-portal .sbay-rail-list__title {
	font-size: 14px;
	font-weight: 600;
}

#sbay-portal .sbay-rail-list__meta {
	color: var(--sbay-text-soft);
	font-size: 12px;
}

#sbay-portal .sbay-app .sbay-rail-card__more {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	margin-top: 10px;
	color: var(--sbay-brand-strong);
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-rail-card__more {
	color: var(--sbay-leaf);
}

/* Without a composer the feed opens with the tabs and topic chips: the rail starts level with the first post instead of with the tabs. */
@media (min-width: 1200px) {
	#sbay-portal .sbay-split.has-rail.is-rail-below-filters {
		gap: 20px 24px;
	}

	#sbay-portal .sbay-split.is-rail-below-filters > .sbay-split__main {
		display: contents;
	}

	#sbay-portal .sbay-split.is-rail-below-filters > .sbay-split__main > * {
		grid-column: 1;
	}

	#sbay-portal .sbay-split.is-rail-below-filters > .sbay-rail {
		grid-column: 2;
		grid-row: 2 / span 3;
	}
}

/* Under 1200px the rail drops below the feed, as cards side by side. */
@media (max-width: 1199px) {
	#sbay-portal .sbay-split.has-rail {
		grid-template-columns: minmax(0, 1fr);
	}

	#sbay-portal .sbay-rail {
		grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
		align-items: start;
	}

	#sbay-portal .sbay-rail.is-sticky {
		position: static;
	}
}

@media (max-width: 767px) {
	#sbay-portal .sbay-split--rail-hides-on-phone > .sbay-rail {
		display: none;
	}
}

/* Member activity cards on Home */

#sbay-portal .sbay-stats {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
}

#sbay-portal .sbay-stat {
	--sbay-tone: var(--sbay-brand);
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 28px 8px;
	padding: 16px 18px 18px;
	border-radius: var(--sbay-radius);
	background: var(--sbay-surface);
	box-shadow: var(--sbay-shadow);
}

#sbay-portal .sbay-stat.is-brand {
	--sbay-tone: var(--sbay-brand);
}

#sbay-portal .sbay-stat.is-blue {
	--sbay-tone: #1d4ed8;
}

#sbay-portal .sbay-stat.is-rose {
	--sbay-tone: #be123c;
}

#sbay-portal .sbay-stat.is-violet {
	--sbay-tone: #6d28d9;
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-stat.is-brand {
	--sbay-tone: var(--sbay-leaf);
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-stat.is-blue {
	--sbay-tone: #93c5fd;
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-stat.is-rose {
	--sbay-tone: #fda4af;
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-stat.is-violet {
	--sbay-tone: #c4b5fd;
}

#sbay-portal .sbay-stat__label {
	overflow: hidden;
	font-size: 14px;
	font-weight: 500;
	text-overflow: ellipsis;
	white-space: nowrap;
}

#sbay-portal .sbay-stat__icon {
	color: var(--sbay-tone);
}

#sbay-portal .sbay-stat__value {
	grid-column: 1 / -1;
	color: var(--sbay-tone);
	font-size: 26px;
	font-weight: 700;
	line-height: 1.1;
}

/* ==========================================================================
   11. Empty states
   ========================================================================== */

#sbay-portal .sbay-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	padding: 48px 24px;
	text-align: center;
}

#sbay-portal .sbay-empty__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--sbay-brand-soft);
	color: var(--sbay-brand);
}

#sbay-portal .sbay-app .sbay-empty__title {
	font-size: 19px;
}

#sbay-portal .sbay-app .sbay-empty__text {
	max-width: 420px;
	margin-bottom: 8px;
	color: var(--sbay-text-soft);
}

/* ==========================================================================
   12. Page headers, tabs and alerts
   ========================================================================== */

/* Tabs are filled pills, no underline. The row starts at the container's edge, so the active pill lines up with the cards below. */
#sbay-portal .sbay-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

#sbay-portal .sbay-tabs--in-card {
	padding: 4px 12px 14px;
}

#sbay-portal .sbay-tab {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 38px;
	padding: 8px 12px;
	border: 0;
	border-radius: var(--sbay-radius-small);
	background: none;
	color: var(--sbay-text-soft);
	font: inherit;
	font-weight: 500;
	cursor: pointer;
}

#sbay-portal .sbay-tab:hover,
#sbay-portal .sbay-tab:focus-visible {
	background: var(--sbay-fill);
	color: var(--sbay-text);
}

#sbay-portal .sbay-tab.is-active {
	background: var(--sbay-brand-soft);
	color: var(--sbay-brand-strong);
	font-weight: 600;
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-tab.is-active {
	color: var(--sbay-leaf);
}

#sbay-portal .sbay-app .sbay-tab .sbay-count {
	margin-inline-start: 0;
}

#sbay-portal .sbay-app .sbay-alert {
	padding: 12px 16px;
	border-radius: var(--sbay-radius-small);
	background: #fde8e6;
	color: #9f1c13;
	font-weight: 500;
}

#sbay-portal .sbay-app .sbay-alert.is-success {
	background: var(--sbay-brand-soft);
	color: var(--sbay-brand-strong);
}

#sbay-portal .sbay-app .sbay-muted {
	color: var(--sbay-text-soft);
}

#sbay-portal .sbay-section-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}

#sbay-portal .sbay-app .sbay-section-head__title {
	margin-bottom: 8px;
	font-size: 17px;
}

#sbay-portal .sbay-section-head .sbay-section-head__title {
	margin-bottom: 0;
}

#sbay-portal .sbay-app .sbay-subhead {
	margin: 20px 0 6px;
	font-size: 14px;
	color: var(--sbay-text-soft);
}

/* Loading placeholders shaped like the content (SkeletonBlock.vue). */
#sbay-portal .sbay-skeletons {
	display: grid;
	align-content: start;
	gap: 16px;
}

#sbay-portal .sbay-skeleton-bone {
	display: block;
	flex-shrink: 0;
	max-width: 100%;
	border-radius: 6px;
	background: linear-gradient(90deg, var(--sbay-skeleton) 0%, var(--sbay-skeleton-shine) 50%, var(--sbay-skeleton) 100%);
	background-size: 200% 100%;
	animation: sbay-shimmer 1.4s ease-in-out infinite;
}

#sbay-portal .sbay-skeleton-bone--line {
	height: 12px;
}

#sbay-portal .sbay-skeleton-bone--line.is-small {
	height: 10px;
}

#sbay-portal .sbay-skeleton-bone--title {
	height: 18px;
}

#sbay-portal .sbay-skeleton-bone--title.is-large {
	height: 26px;
}

#sbay-portal .sbay-skeleton-bone--circle,
#sbay-portal .sbay-skeleton-bone--square {
	width: var(--size, 40px);
	height: var(--size, 40px);
}

#sbay-portal .sbay-skeleton-bone--circle {
	border-radius: 50%;
}

#sbay-portal .sbay-skeleton-bone--square {
	border-radius: 10px;
}

#sbay-portal .sbay-skeleton-bone--pill {
	height: 28px;
	border-radius: 999px;
}

#sbay-portal .sbay-skeleton-bone--pill.is-button {
	height: 36px;
	border-radius: var(--sbay-radius-small);
}

#sbay-portal .sbay-skeleton-bone--pill.is-end {
	margin-inline-start: auto;
}

#sbay-portal .sbay-skeleton-bone--block {
	width: 100%;
	border-radius: var(--sbay-radius-small);
}

#sbay-portal .sbay-skeleton-bone--bubble {
	height: 38px;
	border-radius: 16px;
}

#sbay-portal .sbay-skeleton-card {
	display: grid;
	gap: 14px;
}

#sbay-portal .sbay-skeleton-row {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

#sbay-portal .sbay-skeleton-row.is-event {
	align-items: flex-start;
	gap: 16px;
}

#sbay-portal .sbay-skeleton-stack {
	display: grid;
	flex: 1 1 auto;
	gap: 8px;
	min-width: 0;
}

#sbay-portal .sbay-skeleton-list {
	display: grid;
	gap: 16px;
}

#sbay-portal .sbay-skeleton-list .sbay-skeleton-row.is-nav {
	gap: 10px;
	padding: 7px 12px;
}

#sbay-portal .sbay-skeleton-list .sbay-skeleton-row.is-inbox {
	padding: 4px 10px;
}

#sbay-portal .sbay-skeleton-bar {
	display: flex;
	gap: 8px;
	padding-top: 12px;
	border-top: 1px solid var(--sbay-border);
}

#sbay-portal .sbay-skeleton-post {
	padding: 18px 20px 14px;
}

#sbay-portal .sbay-skeleton-space,
#sbay-portal .sbay-skeleton-header {
	gap: 0;
	overflow: hidden;
	padding: 0;
}

#sbay-portal .sbay-skeleton-space__band,
#sbay-portal .sbay-skeleton-header__band {
	height: 64px;
	border-radius: 0;
}

#sbay-portal .sbay-skeleton-header__band {
	height: 110px;
}

#sbay-portal .sbay-skeleton-header.is-profile .sbay-skeleton-header__band {
	height: 120px;
}

#sbay-portal .sbay-skeleton-space__body {
	display: grid;
	justify-items: start;
	gap: 10px;
	padding: 0 20px 20px;
}

#sbay-portal .sbay-skeleton-space__badge,
#sbay-portal .sbay-skeleton-header__badge {
	margin-top: -26px;
	background-color: var(--sbay-surface);
	box-shadow: 0 0 0 3px var(--sbay-surface);
}

#sbay-portal .sbay-skeleton-header__body {
	display: flex;
	align-items: flex-end;
	gap: 16px;
	padding: 0 24px 24px;
}

#sbay-portal .sbay-skeleton-header__badge {
	margin-top: -38px;
}

#sbay-portal .sbay-skeleton-member {
	justify-items: center;
	gap: 10px;
}

#sbay-portal .sbay-skeleton-mod {
	gap: 16px;
}

#sbay-portal .sbay-skeleton-thread {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 16px;
}

#sbay-portal .sbay-skeleton-bubble,
#sbay-portal .sbay-skeleton-comment {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	max-width: min(420px, 80%);
}

#sbay-portal .sbay-skeleton-bubble .sbay-skeleton-bone--bubble,
#sbay-portal .sbay-skeleton-comment .sbay-skeleton-bone--bubble {
	min-width: 120px;
}

#sbay-portal .sbay-skeleton-bubble {
	width: 100%;
}

#sbay-portal .sbay-skeleton-bubble.is-mine {
	align-self: flex-end;
	justify-content: flex-end;
}

#sbay-portal .sbay-skeleton-comment {
	align-items: flex-start;
	max-width: 100%;
}

#sbay-portal .sbay-skeleton-comment .sbay-skeleton-bone--bubble {
	height: 52px;
}

#sbay-portal .sbay-skeletons--nav .sbay-skeleton-list {
	gap: 2px;
}

#sbay-portal .sbay-skeletons--nav .sbay-skeleton-row.is-nav {
	min-height: 38px;
}

#sbay-portal .sbay-skeletons--nav .sbay-skeleton-bone--square {
	border-radius: 7px;
}

#sbay-portal .sbay-nav__heading .sbay-skeleton-bone {
	margin-top: 4px;
}

#sbay-portal .sbay-skeletons--inbox .sbay-skeleton-list {
	gap: 0;
}

#sbay-portal .sbay-skeletons--inbox .sbay-skeleton-list .sbay-skeleton-row.is-inbox {
	padding: 10px;
}

#sbay-portal .sbay-thread__loading {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-height: 0;
	overflow: hidden;
}

#sbay-portal .sbay-bell__loading {
	padding: 14px;
}

#sbay-portal .sbay-bell__loading .sbay-skeleton-list,
#sbay-portal .sbay-modal .sbay-skeleton-list {
	gap: 14px;
}

#sbay-portal .sbay-stat__value .sbay-skeleton-bone {
	width: 48px;
	height: 26px;
}

#sbay-portal .sbay-greeting__text .sbay-skeleton-bone {
	width: 160px;
	height: 10px;
	margin-top: 5px;
}

#sbay-portal .sbay-load-more {
	justify-self: center;
}

/* Page header with a back link, and pages with a side sub-navigation */

#sbay-portal .sbay-page-header__lead {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

#sbay-portal .sbay-app .sbay-page-header__back {
	margin-inline-start: -8px;
	color: var(--sbay-text);
}

#sbay-portal [dir="rtl"] .sbay-page-header__back .sbay-icon {
	transform: scaleX(-1);
}

#sbay-portal .sbay-subnav-layout {
	display: grid;
	grid-template-columns: 260px minmax(0, 1fr);
	gap: 24px;
	align-items: start;
}

#sbay-portal .sbay-subnav {
	position: sticky;
	top: calc(var(--sbay-topbar-height) + var(--sbay-adminbar, 0px) + 24px);
	display: grid;
	gap: 2px;
	padding: 10px;
	border-radius: var(--sbay-radius);
	background: var(--sbay-surface);
	box-shadow: var(--sbay-shadow);
}

#sbay-portal .sbay-app .sbay-subnav__item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 12px;
	border-radius: 8px;
	color: var(--sbay-text);
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
}

#sbay-portal .sbay-subnav__item .sbay-icon {
	color: var(--sbay-text-soft);
}

#sbay-portal .sbay-subnav__item:hover,
#sbay-portal .sbay-subnav__item:focus-visible {
	background: var(--sbay-fill);
}

#sbay-portal .sbay-app .sbay-subnav__item.is-active {
	background: var(--sbay-brand-soft);
	color: var(--sbay-brand-strong);
	font-weight: 600;
}

#sbay-portal .sbay-app .sbay-subnav__item.is-active .sbay-icon {
	color: var(--sbay-brand);
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-subnav__item.is-active,
#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-subnav__item.is-active .sbay-icon {
	color: var(--sbay-leaf);
}

#sbay-portal .sbay-subnav-layout__content {
	display: grid;
	gap: 16px;
	min-width: 0;
}

#sbay-portal .sbay-app .sbay-subnav-layout__title {
	margin: 0;
	font-size: 19px;
	font-weight: 600;
}

/* ==========================================================================
   13. Spaces: badges, cards, header, actions
   ========================================================================== */

#sbay-portal .sbay-space-badge--small {
	width: 24px;
	height: 24px;
	border-radius: 7px;
	font-size: 11px;
}

#sbay-portal .sbay-space-badge--small .sbay-space-badge__icon {
	width: 66%;
	height: 66%;
}

#sbay-portal .sbay-space-badge--xl {
	background: var(--sbay-badge);
	color: #ffffff;
}

#sbay-portal .sbay-space-badge--xl {
	width: 76px;
	height: 76px;
	border: 4px solid var(--sbay-surface);
	border-radius: 20px;
	font-size: 32px;
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-space-badge:not(.sbay-space-badge--large):not(.sbay-space-badge--xl):not(.has-image) {
	background: color-mix(in srgb, var(--sbay-badge) 26%, var(--sbay-surface));
	color: color-mix(in srgb, var(--sbay-badge) 40%, #ffffff);
}

#sbay-portal .sbay-card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

#sbay-portal .sbay-space-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	padding: 0;
}

#sbay-portal .sbay-space-card__band {
	position: relative;
	height: 64px;
}

/* A soft wash of the space colour with a dot texture, so the badge stands out. */
#sbay-portal .sbay-space-card__band::after,
#sbay-portal .sbay-space-header__band::after {
	content: "";
	position: absolute;
	inset: 0;
	background:
		radial-gradient(circle, rgba(255, 255, 255, 0.35) 1.2px, transparent 1.6px) 0 0 / 14px 14px,
		linear-gradient(120deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.55));
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-space-card__band::after,
#sbay-portal .sbay-space-header__band::after {
	background:
		radial-gradient(circle, rgba(255, 255, 255, 0.12) 1.2px, transparent 1.6px) 0 0 / 14px 14px,
		linear-gradient(120deg, rgba(22, 26, 33, 0.72), rgba(22, 26, 33, 0.5));
}

#sbay-portal .sbay-space-card__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	padding: 0 20px 16px;
}

#sbay-portal .sbay-space-card__body .sbay-space-badge {
	position: relative;
	margin-top: -28px;
	margin-bottom: 4px;
	border: 3px solid var(--sbay-surface);
	box-shadow: 0 4px 12px rgba(16, 24, 40, 0.12);
	box-sizing: content-box;
}

#sbay-portal .sbay-app .sbay-space-card__title {
	color: var(--sbay-text);
	font-size: 17px;
	font-weight: 700;
	text-decoration: none;
}

#sbay-portal .sbay-app .sbay-space-card__title:hover {
	color: var(--sbay-brand);
}

#sbay-portal .sbay-app .sbay-space-card__meta,
#sbay-portal .sbay-app .sbay-space-header__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	color: var(--sbay-text-soft);
	font-size: 13px;
}

#sbay-portal .sbay-app .sbay-space-card__text {
	align-self: stretch;
	display: -webkit-box;
	overflow: hidden;
	color: var(--sbay-text-soft);
	font-size: 14px;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}

#sbay-portal .sbay-space-card__footer {
	padding: 0 20px 20px;
}

#sbay-portal .sbay-space-action {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

#sbay-portal .sbay-status-chip {
	padding: 6px 12px;
	border-radius: 999px;
	background: var(--sbay-surface-alt);
	color: var(--sbay-text-soft);
	font-size: 13px;
	font-weight: 600;
}

#sbay-portal .sbay-space-header {
	overflow: hidden;
	padding: 0;
}

#sbay-portal .sbay-space-header__band {
	position: relative;
	height: 110px;
}

#sbay-portal .sbay-space-header__body {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 16px;
	padding: 0 24px 20px;
}

#sbay-portal .sbay-space-header__body > .sbay-space-badge {
	position: relative;
	margin-top: -38px;
	box-shadow: 0 6px 16px rgba(16, 24, 40, 0.14);
}

#sbay-portal .sbay-space-header__info {
	flex: 1 1 280px;
	min-width: 0;
	padding-top: 14px;
}

#sbay-portal .sbay-app .sbay-space-header__title {
	font-size: 26px;
	line-height: 1.2;
}

#sbay-portal .sbay-app .sbay-space-header__meta {
	margin-top: 6px;
}

#sbay-portal .sbay-app .sbay-space-info {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 12px 12px 12px 16px;
	border-radius: var(--sbay-radius-small);
	background: var(--sbay-brand-soft);
	color: var(--sbay-text);
	font-size: 14px;
	line-height: 1.5;
}

#sbay-portal .sbay-app .sbay-space-info__icon {
	flex: none;
	margin-top: 1px;
	color: var(--sbay-brand);
}

#sbay-portal .sbay-app .sbay-space-info__text {
	flex: 1;
	min-width: 0;
	margin: 0;
	overflow-wrap: anywhere;
}

#sbay-portal .sbay-app .sbay-space-info__close {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	margin: -2px 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--sbay-text-soft);
	cursor: pointer;
}

#sbay-portal .sbay-app .sbay-space-info__close:hover,
#sbay-portal .sbay-app .sbay-space-info__close:focus-visible {
	background: var(--sbay-brand-muted);
	color: var(--sbay-text);
	outline: none;
}

#sbay-portal .sbay-manage {
	display: grid;
	gap: 20px;
}

/* ==========================================================================
   14. Members: lists, cards, profile
   ========================================================================== */

#sbay-portal .sbay-member-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

#sbay-portal .sbay-member-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 0;
	border-top: 1px solid var(--sbay-border);
}

#sbay-portal .sbay-member-row:first-child {
	border-top: 0;
}

#sbay-portal .sbay-member-row__avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
}

#sbay-portal .sbay-member-row__main {
	display: grid;
	flex: 1 1 auto;
	min-width: 0;
}

#sbay-portal .sbay-app .sbay-member-row__name {
	color: var(--sbay-text);
	font-weight: 600;
	text-decoration: none;
}

#sbay-portal .sbay-app .sbay-member-row__name:hover {
	color: var(--sbay-brand);
}

#sbay-portal .sbay-member-row__headline {
	overflow: hidden;
	color: var(--sbay-text-soft);
	font-size: 13px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

#sbay-portal .sbay-member-row__side {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 10px;
}

#sbay-portal .sbay-card-grid--members {
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

#sbay-portal .sbay-member-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	text-align: center;
}

#sbay-portal .sbay-member-card__avatar {
	width: 72px;
	height: 72px;
	margin-bottom: 4px;
	border: 3px solid var(--sbay-brand-soft);
	border-radius: 50%;
	object-fit: cover;
}

#sbay-portal .sbay-app .sbay-member-card__name {
	color: var(--sbay-text);
	font-size: 16px;
	font-weight: 700;
	text-decoration: none;
}

#sbay-portal .sbay-app .sbay-member-card__name:hover {
	color: var(--sbay-brand);
}

#sbay-portal .sbay-app .sbay-member-card__headline,
#sbay-portal .sbay-app .sbay-member-card__meta {
	color: var(--sbay-text-soft);
	font-size: 13px;
}

#sbay-portal .sbay-profile-header {
	display: flex;
	align-items: center;
	gap: 20px;
}

#sbay-portal .sbay-profile-header__avatar {
	width: 96px;
	height: 96px;
	border: 4px solid var(--sbay-brand-soft);
	border-radius: 50%;
	object-fit: cover;
}

#sbay-portal .sbay-app .sbay-profile-header__name {
	font-size: 26px;
}

#sbay-portal .sbay-app .sbay-profile-header__headline {
	margin-top: 2px;
	color: var(--sbay-text-soft);
}

#sbay-portal .sbay-app .sbay-profile-header__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-top: 8px;
	color: var(--sbay-text-soft);
	font-size: 13px;
}

#sbay-portal .sbay-filter-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

#sbay-portal .sbay-events-filters {
	justify-content: flex-start;
	margin-bottom: 16px;
}

#sbay-portal .sbay-event-group + .sbay-event-group {
	margin-top: 20px;
}

#sbay-portal .sbay-sort {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--sbay-text-soft);
	font-size: 14px;
}

/* ==========================================================================
   15. Forms, buttons and modal
   ========================================================================== */

#sbay-portal .sbay-search {
	display: block;
	flex: 0 1 300px;
}

#sbay-portal .sbay-search--full {
	flex-basis: 100%;
	margin-bottom: 8px;
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] select.sbay-input,
#sbay-portal .sbay-app[data-sbay-theme="dark"] select.sbay-select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a3b8aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

#sbay-portal .sbay-card > .sbay-field:first-child {
	margin-top: 0;
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-choice-card.is-selected .sbay-choice-card__title {
	color: var(--sbay-leaf);
}

#sbay-portal .sbay-choice-card:has( :focus-visible ) {
	box-shadow: inset 0 0 0 2px var(--sbay-focus);
}

/* Icon picker in the space form */

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-icon-picker__option.is-selected {
	color: #ffffff;
}

#sbay-portal .sbay-button:disabled,
#sbay-portal .sbay-app .sbay-button:disabled:hover {
	border-color: transparent;
	background: var(--sbay-fill);
	color: var(--sbay-text-soft);
	cursor: default;
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-btn--danger {
	background: #3b1512;
	color: #fca5a5;
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-btn--danger:hover:not(:disabled) {
	background: #4e1c18;
}

#sbay-portal .sbay-button--small {
	min-height: 32px;
	padding: 0 12px;
	font-size: 13px;
}

#sbay-portal .sbay-link-button {
	padding: 0;
	border: 0;
	background: none;
	color: var(--sbay-brand);
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

#sbay-portal .sbay-link-button:hover {
	text-decoration: underline;
}

#sbay-portal .sbay-link-button.is-danger {
	color: #b42318;
}

/* ==========================================================================
   16. Sidebar spaces
   ========================================================================== */

#sbay-portal .sbay-app .sbay-nav__link--space {
	gap: 10px;
	padding: 7px 12px;
	font-size: 14px;
}

/* A long space name wraps to a second line and is cut after that. The badge, the lock and the dot keep their size. */
#sbay-portal .sbay-nav__label {
	display: -webkit-box;
	flex: 1 1 0;
	min-width: 0;
	overflow: hidden;
	overflow-wrap: anywhere;
	line-height: 1.3;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
}

#sbay-portal .sbay-nav__link--space .sbay-space-badge {
	flex: none;
}

#sbay-portal .sbay-nav__lock {
	flex: none;
	opacity: 0.6;
}

#sbay-portal .sbay-nav__dot {
	flex: none;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--sbay-brand);
}

/* ==========================================================================
   17. Composer and mentions
   ========================================================================== */

#sbay-portal .sbay-composer {
	padding: 0;
	background: none;
	box-shadow: none;
}

#sbay-portal .sbay-composer__row {
	display: flex;
	align-items: flex-start;
	gap: 12px;
}

#sbay-portal .sbay-composer__avatar {
	width: 40px;
	height: 40px;
	flex-shrink: 0;
}

#sbay-portal .sbay-composer__main {
	flex: 1 1 auto;
	min-width: 0;
}

#sbay-portal .sbay-app .sbay-composer__title {
	display: block;
	width: 100%;
	min-height: 44px;
	margin-bottom: 10px;
	padding: 9px 14px;
	border: 0;
	border-radius: var(--sbay-radius-small);
	background: var(--sbay-surface);
	color: var(--sbay-text);
	font: inherit;
	font-size: 16px;
	font-weight: 600;
}

#sbay-portal .sbay-app .sbay-composer__title::placeholder {
	color: var(--sbay-text-soft);
	font-weight: 500;
}

/* A soft shadow marks focus; the fill stays the same, so the field never melts into the page. */
#sbay-portal .sbay-app input.sbay-composer__title:focus,
#sbay-portal .sbay-app input.sbay-composer__title:focus-visible {
	outline: none;
	box-shadow: var(--sbay-shadow-focus);
}

#sbay-portal .sbay-mention-field {
	position: relative;
}

#sbay-portal .sbay-app .sbay-textarea {
	display: block;
	width: 100%;
	min-height: 42px;
	padding: 10px 14px;
	border: 1px solid var(--sbay-field-border);
	border-radius: var(--sbay-radius-small);
	background: var(--sbay-surface);
	color: var(--sbay-text);
	font: inherit;
	line-height: 1.5;
	resize: none;
}

/* The post composer's text box: a fixed height the member can drag taller. Card colour, no border. */
#sbay-portal .sbay-app .sbay-textarea.sbay-textarea--post {
	height: 128px;
	min-height: 96px;
	border: 0;
	background: var(--sbay-surface);
	resize: vertical;
}

#sbay-portal .sbay-app .sbay-textarea.sbay-textarea--post:focus {
	background: var(--sbay-surface);
	box-shadow: var(--sbay-shadow-focus);
}

#sbay-portal .sbay-app .sbay-textarea:focus {
	border-color: var(--sbay-field-focus);
	background: var(--sbay-surface);
	outline: none;
	box-shadow: none;
}

#sbay-portal .sbay-mention-list {
	position: absolute;
	top: 100%;
	inset-inline-start: 0;
	z-index: 30;
	min-width: 240px;
	margin: 4px 0 0;
	padding: 6px;
	border-radius: var(--sbay-radius-small);
	background: var(--sbay-surface);
	box-shadow: var(--sbay-shadow-pop);
	list-style: none;
}

#sbay-portal .sbay-mention-list__item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 8px;
	border-radius: 8px;
	cursor: pointer;
}

#sbay-portal .sbay-mention-list__item img {
	border-radius: 50%;
}

#sbay-portal .sbay-mention-list__item.is-active {
	background: var(--sbay-brand-soft);
}

#sbay-portal .sbay-mention-list__slug {
	color: var(--sbay-text-soft);
	font-size: 13px;
}

#sbay-portal .sbay-composer__media {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 12px 0 0;
	padding: 0;
	list-style: none;
}

#sbay-portal .sbay-composer__thumb {
	position: relative;
	width: 84px;
	height: 84px;
	overflow: hidden;
	border-radius: var(--sbay-radius-small);
	background: var(--sbay-surface-alt);
}

#sbay-portal .sbay-composer__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

#sbay-portal .sbay-composer__thumb.is-loading {
	background: linear-gradient(90deg, var(--sbay-surface-alt), var(--sbay-brand-soft), var(--sbay-surface-alt));
	background-size: 200% 100%;
	animation: sbay-shimmer 1.2s linear infinite;
}

#sbay-portal .sbay-composer__remove {
	position: absolute;
	top: 4px;
	inset-inline-end: 4px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(16, 24, 40, 0.75);
	color: #ffffff;
	cursor: pointer;
}

#sbay-portal .sbay-composer__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 12px;
}

/* Selected photos sit in a column to the right of the fields. */
#sbay-portal .sbay-composer__row > .sbay-composer__media {
	flex-direction: column;
	flex-wrap: nowrap;
	flex-shrink: 0;
	margin: 0;
}

#sbay-portal .sbay-composer__submit {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}

#sbay-portal .sbay-topic-picker,
#sbay-portal .sbay-topic-filter,
#sbay-portal .sbay-post__topics {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 12px;
}

/* The paragraph reset (.sbay-app p) is more specific than the rule above and removed this space. */
#sbay-portal .sbay-app .sbay-post__topics {
	margin-top: 12px;
}

#sbay-portal .sbay-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 30px;
	padding: 4px 12px;
	border: 0;
	border-radius: 999px;
	background: var(--sbay-fill);
	color: var(--sbay-text-soft);
	font: inherit;
	font-size: 13px;
	font-weight: 500;
	text-decoration: none;
	cursor: pointer;
}

#sbay-portal .sbay-app .sbay-chip--link {
	color: var(--sbay-text-soft);
}

#sbay-portal .sbay-chip:hover,
#sbay-portal .sbay-chip:focus-visible {
	background: var(--sbay-fill-strong);
	color: var(--sbay-text);
}

#sbay-portal .sbay-app .sbay-chip.is-selected {
	background: var(--sbay-brand-soft);
	color: var(--sbay-brand-strong);
	font-weight: 600;
}

#sbay-portal .sbay-app .sbay-chip.is-selected:hover {
	background: var(--sbay-brand-muted);
}

#sbay-portal .sbay-chip__dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
}

#sbay-portal .sbay-feed-filters {
	display: grid;
	gap: 4px;
}

#sbay-portal .sbay-feed-filters .sbay-topic-filter {
	margin-top: 8px;
}

/* ==========================================================================
   18. Posts, media and link previews
   ========================================================================== */

#sbay-portal .sbay-feed {
	display: grid;
	gap: 16px;
}

#sbay-portal .sbay-feed__sentinel {
	height: 1px;
}

#sbay-portal .sbay-post {
	padding: 18px 20px 6px;
}

#sbay-portal .sbay-post.is-pinned {
	background: color-mix(in srgb, var(--sbay-brand-soft) 35%, var(--sbay-surface));
}

#sbay-portal .sbay-post__head {
	display: flex;
	align-items: center;
	gap: 12px;
}

#sbay-portal .sbay-post__avatar {
	display: block;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	object-fit: cover;
}

#sbay-portal .sbay-post__who {
	display: grid;
	flex: 1 1 auto;
	min-width: 0;
}

#sbay-portal .sbay-app .sbay-post__author {
	color: var(--sbay-text);
	font-weight: 700;
	text-decoration: none;
}

#sbay-portal .sbay-post__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	color: var(--sbay-text-soft);
	font-size: 13px;
}

#sbay-portal .sbay-app .sbay-post__space,
#sbay-portal .sbay-app .sbay-post__time {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	color: var(--sbay-text-soft);
	text-decoration: none;
}

#sbay-portal .sbay-app .sbay-post__space:hover,
#sbay-portal .sbay-app .sbay-post__time:hover,
#sbay-portal .sbay-app .sbay-post__author:hover {
	color: var(--sbay-brand);
	text-decoration: underline;
}

#sbay-portal .sbay-space-badge--tiny {
	width: 18px;
	height: 18px;
	border-radius: 5px;
	font-size: 10px;
}

#sbay-portal .sbay-post__pinned {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

#sbay-portal .sbay-post__menu {
	position: relative;
}

#sbay-portal .sbay-app .sbay-post__title {
	margin-top: 14px;
	font-size: 20px;
	line-height: 1.3;
}

#sbay-portal .sbay-app .sbay-post__title a {
	color: var(--sbay-text);
	text-decoration: none;
}

#sbay-portal .sbay-post__body {
	margin-top: 10px;
}

#sbay-portal .sbay-post__editor {
	margin-top: 12px;
	padding: 0;
	border: 0;
	box-shadow: none;
}

/* The post above already shows who wrote it. */
/* Inside a post card the fields are already on the card colour, so they keep the soft fill. */
#sbay-portal .sbay-app .sbay-post__editor .sbay-composer__title,
#sbay-portal .sbay-app .sbay-post__editor .sbay-textarea.sbay-textarea--post {
	background: var(--sbay-fill);
}

#sbay-portal .sbay-app .sbay-post__editor .sbay-composer__title:focus,
#sbay-portal .sbay-app .sbay-post__editor .sbay-textarea.sbay-textarea--post:focus {
	background: var(--sbay-fill);
}

#sbay-portal .sbay-post__editor .sbay-composer__avatar {
	display: none;
}

#sbay-portal .sbay-app .sbay-post__notice {
	margin-top: 10px;
	color: var(--sbay-text-soft);
	font-size: 13px;
}

#sbay-portal .sbay-post__actions {
	display: flex;
	gap: 4px;
	margin-top: 14px;
	padding: 6px 0;
	border-top: 1px solid var(--sbay-border);
}

#sbay-portal .sbay-action {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 12px;
	border: 0;
	border-radius: var(--sbay-radius-small);
	background: none;
	color: var(--sbay-text-soft);
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
}

#sbay-portal .sbay-action:hover:not(.is-static),
#sbay-portal .sbay-action:focus-visible {
	background: var(--sbay-fill);
	color: var(--sbay-text);
}

#sbay-portal .sbay-action.is-on {
	color: var(--sbay-brand);
}

#sbay-portal .sbay-action.is-static {
	cursor: default;
}

#sbay-portal .sbay-action--end {
	margin-inline-start: auto;
}

#sbay-portal .sbay-rich {
	overflow-wrap: anywhere;
}

#sbay-portal .sbay-rich p,
#sbay-portal .sbay-rich ul,
#sbay-portal .sbay-rich ol,
#sbay-portal .sbay-rich blockquote,
#sbay-portal .sbay-rich pre {
	margin: 0 0 10px;
}

#sbay-portal .sbay-rich > :last-child {
	margin-bottom: 0;
}

#sbay-portal .sbay-rich ul,
#sbay-portal .sbay-rich ol {
	padding-inline-start: 22px;
}

#sbay-portal .sbay-rich blockquote {
	padding: 4px 14px;
	border-inline-start: 3px solid var(--sbay-brand-muted);
	color: var(--sbay-text-soft);
}

#sbay-portal .sbay-rich code {
	padding: 1px 5px;
	border-radius: 5px;
	background: var(--sbay-surface-alt);
	font-family: Menlo, Consolas, monospace;
	font-size: 0.9em;
}

#sbay-portal .sbay-rich pre {
	overflow-x: auto;
	padding: 12px 14px;
	border-radius: var(--sbay-radius-small);
	background: #1b2230;
	color: #e8ebf0;
}

#sbay-portal .sbay-rich pre code {
	padding: 0;
	background: none;
	color: inherit;
}

#sbay-portal .sbay-app .sbay-rich .sbay-mention,
#sbay-portal .sbay-app .sbay-rich .sbay-hashtag {
	font-weight: 600;
	text-decoration: none;
}

#sbay-portal .sbay-media-grid {
	display: grid;
	gap: 4px;
	margin-top: 12px;
	overflow: hidden;
	border-radius: var(--sbay-radius-small);
}

#sbay-portal .sbay-media-grid.is-count-2,
#sbay-portal .sbay-media-grid.is-count-4 {
	grid-template-columns: 1fr 1fr;
}

#sbay-portal .sbay-media-grid.is-count-3 {
	grid-template-columns: 2fr 1fr;
	grid-template-rows: 1fr 1fr;
}

#sbay-portal .sbay-media-grid.is-count-3 .sbay-media-grid__item:first-child {
	grid-row: span 2;
}

#sbay-portal .sbay-media-grid__item {
	position: relative;
	display: block;
	padding: 0;
	border: 0;
	background: var(--sbay-surface-alt);
	cursor: zoom-in;
}

#sbay-portal .sbay-media-grid__item img {
	display: block;
	width: 100%;
	height: 100%;
	max-height: 520px;
	object-fit: cover;
}

#sbay-portal .sbay-media-grid.is-count-2 img,
#sbay-portal .sbay-media-grid.is-count-3 img,
#sbay-portal .sbay-media-grid.is-count-4 img {
	aspect-ratio: 1 / 1;
}

#sbay-portal .sbay-media-grid__more {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(16, 24, 40, 0.55);
	color: #ffffff;
	font-size: 26px;
	font-weight: 700;
}

#sbay-portal .sbay-lightbox {
	position: fixed;
	inset: 0;
	z-index: 2000;
	display: flex;
	align-items: center;
	justify-content: center;
}

#sbay-portal .sbay-lightbox__backdrop {
	position: absolute;
	inset: 0;
	border: 0;
	background: rgba(8, 10, 14, 0.92);
	cursor: zoom-out;
}

#sbay-portal .sbay-lightbox__image {
	position: relative;
	max-width: 92vw;
	max-height: 88vh;
	border-radius: 6px;
}

#sbay-portal .sbay-lightbox__close,
#sbay-portal .sbay-lightbox__nav {
	position: absolute;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	color: #ffffff;
	cursor: pointer;
}

#sbay-portal .sbay-lightbox__close {
	top: 16px;
	inset-inline-end: 16px;
}

#sbay-portal .sbay-lightbox__nav {
	top: 50%;
	transform: translateY(-50%);
}

#sbay-portal .sbay-lightbox__nav.is-prev {
	inset-inline-start: 16px;
}

#sbay-portal .sbay-lightbox__nav.is-next {
	inset-inline-end: 16px;
}

#sbay-portal .sbay-video {
	position: relative;
	margin-top: 12px;
	overflow: hidden;
	border-radius: var(--sbay-radius-small);
	background: #000000;
	aspect-ratio: 16 / 9;
}

#sbay-portal .sbay-video__frame,
#sbay-portal .sbay-video__poster {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

#sbay-portal .sbay-video__poster {
	position: relative;
	padding: 0;
	background: #000000;
	cursor: pointer;
}

#sbay-portal .sbay-video__poster {
	background: radial-gradient(circle at 30% 30%, #273040, #07090c);
}

#sbay-portal .sbay-video__provider {
	position: absolute;
	top: 14px;
	inset-inline-start: 16px;
	color: rgba(255, 255, 255, 0.85);
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.04em;
}

#sbay-portal .sbay-video__play {
	position: absolute;
	top: 50%;
	left: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 68px;
	height: 68px;
	border-radius: 50%;
	background: var(--sbay-brand);
	color: #ffffff;
	transform: translate(-50%, -50%);
}

#sbay-portal .sbay-video__note {
	position: absolute;
	inset-inline: 0;
	bottom: 0;
	padding: 6px 10px;
	background: rgba(0, 0, 0, 0.55);
	color: #ffffff;
	font-size: 12px;
	text-align: start;
}

#sbay-portal .sbay-app .sbay-link-card {
	display: flex;
	margin-top: 12px;
	overflow: hidden;
	border-radius: var(--sbay-radius-small);
	background: var(--sbay-fill);
	color: var(--sbay-text);
	text-decoration: none;
}

#sbay-portal .sbay-app .sbay-link-card:hover,
#sbay-portal .sbay-app .sbay-link-card:focus-visible {
	background: var(--sbay-fill-strong);
}

#sbay-portal .sbay-link-card__image {
	flex: 0 0 140px;
	width: 140px;
	min-height: 100px;
	object-fit: cover;
}

#sbay-portal .sbay-link-card__body {
	display: grid;
	gap: 2px;
	padding: 12px 14px;
}

#sbay-portal .sbay-link-card__host {
	color: var(--sbay-text-soft);
	font-size: 12px;
	text-transform: uppercase;
}

#sbay-portal .sbay-link-card__title {
	font-weight: 700;
}

#sbay-portal .sbay-link-card__text {
	display: -webkit-box;
	overflow: hidden;
	color: var(--sbay-text-soft);
	font-size: 14px;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

#sbay-portal .sbay-app button.sbay-dropdown__item {
	width: 100%;
	border: 0;
	background: none;
	font: inherit;
	text-align: start;
	cursor: pointer;
}

#sbay-portal .sbay-app .sbay-dropdown__item.is-danger {
	color: #b42318;
}

#sbay-portal .sbay-post__menu .sbay-dropdown {
	z-index: 20;
}

#sbay-portal .sbay-app .sbay-section-title {
	margin-top: 8px;
	font-size: 18px;
}

#sbay-portal .sbay-tag-title {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

#sbay-portal .sbay-app .sbay-space-note {
	padding: 12px 16px;
	border-radius: var(--sbay-radius-small);
	background: var(--sbay-surface-alt);
	font-size: 14px;
}

#sbay-portal .sbay-welcome__cta {
	position: relative;
	margin-top: 14px;
}

/* ==========================================================================
   19. Comments
   ========================================================================== */

#sbay-portal .sbay-comments {
	display: grid;
	gap: 12px;
	padding: 12px 0 14px;
	border-top: 1px solid var(--sbay-border);
}

#sbay-portal .sbay-comments {
	--sbay-comment-step: 24px;
}

#sbay-portal .sbay-comments__tree {
	display: grid;
}

/*
 * Each row indents by its level. The guide lines are 1px bars centred on the avatar column of the comment they belong
 * to (step offset + half the 32px avatar), drawn behind the avatars. A comment's line runs from its avatar down to the
 * avatar of its last direct reply, where it turns into an elbow; replies of that last reply do not carry it further.
 * The step must stay wider than 16px so a reply's avatar clears its parent's line.
 */
#sbay-portal .sbay-comments__row {
	--sbay-comment-line: color-mix(in srgb, var(--sbay-field-border) 70%, var(--sbay-text-soft));
	position: relative;
	min-width: 0;
	padding-block: 6px;
	padding-inline-start: calc(var(--sbay-level, 0) * var(--sbay-comment-step));
	overflow-wrap: anywhere;
}

/* A line that passes beside a row on its way to a later reply. */
#sbay-portal .sbay-comments__bar {
	position: absolute;
	z-index: 0;
	inset-block: 0;
	inset-inline-start: calc(var(--sbay-col) * var(--sbay-comment-step) + 15px);
	width: 1px;
	background: var(--sbay-comment-line);
}

/* The short turn from the parent's line into this reply's avatar (the avatar centre is 22px down). */
#sbay-portal .sbay-comments__elbow {
	position: absolute;
	z-index: 0;
	inset-block-start: 0;
	inset-inline-start: calc(var(--sbay-col) * var(--sbay-comment-step) + 15px);
	box-sizing: border-box;
	width: calc((var(--sbay-level, 0) - var(--sbay-col)) * var(--sbay-comment-step) - 18px);
	height: 22px;
	border-inline-start: 1px solid var(--sbay-comment-line);
	border-block-end: 1px solid var(--sbay-comment-line);
	border-end-start-radius: 6px;
}

/* The line of an open comment runs from its avatar centre down to the row's end, where its first reply picks it up. */
#sbay-portal .sbay-comments__row.has-replies::before {
	content: "";
	position: absolute;
	z-index: 0;
	inset-block: 22px 0;
	inset-inline-start: calc(var(--sbay-level, 0) * var(--sbay-comment-step) + 15px);
	width: 1px;
	background: var(--sbay-comment-line);
}

#sbay-portal .sbay-comments__toggle {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	min-height: 32px;
	margin-inline-start: 42px;
	padding: 0 10px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--sbay-text-soft);
	font: inherit;
	font-size: 12px;
	cursor: pointer;
}

#sbay-portal .sbay-comments__toggle:hover,
#sbay-portal .sbay-comments__toggle:focus-visible {
	outline: 0;
	background: var(--sbay-surface-alt);
	color: var(--sbay-text);
}

#sbay-portal .sbay-comment {
	display: flex;
	gap: 10px;
}

#sbay-portal .sbay-comment__avatar {
	width: 32px;
	height: 32px;
	flex-shrink: 0;
	border-radius: 50%;
	background: var(--sbay-surface);
	box-shadow: 0 0 0 2px var(--sbay-surface);
	object-fit: cover;
	position: relative;
	z-index: 1;
}

#sbay-portal .sbay-comment__main {
	flex: 1 1 auto;
	min-width: 0;
}

#sbay-portal .sbay-comment__bubble {
	padding: 8px 12px;
	border-radius: 14px;
	background: var(--sbay-surface-alt);
}

#sbay-portal .sbay-app .sbay-comment__head {
	margin-bottom: 2px;
}

#sbay-portal .sbay-app .sbay-comment__answers {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--sbay-text-soft);
	font-size: 12px;
	font-weight: 400;
}

#sbay-portal .sbay-app .sbay-comment__author {
	color: var(--sbay-text);
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
}

#sbay-portal .sbay-comment__bubble .sbay-rich {
	font-size: 14px;
}

#sbay-portal .sbay-comment__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	padding: 4px 12px 0;
	color: var(--sbay-text-soft);
	font-size: 12px;
}

#sbay-portal .sbay-comment__actions .sbay-link-button {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: var(--sbay-text-soft);
	font-size: 12px;
}

#sbay-portal .sbay-comment__actions .sbay-link-button.is-on {
	color: var(--sbay-brand);
}

#sbay-portal .sbay-comment__likes {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

#sbay-portal .sbay-comment__edit-actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 6px;
}

#sbay-portal .sbay-comments__form {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	column-gap: 10px;
	align-items: center;
}

/* The field's parts sit straight in the grid: avatar, comment box and Send share one centred row. */
#sbay-portal .sbay-comments__field {
	display: contents;
}

#sbay-portal .sbay-comments__form .sbay-comments__replying {
	grid-column: 2 / 4;
	grid-row: 1;
}

#sbay-portal .sbay-comments__form > .sbay-comment__avatar {
	grid-column: 1;
	grid-row: 2;
}

#sbay-portal .sbay-comments__form .sbay-mention-field {
	grid-column: 2;
	grid-row: 2;
}

/* The Send button is as tall as the one-line comment box next to it (43px content and a 1px border each side). */
#sbay-portal .sbay-comments__form > .sbay-button {
	grid-column: 3;
	grid-row: 2;
	min-height: 45px;
}

#sbay-portal .sbay-comments__form .sbay-comments__limit {
	grid-column: 2 / 4;
	grid-row: 3;
}

#sbay-portal .sbay-comments__form .sbay-comments__limit-reason {
	grid-column: 2 / 4;
	grid-row: 4;
}

#sbay-portal .sbay-app .sbay-comments__replying {
	display: flex;
	gap: 10px;
	margin-bottom: 4px;
	color: var(--sbay-text-soft);
	font-size: 13px;
}

#sbay-portal .sbay-comments__more {
	justify-self: start;
}

/* The prompt a guest, or a non-member, sees in place of the comment box. */
#sbay-portal .sbay-comments__prompt {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border: 1px solid var(--sbay-field-border);
	border-radius: var(--sbay-radius);
	background: var(--sbay-surface-alt);
}

#sbay-portal .sbay-comments__prompt-icon {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: var(--sbay-brand-soft);
	color: var(--sbay-brand);
}

#sbay-portal .sbay-app .sbay-comments__prompt-text {
	flex: 1 1 auto;
	margin: 0;
	min-width: 0;
	color: var(--sbay-text-soft);
	font-size: 14px;
}

#sbay-portal .sbay-comments__prompt .sbay-button {
	flex: none;
}

/* ==========================================================================
   20. Profiles, account settings and about
   ========================================================================== */

#sbay-portal .sbay-profile-card {
	overflow: hidden;
	padding: 0;
}

#sbay-portal .sbay-profile-card__cover {
	height: 120px;
	background: linear-gradient(120deg, var(--sbay-mint), var(--sbay-brand-muted));
}

#sbay-portal .sbay-profile-card__cover.has-image {
	width: 100%;
	height: auto;
	aspect-ratio: 10 / 3;
	max-height: 240px;
}

#sbay-portal .sbay-profile-card__cover img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

#sbay-portal .sbay-profile-card .sbay-profile-header {
	align-items: flex-end;
	margin-top: -40px;
	padding: 0 20px 20px;
}

#sbay-portal .sbay-profile-card .sbay-profile-header__avatar {
	position: relative;
	flex: 0 0 auto;
	border-color: var(--sbay-surface);
	background: var(--sbay-surface);
}

#sbay-portal .sbay-profile-header__info {
	flex: 1 1 auto;
	min-width: 0;
	padding-top: 44px;
}

#sbay-portal .sbay-app .sbay-about__bio {
	margin: 8px 0 0;
	white-space: pre-line;
}

#sbay-portal .sbay-app .sbay-about__list {
	display: grid;
	grid-template-columns: minmax(110px, max-content) 1fr;
	gap: 8px 20px;
	margin: 14px 0 0;
}

#sbay-portal .sbay-app .sbay-about__list:empty {
	display: none;
}

#sbay-portal .sbay-app .sbay-about__list dt {
	color: var(--sbay-text-soft);
	font-size: 14px;
	font-weight: 600;
}

#sbay-portal .sbay-app .sbay-about__list dd {
	margin: 0;
	overflow-wrap: anywhere;
}

#sbay-portal .sbay-about__value {
	white-space: pre-line;
}

#sbay-portal .sbay-account-images {
	overflow: hidden;
	padding: 0;
}

#sbay-portal .sbay-account-cover {
	position: relative;
	height: 140px;
	background: linear-gradient(120deg, var(--sbay-mint), var(--sbay-brand-muted));
}

#sbay-portal .sbay-account-cover.has-image {
	height: auto;
	aspect-ratio: 10 / 3;
	max-height: 240px;
}

#sbay-portal .sbay-account-cover img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

#sbay-portal .sbay-account-cover__actions {
	position: absolute;
	inset-block-end: 12px;
	inset-inline-end: 12px;
	display: flex;
	gap: 8px;
}

#sbay-portal .sbay-account-cover__actions .sbay-button--ghost {
	background: var(--sbay-surface);
}

#sbay-portal .sbay-account-avatar {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	margin-top: -36px;
	padding: 0 20px 20px;
}

#sbay-portal .sbay-account-avatar__image {
	position: relative;
	flex: 0 0 auto;
	width: 96px;
	height: 96px;
	border: 4px solid var(--sbay-surface);
	border-radius: 50%;
	background: var(--sbay-surface);
	object-fit: cover;
}

#sbay-portal .sbay-account-avatar__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 12px;
	padding-top: 46px;
}

#sbay-portal .sbay-account-avatar__actions .sbay-field__help {
	flex-basis: 100%;
	margin: 0;
}

#sbay-portal .sbay-app .sbay-check {
	display: inline-flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 14px;
	cursor: pointer;
}

#sbay-portal .sbay-app .sbay-check input {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin: 1px 0 0;
	accent-color: var(--sbay-brand);
}

#sbay-portal .sbay-app .sbay-check small {
	display: block;
	color: var(--sbay-text-soft);
	font-size: 13px;
}

/* ==========================================================================
   21. Notifications and bell
   ========================================================================== */

#sbay-portal .sbay-bell {
	position: relative;
}

#sbay-portal .sbay-bell__button {
	position: relative;
}

#sbay-portal .sbay-bell__count {
	position: absolute;
	top: 2px;
	inset-inline-end: 0;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border: 2px solid var(--sbay-bg);
	border-radius: 999px;
	background: #dc2626;
	color: #ffffff;
	font-size: 10px;
	font-weight: 700;
	line-height: 14px;
	text-align: center;
}

#sbay-portal .sbay-app .sbay-bell__panel {
	width: min(380px, calc(100vw - 24px));
	padding: 0;
	overflow: hidden;
}

#sbay-portal .sbay-bell__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 14px;
	border-bottom: 1px solid var(--sbay-border);
}

#sbay-portal .sbay-app .sbay-bell__empty {
	margin: 0;
	padding: 24px 14px;
	text-align: center;
}

#sbay-portal .sbay-bell__panel .sbay-notice-list {
	max-height: min(420px, 60vh);
	overflow-y: auto;
}

#sbay-portal .sbay-app .sbay-bell__all {
	display: block;
	padding: 10px 14px;
	border-top: 1px solid var(--sbay-border);
	color: var(--sbay-brand);
	font-size: 14px;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
}

#sbay-portal .sbay-app .sbay-bell__all:hover {
	background: var(--sbay-brand-soft);
}

#sbay-portal .sbay-app .sbay-notice-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

#sbay-portal .sbay-app .sbay-notice-list--page {
	padding: 6px;
}

#sbay-portal .sbay-app .sbay-notice {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	width: 100%;
	padding: 10px 14px;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--sbay-text);
	font: inherit;
	text-align: start;
	cursor: pointer;
}

#sbay-portal .sbay-app .sbay-notice-list--page .sbay-notice {
	border-radius: var(--sbay-radius-small);
}

#sbay-portal .sbay-app .sbay-notice:hover,
#sbay-portal .sbay-app .sbay-notice:focus-visible {
	background: var(--sbay-fill);
}

#sbay-portal .sbay-app .sbay-notice.is-unread:hover {
	background: var(--sbay-brand-muted);
}

#sbay-portal .sbay-app .sbay-notice.is-unread {
	background: var(--sbay-brand-soft);
}

#sbay-portal .sbay-notice__avatar {
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	object-fit: cover;
}

#sbay-portal .sbay-notice-list--page .sbay-notice__avatar {
	width: 40px;
	height: 40px;
}

#sbay-portal .sbay-notice__body {
	display: grid;
	flex: 1 1 auto;
	gap: 2px;
	min-width: 0;
}

#sbay-portal .sbay-notice__text {
	font-size: 14px;
	line-height: 1.4;
}

#sbay-portal .sbay-notice__excerpt {
	overflow: hidden;
	color: var(--sbay-text-soft);
	font-size: 13px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

#sbay-portal .sbay-notice__time {
	color: var(--sbay-text-soft);
	font-size: 12px;
}

#sbay-portal .sbay-notice__dot {
	flex: 0 0 auto;
	width: 10px;
	height: 10px;
	margin-top: 6px;
	border-radius: 50%;
	background: var(--sbay-brand);
}

/* ==========================================================================
   22. Search
   ========================================================================== */

#sbay-portal .sbay-topbar__search {
	position: relative;
	flex: 0 1 420px;
	min-width: 160px;
	height: 40px;
}

#sbay-portal .sbay-topbar__search-icon {
	position: absolute;
	top: 50%;
	inset-inline-start: 12px;
	color: var(--sbay-text-soft);
	pointer-events: none;
	transform: translateY(-50%);
}

#sbay-portal .sbay-app .sbay-topbar__search input {
	display: block;
	width: 100%;
	height: 40px;
	margin: 0;
	padding: 0 12px 0 38px;
	border: 1px solid var(--sbay-field-border);
	border-radius: var(--sbay-radius-small);
	background: var(--sbay-surface);
	color: var(--sbay-text);
	font: inherit;
	font-size: 14px;
	line-height: 38px;
}

#sbay-portal [dir="rtl"] .sbay-app .sbay-topbar__search input {
	padding: 0 38px 0 12px;
}

/* The clear button replaces the browser's own cancel icon, which differs between browsers. */
#sbay-portal .sbay-app input[type="search"]::-webkit-search-cancel-button,
#sbay-portal .sbay-app input[type="search"]::-webkit-search-decoration {
	display: none;
	-webkit-appearance: none;
}

#sbay-portal .sbay-app .sbay-topbar__search input,
#sbay-portal .sbay-app .sbay-search-field .sbay-search__input {
	padding-inline-end: 38px;
}

#sbay-portal .sbay-search-field {
	position: relative;
	display: block;
	flex: 1 1 auto;
}

#sbay-portal .sbay-search-clear {
	position: absolute;
	top: 50%;
	inset-inline-end: 6px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--sbay-text-soft);
	cursor: pointer;
	transform: translateY(-50%);
}

#sbay-portal .sbay-search-clear:hover,
#sbay-portal .sbay-search-clear:focus-visible {
	background: var(--sbay-brand-soft);
	color: var(--sbay-brand);
}

#sbay-portal .sbay-app .sbay-topbar__search input:focus {
	border-color: var(--sbay-field-focus);
	outline: none;
	box-shadow: none;
	background: var(--sbay-surface);
}

#sbay-portal .sbay-app .sbay-topbar__search-link {
	display: none;
	color: var(--sbay-text-soft);
}

/* The search box collapses to an icon next to the other actions. */
@media (max-width: 900px) {
	#sbay-portal .sbay-topbar__search {
		display: none;
	}

	#sbay-portal .sbay-app .sbay-topbar__search-link {
		display: inline-flex;
	}
}

#sbay-portal .sbay-search-form {
	display: flex;
	gap: 8px;
}

#sbay-portal .sbay-search-form .sbay-search-field {
	flex: 1 1 auto;
}

#sbay-portal .sbay-search-form .sbay-button {
	flex: 0 0 auto;
}

/* Where the top bar search box is visible it is the only search box; the page form is for narrow screens. */
@media (min-width: 901px) {
	#sbay-portal .sbay-search-form {
		display: none;
	}
}

/* ==========================================================================
   23. Moderation, reports, logo and account notices
   ========================================================================== */

#sbay-portal .sbay-app .sbay-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	margin-inline-start: 6px;
	padding: 0 6px;
	border-radius: 999px;
	background: #dc2626;
	color: #ffffff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
}

#sbay-portal .sbay-app .sbay-nav__count {
	margin-inline-start: auto;
}

#sbay-portal .sbay-app .sbay-button--danger {
	border-color: #b91c1c;
	background: #b91c1c;
	color: #ffffff;
}

#sbay-portal .sbay-app .sbay-button--danger:hover {
	border-color: #991b1b;
	background: #991b1b;
}

#sbay-portal .sbay-account-notice {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	margin-bottom: 20px;
	background: var(--sbay-brand-soft);
	box-shadow: none;
	color: var(--sbay-brand);
}

#sbay-portal .sbay-account-notice.is-blocked {
	background: #fde8e6;
	color: #b91c1c;
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-account-notice {
	color: var(--sbay-leaf);
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-account-notice.is-blocked {
	background: #3b1512;
	color: #fca5a5;
}

#sbay-portal .sbay-app .sbay-account-notice__title {
	margin: 0;
	color: var(--sbay-text);
	font-size: 18px;
}

#sbay-portal .sbay-app .sbay-account-notice__text {
	margin: 6px 0 0;
	color: var(--sbay-text-soft);
}

#sbay-portal .sbay-app .sbay-composer__pending {
	margin-top: 12px;
}

#sbay-portal .sbay-app .sbay-comment__report {
	color: var(--sbay-text-soft);
}

#sbay-portal .sbay-app .sbay-profile-header__report {
	align-self: flex-start;
	color: var(--sbay-text-soft);
}

#sbay-portal .sbay-report__reasons {
	display: grid;
	gap: 10px;
	margin: 0;
	padding: 0;
	border: 0;
}

#sbay-portal .sbay-app .sbay-report__done p {
	margin: 0;
}

#sbay-portal .sbay-mod-item {
	display: grid;
	gap: 14px;
}

#sbay-portal .sbay-mod-item__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	color: var(--sbay-text-soft);
	font-size: 13px;
}

#sbay-portal .sbay-app .sbay-mod-item__space a {
	color: var(--sbay-text-soft);
	font-weight: 600;
}

#sbay-portal .sbay-mod-item__time {
	margin-inline-start: auto;
}

#sbay-portal .sbay-mod-item__author {
	display: flex;
	align-items: center;
	gap: 10px;
}

#sbay-portal .sbay-mod-item__author img {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	object-fit: cover;
}

#sbay-portal .sbay-mod-item__author > div {
	display: grid;
}

#sbay-portal .sbay-app .sbay-mod-item__name {
	color: var(--sbay-text);
	font-weight: 600;
	text-decoration: none;
}

#sbay-portal .sbay-mod-item__headline {
	color: var(--sbay-text-soft);
	font-size: 13px;
}

#sbay-portal .sbay-mod-item__content {
	padding: 12px 16px;
	border-radius: var(--sbay-radius-small);
	background: var(--sbay-surface-alt);
	overflow-wrap: anywhere;
}

#sbay-portal .sbay-app .sbay-mod-item__context {
	margin: 0 0 6px;
	color: var(--sbay-text-soft);
	font-size: 13px;
}

#sbay-portal .sbay-app .sbay-mod-item__title {
	margin: 0 0 6px;
	font-size: 16px;
}

#sbay-portal .sbay-app .sbay-mod-item__media {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 10px 0 0;
}

#sbay-portal .sbay-mod-item__media img {
	width: 72px;
	height: 72px;
	border-radius: 8px;
	object-fit: cover;
}

#sbay-portal .sbay-mod-decisions {
	display: grid;
	gap: 10px;
	margin-block-start: 24px;
}

#sbay-portal .sbay-mod-decisions__title {
	margin: 0;
	font-size: 1rem;
}

#sbay-portal .sbay-app .sbay-mod-reasons {
	display: grid;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 14px;
}

#sbay-portal .sbay-mod-reasons li {
	display: flex;
	align-items: flex-start;
	gap: 8px;
}

#sbay-portal .sbay-mod-reasons li > svg {
	flex: 0 0 auto;
	margin-top: 2px;
	color: #b45309;
}

#sbay-portal .sbay-app .sbay-mod-reasons__reporter {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

#sbay-portal .sbay-app .sbay-mod-reasons__reporter:hover,
#sbay-portal .sbay-app .sbay-mod-reasons__reporter:focus-visible {
	color: var(--sbay-brand);
}

/* Delete in a moderation card: a light red button with red text, not the solid danger fill. */
#sbay-portal .sbay-app .sbay-mod-item__actions .sbay-button.sbay-button--danger {
	border-color: color-mix(in srgb, var(--sbay-danger) 35%, var(--sbay-surface));
	background: color-mix(in srgb, var(--sbay-danger) 12%, var(--sbay-surface));
	color: var(--sbay-danger);
}

#sbay-portal .sbay-app .sbay-mod-item__actions .sbay-button.sbay-button--danger:hover,
#sbay-portal .sbay-app .sbay-mod-item__actions .sbay-button.sbay-button--danger:focus-visible {
	border-color: color-mix(in srgb, var(--sbay-danger) 55%, var(--sbay-surface));
	background: color-mix(in srgb, var(--sbay-danger) 22%, var(--sbay-surface));
	color: var(--sbay-danger);
}

#sbay-portal .sbay-mod-reasons__note {
	display: block;
	margin-top: 2px;
	color: var(--sbay-text-soft);
	font-style: italic;
}

#sbay-portal .sbay-mod-item__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding-top: 12px;
	border-top: 1px solid var(--sbay-border);
}

/* ==========================================================================
   24. Accessibility helpers
   ========================================================================== */

#sbay-portal .screen-reader-text,
#sbay-portal .sbay-app .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

#sbay-portal .sbay-app .sbay-skip-link {
	position: absolute;
	top: -100px;
	inset-inline-start: 12px;
	z-index: 50;
	padding: 8px 14px;
	border-radius: 8px;
	background: var(--sbay-surface);
	color: var(--sbay-text);
}

#sbay-portal .sbay-app .sbay-skip-link:focus {
	top: 12px;
}

/* ==========================================================================
   25. Media queries
   ========================================================================== */

@media (max-width: 1100px) {
	#sbay-portal .sbay-greeting__text {
		display: none;
	}
}

/* Tablet: the left nav shrinks to a 72px icon rail; the labels stay for screen readers and show as tooltips. */
@media (min-width: 768px) and (max-width: 899px) {
	#sbay-portal .sbay-app {
		--sbay-sidebar-width: 72px;
	}

	#sbay-portal .sbay-sidebar__brand {
		justify-content: center;
		padding: 0;
	}

	#sbay-portal .sbay-app .sbay-sidebar__brand .sbay-brand__name {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}

	#sbay-portal .sbay-sidebar__brand .sbay-brand__logo {
		max-width: 44px;
		max-height: 40px;
		object-fit: contain;
	}

	/* The rail keeps the first image or mark only. */
	#sbay-portal .sbay-sidebar__brand .sbay-brand__images.is-pair > :nth-child(n+2) {
		display: none;
	}

	#sbay-portal .sbay-sidebar__brand .sbay-brand__mark.is-rail-only {
		display: inline-flex;
	}

	#sbay-portal .sbay-sidebar__brand.is-stacked {
		height: var(--sbay-topbar-height);
		padding: 0;
	}

	#sbay-portal .sbay-app .sbay-sidebar__primary,
	#sbay-portal .sbay-sidebar__scroll,
	#sbay-portal .sbay-app .sbay-sidebar__foot {
		padding-inline: 12px;
	}

	#sbay-portal .sbay-sidebar__scroll {
		scrollbar-gutter: auto;
		scrollbar-width: none;
	}

	#sbay-portal .sbay-app .sbay-nav__link {
		position: relative;
		justify-content: center;
		padding: 9px 0;
	}

	#sbay-portal .sbay-nav__link > span:not(.sbay-count):not(.sbay-nav__dot):not(.sbay-space-badge),
	#sbay-portal .sbay-nav__link > .sbay-nav__label {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
	}

	#sbay-portal .sbay-app .sbay-nav__heading {
		height: 1px;
		margin: 12px 8px;
		overflow: hidden;
		background: var(--sbay-fill-strong);
		color: transparent;
		font-size: 0;
	}

	#sbay-portal .sbay-app .sbay-nav__heading > * {
		display: none;
	}

	#sbay-portal .sbay-app .sbay-nav__empty,
	#sbay-portal .sbay-nav__lock {
		display: none;
	}

	#sbay-portal .sbay-app .sbay-nav__link .sbay-nav__count {
		position: absolute;
		top: 2px;
		inset-inline-end: 2px;
		min-width: 16px;
		height: 16px;
		margin: 0;
		padding: 0 4px;
		font-size: 10px;
	}

	#sbay-portal .sbay-nav__link .sbay-nav__dot {
		position: absolute;
		top: 6px;
		inset-inline-end: 8px;
	}
}

@media (max-width: 899px) {
	#sbay-portal .sbay-app {
		--sbay-topbar-height: 60px;
		--sbay-gutter: 24px;
	}

	#sbay-portal .sbay-main {
		padding-top: 16px;
	}
}

/* Bottom tab bar: phones only. */
#sbay-portal .sbay-tabbar {
	display: none;
}

@media (max-width: 767px) {
	#sbay-portal .sbay-shell {
		padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
	}

	#sbay-portal .sbay-tabbar {
		position: fixed;
		inset: auto 0 0;
		z-index: 30;
		display: flex;
		height: calc(56px + env(safe-area-inset-bottom, 0px));
		padding: 0 4px env(safe-area-inset-bottom, 0px);
		background: var(--sbay-surface);
		box-shadow: 0 -1px 0 var(--sbay-fill-strong), 0 -4px 16px rgba(16, 24, 40, 0.06);
		transition: transform 0.2s ease;
	}

	#sbay-portal .sbay-tabbar.is-hidden {
		transform: translateY(100%);
	}

	#sbay-portal .sbay-app .sbay-tabbar__item {
		position: relative;
		display: flex;
		flex: 1 1 0;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 2px;
		min-width: 0;
		margin: 6px 2px;
		border-radius: 12px;
		color: var(--sbay-text-soft);
		font-size: 11px;
		font-weight: 600;
		line-height: 1.2;
		text-decoration: none;
	}

	#sbay-portal .sbay-app .sbay-tabbar__item:hover,
	#sbay-portal .sbay-app .sbay-tabbar__item:focus-visible {
		background: var(--sbay-fill);
		color: var(--sbay-text);
	}

	#sbay-portal .sbay-app .sbay-tabbar__item.is-active {
		background: var(--sbay-brand-soft);
		color: var(--sbay-brand-strong);
	}

	#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-tabbar__item.is-active {
		color: var(--sbay-leaf);
	}

	#sbay-portal .sbay-tabbar__icon {
		position: relative;
		display: inline-flex;
	}

	#sbay-portal .sbay-app .sbay-tabbar__count {
		position: absolute;
		top: -6px;
		inset-inline-start: 12px;
		min-width: 16px;
		height: 16px;
		margin: 0;
		padding: 0 4px;
		font-size: 10px;
	}

	#sbay-portal .sbay-main {
		padding-bottom: 32px;
	}
}

@media (max-width: 767px) {
	#sbay-portal .sbay-app {
		--sbay-topbar-height: 60px;
		--sbay-gutter: 20px;
	}

	#sbay-portal .sbay-topbar__inner {
		gap: 4px;
		padding: 0 12px;
	}

	#sbay-portal .sbay-topbar__actions {
		flex: 0 0 auto;
		gap: 4px;
		margin-inline-start: auto;
	}

	#sbay-portal .sbay-topbar__menu,
	#sbay-portal .sbay-app .sbay-brand.sbay-topbar__brand {
		display: inline-flex;
	}

	/* A wide logo or an icon + logo pair must never push the bar's buttons: the brand shrinks, and the
	   name (already in the logo) stays for screen readers only instead of showing as a clipped letter. */
	#sbay-portal .sbay-app .sbay-brand.sbay-topbar__brand {
		flex: 0 1 auto;
		min-width: 0;
		max-width: 100%;
	}

	#sbay-portal .sbay-app .sbay-brand.sbay-topbar__brand.has-logo .sbay-brand__name {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		padding: 0;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}

	#sbay-portal .sbay-app .sbay-brand.sbay-topbar__brand.has-logo .sbay-brand__images {
		min-width: 0;
		overflow: hidden;
	}

	#sbay-portal .sbay-greeting {
		display: none;
	}

	#sbay-portal .sbay-sidebar,
	.sbay-layout-theme #sbay-portal .sbay-sidebar {
		position: fixed;
		top: 0;
		inset-inline-start: 0;
		z-index: 40;
		width: min(300px, 86vw);
		height: 100vh;
		height: 100dvh;
		box-shadow: 0 0 40px rgba(16, 24, 40, 0.2);
		visibility: hidden;
		transform: translateX(-105%);
		transition: transform 0.2s ease, visibility 0s linear 0.2s;
	}

	#sbay-portal [dir="rtl"] .sbay-sidebar {
		transform: translateX(105%);
	}

	#sbay-portal .sbay-sidebar.is-open,
	#sbay-portal [dir="rtl"] .sbay-sidebar.is-open {
		visibility: visible;
		transform: none;
		transition: transform 0.2s ease;
	}

	#sbay-portal .sbay-sidebar__brand {
		padding: 0 12px 0 20px;
	}

	#sbay-portal .sbay-sidebar__close {
		display: inline-flex;
	}

	#sbay-portal .sbay-scrim {
		position: fixed;
		inset: 0;
		z-index: 35;
		display: block;
		background: rgba(16, 24, 40, 0.45);
	}

	#sbay-portal .sbay-main {
		padding: 16px var(--sbay-gutter) 40px;
	}
}

@media (max-width: 767px) {
	#sbay-portal .sbay-subnav-layout {
		grid-template-columns: 1fr;
	}

	#sbay-portal .sbay-subnav {
		position: static;
		display: flex;
		overflow-x: auto;
	}

	#sbay-portal .sbay-app .sbay-subnav__item {
		flex: 0 0 auto;
	}
}

@media (max-width: 600px) {
	#sbay-portal .sbay-app {
		--sbay-gutter: 16px;
	}

	#sbay-portal .sbay-stats {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
	}

	#sbay-portal .sbay-stat {
		gap: 12px 8px;
		padding: 14px;
	}

	#sbay-portal .sbay-app .sbay-welcome__title {
		font-size: 22px;
	}

	#sbay-portal .sbay-welcome__art {
		display: none;
	}

	#sbay-portal .sbay-profile-header {
		flex-direction: column;
		align-items: flex-start;
	}

	#sbay-portal .sbay-member-row {
		flex-wrap: wrap;
	}

	#sbay-portal .sbay-member-row__main {
		flex-basis: calc(100% - 52px);
	}

	#sbay-portal .sbay-member-row__side {
		width: 100%;
		justify-content: flex-start;
		padding-inline-start: 52px;
	}

	#sbay-portal .sbay-search {
		flex-basis: 100%;
	}

	#sbay-portal .sbay-post {
		padding: 14px 14px 4px;
	}

	#sbay-portal .sbay-composer__avatar {
		display: none;
	}

	#sbay-portal .sbay-composer__row {
		flex-wrap: wrap;
	}

	#sbay-portal .sbay-composer__row > .sbay-composer__media {
		flex-direction: row;
		flex-wrap: wrap;
		flex-basis: 100%;
	}

	#sbay-portal .sbay-link-card {
		flex-direction: column;
	}

	#sbay-portal .sbay-link-card__image {
		flex-basis: auto;
		width: 100%;
		max-height: 180px;
	}

	#sbay-portal .sbay-action span {
		font-size: 13px;
	}

	#sbay-portal .sbay-comments {
		--sbay-comment-step: 20px;
	}

	#sbay-portal .sbay-comment__actions {
		row-gap: 0;
	}

	#sbay-portal .sbay-comment__actions .sbay-link-button {
		min-height: 32px;
	}

	#sbay-portal .sbay-profile-card .sbay-profile-header {
		align-items: flex-start;
	}

	#sbay-portal .sbay-profile-header__info {
		padding-top: 0;
	}

	#sbay-portal .sbay-app .sbay-about__list {
		grid-template-columns: 1fr;
		gap: 2px;
	}

	#sbay-portal .sbay-app .sbay-about__list dd {
		margin-bottom: 8px;
	}

	#sbay-portal .sbay-account-avatar {
		flex-direction: column;
		align-items: flex-start;
	}

	#sbay-portal .sbay-account-avatar__actions {
		padding-top: 0;
	}

	#sbay-portal .sbay-account-cover__actions {
		flex-wrap: wrap;
	}

	#sbay-portal .sbay-search-form {
		flex-direction: column;
	}

	#sbay-portal .sbay-mod-item__time {
		margin-inline-start: 0;
	}

	/* The bell panel spans the top bar instead of hanging off the bell icon. */
	#sbay-portal .sbay-bell {
		position: static;
	}

	#sbay-portal .sbay-app .sbay-bell__panel {
		top: calc(100% + 4px);
		inset-inline: 8px;
		width: auto;
		min-width: 0;
	}
}

/* Avatars show a neutral silhouette while the real picture loads (Gravatar can be slow). */
#sbay-portal .sbay-app img[class*="avatar"],
#sbay-portal .sbay-mention-list img {
	background: #d5dbe3 url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Ccircle cx='32' cy='25' r='11' fill='%238f9bab'/%3E%3Cpath d='M12 58c2-11 10-17 20-17s18 6 20 17z' fill='%238f9bab'/%3E%3C/svg%3E") center / cover no-repeat;
}

/* ==========================================================================
   Messages
   ========================================================================== */

#sbay-portal .sbay-messages {
	display: grid;
	grid-template-columns: 300px minmax(0, 1fr);
	gap: 16px;
	height: max(480px, calc(100vh - var(--sbay-topbar-height) - 84px));
}

.sbay-layout-theme #sbay-portal .sbay-messages {
	height: max(480px, min(760px, calc(100vh - 160px)));
}

#sbay-portal .sbay-messages > .sbay-empty {
	grid-column: 1 / -1;
}

#sbay-portal .sbay-inbox,
#sbay-portal .sbay-thread {
	display: flex;
	flex-direction: column;
	min-height: 0;
	padding: 0;
	overflow: hidden;
}

#sbay-portal .sbay-inbox__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 16px 16px 8px;
}

#sbay-portal .sbay-app .sbay-inbox__title {
	font-size: 20px;
}

#sbay-portal .sbay-inbox__search,
#sbay-portal .sbay-picker__search {
	position: relative;
	display: flex;
	align-items: center;
	margin: 0 16px 8px;
	color: var(--sbay-text-soft);
}

#sbay-portal .sbay-picker__search {
	margin: 0 0 8px;
}

#sbay-portal .sbay-inbox__search .sbay-icon,
#sbay-portal .sbay-picker__search .sbay-icon {
	position: absolute;
	inset-inline-start: 12px;
	pointer-events: none;
}

#sbay-portal .sbay-app .sbay-inbox__search .sbay-input,
#sbay-portal .sbay-app .sbay-picker__search .sbay-input {
	width: 100%;
	padding-inline-start: 36px;
}

#sbay-portal .sbay-inbox__list {
	flex: 1 1 auto;
	min-height: 0;
	margin: 0;
	padding: 0 8px 8px;
	overflow-y: auto;
	list-style: none;
}

#sbay-portal .sbay-app .sbay-inbox__item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px;
	border-radius: var(--sbay-radius-small);
	color: var(--sbay-text);
	text-decoration: none;
}

#sbay-portal .sbay-app .sbay-inbox__item:hover,
#sbay-portal .sbay-app .sbay-inbox__item:focus-visible {
	background: var(--sbay-fill);
}

#sbay-portal .sbay-app .sbay-inbox__item.is-active {
	background: var(--sbay-brand-soft);
}

#sbay-portal .sbay-inbox__avatars {
	position: relative;
	display: inline-flex;
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
}

#sbay-portal .sbay-inbox__avatars img {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	object-fit: cover;
}

#sbay-portal .sbay-inbox__avatars.is-group img {
	position: absolute;
	width: 32px;
	height: 32px;
	border: 2px solid var(--sbay-surface);
}

#sbay-portal .sbay-inbox__avatars.is-group img:first-child {
	top: 0;
	inset-inline-start: 0;
}

#sbay-portal .sbay-inbox__avatars.is-group img:nth-child(2) {
	bottom: 0;
	inset-inline-end: 0;
}

#sbay-portal .sbay-thread__head .sbay-inbox__avatars,
#sbay-portal .sbay-thread__head .sbay-inbox__avatars img {
	width: 40px;
	height: 40px;
}

#sbay-portal .sbay-thread__head .sbay-inbox__avatars.is-group img {
	width: 30px;
	height: 30px;
}

#sbay-portal .sbay-inbox__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

#sbay-portal .sbay-inbox__row {
	display: flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
}

#sbay-portal .sbay-inbox__name,
#sbay-portal .sbay-inbox__preview {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

#sbay-portal .sbay-inbox__name {
	font-weight: 600;
}

#sbay-portal .sbay-inbox__preview,
#sbay-portal .sbay-inbox__time {
	color: var(--sbay-text-soft);
	font-size: 13px;
}

#sbay-portal .sbay-inbox__time {
	flex: 0 0 auto;
	font-size: 12px;
}

#sbay-portal .sbay-inbox__item.is-unread .sbay-inbox__preview {
	color: var(--sbay-text);
	font-weight: 600;
}

#sbay-portal .sbay-inbox__muted {
	color: var(--sbay-text-soft);
}

#sbay-portal .sbay-inbox__empty,
#sbay-portal .sbay-thread__placeholder {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 24px;
	color: var(--sbay-text-soft);
	text-align: center;
}

#sbay-portal .sbay-app .sbay-thread__placeholder h2 {
	color: var(--sbay-text);
}

#sbay-portal .sbay-thread__head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	border-bottom: 1px solid var(--sbay-border);
}

#sbay-portal .sbay-app .sbay-thread__back {
	display: none;
}

#sbay-portal .sbay-thread__who {
	flex: 1 1 auto;
	min-width: 0;
}

#sbay-portal .sbay-app .sbay-thread__title {
	overflow: hidden;
	font-size: 16px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

#sbay-portal .sbay-app .sbay-thread__title a {
	color: inherit;
	text-decoration: none;
}

#sbay-portal .sbay-thread__subtitle {
	overflow: hidden;
	color: var(--sbay-text-soft);
	font-size: 13px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

#sbay-portal .sbay-thread__actions {
	display: flex;
	align-items: center;
	gap: 4px;
}

#sbay-portal .sbay-menu {
	position: relative;
}

#sbay-portal .sbay-menu .sbay-dropdown {
	z-index: 30;
	top: calc(100% + 6px);
}

#sbay-portal .sbay-app .sbay-icon-button:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

#sbay-portal .sbay-thread__rename {
	display: flex;
	gap: 8px;
	padding: 10px 16px;
	border-bottom: 1px solid var(--sbay-border);
}

#sbay-portal .sbay-app .sbay-thread__rename .sbay-input {
	flex: 1 1 auto;
}

#sbay-portal .sbay-thread__scroll {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 2px;
	min-height: 0;
	padding: 16px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

#sbay-portal .sbay-app .sbay-thread__older {
	align-self: center;
	margin-bottom: 8px;
}

#sbay-portal .sbay-thread__hint {
	margin: auto 0 12px;
	color: var(--sbay-text-soft);
	text-align: center;
}

#sbay-portal .sbay-thread__day {
	display: flex;
	justify-content: center;
	margin: 14px 0 8px;
}

#sbay-portal .sbay-thread__day span {
	padding: 2px 10px;
	border-radius: 999px;
	background: var(--sbay-surface-alt);
	color: var(--sbay-text-soft);
	font-size: 12px;
	font-weight: 600;
}

#sbay-portal .sbay-thread__event {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin: 8px 0;
	color: var(--sbay-text-soft);
	font-size: 13px;
	text-align: center;
}

#sbay-portal .sbay-thread__event time {
	font-size: 12px;
	opacity: 0.8;
}

#sbay-portal .sbay-thread__event.is-call {
	align-self: center;
	padding: 6px 12px;
	border-radius: 999px;
	background: var(--sbay-surface-alt);
	color: var(--sbay-text);
}

#sbay-portal .sbay-bubble-row {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	max-width: min(560px, 85%);
}

#sbay-portal .sbay-bubble-row.starts-run {
	margin-top: 8px;
}

#sbay-portal .sbay-bubble-row.is-mine {
	flex-direction: row-reverse;
	align-self: flex-end;
}

#sbay-portal .sbay-bubble-row__avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	object-fit: cover;
}

#sbay-portal .sbay-bubble-row__avatar.is-hidden {
	visibility: hidden;
}

#sbay-portal .sbay-bubble-wrap {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

#sbay-portal .sbay-bubble-row.is-mine .sbay-bubble-wrap {
	align-items: flex-end;
}

#sbay-portal .sbay-bubble__author {
	margin: 0 0 2px 12px;
	color: var(--sbay-text-soft);
	font-size: 12px;
	font-weight: 600;
}

#sbay-portal .sbay-bubble {
	max-width: 100%;
	padding: 8px 12px;
	border-radius: 16px;
	background: var(--sbay-surface-alt);
	color: var(--sbay-text);
	overflow-wrap: anywhere;
}

#sbay-portal .sbay-bubble-row.is-mine .sbay-bubble {
	background: var(--sbay-brand);
	color: #ffffff;
}

#sbay-portal .sbay-app .sbay-bubble-row.is-mine .sbay-bubble a {
	color: #ffffff;
	text-decoration: underline;
}

#sbay-portal .sbay-bubble p {
	margin: 0;
}

#sbay-portal .sbay-bubble p + p {
	margin-top: 6px;
}

#sbay-portal .sbay-bubble .sbay-media-grid {
	min-width: min(260px, 60vw);
	margin: 0 -4px 6px;
}

#sbay-portal .sbay-bubble.is-deleted,
#sbay-portal .sbay-bubble-row.is-mine .sbay-bubble.is-deleted {
	background: var(--sbay-fill);
	color: var(--sbay-text-soft);
}

#sbay-portal .sbay-bubble__deleted {
	color: var(--sbay-text-soft);
	font-style: italic;
}

#sbay-portal .sbay-bubble__meta {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 2px 6px 0;
	color: var(--sbay-text-soft);
	font-size: 11px;
}

#sbay-portal .sbay-app .sbay-bubble__action {
	font-size: 11px;
	opacity: 0;
}

#sbay-portal .sbay-bubble-row:hover .sbay-bubble__action,
#sbay-portal .sbay-bubble__action:focus-visible {
	opacity: 1;
}

@media (hover: none) {
	#sbay-portal .sbay-app .sbay-bubble__action {
		opacity: 1;
	}
}

#sbay-portal .sbay-thread__alert {
	margin: 0 16px 8px;
}

#sbay-portal .sbay-thread__composer {
	padding: 10px 12px 12px;
	border-top: 1px solid var(--sbay-border);
}

#sbay-portal .sbay-thread__composer .sbay-composer__media {
	margin: 0 0 8px;
}

#sbay-portal .sbay-thread__composer .sbay-composer__thumb {
	width: 64px;
	height: 64px;
}

#sbay-portal .sbay-thread__input {
	display: flex;
	align-items: flex-end;
	gap: 8px;
}

#sbay-portal .sbay-app .sbay-thread__input .sbay-thread__textarea {
	flex: 1 1 auto;
	min-height: 40px;
	max-height: 160px;
	padding: 9px 14px;
	border-radius: 20px;
	line-height: 1.45;
	resize: none;
}

#sbay-portal .sbay-app .sbay-thread__send {
	width: 40px;
	min-height: 40px;
	padding: 0;
	border-radius: 50%;
}

#sbay-portal .sbay-thread__blocked {
	margin: 0;
	padding: 14px 16px;
	border-top: 1px solid var(--sbay-border);
	color: var(--sbay-text-soft);
	text-align: center;
}

/* Member picker (new message, add people) */

#sbay-portal .sbay-picker__chosen {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 10px;
	padding: 0;
	list-style: none;
}

#sbay-portal .sbay-picker__chosen .sbay-chip {
	gap: 6px;
}

#sbay-portal .sbay-picker__chosen img {
	width: 20px;
	height: 20px;
	border-radius: 50%;
}

#sbay-portal .sbay-picker__results {
	max-height: 280px;
	margin: 0;
	padding: 0;
	overflow-y: auto;
	list-style: none;
}

#sbay-portal .sbay-picker {
	margin-top: 14px;
}

#sbay-portal .sbay-app .sbay-picker__item {
	display: flex;
	border: 0;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 8px;
	border-radius: var(--sbay-radius-small);
	background: transparent;
	color: var(--sbay-text);
	text-align: start;
	cursor: pointer;
}

#sbay-portal .sbay-app .sbay-picker__item:hover,
#sbay-portal .sbay-app .sbay-picker__item:focus-visible {
	background: var(--sbay-fill);
}

#sbay-portal .sbay-app .sbay-picker__item.is-picked {
	background: var(--sbay-brand-soft);
}

#sbay-portal .sbay-picker__item .sbay-avatar {
	width: 36px;
	height: 36px;
}

#sbay-portal .sbay-picker__name {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-width: 0;
	font-weight: 600;
}

#sbay-portal .sbay-picker__headline {
	overflow: hidden;
	color: var(--sbay-text-soft);
	font-size: 13px;
	font-weight: 400;
	text-overflow: ellipsis;
	white-space: nowrap;
}

#sbay-portal .sbay-picker__check {
	display: inline-flex;
	color: var(--sbay-brand);
}

#sbay-portal .sbay-picker__empty,
#sbay-portal .sbay-picker__tip {
	padding: 12px 8px;
	color: var(--sbay-text-soft);
	font-size: 14px;
}

#sbay-portal .sbay-modal__subtitle {
	margin: 18px 0 8px;
	font-size: 15px;
}

#sbay-portal .sbay-member-list__item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 0;
	border-top: 1px solid var(--sbay-border);
}

#sbay-portal .sbay-member-list__item:first-child {
	border-top: 0;
}

#sbay-portal .sbay-member-list__item .sbay-avatar {
	width: 36px;
	height: 36px;
}

#sbay-portal .sbay-member-list__item .sbay-link-button {
	margin-inline-start: auto;
}

#sbay-portal .sbay-profile-header__actions {
	display: flex;
	align-items: center;
	gap: 6px;
}

@media (max-width: 767px) {
	#sbay-portal .sbay-messages {
		grid-template-columns: minmax(0, 1fr);
		height: calc(100vh - var(--sbay-topbar-height) - 48px - 56px - env(safe-area-inset-bottom, 0px));
		height: calc(100dvh - var(--sbay-topbar-height) - 48px - 56px - env(safe-area-inset-bottom, 0px));
	}

	#sbay-portal .sbay-messages.has-thread .sbay-inbox,
	#sbay-portal .sbay-messages:not(.has-thread) .sbay-thread {
		display: none;
	}

	#sbay-portal .sbay-app .sbay-thread__back {
		display: inline-flex;
	}

	#sbay-portal .sbay-bubble-row {
		max-width: 92%;
	}
}

/* ==========================================================================
   26. Login, signup and account security
   ========================================================================== */

#sbay-portal .sbay-auth {
	display: grid;
	justify-items: center;
	align-content: start;
	gap: 20px;
	min-height: 100vh;
	padding: 40px 16px 56px;
}

.sbay-layout-theme #sbay-portal .sbay-auth {
	min-height: 0;
}

#sbay-portal .sbay-auth__top,
#sbay-portal .sbay-auth__card {
	width: 100%;
	max-width: 440px;
}

#sbay-portal .sbay-auth.is-wide .sbay-auth__top,
#sbay-portal .sbay-auth.is-wide .sbay-auth__card {
	max-width: 640px;
}

#sbay-portal .sbay-auth__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

#sbay-portal .sbay-auth__card {
	padding: 32px;
}

#sbay-portal .sbay-auth__card:focus {
	outline: none;
}

#sbay-portal .sbay-app .sbay-auth__title {
	font-size: 24px;
	line-height: 1.25;
}

#sbay-portal .sbay-app .sbay-auth__text {
	margin-top: 8px;
	color: var(--sbay-text-soft);
}

#sbay-portal .sbay-app .sbay-auth__card > .sbay-alert {
	margin-top: 16px;
}

#sbay-portal .sbay-app .sbay-alert a {
	color: inherit;
	font-weight: 700;
}

#sbay-portal .sbay-auth__form {
	margin-top: 8px;
}

#sbay-portal .sbay-auth__form .sbay-input {
	width: 100%;
}

#sbay-portal .sbay-app .sbay-auth__submit {
	width: 100%;
	min-height: 44px;
	margin-top: 24px;
}

#sbay-portal .sbay-auth__label-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
}

#sbay-portal .sbay-app .sbay-auth__link {
	font-size: 14px;
}

#sbay-portal .sbay-auth__terms {
	margin-inline-start: 28px;
}

#sbay-portal .sbay-auth__optional {
	color: var(--sbay-text-soft);
	font-size: 13px;
	font-weight: 400;
}

#sbay-portal .sbay-app .sbay-auth__note {
	margin-top: 12px;
	text-align: center;
}

#sbay-portal .sbay-app .sbay-auth__foot {
	color: var(--sbay-text-soft);
	text-align: center;
}

#sbay-portal .sbay-app .sbay-auth__foot a {
	font-weight: 600;
}

#sbay-portal .sbay-auth__options {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px 20px;
	margin-top: 20px;
}

#sbay-portal .sbay-app .sbay-link-button:disabled {
	color: var(--sbay-text-soft);
	cursor: default;
	text-decoration: none;
}

/* A field people never see; automated signups fill it in and are refused. */
#sbay-portal .sbay-auth__trap {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

#sbay-portal .sbay-password {
	position: relative;
	display: block;
}

#sbay-portal .sbay-app .sbay-password .sbay-input {
	width: 100%;
	padding-inline-end: 48px;
}

#sbay-portal .sbay-app .sbay-password__toggle {
	position: absolute;
	inset-block-start: 50%;
	inset-inline-end: 4px;
	width: 36px;
	height: 36px;
	transform: translateY(-50%);
}

#sbay-portal .sbay-app .sbay-input[aria-invalid="true"] {
	border-color: #b42318;
}

#sbay-portal .sbay-security {
	display: grid;
	gap: 20px;
}

/* A help text under one field must not push the field next to it down. */
#sbay-portal .sbay-security .sbay-field {
	align-content: start;
}

/* On the "protect your account" page the card of the page is enough. */
#sbay-portal .sbay-auth__card .sbay-security {
	margin-top: 16px;
}

#sbay-portal .sbay-auth__card .sbay-security .sbay-card {
	padding: 0;
	border: 0;
	box-shadow: none;
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-auth__link,
#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-auth__foot a,
#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-two-factor__status.is-on > .sbay-icon {
	color: var(--sbay-leaf);
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-alert.is-success {
	background: var(--sbay-brand-soft);
	color: var(--sbay-leaf);
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-input[aria-invalid="true"] {
	border-color: #fca5a5;
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-link-button.is-danger {
	color: #fca5a5;
}

@media (max-width: 600px) {
	#sbay-portal .sbay-auth {
		padding: 20px 12px 40px;
	}

	#sbay-portal .sbay-auth__card {
		padding: 24px 20px;
	}

	
}

/* ==========================================================================
   30. Points, levels and badges
   ========================================================================== */

#sbay-portal .sbay-level-tag {
	display: inline-flex;
	align-items: center;
	padding: 1px 8px;
	border-radius: 999px;
	background: var(--sbay-brand-soft);
	color: var(--sbay-brand-strong);
	font-size: 11px;
	font-weight: 600;
	line-height: 18px;
	white-space: nowrap;
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-level-tag {
	color: var(--sbay-leaf);
}

#sbay-portal .sbay-post__byline {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 8px;
	min-width: 0;
}

#sbay-portal .sbay-member-row__headline .sbay-level-tag {
	margin-inline-end: 6px;
}

#sbay-portal .sbay-profile-header__meta .sbay-level-tag {
	font-size: 12px;
}

#sbay-portal .sbay-achievements {
	display: grid;
	gap: 18px;
}

#sbay-portal .sbay-achievements__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

#sbay-portal .sbay-achievements__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

#sbay-portal .sbay-app .sbay-achievements__subtitle {
	margin: 4px 0 0;
	color: var(--sbay-text-soft);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

#sbay-portal .sbay-level {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 16px;
	border-radius: var(--sbay-radius);
	background: var(--sbay-surface-alt);
}

#sbay-portal .sbay-level__number {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: var(--sbay-brand);
	color: #ffffff;
	font-size: 22px;
	font-weight: 700;
}

#sbay-portal .sbay-level__body {
	flex: 1;
	min-width: 0;
}

#sbay-portal .sbay-app .sbay-level__name {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 12px;
	margin: 0 0 8px;
	font-size: 18px;
	font-weight: 700;
}

#sbay-portal .sbay-level__points,
#sbay-portal .sbay-level__rank {
	color: var(--sbay-text-soft);
	font-size: 14px;
	font-weight: 500;
}

#sbay-portal .sbay-app .sbay-level__next {
	margin: 6px 0 0;
	color: var(--sbay-text-soft);
	font-size: 13px;
}

#sbay-portal .sbay-progress {
	display: block;
	overflow: hidden;
	height: 8px;
	border-radius: 999px;
	background: var(--sbay-border);
}

#sbay-portal .sbay-progress--small {
	width: 100%;
	height: 5px;
}

#sbay-portal .sbay-progress__bar {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: var(--sbay-brand);
	transition: width 0.4s ease;
}

#sbay-portal .sbay-badge-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

#sbay-portal .sbay-badge-tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 16px 12px;
	border-radius: var(--sbay-radius);
	background: var(--sbay-surface-alt);
	text-align: center;
}

#sbay-portal .sbay-badge-tile.is-locked {
	background: transparent;
}

#sbay-portal .sbay-badge-tile__name {
	font-weight: 600;
	line-height: 1.3;
}

#sbay-portal .sbay-badge-tile__text {
	color: var(--sbay-text-soft);
	font-size: 13px;
	line-height: 1.4;
}

#sbay-portal .sbay-badge-tile__date {
	color: var(--sbay-text-soft);
	font-size: 12px;
}

#sbay-portal .sbay-medal--large {
	width: 60px;
	height: 60px;
	box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.35), 0 0 0 3px color-mix(in srgb, var(--sbay-medal) 22%, transparent);
}

#sbay-portal .sbay-award-list,
#sbay-portal .sbay-points-list {
	display: grid;
	gap: 8px;
	max-height: min(60vh, 520px);
	margin: 0 0 16px;
	padding: 0 4px 0 0;
	overflow-y: auto;
	list-style: none;
	overscroll-behavior: contain;
}

#sbay-portal .sbay-app .sbay-notice-line {
	margin: 8px 0 0;
	color: var(--sbay-brand-strong);
	font-weight: 600;
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-notice-line {
	color: var(--sbay-leaf);
}

#sbay-portal .sbay-points-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 0;
	border-bottom: 1px solid var(--sbay-border);
}

#sbay-portal .sbay-points-row__value {
	min-width: 48px;
	color: var(--sbay-brand-strong);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-points-row__value {
	color: var(--sbay-leaf);
}

#sbay-portal .sbay-points-row__value.is-negative {
	color: #b42318;
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-points-row__value.is-negative {
	color: #fda29b;
}

#sbay-portal .sbay-points-row__text {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-width: 0;
}

#sbay-portal .sbay-points-row__note,
#sbay-portal .sbay-points-row__time {
	color: var(--sbay-text-soft);
	font-size: 13px;
}

/* Leaderboard */

#sbay-portal .sbay-app .sbay-leaderboard__since {
	margin: 12px 0;
	font-size: 14px;
}

#sbay-portal .sbay-podium {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	align-items: end;
	gap: 12px;
	margin: 0 0 16px;
	padding: 0;
	list-style: none;
}

#sbay-portal .sbay-podium__place {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	min-width: 0;
	padding: 20px 12px 18px;
	border-radius: var(--sbay-radius);
	background: var(--sbay-surface);
	box-shadow: var(--sbay-shadow);
	text-align: center;
}

#sbay-portal .sbay-podium.has-2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	max-width: 66%;
	margin-inline: auto;
}

#sbay-portal .sbay-podium.has-1 {
	grid-template-columns: minmax(0, 1fr);
	max-width: 34%;
	margin-inline: auto;
}

#sbay-portal .sbay-podium__place.is-1 {
	order: 2;
	padding-top: 28px;
	padding-bottom: 26px;
	background: linear-gradient(180deg, color-mix(in srgb, #e7b416 12%, var(--sbay-surface)) 0%, var(--sbay-surface) 70%);
	box-shadow: 0 8px 24px rgba(231, 180, 22, 0.16);
}

#sbay-portal .sbay-podium__place.is-2 {
	order: 1;
}

#sbay-portal .sbay-podium__place.is-3 {
	order: 3;
}

#sbay-portal .sbay-podium__place.is-self {
	background: var(--sbay-brand-soft);
}

#sbay-portal .sbay-podium__rank {
	position: absolute;
	top: -12px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #8a94a6;
	color: #ffffff;
	font-size: 14px;
	font-weight: 700;
}

#sbay-portal .sbay-podium__place.is-1 .sbay-podium__rank {
	background: #a16207;
}

#sbay-portal .sbay-podium__place.is-3 .sbay-podium__rank {
	background: #9a5b2d;
}

#sbay-portal .sbay-podium__avatar {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	object-fit: cover;
}

#sbay-portal .sbay-podium__place.is-1 .sbay-podium__avatar {
	width: 80px;
	height: 80px;
}

#sbay-portal .sbay-app .sbay-podium__name {
	overflow: hidden;
	max-width: 100%;
	color: var(--sbay-text);
	font-weight: 700;
	text-decoration: none;
	text-overflow: ellipsis;
	white-space: nowrap;
}

#sbay-portal .sbay-app .sbay-podium__name:hover {
	text-decoration: underline;
}

#sbay-portal .sbay-podium__points {
	color: var(--sbay-text-soft);
	font-size: 14px;
	font-variant-numeric: tabular-nums;
}

#sbay-portal .sbay-board {
	margin: 0;
	padding: 4px 0;
	list-style: none;
}

#sbay-portal .sbay-board__row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 20px;
	border-bottom: 1px solid var(--sbay-border);
}

#sbay-portal .sbay-board__row:last-child {
	border-bottom: 0;
}

#sbay-portal .sbay-board__row.is-self {
	background: var(--sbay-brand-soft);
}

#sbay-portal .sbay-board__rank {
	width: 28px;
	color: var(--sbay-text-soft);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	text-align: center;
}

#sbay-portal .sbay-board__avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
}

#sbay-portal .sbay-board__who {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

#sbay-portal .sbay-app .sbay-board__name {
	overflow: hidden;
	color: var(--sbay-text);
	font-weight: 600;
	text-decoration: none;
	text-overflow: ellipsis;
	white-space: nowrap;
}

#sbay-portal .sbay-app .sbay-board__name:hover {
	text-decoration: underline;
}

#sbay-portal .sbay-board__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 8px;
	color: var(--sbay-text-soft);
	font-size: 13px;
}

#sbay-portal .sbay-board__points {
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

#sbay-portal .sbay-app .sbay-board__me {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 16px;
	padding: 14px 20px;
	color: var(--sbay-text-soft);
}

#sbay-portal .sbay-rail-list--ranked .sbay-rail-list__link {
	align-items: center;
}

#sbay-portal .sbay-rail-rank {
	width: 16px;
	color: var(--sbay-text-soft);
	font-size: 13px;
	font-weight: 700;
	text-align: center;
}

#sbay-portal .sbay-rail-points {
	margin-inline-start: auto;
	color: var(--sbay-text-soft);
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
}

#sbay-portal .sbay-notice__avatar--icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--sbay-brand-soft);
	color: var(--sbay-brand-strong);
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-notice__avatar--icon {
	color: var(--sbay-leaf);
}

/* ==========================================================================
   31. Events
   ========================================================================== */

#sbay-portal .sbay-event-list {
	display: grid;
	gap: 12px;
	margin: 16px 0 0;
	padding: 0;
	list-style: none;
}

#sbay-portal .sbay-event-card {
	display: flex;
	align-items: flex-start;
	gap: 16px;
}

#sbay-portal .sbay-event-card.is-past {
	opacity: 0.85;
}

#sbay-portal .sbay-event-date {
	display: flex;
	flex-shrink: 0;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 56px;
	padding: 6px 0;
	border-radius: var(--sbay-radius-small);
	background: var(--sbay-brand-soft);
	line-height: 1.1;
}

#sbay-portal .sbay-event-date__month {
	color: var(--sbay-brand-strong);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-event-date__month {
	color: var(--sbay-leaf);
}

#sbay-portal .sbay-event-date__day {
	font-size: 22px;
	font-weight: 700;
}

#sbay-portal .sbay-event-date__weekday {
	color: var(--sbay-text-soft);
	font-size: 12px;
}

#sbay-portal .sbay-event-date--large {
	width: 72px;
	padding: 10px 0;
}

#sbay-portal .sbay-event-date--large .sbay-event-date__day {
	font-size: 30px;
}

#sbay-portal .sbay-event-date--small {
	width: 40px;
	padding: 3px 0;
}

#sbay-portal .sbay-event-date--small .sbay-event-date__month {
	font-size: 9px;
}

#sbay-portal .sbay-event-date--small .sbay-event-date__day {
	font-size: 15px;
}

#sbay-portal .sbay-event-card__body {
	flex: 1;
	min-width: 0;
}

#sbay-portal .sbay-app .sbay-event-card__title {
	margin: 0 0 6px;
	font-size: 17px;
	line-height: 1.35;
}

#sbay-portal .sbay-app .sbay-event-card__title a {
	color: var(--sbay-text);
	text-decoration: none;
}

#sbay-portal .sbay-app .sbay-event-card__title a:hover {
	text-decoration: underline;
}

#sbay-portal .sbay-event-card.is-cancelled .sbay-event-card__title a {
	text-decoration: line-through;
}

#sbay-portal .sbay-app .sbay-event-card__when,
#sbay-portal .sbay-app .sbay-event-card__where {
	display: flex;
	align-items: flex-start;
	gap: 6px;
	margin: 0 0 4px;
	color: var(--sbay-text-soft);
	font-size: 14px;
}

#sbay-portal .sbay-event-card__when .sbay-icon,
#sbay-portal .sbay-event-card__where .sbay-icon {
	flex-shrink: 0;
	margin-top: 2px;
}

#sbay-portal .sbay-app .sbay-event-card__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 12px;
	margin: 8px 0 0;
	color: var(--sbay-text-soft);
	font-size: 13px;
}

#sbay-portal .sbay-app .sbay-event-card__space {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--sbay-text-soft);
	text-decoration: none;
}

#sbay-portal .sbay-app .sbay-event-card__space:hover {
	color: var(--sbay-text);
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-pill.is-cancelled {
	background: #3d1714;
	color: #fda29b;
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-pill.is-soon {
	background: #3a2a07;
	color: #fcd977;
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-pill.is-going {
	color: var(--sbay-leaf);
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-pill.is-maybe {
	background: #172554;
	color: #bfdbfe;
}

#sbay-portal .sbay-app .sbay-back-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 12px;
	color: var(--sbay-text-soft);
	font-weight: 500;
	text-decoration: none;
}

#sbay-portal .sbay-app .sbay-back-link:hover {
	color: var(--sbay-text);
}

#sbay-portal .sbay-event {
	display: grid;
	gap: 20px;
}

#sbay-portal .sbay-event__head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 16px 20px;
}

#sbay-portal .sbay-event__intro {
	flex: 1;
	min-width: 220px;
}

#sbay-portal .sbay-app .sbay-event__badges {
	display: flex;
	gap: 8px;
	margin: 0 0 6px;
}

#sbay-portal .sbay-app .sbay-event__badges:empty {
	display: none;
}

#sbay-portal .sbay-app .sbay-event__title {
	margin: 0 0 6px;
	font-size: 26px;
	line-height: 1.25;
}

#sbay-portal .sbay-event.is-cancelled .sbay-event__title {
	text-decoration: line-through;
}

#sbay-portal .sbay-app .sbay-event__space {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin: 0;
	color: var(--sbay-text-soft);
	font-size: 14px;
}

#sbay-portal .sbay-app .sbay-event__space a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--sbay-text);
	font-weight: 600;
	text-decoration: none;
}

#sbay-portal .sbay-app .sbay-event__space a:hover {
	text-decoration: underline;
}

#sbay-portal .sbay-event__manage {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

#sbay-portal .sbay-event__facts {
	display: grid;
	gap: 12px;
	margin: 0;
	padding: 16px;
	border-radius: var(--sbay-radius);
	background: var(--sbay-surface-alt);
}

#sbay-portal .sbay-event__fact {
	display: flex;
	align-items: flex-start;
	gap: 12px;
}

#sbay-portal .sbay-event__fact dt {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	height: 24px;
	color: var(--sbay-brand);
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-event__fact dt {
	color: var(--sbay-leaf);
}

#sbay-portal .sbay-event__fact dd {
	margin: 0;
	min-height: 24px;
	line-height: 24px;
	overflow-wrap: anywhere;
}

#sbay-portal .sbay-app .sbay-event__fact dd .sbay-link-button {
	min-height: 24px;
	line-height: inherit;
}

#sbay-portal .sbay-app .sbay-event__join {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--sbay-brand-strong);
	font-weight: 600;
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-event__join {
	color: var(--sbay-leaf);
}

#sbay-portal .sbay-app .sbay-event__join-note {
	margin: 0;
}

#sbay-portal .sbay-event__text {
	line-height: 1.6;
}

#sbay-portal .sbay-event__calendar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	padding-top: 16px;
	border-top: 1px solid var(--sbay-border);
}

#sbay-portal .sbay-event__calendar-menu .sbay-dropdown {
	inset-inline: 0 auto;
	/* Opens upward: the bar sits at the foot of the page, where the phone's tab bar would cover a menu below it. */
	top: auto;
	bottom: calc(100% + 6px);
	width: max-content;
	max-width: calc(100vw - 48px);
}

#sbay-portal .sbay-event__calendar-menu .sbay-dropdown__item {
	white-space: nowrap;
}

#sbay-portal .sbay-avatar-stack {
	display: flex;
	flex-wrap: wrap;
	margin: 0;
	padding: 0;
	padding-inline-start: 8px;
	list-style: none;
}

#sbay-portal .sbay-avatar-stack li {
	margin-inline-start: -8px;
}

#sbay-portal .sbay-avatar-stack .sbay-avatar {
	width: 36px;
	height: 36px;
	border: 2px solid var(--sbay-surface);
	border-radius: 50%;
	object-fit: cover;
}

#sbay-portal .sbay-confirm {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
	border-radius: var(--sbay-radius);
	background: #fde8e6;
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-confirm {
	background: #3b1512;
}

#sbay-portal .sbay-app .sbay-confirm p {
	flex: 1;
	min-width: 220px;
	margin: 0;
}

#sbay-portal .sbay-confirm__actions {
	display: flex;
	gap: 8px;
}

#sbay-portal .sbay-rsvp {
	display: grid;
	gap: 8px;
}

#sbay-portal .sbay-rsvp__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

#sbay-portal .sbay-app .sbay-rsvp__button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 40px;
	padding: 8px 16px;
	border: 0;
	border-radius: 999px;
	background: var(--sbay-fill);
	color: var(--sbay-text);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

#sbay-portal .sbay-app .sbay-rsvp__button:hover:not(:disabled),
#sbay-portal .sbay-app .sbay-rsvp__button:focus-visible {
	background: var(--sbay-fill-strong);
}

#sbay-portal .sbay-app .sbay-rsvp__button.is-selected,
#sbay-portal .sbay-app .sbay-rsvp__button.is-selected:hover:not(:disabled) {
	background: var(--sbay-brand);
	color: #ffffff;
}

#sbay-portal .sbay-app .sbay-rsvp__button:disabled {
	cursor: not-allowed;
	opacity: 0.55;
}

#sbay-portal .sbay-app .sbay-rsvp__note {
	margin: 0;
	color: var(--sbay-text-soft);
	font-size: 13px;
}

#sbay-portal .sbay-event-form {
	display: grid;
	gap: 16px;
}

#sbay-portal .sbay-app .sbay-event-form__help {
	margin-top: -8px;
}

#sbay-portal .sbay-event-form__capacity {
	max-width: 220px;
}

#sbay-portal .sbay-space-events__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}

#sbay-portal .sbay-segmented-tabs {
	display: flex;
	gap: 8px;
}

/* Calendar */

#sbay-portal .sbay-calendar {
	padding: 16px;
}

#sbay-portal .sbay-calendar__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}

#sbay-portal .sbay-app .sbay-calendar__month {
	margin: 0;
	font-size: 18px;
}

#sbay-portal .sbay-calendar__nav {
	display: flex;
	align-items: center;
	gap: 4px;
}

#sbay-portal .sbay-calendar__grid {
	display: grid;
	gap: 4px;
}

#sbay-portal .sbay-calendar__row {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 4px;
}

#sbay-portal .sbay-calendar__weekday {
	padding: 4px 0;
	color: var(--sbay-text-soft);
	font-size: 12px;
	font-weight: 600;
	text-align: center;
}

#sbay-portal .sbay-app .sbay-calendar__day {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 3px;
	min-width: 0;
	min-height: 86px;
	padding: 6px;
	border: 0;
	border-radius: var(--sbay-radius-small);
	background: var(--sbay-fill);
	color: var(--sbay-text);
	font: inherit;
	text-align: start;
	cursor: pointer;
}

#sbay-portal .sbay-app .sbay-calendar__day:hover,
#sbay-portal .sbay-app .sbay-calendar__day:focus-visible {
	background: var(--sbay-fill-strong);
}

#sbay-portal .sbay-app .sbay-calendar__day.is-other {
	background: transparent;
	color: var(--sbay-text-soft);
}

#sbay-portal .sbay-app .sbay-calendar__day.is-other:hover {
	background: var(--sbay-fill);
}

#sbay-portal .sbay-app .sbay-calendar__day.is-picked {
	background: var(--sbay-brand-soft);
}

#sbay-portal .sbay-calendar__date {
	font-size: 13px;
	font-weight: 600;
}

#sbay-portal .sbay-calendar__day.is-today .sbay-calendar__date {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	align-self: flex-start;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--sbay-brand);
	color: #ffffff;
}

#sbay-portal .sbay-calendar__events {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

#sbay-portal .sbay-calendar__chip {
	overflow: hidden;
	padding: 1px 6px;
	border-radius: 4px;
	background: var(--sbay-brand-soft);
	color: var(--sbay-brand-strong);
	font-size: 11px;
	font-weight: 600;
	line-height: 16px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-calendar__chip {
	color: var(--sbay-leaf);
}

#sbay-portal .sbay-calendar__day.is-picked .sbay-calendar__chip:not(.is-going):not(.is-cancelled) {
	background: var(--sbay-surface);
}

#sbay-portal .sbay-calendar__chip.is-going,
#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-calendar__chip.is-going {
	background: var(--sbay-brand);
	color: #ffffff;
}

#sbay-portal .sbay-calendar__chip.is-cancelled,
#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-calendar__chip.is-cancelled {
	background: var(--sbay-surface-alt);
	color: var(--sbay-text-soft);
	text-decoration: line-through;
}

#sbay-portal .sbay-calendar__more {
	color: var(--sbay-text-soft);
	font-size: 11px;
	font-weight: 600;
}

#sbay-portal .sbay-calendar__dot {
	display: none;
}

@media (max-width: 767px) {
	#sbay-portal .sbay-podium {
		gap: 8px;
	}

	#sbay-portal .sbay-podium.has-2 {
		max-width: none;
	}

	#sbay-portal .sbay-podium.has-1 {
		max-width: 60%;
	}

	#sbay-portal .sbay-podium__place {
		padding: 18px 6px 14px;
	}

	#sbay-portal .sbay-podium__avatar,
	#sbay-portal .sbay-podium__place.is-1 .sbay-podium__avatar {
		width: 52px;
		height: 52px;
	}

	#sbay-portal .sbay-board__row {
		padding: 10px 14px;
	}

	#sbay-portal .sbay-level {
		align-items: flex-start;
	}

	#sbay-portal .sbay-badge-grid {
		grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
	}

	#sbay-portal .sbay-app .sbay-calendar__day {
		align-items: center;
		min-height: 48px;
		padding: 4px 2px;
	}

	#sbay-portal .sbay-calendar__events {
		display: none;
	}

	#sbay-portal .sbay-calendar__dot {
		display: block;
		width: 6px;
		height: 6px;
		border-radius: 50%;
		background: var(--sbay-brand);
	}

	#sbay-portal .sbay-calendar__day.is-today .sbay-calendar__date {
		align-self: center;
	}

	#sbay-portal .sbay-event-card {
		gap: 12px;
	}

	#sbay-portal .sbay-app .sbay-event__title {
		font-size: 22px;
	}
}

/* ==========================================================================
   Social login buttons
   ========================================================================== */

#sbay-portal .sbay-social {
	display: grid;
	gap: 10px;
	margin-top: 20px;
}

#sbay-portal .sbay-app .sbay-social__divider {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 4px;
	color: var(--sbay-text-soft);
	font-size: 13px;
}

#sbay-portal .sbay-social__divider::before,
#sbay-portal .sbay-social__divider::after {
	flex: 1 1 auto;
	height: 1px;
	background: var(--sbay-border);
	content: "";
}

#sbay-portal .sbay-app .sbay-social__button {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 16px;
	border-radius: 8px;
	background: var(--sbay-fill);
	color: var(--sbay-text);
	font-weight: 600;
	text-decoration: none;
	transition: background-color 0.15s ease;
}

#sbay-portal .sbay-app .sbay-social__button:hover,
#sbay-portal .sbay-app .sbay-social__button:focus-visible {
	background: var(--sbay-fill-strong);
	color: var(--sbay-text);
}

#sbay-portal .sbay-app .sbay-social__terms {
	margin: 2px 0 0;
	text-align: center;
}

/* Profile sections added by add-ons (Posts, Shop …). */
#sbay-portal .sbay-profile-tabs {
	margin-top: 8px;
}

/* ==========================================================================
   27. Composer: entry bar, new-post dialog, character counter, large short posts
   ========================================================================== */

/* Entry bar: an input-looking button that opens the dialog. */
#sbay-portal .sbay-composer-bar {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
}

#sbay-portal .sbay-composer-bar__avatar {
	width: 40px;
	height: 40px;
	flex-shrink: 0;
}

#sbay-portal .sbay-app .sbay-composer-bar__open {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 44px;
	padding: 0 16px;
	border: 1px solid var(--sbay-field-border);
	border-radius: 999px;
	background: var(--sbay-surface-alt);
	color: var(--sbay-text-soft);
	font: inherit;
	text-align: start;
	text-overflow: ellipsis;
	white-space: nowrap;
	overflow: hidden;
	cursor: pointer;
}

#sbay-portal .sbay-app .sbay-composer-bar__open:hover {
	background: var(--sbay-fill-strong);
}

#sbay-portal .sbay-composer-bar__tools {
	display: flex;
	gap: 2px;
	flex-shrink: 0;
}

#sbay-portal .sbay-composer-bar__tools .sbay-icon-button {
	width: auto;
	min-width: 44px;
	height: 44px;
	gap: 6px;
}

#sbay-portal .sbay-icon-button__label {
	display: none;
	font-size: 14px;
	font-weight: 600;
}

/* Dialog */
#sbay-portal .sbay-modal--composer .sbay-modal__dialog {
	max-width: 560px;
}

#sbay-portal .sbay-modal--composer .sbay-modal__header {
	gap: 12px;
	padding-block: 8px;
}

#sbay-portal .sbay-modal--composer .sbay-modal__title {
	flex: 1 1 auto;
	margin: 0;
}

#sbay-portal .sbay-modal--composer .sbay-modal__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	flex-shrink: 0;
}

#sbay-portal .sbay-modal--composer .sbay-modal__body {
	padding: 16px 24px;
}

#sbay-portal .sbay-modal--composer .sbay-modal__footer {
	align-items: center;
	gap: 8px 10px;
	padding: 12px 24px;
}

#sbay-portal .sbay-modal__footer-hint {
	flex: 1 0 100%;
	order: -1;
	color: var(--sbay-text-soft);
	font-size: 13px;
}

#sbay-portal .sbay-modal--composer .sbay-modal__footer .sbay-button {
	min-height: 44px;
}

#sbay-portal .sbay-composer__who {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

#sbay-portal .sbay-composer__who-main {
	display: flex;
	flex: 0 1 auto;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

#sbay-portal .sbay-composer__who-main .sbay-avatar {
	flex: none;
}

#sbay-portal .sbay-composer__who-text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

#sbay-portal .sbay-composer__name {
	overflow: hidden;
	font-weight: 600;
	text-overflow: ellipsis;
	white-space: nowrap;
}

#sbay-portal .sbay-composer__handle {
	overflow: hidden;
	color: var(--sbay-text-soft);
	font-size: 13px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

#sbay-portal .sbay-app .sbay-composer__space {
	flex: 0 1 220px;
	min-width: 0;
	margin: 0;
	color: var(--sbay-text-soft);
	font-size: 13px;
	text-align: end;
}

#sbay-portal .sbay-composer__space .sbay-select {
	width: 100%;
	min-width: 0;
}

#sbay-portal .sbay-composer__space.is-fixed {
	flex-basis: auto;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Space picker in the composer footer: the list opens above the button. */
#sbay-portal .sbay-space-picker {
	position: relative;
	flex: 0 1 200px;
	min-width: 0;
	margin-inline-end: auto;
}

#sbay-portal .sbay-space-picker__button {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	width: 100%;
	min-height: 44px;
	padding: 6px 12px;
	border: 0;
	border-radius: 8px;
	background: var(--sbay-brand-soft);
	color: var(--sbay-brand-strong);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

#sbay-portal .sbay-space-picker__button:hover,
#sbay-portal .sbay-space-picker__button:focus-visible,
#sbay-portal .sbay-space-picker__button[aria-expanded="true"] {
	background: var(--sbay-brand-muted);
	box-shadow: none;
}

#sbay-portal .sbay-space-picker__value {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

#sbay-portal .sbay-space-picker__list {
	position: absolute;
	bottom: calc(100% + 8px);
	inset-inline-start: 0;
	z-index: 5;
	min-width: 100%;
	width: max-content;
	max-width: min(320px, calc(100vw - 32px));
	max-height: 240px;
	margin: 0;
	padding: 6px;
	overflow-y: auto;
	border-radius: var(--sbay-radius);
	background: var(--sbay-surface);
	box-shadow: var(--sbay-shadow-pop);
	list-style: none;
}

#sbay-portal .sbay-space-picker__option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 9px 10px;
	border-radius: 8px;
	color: var(--sbay-text);
	font-size: 14px;
	cursor: pointer;
}

#sbay-portal .sbay-space-picker__option.is-active {
	background: var(--sbay-brand-soft);
}

#sbay-portal .sbay-space-picker__option.is-selected {
	color: var(--sbay-brand-strong);
	font-weight: 600;
}

#sbay-portal .sbay-app .sbay-composer-form .sbay-composer__title-field {
	margin-top: 8px;
	font-size: 20px;
	font-weight: 600;
	line-height: 1.3;
}

#sbay-portal .sbay-app .sbay-composer-form .sbay-composer__title-field::placeholder {
	color: var(--sbay-text-soft);
	font-weight: 600;
}

#sbay-portal .sbay-composer__restored {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 12px;
	padding: 8px 12px;
	border-radius: var(--sbay-radius-small);
	background: var(--sbay-surface-alt);
	color: var(--sbay-text-soft);
	font-size: 13px;
}

#sbay-portal .sbay-app .sbay-composer__restored button {
	min-height: 44px;
	padding: 0 4px;
	border: 0;
	background: none;
	color: var(--sbay-link);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

#sbay-portal .sbay-composer-form .sbay-composer__field {
	margin-top: 12px;
}

#sbay-portal .sbay-app .sbay-composer-form .sbay-textarea.sbay-textarea--post {
	height: auto;
	min-height: 140px;
	padding: 12px 14px;
	border-radius: 8px;
	background: none;
	font-size: 17px;
	line-height: 1.5;
}

/* No ring on a field: the box takes a soft fill instead. */
#sbay-portal .sbay-app .sbay-composer-form .sbay-textarea.sbay-textarea--post:focus {
	background: var(--sbay-surface-alt);
	box-shadow: none;
}

#sbay-portal .sbay-composer__meta {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	color: var(--sbay-text-soft);
	font-size: 13px;
}

#sbay-portal .sbay-limit__count.is-over {
	color: #9f1c13;
	font-weight: 600;
}

#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-limit__count.is-over {
	color: #fecaca;
}

#sbay-portal .sbay-composer-form .sbay-composer__media {
	margin-top: 12px;
}

#sbay-portal .sbay-composer-form .sbay-composer__remove {
	top: -6px;
	inset-inline-end: -6px;
	width: 28px;
	height: 28px;
	border: 2px solid var(--sbay-surface);
	background: #2b3345;
}

/* A 44px hit area around the 28px visible circle. */
#sbay-portal .sbay-composer-form .sbay-composer__remove::after {
	content: "";
	position: absolute;
	inset: -8px;
}

#sbay-portal .sbay-composer-form .sbay-composer__thumb {
	overflow: visible;
}

#sbay-portal .sbay-composer-form .sbay-composer__thumb img,
#sbay-portal .sbay-composer-form .sbay-composer__thumb.is-loading {
	border-radius: var(--sbay-radius-small);
}

#sbay-portal .sbay-composer__progress {
	margin-top: 8px;
	color: var(--sbay-text-soft);
	font-size: 13px;
}

#sbay-portal .sbay-app .sbay-composer__error {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin-top: 12px;
}

#sbay-portal .sbay-composer__error button {
	min-height: 44px;
	flex-shrink: 0;
	padding: 0 12px;
	border: 1px solid currentColor;
	border-radius: 6px;
	background: none;
	color: inherit;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

#sbay-portal .sbay-composer__tools {
	display: flex;
	align-items: center;
	gap: 4px;
	margin-top: 12px;
	padding: 6px 8px;
	border: 1px solid var(--sbay-border);
	border-radius: var(--sbay-radius-small);
}

#sbay-portal .sbay-composer__tools-label {
	flex: 1 1 auto;
	padding-inline-start: 4px;
	font-size: 14px;
	font-weight: 600;
}

#sbay-portal .sbay-composer__tools .sbay-icon-button {
	width: 44px;
	height: 44px;
}

#sbay-portal .sbay-composer__more {
	margin-top: 12px;
}

#sbay-portal .sbay-app .sbay-composer__disclosure {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	padding: 0 4px;
	border: 0;
	background: none;
	color: var(--sbay-link);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

#sbay-portal .sbay-composer__more-body {
	padding-top: 4px;
}

#sbay-portal .sbay-composer__more-body .sbay-input {
	min-height: 44px;
	font-size: 16px;
}

#sbay-portal .sbay-composer__reason {
	flex: 1 1 100%;
	color: var(--sbay-text-soft);
	font-size: 13px;
	text-align: end;
}

#sbay-portal .sbay-comments__limit {
	display: block;
	color: var(--sbay-text-soft);
	font-size: 13px;
}

#sbay-portal .sbay-comments__limit-reason {
	color: var(--sbay-text-soft);
	font-size: 13px;
}

/* Discard confirm, above the dialog. */
#sbay-portal .sbay-discard {
	position: fixed;
	inset: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: var(--sbay-backdrop);
}

#sbay-portal .sbay-discard__box {
	width: 100%;
	max-width: 400px;
	padding: 24px;
	border-radius: var(--sbay-radius);
	background: var(--sbay-surface);
	box-shadow: var(--sbay-shadow-pop);
}

#sbay-portal .sbay-app .sbay-discard__title {
	margin: 0 0 8px;
	font-size: 18px;
}

#sbay-portal .sbay-app .sbay-discard__text {
	margin: 0 0 20px;
	color: var(--sbay-text-soft);
}

#sbay-portal .sbay-discard__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 8px;
}

#sbay-portal .sbay-discard__actions .sbay-button {
	min-height: 44px;
}

/* The shared dark ghost hover/focus fill is too close to its text colour; keep AA here. */
#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-discard__actions .sbay-button--ghost:hover,
#sbay-portal .sbay-app[data-sbay-theme="dark"] .sbay-discard__actions .sbay-button--ghost:focus-visible {
	background: var(--sbay-surface-alt, var(--sbay-bg));
	color: var(--sbay-text);
}

#sbay-portal .sbay-app .sbay-button.sbay-button--danger {
	border-color: var(--sbay-danger);
	background: var(--sbay-danger);
	color: var(--sbay-danger-text);
}

#sbay-portal .sbay-app .sbay-button.sbay-button--danger:hover,
#sbay-portal .sbay-app .sbay-button.sbay-button--danger:focus-visible {
	border-color: var(--sbay-danger-strong);
	background: var(--sbay-danger-strong);
}

/* Large type for short text-only posts (display only). */
#sbay-portal .sbay-post__body.is-large {
	font-size: 1.5rem;
	line-height: 1.35;
	overflow-wrap: anywhere;
}

#sbay-portal .sbay-post__body.is-large p {
	margin-bottom: 6px;
}

/* Phone: full-screen dialog, 44px+ targets, 16px fields (no iOS zoom), safe areas. */
@media (max-width: 600px) {
	#sbay-portal .sbay-composer-bar {
		flex-wrap: wrap;
		padding: 12px 16px 0;
	}

	#sbay-portal .sbay-composer-bar__tools {
		flex: 1 0 100%;
		order: 3;
		margin: 8px -16px 0;
		padding: 0 8px;
		border-top: 1px solid var(--sbay-border);
	}

	#sbay-portal .sbay-composer-bar__tools .sbay-icon-button {
		flex: 1;
		height: 48px;
		border-radius: var(--sbay-radius-small);
	}

	#sbay-portal .sbay-icon-button__label {
		display: inline;
	}

	#sbay-portal .sbay-modal.is-fullscreen-phone {
		padding: 0;
		overflow: hidden;
	}

	#sbay-portal .sbay-modal.is-fullscreen-phone .sbay-modal__dialog,
	#sbay-portal .sbay-modal.is-fullscreen-phone .sbay-modal__dialog.is-wide {
		max-width: none;
		height: 100vh;
		height: 100dvh;
		max-height: none;
		border-radius: 0;
		box-shadow: none;
	}

	#sbay-portal .sbay-modal.is-fullscreen-phone .sbay-modal__header {
		min-height: 56px;
		padding: env(safe-area-inset-top) 8px 0 16px;
	}

	#sbay-portal .sbay-modal--composer .sbay-modal__body {
		padding: 12px 16px;
	}

	#sbay-portal .sbay-app .sbay-composer-form .sbay-textarea.sbay-textarea--post {
		min-height: 120px;
		font-size: 16px;
	}

	#sbay-portal .sbay-modal--composer .sbay-modal__footer {
		padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
	}

	#sbay-portal .sbay-modal--composer .sbay-modal__footer .sbay-button {
		min-height: 48px;
	}

	#sbay-portal .sbay-modal--composer .sbay-modal__cancel {
		display: none;
	}

	#sbay-portal .sbay-space-picker {
		flex: 1 1 100%;
	}

	#sbay-portal .sbay-modal--composer .sbay-modal__post {
		flex: 1;
	}

	#sbay-portal .sbay-composer__tools-label {
		display: none;
	}

	#sbay-portal .sbay-composer__tools {
		justify-content: space-around;
	}

	#sbay-portal .sbay-composer__tools .sbay-icon-button {
		width: 48px;
		height: 48px;
	}

	#sbay-portal .sbay-composer-form .sbay-select {
		min-height: 44px;
		font-size: 16px;
	}

	#sbay-portal .sbay-composer-form .sbay-composer__thumb {
		width: calc((100% - 16px) / 3);
		height: auto;
		aspect-ratio: 1;
	}

	#sbay-portal .sbay-composer-form .sbay-composer__thumb img {
		position: absolute;
		inset: 0;
	}
}

/* Touch screens: chips and small buttons get a finger-sized target. */
@media (pointer: coarse) {
	#sbay-portal .sbay-chip {
		min-height: 36px;
	}

	#sbay-portal .sbay-app .sbay-space-info__close {
		width: 36px;
		height: 36px;
	}

	#sbay-portal .sbay-link-button {
		min-height: 32px;
		padding-inline: 4px;
	}
}

#sbay-portal .sbay-member-list__role {
	padding: 1px 8px;
	border: 1px solid var(--sbay-border);
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.5;
}

#sbay-portal .sbay-member-list__role + .sbay-link-button {
	margin-inline-start: auto;
}

#sbay-portal .sbay-member-list__item .sbay-link-button + .sbay-link-button {
	margin-inline-start: 0;
}
