/**
 * qTap IGcr — Public Styles
 *
 * @package KDC_QTAP_IGCR
 */

/* ── Design Tokens ─────────────────────────────────────────────────────── */
:root {
  /* Accent — overridden via wp_add_inline_style from network setting */
  --igcr-accent: #3D6792;
  --igcr-accent-hover: #345878;
  --igcr-accent-light: rgba(61,103,146,0.1);
  --igcr-accent-rgb: 61,103,146;

  /* Semantic */
  --igcr-success: #22c55e;
  --igcr-success-hover: #16a34a;
  --igcr-warning: #f59e0b;
  --igcr-danger: #ef4444;
  --igcr-danger-hover: #dc2626;
  --igcr-info: #3b82f6;

  /* Neutrals */
  --igcr-text: #1f2937;
  --igcr-text-secondary: #6b7280;
  --igcr-text-muted: #9ca3af;
  --igcr-border: #e5e7eb;
  --igcr-border-light: #f3f4f6;
  --igcr-bg: #ffffff;
  --igcr-bg-subtle: #f9fafb;
  --igcr-bg-muted: #f3f4f6;

  /* Radius */
  --igcr-radius-sm: 6px;
  --igcr-radius: 10px;
  --igcr-radius-lg: 14px;
  --igcr-radius-full: 9999px;

  /* Shadows */
  --igcr-shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --igcr-shadow: 0 4px 12px rgba(0,0,0,0.08);
  --igcr-shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
}

/* Icon base */
.igcr-icon {
  display: inline-block;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* Instagram login button */
.igcr-login-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 20px;
	background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
	color: #fff;
	border-radius: 6px;
	text-decoration: none;
	font-weight: 600;
	font-size: 15px;
	transition: opacity 0.2s;
}

.igcr-login-btn:hover,
.igcr-login-btn:focus {
	opacity: 0.85;
	color: #fff;
}

/* Grid — column count driven by --igcr-cols (set via inline style from PHP) */
.igcr-accounts-grid {
	display: grid;
	grid-template-columns: repeat( var( --igcr-cols, 3 ), 1fr );
	gap: 20px;
}

@media ( max-width: 900px ) {
	.igcr-accounts-grid {
		grid-template-columns: repeat( min( var( --igcr-cols, 3 ), 2 ), 1fr );
	}
}

@media ( max-width: 560px ) {
	.igcr-accounts-grid {
		grid-template-columns: 1fr;
	}
}

/* Card */
.igcr-account-card {
	background: #fff;
	border: 1px solid var(--igcr-border);
	border-radius: 14px;
	padding: 24px;
	display: flex;
	flex-direction: column;
	gap: 14px;
	transition: box-shadow 0.15s ease;
}

.igcr-account-card:hover {
	box-shadow: 0 4px 20px rgba( 0, 0, 0, 0.07 );
}

/* ── Onboarding: selectable radio cards ─────────────────────────────────── */

.igcr-account-card--selectable {
	cursor: pointer;
	border: 2px solid var(--igcr-border);
	overflow: hidden; /* clips browser chrome bar to card border-radius */
	padding: 0; /* URL bar fills edge-to-edge; igcr-card-body handles inner spacing */
	gap: 0;
}

/* Card body — content area below the URL/chrome row */
.igcr-card-body {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 14px 20px 20px;
}

.igcr-account-card--selectable:hover {
	border-color: #b3b4b6;
	box-shadow: 0 2px 10px rgba( 0, 0, 0, 0.08 );
}

.igcr-account-card--selected {
	border-color: #c0d6ec;
}

/* Radio indicator (visible when NOT selected) */
.igcr-card-radio {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	border: 2px solid #c3c4c7;
	background: #fff;
	flex-shrink: 0;
}

/* Hidden when browser chrome takes over */
.igcr-account-card--selected .igcr-card-radio {
	display: none;
}

/* ── Account picker list ─────────────────────────────────────────────────── */

#igcr-account-cards {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-bottom: 24px;
}

/* ── URL / browser chrome row ────────────────────────────────────────────── */

.igcr-onboard-url-row {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 20px;
	border-bottom: 1px solid var(--igcr-border);
}

/* Traffic light dots — hidden until card is selected */
.igcr-browser-dots {
	display: none;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
}

.igcr-dot {
	width: 11px;
	height: 11px;
	border-radius: 50%;
	flex-shrink: 0;
}

