/**
 * Address Autocomplete admin styles.
 *
 * Scoped to the plugin's own settings page. Sections 1 to 5 and 8 follow
 * Confetti's admin.css so the WP Sunshine plugins look like one family; keep
 * them in step when either one changes.
 *
 * Every colour, radius and shadow comes from the tokens block. The
 * `body.settings_page_wps_aa` prefix on some rules is what outranks
 * WordPress core's own admin CSS.
 *
 * Sections:
 *   1. Tokens
 *   2. Page chrome
 *   3. Accessibility
 *   4. Panels and option rows
 *   5. Instance nav
 *   6. Fields to fill in
 *   7. Template chips
 *   8. Sidebar cards
 *   9. Choice cards, switches, integrations
 *  10. Setup wizard
 */

/* 1. Tokens
   ======================================================================== */

:root {
	/* Brand */
	--wps-brand: #FF8500;
	--wps-brand-hover: #FFB600;
	--wps-brand-tint: #fff4e6;
	--wps-brand-tint-border: #ffd9a8;
	--wps-brand-tint-hover: #fffaf4;
	--wps-yellow: #fecd08;

	/* Surfaces */
	--wps-page-bg: #fef8f1;
	--wps-surface: #FFF;
	--wps-surface-sunken: #f6f7f7;
	--wps-surface-code: #f5f5f5;
	--wps-dark: #1d2634;

	/* Text */
	--wps-text: #1d2327;
	--wps-text-muted: #787c82;
	--wps-text-dim: #8c8f94;
	--wps-text-faint: #a7aaad;
	--wps-text-on-brand: #FFF;
	--wps-text-on-dark: #d4d7dd;
	--wps-text-on-dark-muted: #b9bfc9;

	/* Lines */
	--wps-border-warm: #f0e6da;
	--wps-border-soft: #f0f0f0;
	--wps-border-faint: #f3f3f3;
	--wps-border: #dcdcde;
	--wps-border-strong: #c3c4c7;
	--wps-border-muted: #8c8f94;

	/* Legacy greys, kept because the older screens still use them. */
	--wps-text-heading: #333;
	--wps-border-grey: #ddd;

	/* Status */
	--wps-danger: #d63638;
	--wps-success: #00a32a;

	/* Shape */
	--wps-radius-sm: 8px;
	--wps-radius: 10px;
	--wps-radius-lg: 12px;
	--wps-radius-pill: 999px;
	--wps-control-size: 44px;
	--wps-shadow-card: 0 1px 4px rgb(18 25 97 / 6%);
	--wps-shadow-pop: 0 8px 30px rgba(0,0,0,.18);
	--wps-speed: .15s;

	/* Switch track when off. */
	--wps-switch-off: #ccc;
}

/* 2. Page chrome
   ======================================================================== */

body.settings_page_wps_aa,
#wpcontent { padding: 0; background: var(--wps-page-bg); }
.wps-wrap { padding: 0 40px; }
.wps-wrap a { color: var(--wps-brand); }
.wps-wrap a:hover { color: var(--wps-brand-hover); }
.wps-wrap h2 { color: var(--wps-text-heading); font-size: 24px; margin: 20px 0; }
.wps-wrap .form-table { width: auto; clear: none; }

.wps-header { background: var(--wps-surface); padding: 30px 40px; box-shadow: 0 0 5px 0 rgba(0,0,0,.1); display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; }
.wps-logo img { height: 50px; width: auto; }

