/* Photo Gallery RB — the editor, inside <pgrb-editor>'s shadow root. */

:host {
	--accent: var(--wp-admin-theme-color, #2271b1);
	--accent-dark: var(--wp-admin-theme-color-darker-10, #135e96);
	--accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
	--bg: #f6f7f9;
	--panel: #fff;
	--line: #e3e5e8;
	--line-strong: #c9cdd2;
	--text: #1d2327;
	--muted: #646970;
	--danger: #d63638;
	--radius: 10px;
	--shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
	display: block;
	opacity: 0;
	transition: opacity .2s;
	color: var(--text);
	font: 13px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}
:host(.ready) { opacity: 1; }
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---------- frame ---------- */
.app {
	display: flex;
	flex-direction: column;
	height: calc(100vh - 32px);
	min-height: 560px;
	background: var(--bg);
}
.body {
	flex: 1;
	min-height: 0;
	display: grid;
	grid-template-columns: minmax(0, 1fr) 340px;
}

/* ---------- header ---------- */
.bar {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 16px;
	background: var(--panel);
	border-bottom: 1px solid var(--line);
}
.back {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 6px 10px 6px 6px;
	border-radius: 8px;
	color: var(--muted);
	text-decoration: none;
}
.back:hover { background: var(--bg); color: var(--text); }
.title {
	flex: 0 1 460px;
	min-width: 120px;
	padding: 7px 10px;
	border: 1px solid transparent;
	border-radius: 8px;
	background: transparent;
	font-size: 18px;
	font-weight: 600;
}
.title:hover { border-color: var(--line); }
.title:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: #fff; }
.state { color: var(--muted); font-size: 12px; white-space: nowrap; }
.state.dirty { color: #996800; }
.state.dirty::before { content: "●"; margin-right: 5px; font-size: 9px; vertical-align: 2px; }
.status {
	padding: 6px 28px 6px 10px;
	border: 1px solid var(--line-strong);
	border-radius: 8px;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23646970' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 14px;
	appearance: none;
}

/* ---------- buttons ---------- */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 34px;
	padding: 6px 13px;
	border: 1px solid var(--line-strong);
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
	white-space: nowrap;
	text-decoration: none;
	transition: background-color .15s, border-color .15s, box-shadow .15s, color .15s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn:focus-visible, .icon-btn:focus-visible, .seg-btn:focus-visible, .tab:focus-visible, .card:focus-visible, .chip:focus-visible, .tile:focus-visible {
	outline: none;
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent);
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 500; }
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn.primary:disabled { opacity: .5; cursor: default; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--panel); border-color: var(--line); }
.btn.danger:hover { color: var(--danger); border-color: var(--danger); }
.btn.wide { width: 100%; margin-top: 6px; }
.ico { display: inline-flex; }
.icon-btn {
	display: inline-grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--muted);
	cursor: pointer;
}
.icon-btn:hover { background: var(--panel); color: var(--text); }
.icon-btn.on { background: var(--panel); color: var(--accent); box-shadow: var(--shadow); }
.link-btn { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0 2px; font-size: 12px; }

/* ---------- main ---------- */
.main {
	display: flex;
	flex-direction: column;
	min-width: 0;
	min-height: 0;
}
.toolbar {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px 16px;
	flex-wrap: wrap;
}
.tools { display: flex; align-items: center; gap: 6px; flex: 1; flex-wrap: wrap; min-width: 0; }
.seg {
	display: inline-flex;
	padding: 3px;
	border-radius: 10px;
	background: #e9ebee;
}
.seg-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--muted);
	cursor: pointer;
	font-weight: 500;
}
.seg-btn.on { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.seg-btn .count {
	min-width: 20px;
	padding: 0 6px;
	border-radius: 10px;
	background: var(--accent-soft);
	color: var(--accent);
	font-size: 11px;
	line-height: 18px;
	text-align: center;
}
.sel-info { color: var(--accent); font-weight: 500; }
.sort {
	padding: 6px 26px 6px 10px;
	border: 1px solid transparent;
	border-radius: 8px;
	background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23646970' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 6px center / 14px;
	appearance: none;
	cursor: pointer;
	color: var(--muted);
}
.sort:hover { background-color: var(--panel); border-color: var(--line); }

.pop-wrap { position: relative; }
.pop {
	position: absolute;
	z-index: 20;
	top: calc(100% + 6px);
	left: 0;
	display: flex;
	gap: 6px;
	width: 440px;
	max-width: 80vw;
	padding: 10px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 12px 32px rgba(16, 24, 40, .16);
}
.pop input { flex: 1; min-width: 0; }
.pop.busy { opacity: .6; pointer-events: none; }

/* ---------- image grid ---------- */
.images-view, .preview-view {
	flex: 1;
	min-height: 0;
	overflow: auto;
	padding: 0 16px 24px;
}
.grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 12px;
	align-content: start;
	min-height: 100%;
	outline: none;
}
.grid.empty { display: block; }
.hint { margin: 14px 0 0; color: var(--muted); font-size: 12px; text-align: center; }

