/**
 * BuddyNext Pro — shared suite "Portfolio" profile panel.
 *
 * One tab, many integration sections. BuddyNext design tokens only; relies on
 * the shared .bn-card / .bn-link primitives. Responsive to 390px.
 */

.bn-suite-portfolio {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.bn-suite-panel {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	padding: 1.1rem;
}

.bn-suite-panel__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.bn-suite-panel__title {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	margin: 0;
	font-size: var(--bn-text-lg);
	font-weight: var(--bn-fw-semibold);
	color: var(--bn-ink);
}

.bn-suite-panel__title svg {
	width: 1.1rem;
	height: 1.1rem;
	color: var(--bn-ink-3);
}

/* Count chip — matches BN's .bn-tab__count pill. */
.bn-suite-panel__count {
	font-size: var(--bn-text-2xs);
	font-weight: var(--bn-fw-medium);
	color: var(--bn-ink-3);
	background: var(--bn-sunken);
	padding: 1px 6px;
	border-radius: var(--bn-r-full);
}

.bn-suite-panel__actions {
	display: inline-flex;
	align-items: center;
	gap: 0.9rem;
	flex-wrap: wrap;
}

.bn-suite-panel__cta {
	font-size: var(--bn-text-sm);
	white-space: nowrap;
}

.bn-suite-panel__manage {
	font-size: var(--bn-text-sm);
	font-weight: var(--bn-fw-semibold);
	white-space: nowrap;
}

.bn-suite-panel__items {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}

.bn-suite-panel__item {
	margin: 0;
	padding: 0;
}

/* Whole-row link reads as a card; hover lifts a subtle surface. */
.bn-suite-panel__item-link {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	padding: 0.55rem 0.6rem;
	margin: 0 -0.6rem;
	border-radius: var(--bn-r-md);
	color: inherit;
	text-decoration: none;
	transition: background-color 0.15s ease;
}

a.bn-suite-panel__item-link:hover,
a.bn-suite-panel__item-link:focus-visible {
	background: var(--bn-bg-hover);
	outline: 2px solid transparent;
	outline-offset: 2px;
}

.bn-suite-panel__item-link.is-static {
	cursor: default;
}

/* Thumbnail or icon tile — fixed square keeps rows aligned. */
.bn-suite-panel__thumb {
	flex: 0 0 auto;
	width: 48px;
	height: 48px;
	border-radius: var(--bn-r-md);
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--bn-bg-subtle);
}

.bn-suite-panel__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* A company logo is shown whole: a wide logo cropped to a square loses its name.
   Photos and course covers keep the cover crop above. */
.bn-suite-panel__thumb img.bn-suite-panel__logo {
	object-fit: contain;
	padding: var(--bn-s1);
	background: var(--bn-surface);
	box-sizing: border-box;
}

/* Monogram fallback — a solid tone tile with initials, mirroring BN's avatar
   language. Deterministic tone per row (seeded from company/title) so rows read
   distinct instead of repeating the section icon. */
.bn-suite-panel__thumb.is-mono {
	color: #fff;
	font-weight: var(--bn-fw-semibold);
	font-size: var(--bn-text-sm);
	letter-spacing: 0.02em;
	background: oklch(58% var(--bn-chroma) 240);
}

.bn-suite-panel__thumb.is-mono[data-tone="1"] { background: oklch(58% var(--bn-chroma) 240); }
.bn-suite-panel__thumb.is-mono[data-tone="2"] { background: oklch(58% var(--bn-chroma) 155); }
.bn-suite-panel__thumb.is-mono[data-tone="3"] { background: oklch(58% var(--bn-chroma) 290); }
.bn-suite-panel__thumb.is-mono[data-tone="4"] { background: oklch(60% var(--bn-chroma) 60); }
.bn-suite-panel__thumb.is-mono[data-tone="5"] { background: oklch(60% var(--bn-chroma) 350); }
.bn-suite-panel__thumb.is-mono[data-tone="6"] { background: oklch(58% var(--bn-chroma) 195); }
.bn-suite-panel__thumb.is-mono[data-tone="7"] { background: oklch(56% var(--bn-chroma) 270); }
.bn-suite-panel__thumb.is-mono[data-tone="8"] { background: oklch(58% var(--bn-chroma) 25); }

