/**
 * AI Summaries & Share Buttons - Admin Styles
 *
 * Analytics dashboard, dashboard widget, and promo banner styles.
 * Design adapted from VigIA plugin patterns.
 *
 * @package AiShareSummarize
 * @since 1.5.0
 */

/* CSS Variables for brand colors */
:root {
	--aiss-brand: #7224D1;
	--aiss-brand-light: rgba(114, 36, 209, 0.1);
	--aiss-brand-hover: #5e1db0;
}

/* Main wrapper */
.aiss-wrap {
	max-width: 100%;
	margin: 20px 20px 20px 0;
	box-sizing: border-box;
}

/* Tab navigation */
.aiss-wrap .nav-tab-wrapper {
	margin-bottom: 25px;
}

.aiss-wrap .nav-tab-wrapper .nav-tab-active {
	border-bottom-color: #fff;
}

/* Page title icon (v1.7.0) */
.aiss-page-icon {
	font-size: 28px;
	width: 28px;
	height: 28px;
	color: var(--aiss-brand);
	vertical-align: middle;
	margin-right: 2px;
}

/* Date filter */
.aiss-date-filter {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 15px;
	margin-bottom: 25px;
	padding: 15px 20px;
	background: #fff;
	border: 1px solid #c3c4c7;
}

.aiss-date-filter-left {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
}

.aiss-date-filter-left label {
	font-weight: 600;
	color: #1d2327;
}

.aiss-date-filter-left select {
	min-width: 140px;
}

.aiss-custom-dates {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.aiss-date-separator {
	color: #646970;
}

/* Comparison controls (v1.7.0) */
.aiss-compare-label {
	display: flex;
	align-items: center;
	gap: 5px;
	margin-left: 15px;
	padding-left: 15px;
	border-left: 1px solid #c3c4c7;
	font-weight: normal !important;
}

.aiss-compare-label input[type="checkbox"] {
	margin: 0;
}

#aiss-compare-range:disabled {
	opacity: 0.5;
}

/* Export CSV button */
.aiss-date-filter-right {
	display: flex;
	align-items: center;
}

/* Export dropdown (v1.7.0) */
.aiss-export-dropdown {
	position: relative;
	display: inline-block;
}

/* Export button: inline-flex for icon + text alignment */
.aiss-export-btn {
	display: inline-flex !important;
	align-items: center !important;
	gap: 5px;
	line-height: 1 !important;
}

/* Specificity (0,3,0) to override WP core .button .dashicons defaults */
.aiss-export-dropdown .aiss-export-btn .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	line-height: 1;
	flex-shrink: 0;
	position: static;
	top: auto;
	vertical-align: middle;
}

.aiss-export-btn .dashicons-arrow-down-alt2 {
	margin-left: 2px;
}

.aiss-export-menu {
	display: none;
	position: absolute;
	top: 100%;
	right: 0;
	margin-top: 4px;
	min-width: 180px;
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
	z-index: 100;
}

.aiss-export-menu.open {
	display: block;
}

.aiss-export-option {
	display: block;
	width: 100%;
	padding: 10px 15px;
	border: none;
	background: none;
	text-align: left;
	cursor: pointer;
	font-size: 13px;
	color: #1d2327;
	transition: background-color 0.15s;
}

.aiss-export-option:hover:not(:disabled) {
	background-color: #f0f0f1;
}

.aiss-export-option:not(:last-child) {
	border-bottom: 1px solid #f0f0f1;
}

/* Stats grid */
.aiss-stats-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
	margin-bottom: 25px;
}

.aiss-stat-card {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 15px;
	padding: 20px;
	background: #fff;
	border: 1px solid #c3c4c7;
	transition: box-shadow 0.2s ease;
	box-sizing: border-box;
	min-width: 0;
}

.aiss-stat-card:hover {
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.aiss-stat-icon {
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	font-size: 40px;
	line-height: 1;
	color: var(--aiss-brand);
}

.aiss-stat-icon::before {
	display: block;
	width: 40px;
	height: 40px;
	line-height: 40px;
	text-align: center;
}

.aiss-stat-content {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	min-width: 0;
}

.aiss-stat-value {
	font-size: 32px;
	font-weight: 600;
	color: #1d2327;
	line-height: 1;
	margin-bottom: 4px;
}

.aiss-stat-label {
	font-size: 11px;
	color: #646970;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	line-height: 1.2;
}

/* Stat card comparison indicators (v1.7.0) */
.aiss-stat-compare {
	font-size: 12px;
	margin-top: 4px;
	display: none;
}

.aiss-stat-compare.positive {
	color: #00a32a;
	display: block;
}

.aiss-stat-compare.negative {
	color: #d63638;
	display: block;
}

.aiss-stat-compare.neutral {
	color: #646970;
	display: block;
}

/* Chart container */
.aiss-chart-container {
	background: #fff;
	border: 1px solid #c3c4c7;
	padding: 20px;
	box-sizing: border-box;
	min-width: 0;
	overflow: visible;
	margin-bottom: 25px;
}

.aiss-chart-container h3 {
	margin: 0 0 15px;
	font-size: 14px;
	font-weight: 600;
	color: #1d2327;
}

.aiss-chart-wrapper {
	position: relative;
	height: 300px;
	min-width: 0;
	overflow: visible;
}

/* Chart comparison tooltip (v1.7.0) — matches Chart.js default tooltip style */
.aiss-chart-tooltip {
	position: absolute;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.15s ease;
	background: rgba(0, 0, 0, 0.8);
	color: #fff;
	border-radius: 6px;
	padding: 8px 12px;
	font-size: 12px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	line-height: 1.5;
	z-index: 10;
	white-space: nowrap;
}

.aiss-tooltip-header {
	display: flex;
	align-items: center;
	gap: 6px;
	padding-bottom: 6px;
	margin-bottom: 6px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.2);
	font-weight: 600;
	font-size: 11px;
}