.tile {
	position: relative;
	aspect-ratio: 1;
	border-radius: var(--radius);
	overflow: hidden;
	background: #dcdfe3;
	box-shadow: var(--shadow);
	cursor: pointer;
	outline: none;
	transition: transform .15s, box-shadow .15s, opacity .15s;
	-webkit-user-select: none;
	user-select: none;
}
.tile img, .tile .noimg { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.tile::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	box-shadow: inset 0 0 0 0 var(--accent);
	transition: box-shadow .12s;
	pointer-events: none;
}
.tile:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(16, 24, 40, .14); }
.tile.sel::after { box-shadow: inset 0 0 0 3px var(--accent); }
.tile.sel img { transform: scale(.94); border-radius: 6px; transition: transform .15s; }
.tile.dragging { opacity: .35; }
.tile.drop-before { box-shadow: -7px 0 0 -2px var(--accent), var(--shadow); }
.tile.drop-after { box-shadow: 7px 0 0 -2px var(--accent), var(--shadow); }
.check {
	position: absolute;
	top: 8px;
	left: 8px;
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .9);
	box-shadow: 0 0 0 1.5px rgba(0, 0, 0, .25);
	color: transparent;
	opacity: 0;
	transition: opacity .12s, background-color .12s;
}
.check svg { width: 15px; height: 15px; stroke-width: 2.6; }
.tile:hover .check, .tile:focus-visible .check, .grid:has(.sel) .check { opacity: 1; }
.tile.sel .check { background: var(--accent); color: #fff; box-shadow: none; opacity: 1; }
.name {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 18px 9px 7px;
	background: linear-gradient(transparent, rgba(0, 0, 0, .62));
	color: #fff;
	font-size: 12px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	opacity: 0;
	transition: opacity .15s;
}
.tile:hover .name, .tile.sel .name { opacity: 1; }
.name:empty { display: none; }
.badge, .tagn {
	position: absolute;
	top: 8px;
	right: 8px;
	display: inline-flex;
	align-items: center;
	gap: 3px;
	padding: 3px 6px;
	border-radius: 6px;
	background: rgba(0, 0, 0, .6);
	color: #fff;
	font-size: 11px;
}
.badge svg, .tagn svg { width: 14px; height: 14px; }
.badge + .tagn { top: 36px; }
.tile.up { cursor: progress; }
.tile.up img { opacity: .5; filter: grayscale(.4); }
.progress {
	position: absolute;
	left: 10px;
	right: 10px;
	bottom: 10px;
	height: 5px;
	border-radius: 5px;
	background: rgba(255, 255, 255, .7);
	overflow: hidden;
}
.progress i { display: block; height: 100%; background: var(--accent); transition: width .2s; }

.empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 420px;
	height: 100%;
	padding: 40px 20px;
	border: 2px dashed var(--line-strong);
	border-radius: 16px;
	background: rgba(255, 255, 255, .6);
	text-align: center;
}
.empty-state h2 { margin: 6px 0 0; font-size: 20px; }
.empty-state p { margin: 0 0 14px; max-width: 460px; color: var(--muted); }
.empty-ico svg { width: 56px; height: 56px; stroke: var(--accent); stroke-width: 1.3; }
.row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* ---------- preview ---------- */
.devices { flex: 1; }
.device-wrap { display: flex; justify-content: center; }
.device {
	width: 100%;
	min-height: 300px;
	padding: 28px;
	border-radius: 14px;
	background: #fff;
	box-shadow: var(--shadow);
	transition: width .3s ease, opacity .2s;
}
.device.tablet { width: 820px; max-width: 100%; }
.device.mobile { width: 390px; max-width: 100%; padding: 16px; border: 8px solid #1d2327; border-radius: 34px; }
.device.loading { opacity: .55; }

/* ---------- sidebar ---------- */
.side {
	display: flex;
	flex-direction: column;
	min-height: 0;
	background: var(--panel);
	border-left: 1px solid var(--line);
}
.tabs {
	display: flex;
	gap: 2px;
	padding: 8px 8px 0;
	border-bottom: 1px solid var(--line);
	/* Pro has eight tabs: they wrap, none hidden past the edge */
	flex-wrap: wrap;
}
.tab {
	flex: none;
	padding: 9px 7px 10px;
	font-size: 12.5px;
	border: 0;
	border-bottom: 2px solid transparent;
	background: none;
	color: var(--muted);
	cursor: pointer;
	font-weight: 500;
	white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); }