.igcr-dot--red    { background: #eb3e56; }
.igcr-dot--yellow { background: #f4b11d; }
.igcr-dot--green  { background: #29ab7f; }

/* Address bar wrapper */
.igcr-browser-address {
	flex: 1;
	min-width: 0;
	display: flex;
	align-items: center;
}

/* URL text */
.igcr-onboard-url {
	font-size: 12px;
	font-weight: 600;
	color: #2271b1;
	font-family: monospace;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Vertical three-dot menu — hidden until card is selected */
.igcr-browser-menu {
	display: none;
	flex-direction: column;
	align-items: center;
	gap: 3px;
	flex-shrink: 0;
	padding: 2px 0;
}

.igcr-browser-menu span {
	display: block;
	width: 3px;
	height: 3px;
	border-radius: 50%;
	background: #666;
}

/* ── Selected state: URL row becomes browser chrome bar ──────────────────── */

.igcr-account-card--selected .igcr-onboard-url-row {
	background: #e3e3e3;
	border-bottom-color: #d0d0d0;
	padding: 9px 14px;
}

.igcr-account-card--selected .igcr-browser-dots {
	display: flex;
}

.igcr-account-card--selected .igcr-browser-address {
	background: #fff;
	border-radius: 12px;
	padding: 3px 10px;
	justify-content: center;
}

.igcr-account-card--selected .igcr-browser-menu {
	display: flex;
}

/* Card top row — avatar + identity */
.igcr-card-top {
	display: flex;
	align-items: flex-start;
	gap: 14px;
}

/* Avatar */
.igcr-account-avatar img,
.igcr-avatar-placeholder {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
}

.igcr-avatar-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f0f0f0;
	font-size: 20px;
	font-weight: 600;
}

/* Identity */
.igcr-account-meta {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.igcr-account-identity {
	display: flex;
	align-items: center;
	gap: 7px;
	flex-wrap: wrap;
}

.igcr-account-username {
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Account type badge */
.igcr-account-type {
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	padding: 2px 7px;
	border-radius: 4px;
	white-space: nowrap;
}

.igcr-type--business {
	background: #e8f4fd;
	color: #1a6fa8;
}

.igcr-type--creator {
	background: #f3eafd;
	color: var(--igcr-accent-hover);
}

/* Bio — clamp to 3 lines */
.igcr-account-bio {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin: 0;
}

/* Stats */
.igcr-account-stats {
	display: flex;
	gap: 24px;
	padding-top: 14px;
	border-top: 1px solid #f0f0f0;
	margin-top: auto;
}

.igcr-stat {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.igcr-stat-value {
	font-weight: 700;
	line-height: 1;
}

.igcr-stat-label {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.4px;
}

/* Actions row */
.igcr-accounts-actions {
	margin-top: 28px;
}

/* Empty state */
.igcr-accounts-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 80px 24px;
	gap: 16px;
}

.igcr-empty-icon {
	width: 48px;
	height: 48px;
	color: #ccc;
}

.igcr-empty-text {
	margin: 0;
}

/* ── Profile page (/profile/{username}/) ── */

.igcr-profile-wrap {
	max-width: 960px;
}

.igcr-profile-not-found {
	padding: 60px 24px;
	text-align: center;
}

/* Profile card */
.igcr-profile-card {
	background: var(--igcr-bg);
	border: 1px solid var(--igcr-border);
	border-radius: var(--igcr-radius-lg);
	padding: 24px;
	margin-bottom: 16px;
}

/* 1. Profile header */
.igcr-profile-header {
	display: flex;
	align-items: flex-start;
	gap: 18px;
	margin-bottom: 0;
}

.igcr-profile-card .igcr-profile-header {
	margin-bottom: 0;
}

.igcr-profile-card .igcr-profile-bio-group {
	margin-top: 14px;
	margin-bottom: 0;
}

img.igcr-profile-avatar {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
	flex-shrink: 0;
}

span.igcr-profile-avatar {
	width: 80px;
	height: 80px;
	font-size: 28px;
	flex-shrink: 0;
}

.igcr-profile-identity {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.igcr-profile-name-row {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.igcr-account-username {
	font-size: 1.15em;
	font-weight: 700;
}

.igcr-profile-display-name {
	font-size: 1em;
	font-weight: 500;
	color: #333;
}

.igcr-header-stats {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
	font-size: 0.875em;
}

.igcr-header-stat {
	white-space: nowrap;
}

.igcr-header-stat strong {
	font-weight: 700;
	margin-right: 2px;
}

.igcr-header-stat-sep {
	color: #ccc;
}

/* 2. Bio + website */
.igcr-profile-bio-group {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 20px;
}

/* Action button bar */
.igcr-profile-actions {
	display: flex;
	gap: 8px;
	margin-bottom: 20px;
	flex-wrap: wrap;
}

.igcr-action-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	border: 1px solid var(--igcr-border);
	border-radius: var(--igcr-radius-full);
	font-size: 0.85em;
	font-weight: 500;
	background: var(--igcr-bg);
	cursor: pointer;
	text-decoration: none;
	color: var(--igcr-text);
	transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
	line-height: 1;
	white-space: nowrap;
}

.igcr-action-btn:hover {
	background: var(--igcr-bg-subtle);
	border-color: var(--igcr-text-muted);
	text-decoration: none;
	color: var(--igcr-text);
}

.igcr-action-btn--primary {
	background: var(--igcr-accent);
	color: #fff;
	border-color: var(--igcr-accent);
}

.igcr-action-btn--primary:hover {
	background: var(--igcr-accent-hover);
	border-color: var(--igcr-accent-hover);
	color: #fff;
}

/* Content tabs */
.igcr-content-tabs {
	margin-bottom: 24px;
}

.igcr-tab-nav {
	display: flex;
	border-bottom: 1px solid var(--igcr-border);
	margin-bottom: 2px;
}

.igcr-tab-btn {
	flex: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 12px 0;
	border: none;
	border-bottom: 2px solid transparent;
	background: none;
	cursor: pointer;
	font-size: 0.85em;
	font-weight: 500;
	color: var(--igcr-text-secondary);
	transition: color 0.15s, border-color 0.15s;
}

.igcr-tab-btn:hover {
	color: var(--igcr-text);
}

.igcr-tab-btn.is-active {
	color: var(--igcr-text);
	border-bottom-color: var(--igcr-accent);
}

.igcr-tab-panel[hidden] {
	display: none;
}

.igcr-tab-panel {
	padding-top: 4px;
}

.igcr-tab-empty {
	text-align: center;
	padding: 40px 20px;
	color: var(--igcr-text-muted);
	font-size: 0.9em;
	border: 1px dashed var(--igcr-border);
	border-radius: var(--igcr-radius);
	margin-top: 4px;
}

/* Instagram-style square grid */
.igcr-grid {
	display: grid;
	gap: 3px;
}

.igcr-grid--3col {
	grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 560px) {
	.igcr-grid--3col {
		grid-template-columns: repeat(2, 1fr);
	}
}

.igcr-grid-item {
	display: block;
	position: relative;
	aspect-ratio: 1;
	overflow: hidden;
	background: var(--igcr-bg-muted);
	border-radius: 2px;
}

.igcr-grid-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.2s;
}

.igcr-grid-item:hover img {
	transform: scale(1.04);
}

.igcr-grid-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: var(--igcr-text-muted);
}

.igcr-grid-badge {
	position: absolute;
	top: 6px;
	right: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	background: rgba(0, 0, 0, 0.5);
	color: #fff;
	border-radius: 50%;
}

/* Admin panel (collapsible) */
.igcr-admin-panel {
	margin-top: 8px;
	padding: 16px 0;
	border-top: 1px solid var(--igcr-border);
}

.igcr-admin-panel[hidden] {
	display: none;
}

/* Create Post modal overrides */
.igcr-create-post-modal .igcr-modal-box {
	max-width: 520px;
	padding: 0;
}

.igcr-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16px 20px;
	border-bottom: 1px solid var(--igcr-border);
}

.igcr-modal-header .igcr-modal-title {
	margin: 0;
	font-size: 1em;
	color: var(--igcr-text);
}

.igcr-modal-close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: none;
	background: none;
	cursor: pointer;
	color: var(--igcr-text-secondary);
	border-radius: var(--igcr-radius-sm);
	transition: background 0.15s;
}

.igcr-modal-close:hover {
	background: var(--igcr-bg-muted);
	color: var(--igcr-text);
}

.igcr-modal-content {
	padding: 20px;
}

/* Single post actions */
.igcr-single-actions {
	display: flex;
	gap: 8px;
	margin: 12px 0;
	flex-wrap: wrap;
}

.igcr-profile-bio {
	margin: 0;
	line-height: 1.55;
	color: #333;
}

.igcr-profile-website {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 0.9em;
	text-decoration: none;
	word-break: break-all;
}

.igcr-profile-website:hover {
	text-decoration: underline;
}

/* 3. Account meta panel */
.igcr-profile-meta {
	display: flex;
	flex-direction: column;
	background: #f9f9f9;
	border-radius: 10px;
	padding: 0 16px;
	margin-bottom: 24px;
	font-size: 0.855em;
}

.igcr-meta-row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 0;
	border-bottom: 1px solid #eee;
}

.igcr-meta-row:last-child {
	border-bottom: none;
}

.igcr-meta-label {
	font-weight: 600;
	color: #888;
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	white-space: nowrap;
	min-width: 100px;
}

.igcr-meta-value-wrap {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	min-width: 0;
}

.igcr-meta-value {
	color: #333;
}

.igcr-reconnect-hint {
	font-size: 0.85em;
	opacity: 0.5;
}

.igcr-token-auto-renew {
	font-size: 0.9em;
	opacity: 0.5;
	margin-left: 4px;
}

.igcr-token-warn {
	color: #c0392b;
	font-weight: 600;
}

/* Instagram Shop badge */
.igcr-shop-badge {
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	padding: 2px 7px;
	border-radius: 4px;
	background: #fef3c7;
	color: #92400e;
	white-space: nowrap;
}

/* 4. Sync bar */
.igcr-sync-started-notice {
	background: #e8f5e9;
	border-left: 3px solid #4caf50;
	padding: 10px 14px;
	border-radius: 6px;
	font-size: 0.88em;
	margin-bottom: 12px;
}

.igcr-sync-bar {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 0.82em;
	color: #999;
	margin-bottom: 20px;
	flex-wrap: wrap;
}

.igcr-sync-now-link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: var( --wp--preset--color--vivid-cyan-blue, #0073aa );
	text-decoration: none;
	font-weight: 500;
}

.igcr-sync-now-link:hover {
	text-decoration: underline;
}

/* 5. Post grid */
.igcr-posts-grid {
	display: grid;
	margin-bottom: 8px;
}

.igcr-posts-grid--2col {
	grid-template-columns: repeat( 2, 1fr );
	gap: 16px;
}

.igcr-posts-grid--3col {
	grid-template-columns: repeat( 3, 1fr );
	gap: 12px;
}

.igcr-posts-grid--4col {
	grid-template-columns: repeat( 4, 1fr );
	gap: 8px;
}

.igcr-posts-grid--5col {
	grid-template-columns: repeat( 5, 1fr );
	gap: 4px;
}

.igcr-posts-grid--6col {
	grid-template-columns: repeat( 6, 1fr );
	gap: 3px;
}

/* 5/6-col: thumbnails only — hide text below images */
.igcr-posts-grid--5col .igcr-post-caption,
.igcr-posts-grid--5col .igcr-post-time,
.igcr-posts-grid--6col .igcr-post-caption,
.igcr-posts-grid--6col .igcr-post-time {
	display: none;
}

@media ( max-width: 640px ) {
	.igcr-posts-grid--2col {
		grid-template-columns: repeat( 2, 1fr );
	}

	.igcr-posts-grid--3col {
		grid-template-columns: repeat( 2, 1fr );
	}

	.igcr-posts-grid--4col,
	.igcr-posts-grid--5col {
		grid-template-columns: repeat( 3, 1fr );
	}

	.igcr-posts-grid--6col {
		grid-template-columns: repeat( 3, 1fr );
	}
}

@media ( max-width: 400px ) {
	.igcr-posts-grid--2col,
	.igcr-posts-grid--3col,
	.igcr-posts-grid--4col,
	.igcr-posts-grid--5col,
	.igcr-posts-grid--6col {
		grid-template-columns: repeat( 2, 1fr );
	}
}

.igcr-post-card {
	background: #fff;
	overflow: hidden;
	transition: box-shadow 0.15s;
}

.igcr-posts-grid--3col .igcr-post-card {
	border: 1px solid #eee;
	border-radius: 10px;
}

.igcr-posts-grid--6col .igcr-post-card {
	border-radius: 2px;
}

.igcr-post-card:hover {
	box-shadow: 0 3px 12px rgba( 0, 0, 0, 0.08 );
}

.igcr-post-thumb-wrap {
	display: block;
	position: relative;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: #f0f0f0;
}

.igcr-post-thumb-wrap img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.2s;
}