#wps-header-links { display: flex; }
#wps-header-links a { color: var(--wps-brand); text-decoration: none; display: inline-block; margin-left: 20px; }
#wps-header-links a:hover { color: var(--wps-brand-hover); }
#wps-header-links a:before { display: inline-block; vertical-align: middle; margin: 0 3px 0 0; }
a.wps-header-link--documentation:before { content: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 16 16' width='16px' height='16px'%3E%3Cpath style=' stroke:none;fill-rule:nonzero;fill:%23fede53;fill-opacity:1;' d='M 3.199219 2.132812 C 2.609375 2.132812 2.132812 2.609375 2.132812 3.199219 L 2.132812 12.800781 C 2.132812 13.390625 2.609375 13.867188 3.199219 13.867188 L 4.03125 13.867188 C 3.847656 13.550781 3.734375 13.191406 3.734375 12.800781 L 3.734375 3.199219 C 3.734375 2.808594 3.847656 2.449219 4.03125 2.132812 Z M 5.867188 2.132812 C 5.277344 2.132812 4.800781 2.609375 4.800781 3.199219 L 4.800781 12.800781 C 4.800781 13.390625 5.277344 13.867188 5.867188 13.867188 L 12.800781 13.867188 C 13.390625 13.867188 13.867188 13.390625 13.867188 12.800781 L 13.867188 5.601562 C 13.867188 5.457031 13.8125 5.324219 13.710938 5.222656 L 10.777344 2.289062 C 10.675781 2.1875 10.542969 2.132812 10.398438 2.132812 Z M 10.132812 3.148438 L 12.851562 5.867188 L 10.667969 5.867188 C 10.371094 5.867188 10.132812 5.628906 10.132812 5.332031 Z M 7.464844 8 L 11.199219 8 C 11.496094 8 11.734375 8.238281 11.734375 8.535156 C 11.734375 8.828125 11.496094 9.066406 11.199219 9.066406 L 7.464844 9.066406 C 7.171875 9.066406 6.933594 8.828125 6.933594 8.535156 C 6.933594 8.238281 7.171875 8 7.464844 8 Z M 7.464844 10.132812 L 10.132812 10.132812 C 10.425781 10.132812 10.667969 10.371094 10.667969 10.667969 C 10.667969 10.960938 10.425781 11.199219 10.132812 11.199219 L 7.464844 11.199219 C 7.171875 11.199219 6.933594 10.960938 6.933594 10.667969 C 6.933594 10.371094 7.171875 10.132812 7.464844 10.132812 Z M 7.464844 10.132812 '/%3E%3C/svg%3E%0A"); }
a.wps-header-link--review:before { content: url("data:image/svg+xml,%3C%3Fxml version='1.0'%3F%3E%3Csvg fill='%23fede53' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30' width='16px' height='16px'%3E%3Cpath d='M15.765,2.434l2.875,8.512l8.983,0.104c0.773,0.009,1.093,0.994,0.473,1.455l-7.207,5.364l2.677,8.576 c0.23,0.738-0.607,1.346-1.238,0.899L15,22.147l-7.329,5.196c-0.63,0.447-1.468-0.162-1.238-0.899l2.677-8.576l-7.207-5.364 c-0.62-0.461-0.3-1.446,0.473-1.455l8.983-0.104l2.875-8.512C14.482,1.701,15.518,1.701,15.765,2.434z'/%3E%3C/svg%3E%0A"); }
a.wps-header-link--feedback:before { content: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 16 16' width='16px' height='16px'%3E%3Cpath style=' stroke:none;fill-rule:nonzero;fill:%23fede53;fill-opacity:1;' d='M 8 1.601562 C 4.171875 1.601562 1.066406 4.226562 1.066406 7.464844 C 1.066406 9.261719 2.023438 10.867188 3.527344 11.945312 C 3.5625 12.765625 3.4375 13.894531 2.308594 14.417969 C 2.304688 14.417969 2.304688 14.417969 2.304688 14.417969 C 2.203125 14.457031 2.132812 14.554688 2.132812 14.667969 C 2.132812 14.8125 2.253906 14.933594 2.398438 14.933594 C 2.40625 14.933594 2.414062 14.933594 2.417969 14.933594 C 2.421875 14.933594 2.421875 14.933594 2.421875 14.933594 C 3.722656 14.925781 4.824219 14.222656 5.582031 13.480469 C 5.824219 13.246094 6.160156 13.128906 6.492188 13.191406 C 6.976562 13.285156 7.480469 13.332031 8 13.332031 C 11.828125 13.332031 14.933594 10.707031 14.933594 7.464844 C 14.933594 4.226562 11.828125 1.601562 8 1.601562 Z M 8 1.601562 '/%3E%3C/svg%3E%0A"); }
a.wps-header-link--ticket:before { content: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 16 16' width='16px' height='16px'%3E%3Cpath style=' stroke:none;fill-rule:nonzero;fill:%23fede53;fill-opacity:1;' d='M 8 1.601562 C 6.617188 1.601562 5.34375 2.042969 4.296875 2.789062 L 4.230469 2.722656 C 4.019531 2.511719 3.683594 2.511719 3.476562 2.722656 L 2.722656 3.476562 C 2.511719 3.683594 2.511719 4.019531 2.722656 4.230469 L 2.789062 4.296875 C 2.042969 5.34375 1.601562 6.617188 1.601562 8 C 1.601562 9.382812 2.042969 10.65625 2.785156 11.703125 L 2.71875 11.769531 C 2.511719 11.980469 2.511719 12.316406 2.71875 12.523438 L 3.472656 13.277344 C 3.683594 13.488281 4.019531 13.488281 4.226562 13.277344 L 4.292969 13.210938 C 5.339844 13.957031 6.617188 14.398438 8 14.398438 C 9.382812 14.398438 10.65625 13.957031 11.703125 13.210938 L 11.769531 13.277344 C 11.980469 13.488281 12.316406 13.488281 12.523438 13.277344 L 13.277344 12.523438 C 13.488281 12.316406 13.488281 11.980469 13.277344 11.769531 L 13.210938 11.703125 C 13.957031 10.65625 14.398438 9.382812 14.398438 8 C 14.398438 6.617188 13.957031 5.34375 13.210938 4.296875 L 13.277344 4.230469 C 13.488281 4.019531 13.488281 3.683594 13.277344 3.476562 L 12.523438 2.722656 C 12.316406 2.511719 11.980469 2.511719 11.769531 2.722656 L 11.703125 2.789062 C 10.65625 2.042969 9.382812 1.601562 8 1.601562 Z M 8 2.667969 C 9.085938 2.667969 10.09375 2.992188 10.9375 3.554688 L 9.773438 4.714844 C 9.246094 4.429688 8.640625 4.265625 8 4.265625 C 7.359375 4.265625 6.753906 4.429688 6.226562 4.714844 L 5.0625 3.554688 C 5.90625 2.992188 6.914062 2.667969 8 2.667969 Z M 3.554688 5.0625 L 4.714844 6.226562 C 4.429688 6.753906 4.265625 7.359375 4.265625 8 C 4.265625 8.640625 4.429688 9.246094 4.714844 9.773438 L 3.554688 10.9375 C 2.996094 10.09375 2.667969 9.085938 2.667969 8 C 2.667969 6.914062 2.992188 5.90625 3.554688 5.0625 Z M 12.445312 5.0625 C 13.007812 5.90625 13.332031 6.914062 13.332031 8 C 13.332031 9.085938 13.007812 10.09375 12.445312 10.9375 L 11.285156 9.773438 C 11.570312 9.246094 11.734375 8.640625 11.734375 8 C 11.734375 7.359375 11.570312 6.753906 11.285156 6.226562 Z M 8 5.332031 C 9.472656 5.332031 10.667969 6.527344 10.667969 8 C 10.667969 9.472656 9.472656 10.667969 8 10.667969 C 6.527344 10.667969 5.332031 9.472656 5.332031 8 C 5.332031 7.265625 5.632812 6.597656 6.113281 6.113281 C 6.597656 5.632812 7.265625 5.332031 8 5.332031 Z M 6.226562 11.285156 C 6.753906 11.570312 7.359375 11.734375 8 11.734375 C 8.640625 11.734375 9.246094 11.570312 9.773438 11.285156 L 10.9375 12.445312 C 10.09375 13.007812 9.085938 13.332031 8 13.332031 C 6.914062 13.332031 5.90625 13.003906 5.0625 12.445312 Z M 6.226562 11.285156 '/%3E%3C/svg%3E%0A"); }
a.wps-header-link--upgrade:before { content: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 16 16' width='16px' height='16px'%3E%3Cpath style=' stroke:none;fill-rule:nonzero;fill:%23fede53;fill-opacity:1;' d='M 8 1.601562 C 4.472656 1.601562 1.601562 4.472656 1.601562 8 C 1.601562 11.527344 4.472656 14.398438 8 14.398438 C 11.527344 14.398438 14.398438 11.527344 14.398438 8 C 14.398438 4.472656 11.527344 1.601562 8 1.601562 Z M 8 2.667969 C 10.953125 2.667969 13.332031 5.046875 13.332031 8 C 13.332031 10.953125 10.953125 13.332031 8 13.332031 C 5.046875 13.332031 2.667969 10.953125 2.667969 8 C 2.667969 5.046875 5.046875 2.667969 8 2.667969 Z M 8 3.734375 C 5.644531 3.734375 3.734375 5.644531 3.734375 8 C 3.734375 10.355469 5.644531 12.265625 8 12.265625 C 10.355469 12.265625 12.265625 10.355469 12.265625 8 C 12.265625 5.644531 10.355469 3.734375 8 3.734375 Z M 8 5.332031 C 8.136719 5.332031 8.273438 5.386719 8.378906 5.488281 L 9.976562 7.089844 C 10.1875 7.296875 10.1875 7.636719 9.976562 7.84375 C 9.769531 8.050781 9.429688 8.050781 9.222656 7.84375 L 8.535156 7.152344 L 8.535156 10.132812 C 8.535156 10.425781 8.292969 10.667969 8 10.667969 C 7.707031 10.667969 7.464844 10.425781 7.464844 10.132812 L 7.464844 7.152344 L 6.777344 7.84375 C 6.570312 8.050781 6.230469 8.050781 6.023438 7.84375 C 5.8125 7.636719 5.8125 7.296875 6.023438 7.089844 L 7.621094 5.488281 C 7.726562 5.386719 7.863281 5.332031 8 5.332031 Z M 8 5.332031 '/%3E%3C/svg%3E%0A"); }

/* Buttons. Core styles these hard, hence the prefix. */
body.settings_page_wps_aa .button,
body.settings_page_wps_aa .wps-wrap .button,
body.settings_page_wps_aa .wps-wrap .button-primary,
body.settings_page_wps_aa .wps-wrap .button-secondary,
body.settings_page_wps_aa .wps-button { border: 1px solid var(--wps-brand); background: transparent; display: inline-block; border-radius: var(--wps-radius-pill); padding: 5px 25px; color: var(--wps-brand); text-transform: uppercase; font-weight: bold; text-decoration: none; }
body.settings_page_wps_aa .wps-wrap .button:hover,
body.settings_page_wps_aa .wps-wrap .button-primary:hover,
body.settings_page_wps_aa .wps-button:hover { background: var(--wps-brand-hover); color: var(--wps-text-on-brand); border: 1px solid var(--wps-brand-hover); }
body.settings_page_wps_aa .wps-wrap .button-primary { background: var(--wps-brand); color: var(--wps-text-on-brand); border: 1px solid var(--wps-brand); }
body.settings_page_wps_aa .wps-wrap .button-secondary { border-radius: 40px; border-color: var(--wps-brand-hover); color: var(--wps-brand-hover); }
body.settings_page_wps_aa .wps-wrap .button-secondary:hover { border-color: var(--wps-brand); color: var(--wps-text-on-brand); background: var(--wps-brand); }

/* The new UI reads as sentences, not shouted labels. */
body.settings_page_wps_aa .wps-panel .button,
body.settings_page_wps_aa .wps-card .button,
body.settings_page_wps_aa .wps-save-bar .button,
body.settings_page_wps_aa .wps-setup .button { text-transform: none; letter-spacing: 0; }

.wps-description { display: block; font-size: 13px; color: #999; margin: 5px 0 0 0; }

.wps-badge { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--wps-brand); background: var(--wps-brand-tint); border: 1px solid var(--wps-brand-tint-border); border-radius: var(--wps-radius-pill); padding: 2px 9px; line-height: 1.5; }

/* Surfaces. Panels and sidebar cards are the same card, different padding. */
.wps-panel,
.wps-card { background: var(--wps-surface); border: 1px solid var(--wps-border-warm); border-radius: var(--wps-radius); box-shadow: var(--wps-shadow-card); margin: 0 0 20px 0; }

.wps-options-menu { margin: 25px 0 -30px 0; flex-basis: 100%; }
.wps-options-menu ul { display: flex; margin: 0; }
.wps-options-menu li { list-style: none; padding: 10px 0; margin: 0 25px 0 0; }
.wps-options-menu li a { color: #000; text-decoration: none; font-size: 16px; }
.wps-options-menu li.wps-options-active { font-weight: bold; border-bottom: 2px solid var(--wps-yellow); }

/* 3. Accessibility
   ======================================================================== */

/* One visible focus ring for everything the keyboard can reach. */
body.settings_page_wps_aa :focus-visible {
	outline: 2px solid var(--wps-brand);
	outline-offset: 2px;
	border-radius: 2px;
}

@media ( prefers-reduced-motion: reduce ) {
	body.settings_page_wps_aa *,
	body.settings_page_wps_aa *::before,
	body.settings_page_wps_aa *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
		scroll-behavior: auto !important;
	}
}

/* 4. Panels and option rows
   ======================================================================== */

.wps-layout { display: flex; align-items: flex-start; gap: 30px; padding-bottom: 40px; }
.wps-layout__main { flex: 1 1 auto; min-width: 0; }
.wps-layout__side { flex: 0 0 340px; position: sticky; top: 50px; }

@media screen and ( max-width: 75rem ) {
	.wps-layout { display: block; }
	.wps-layout__side { width: auto; position: static; margin-top: 30px; }
}

/* Panels */
/* No overflow clipping here: the chip menus and select2 dropdowns hang past
   the bottom of a panel. */
.wps-panel__head { display: flex; align-items: center; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--wps-border-soft); }
.wps-wrap .wps-panel__head h2.wps-panel__title { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--wps-text); }
.wps-panel__body { padding: 4px 24px 20px; position: relative; }

.wps-panel--collapsible .wps-panel__head { width: 100%; background: none; border: none; border-bottom: 1px solid transparent; cursor: pointer; text-align: left; font-family: inherit; }
.wps-panel--collapsible.is-open .wps-panel__head { border-bottom-color: var(--wps-border-soft); }
.wps-panel--collapsible .wps-panel__head:hover .wps-panel__title { color: var(--wps-brand); }
.wps-panel__arrow { flex: 0 0 auto; width: 0; height: 0; border-left: 5px solid var(--wps-text-muted); border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform var(--wps-speed) ease; }
.wps-panel--collapsible.is-open .wps-panel__arrow { transform: rotate( 90deg ); }

/* Option rows */
.wps-option-row { display: flex; align-items: flex-start; gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--wps-border-faint); }
.wps-option-row:last-child { border-bottom: none; }
.wps-option-row__label { flex: 0 0 150px; font-weight: 600; font-size: 14px; color: var(--wps-text); padding-top: 6px; }
.wps-option-row__control { flex: 1 1 auto; min-width: 0; }
.wps-option-row__control .description { margin: 6px 0 0 0; color: var(--wps-text-muted); }
.wps-option-row__control > label { display: inline-block; }

/* Save bar */
.wps-save-bar { display: flex; align-items: center; gap: 20px; margin: 0 0 20px 0; }
.wps-save-bar__time { font-size: 13px; color: var(--wps-text-muted); }

/* 5. Instance nav
   ======================================================================== */

.wps-instance-nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 25px 0 20px; }
.wps-instance-switcher { position: relative; }
.wps-instance-switcher__toggle { display: flex; align-items: center; gap: 10px; min-width: 280px; max-width: 460px; min-height: 50px; padding: 6px 16px 6px 20px; background: var(--wps-surface); border: 1px solid var(--wps-border-warm); border-radius: 26px; cursor: pointer; text-align: left; font-size: 15px; color: var(--wps-text); }
.wps-instance-switcher__toggle:hover,
.wps-instance-switcher__toggle[aria-expanded="true"] { border-color: var(--wps-brand); }
.wps-instance-switcher__toggle.is-single,
.wps-instance-switcher__toggle.is-single:hover { cursor: default; border-color: var(--wps-border-warm); box-sizing: border-box; }
.wps-instance-switcher__eyebrow { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--wps-text-muted); }
.wps-instance-switcher__name { flex: 1; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wps-instance-switcher__toggle .dashicons { color: var(--wps-text-muted); }
.wps-instance-switcher__toggle[aria-expanded="true"] .dashicons { transform: rotate(180deg); }
.wps-instance-switcher__panel { position: absolute; top: calc( 100% + 8px ); left: 0; z-index: 100; width: 100%; min-width: 280px; background: var(--wps-surface); border-radius: var(--wps-radius); box-shadow: var(--wps-shadow-pop); overflow: hidden; }
.wps-instance-switcher__panel[hidden] { display: none; }
body.settings_page_wps_aa .wps-wrap .wps-instance-switcher__search { display: block; width: calc( 100% - 24px ); max-width: none; margin: 12px; }
.wps-instance-switcher__list { max-height: 320px; overflow-y: auto; margin: 0; padding: 0 0 8px; list-style: none; border-top: 1px solid var(--wps-border-soft); }
.wps-instance-switcher__search + .wps-instance-switcher__list { padding-top: 4px; }
.wps-instance-switcher__list li { margin: 0; }
.wps-wrap .wps-instance-switcher__list a { display: block; padding: 10px 20px; text-decoration: none; font-size: 14px; color: var(--wps-text); }
.wps-wrap .wps-instance-switcher__list a:hover,
.wps-wrap .wps-instance-switcher__list a:focus { background: var(--wps-brand-tint); outline: none; box-shadow: none; }
.wps-wrap .wps-instance-switcher__list a.is-current { font-weight: 700; color: var(--wps-brand); }
.wps-instance-switcher__empty { margin: 0; padding: 4px 20px 14px; color: var(--wps-text-muted); }
.wps-instance-actions { position: relative; }
.wps-instance-actions .wps-instance-menu-toggle { width: 44px; height: 44px; padding: 0 0 8px; font-size: 18px; line-height: 1; cursor: pointer; color: var(--wps-text); background: var(--wps-surface); border: 1px solid var(--wps-border-warm); border-radius: var(--wps-radius-pill); }
.wps-instance-actions .wps-instance-menu-toggle:hover { background: var(--wps-brand-tint); }
.wps-instance-menu { display: none; position: absolute; top: calc( 100% + 8px ); left: 0; z-index: 100; min-width: 220px; background: var(--wps-surface); border-radius: var(--wps-radius); box-shadow: var(--wps-shadow-pop); padding: 8px 0; }
.wps-wrap .wps-instance-menu a { display: flex; align-items: center; gap: 10px; padding: 10px 18px; text-decoration: none; color: var(--wps-text); font-size: 14px; }
.wps-wrap .wps-instance-menu a:hover { background: var(--wps-brand-tint); }
.wps-instance-menu .dashicons { font-size: 17px; width: 17px; height: 17px; color: var(--wps-text-muted); }
.wps-wrap .wps-instance-menu a.wps-instance-menu__delete { border-top: 1px solid var(--wps-border-soft); margin-top: 8px; padding-top: 14px; color: var(--wps-danger); }
.wps-instance-menu__delete .dashicons { color: var(--wps-danger); }

.wps-add-instance-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 50px; box-sizing: border-box; padding: 0 22px; border: 1px solid var(--wps-brand); border-radius: var(--wps-radius-pill); text-decoration: none; color: var(--wps-brand); font-weight: 700; }
.wps-add-instance-btn:hover { background: var(--wps-brand-tint); }
.wps-add-instance-btn.is-locked { border-style: dashed; border-color: var(--wps-border-strong); color: var(--wps-text-dim); cursor: pointer; }
.wps-add-instance-btn.is-locked:hover { background: var(--wps-surface); }