.tab.dim:not(.on) { opacity: .55; }
.panel {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	padding: 16px;
	transition: opacity .15s;
}
.panel.busy { opacity: .5; pointer-events: none; }

.field { margin: 0 0 16px; }
.label { display: block; margin: 0 0 6px; font-weight: 500; }
.help { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.field input[type="text"], .field input[type="url"], .field input[type="number"], .field select, .field textarea, .pop input, .tag-input {
	width: 100%;
	padding: 7px 10px;
	border: 1px solid var(--line-strong);
	border-radius: 8px;
	background: #fff;
	transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 58px; }
.field input:focus, .field select:focus, .field textarea:focus, .pop input:focus, .tag-input:focus-within {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-soft);
}
::placeholder { color: #8c8f94; }

.toggle-field { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.toggle-field .label { margin: 0; font-weight: 400; flex: 1; }
.toggle-field .help { flex-basis: 100%; margin: 0; }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.track { position: absolute; inset: 0; border-radius: 22px; background: #c3c4c7; transition: background-color .15s; }
.track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent); }

.range { display: flex; align-items: center; gap: 10px; }
.range input[type="range"] { flex: 1; accent-color: var(--accent); }
.range .num { width: 64px !important; flex: none; padding: 5px 6px !important; text-align: right; }
.unit { color: var(--muted); font-size: 12px; min-width: 16px; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 10px 6px 8px;
	border: 1.5px solid var(--line);
	border-radius: 10px;
	background: #fff;
	cursor: pointer;
	font-size: 12px;
	color: var(--muted);
	transition: border-color .15s, color .15s, background-color .15s;
}
.card:hover { border-color: var(--line-strong); color: var(--text); }
.card.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.art svg { width: 48px; height: 32px; fill: currentColor; stroke: currentColor; stroke-width: 1; opacity: .75; }
.art svg rect { rx: 2; }
.tiles-cards { grid-template-columns: repeat(5, 1fr); }
.tiles-art { display: grid; grid-auto-rows: 9px; gap: 2px; width: 100%; grid-auto-flow: dense; }
.tiles-art i { background: currentColor; opacity: .55; border-radius: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
	padding: 5px 11px;
	border: 1px solid var(--line-strong);
	border-radius: 999px;
	background: #fff;
	cursor: pointer;
	font-size: 12px;
	transition: border-color .15s, background-color .15s, color .15s;
}
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.check-chip input { position: absolute; opacity: 0; pointer-events: none; }
.check-chip:focus-within { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent); }

.color { display: grid; grid-template-columns: 36px 1fr; gap: 6px 8px; align-items: center; }
.color input[type="range"] { grid-column: 1 / span 2; accent-color: var(--accent); }
.color .link-btn { grid-column: 2; justify-self: end; margin-top: -4px; }
.swatch {
	position: relative;
	width: 36px;
	height: 34px;
	border-radius: 8px;
	overflow: hidden;
	border: 1px solid var(--line-strong);
	background: repeating-conic-gradient(#e2e4e7 0 25%, #fff 0 50%) 0 0 / 10px 10px;
}
.swatch i { position: absolute; inset: 0; pointer-events: none; }
.swatch input { position: absolute; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); opacity: 0; cursor: pointer; }