.aiss-tooltip-vs {
	color: rgba(255, 255, 255, 0.5);
	font-weight: 400;
}

.aiss-tooltip-row {
	display: flex;
	justify-content: space-between;
	gap: 20px;
	padding: 2px 0;
}

.aiss-tooltip-label {
	color: rgba(255, 255, 255, 0.7);
}

.aiss-tooltip-value {
	font-weight: 600;
	text-align: right;
}

.aiss-tooltip-dot {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	margin-right: 5px;
	vertical-align: middle;
}

.aiss-tooltip-footer {
	padding-top: 6px;
	margin-top: 6px;
	border-top: 1px solid rgba(255, 255, 255, 0.2);
	font-weight: 600;
	font-size: 11px;
}

.aiss-tooltip-footer.positive {
	color: #68de7c;
}

.aiss-tooltip-footer.negative {
	color: #f87171;
}

.aiss-tooltip-footer.neutral {
	color: rgba(255, 255, 255, 0.5);
}

.aiss-period-indicator {
	font-weight: 400;
	font-size: 12px;
	color: #646970;
	margin-left: 8px;
}

/* Chart legend (Fix #2: platform breakdown) */
.aiss-chart-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
	margin-top: 14px;
	padding-top: 12px;
	border-top: 1px solid #f0f0f1;
}

.aiss-legend-item {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: #50575e;
	cursor: pointer;
}

.aiss-legend-item:hover {
	color: #1d2327;
}

.aiss-legend-dot {
	flex-shrink: 0;
	width: 10px;
	height: 10px;
	border-radius: 50%;
}

/* Tables row */
.aiss-tables-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	margin-bottom: 25px;
}

.aiss-table-container {
	background: #fff;
	border: 1px solid #c3c4c7;
	padding: 20px;
	box-sizing: border-box;
	min-width: 0;
	overflow: hidden;
}

.aiss-table-container h3 {
	margin: 0 0 15px;
	font-size: 14px;
	font-weight: 600;
	color: #1d2327;
}

.aiss-table-container table {
	border: none;
}

.aiss-table-container table th {
	background: #f6f7f7;
	border-bottom: 1px solid #c3c4c7;
	padding: 10px 12px;
	font-weight: 600;
}

.aiss-table-container table td {
	padding: 10px 12px;
	vertical-align: middle;
}

.aiss-table-container table .num {
	text-align: right;
	white-space: nowrap;
}

.aiss-col-id {
	width: 60px;
}

.aiss-loading {
	text-align: center;
	color: #646970;
	padding: 30px !important;
}

/* Platform color dot in table */
.aiss-platform-dot {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	margin-right: 8px;
	vertical-align: middle;
	flex-shrink: 0;
}

.aiss-platform-name {
	display: flex;
	align-items: center;
}

/* Type badge: Social / AI */
.aiss-col-type {
	width: 100px;
	white-space: nowrap;
}

.aiss-type-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	padding: 3px 8px;
	border-radius: 3px;
	font-size: 11px;
	font-weight: 500;
	color: #555;
	border: 1px solid #ddd;
	line-height: 1.4;
	min-width: 72px;
	min-height: 26px;
	box-sizing: border-box;
}

.aiss-type-badge .dashicons {
	font-size: 13px;
	width: 13px;
	height: 13px;
	color: #555;
}

/* Social: white background */
.aiss-type-social {
	background: #fff;
}

/* AI: light gray background */
.aiss-type-ai {
	background: #f0f0f0;
}

/* Edit link in top content table */
.aiss-edit-link {
	color: #2271b1;
	text-decoration: none;
	font-size: 12px;
	margin-left: 8px;
}

.aiss-edit-link:hover {
	color: var(--aiss-brand);
	text-decoration: underline;
}