.wps-instance-origin { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 0 0 20px; padding: 14px 18px; background: var(--wps-surface); border: 1px solid var(--wps-border-warm); border-left: 4px solid var(--wps-brand); border-radius: var(--wps-radius-sm); }
.wps-instance-origin p { flex: 1 1 320px; margin: 0; }
body.settings_page_wps_aa .wps-wrap .wps-instance-origin .button { padding: 0 14px; min-height: 30px; line-height: 28px; font-size: 13px; }
.wps-instance-rename { display: flex; align-items: center; gap: 12px; margin: 0 0 20px; }
.wps-instance-rename label { font-weight: 600; }

/* 8. Sidebar cards (from Confetti)
   ======================================================================== */

.wps-card { padding: 20px 24px; }
.wps-card__eyebrow { margin: 0 0 10px 0; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--wps-text-muted); }
.wps-card p:last-child { margin-bottom: 0; }

.wps-card--upgrade { background: var(--wps-dark); border-color: var(--wps-dark); color: var(--wps-text-on-brand); }
.wps-card--upgrade .wps-card__eyebrow { color: var(--wps-brand); }
.wps-card--upgrade h3 { margin: 0 0 16px 0; font-size: 19px; line-height: 1.3; color: var(--wps-text-on-brand); }
.wps-card--upgrade ul { margin: 0 0 20px 0; }
.wps-card--upgrade li { position: relative; padding-left: 22px; margin: 0 0 8px 0; font-size: 13px; color: var(--wps-text-on-dark); }
.wps-card--upgrade li:before { content: "\2713"; position: absolute; left: 0; color: var(--wps-brand); font-weight: bold; }
/* Outlined and small on purpose, so the upsell never outweighs Save. */
body.settings_page_wps_aa .wps-card--upgrade .button-primary { display: inline-block; width: auto; padding: 6px 18px; font-size: 13px; background: transparent; color: var(--wps-brand); border: 1px solid var(--wps-brand); }
body.settings_page_wps_aa .wps-card--upgrade .button-primary:hover { background: var(--wps-brand); color: var(--wps-text-on-brand); border-color: var(--wps-brand); }
.wps-card p.wps-card__fineprint { margin: 10px 0 0 0; font-size: 12px; color: var(--wps-text-dim); }