.igcr-post-card:hover .igcr-post-thumb-wrap img {
	transform: scale( 1.04 );
}

.igcr-post-thumb-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: #bbb;
}

.igcr-post-card-body {
	padding: 0;
}

.igcr-post-type-badge {
	position: absolute;
	top: 6px;
	right: 6px;
	font-size: 9px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	padding: 2px 5px;
	border-radius: 3px;
	background: rgba( 0, 0, 0, 0.55 );
	color: #fff;
}

.igcr-post-caption {
	padding: 8px 10px 3px;
	font-size: 0.8em;
	line-height: 1.4;
	color: #444;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.igcr-post-time {
	display: block;
	padding: 3px 10px 9px;
	font-size: 0.73em;
	color: #aaa;
}

.igcr-posts-empty {
	text-align: center;
	padding: 40px 20px;
	color: #aaa;
	font-size: 0.9em;
	border: 1px dashed #ddd;
	border-radius: 10px;
	margin-bottom: 8px;
}

/* 6. Danger zone + disconnect modal */
.igcr-profile-danger-zone {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	margin-top: 32px;
	padding-top: 20px;
	border-top: 1px solid #f0f0f0;
}

.igcr-back-link {
	font-size: 0.85em;
	opacity: 0.6;
	text-decoration: none;
}

.igcr-back-link:hover,
.igcr-back-link:focus {
	opacity: 1;
	text-decoration: underline;
}

.igcr-disconnect-trigger {
	color: #c0392b !important;
	border-color: #e8b0ab !important;
	background: #fff5f5 !important;
}

.igcr-disconnect-trigger:hover,
.igcr-disconnect-trigger:focus {
	background: #fde8e8 !important;
	border-color: #c0392b !important;
}

/* Disconnect modal */
.igcr-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.igcr-modal[ hidden ] {
	display: none;
}

.igcr-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba( 0, 0, 0, 0.5 );
	cursor: pointer;
}

.igcr-modal-box {
	position: relative;
	background: #fff;
	border-radius: 12px;
	padding: 28px 28px 22px;
	max-width: 420px;
	width: 100%;
	box-shadow: 0 12px 48px rgba( 0, 0, 0, 0.2 );
}

.igcr-modal-title {
	margin: 0 0 10px;
	font-size: 1.1em;
	color: #c0392b;
}

.igcr-modal-body {
	font-size: 0.9em;
	color: #555;
	margin: 0 0 10px;
	line-height: 1.5;
}

.igcr-modal-list {
	margin: 0 0 20px;
	padding-left: 18px;
	font-size: 0.875em;
	color: #666;
	line-height: 1.7;
}

.igcr-modal-footer {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 10px;
}

.igcr-disconnect-confirm {
	background: #c0392b !important;
	border-color: #c0392b !important;
	color: #fff !important;
}

.igcr-disconnect-confirm:hover,
.igcr-disconnect-confirm:focus {
	background: #a93226 !important;
	border-color: #a93226 !important;
}

/* ── Single igcr_post (/p/{shortcode}/) ── */

.igcr-single-wrap {
	max-width: 960px;
	margin: 0 auto;
	padding: 24px 16px 60px;
}

.igcr-single-back {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 0.85em;
	opacity: 0.6;
	text-decoration: none;
	margin-bottom: 20px;
}

.igcr-single-back:hover {
	opacity: 1;
	text-decoration: underline;
}

/* Two-column: media left | content right */
.igcr-single-post {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 32px;
	align-items: start;
}

@media ( max-width: 680px ) {
	.igcr-single-post {
		grid-template-columns: 1fr;
	}
}

/* ── Media column ── */
.igcr-single-media {
	position: sticky;
	top: 24px;
}