/* Table header with inline pagination (v1.7.0) */
.aiss-table-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	min-height: 32px;
	margin-bottom: 15px;
}

.aiss-table-header h3 {
	margin: 0;
	flex: 1;
}

/* Pager controls (v1.7.0, replaces Load more buttons) */
.aiss-pager {
	display: flex;
	align-items: center;
	gap: 4px;
	white-space: nowrap;
	flex-shrink: 0;
}

.aiss-pager-btn {
	background: none;
	border: 1px solid #dcdcde;
	border-radius: 3px;
	color: #2271b1;
	cursor: pointer;
	font-size: 14px;
	line-height: 1;
	padding: 3px 7px;
	min-width: 26px;
	text-align: center;
}

.aiss-pager-btn:hover:not(:disabled) {
	border-color: #2271b1;
	color: #135e96;
}

.aiss-pager-btn:disabled {
	color: #a7aaad;
	border-color: #dcdcde;
	cursor: default;
}

.aiss-pager-info {
	color: #50575e;
	font-size: 13px;
	padding: 0 4px;
}

/* Bottom pager wrapper (right-aligned below table) */
.aiss-pager-bottom-wrap {
	display: flex;
	justify-content: flex-end;
	margin-top: 10px;
}

/* Promotional notice */
.aiss-promo-notice {
	background: #f6f7f7;
	border: 1px solid #c3c4c7;
	padding: 20px;
	margin-top: 10px;
}

.aiss-promo-columns {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 25px;
}

.aiss-promo-column {
	background: #fff;
	border: 1px solid #dcdcde;
	padding: 20px;
	display: flex;
	flex-direction: column;
}

.aiss-promo-column > .dashicons {
	font-size: 28px;
	width: 28px;
	height: 28px;
	color: var(--aiss-brand);
	margin-bottom: 12px;
}

.aiss-promo-column h5 {
	margin: 0 0 10px;
	font-size: 13px;
	font-weight: 600;
	color: #1d2327;
	line-height: 1.4;
}

.aiss-promo-column p {
	margin: 0 0 15px;
	color: #50575e;
	font-size: 13px;
	line-height: 1.5;
	flex-grow: 1;
}

/* Specificity (0,3,0) to override WP core .button defaults */
.aiss-promo-notice .aiss-promo-column .button {
	align-self: flex-start;
	margin-top: auto;
	white-space: normal;
	height: auto;
	min-height: auto;
	line-height: 1.4;
	padding: 6px 12px;
	text-align: center;
}

/* Dashboard widget styles */
.aiss-widget-stats {
	display: flex;
	justify-content: space-around;
	padding: 15px 0;
	margin-bottom: 15px;
	border-bottom: 1px solid #f0f0f1;
}

.aiss-widget-stat {
	text-align: center;
}

.aiss-widget-stat-value {
	display: block;
	font-size: 24px;
	font-weight: 600;
	color: #1d2327;
	line-height: 1.2;
}

.aiss-widget-stat-label {
	font-size: 11px;
	color: #646970;
	text-transform: uppercase;
}

.aiss-widget h4 {
	margin: 0 0 10px;
	font-size: 13px;
	color: #1d2327;
}

.aiss-widget-section-title {
	margin: 0 0 10px;
	font-size: 13px;
	color: #1d2327;
}

.aiss-widget-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.aiss-widget-list li {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 0;
	border-bottom: 1px solid #f0f0f1;
}

.aiss-widget-list li:last-child {
	border-bottom: none;
}

.aiss-widget-platform-name {
	flex: 1;
	font-weight: 500;
}

.aiss-widget-platform-count {
	font-weight: 600;
	color: var(--aiss-brand);
}

.aiss-widget-empty {
	text-align: center;
	color: #646970;
	padding: 20px 0;
}

.aiss-widget-footer {
	margin: 15px 0 0;
	padding-top: 15px;
	border-top: 1px solid #f0f0f1;
	text-align: right;
}

.aiss-widget-footer a {
	text-decoration: none;
	font-weight: 500;
}

/* Widget sparkline */
.aiss-widget .aiss-sparkline-container {
	display: flex !important;
	align-items: flex-end;
	gap: 3px;
	height: 40px;
	width: 100%;
}

.aiss-widget .aiss-sparkline-bar {
	flex: 1;
	background: var(--aiss-brand);
	border-radius: 2px 2px 0 0;
	min-height: 2px;
	min-width: 8px;
	transition: opacity 0.2s;
}

.aiss-widget .aiss-sparkline-bar:hover {
	opacity: 0.8;
}

.aiss-widget .aiss-sparkline-labels {
	display: flex !important;
	justify-content: space-between;
	width: 100%;
	margin-top: 5px;
	margin-bottom: 10px;
	font-size: 11px;
	color: #888;
}

/* VigIA tip notice */
.aiss-vigia-tip {
	margin-top: 0 !important;
	margin-bottom: 20px !important;
}