.wps-card--plugins ul { margin: 0; }
.wps-card--plugins li { margin: 0 0 16px 0; }
.wps-card--plugins li:last-child { margin-bottom: 0; }
.wps-card--plugins li a { display: block; font-weight: 600; text-decoration: none; }
.wps-card--plugins li .description { font-size: 12px; }

/* Small shared bits */
.wps-panel__intro { margin: 14px 0 4px; color: var(--wps-text-muted); max-width: 640px; }
.wps-tab-intro { margin: 25px 0 20px; color: var(--wps-text-muted); font-size: 14px; }
.wps-input-suffix { display: inline-flex; align-items: center; gap: 6px; color: var(--wps-text-muted); font-size: 13px; }
.wps-inline-field { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
body.settings_page_wps_aa .wps-inline-field .button { padding: 0 20px; min-height: 36px; }
.wps-license-status { margin: 10px 0 0; font-weight: 600; }
.wps-license-status.is-ok { color: var(--wps-success); }
.wps-license-status.is-error { color: var(--wps-danger); }
/* Address field: type a selector OR pick it on the page, side by side */
.wps-aa-field-choice { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 24px; align-items: stretch; margin-top: 20px; }
.wps-aa-field-choice.is-single { grid-template-columns: minmax(0, 1fr); max-width: 520px; }
.wps-aa-field-choice__label { display: block; margin: 0 0 8px; font-weight: 600; color: var(--wps-text-heading); }
body.settings_page_wps_aa .wps-wrap .wps-aa-field-choice input[type="text"],
body.settings_page_wps_aa .wps-wrap .wps-aa-field-choice input[type="url"],
.wps-aa-field-choice select { width: 100%; max-width: none; }
.wps-aa-field-choice .description { margin: 8px 0 0; }
.wps-aa-field-choice__or { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 22px; font-weight: 800; text-transform: uppercase; color: var(--wps-brand); }
.wps-aa-field-choice__or::before,
.wps-aa-field-choice__or::after { content: ""; flex: 1; width: 1px; background: var(--wps-border); }
.wps-aa-picker-start { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
body.settings_page_wps_aa .wps-wrap .button.wps-aa-pick-button { padding: 0 14px; min-height: 30px; line-height: 28px; font-size: 13px; }
.wps-aa-pick-status { margin: 8px 0 0; }
@media (max-width: 900px) {
	.wps-aa-field-choice { grid-template-columns: minmax(0, 1fr); gap: 16px; }
	.wps-aa-field-choice__or { flex-direction: row; }
	.wps-aa-field-choice__or::before,
	.wps-aa-field-choice__or::after { width: auto; height: 1px; }
}
.wps-aa-pick-status:empty { display: none; }
.wps-aa-pick-status.is-ok { color: var(--wps-success); font-weight: 600; }
.wps-aa-pick-status.is-error { color: var(--wps-danger); }
.wps-aa-key-test-result { flex-basis: 100%; margin: 0; }
.wps-aa-key-test-result:empty { display: none; }
.wps-aa-key-test-result.is-ok { color: var(--wps-success); font-weight: 600; }
.wps-aa-key-test-result.is-error { color: var(--wps-danger); }
body.settings_page_wps_aa .wps-wrap input[type="text"],
body.settings_page_wps_aa .wps-wrap input[type="number"],
body.settings_page_wps_aa .wps-wrap select,
body.settings_page_wps_aa .wps-setup input[type="text"] { border-color: var(--wps-border-strong); border-radius: var(--wps-radius-sm); min-height: 36px; }
body.settings_page_wps_aa .wps-wrap select { padding-right: 28px; }

/* select2, restyled to match the other inputs */
.wps-wrap .select2-container { max-width: 620px; width: 100% !important; }
.wps-wrap .select2-container--default .select2-selection--multiple { border-color: var(--wps-border-strong); border-radius: var(--wps-radius-sm); min-height: 36px; padding: 2px 4px; }
.wps-wrap .select2-container--default.select2-container--focus .select2-selection--multiple { border-color: var(--wps-brand); box-shadow: 0 0 0 1px var(--wps-brand); }
.wps-wrap .select2-container--default .select2-selection--multiple .select2-selection__choice { background: var(--wps-brand-tint); border: 1px solid var(--wps-brand-tint-border); border-radius: var(--wps-radius-pill); padding: 2px 10px; margin-top: 4px; color: var(--wps-text); }
.wps-wrap .select2-container--default .select2-selection--multiple .select2-selection__choice__remove { color: var(--wps-brand); margin-right: 4px; }
.wps-wrap .select2-search--inline .select2-search__field { min-height: 0 !important; margin-top: 6px; }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--wps-brand); }