.bn-suite-panel__item-body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
}

/* Title row: the title takes the room and truncates; an optional highlight
   (e.g. a salary range) holds the end of the line as a compact emphasis. */
.bn-suite-panel__item-line {
	display: flex;
	align-items: baseline;
	gap: 0.6rem;
	min-width: 0;
}

.bn-suite-panel__item-title {
	color: var(--bn-ink);
	font-weight: var(--bn-fw-medium);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.bn-suite-panel__item-line .bn-suite-panel__item-title {
	flex: 1 1 auto;
	min-width: 0;
}

.bn-suite-panel__item-highlight {
	flex: 0 0 auto;
	margin-inline-start: auto;
	display: inline-flex;
	align-items: center;
	gap: 0.2rem;
	font-size: var(--bn-text-sm);
	font-weight: var(--bn-fw-semibold);
	color: var(--bn-ink);
	white-space: nowrap;
}

.bn-suite-panel__item-highlight svg {
	width: 0.9em;
	height: 0.9em;
	flex: 0 0 auto;
}

.bn-suite-panel__item-link:hover .bn-suite-panel__item-title,
.bn-suite-panel__item-link:focus-visible .bn-suite-panel__item-title {
	color: var(--bn-accent-text, var(--bn-accent));
}

.bn-suite-panel__item-meta {
	font-size: var(--bn-text-sm);
	color: var(--bn-ink-3);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Each fact is an indivisible unit; the spaced middot between facts is the only
   place the line may break (so a fact never splits mid-word, and on mobile the
   row wraps cleanly between facts). */
.bn-suite-panel__fact {
	white-space: nowrap;
}

.bn-suite-panel__fact-sep {
	color: var(--bn-ink-4);
}

.bn-suite-panel__item-go {
	flex: 0 0 auto;
	display: inline-flex;
	color: var(--bn-ink-4);
	transition: transform 0.15s ease, color 0.15s ease;
}

.bn-suite-panel__item-go svg {
	width: 1rem;
	height: 1rem;
}

.bn-suite-panel__item-link:hover .bn-suite-panel__item-go {
	transform: translateX(2px);
	color: var(--bn-accent-text, var(--bn-accent));
}

/* Grouped view (e.g. jobs by company): one bordered section per group with a
   logo, name, total and a "View all" link, then its rows. The rest of the
   groups sit in a native <details>; its summary is the "Show N more" control. */
.bn-suite-groups {
	display: flex;
	flex-direction: column;
	gap: var(--bn-s4);
}

.bn-suite-groups__extra {
	display: flex;
	flex-direction: column;
	gap: var(--bn-s4);
	margin-block-start: var(--bn-s4);
}

.bn-suite-groups__empty {
	margin: 0;
	color: var(--bn-ink-3);
	font-size: var(--bn-text-sm);
}

.bn-suite-group {
	border: 1px solid var(--bn-line);
	border-radius: var(--bn-r-lg);
	overflow: hidden;
}

.bn-suite-group__head {
	display: flex;
	align-items: center;
	gap: var(--bn-s3);
	padding: var(--bn-s3) var(--bn-s4);
	border-block-end: 1px solid var(--bn-line);
	background: var(--bn-sunken);
}

.bn-suite-group .bn-suite-group__logo {
	width: 40px;
	height: 40px;
}

.bn-suite-group__id {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.bn-suite-group__name {
	margin: 0;
	font-size: var(--bn-text-base);
	font-weight: var(--bn-fw-bold);
	color: var(--bn-ink);
	overflow-wrap: anywhere;
}

.bn-suite-group__summary {
	font-size: var(--bn-text-sm);
	color: var(--bn-ink-3);
}

.bn-suite-group__all {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding-inline: var(--bn-s2);
	font-size: var(--bn-text-sm);
	font-weight: var(--bn-fw-semibold);
	white-space: nowrap;
}

.bn-suite-group__items {
	list-style: none;
	margin: 0;
	padding: 0;
}

.bn-suite-group__item + .bn-suite-group__item {
	border-block-start: 1px solid var(--bn-line);
}

/* The whole row is the job link: at least 44px tall. */
.bn-suite-group__job {
	display: flex;
	align-items: center;
	gap: var(--bn-s3);
	min-height: 44px;
	padding: var(--bn-s3) var(--bn-s4);
	color: inherit;
	text-decoration: none;
	transition: background-color 0.15s ease;
}

a.bn-suite-group__job:hover,
a.bn-suite-group__job:focus-visible {
	background: var(--bn-bg-hover);
}

a.bn-suite-group__job:focus-visible {
	outline: 2px solid transparent;
	box-shadow: inset 0 0 0 2px var(--bn-focus);
}

.bn-suite-group__job-body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
}

.bn-suite-group__job-title {
	color: var(--bn-ink);
	font-weight: var(--bn-fw-semibold);
	overflow-wrap: anywhere;
}

a.bn-suite-group__job:hover .bn-suite-group__job-title,
a.bn-suite-group__job:focus-visible .bn-suite-group__job-title {
	color: var(--bn-accent-text, var(--bn-accent));
}

.bn-suite-group__job-meta {
	font-size: var(--bn-text-sm);
	color: var(--bn-ink-3);
}

.bn-suite-group__badge {
	flex: 0 0 auto;
	font-size: var(--bn-text-xs);
	font-weight: var(--bn-fw-medium);
	color: var(--bn-accent-text, var(--bn-accent));
	background: var(--bn-accent-50);
	padding: 2px var(--bn-s2);
	border-radius: var(--bn-r-full);
	white-space: nowrap;
}

/* Desktop and phone wording of the same text; only one is ever displayed. */
.bn-suite-group__narrow {
	display: none;
}

.bn-suite-groups__toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: var(--bn-s2) var(--bn-s3);
	border: 1px dashed var(--bn-line-strong);
	border-radius: var(--bn-r-md);
	color: var(--bn-accent-text, var(--bn-accent));
	font-size: var(--bn-text-sm);
	font-weight: var(--bn-fw-semibold);
	cursor: pointer;
	list-style: none;
}

.bn-suite-groups__toggle::-webkit-details-marker {
	display: none;
}

.bn-suite-groups__toggle:hover {
	background: var(--bn-bg-hover);
}

.bn-suite-groups__toggle:focus-visible {
	outline: 2px solid transparent;
	box-shadow: var(--bn-ring);
}

.bn-suite-groups__toggle-less,
.bn-suite-groups__more[open] .bn-suite-groups__toggle-more {
	display: none;
}

.bn-suite-groups__more[open] .bn-suite-groups__toggle-less {
	display: inline;
}

@media (max-width: 640px) {
	.bn-suite-panel__head {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.4rem;
	}

	.bn-suite-panel__thumb {
		width: 44px;
		height: 44px;
	}

	/* Mobile: horizontal room is scarce but vertical room is cheap, so let the
	   facts wrap to show every signal instead of truncating to one line. Each
	   fact stays intact (nowrap above); only the row between facts breaks. */
	.bn-suite-panel__item-meta {
		white-space: normal;
		overflow: visible;
		text-overflow: clip;
	}

	/* Phones are too narrow to share the title row with the salary without
	   crushing the title, so stack the salary on its own line beneath it - the
	   title gets the full width and the salary still reads prominently. */
	.bn-suite-panel__item-line {
		flex-direction: column;
		align-items: stretch;
		gap: 0.1rem;
	}

	.bn-suite-panel__item-highlight {
		margin-inline-start: 0;
	}

	/* Phone: shorter link text and meta ("2 days ago"), no type pill. */
	.bn-suite-group__wide,
	.bn-suite-group__badge {
		display: none;
	}

	.bn-suite-group__narrow {
		display: inline;
	}

	.bn-suite-group__job-meta.bn-suite-group__narrow {
		display: block;
	}

	.bn-suite-group__head {
		padding-inline: var(--bn-s3);
	}

	.bn-suite-group__job {
		padding-inline: var(--bn-s3);
	}
}