/* Data retention row alignment (WP 7.0 fix) */
.aiss-retention-row > div {
	display: flex;
	flex-direction: column;
}

/* Responsive */
@media screen and (max-width: 1200px) {
	.aiss-tables-row {
		grid-template-columns: 1fr;
	}

	.aiss-promo-columns {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media screen and (max-width: 960px) {
	.aiss-stats-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media screen and (max-width: 782px) {
	.aiss-date-filter {
		flex-direction: column;
		align-items: flex-start;
	}

	.aiss-date-filter-left {
		width: 100%;
	}

	.aiss-compare-label {
		margin-left: 0;
		padding-left: 0;
		border-left: none;
		margin-top: 10px;
		width: 100%;
	}

	.aiss-stats-grid {
		grid-template-columns: 1fr;
	}

	.aiss-promo-columns {
		grid-template-columns: 1fr;
	}

	.aiss-table-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}
}
/* =============================================
   Settings layout (v2.5.0)
   ============================================= */

/* Two settings that belong together, side by side when there is room. */
.aiss-two-col {
	display: grid;
	grid-template-columns: 1fr;
	gap: 18px 32px;
	max-width: 900px;
}

@media (min-width: 900px) {
	.aiss-two-col { grid-template-columns: 1fr 1fr; }
}

.aiss-two-col > div > strong,
.aiss-two-col > div > label > strong {
	display: block;
	margin-bottom: 6px;
}

.aiss-stacked {
	display: block;
	margin-bottom: 5px;
}

.aiss-inline-choices {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 20px;
	margin: 6px 0 10px;
}

.aiss-full { width: 100%; max-width: 340px; }

/* --- Where the buttons appear ------------------------------------------- */
.aiss-placements {
	max-width: 980px;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	background: #fff;
	padding: 14px 16px;
}

/* Single content and archives side by side: stacked, a site with several
   public post types made a column tall enough to need its own scroll. */
@media (min-width: 1100px) {
	.aiss-placements.has-groups {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 4px 30px;
		align-items: start;
	}
}

.aiss-placements-group {
	margin: 14px 0 8px;
	padding-bottom: 6px;
	border-bottom: 2px solid #2271b1;
	display: inline-block;
	font-weight: 600;
}

.aiss-placements-group:first-child { margin-top: 0; }

/* Fixed tracks so every select lines up down the column. */
.aiss-placement-row {
	display: grid;
	grid-template-columns: 20px minmax(0, 1fr) 190px;
	align-items: center;
	gap: 10px;
	padding: 5px 0;
}

.aiss-placement-row input[type="checkbox"] { margin: 0; }
.aiss-placement-row label { cursor: pointer; }
.aiss-placement-row select { width: 100%; }

/* A position whose destination is unticked is inert information. */
.aiss-placement-row:not(.is-on):not(:has(input:checked)) select {
	opacity: .45;
}

@media (max-width: 782px) {
	.aiss-placement-row { grid-template-columns: 20px minmax(0, 1fr); }
	.aiss-placement-row select { grid-column: 2; }
}

.aiss-hint-tag {
	display: inline-block;
	margin-left: 6px;
	padding: 1px 7px;
	border: 1px solid #c5d9ed;
	border-radius: 3px;
	background: #f0f6fc;
	color: #0a4b78;
	font-size: 11px;
}

.aiss-danger-button.button {
	color: #b32d2e;
	border-color: #b32d2e;
}

.aiss-danger-button.button:hover {
	color: #8a2424;
	border-color: #8a2424;
	background: #fcf0f1;
}

/* --- Summary block preview (v2.5.0) ------------------------------------- */
.aiss-preview-caption {
	margin: 18px 0 6px;
	font-size: 11px;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: #646970;
}

.aiss-summary-preview {
	max-width: 640px;
	padding: 16px;
	border: 1px dashed #c3c4c7;
	border-radius: 6px;
	background: #fbfbfc;
}

/* The sample carries the front-end classes, so its own margins have to go. */
.aiss-summary-preview .ayudawp-aiss-summary {
	margin: 0;
}

.aiss-checklist {
	max-height: 190px;
	overflow-y: auto;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	background: #fff;
	padding: 10px 12px;
}

/* =============================================
   One width for the whole settings form (v2.5.0)
   The screen had two: the grids stopped at 900px while descriptions, notes and
   the promo banner ran the full width of the browser, so a long paragraph shot
   past the fields it belonged to and the page read as two designs stacked.
   ============================================= */
.aiss-wrap {
	/*
	 * The form is bounded by the layout grid below, not by a figure of its own.
	 * WordPress puts no maximum on `form-table`, so this was a choice, and a
	 * narrow one: Visibility uses 1400px and Widget Visibility Control 1200px.
	 */
	--aiss-settings-width: 100%;
}

/* --- Content and promo rail (v2.5.0) ------------------------------------ */
.aiss-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 26px;
	align-items: start;
	max-width: 1500px;
	margin-top: 16px;
}

.aiss-layout-main { min-width: 0; }

.aiss-layout-side {
	position: sticky;
	top: 42px;
}

@media screen and (max-width: 1200px) {
	.aiss-layout {
		grid-template-columns: 1fr;
	}

	.aiss-layout-side {
		position: static;
	}
}

/*
 * Analytics without the rail (v2.7.1): content at full width, without the
 * 1500px cap, and the banner as a strip at the bottom, as in VigIA's data
 * panel. The strip reuses the .aiss-promo-notice rules above, which are the
 * ones it had before 2.5.0 and the same ones VigIA uses.
 */
.aiss-layout--full {
	grid-template-columns: minmax(0, 1fr);
	max-width: none;
}

.aiss-wrap > .aiss-promo-notice {
	margin-top: 26px;
}

.aiss-wrap .form-table td > p.description,
.aiss-wrap .form-table td > .description,
.aiss-wrap .aiss-two-col,
.aiss-wrap .aiss-placements,
.aiss-wrap .aiss-catalog,
.aiss-wrap .aiss-catalog-notes,
.aiss-wrap .aiss-order-board,
.aiss-wrap .aiss-look,
.aiss-wrap .aiss-summary-preview,
.aiss-wrap .form-table td > .aiss-inline-choices {
	max-width: var(--aiss-settings-width);
}

/*
 * Promo cards down the rail. Same shape as Widget Visibility Control's, which
 * is where this layout comes from, including the three-class specificity the
 * banner contract needs to beat the 40px min-height that .wp-core-ui puts on
 * every .button.
 */
.aiss-layout-side {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.aiss-wrap .aiss-layout-side .aiss-promo-box {
	padding: 16px;
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 4px;
}

.aiss-layout-side .aiss-promo-box .aiss-promo-icon {
	color: #2271b1;
	font-size: 24px;
	width: 24px;
	height: 24px;
}

.aiss-layout-side .aiss-promo-box .aiss-promo-box-title {
	margin: 8px 0 4px;
	font-size: 14px;
	line-height: 1.4;
}

.aiss-layout-side .aiss-promo-box .aiss-promo-box-description {
	margin: 0 0 12px;
	font-size: 13px;
	color: #50575e;
}

.aiss-layout-side .aiss-promo-box .button {
	white-space: normal;
	height: auto;
	min-height: auto;
	line-height: 1.4;
	padding: 6px 12px;
	text-align: center;
}

/* =============================================
   Google preferred source button (v2.6.0)
   ============================================= */

/* Where it goes and the title of its section, side by side when they fit. */
.aiss-google-placement {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 12px 24px;
	max-width: 900px;
	margin-top: 12px;
}

.aiss-google-field label {
	display: block;
	margin-bottom: 4px;
}

.aiss-google-field select,
.aiss-google-field input {
	max-width: 100%;
}

/* `hidden` loses against a display set by a class. */
.aiss-google-title-field[hidden],
.aiss-google-order-note[hidden] {
	display: none;
}

/* =============================================
   Platforms table: posts each button was clicked from (v2.6.0)
   Same look as the crawler breakdown of VigIA.
   ============================================= */

.aiss-expand-platforms {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 0;
	margin: 0;
	border: none;
	background: none;
	color: #2271b1;
	font-size: inherit;
	font-variant-numeric: tabular-nums;
	cursor: pointer;
}

.aiss-expand-platforms:hover {
	color: #135e96;
}

.aiss-expand-platforms .dashicons {
	width: 18px;
	height: 18px;
	font-size: 18px;
	line-height: 1;
}

.aiss-platforms-drawer td {
	background: #f6f7f7;
}

.aiss-platforms-breakdown {
	padding: 6px 4px;
}

.aiss-platforms-breakdown-label {
	display: block;
	margin-bottom: 8px;
	color: #787c82;
	font-size: 11px;
	letter-spacing: .02em;
	text-transform: uppercase;
}

.aiss-platforms-posts {
	margin: 0 0 0 20px;
}

.aiss-platforms-posts li {
	margin-bottom: 4px;
}

.aiss-platforms-posts strong {
	font-variant-numeric: tabular-nums;
}

/* =============================================
   Analytics on a laptop screen (v2.7.0)
   On a 13" screen the two tables sat side by side in a column about 900px
   wide: the content table gave its title a third of that, so a title broke
   into five lines and "AI Crawls" was cut off. The tables now go side by side
   only when the content column itself has room (a container query: the
   viewport also counts the admin menu, and until 2.7.1 the promo rail), the
   count columns take just their width and the title the rest.
   ============================================= */
.aiss-layout-main {
	container-type: inline-size;
	container-name: aiss-main;
}

@container aiss-main (max-width: 1100px) {
	.aiss-tables-row {
		grid-template-columns: 1fr;
	}
}

/* Title, period and pager share a line while they fit, and wrap after. */
.aiss-table-header {
	flex-wrap: wrap;
}

.aiss-table-header h3 {
	min-width: 12em;
}

.aiss-table-container table th.aiss-col-count {
	width: 96px;
	white-space: normal;
}

.aiss-table-container #aiss-content-table td:first-child {
	overflow-wrap: anywhere;
}

/* =============================================
   Floating bar section (v2.8.0)
   ============================================= */
.aiss-bar-intro {
	max-width: 900px;
}

/* `hidden` loses to any display set by a class, so each one gets its rule. */
.aiss-bar-section tr[hidden],
.aiss-bar-dock[hidden],
.aiss-bar-own[hidden],
.aiss-bar-own-look[hidden] {
	display: none;
}

/* --- Radios and preview switches (v2.8.0) ------------------------------ */
/* Native radios like every other group on the screen: the fieldset only
   carries the legend for screen readers. */
.aiss-radios {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.aiss-radios .aiss-inline-choices {
	margin: 0 0 6px;
}

/* Which sample a preview draws: not settings, so small and inline. */
.aiss-preview-views {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 14px;
	font-size: 13px;
}

.aiss-preview-views label {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

/* --- The preview ------------------------------------------------------- */
.aiss-bar-dock {
	display: grid;
	gap: 8px;
	max-width: 420px;
	margin: 0 0 12px;
}

.aiss-bar-readout {
	margin: 0;
	font-size: 13px;
	color: #1d2327;
	font-variant-numeric: tabular-nums;
}

.aiss-bar-dock .description {
	margin: 0;
}

/*
 * The frame is a page at real size, scaled down with zoom: drawn at 360px
 * wide, a bottom bar of six buttons wrapped into two rows that a real screen
 * never shows. A phone is 375px wide here, as on a real one.
 */
.aiss-bar-stage {
	position: relative;
	width: 480px;
	height: 540px;
	overflow: hidden;
	border: 1px solid #c3c4c7;
	border-radius: 8px;
	background: #fff;
	box-sizing: border-box;
	zoom: 0.75;
}

.aiss-bar-stage.is-phone {
	justify-self: center;
	width: 375px;
	height: 667px;
	border: 12px solid #1d2327;
	border-radius: 40px;
	zoom: 0.62;
}

/* A page of grey blocks. */
.aiss-bar-page {
	position: absolute;
	inset: 0;
	display: grid;
	grid-template-rows: auto 1fr;
	gap: 14px;
	padding: 14px 16px;
}

.aiss-bar-page-top {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.aiss-bar-page-top span:first-child {
	width: 74px;
	height: 12px;
	border-radius: 3px;
	background: #50575e;
	opacity: 0.7;
}

.aiss-bar-page-top span:last-child {
	width: 120px;
	height: 8px;
	border-radius: 3px;
	background: #dcdcde;
}

.aiss-bar-page-body {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 30%;
	gap: 16px;
	min-height: 0;
}

.aiss-bar-page-main {
	display: grid;
	align-content: start;
	gap: 8px;
}

.aiss-bar-page-main i {
	display: block;
	height: 8px;
	border-radius: 3px;
	background: #eef0f3;
}

.aiss-bar-page-main i:nth-child(3n) {
	width: 90%;
}

.aiss-bar-page-main i.is-title {
	width: 80%;
	height: 16px;
	margin-bottom: 6px;
	background: #e3e5ea;
}

.aiss-bar-page-main i.is-img {
	height: 70px;
	margin: 4px 0;
}

.aiss-bar-page-side {
	display: grid;
	align-content: start;
	gap: 10px;
}

.aiss-bar-page-side b {
	display: block;
	height: 70px;
	border: 1px solid #e3e5ea;
	border-radius: 6px;
	background: #eef0f3;
}

.is-phone .aiss-bar-page-body {
	grid-template-columns: minmax(0, 1fr);
}

.is-phone .aiss-bar-page-side {
	display: none;
}

/* The sample bar: same geometry as floating-bar.css, inside the frame. */
.aiss-bar-mock.ayudawp-share-buttons {
	position: absolute;
	z-index: 2;
	margin: 0;
	padding: 8px;
	border: 0;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.94);
	box-shadow: 0 2px 14px rgba(0, 0, 0, 0.16);
	box-sizing: border-box;
}

.aiss-bar-mock.ayudawp-share-buttons .ayudawp-buttons-container {
	display: flex;
	gap: 8px;
	margin: 0;
	max-width: none;
	grid-template-columns: none;
}

.aiss-bar-mock--left,
.aiss-bar-mock--right {
	top: 50%;
	transform: translateY(-50%);
}

.aiss-bar-mock--left {
	left: 12px;
}

.aiss-bar-mock--right {
	right: 12px;
}

.aiss-bar-mock.aiss-bar-mock--left .ayudawp-buttons-container,
.aiss-bar-mock.aiss-bar-mock--right .ayudawp-buttons-container {
	flex-direction: column;
	flex-wrap: nowrap;
}

.aiss-bar-mock--left:not(.has-more),
.aiss-bar-mock--right:not(.has-more) {
	max-height: 92%;
	overflow-y: auto;
}

/* One row, as on a desktop screen; wider than the frame, it is cut at
   both ends and the readout gives its width. */
.aiss-bar-mock--bottom {
	bottom: 12px;
	left: 50%;
	transform: translateX(-50%);
	width: max-content;
}

.aiss-bar-mock--phone {
	left: 10px;
	right: 10px;
	bottom: 10px;
}

.aiss-bar-mock.aiss-bar-mock--bottom .ayudawp-buttons-container,
.aiss-bar-mock.aiss-bar-mock--phone .ayudawp-buttons-container {
	flex-direction: row;
	flex-wrap: wrap;
	justify-content: center;
}

.aiss-bar-mock.aiss-bar-mock--bottom .ayudawp-buttons-container {
	flex-wrap: nowrap;
}

/* Phones draw icon buttons at 40px unless the size says otherwise. */
.aiss-bar-mock--phone:not(.size-compact):not(.size-large) .ayudawp-share-btn {
	width: 40px;
	min-width: 40px;
	height: 40px;
}

.aiss-bar-mock .ayudawp-aiss-bar-more.is-open:not(.is-single) > .ayudawp-aiss-bar-more-btn svg {
	transform: rotate(45deg);
}

.aiss-bar-mock .ayudawp-aiss-bar-panel {
	max-height: 420px;
}

.aiss-bar-mock--right .ayudawp-aiss-bar-panel {
	right: calc(100% + 8px);
	top: 50%;
	transform: translateY(-50%);
}

.aiss-bar-mock--left .ayudawp-aiss-bar-panel {
	left: calc(100% + 8px);
	top: 50%;
	transform: translateY(-50%);
}

.aiss-bar-mock--bottom .ayudawp-aiss-bar-panel,
.aiss-bar-mock--phone .ayudawp-aiss-bar-panel {
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
}

/* =============================================
   Buttons block preview (v2.8.0)
   One more row of the table at the end of "The buttons", with the label in
   the label column and the sample under the controls, so it lines up with
   everything around it. Measures copied from .form-table: a 200px th with
   10px of right padding, and 10px of left padding in the td. The block is
   laid out in an iframe at a real width (a content column, or a phone) and
   scaled down to fit, so the site stylesheet applies its own phone rules.
   ============================================= */
.aiss-block-dock {
	display: grid;
	justify-items: start;
	gap: 8px;
	min-width: 0;
}

.aiss-block-dock[hidden] {
	display: none;
}

/* Without the script the preview stays hidden, and so does its row. */
.aiss-wrap tr.aiss-preview-row:has(.aiss-block-dock[hidden]),
.aiss-wrap tr.aiss-preview-row:has(.aiss-bar-dock[hidden]) {
	display: none;
}

.aiss-block-dock-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 14px;
}

.aiss-block-dark {
	font-size: 13px;
}

.aiss-block-status {
	font-size: 12px;
	color: #646970;
}

.aiss-block-dock .description {
	margin: 0;
	max-width: 600px;
}

.aiss-block-frame {
	position: relative;
	overflow: hidden;
	border: 1px solid #c3c4c7;
	border-radius: 8px;
	background: #fff;
}

/* Same thin frame as the desktop one, rounder: the sample is only the block,
   not a whole phone, so a phone bezel around it was all frame. The 375px
   width is what says phone. */
.aiss-block-frame.is-phone {
	border-radius: 18px;
}

.aiss-block-iframe {
	display: block;
	border: 0;
	background: #fff;
	transform-origin: 0 0;
}

/* =============================================
   Buttons tab (v2.8.0)
   The catalog, then "In-content buttons" and "Floating bar" with the same six
   rows. Buttons are listed as narrow chips with no style of their own: the
   preview at the end of each section is where the look shows.
   ============================================= */

/* Where a row applies ("On phones", "Always"), under its label. */
.aiss-scope {
	display: block;
	margin-top: 4px;
	font-size: 12px;
	font-weight: 400;
	color: #646970;
}

/* A small heading inside a row. */
.aiss-sub {
	display: block;
	margin: 0 0 6px;
	font-weight: 600;
}

.aiss-sub-next {
	margin-top: 12px;
}

/* --- Chips: the catalog and the order lists ------------------------------ */
.aiss-catalog {
	display: grid;
	gap: 12px;
}

.aiss-catalog-title,
.aiss-order-title {
	margin: 0 0 6px;
	font-size: 12px;
	font-weight: 600;
	color: #50575e;
}

.aiss-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.aiss-chip,
.aiss-order-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 3px 9px 3px 6px;
	border: 1px solid #c3c4c7;
	border-radius: 6px;
	background: #fff;
	font-size: 12px;
	line-height: 1.4;
	color: #1d2327;
}

.aiss-chip {
	cursor: pointer;
}

.aiss-chip input[type="checkbox"],
.aiss-order-chip input[type="checkbox"] {
	margin: 0;
}

.aiss-chip-dot {
	display: inline-grid;
	flex: none;
	place-items: center;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--aiss-chip, #50575e);
	color: #fff;
}

.aiss-chip-dot.is-small {
	width: 18px;
	height: 18px;
	margin-top: 1px;
}

.aiss-chip-dot .ayudawp-icon-wrapper {
	display: inline-flex;
}

.aiss-chip-dot svg {
	width: 11px;
	height: 11px;
	fill: currentColor;
}

.aiss-chip-dot.is-small svg {
	width: 10px;
	height: 10px;
}

/* Unticked: the name and the dot go grey, as the button goes away. */
.aiss-chip:has(input:not(:checked)),
.aiss-order-board.is-picking .aiss-order-chip:has(.aiss-order-pick:not(:checked)) {
	color: #646970;
}

.aiss-chip:has(input:not(:checked)) .aiss-chip-dot,
.aiss-order-board.is-picking .aiss-order-chip:has(.aiss-order-pick:not(:checked)) .aiss-chip-dot {
	background: #dcdcde;
	color: #646970;
}

/* Two notes side by side, plain descriptions with the icon of their button. */
.aiss-catalog-notes {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 6px 28px;
	margin-top: 12px;
}

.aiss-catalog-notes .aiss-note {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 8px;
	align-items: start;
	margin: 0;
}

@media (max-width: 782px) {
	.aiss-catalog-notes {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* --- Buttons and order ---------------------------------------------------- */
.aiss-groups {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 12px;
	margin: 10px 0;
}

.aiss-groups .aiss-sub {
	margin: 0;
}

.aiss-order-board {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px 24px;
	margin-bottom: 8px;
}

@media (max-width: 782px) {
	.aiss-order-board {
		grid-template-columns: minmax(0, 1fr);
	}
}

.aiss-order-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	min-height: 28px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.aiss-order-chip {
	margin: 0;
	cursor: grab;
}

.aiss-order-chip:active {
	cursor: grabbing;
}

.aiss-order-chip[hidden],
.ayudawp-color-picker-row[hidden] {
	display: none;
}

.aiss-chip-grip {
	width: 14px;
	height: 14px;
	font-size: 14px;
	line-height: 14px;
	color: #a7aaad;
}

/* The box that says "chosen" only shows while the section is choosing. */
.aiss-order-board:not(.is-picking) .aiss-order-pick {
	display: none;
}

.aiss-order-chips .ayudawp-sortable-placeholder {
	display: inline-block;
	width: 96px;
	height: 26px;
	margin: 0;
}

/* --- Appearance: one line per setting -------------------------------------- */
.aiss-look {
	display: grid;
	gap: 6px;
	margin-bottom: 6px;
}

.aiss-look-row {
	display: grid;
	grid-template-columns: 130px minmax(0, 1fr);
	gap: 4px 12px;
	align-items: baseline;
}

.aiss-look-label {
	font-weight: 600;
}

.aiss-look .ayudawp-color-picker-row {
	margin: 0 0 6px 142px;
}

@media (max-width: 782px) {
	.aiss-look-row {
		grid-template-columns: minmax(0, 1fr);
	}

	.aiss-look .ayudawp-color-picker-row {
		margin-left: 0;
	}
}

/* Radios in a row: core makes the labels inline-block inside a fieldset of
   .form-table and sets their margins with !important (forms.css), so the gap
   between them comes from the fieldset. */
.aiss-radios.is-inline {
	display: flex;
	flex-wrap: wrap;
	column-gap: 16px;
}

.aiss-compact-count {
	width: 56px;
}

.aiss-bar-own-look {
	margin-top: 10px;
}

.aiss-bar-own .aiss-groups {
	margin-top: 10px;
}

/* The bar preview on a dark page, and the bar itself when it turns dark. */
.aiss-bar-stage.is-dark,
.aiss-bar-stage.is-dark .aiss-bar-page {
	background: #1e1e1e;
}

.aiss-bar-stage.is-dark .aiss-bar-page-main i,
.aiss-bar-stage.is-dark .aiss-bar-page-side b {
	background: #3a3a3a;
	border-color: #3a3a3a;
}

.aiss-bar-mock.ayudawp-share-buttons.is-on-dark,
.aiss-bar-mock.ayudawp-share-buttons.dark {
	background: rgba(24, 24, 24, 0.92);
	box-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
}