/* 6. Fields to fill in
   ======================================================================== */

.wps-aa-fields { margin: 16px 0 0; }
.wps-aa-fields__head,
.wps-aa-field { display: grid; grid-template-columns: minmax( 150px, 220px ) minmax( 0, 1fr ) 72px 32px; gap: 12px; align-items: start; }
.wps-aa-fields__head { padding: 0 0 8px; border-bottom: 1px solid var(--wps-border-soft); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--wps-text-muted); }
.wps-aa-field { padding: 12px 0; border-bottom: 1px solid var(--wps-border-faint); }
.wps-aa-field:last-child { border-bottom: none; }
.wps-aa-field__selector input { width: 100%; font-size: 13px; }
.wps-aa-field__delay input { width: 52px; padding-right: 2px; }
.wps-aa-remove-field { background: none; border: none; padding: 0; width: 32px; height: 36px; cursor: pointer; color: var(--wps-text-faint); border-radius: var(--wps-radius-sm); }
.wps-aa-remove-field:hover { color: var(--wps-danger); background: #fcf0f1; }
.wps-aa-remove-field .dashicons { font-size: 18px; width: 18px; height: 18px; }
.wps-aa-fields__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 16px 0 0; }
.wps-aa-fields__foot .description { margin: 0; color: var(--wps-text-muted); }
body.settings_page_wps_aa .wps-aa-fields__foot .button { padding: 0 18px; min-height: 34px; }

