.fs-invoice-portal,
.fs-leaderboard,
.fs-rate-estimates {
	border: 1px solid #dcdcde;
	padding: 1rem;
	background: #fff;
	border-radius: 8px;
	/* Query container: lets child rules below respond to the width of the
	   page/column this block is placed in, not just the browser viewport —
	   important since many page templates embed this block in a narrow
	   content column even on a wide desktop screen. */
	container-type: inline-size;
	container-name: fs-widget;
}

.fs-rate-estimates {
	margin: 1.5rem 0;
	padding: 1.5rem;
}

.fs-invoice-portal {
	--fs-accent: var(--wp--preset--color--primary, #1d4e89);
	--fs-accent-contrast: var(--wp--preset--color--base, #ffffff);
	--fs-accent-soft: var(--wp--preset--color--secondary, #f0f6fc);
	--fs-accent-border: var(--wp--preset--color--secondary, #c5d9ed);
}

/* ---- Leaderboard ---- */
.fs-leaderboard {
	padding: 1.25rem 1.25rem 0.5rem;
}

.fs-leaderboard__title {
	margin: 0 0 1rem;
	font-size: 1.1rem;
	font-weight: 700;
	color: #1d2327;
	text-align: center;
	letter-spacing: 0.01em;
}

.fs-leaderboard__empty {
	text-align: center;
	color: #50575e;
	font-style: italic;
	padding: 1rem 0;
}

.fs-leaderboard__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.fs-lb-item {
	display: grid;
	grid-template-columns: 2.2rem 1fr auto auto;
	align-items: center;
	gap: 0.5rem;
	padding: 0.65rem 0.75rem;
	border-radius: 6px;
	margin-bottom: 0.4rem;
	background: #f6f7f7;
	border: 1px solid #e0e0e0;
	transition: background 0.15s;
}

.fs-lb-item--rank-1 { background: linear-gradient(90deg,#fffbeb,#fef3c7); border-color: #f59e0b; }
.fs-lb-item--rank-2 { background: linear-gradient(90deg,#f9fafb,#e5e7eb); border-color: #9ca3af; }
.fs-lb-item--rank-3 { background: linear-gradient(90deg,#fff7ed,#fed7aa); border-color: #fb923c; }

.fs-lb-item__medal {
	text-align: center;
	font-size: 1.5rem;
	line-height: 1;
}

.fs-lb-item__rank-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.8rem;
	height: 1.8rem;
	border-radius: 50%;
	background: #c3c4c7;
	color: #1d2327;
	font-size: 0.75rem;
	font-weight: 700;
}

.fs-lb-item__name {
	font-weight: 600;
	color: #1d2327;
	truncate: ellipsis;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.fs-lb-item__meta {
	font-size: 0.78rem;
	color: #50575e;
	white-space: nowrap;
}

.fs-lb-item__amount {
	font-weight: 700;
	color: #1a7f37;
	font-size: 1rem;
	white-space: nowrap;
}

.fs-invoice-form {
	display: grid;
	gap: 0.8rem;
	margin-bottom: 1rem;
	padding: 1rem;
	border: 1px solid #e3e5e8;
	border-radius: 8px;
	background: linear-gradient(180deg, #ffffff, #f9fafc);
	box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.fs-form-row--identity {
	display: grid;
	grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.2fr);
	gap: 0.75rem;
	align-items: start;
}
}

.fs-invoice-form label:not(.fs-comp-pill) {
	display: grid;
	gap: 0.25rem;
	font-weight: 600;
}

.fs-invoice-form input,
.fs-invoice-form textarea {
	width: 100%;
	padding: 0.5rem;
	border: 1px solid #8c8f94;
	border-radius: 4px;
	background: #fff;
	transition: border-color 0.12s, box-shadow 0.12s;
}

.fs-invoice-form input:focus,
.fs-invoice-form textarea:focus {
	border-color: var(--fs-accent);
	box-shadow: 0 0 0 2px rgba(29, 78, 137, 0.12);
	outline: none;
}

.fs-invoice-form button {
	justify-self: start;
	padding: 0.6rem 1rem;
	border: 0;
	border-radius: 4px;
	background: var(--fs-accent);
	color: var(--fs-accent-contrast);
}

.fs-invoice-form [data-fs-submit-btn] {
	margin-top: 0.3rem;
}

.fs-invoice-dashboard ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.fs-student-summary {
	margin: 0 0 0.85rem;
	padding: 0.75rem 0.85rem;
	border: 1px solid #dcdcde;
	border-radius: 8px;
	background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.fs-student-summary__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.6rem;
	margin-bottom: 0.55rem;
	flex-wrap: wrap;
}

.fs-student-summary__title {
	margin: 0;
	font-size: 0.98rem;
	font-weight: 700;
	color: #1d2327;
}

.fs-student-summary__hint {
	margin: 0;
	font-size: 0.78rem;
	color: #50575e;
}

.fs-student-summary__empty {
	margin: 0;
	font-size: 0.84rem;
	color: #50575e;
	font-style: italic;
}

.fs-student-summary__empty[hidden] {
	display: none;
}

.fs-student-summary__body {
	display: grid;
	grid-template-columns: minmax(240px, 280px) 1fr;
	gap: 1rem;
	align-items: start;
}

.fs-student-summary__body[hidden] {
	display: none;
}

.fs-student-summary__radar {
	justify-self: center;
	width: 100%;
	max-width: 280px;
}

.fs-summary-radar-svg {
	display: block;
	width: 100%;
	height: auto;
}

.fs-student-summary__bars {
	display: grid;
	gap: 0.55rem;
}

.fs-summary-bar-row {
	display: grid;
	gap: 0.25rem;
}

.fs-summary-bar-row__top {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.fs-summary-bar-row__label {
	font-size: 0.83rem;
	font-weight: 700;
	color: #1d2327;
}

.fs-summary-bar-row__concepts {
	font-size: 0.75rem;
	color: #50575e;
}

.fs-summary-bar-row__track {
	height: 0.56rem;
	border-radius: 999px;
	background: #e5e7eb;
	overflow: hidden;
}

.fs-summary-bar-row__fill {
	display: block;
	height: 100%;
	border-radius: 999px;
	transition: width 180ms ease;
}

.fs-summary-bar-row__meta {
	font-size: 0.75rem;
	color: #3c434a;
}

.fs-invoice-row {
	border: 1px solid #dcdcde;
	border-radius: 6px;
	padding: 0.75rem 0.9rem;
	margin-bottom: 0.6rem;
	background: #fff;
}

.fs-invoice-row__main {
	display: flex;
	align-items: center;
	gap: 0.6rem;
}

.fs-invoice-row__title {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.fs-invoice-row__amount {
	flex: 0 0 auto;
	min-width: 5.5rem;
	text-align: right;
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	color: #1d2327;
}

.fs-invoice-row__actions {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 0.4rem;
}

.fs-invoice-row__details {
	margin-top: 0.65rem;
	padding-top: 0.65rem;
	border-top: 1px solid #f0f0f1;
	display: grid;
	gap: 0.4rem;
}

.fs-invoice-row__details[hidden] {
	display: none;
}

.fs-invoice-row__detail-line {
	margin: 0;
	font-size: 0.85rem;
	color: #3c434a;
}

.fs-invoice-row__detail-line--note {
	padding: 0.25rem 0.45rem;
	background: #eef2ff;
	border: 1px solid #c7d2fe;
	border-radius: 4px;
	color: #3730a3;
	font-size: 0.8rem;
}

.fs-details-btn {
	padding: 0.3rem 0.65rem;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	background: #fff;
	color: #3c434a;
	font-size: 0.78rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.12s;
}

.fs-details-btn:hover {
	background: #f0f0f0;
}

/* Period filter bar */
.fs-period-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	flex-wrap: wrap;
	margin-bottom: 0.65rem;
}

.fs-period-bar__title {
	margin: 0;
}

.fs-period-toggle {
	display: flex;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	overflow: hidden;
}

.fs-period-btn {
	padding: 0.25rem 0.75rem;
	background: #fff;
	border: none;
	font-size: 0.78rem;
	font-weight: 600;
	color: #50575e;
	cursor: pointer;
	transition: background 0.1s, color 0.1s;
}

.fs-period-btn + .fs-period-btn {
	border-left: 1px solid #c3c4c7;
}

.fs-period-btn--active {
	background: var(--fs-accent);
	color: var(--fs-accent-contrast);
}

.fs-period-btn:not(.fs-period-btn--active):hover {
	background: #f0f0f0;
	color: #1d2327;
}

.fs-status-icon {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.6rem;
	height: 1.6rem;
	border-radius: 50%;
	font-size: 0.85rem;
	font-weight: 700;
	line-height: 1;
	cursor: help;
}

.fs-status-icon--pending {
	background: #fff3cd;
	color: #664d03;
	font-size: 0.9rem;
}

.fs-status-icon--approved {
	background: #d1e7dd;
	color: #0f5132;
}

.fs-status-icon--revision_requested {
	background: #fee2e2;
	color: #dc2626;
}

.fs-status-icon--rejected {
	background: #f8d7da;
	color: #842029;
}

.fs-editor-placeholder {
	border: 1px dashed #8c8f94;
	padding: 1rem;
}

/* Tab navigation */
.fs-dashboard-topbar {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.9rem;
	flex-wrap: wrap;
	margin-bottom: 0.65rem;
}

.fs-tab-nav {
	display: flex;
	gap: 0.35rem;
	padding: 0.5rem 0.5rem 0;
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	border-bottom: none;
	border-radius: 6px 6px 0 0;
	margin-bottom: 0;
	flex: 1 1 520px;
}

.fs-tab-btn {
	padding: 0.5rem 1.1rem;
	background: #e8eaed;
	border: 1px solid #c3c4c7;
	border-bottom: none;
	border-radius: 5px 5px 0 0;
	margin-bottom: -1px;
	font-size: 0.875rem;
	font-weight: 600;
	color: #50575e;
	cursor: pointer;
	transition: background 0.12s, color 0.12s;
}

.fs-tab-btn:hover { background: #d9dbde; color: #1d2327; }

.fs-tab-btn--active {
	background: #fff;
	border-color: #dcdcde;
	color: var(--fs-accent);
	z-index: 1;
}

.fs-tab-panels {
	border: 1px solid #dcdcde;
	border-radius: 0 0 6px 6px;
	padding: 1rem;
	background: #fff;
}

.fs-tab-panel[hidden] { display: none !important; }

/* Basecamp URL field and help tooltip */
.fs-field-group {
	display: grid;
	gap: 0.35rem;
	margin-bottom: 0.45rem;
}

.fs-field-group label {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	font-weight: 600;
}

.fs-field-note {
	margin: 0;
	font-size: 0.8rem;
	color: #50575e;
}

.fs-help-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	border: 1px solid var(--fs-accent);
	background: var(--fs-accent-soft);
	color: var(--fs-accent);
	font-size: 0.75rem;
	font-weight: 600;
	cursor: pointer;
	line-height: 1;
	padding: 0.3rem 0.65rem;
}

.fs-help-tooltip {
	background: var(--fs-accent-soft);
	border: 1px solid var(--fs-accent-border);
	border-radius: 4px;
	padding: 0.6rem 0.75rem;
	font-size: 0.82rem;
	color: #1e1e1e;
	margin-bottom: 0.55rem;
}

.fs-cd-feedback {
	font-style: italic;
	color: #50575e;
	font-size: 0.875rem;
	margin-top: 0.25rem;
}

.fs-invoice-edit-btn {
	display: inline-block;
	margin-top: 0.4rem;
	padding: 0.3rem 0.75rem;
	border: 1px solid var(--fs-accent);
	border-radius: 4px;
	background: #fff;
	color: var(--fs-accent);
	font-size: 0.8rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.12s, color 0.12s;
}

.fs-invoice-edit-btn:hover {
	background: var(--fs-accent);
	color: var(--fs-accent-contrast);
}

.fs-cancel-edit-btn {
	margin-left: 0.5rem;
	padding: 0.6rem 1rem;
	border: 1px solid #8c8f94;
	border-radius: 4px;
	background: #fff;
	color: #50575e;
	cursor: pointer;
}

.fs-cancel-edit-btn[hidden] { display: none !important; }

/* Success card — full-block replacement after submit */
.fs-success-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 2.5rem 1.5rem;
	gap: 0.75rem;
	background: #f0fdf4;
	border: 2px solid #86efac;
	border-radius: 8px;
	margin-bottom: 1rem;
}

.fs-success-card__close {
	position: absolute;
	top: 0.35rem;
	right: 0.45rem;
	border: none;
	background: transparent;
	font-size: 1.25rem;
	line-height: 1;
	color: #166534;
	cursor: pointer;
	padding: 0.1rem 0.2rem;
}

.fs-success-card[hidden] { display: none !important; }

[data-fs-form-wrap][hidden] { display: none !important; }

.fs-success-card__icon {
	font-size: 3rem;
	line-height: 1;
	color: #16a34a;
	font-weight: 700;
}

.fs-success-card__heading {
	margin: 0;
	font-size: 1.4rem;
	color: #14532d;
}

.fs-success-card__body {
	color: #166534;
	font-size: 0.95rem;
	line-height: 1.5;
}

.fs-success-card__body p { margin: 0.2rem 0; }

.fs-success-card__dismiss {
	margin-top: 0.5rem;
	padding: 0.6rem 1.5rem;
	background: #16a34a;
	color: #fff;
	border: 0;
	border-radius: 4px;
	cursor: pointer;
	font-size: 0.95rem;
	font-weight: 600;
	transition: background 0.15s;
}

.fs-success-card__dismiss:hover { background: #15803d; }

/* Remove old banner — keep rule just in case any stale HTML references it */
.fs-success-banner[hidden] { display: none !important; }

/* Competency pills — clickable tag grid */
.fs-competencies {
	margin: 0.5rem 0;
}

.fs-competencies__legend {
	font-weight: 600;
	font-size: 0.875rem;
	margin: 0 0 0.65rem;
	color: #1d2327;
}

.fs-competencies__subheading {
	margin: 0 0 0.4rem;
	font-size: 0.78rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #50575e;
}

.fs-competencies__selected-wrap {
	padding: 0.5rem;
	border: 1px dashed #c3c4c7;
	border-radius: 6px;
	background: #fcfcfd;
	margin-bottom: 0.45rem;
}

.fs-competencies__selected-wrap.is-empty {
	padding-bottom: 0.35rem;
}

.fs-competencies__pool-wrap {
	padding: 0.5rem;
	border: 1px solid #e4e4e7;
	border-radius: 6px;
	background: #f9fafb;
}

.fs-competencies__empty {
	margin: 0 0 0.3rem;
	font-size: 0.8rem;
	color: #6b7280;
}

.fs-competencies__empty[hidden] {
	display: none;
}

.fs-competencies__grid {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.fs-competencies__grid--selected {
	min-height: 0.85rem;
}

.fs-comp-pill {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.12rem 0.35rem 0.12rem 0.18rem;
	border-radius: 3px;
	border: 1px solid transparent;
	cursor: pointer;
	user-select: none;
	font-size: 0.75rem;
	white-space: nowrap;
	transition: filter 0.12s, border-color 0.12s, transform 0.12s;
	filter: grayscale(0.3) opacity(0.7);
}

.fs-comp-pill input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	margin: 0;
	pointer-events: none;
}

.fs-comp-pill:hover {
	filter: grayscale(0.05) opacity(0.9);
	transform: translateY(-1px);
}

.fs-comp-pill.is-selected {
	filter: none;
}

.fs-comp-pill__action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1rem;
	height: 1rem;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.15);
	color: #fff;
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1;
	flex-shrink: 0;
}

.fs-comp-pill.is-selected .fs-comp-pill__action {
	background: rgba(0, 0, 0, 0.3);
}

.fs-comp-pill__num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.1rem;
	height: 1.1rem;
	border-radius: 50%;
	font-size: 0.7rem;
	font-weight: 700;
	color: #fff;
	flex-shrink: 0;
}

.fs-comp-pill__text {
	line-height: 1.3;
	white-space: nowrap;
}

/* Pill colors — always show the tag color, dimmed when unselected */
.fs-comp-pill--1 .fs-comp-pill__num, .fs-comp-pill--3 .fs-comp-pill__num { background: #1d4e89; }
.fs-comp-pill--1, .fs-comp-pill--3 { background: #dbeafe; border-color: #93c5fd; color: #1e3a5f; }

.fs-comp-pill--2 .fs-comp-pill__num, .fs-comp-pill--5 .fs-comp-pill__num { background: #c2610a; }
.fs-comp-pill--2, .fs-comp-pill--5 { background: #fff3e0; border-color: #ffb74d; color: #7c3d00; }

.fs-comp-pill--4 .fs-comp-pill__num { background: #2e7d32; }
.fs-comp-pill--4 { background: #e8f5e9; border-color: #81c784; color: #1b5e20; }

.fs-comp-pill--6 .fs-comp-pill__num { background: #6a1b9a; }
.fs-comp-pill--6 { background: #f3e5f5; border-color: #ce93d8; color: #4a148c; }

.fs-comp-pill--7 .fs-comp-pill__num, .fs-comp-pill--8 .fs-comp-pill__num, .fs-comp-pill--9 .fs-comp-pill__num { background: #c62828; }
.fs-comp-pill--7, .fs-comp-pill--8, .fs-comp-pill--9 { background: #ffebee; border-color: #ef9a9a; color: #7f0000; }

/* Competency tags on submitted invoice list */
.fs-competency-tags {
	list-style: none;
	margin: 0.3rem 0 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem;
}

.fs-comp-tag {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	border-radius: 3px;
	padding: 0.1rem 0.45rem 0.1rem 0.2rem;
	font-size: 0.75rem;
	border: 1px solid transparent;
}

.fs-comp-tag__num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.1rem;
	height: 1.1rem;
	border-radius: 50%;
	font-weight: 700;
	font-size: 0.7rem;
	color: #fff;
	flex-shrink: 0;
}

/* Color map: 1,3 = blue | 2,5 = orange | 4 = green | 6 = purple | 7,8,9 = red */
.fs-comp-num--1, .fs-comp-num--3,
.fs-comp-tag--1 .fs-comp-tag__num, .fs-comp-tag--3 .fs-comp-tag__num { background: #1d4e89; }
.fs-comp-tag--1, .fs-comp-tag--3 { background: #dbeafe; border-color: #93c5fd; color: #1e3a5f; }

.fs-comp-num--2, .fs-comp-num--5,
.fs-comp-tag--2 .fs-comp-tag__num, .fs-comp-tag--5 .fs-comp-tag__num { background: #c2610a; }
.fs-comp-tag--2, .fs-comp-tag--5 { background: #fff3e0; border-color: #ffb74d; color: #7c3d00; }

.fs-comp-num--4,
.fs-comp-tag--4 .fs-comp-tag__num { background: #2e7d32; }
.fs-comp-tag--4 { background: #e8f5e9; border-color: #81c784; color: #1b5e20; }

.fs-comp-num--6,
.fs-comp-tag--6 .fs-comp-tag__num { background: #6a1b9a; }
.fs-comp-tag--6 { background: #f3e5f5; border-color: #ce93d8; color: #4a148c; }

.fs-comp-num--7, .fs-comp-num--8, .fs-comp-num--9,
.fs-comp-tag--7 .fs-comp-tag__num, .fs-comp-tag--8 .fs-comp-tag__num, .fs-comp-tag--9 .fs-comp-tag__num { background: #c62828; }
.fs-comp-tag--7, .fs-comp-tag--8, .fs-comp-tag--9 { background: #ffebee; border-color: #ef9a9a; color: #7f0000; }

/* ---- Student stats bar ---- */
.fs-student-stats {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	margin-bottom: 0;
	justify-content: flex-end;
	flex: 0 1 500px;
}

	.fs-form-row--identity {
		grid-template-columns: 1fr;
	}

.fs-student-stat {
	flex: 0 1 114px;
	min-width: 96px;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 0.45rem 0.55rem;
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	text-align: center;
}

.fs-student-stat__value {
	font-size: 1.2rem;
	font-weight: 700;
	line-height: 1;
	color: #1d2327;
}

.fs-student-stat__label {
	font-size: 0.63rem;
	color: #50575e;
	margin-top: 0.18rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.fs-student-stat--approved .fs-student-stat__value { color: #1a7f37; }
.fs-student-stat--earnings .fs-student-stat__value { color: #0073aa; }
.fs-student-stat--revision .fs-student-stat__value { color: #d63638; }

/* ---- Client field ---- */
.fs-client-field {
	display: grid;
	gap: 0.35rem;
}

.fs-client-field label {
	font-weight: 600;
}

.fs-client-combobox {
	position: relative;
}

.fs-client-combobox input[data-fs-client-input] {
	width: 100%;
	padding: 0.5rem;
	border: 1px solid #8c8f94;
	border-radius: 4px;
	box-sizing: border-box;
}

.fs-client-combobox input[data-fs-client-input]:focus {
	outline: 2px solid #0073aa;
	outline-offset: 0;
	border-color: #0073aa;
}

.fs-client-suggestions {
	position: absolute;
	top: calc(100% + 2px);
	left: 0;
	right: 0;
	z-index: 100;
	list-style: none;
	margin: 0;
	padding: 0;
	background: #fff;
	border: 1px solid #8c8f94;
	border-radius: 4px;
	box-shadow: 0 4px 12px rgba(0,0,0,.12);
	max-height: 200px;
	overflow-y: auto;
}

.fs-client-suggestions[hidden] { display: none !important; }

.fs-client-suggestions li {
	padding: 0.45rem 0.75rem;
	cursor: pointer;
	font-size: 0.9rem;
	border-bottom: 1px solid #f0f0f0;
}

.fs-client-suggestions li:last-child { border-bottom: none; }

.fs-client-suggestions li:hover,
.fs-client-suggestions li.is-active {
	background: #f0f6fb;
	outline: none;
}

.fs-client-suggestions li mark {
	background: transparent;
	font-weight: 700;
	color: inherit;
}

.fs-client-suggestion--new {
	color: #0073aa;
	border-top: 1px solid #e0e0e0 !important;
	font-style: italic;
}

.fs-client-suggestion--new strong { font-style: normal; }

.fs-client-suggest-note {
	font-size: 0.8rem;
	color: #8a6500;
	background: #fffbf0;
	border: 1px solid #f0c040;
	border-radius: 4px;
	padding: 0.35rem 0.6rem;
	margin: 0;
}

.fs-client-suggest-note[hidden] { display: none !important; }

/* ---- Frontend login notices ---- */
.fs-login-notices {
	position: fixed;
	bottom: 1.5rem;
	right: 1.5rem;
	z-index: 9999;
	min-width: 280px;
	max-width: 420px;
	background: #fff;
	border: 1px solid #dcdcde;
	border-left: 4px solid #0073aa;
	border-radius: 4px;
	box-shadow: 0 4px 16px rgba(0,0,0,.15);
	font-size: 0.9rem;
}

.fs-login-notices__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.6rem 0.75rem;
	background: #f6f7f7;
	border-bottom: 1px solid #dcdcde;
}

.fs-login-notices__dismiss {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 1.25rem;
	line-height: 1;
	color: #50575e;
	padding: 0 0.25rem;
}

.fs-login-notices__list {
	list-style: none;
	margin: 0;
	padding: 0.5rem 0.75rem;
}

.fs-login-notices__item {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	padding: 0.4rem 0;
	border-bottom: 1px solid #f0f0f0;
}

.fs-login-notices__item:last-child { border-bottom: none; }

.fs-ln__icon {
	font-weight: 700;
	min-width: 1rem;
	text-align: center;
}

.fs-ln--approved .fs-ln__icon    { color: #1a7f37; }
.fs-ln--revision_requested .fs-ln__icon { color: #d63638; }
.fs-ln--rejected .fs-ln__icon    { color: #a00; }

.fs-ln__feedback {
	display: block;
	font-size: 0.8rem;
	color: #50575e;
	margin-top: 0.15rem;
}

.fs-ln__project {
	display: block;
	font-size: 0.82rem;
	color: #3c434a;
	margin-top: 0.08rem;
}

.fs-ln__link {
	display: inline-block;
	margin-top: 0.2rem;
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--fs-accent);
	text-decoration: underline;
}

/* Keep the fixed-position notice from overflowing narrow phone viewports —
   this is viewport-relative (position: fixed), so a regular media query is
   used here instead of the container queries below. */
@media ( max-width: 480px ) {
	.fs-login-notices {
		left: 1rem;
		right: 1rem;
		bottom: 1rem;
		min-width: 0;
		max-width: none;
	}
}

/* =========================================================
   EXPENSE TRACKER
   ========================================================= */
.fs-section-heading {
	font-size: 1rem;
	font-weight: 700;
	margin: 0 0 0.75rem;
	color: #1d2327;
}

.fs-expense-tracker {
	margin-top: 0;
	padding-top: 0;
}

.fs-expense-form {
	margin-bottom: 1rem;
}

.fs-expense-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: flex-end;
}

.fs-expense-field {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	min-width: 100px;
}

.fs-expense-field label {
	font-size: 0.8rem;
	font-weight: 600;
	color: #50575e;
}

.fs-expense-field input,
.fs-expense-field select {
	border: 1px solid #8c8f94;
	border-radius: 4px;
	padding: 0.4rem 0.5rem;
	font-size: 0.9rem;
	line-height: 1.4;
	background: #fff;
}

.fs-expense-field select {
	appearance: none;
	padding-right: 2rem;
	background-image: linear-gradient(45deg, transparent 50%, #50575e 50%), linear-gradient(135deg, #50575e 50%, transparent 50%);
	background-position: calc(100% - 14px) calc(50% - 2px), calc(100% - 9px) calc(50% - 2px);
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
}

.fs-expense-field select:invalid {
	color: #757575;
}

.fs-expense-field--desc {
	flex: 1 1 180px;
}

.fs-expense-field--submit {
	min-width: auto;
}

.fs-expense-add-btn {
	background: #2271b1;
	color: #fff;
	border: none;
	border-radius: 4px;
	padding: 0.45rem 1rem;
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
}
.fs-expense-add-btn:hover  { background: #135e96; }
.fs-expense-add-btn:active { background: #0d4472; }
.fs-expense-add-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.fs-expense-gate-message {
	margin: 0 0 0.75rem;
	padding: 0.5rem 0.65rem;
	font-size: 0.82rem;
	color: #8a6500;
	background: #fff8e6;
	border: 1px solid #f0c040;
	border-radius: 4px;
}

.fs-expense-gate-message[hidden] {
	display: none;
}

.fs-expense-view-toggle {
	display: inline-flex;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	overflow: hidden;
	margin-bottom: 0.7rem;
}

.fs-expense-view-btn {
	padding: 0.3rem 0.75rem;
	background: #fff;
	border: none;
	font-size: 0.78rem;
	font-weight: 600;
	color: #50575e;
	cursor: pointer;
	transition: background 0.1s, color 0.1s;
}

.fs-expense-view-btn + .fs-expense-view-btn {
	border-left: 1px solid #c3c4c7;
}

.fs-expense-view-btn--active {
	background: var(--fs-accent);
	color: var(--fs-accent-contrast);
}

.fs-field-hint {
	font-weight: 400;
	color: #757575;
	font-size: 0.75rem;
}

/* Expense list */
.fs-expense-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.fs-expense-empty {
	color: #50575e;
	font-style: italic;
	font-size: 0.875rem;
	padding: 0.5rem 0;
}

.fs-expense-item {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.5rem 0;
	border-bottom: 1px solid #f0f0f0;
}
.fs-expense-item:last-child { border-bottom: none; }

.fs-expense-type {
	background: #e0f0ff;
	color: #135e96;
	border-radius: 3px;
	padding: 0.15rem 0.45rem;
	font-size: 0.75rem;
	font-weight: 700;
	white-space: nowrap;
	min-width: 64px;
	text-align: center;
}

.fs-expense-type--mileage { background: #d1fae5; color: #065f46; }
.fs-expense-type--supplies { background: #dbeafe; color: #1e3a8a; }
.fs-expense-type--equipment { background: #ede9fe; color: #5b21b6; }
.fs-expense-type--travel { background: #ffedd5; color: #9a3412; }
.fs-expense-type--software { background: #ffe4e6; color: #9f1239; }
.fs-expense-type--other { background: #e5e7eb; color: #1f2937; }

.fs-expense-desc {
	flex: 1;
	font-size: 0.875rem;
	color: #1d2327;
}

.fs-expense-amount {
	font-size: 0.875rem;
	font-weight: 700;
	color: #1d2327;
	white-space: nowrap;
}

.fs-expense-delete {
	background: none;
	border: 1px solid #d63638;
	color: #d63638;
	border-radius: 50%;
	width: 1.4rem;
	height: 1.4rem;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	cursor: pointer;
	font-size: 0.9rem;
	line-height: 1;
	padding: 0;
}
.fs-expense-delete:hover { background: #d63638; color: #fff; }

.fs-expense-summary {
	margin-top: 0.25rem;
	padding: 0.6rem;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	background: #fcfcfd;
}

.fs-expense-summary__total {
	font-size: 0.84rem;
	font-weight: 700;
	color: #1f2937;
	margin-bottom: 0.45rem;
	padding: 0.35rem 0.5rem;
	background: #eef2ff;
	border: 1px solid #c7d2fe;
	border-radius: 4px;
}

.fs-expense-summary__empty {
	margin: 0;
	color: #50575e;
	font-style: italic;
	font-size: 0.875rem;
}

.fs-expense-summary__row {
	display: grid;
	grid-template-columns: minmax(100px, 1fr) minmax(140px, 2fr) auto;
	align-items: center;
	gap: 0.65rem;
	padding: 0.35rem 0;
	border-bottom: 1px solid #efefef;
}

.fs-expense-summary__row:last-child {
	border-bottom: none;
}

.fs-expense-summary__label {
	font-size: 0.8rem;
	font-weight: 700;
	color: #1d2327;
	text-transform: capitalize;
}

.fs-expense-summary__bar-track {
	height: 0.55rem;
	background: #e5e7eb;
	border-radius: 999px;
	overflow: hidden;
}

.fs-expense-summary__bar {
	height: 100%;
	background: linear-gradient(90deg, var(--fs-accent), #60a5fa);
	border-radius: 999px;
}

.fs-expense-summary__amount {
	font-size: 0.82rem;
	font-weight: 700;
	color: #1d2327;
	white-space: nowrap;
}

.fs-expense-toasts {
	position: fixed;
	right: 1rem;
	bottom: 1rem;
	display: grid;
	gap: 0.55rem;
	width: min(320px, calc(100vw - 2rem));
	z-index: 9999;
	pointer-events: none;
}

.fs-expense-toast {
	position: relative;
	padding: 0.55rem 2rem 0.7rem 0.7rem;
	background: #ffffff;
	border: 1px solid #dcdcde;
	border-left: 4px solid #2271b1;
	border-radius: 6px;
	box-shadow: 0 8px 20px rgba(0,0,0,0.12);
	font-size: 0.82rem;
	color: #1d2327;
	pointer-events: auto;
	overflow: hidden;
}

.fs-expense-toast--success {
	border-left-color: #1a7f37;
}

.fs-expense-toast--error {
	border-left-color: #d63638;
}

.fs-expense-toast__close {
	position: absolute;
	top: 0.22rem;
	right: 0.3rem;
	border: none;
	background: transparent;
	font-size: 1rem;
	line-height: 1;
	color: #50575e;
	cursor: pointer;
	padding: 0.15rem;
}

.fs-expense-toast__progress {
	position: absolute;
	left: 0;
	bottom: 0;
	height: 3px;
	width: 100%;
	background: rgba(17, 24, 39, 0.2);
	transform-origin: left center;
	transition: transform 2.6s linear;
}

/* =========================================================
   NARROW CONTAINER LAYOUT
   Applies whenever this block's own width is small — e.g. placed in a
   narrow page template column, sidebar, or block-editor column — even if
   the browser viewport itself is wide.
   ========================================================= */
@container fs-widget ( max-width: 480px ) {
	.fs-student-summary__body {
		grid-template-columns: 1fr;
	}

	.fs-student-summary__radar {
		max-width: 260px;
	}

	.fs-dashboard-topbar {
		flex-direction: column;
		align-items: stretch;
	}

	/* Stat tiles: 2-up instead of an unreadable single-row squeeze. */
	.fs-student-stat {
		flex: 1 1 40%;
		min-width: 0;
	}

	.fs-student-stats {
		justify-content: stretch;
	}

	/* Period filter bar: stack the title above the Last 30 Days / All Time toggle. */
	.fs-period-bar {
		flex-direction: column;
		align-items: stretch;
	}

	.fs-period-toggle {
		align-self: flex-start;
	}

	/* Tab nav: allow the two tab buttons to wrap instead of overflowing. */
	.fs-tab-nav {
		flex-wrap: wrap;
	}

	.fs-tab-btn {
		flex: 1 1 auto;
		text-align: center;
	}

	/* Expense form: stack each field full-width instead of cramming several
	   min-width:100px fields onto one row. */
	.fs-expense-row {
		flex-direction: column;
		align-items: stretch;
	}

	.fs-expense-field,
	.fs-expense-field--desc,
	.fs-expense-field--submit {
		min-width: 0;
		width: 100%;
	}

	.fs-expense-add-btn {
		width: 100%;
	}

	.fs-expense-view-toggle {
		display: flex;
		width: 100%;
	}

	.fs-expense-view-btn {
		flex: 1 1 50%;
	}

	/* Expense list rows: let description wrap onto its own line rather than
	   squeezing type/amount/delete off the edge. */
	.fs-expense-item {
		flex-wrap: wrap;
	}

	.fs-expense-desc {
		flex: 1 1 100%;
		order: 3;
	}

	.fs-expense-summary__row {
		grid-template-columns: 1fr;
		gap: 0.25rem;
	}

	/* Leaderboard rows: drop to a 2-column grid (medal+name / meta+amount). */
	.fs-lb-item {
		grid-template-columns: 2.2rem 1fr;
		grid-template-rows: auto auto;
	}

	.fs-lb-item__meta,
	.fs-lb-item__amount {
		grid-column: 2;
	}

	/* Invoice rows: let title/amount wrap and actions go full-width instead
	   of squeezing everything onto one line. */
	.fs-invoice-row__main {
		flex-wrap: wrap;
	}

	.fs-invoice-row__title {
		flex: 1 1 100%;
		white-space: normal;
		order: 1;
	}

	.fs-status-icon {
		order: 0;
	}

	.fs-invoice-row__amount {
		order: 2;
		text-align: left;
	}

	.fs-invoice-row__actions {
		order: 3;
		flex: 1 1 100%;
		justify-content: flex-start;
	}
}

/* =========================================================
   FINANCIAL SUMMARY
   ========================================================= */
.fs-financial-summary {
	margin-top: 2rem;
	padding: 1.25rem 1.5rem;
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	border-radius: 6px;
}

.fs-fin-intro {
	margin: 0 0 0.75rem;
	font-size: 0.86rem;
	color: #3c434a;
}

.fs-fin-table {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	margin-bottom: 0.75rem;
}

.fs-fin-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	font-size: 0.9rem;
	color: #1d2327;
	padding: 0.25rem 0;
}

.fs-fin-row--deduct .fs-fin-value {
	color: #d63638;
}

.fs-fin-row--taxbill {
	border-top: 2px solid #1d2327;
	padding-top: 0.5rem;
	font-size: 1rem;
	font-weight: 700;
}

.fs-fin-row--taxbill .fs-fin-value {
	color: #b42318;
	font-size: 1.15rem;
}

.fs-fin-row--subtotal {
	border-top: 1px solid #c9c9c9;
	padding-top: 0.4rem;
	font-weight: 600;
}

.fs-fin-row--savings {
	padding-top: 0.2rem;
	font-size: 0.92rem;
	font-weight: 600;
}

.fs-fin-value--positive {
	color: #1a7f37;
	font-weight: 700;
}

.fs-fin-label {
	flex: 1;
}

.fs-fin-value {
	font-weight: 700;
	white-space: nowrap;
}

.fs-fin-disclaimer {
	font-size: 0.75rem;
	color: #50575e;
	font-style: italic;
	margin: 0;
}

/* =========================================================
   PRODUCTION RATE ESTIMATES BLOCK
   ========================================================= */
.fs-rate-estimates__empty {
	text-align: center;
	color: #50575e;
	font-style: italic;
	padding: 1.5rem 0;
}

.fs-rate-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	border: 1px solid #dcdcde;
	border-radius: 8px;
	overflow: hidden;
}

.fs-rate-table th,
.fs-rate-table td {
	text-align: left;
	padding: 0.7rem 1rem;
}

.fs-rate-table thead th {
	background: #1d2327;
	color: #f0f0f1;
	font-size: 0.72rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	border-bottom: none;
}

.fs-rate-table tbody td {
	border-bottom: 1px solid #ececec;
	font-size: 0.9rem;
	color: #1d2327;
}

.fs-rate-table tbody tr:nth-child(even) td {
	background: #f9f9f9;
}

.fs-rate-table tbody tr:hover td {
	background: #f6efe6;
}

.fs-rate-table td:last-child,
.fs-rate-table th:last-child {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.fs-rate-table tbody td:last-child {
	font-weight: 700;
	color: #b45309;
}

.fs-rate-table tbody tr:last-child td {
	border-bottom: none;
}

.fs-rate-estimates__disclaimer {
	font-size: 0.75rem;
	color: #50575e;
	font-style: italic;
	text-align: center;
	margin: 1rem 0 0;
}

@container fs-widget ( max-width: 480px ) {
	.fs-rate-table {
		border-radius: 6px;
	}

	.fs-rate-table thead {
		display: none;
	}

	.fs-rate-table,
	.fs-rate-table tbody,
	.fs-rate-table tr,
	.fs-rate-table td {
		display: block;
		width: 100%;
	}

	.fs-rate-table tr {
		border-bottom: 1px solid #dcdcde;
		padding: 0.4rem 0;
	}

	.fs-rate-table td {
		border-bottom: none;
		padding: 0.15rem 0;
	}

	.fs-rate-table td::before {
		content: attr(data-label) ": ";
		font-weight: 600;
		color: #50575e;
	}

	.fs-rate-table td:last-child {
		text-align: left;
	}
}
