.sgi-case-selector {
	max-width: 1170px;
	margin: 0 auto;
	font-family: inherit;
}

/* Shortcode-selected pill controls only. Card/grid and SGI dropdown styles stay as before. */
.sgi-case-selector-pills .sgi-case-pill-bar {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: nowrap;
	gap: 10px;
	max-width: 100%;
	overflow-x: auto;
	padding: 3px;
	margin-bottom: 18px;
	scrollbar-width: thin;
}
.sgi-case-selector-pills .sgi-case-filter-pill {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 38px;
	padding: 8px 15px;
	border: 1px solid #ddd;
	border-radius: 999px;
	background: #fff;
	color: #333;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.sgi-case-selector-pills .sgi-case-filter-pill:hover { border-color: #999; }
.sgi-case-selector-pills .sgi-case-filter-pill[aria-pressed="true"] { background: #000; color: #fff; border-color: #000; }
.sgi-case-selector-pills .sgi-case-star { width: 38px; padding: 8px; }
.sgi-case-selector-pills .sgi-case-star svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.sgi-case-selector-pills .sgi-case-star[aria-pressed="true"] { color: var(--sgi-portfolio-accent, #b35900); background: #000; border-color: #000; }
.sgi-case-selector-pills .sgi-case-star[aria-pressed="true"] svg { fill: currentColor; }
.sgi-case-selector-pills.is-enhanced .sgi-case-filter-field--pill { display: none; }
@media (max-width: 680px) { .sgi-case-selector-pills .sgi-case-pill-bar { justify-content: flex-start; } }
@media (pointer: coarse) { .sgi-case-selector-pills .sgi-case-filter-pill { min-height: 44px; } }

.sgi-case-filter-fields {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 16px;
	margin-bottom: 18px;
}

.sgi-case-filter-field {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.sgi-case-filter-field label {
	color: #595959;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.02em;
}

.sgi-case-selector .sgi-filter-select {
	min-width: 150px;
	padding: 9px 34px 9px 12px;
	border: 1px solid #ddd;
	border-radius: 8px;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E") no-repeat right 12px center;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	color: #333;
	font-family: inherit;
	font-size: 13px;
	cursor: pointer;
	appearance: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sgi-case-selector .sgi-filter-select:hover {
	border-color: #bbb;
}

.sgi-case-selector .sgi-filter-select:focus {
	outline: none;
	border-color: var(--sgi-portfolio-accent, #b35900);
	box-shadow: none;
}

.sgi-case-debug {
	margin-bottom: 18px;
	padding: 16px;
	border: 1px solid #ddd;
	border-radius: 8px;
	background: #fff;
	color: #333;
}

.sgi-case-selector .sgi-case-debug h3 {
	margin: 0 0 4px;
	color: inherit;
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	text-transform: none;
}

.sgi-case-debug .sgi-case-debug-help,
.sgi-case-debug .sgi-case-debug-empty {
	margin: 0;
	color: #595959;
	font-size: 13px;
}

.sgi-case-debug-groups {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
	gap: 16px;
	margin-top: 14px;
}

.sgi-case-debug .sgi-case-debug-group {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.sgi-case-debug-group legend {
	margin-bottom: 4px;
	padding: 0;
	font-weight: 700;
}

.sgi-case-debug-group label {
	display: flex;
	align-items: baseline;
	gap: 8px;
	width: fit-content;
	max-width: 100%;
	min-height: 24px;
	font-size: 14px;
	line-height: 1.4;
	overflow-wrap: anywhere;
	cursor: pointer;
}

.sgi-case-debug input.sgi-debug-filter {
	flex: none;
	appearance: auto;
	width: 1em;
	height: 1em;
	margin: 0;
	accent-color: #333;
}

.sgi-case-debug .sgi-case-debug-slug {
	font-size: 0.875em;
	white-space: normal;
	overflow-wrap: anywhere;
}

.sgi-case-apply {
	display: block;
	margin: 0 auto 18px;
	padding: 7px 16px;
	border: 0;
	border-radius: 20px;
	background: var(--sgi-portfolio-accent, #b35900);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
}

.sgi-case-selector.is-enhanced .sgi-case-apply {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.sgi-case-filter-actions {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	margin-bottom: 28px;
}

.sgi-reset-filters {
	font-size: 12px;
	color: #595959;
	text-decoration: underline;
}

.sgi-reset-filters:hover,
.sgi-reset-filters:focus {
	color: #666;
}

.sgi-case-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 28px;
}

.sgi-case-card {
	min-width: 0;
}

.sgi-case-card-link {
	display: block;
	color: inherit;
	text-decoration: none;
}

.sgi-case-card-link:hover,
.sgi-case-card-link:focus {
	color: inherit;
	text-decoration: none;
}

.sgi-case-image {
	position: relative;
	aspect-ratio: 16 / 9;
	margin-top: 0;
	margin-bottom: 0;
	overflow: hidden;
	border-radius: 6px;
	background: #dbe4f0;
}

.sgi-case-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.25s ease;
}

.sgi-case-card-link:hover .sgi-case-image img,
.sgi-case-card-link:focus .sgi-case-image img {
	transform: scale(1.025);
}

.sgi-case-card:nth-child(6n + 2) .sgi-case-image-placeholder { background: #f0e4db; }
.sgi-case-card:nth-child(6n + 3) .sgi-case-image-placeholder { background: #dbeee0; }
.sgi-case-card:nth-child(6n + 4) .sgi-case-image-placeholder { background: #e6dbf0; }
.sgi-case-card:nth-child(6n + 5) .sgi-case-image-placeholder { background: #f0dbdb; }
.sgi-case-card:nth-child(6n) .sgi-case-image-placeholder { background: #dbf0ee; }

.sgi-case-tags {
	margin-bottom: 4px;
	color: var(--sgi-portfolio-accent, #b35900);
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
}

.sgi-case-title {
	margin: 0;
	color: #000;
	font-size: 15px;
	font-weight: 900;
	line-height: 1.35;
}

.wpb_text_column h3.sgi-case-title {
	margin-top: 0;
	margin-bottom: 0;
}

.sgi-case-client {
	margin: 0;
	color: #666;
	font-size: 13px;
}

.sgi-case-selector-gametools .sgi-case-card :is(.sgi-case-tags, .sgi-case-title, .sgi-case-client) {
	font-family: "PT Sans", sans-serif;
}

.sgi-case-selector-gametools .sgi-case-card .sgi-case-title {
	font-size: 19.5px;
}

.sgi-case-selector-gametools .sgi-case-card :is(.sgi-case-tags, .sgi-case-client) {
	font-size: 12px;
}

.sgi-case-selector-gametools .sgi-case-card .sgi-case-tags {
	margin-bottom: 0;
}

.sgi-case-no-results {
	margin-top: 24px;
	color: #595959;
	font-size: 14px;
	text-align: center;
}

@media (max-width: 900px) {
	.sgi-case-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 560px) {
	.sgi-case-filter-field {
		flex: 1 1 130px;
	}

	.sgi-case-selector .sgi-filter-select {
		width: 100%;
		min-width: 0;
	}

	.sgi-case-grid {
		grid-template-columns: 1fr;
		gap: 24px;
	}
}
.sgi-case-results {
	transition: opacity 0.15s ease;
}

.sgi-case-selector.is-loading .sgi-case-results {
	opacity: 0.55;
}

.sgi-case-load-more-wrap {
	display: none;
	margin-top: 32px;
	text-align: center;
}

.sgi-case-selector.is-enhanced .sgi-case-load-more-wrap {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
}

.sgi-case-selector.is-enhanced .sgi-case-load-more-wrap[hidden] {
	display: none;
}
.sgi-case-load-more,
.sgi-case-show-all {
	padding: 10px 24px;
	border: 1px solid #000000;
	background: #ffffff;
	color: #000000;
	font-family: inherit;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	transition: all 150ms;
}

.sgi-case-load-more:hover,
.sgi-case-show-all:hover {
	border: 1px solid #ffffff;
	background: #000000;
	color: #ffffff;
}

.sgi-case-load-more:hover,
.sgi-case-load-more:focus,
.sgi-case-show-all:hover,
.sgi-case-show-all:focus {
	transform: translateY(-1px);
}

.sgi-case-load-more:disabled,
.sgi-case-show-all:disabled {
	opacity: 0.6;
	cursor: wait;
	transform: none;
}


.sgi-case-selector [hidden] { display: none !important; }
.sgi-case-selector a:focus-visible, .sgi-case-selector button:focus-visible, .sgi-case-selector select:focus-visible { outline: 3px solid var(--sgi-portfolio-accent, #b35900); outline-offset: 3px; }
.sgi-case-selector .sgi-case-status:not(:empty) { position: static; width: auto; height: auto; clip: auto; clip-path: none; margin-top: 16px; color: #595959; }
@media (prefers-reduced-motion: reduce) { .sgi-case-selector * { transition: none !important; transform: none !important; } }

.sgi-external-link-dialog {
	width: min(620px, calc(100vw - 32px));
	max-width: 620px;
	max-height: calc(100vh - 32px);
	padding: 0;
	overflow: auto;
	border: 0;
	border-radius: 6px;
	background: #fff;
	color: #222;
	box-shadow: 0 18px 60px rgba(0, 0, 0, 0.3);
}

.sgi-external-link-dialog::backdrop {
	background: rgba(0, 0, 0, 0.68);
}

.sgi-external-link-dialog[open]:not(:modal) {
	position: fixed;
	inset: 50% auto auto 50%;
	z-index: 100000;
	transform: translate(-50%, -50%);
}

.sgi-external-link-dialog-inner {
	padding: 32px;
	position: relative;
}

.sgi-external-link-content {
	margin-bottom: 28px;
}

.sgi-external-link-content > :first-child {
	margin-top: 0;
}

.sgi-external-link-content > :last-child {
	margin-bottom: 0;
}

.sgi-external-link-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 12px;
	flex-wrap: wrap;
}

.sgi-external-link-open,
.sgi-external-link-cancel {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 24px;
	border: 1px solid #000000;
	background: #ffffff;
	color: #000000;
	font-family: Hind, Arial, sans-serif;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	transition: all 150ms;
}

.sgi-external-link-cancel {
	position: absolute;
	top: 10px;
	right: 10px;
	outline: 0;
	padding: 0;
	margin: 0;
	border: 0;
	font-size: 20pt;
	cursor: pointer;
	transition: all 200ms ease-in-out;
	opacity: .6;
}

.sgi-external-link-cancel,
.sgi-external-link-cancel:hover,
.sgi-external-link-cancel:focus {
	background: transparent !important;
	color: #000000 !important;
}

.sgi-external-link-cancel:hover {
	opacity: 1;
}

.sgi-external-link-cancel:focus {
	outline: 1px solid black;
}

.sgi-external-link-open:hover,
.sgi-external-link-open:focus {
	transform: translateY(-1px);
	border: 1px solid #ffffff;
	background: #000000;
	color: #ffffff;
}

.sgi-case-load-more:disabled {
	opacity: 0.6;
	cursor: wait;
	transform: none;
}

/*.sgi-external-link-open,
.sgi-external-link-open:hover,
.sgi-external-link-open:focus {
	background: #ff9900;
	color: #111;
	text-decoration: none;
}

.sgi-external-link-cancel {
	background: #fff;
	color: #111;
}*/

@media (max-width: 560px) {
	.sgi-external-link-dialog-inner {
		padding: 24px 20px;
	}

	.sgi-external-link-actions {
		align-items: stretch;
		flex-direction: column;
	}
}