@media screen and ( max-width: 50rem ) {
	.wps-aa-fields__head { display: none; }
	.wps-aa-field { grid-template-columns: 1fr 72px 32px; }
	.wps-aa-field__selector { grid-column: 1 / -1; }
}

/* 7. Template chips
   ======================================================================== */

/* The textarea stays in the form and is what gets saved. The chip box below
   it is what people see and type into. */
.wps-aa-template.is-ready .wps-aa-template-source { display: none; }
.wps-aa-template { position: relative; }
.wps-aa-template__box { display: flex; align-items: flex-start; gap: 8px; min-height: 36px; box-sizing: border-box; padding: 4px 4px 4px 8px; background: var(--wps-surface); border: 1px solid var(--wps-border-strong); border-radius: var(--wps-radius-sm); cursor: text; }
.wps-aa-template__box:focus-within { border-color: var(--wps-brand); box-shadow: 0 0 0 1px var(--wps-brand); }
.wps-aa-template__editor { flex: 1 1 auto; min-width: 0; min-height: 26px; padding: 3px 0; line-height: 26px; white-space: pre-wrap; word-break: break-word; outline: none; font-size: 14px; }
.wps-aa-template__editor:empty:before { content: attr(data-placeholder); color: var(--wps-text-faint); }

.wps-aa-chip { display: inline-flex; align-items: center; gap: 4px; margin: 0 2px; padding: 0 10px; line-height: 24px; font-size: 13px; background: #e7ecf2; color: var(--wps-text); border-radius: var(--wps-radius-pill); cursor: pointer; user-select: none; vertical-align: baseline; white-space: nowrap; }
.wps-aa-chip:hover,
.wps-aa-chip.is-editing { background: var(--wps-brand-tint); box-shadow: 0 0 0 1px var(--wps-brand-tint-border); }
.wps-aa-chip__mod { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--wps-text-muted); }
.wps-aa-chip.has-extras:after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--wps-brand); }
.wps-aa-chip.is-unknown { background: #f6f7f7; font-family: Menlo, Consolas, monospace; font-size: 12px; }

.wps-aa-template__insert { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; border: 1px solid var(--wps-border); border-radius: var(--wps-radius-pill); background: var(--wps-surface); color: var(--wps-text-muted); font-size: 12px; cursor: pointer; white-space: nowrap; }
.wps-aa-template__insert:hover,
.wps-aa-template__insert[aria-expanded="true"] { border-color: var(--wps-brand); color: var(--wps-brand); }
.wps-aa-template__insert .dashicons { font-size: 14px; width: 14px; height: 14px; }

/* The two floating menus: pick a part of the address, and edit one chip. */
.wps-aa-pop { position: absolute; z-index: 1000; top: calc( 100% + 6px ); right: 0; width: 300px; max-width: calc( 100vw - 40px ); background: var(--wps-surface); border-radius: var(--wps-radius); box-shadow: var(--wps-shadow-pop); }
.wps-aa-pop--list { max-height: 320px; overflow-y: auto; padding: 6px 0; }
.wps-aa-pop--list button { display: flex; justify-content: space-between; gap: 10px; width: 100%; padding: 8px 16px; background: none; border: none; text-align: left; cursor: pointer; font-size: 13px; color: var(--wps-text); }
.wps-aa-pop--list button:hover,
.wps-aa-pop--list button:focus-visible { background: var(--wps-brand-tint); outline: none; }
.wps-aa-pop--list button small { color: var(--wps-text-dim); font-family: Menlo, Consolas, monospace; font-size: 11px; }

.wps-aa-pop--edit { left: 0; right: auto; padding: 16px 18px; }
.wps-aa-pop__title { margin: 0 0 12px; font-weight: 700; font-size: 14px; }
.wps-aa-pop__field { margin: 0 0 14px; }
.wps-aa-pop__field > label,
.wps-aa-pop__label { display: block; margin: 0 0 5px; font-size: 12px; font-weight: 600; color: var(--wps-text); }
.wps-aa-pop__field input[type="text"],
.wps-aa-pop__field select { width: 100%; }
.wps-aa-pop__hint { margin: 4px 0 0; font-size: 12px; color: var(--wps-text-muted); }
.wps-aa-pop__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wps-aa-pop__fallbacks { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; }
.wps-aa-pop__fallbacks:empty { display: none; }
.wps-aa-pop__fallbacks .wps-aa-chip { cursor: default; }
.wps-aa-pop__fallbacks button { background: none; border: none; padding: 0; cursor: pointer; color: var(--wps-text-muted); font-size: 14px; line-height: 1; }
.wps-aa-pop__fallbacks button:hover { color: var(--wps-danger); }
.wps-aa-pop__foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--wps-border-soft); margin: 4px -18px -16px; padding: 10px 18px; }
.wps-aa-pop__remove { background: none; border: none; padding: 0; color: var(--wps-danger); cursor: pointer; font-size: 13px; }
body.settings_page_wps_aa .wps-aa-pop__foot .button { padding: 0 16px; min-height: 30px; line-height: 28px; font-size: 13px; }