/* ---------- selection panel ---------- */
.blank { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 30px 12px; color: var(--muted); text-align: center; }
.blank svg { width: 36px; height: 36px; stroke-width: 1.4; }
.sel-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.sel-head.one { flex-direction: row; align-items: flex-start; gap: 12px; }
.sel-head.one img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; flex: none; }
.sel-head .meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sel-head .meta strong { overflow-wrap: anywhere; }
.sel-head a { color: var(--accent); }
.strip { display: flex; }
.strip img, .strip span { width: 46px; height: 46px; object-fit: cover; border-radius: 8px; border: 2px solid #fff; margin-right: -14px; box-shadow: var(--shadow); background: #dcdfe3; }
.inline { display: flex; align-items: center; gap: 8px; margin: -8px 0 16px; cursor: pointer; }
.inline input { accent-color: var(--accent); margin: 0; }
.tag-input { display: flex; flex-wrap: wrap; gap: 5px; padding: 5px !important; }
.tag-input input { flex: 1; min-width: 120px; border: 0 !important; box-shadow: none !important; padding: 3px 5px !important; outline: none; }
.tag-list { display: contents; }
.tag {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	padding: 2px 4px 2px 9px;
	border-radius: 999px;
	background: var(--accent-soft);
	color: var(--accent);
	font-size: 12px;
}
.tag button { display: grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: none; color: inherit; cursor: pointer; }
.tag button:hover { background: rgba(0, 0, 0, .08); }
.tag svg { width: 12px; height: 12px; stroke-width: 2.4; }
.seg.small { margin-top: 8px; display: flex; }
.seg.small label { flex: 1; padding: 4px 6px; border-radius: 7px; text-align: center; cursor: pointer; color: var(--muted); font-size: 12px; }
.seg.small label.on { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.seg.small input { position: absolute; opacity: 0; pointer-events: none; }
.sel-actions { display: flex; flex-direction: column; align-items: stretch; gap: 2px; margin: 12px 0; padding-top: 12px; border-top: 1px solid var(--line); }
.sel-actions .btn { justify-content: flex-start; }
.exif-box { margin-top: 8px; padding: 12px 14px; border-radius: 10px; background: var(--bg); }
.exif-box h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 13px; }
.exif-box dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 12px; }
.exif-box dt { color: var(--muted); text-transform: capitalize; }
.exif-box dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- embed ---------- */
.code {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 6px 6px 6px 12px;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--bg);
}
.code code { flex: 1; min-width: 0; font: 12px/1.5 Consolas, Monaco, monospace; overflow-wrap: anywhere; }

/* ---------- overlays ---------- */
.drop {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: grid;
	place-items: center;
	padding: 24px;
	background: color-mix(in srgb, var(--accent) 22%, rgba(255, 255, 255, .7));
	backdrop-filter: blur(3px);
	pointer-events: none;
}
.drop-in {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	width: min(560px, 100%);
	padding: 60px 30px;
	border: 3px dashed var(--accent);
	border-radius: 24px;
	background: #fff;
	color: var(--accent);
	font-size: 18px;
}
.drop-ico svg { width: 64px; height: 64px; stroke-width: 1.3; }
.toast {
	position: fixed;
	z-index: 100001;
	left: 50%;
	bottom: 24px;
	max-width: min(560px, 90vw);
	padding: 10px 18px;
	border-radius: 10px;
	background: #1d2327;
	color: #fff;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
	opacity: 0;
	transform: translate(-50%, 12px);
	transition: opacity .2s, transform .2s;
	pointer-events: none;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); }

/* ---------- small screens ---------- */
@media (max-width: 960px) {
	.app { height: auto; min-height: 0; }
	.body { grid-template-columns: 1fr; }
	.side { border-left: 0; border-top: 1px solid var(--line); }
	.images-view, .preview-view { overflow: visible; }
	.panel { overflow: visible; }
	.grid { min-height: 0; }
}
@media (max-width: 600px) {
	.bar { flex-wrap: wrap; padding: 8px 10px; }
	.title { flex-basis: 100%; order: 5; font-size: 16px; }
	.back span { display: none; }
	.toolbar { padding: 10px; }
	.images-view, .preview-view { padding: 0 10px 16px; }
	.grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
	.btn { padding: 6px 10px; }
	.tools .btn { font-size: 0; gap: 0; }
	.tools .btn .ico { font-size: 13px; }
	.device { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition-duration: 1ms !important; }
}