.igcr-media-image,
.igcr-media-video--single {
	width: 100%;
	border-radius: 12px;
	display: block;
	background: #f0f0f0;
}

.igcr-media-image {
	aspect-ratio: 1 / 1;
	object-fit: cover;
}

.igcr-media-video--single {
	aspect-ratio: 1 / 1;
}

/* ── Carousel ── */
.igcr-carousel {
	position: relative;
	border-radius: 12px;
	overflow: hidden;
	background: #111;
	aspect-ratio: 1 / 1;
}

.igcr-carousel-track {
	position: relative;
	width: 100%;
	height: 100%;
}

.igcr-carousel-slide {
	display: none !important;
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.igcr-carousel-slide.is-active {
	display: flex !important;
	align-items: center;
	justify-content: center;
}

.igcr-carousel-slide img,
.igcr-carousel-slide .igcr-media-video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.igcr-carousel-btn {
	position: absolute;
	top: 50%;
	transform: translateY( -50% );
	background: rgba( 0, 0, 0, 0.45 );
	border: none;
	border-radius: 50%;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: #fff;
	z-index: 10;
	transition: background 0.15s;
}

.igcr-carousel-btn:hover {
	background: rgba( 0, 0, 0, 0.7 );
}

.igcr-carousel-prev { left: 10px; }
.igcr-carousel-next { right: 10px; }

.igcr-carousel-dots {
	position: absolute;
	bottom: 10px;
	left: 50%;
	transform: translateX( -50% );
	display: flex;
	gap: 5px;
	z-index: 10;
}

.igcr-carousel-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	border: none;
	background: rgba( 255, 255, 255, 0.5 );
	cursor: pointer;
	padding: 0;
	transition: background 0.15s, transform 0.15s;
}

.igcr-carousel-dot.is-active {
	background: #fff;
	transform: scale( 1.3 );
}