.wps-seg { display: inline-flex; border: 1px solid var(--wps-border); border-radius: var(--wps-radius-pill); padding: 2px; }
.wps-seg label { position: relative; }
.wps-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.wps-seg span { display: block; padding: 3px 14px; border-radius: var(--wps-radius-pill); font-size: 12px; cursor: pointer; }
.wps-seg input:checked + span { background: var(--wps-brand); color: var(--wps-text-on-brand); font-weight: 600; }
.wps-seg input:focus-visible + span { outline: 2px solid var(--wps-brand); outline-offset: 1px; }


/* 9. Choice cards, switches, integrations
   ======================================================================== */

.wps-choice-cards { display: grid; grid-template-columns: repeat( auto-fit, minmax( 200px, 1fr ) ); gap: 10px; max-width: 620px; }
.wps-choice-card { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 12px 14px 12px 40px; border: 1px solid var(--wps-border); border-radius: var(--wps-radius-sm); background: var(--wps-surface); cursor: pointer; }
.wps-choice-card:hover { border-color: var(--wps-border-muted); }
.wps-choice-card:has( input:checked ) { border-color: var(--wps-brand); background: var(--wps-brand-tint); box-shadow: 0 0 0 1px var(--wps-brand); }
.wps-choice-card input { position: absolute; left: 14px; top: 14px; margin: 0; }
.wps-choice-card__name { font-weight: 700; font-size: 13px; color: var(--wps-text); }
.wps-choice-card__blurb { font-size: 12px; color: var(--wps-text-muted); line-height: 1.4; }

.wps-switch { position: relative; display: inline-block; flex: 0 0 auto; width: 40px; height: 22px; }
.wps-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.wps-switch__slider { position: absolute; inset: 0; background: var(--wps-switch-off); border-radius: var(--wps-radius-pill); transition: background-color var(--wps-speed); }
.wps-switch__slider:before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: var(--wps-surface); border-radius: 50%; transition: transform var(--wps-speed); }
.wps-switch input:checked + .wps-switch__slider { background: var(--wps-brand); }
.wps-switch input:checked + .wps-switch__slider:before { transform: translateX( 18px ); }
.wps-switch input:focus-visible + .wps-switch__slider { outline: 2px solid var(--wps-brand); outline-offset: 2px; }

