/**
 * Share Buttons & AI-powered Summaries - 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;
	}
}
/* =============================================
   Button picker (v2.5.0)
   The "Enabled buttons" field renders each option as the real button, with
   the front-end stylesheet loaded alongside this one. These rules neutralise
   the block's own spacing inside the settings form and lay the options out.
   ============================================= */
.aiss-picker-preview {
	margin: 0 0 10px;
	padding: 0;
	border: 0;
}

.aiss-picker-group-title {
	margin: 16px 0 6px;
	font-weight: 600;
	color: #1d2327;
}

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

.aiss-picker-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 8px;
	max-width: 900px;
}

.aiss-pick {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 8px;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	background: #fff;
	cursor: pointer;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.aiss-pick:hover {
	border-color: #8c8f94;
}

/*
 * No selected ring: the button preview inside the label already shows, in its
 * own colours, what is on, and a blue frame around it only competed with it.
 */
.aiss-pick.is-on,
.aiss-pick:has(input:checked) {
	border-color: #c3c4c7;
	background: #fbfbfc;
}

.aiss-pick input[type="checkbox"] {
	margin: 0;
	flex: none;
}

/* The preview is a sample, not a control: it must not swallow the click. */
.aiss-pick .ayudawp-share-btn {
	pointer-events: none;
	flex: 1 1 auto;
	width: auto;
	min-width: 0;
	min-height: 30px;
	padding: 5px 10px;
	font-size: 12px;
	transform: none;
}

.aiss-picker-preview.icons-only .aiss-pick .ayudawp-share-btn {
	flex: none;
	width: 32px;
	min-width: 32px;
	height: 32px;
	padding: 0;
}

.aiss-pick-name {
	font-size: 12px;
	color: #50575e;
}

.aiss-picker-note {
	max-width: 900px;
	margin-top: 10px;
	padding: 10px 12px;
	border-left: 4px solid #2271b1;
	background: #f0f6fc;
}

.aiss-picker-note .dashicons {
	color: #2271b1;
	vertical-align: text-bottom;
}

/* =============================================
   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;
}

/* --- Live preview of the picker ----------------------------------------- */
/* The label lives in two places at once; the style in force decides which. */
.aiss-picker-preview .aiss-pick-name { display: none; }
.aiss-picker-preview.icons-only .aiss-pick .ayudawp-button-text { display: none; }
.aiss-picker-preview.icons-only .aiss-pick-name { display: inline; }

/* Live preview: the icons come and go with the "add icons" checkbox. */
.aiss-picker-preview.aiss-hide-icons .aiss-pick .ayudawp-icon-wrapper { display: none; }

/* --- 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;
}

/* --- Order lists (v2.5.0) ----------------------------------------------- */
/* The wrapper carries the front-end classes so each row can show the real
   button; these rules undo the block's own spacing inside the form. */
.aiss-order-preview {
	margin: 12px 0 0;
	padding: 0;
	border: 0;
}

.aiss-order-list {
	margin: 6px 0 0;
	padding: 0;
	list-style: none;
	min-height: 40px;
}

.aiss-order-list li {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 4px;
	padding: 5px 8px;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	background: #fff;
	cursor: grab;
}

.aiss-order-list li:active { cursor: grabbing; }

.aiss-order-grip {
	color: #b4b9be;
	font-size: 16px;
	width: 16px;
	height: 16px;
	line-height: 16px;
	flex: none;
}

.aiss-order-list .ayudawp-share-btn {
	pointer-events: none;
	flex: 1 1 auto;
	width: auto;
	min-width: 0;
	min-height: 28px;
	padding: 4px 10px;
	font-size: 12px;
	transform: none;
}

.aiss-order-preview.icons-only .aiss-order-list .ayudawp-share-btn {
	flex: none;
	width: 30px;
	min-width: 30px;
	height: 30px;
	padding: 0;
}

.aiss-order-list .aiss-pick-name { display: none; }
.aiss-order-preview.icons-only .aiss-order-list .aiss-pick-name { display: inline; }
.aiss-order-preview.icons-only .aiss-order-list .ayudawp-button-text { display: none; }

/* =============================================
   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-picker-grid,
.aiss-wrap .aiss-picker-note,
.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;
}

/* The order lists follow the live style too, icons included. */
.aiss-order-preview.aiss-hide-icons .aiss-order-list .ayudawp-icon-wrapper { display: none; }

/* =============================================
   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%;
}

/* The title only applies to a section of its own. */
.aiss-google-title-field.is-off {
	opacity: .45;
}

/* `hidden` loses against the flex the list rows get from their class. */
.aiss-order-list li[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;
}