/* ── Content column (WP: entry-* + igcr fallback) ── */
.igcr-single-content {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

/* Entry header */
.entry-header.igcr-entry-header,
.igcr-entry-header {
	margin: 0;
}

.entry-content.igcr-entry-content,
.igcr-entry-content {
	margin: 0;
}

.igcr-single-meta-row {
	display: flex;
	align-items: center;
	gap: 10px;
}

.igcr-single-avatar {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
}

.igcr-single-identity {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.igcr-single-username {
	display: block;
	font-size: 0.95em;
	font-weight: 700;
}

.igcr-single-date {
	display: block;
	font-size: 0.78em;
	color: #999;
}

.igcr-view-on-ig {
	margin-left: auto;
	color: #888;
	text-decoration: none;
	flex-shrink: 0;
}

.igcr-view-on-ig:hover {
	color: #333;
}

.igcr-single-caption {
	font-size: 0.9em;
	line-height: 1.65;
	color: #333;
	white-space: pre-line;
	margin: 0;
}

/* ── Comments area (WP: comments-area / comment-* + igcr fallback) ── */

.comments-area.igcr-comments-section,
.igcr-comments-section {
	border-top: 1px solid #f0f0f0;
	padding-top: 16px;
}

.comments-title.igcr-comments-title,
.igcr-comments-title {
	font-size: 0.9em;
	font-weight: 700;
	color: #555;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	margin: 0 0 14px;
}

/* Comment lists */
.comment-list.igcr-comment-list,
.igcr-comment-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.children.igcr-reply-list,
.igcr-reply-list {
	list-style: none;
	margin-top: 8px;
	padding-left: 20px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* Comment <li> */
.comment.igcr-comment,
.igcr-comment {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

/* Our comments (account's own) — right-aligned bubble */
.igcr-comment--ours,
.igcr-comment.bypostauthor {
	align-items: flex-end;
}

/* comment-body = bubble container */
.comment-body.igcr-comment-body,
.igcr-comment-bubble {
	max-width: 85%;
	background: #f4f4f4;
	border-radius: 16px 16px 16px 4px;
	padding: 8px 12px;
	font-size: 0.875em;
}

.igcr-comment--ours .comment-body.igcr-comment-body,
.igcr-comment--ours .igcr-comment-bubble {
	background: #e8f4fd;
	border-radius: 16px 16px 4px 16px;
}

/* Author */
.comment-author.igcr-comment-author {
	margin-bottom: 3px;
}

.comment-author .fn.igcr-comment-author-name,
.igcr-comment-author {
	display: block;
	font-weight: 700;
	font-size: 0.8em;
	color: #888;
	font-style: normal;
}

/* Timestamp */
.comment-metadata.igcr-comment-time,
.igcr-comment-time {
	display: block;
	font-size: 0.72em;
	color: #bbb;
	margin-top: 4px;
}

/* Content */
.comment-content.igcr-comment-content,
.igcr-comment-content {
	margin: 0;
}

.igcr-comment-text {
	margin: 0;
	line-height: 1.5;
}

/* Reply button */
.reply.igcr-comment-reply {
	margin-top: 4px;
}

.comment-reply-link.igcr-reply-toggle,
.igcr-reply-toggle {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 0.75em;
	color: var( --wp--preset--color--vivid-cyan-blue, #0073aa );
	padding: 3px 0 0;
	display: block;
	text-decoration: none;
}

.comment-reply-link.igcr-reply-toggle:hover,
.igcr-reply-toggle:hover {
	text-decoration: underline;
}

/* Empty state */
.no-comments.igcr-comments-empty,
.igcr-comments-empty {
	font-size: 0.85em;
	color: #aaa;
	text-align: center;
	padding: 20px 0;
}

/* ── Comment form (WP: comment-respond / comment-form + igcr fallback) ── */

.comment-respond.igcr-comment-respond,
.igcr-comment-respond {
	margin-top: 4px;
}

.comment-reply-title.igcr-reply-title,
.igcr-reply-title {
	font-size: 0.85em;
	font-weight: 600;
	color: #555;
	margin: 0 0 10px;
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}

.igcr-reply-context {
	background: #e8f4fd;
	border-radius: 4px;
	padding: 1px 8px;
	color: #1a6fa8;
	font-size: 0.85em;
}

.comment-form.igcr-comment-form,
.igcr-comment-form {
	margin: 0;
}

.comment-form-comment.igcr-comment-form-field,
.igcr-comment-form-field {
	margin: 0 0 8px;
}

.igcr-comment-textarea {
	width: 100%;
	resize: vertical;
	border: 1px solid #ddd;
	border-radius: 10px;
	padding: 8px 12px;
	font-size: 0.875em;
	font-family: inherit;
	line-height: 1.5;
	min-height: 60px;
	transition: border-color 0.15s;
	box-sizing: border-box;
}

.igcr-comment-textarea:focus {
	outline: none;
	border-color: #0073aa;
}

.form-submit.igcr-form-submit,
.igcr-form-submit {
	margin: 0;
}

.submit.igcr-comment-submit,
.igcr-comment-submit {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: linear-gradient( 45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888 );
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	transition: opacity 0.15s;
	padding: 0;
}

.submit.igcr-comment-submit:hover,
.igcr-comment-submit:hover {
	opacity: 0.85;
}

.submit.igcr-comment-submit:disabled,
.igcr-comment-submit:disabled {
	opacity: 0.5;
	cursor: default;
}

.igcr-comment-status {
	font-size: 0.8em;
	margin: 6px 0 0;
	min-height: 1.2em;
}

.igcr-comment-status--error {
	color: #c0392b;
}

/* Reconnect button on profile page */
.igcr-reconnect-btn {
	font-size: 0.8em !important;
}

/* ── Sync active badge ── */
.igcr-sync-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.82em;
	font-weight: 600;
	color: #1a6fa8;
}

.igcr-sync-badge--active {
	color: #1a6fa8;
}

.igcr-sync-spinner {
	display: inline-block;
	width: 12px;
	height: 12px;
	border: 2px solid rgba( 26, 111, 168, 0.25 );
	border-top-color: #1a6fa8;
	border-radius: 50%;
	animation: igcr-spin 0.7s linear infinite;
	flex-shrink: 0;
}

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

/* ─── Create Post ──────────────────────────────────────────────────────────── */

.igcr-create-post-section {
	margin-bottom: 20px;
}

.igcr-create-post-toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	border: 1px dashed #ccc;
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
	font-size: 0.88em;
	font-weight: 600;
	color: #555;
	transition: border-color 0.15s, color 0.15s;
}

.igcr-create-post-toggle:hover {
	border-color: #999;
	color: #111;
}

.igcr-create-post-toggle[aria-expanded="true"] {
	border-style: solid;
	border-color: #0073aa;
	color: #0073aa;
}

.igcr-create-post-form-wrap[hidden] {
	display: none;
}

/* Post type tabs */
.igcr-create-post-tabs {
	display: flex;
	gap: 0;
	margin-top: 12px;
	border-bottom: 2px solid var(--igcr-border);
}

.igcr-create-post-tab {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 8px 14px;
	border: none;
	background: none;
	cursor: pointer;
	font-size: 0.82em;
	font-weight: 600;
	color: #888;
	border-bottom: 2px solid transparent;
	margin-bottom: -2px;
	transition: color 0.15s, border-color 0.15s;
}

.igcr-create-post-tab:hover {
	color: #444;
}

.igcr-create-post-tab.is-active {
	color: #0073aa;
	border-bottom-color: #0073aa;
}

.igcr-create-post-form {
	border: 1px solid var(--igcr-border);
	border-top: none;
	border-radius: 0 0 12px 12px;
	padding: 16px;
	background: #fafafa;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.igcr-create-post-preview {
	position: relative;
}

.igcr-create-post-dropzone {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	aspect-ratio: 1 / 1;
	max-height: 300px;
	border: 2px dashed #d0d0d0;
	border-radius: 10px;
	background: #f5f5f5;
	cursor: pointer;
	color: #aaa;
	transition: border-color 0.15s, color 0.15s;
}

.igcr-create-post-dropzone[hidden] {
	display: none;
}

.igcr-create-post-dropzone:hover,
.igcr-create-post-dropzone:focus-within {
	border-color: #0073aa;
	color: #0073aa;
}

.igcr-dropzone-text {
	font-size: 0.85em;
	font-weight: 500;
}

.igcr-dropzone-icon[hidden] {
	display: none;
}

.igcr-create-post-img {
	width: 100%;
	aspect-ratio: 1 / 1;
	max-height: 300px;
	object-fit: cover;
	border-radius: 10px;
	display: block;
}

.igcr-create-post-img[hidden] {
	display: none;
}

/* Video preview */
.igcr-create-post-video {
	width: 100%;
	max-height: 300px;
	border-radius: 10px;
	display: block;
	background: #000;
}

.igcr-create-post-video[hidden] {
	display: none;
}

.igcr-create-post-clear {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: none;
	background: rgba( 0, 0, 0, 0.55 );
	color: #fff;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.igcr-create-post-clear[hidden] {
	display: none;
}

.igcr-create-post-clear:hover {
	background: rgba( 0, 0, 0, 0.75 );
}

/* Carousel thumbnail strip */
.igcr-create-post-thumbs {
	display: flex;
	gap: 6px;
	overflow-x: auto;
	padding: 4px 0;
}

.igcr-create-post-thumbs[hidden] {
	display: none;
}

.igcr-create-post-thumb {
	position: relative;
	flex-shrink: 0;
	width: 64px;
	height: 64px;
}

.igcr-create-post-thumb img {
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: 6px;
	display: block;
	border: 2px solid var(--igcr-border);
}

.igcr-create-post-thumb-remove {
	position: absolute;
	top: -4px;
	right: -4px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	border: none;
	background: rgba( 0, 0, 0, 0.6 );
	color: #fff;
	font-size: 12px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.igcr-create-post-thumb-hint {
	font-size: 0.75em;
	color: #999;
	margin: 0;
}

.igcr-create-post-thumb-hint[hidden] {
	display: none;
}

.igcr-create-post-caption {
	width: 100%;
	resize: vertical;
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 10px 12px;
	font-size: 0.88em;
	font-family: inherit;
	line-height: 1.5;
	min-height: 60px;
	box-sizing: border-box;
	transition: border-color 0.15s;
}

.igcr-create-post-caption[hidden] {
	display: none;
}

.igcr-create-post-caption:focus {
	outline: none;
	border-color: #0073aa;
}

.igcr-create-post-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.igcr-create-post-charcount {
	font-size: 0.75em;
	color: #aaa;
}

.igcr-create-post-submit {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 9px 18px;
	border: none;
	border-radius: 8px;
	background: linear-gradient( 135deg, #dc2743 0%, #bc1888 100% );
	color: #fff;
	font-size: 0.88em;
	font-weight: 600;
	cursor: pointer;
	transition: opacity 0.15s;
}

.igcr-create-post-submit:hover:not(:disabled) {
	opacity: 0.88;
}

.igcr-create-post-submit:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.igcr-create-post-status {
	font-size: 0.82em;
	margin: 0;
	min-height: 1.2em;
}

.igcr-create-post-status--error {
	color: #c0392b;
}

.igcr-create-post-status--success {
	color: var(--igcr-success-hover);
}

/* ─── Sync overlay ─────────────────────────────────────────────────────────── */

.igcr-sync-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba( 0, 0, 0, 0.45 );
	backdrop-filter: blur( 2px );
}

.igcr-sync-overlay[hidden] {
	display: none;
}

.igcr-sync-overlay-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	padding: 32px 48px;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 8px 32px rgba( 0, 0, 0, 0.18 );
}

.igcr-sync-overlay-spinner {
	display: block;
	width: 36px;
	height: 36px;
	border: 3px solid rgba( 26, 111, 168, 0.2 );
	border-top-color: #1a6fa8;
	border-radius: 50%;
	animation: igcr-spin 0.7s linear infinite;
}

.igcr-sync-overlay-text {
	margin: 0;
	font-size: 15px;
	font-weight: 500;
	color: #333;
}

/* ─── Onboarding block ─────────────────────────────────────────────────────── */

.igcr-onboard-wrap {
	box-sizing: border-box;
	width: 100%;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Hero / connect state */
.igcr-onboard-hero {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 48px 24px;
	max-width: 520px;
	margin: 0 auto;
}

.igcr-onboard-icon {
	margin-bottom: 20px;
}

.igcr-onboard-icon--sm {
	font-size: 40px;
	margin-bottom: 12px;
}

.igcr-onboard-success-icon {
	font-size: 52px;
	margin-bottom: 12px;
}

.igcr-onboard-headline {
	font-size: 28px;
	font-weight: 700;
	line-height: 1.25;
	margin: 0 0 12px;
	color: #111;
}

.igcr-onboard-headline--sm {
	font-size: 22px;
}

.igcr-onboard-subhead {
	font-size: 15px;
	color: #555;
	line-height: 1.6;
	margin: 0 0 28px;
	max-width: 420px;
}

.igcr-onboard-subhead--sm {
	margin-bottom: 20px;
}

/* Primary CTA button */
.igcr-onboard-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 24px;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: opacity 0.15s, transform 0.1s;
	border: none;
	line-height: 1;
}

.igcr-onboard-btn:hover:not(:disabled) {
	opacity: 0.88;
	transform: translateY( -1px );
}

.igcr-onboard-btn:active:not(:disabled) {
	transform: translateY( 0 );
}

.igcr-onboard-btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.igcr-onboard-btn--primary {
	background: linear-gradient( 135deg, #dc2743 0%, #bc1888 100% );
	color: #fff;
}

.igcr-onboard-btn--secondary {
	background: #111;
	color: #fff;
}

.igcr-onboard-btn--ghost {
	background: transparent;
	color: #555;
	border: 1px solid #ddd;
}

/* Benefit checklist */
.igcr-onboard-checklist {
	list-style: none;
	padding: 0;
	margin: 20px 0 16px;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px 20px;
	font-size: 13px;
	color: #555;
}

.igcr-onboard-checklist li::before {
	content: "✓ ";
	color: var(--igcr-success);
	font-weight: 700;
}

/* Legal text */
.igcr-onboard-legal {
	font-size: 12px;
	color: #888;
	margin: 0;
}

.igcr-onboard-legal a {
	color: #555;
}

/* Notice / error banner */
.igcr-onboard-notice {
	border-radius: 6px;
	padding: 10px 14px;
	font-size: 14px;
	margin: 0 0 20px;
	text-align: center;
}

.igcr-onboard-notice--error {
	background: #fef2f2;
	color: #b91c1c;
	border: 1px solid #fecaca;
}

/* Configure state */
.igcr-onboard-configure {
	max-width: 520px;
	margin: 0 auto;
	padding: 40px 24px;
}

/* Account chip */
.igcr-onboard-account-chip {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	background: #f4f4f5;
	border: 1px solid #e4e4e7;
	border-radius: 50px;
	padding: 6px 14px 6px 6px;
	margin-bottom: 28px;
}

.igcr-onboard-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
	flex-shrink: 0;
}

.igcr-onboard-avatar--placeholder {
	background: linear-gradient( 135deg, #dc2743 0%, #bc1888 100% );
	color: #fff;
	font-weight: 700;
	font-size: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.igcr-onboard-account-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.igcr-onboard-username {
	font-size: 14px;
	color: #111;
}

.igcr-onboard-connected {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 12px;
	color: var(--igcr-success-hover);
}

/* Subdomain form */
.igcr-onboard-form {
	margin-top: 4px;
}

.igcr-onboard-subdomain-label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: #333;
	margin-bottom: 8px;
}

.igcr-onboard-subdomain-row {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-wrap: nowrap;
	margin-bottom: 6px;
}

.igcr-onboard-subdomain-input {
	flex: 1 1 auto;
	min-width: 0;
	padding: 10px 12px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 15px;
	font-family: inherit;
	color: #111;
	outline: none;
	transition: border-color 0.15s;
}

.igcr-onboard-subdomain-input:focus {
	border-color: #bc1888;
	box-shadow: 0 0 0 3px rgba( 188, 24, 136, 0.12 );
}

.igcr-onboard-domain-suffix {
	flex-shrink: 0;
	font-size: 14px;
	color: #666;
	white-space: nowrap;
}

.igcr-onboard-status {
	flex-shrink: 0;
	font-size: 13px;
	font-weight: 600;
	min-width: 90px;
	text-align: left;
}

.igcr-onboard-status--ok      { color: var(--igcr-success-hover); }
.igcr-onboard-status--error   { color: #b91c1c; }
.igcr-onboard-status--checking { color: #888; }

.igcr-onboard-subdomain-hint {
	font-size: 12px;
	color: #888;
	margin: 0 0 20px;
}

.igcr-onboard-form .igcr-onboard-btn {
	width: 100%;
	justify-content: center;
	padding: 14px;
	font-size: 16px;
}

.igcr-onboard-skip {
	text-align: center;
	margin-top: 16px;
	font-size: 13px;
}

.igcr-onboard-skip a {
	color: #888;
	text-decoration: none;
}

.igcr-onboard-skip a:hover {
	color: #444;
	text-decoration: underline;
}

/* Skipped / Done card states */
.igcr-onboard-card {
	max-width: 480px;
	margin: 0 auto;
	padding: 48px 32px;
	text-align: center;
	border: 1px solid #e4e4e7;
	border-radius: 16px;
	background: #fafafa;
}

.igcr-onboard-card--done {
	background: linear-gradient( 160deg, #fff 60%, #fdf2fb 100% );
	border-color: #f3c6f1;
}

.igcr-onboard-site-domain {
	display: inline-block;
	background: #f4f4f5;
	border: 1px solid #e4e4e7;
	border-radius: 6px;
	padding: 4px 12px;
	font-size: 14px;
	font-family: monospace;
	color: #555;
	margin: 0 0 16px;
}

.igcr-onboard-done-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 24px;
	align-items: center;
}

/* Responsive */
@media ( max-width: 480px ) {
	.igcr-onboard-hero        { padding: 32px 16px; }
	.igcr-onboard-configure   { padding: 24px 16px; }
	.igcr-onboard-card        { padding: 32px 20px; }
	.igcr-onboard-headline    { font-size: 22px; }
	.igcr-onboard-headline--sm { font-size: 19px; }
	.igcr-onboard-subdomain-row { flex-wrap: wrap; }
	.igcr-onboard-domain-suffix,
	.igcr-onboard-status      { flex: 1 0 100%; order: 1; }
	.igcr-onboard-done-actions .igcr-onboard-btn { width: 100%; justify-content: center; }
}

/* ─── DM Inbox (/messages/) ───────────────────────────────────────────────── */

.igcr-messages-wrap {
	max-width: 900px;
	margin: 0 auto;
	padding: 24px 16px 60px;
	min-height: 60vh;
	position: relative;
}

/* ── Header ── */
.igcr-dm-header {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px 12px;
	margin-bottom: 16px;
}

.igcr-dm-title {
	font-size: 1.4em;
	font-weight: 700;
	margin: 0;
}

.igcr-dm-header-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-left: auto;
}

.igcr-dm-account-picker {
	font-size: 0.85em;
	padding: 6px 10px;
	border: 1px solid #ddd;
	border-radius: 6px;
	background: #fff;
}

.igcr-dm-sync-btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 6px 12px;
	font-size: 0.8em;
	font-weight: 600;
	color: #555;
	background: #f5f5f5;
	border: 1px solid #ddd;
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.2s, color 0.2s;
}

.igcr-dm-sync-btn:hover {
	background: #eee;
	color: #333;
}

.igcr-dm-sync-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.igcr-dm-sync-btn.is-syncing .igcr-dm-sync-icon {
	animation: igcr-spin 1s linear infinite;
}

@keyframes igcr-spin {
	from { transform: rotate(0deg); }
	to   { transform: rotate(360deg); }
}

/* ── Auth notice (non-admin) ── */
.igcr-dm-auth-notice {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
	padding: 48px 24px;
	text-align: center;
	color: #666;
	background: #fafafa;
	border: 1px solid #eee;
	border-radius: 12px;
	margin: 24px 0;
}

.igcr-dm-auth-notice svg {
	color: #ccc;
}

.igcr-dm-auth-notice p {
	margin: 0;
	font-size: 1em;
	max-width: 320px;
}

/* ── Loading state ── */
.igcr-dm-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 40px 20px;
	color: #999;
	font-size: 0.9em;
}

/* ── Thread list ── */
.igcr-dm-threads-panel[hidden] {
	display: none;
}

.igcr-dm-threads {
	display: flex;
	flex-direction: column;
}

.igcr-dm-thread {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	border-bottom: 1px solid #f0f0f0;
	cursor: pointer;
	transition: background 0.12s;
	text-decoration: none;
	color: inherit;
}

.igcr-dm-thread:hover {
	background: #f8f8f8;
}

.igcr-dm-thread--active {
	background: #f0f5ff;
}

.igcr-dm-thread-avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: linear-gradient( 135deg, #dc2743 0%, #bc1888 100% );
	color: #fff;
	font-weight: 700;
	font-size: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	text-transform: uppercase;
}

.igcr-dm-thread-info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.igcr-dm-thread-name {
	font-weight: 600;
	font-size: 0.9em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.igcr-dm-thread-preview {
	font-size: 0.82em;
	color: #888;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin: 0;
}

.igcr-dm-thread-preview--outbound::before {
	content: "You: ";
	color: #aaa;
}

.igcr-dm-thread-meta {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 4px;
	flex-shrink: 0;
}

.igcr-dm-thread-time {
	font-size: 0.72em;
	color: #bbb;
	white-space: nowrap;
}

.igcr-dm-thread-count {
	font-size: 0.7em;
	color: #999;
	background: #f0f0f0;
	padding: 1px 6px;
	border-radius: 10px;
}

.igcr-dm-empty {
	text-align: center;
	padding: 60px 20px;
	color: #aaa;
	font-size: 0.9em;
}

/* ── Conversation panel ── */
.igcr-dm-conversation-panel {
	display: flex;
	flex-direction: column;
	height: 70vh;
	min-height: 400px;
}

.igcr-dm-conversation-panel[hidden] {
	display: none;
}

.igcr-dm-conv-header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 0;
	border-bottom: 1px solid #eee;
	margin-bottom: 0;
}

.igcr-dm-back {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	cursor: pointer;
	color: #555;
	padding: 4px;
	border-radius: 6px;
	transition: background 0.12s;
}

.igcr-dm-back:hover {
	background: #f0f0f0;
	color: #111;
}

.igcr-dm-conv-identity {
	display: flex;
	align-items: center;
	gap: 8px;
}

.igcr-dm-conv-avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: linear-gradient( 135deg, #dc2743 0%, #bc1888 100% );
	color: #fff;
	font-weight: 700;
	font-size: 13px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	text-transform: uppercase;
}

.igcr-dm-conv-name {
	font-size: 0.95em;
	font-weight: 600;
}

/* ── Messages area ── */
.igcr-dm-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.igcr-dm-msg {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	max-width: 75%;
}

.igcr-dm-msg--outbound {
	align-self: flex-end;
	align-items: flex-end;
}

.igcr-dm-msg-bubble {
	padding: 8px 14px;
	border-radius: 18px 18px 18px 4px;
	background: #f0f0f0;
	font-size: 0.9em;
	line-height: 1.45;
	word-break: break-word;
}

.igcr-dm-msg--outbound .igcr-dm-msg-bubble {
	background: linear-gradient( 135deg, #dc2743 0%, #bc1888 100% );
	color: #fff;
	border-radius: 18px 18px 4px 18px;
}

.igcr-dm-msg-time {
	font-size: 0.68em;
	color: #bbb;
	margin-top: 2px;
	padding: 0 4px;
}

.igcr-dm-msg-date-sep {
	text-align: center;
	font-size: 0.75em;
	color: #aaa;
	padding: 12px 0 6px;
	font-weight: 600;
}

/* ── Reply form ── */
.igcr-dm-reply-form {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 0 0;
	border-top: 1px solid #eee;
}

.igcr-dm-reply-input {
	flex: 1;
	padding: 10px 14px;
	border: 1px solid #ddd;
	border-radius: 24px;
	font-size: 0.9em;
	font-family: inherit;
	outline: none;
	transition: border-color 0.15s;
}

.igcr-dm-reply-input:focus {
	border-color: #bc1888;
}

.igcr-dm-reply-send {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: none;
	background: linear-gradient( 135deg, #dc2743 0%, #bc1888 100% );
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity 0.15s;
	flex-shrink: 0;
	padding: 0;
}

.igcr-dm-reply-send:hover:not(:disabled) {
	opacity: 0.85;
}

.igcr-dm-reply-send:disabled {
	opacity: 0.4;
	cursor: default;
}

/* ── Responsive: side-by-side on wide screens ── */
@media ( min-width: 768px ) {
	.igcr-messages-wrap {
		display: grid;
		grid-template-columns: 320px 1fr;
		gap: 0;
		max-width: 1000px;
		border: 1px solid var(--igcr-border);
		border-radius: 14px;
		overflow: hidden;
		padding: 0;
		margin-top: 32px;
		margin-bottom: 60px;
		min-height: 70vh;
	}

	.igcr-dm-header {
		padding: 16px;
		border-bottom: 1px solid #eee;
		margin-bottom: 0;
	}

	.igcr-dm-threads-panel {
		border-right: 1px solid var(--igcr-border);
		display: flex;
		flex-direction: column;
	}

	/* Always show threads panel on desktop */
	.igcr-dm-threads-panel[hidden] {
		display: flex;
	}

	.igcr-dm-threads {
		flex: 1;
		overflow-y: auto;
	}

	.igcr-dm-conversation-panel {
		height: auto;
		min-height: 0;
	}

	/* Show conversation panel as empty state when hidden on desktop */
	.igcr-dm-conversation-panel[hidden] {
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.igcr-dm-conversation-panel[hidden]::after {
		content: "Select a conversation";
		color: #ccc;
		font-size: 0.95em;
	}

	.igcr-dm-conversation-panel[hidden] > * {
		display: none;
	}

	.igcr-dm-conv-header {
		padding: 12px 16px;
		margin: 0;
	}

	.igcr-dm-back {
		display: none;
	}

	.igcr-dm-messages {
		padding: 16px;
	}

	.igcr-dm-reply-form {
		padding: 12px 16px;
		border-top: 1px solid #eee;
	}
}

/* ═══════════════════════════════════════════════════════════════════════════
   AUTOMATION SETTINGS (slot-based cards)
   ═══════════════════════════════════════════════════════════════════════════ */

.igcr-auto-wrap {
	max-width: 720px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.igcr-auto-header {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 24px;
}

.igcr-auto-account-picker {
	font-size: 0.85em;
	padding: 6px 10px;
	border: 1px solid #ddd;
	border-radius: 6px;
	background: #fff;
	margin-left: auto;
}

.igcr-auto-title {
	margin: 0;
	font-size: 22px;
	font-weight: 700;
}

/* ── Card ───────────────────────────────────────────────────────────────── */

.igcr-auto-card {
	background: #fff;
	border: 1px solid var(--igcr-border);
	border-radius: 12px;
	margin-bottom: 12px;
	transition: box-shadow 0.15s;
}

.igcr-auto-card:hover {
	box-shadow: 0 2px 12px rgba( 0, 0, 0, 0.05 );
}

.igcr-auto-card--active {
	border-left: 3px solid var(--igcr-success, #22c55e);
}

.igcr-auto-card-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	gap: 12px;
}

.igcr-auto-card-info {
	flex: 1;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.igcr-auto-card-title {
	font-size: 15px;
	font-weight: 600;
}

.igcr-auto-card-desc {
	font-size: 13px;
	color: var(--igcr-text-secondary);
}

.igcr-auto-card-runs {
	font-size: 12px;
	color: var(--igcr-text-muted);
}

/* ── Toggle switch ─────────────────────────────────────────────────────── */

.igcr-auto-toggle {
	position: relative;
	display: inline-block;
	width: 44px;
	height: 24px;
	flex-shrink: 0;
}

.igcr-auto-toggle input {
	opacity: 0;
	width: 0;
	height: 0;
}

.igcr-auto-toggle-slider {
	position: absolute;
	inset: 0;
	background: #d1d5db;
	border-radius: 24px;
	cursor: pointer;
	transition: background 0.2s;
}

.igcr-auto-toggle-slider::before {
	content: '';
	position: absolute;
	left: 3px;
	top: 3px;
	width: 18px;
	height: 18px;
	background: #fff;
	border-radius: 50%;
	transition: transform 0.2s;
	box-shadow: 0 1px 3px rgba( 0, 0, 0, 0.15 );
}

.igcr-auto-toggle input:checked + .igcr-auto-toggle-slider {
	background: var(--igcr-success, #22c55e);
}

.igcr-auto-toggle input:checked + .igcr-auto-toggle-slider::before {
	transform: translateX( 20px );
}

/* ── Card body (expanded config) ───────────────────────────────────────── */

.igcr-auto-card-body {
	padding: 0 16px 16px;
	border-top: 1px solid var(--igcr-bg-muted, #f3f4f6);
}

.igcr-auto-card--open .igcr-auto-card-body {
	padding-top: 16px;
}

/* ── Form fields ───────────────────────────────────────────────────────── */

.igcr-auto-field {
	margin-bottom: 14px;
}

.igcr-auto-field:last-child {
	margin-bottom: 0;
}

.igcr-auto-field label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--igcr-text-secondary);
	margin-bottom: 4px;
}

.igcr-auto-field label small {
	font-weight: 400;
	color: var(--igcr-text-muted);
}

.igcr-auto-field input[type="text"],
.igcr-auto-field textarea,
.igcr-auto-field select {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid var(--igcr-border);
	border-radius: 6px;
	font-size: 13px;
	font-family: inherit;
	outline: none;
	transition: border-color 0.15s;
	box-sizing: border-box;
}

.igcr-auto-field input[type="text"]:focus,
.igcr-auto-field textarea:focus,
.igcr-auto-field select:focus {
	border-color: var(--igcr-accent);
}

.igcr-auto-field textarea {
	resize: vertical;
	min-height: 60px;
}

.igcr-auto-field--checkbox label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: 400;
	cursor: pointer;
}

.igcr-auto-field--checkbox input[type="checkbox"] {
	accent-color: var(--igcr-accent);
	width: 16px;
	height: 16px;
}

/* ── Delete keyword rule button ────────────────────────────────────────── */

.igcr-auto-delete-kw {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 12px;
	padding: 6px 14px;
	border: 1px solid #fecaca;
	border-radius: 6px;
	background: #fff;
	color: var(--igcr-danger, #ef4444);
	font-size: 13px;
	cursor: pointer;
	transition: background 0.15s;
}

.igcr-auto-delete-kw:hover {
	background: #fef2f2;
}

/* ── Keyword Rules section ─────────────────────────────────────────────── */

.igcr-auto-keywords-section {
	margin-top: 32px;
}

.igcr-auto-keywords-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
}

.igcr-auto-keywords-header h3 {
	margin: 0;
	font-size: 17px;
	font-weight: 700;
}

.igcr-auto-add-keyword {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	background: var(--igcr-accent);
	color: #fff;
	border: none;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s;
}

.igcr-auto-add-keyword:hover {
	background: var(--igcr-accent-hover);
}

/* ── Variables hint ────────────────────────────────────────────────────── */

.igcr-auto-vars-hint {
	margin-top: 24px;
	padding: 10px 14px;
	background: var(--igcr-bg-subtle, #f9fafb);
	border: 1px solid var(--igcr-border);
	border-radius: 8px;
	font-size: 12px;
	color: var(--igcr-text-muted);
}

/* ── Responsive ────────────────────────────────────────────────────────── */

@media ( max-width: 600px ) {
	.igcr-auto-wrap {
		padding: 0 12px;
	}

	.igcr-auto-keywords-header {
		flex-direction: column;
		gap: 12px;
		align-items: flex-start;
	}
}

/* ── SSE Real-Time UI ─────────────────────────────────────────────────── */

/* New-message indicator dot (appears next to DM title) */
.igcr-sse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--igcr-accent);
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
  animation: igcr-sse-pulse 1s ease-in-out infinite;
}

@keyframes igcr-sse-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Live comment highlight — fades in */
.igcr-comment--live {
  animation: igcr-sse-fadein 0.4s ease-out;
}

@keyframes igcr-sse-fadein {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Toast notification */
.igcr-sse-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  max-width: 360px;
  padding: 12px 20px;
  background: var(--igcr-surface, #fff);
  border: 1px solid var(--igcr-border, #e5e7eb);
  border-left: 4px solid var(--igcr-accent);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  font-size: 14px;
  line-height: 1.4;
  color: var(--igcr-text, #1f2937);
  animation: igcr-sse-slidein 0.3s ease-out;
}

.igcr-sse-toast--hide {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s, transform 0.3s;
}

@keyframes igcr-sse-slidein {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