.wps-integrations { list-style: none; margin: 0 0 20px; padding: 0; background: var(--wps-surface); border: 1px solid var(--wps-border-warm); border-radius: var(--wps-radius); box-shadow: var(--wps-shadow-card); max-width: 820px; }
.wps-integration { margin: 0; padding: 18px 24px; border-bottom: 1px solid var(--wps-border-soft); }
.wps-integration:last-child { border-bottom: none; }
.wps-integration__head { display: flex; align-items: center; gap: 12px; }
.wps-wrap .wps-integration__name,
.wps-integration__name { margin: 0; font-size: 15px; color: var(--wps-text); }
.wps-integration__state { font-size: 12px; color: var(--wps-text-dim); }
.wps-wrap a.wps-integration__doc { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; font-size: 13px; text-decoration: none; }
.wps-integration__doc .dashicons { font-size: 15px; width: 15px; height: 15px; }
.wps-integration__note { margin: 8px 0 0; font-size: 13px; color: var(--wps-text-muted); }
.wps-integration__toggle { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; font-size: 14px; cursor: pointer; }
.wps-integration.is-inactive .wps-integration__name { color: var(--wps-text-dim); }

/* 10. Setup wizard
   ======================================================================== */

.wps-setup { max-width: 640px; margin: 0 auto; padding: 50px 20px 80px; }
.wps-setup__logo { text-align: center; margin: 0 0 30px; }
.wps-setup__logo img { height: 56px; width: auto; }

.wps-setup__progress { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 22px; list-style: none; margin: 0 0 24px; padding: 0; }
.wps-setup__progress li { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--wps-text-dim); }
.wps-setup__num { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--wps-border-strong); font-size: 12px; font-weight: 700; background: var(--wps-surface); }
.wps-setup__progress li.is-current { color: var(--wps-text); font-weight: 600; }
.wps-setup__progress li.is-current .wps-setup__num { background: var(--wps-brand); border-color: var(--wps-brand); color: var(--wps-text-on-brand); }
.wps-setup__progress li.is-done .wps-setup__num { background: var(--wps-brand-tint); border-color: var(--wps-brand-tint-border); color: var(--wps-brand); font-size: 0; }
.wps-setup__progress li.is-done .wps-setup__num:before { content: "\2713"; font-size: 13px; }

.wps-setup__card { background: var(--wps-surface); border: 1px solid var(--wps-border-warm); border-radius: var(--wps-radius-lg); box-shadow: var(--wps-shadow-card); padding: 36px 40px; }
.wps-setup__card h1 { margin: 0 0 10px; padding: 0; font-size: 26px; line-height: 1.25; color: var(--wps-dark); }
.wps-setup__lead { margin: 0 0 26px; font-size: 15px; color: var(--wps-text-muted); }
.wps-setup__field { margin: 0 0 24px; }
.wps-setup__field > label,
.wps-setup__label { display: block; margin: 0 0 8px; font-weight: 600; font-size: 14px; }
.wps-setup__field input.large-text { font-size: 16px; padding: 6px 12px; }
.wps-setup__field .description { margin: 8px 0 0; color: var(--wps-text-muted); }
.wps-setup__card .notice { margin: 0 0 20px; }

.wps-setup__actions { display: flex; align-items: center; gap: 20px; margin: 30px 0 0; }
body.settings_page_wps_aa .wps-setup__actions .button-primary { background: var(--wps-brand); color: var(--wps-text-on-brand); padding: 8px 30px; font-size: 15px; }
body.settings_page_wps_aa .wps-setup__actions .button-primary:hover { background: var(--wps-brand-hover); border-color: var(--wps-brand-hover); }
.wps-setup__skip { background: none; border: none; padding: 0; color: var(--wps-text-muted); cursor: pointer; font-size: 14px; }
.wps-setup__skip:hover { color: var(--wps-text); text-decoration: underline; }
.wps-setup__exit { text-align: center; margin: 20px 0 0; }
.wps-setup__exit a { color: var(--wps-text-muted); font-size: 13px; }

.wps-setup__promo { padding: 18px 20px; background: var(--wps-page-bg); border-radius: var(--wps-radius); }
.wps-setup__promo p:first-child { margin-top: 0; }
.wps-setup__promo p:last-child { margin-bottom: 0; }
.wps-setup__found { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.wps-setup__found li { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 6px 12px; background: var(--wps-surface); border: 1px solid var(--wps-border-warm); border-radius: var(--wps-radius-pill); font-weight: 600; }
.wps-integrations--setup { box-shadow: none; margin-bottom: 14px; }
.wps-integrations--setup .wps-integration { padding: 16px 20px; }

.wps-setup__warning { margin: 0 0 20px; padding: 12px 16px; border-left: 4px solid var(--wps-brand); background: var(--wps-brand-tint); }
.wps-setup__next { margin: 0; }
.wps-setup__next li { margin: 0 0 10px; }
.wps-setup__next a { display: block; padding: 14px 18px; border: 1px solid var(--wps-border-warm); border-radius: var(--wps-radius); text-decoration: none; color: var(--wps-text); }
.wps-setup__next a:hover { border-color: var(--wps-brand); background: var(--wps-brand-tint-hover); }
.wps-setup__next strong { display: block; color: var(--wps-brand); font-size: 15px; }
.wps-setup__next span { font-size: 13px; color: var(--wps-text-muted); }
.wps-setup a { color: var(--wps-brand); }
.wps-setup a:hover { color: var(--wps-brand-hover); }