/* ---------- social feeds ---------- */
.brand { display: inline-grid; place-items: center; }
.brand svg { width: 20px; height: 20px; stroke-width: 1.8; }
.feed-menu {
	position: absolute;
	z-index: 30;
	top: calc(100% + 6px);
	left: 0;
	display: flex;
	flex-direction: column;
	width: 250px;
	padding: 10px;
	border-radius: 10px;
	background: #161616;
	box-shadow: 0 16px 40px rgba(0, 0, 0, .3);
}
.feed-opt {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 10px;
	border: 0;
	border-radius: 7px;
	background: none;
	color: #fff;
	font-size: 14px;
	font-weight: 500;
	text-align: left;
	cursor: pointer;
}
.feed-opt:hover, .feed-opt:focus-visible { background: rgba(255, 255, 255, .1); outline: none; }
.feed-opt .brand { width: 22px; }
.feed-opt:disabled { opacity: .45; cursor: default; }
.feed-opt.locked .feed-name { opacity: .8; }
.feed-name { flex: 1; }
.pill { padding: 0 7px; border-radius: 999px; background: rgba(255, 255, 255, .14); color: #fff; font-size: 10px; font-weight: 600; line-height: 17px; letter-spacing: .03em; text-transform: uppercase; }
.pill.pro { background: linear-gradient(135deg, #f7b733, #fc4a1a); }
.feed-note { display: flex; flex-direction: column; gap: 8px; margin: 8px 2px 2px; padding: 10px; border-radius: 8px; background: rgba(255, 255, 255, .08); color: #ddd; font-size: 12px; }
.feed-note[hidden] { display: none; }

.tile.feed { background: #eef0f3; }
.collage { position: absolute; inset: 0; display: grid; gap: 2px; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.collage img { width: 100%; height: 100%; object-fit: cover; display: block; }
.collage.n1 img { grid-column: span 2; grid-row: span 2; }
.collage.n2 img { grid-row: span 2; }
.collage.n3 img:first-child { grid-row: span 2; }
.feed-blank { position: absolute; inset: 0; display: grid; place-items: center; }
.feed-blank .brand svg { width: 54px; height: 54px; stroke-width: 1.4; opacity: .9; }
.feed-badge {
	position: absolute;
	top: 8px;
	right: 8px;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 3px 8px 3px 5px;
	border-radius: 999px;
	background: #fff;
	color: var(--text);
	font-size: 11px;
	font-weight: 600;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
}
.feed-badge .brand svg { width: 15px; height: 15px; }
.feed-badge .brand { color: inherit; }
.feed-count {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 16px 9px 7px;
	background: linear-gradient(transparent, rgba(0, 0, 0, .65));
	color: #fff;
	font-size: 12px;
	font-weight: 500;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.tile.feed.has-error .feed-count { background: var(--danger); white-space: normal; padding-top: 6px; }
.tile.feed.loading .feed-count { background: rgba(0, 0, 0, .55); }
.tile.feed.loading::before { content: ""; position: absolute; inset: 0; background: rgba(255, 255, 255, .4); z-index: 1; }
.tile.feed .check { z-index: 2; }

.feed-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.feed-head > div { display: flex; flex-direction: column; }
.feed-head strong { font-size: 15px; }
.feed-logo { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--bg); }
.feed-logo svg { width: 26px; height: 26px; }
.feed-status { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 16px; padding: 10px 12px; border-radius: 10px; background: var(--bg); }
.feed-status.error { background: #fcf0f1; color: #8a2424; }
.feed-status .btn { align-self: flex-start; }
.feed-status .strip img { width: 40px; height: 40px; margin-right: -10px; }

/* ---------- Pro tabs without the key ---------- */
.tab.locked::after { content: "PRO"; margin-left: 5px; padding: 0 5px; border-radius: 6px; background: linear-gradient(135deg, #f7b733, #fc4a1a); color: #fff; font-size: 9px; font-weight: 700; vertical-align: 1px; }
.pro-pitch { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 20px; border-radius: 12px; background: linear-gradient(160deg, #fff7ed, #fff); border: 1px solid #fde3c8; }
.pro-pitch h3 { margin: 4px 0 0; font-size: 16px; }
.pro-pitch p { margin: 0 0 8px; color: var(--muted); }

/* ---------- Protect: our other plugins ---------- */
.companions { display: flex; flex-direction: column; gap: 12px; }
.comp { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.comp-head { display: flex; align-items: center; gap: 10px; }
.comp-head > div { display: flex; flex-direction: column; flex: 1; }
.comp-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.comp-ico svg { width: 22px; height: 22px; }
.comp-ok { padding: 2px 9px; border-radius: 999px; background: #d1fae5; color: #065f46; font-size: 11px; font-weight: 600; white-space: nowrap; }
.comp-text { margin: 10px 0; color: var(--muted); font-size: 12.5px; }
.comp-actions { display: flex; gap: 8px; }
.comp-msg:empty { display: none; }
.comp-msg.err { color: var(--danger); }
