/* AIPCF settings screen - design system. Scoped to .aipcf-wrap. */
.aipcf-wrap {
  --aipcf-accent: #f6821f;
  --aipcf-accent-2: #fbad41;
  --aipcf-accent-ink: #b45309;
  --aipcf-ink: #1d2327;
  --aipcf-muted: #646970;
  --aipcf-line: #e3e5e8;
  --aipcf-soft: #f6f7f8;
  --aipcf-ok: #1a9a52;
  --aipcf-ok-ink: #15803d; /* green as text: 5.0:1 on white (--aipcf-ok is for dots and icons) */
  --aipcf-warn: #b26200;
  --aipcf-bad: #d63638;
  --aipcf-bad-ink: #b32d2e; /* red as text: 5.9:1 on white */
  --aipcf-radius: 12px;
  --aipcf-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .08);
  --aipcf-ring: 0 0 0 3px rgba(246, 130, 31, .22);
  max-width: 1180px;
  margin-right: 20px;
  color: var(--aipcf-ink);
}

/* == Header ================================================================== */
.aipcf-header {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 0 14px;
}
.aipcf-logo {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--aipcf-accent), var(--aipcf-accent-2));
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 6px 16px rgba(246, 130, 31, .28);
  flex: 0 0 auto;
}
.aipcf-logo .dashicons { font-size: 26px; width: 26px; height: 26px; }
.aipcf-header-title { flex: 1 1 220px; min-width: 0; }
.aipcf-header h1 {
  margin: 0;
  padding: 0;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
}
.aipcf-header .aipcf-sub {
  margin: 3px 0 0;
  color: var(--aipcf-muted);
  font-size: 13px;
}
.aipcf-header-side {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.aipcf-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid var(--aipcf-line);
  background: #fff;
  text-decoration: none;
  color: var(--aipcf-ink);
}
.aipcf-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a7aaad;
  box-shadow: 0 0 0 3px rgba(167, 170, 173, .25);
}
.aipcf-pill.is-ok::before   { background: var(--aipcf-ok);   box-shadow: 0 0 0 3px rgba(26, 154, 82, .2); }
.aipcf-pill.is-warn::before { background: var(--aipcf-warn); box-shadow: 0 0 0 3px rgba(178, 98, 0, .2); }
.aipcf-pill.is-bad::before  { background: var(--aipcf-bad);  box-shadow: 0 0 0 3px rgba(214, 54, 56, .2); }
.aipcf-wrap .wp-header-end { margin: 0; }

/* == Layout ================================================================== */
.aipcf-layout {
  display: grid;
  grid-template-columns: 236px minmax(0, 780px);
  gap: 24px;
  align-items: start;
  margin-top: 6px;
}
.aipcf-side { position: sticky; top: 48px; display: flex; flex-direction: column; gap: 14px; }
.aipcf-about {
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--aipcf-line);
  border-radius: var(--aipcf-radius);
  box-shadow: var(--aipcf-shadow);
}
.aipcf-about h2 {
  margin: 0 0 6px;
  padding: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--aipcf-muted);
}
.aipcf-about p { margin: 0 0 6px; font-size: 12.5px; line-height: 1.5; color: var(--aipcf-muted); }
.aipcf-about p:last-child { margin-bottom: 0; }
.aipcf-about .aipcf-version { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--aipcf-line); font-size: 11.5px; color: var(--aipcf-muted); } /* 5.5:1; #8c8f94 was 3.4:1 */
.aipcf-about .aipcf-reset-link { color: var(--aipcf-muted); text-decoration: underline; }
.aipcf-about .aipcf-reset-link.aipcf-danger,
.aipcf-about .aipcf-reset-link:hover { color: var(--aipcf-bad-ink); }
.aipcf-about .aipcf-reset-link::before { content: "\00B7"; display: inline-block; margin: 0 6px 0 2px; color: #c3c4c7; text-decoration: none; }
.aipcf-toolbar { display: flex; justify-content: flex-end; margin: 0 0 8px; min-height: 0; }
.aipcf-toolbar:empty, .aipcf-toolbar:has(> [hidden]:only-child) { display: none; }
.aipcf-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  background: var(--aipcf-soft);
  border: 1px solid var(--aipcf-line);
  border-radius: var(--aipcf-radius);
}
.aipcf-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: 9px;
  color: var(--aipcf-ink);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background .15s, box-shadow .15s;
}
.aipcf-nav a:hover { background: #fff; }
.aipcf-nav a:focus-visible { outline: 2px solid transparent; box-shadow: var(--aipcf-ring); }
.aipcf-nav a.is-active {
  background: #fff;
  border-color: var(--aipcf-line);
  box-shadow: var(--aipcf-shadow);
}
.aipcf-nav .aipcf-nav-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--aipcf-muted);
  border: 1px solid var(--aipcf-line);
  flex: 0 0 auto;
}
.aipcf-nav .aipcf-nav-icon .dashicons { font-size: 17px; width: 17px; height: 17px; }
.aipcf-nav a.is-active .aipcf-nav-icon {
  background: linear-gradient(135deg, var(--aipcf-accent), var(--aipcf-accent-2));
  color: #fff;
  border-color: transparent;
}
.aipcf-nav .aipcf-nav-text { min-width: 0; line-height: 1.25; }
.aipcf-nav .aipcf-nav-label { display: block; font-weight: 600; font-size: 13px; }
.aipcf-nav .aipcf-nav-desc {
  display: block;
  font-size: 11.5px;
  color: var(--aipcf-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.aipcf-main { min-width: 0; max-width: 780px; }

/* == Panels (one per settings section) ======================================= */
.aipcf-panel,
.aipcf-card {
  background: #fff;
  border: 1px solid var(--aipcf-line);
  border-radius: var(--aipcf-radius);
  box-shadow: var(--aipcf-shadow);
}
.aipcf-panel { padding: 20px 24px 8px; margin: 0 0 18px; }
.aipcf-panel > h2 {
  margin: 0 0 4px;
  padding: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}
.aipcf-panel > p { margin: 4px 0 10px; color: var(--aipcf-muted); }
.aipcf-panel > p a { color: #2271b1; }
.aipcf-wrap .form-table { margin-top: 4px; width: 100%; table-layout: fixed; }
.aipcf-wrap .form-table td { min-width: 0; overflow-wrap: anywhere; }
.aipcf-wrap .form-table th {
  width: 190px;
  padding: 14px 16px 14px 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--aipcf-ink);
  line-height: 1.4;
}
.aipcf-wrap .form-table td { padding: 12px 0; }
.aipcf-wrap .form-table tr + tr th,
.aipcf-wrap .form-table tr + tr td { border-top: 1px solid #f0f0f1; }
.aipcf-wrap .form-table .description { color: var(--aipcf-muted); font-size: 12.5px; }
.aipcf-wrap .form-table p.description { margin: 6px 0 0; }

/* Inputs */
.aipcf-wrap .aipcf-main input[type="text"],
.aipcf-wrap .aipcf-main input[type="password"],
.aipcf-wrap .aipcf-main input[type="number"],
.aipcf-wrap .aipcf-main input[type="email"],
.aipcf-wrap .aipcf-main select,
.aipcf-wrap .aipcf-main textarea {
  border: 1px solid #c9ccd1;
  border-radius: 8px;
  padding: 6px 10px;
  min-height: 34px;
  box-shadow: none;
  background: #fff;
  color: var(--aipcf-ink);
  transition: border-color .15s, box-shadow .15s;
}
.aipcf-wrap .aipcf-main select { padding: 0 30px 0 10px; height: 34px; line-height: 32px; max-width: 100%; width: auto; }
.aipcf-wrap .aipcf-main select#aipcf_preferred_model,
.aipcf-wrap .aipcf-main select[name$="[light_model]"],
.aipcf-wrap .aipcf-main select[name$="[image_model]"] { width: 100%; max-width: 640px; text-overflow: ellipsis; }
.aipcf-wrap .aipcf-main textarea { line-height: 1.5; }
.aipcf-wrap .aipcf-main input.regular-text,
.aipcf-wrap .aipcf-main input.large-text,
.aipcf-wrap .aipcf-main textarea { max-width: 100%; box-sizing: border-box; }
.aipcf-wrap .aipcf-main input[type="number"] { padding: 6px 6px 6px 10px; min-width: 7.5em; }
.aipcf-wrap .aipcf-main input:focus,
.aipcf-wrap .aipcf-main select:focus,
.aipcf-wrap .aipcf-main textarea:focus {
  border-color: var(--aipcf-accent);
  box-shadow: var(--aipcf-ring);
  outline: 2px solid transparent;
}

/* Checkboxes as switches: single on/off settings. Lists of choices (.aipcf-choices) keep
   ordinary checkboxes, which read as "pick any" rather than "turn on". */
.aipcf-wrap .aipcf-main input[type="checkbox"]:not(.aipcf-choices input) {
  -webkit-appearance: none;
  appearance: none;
  width: 38px;
  height: 22px;
  margin: 0 8px 0 0;
  border: 0;
  border-radius: 999px;
  background: #c9ccd1;
  position: relative;
  vertical-align: middle;
  box-shadow: none;
  cursor: pointer;
  transition: background .18s;
  flex: 0 0 auto;
}
.aipcf-wrap .aipcf-main input[type="checkbox"]:not(.aipcf-choices input)::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  margin: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  transition: transform .18s;
}
.aipcf-wrap .aipcf-main input[type="checkbox"]:not(.aipcf-choices input):checked { background: var(--aipcf-accent); }
.aipcf-wrap .aipcf-main input[type="checkbox"]:not(.aipcf-choices input):checked::before { content: ""; transform: translateX(16px); }
.aipcf-wrap .aipcf-main input[type="checkbox"]:focus-visible { outline: 2px solid transparent; box-shadow: var(--aipcf-ring); }
.aipcf-wrap .aipcf-main input[type="checkbox"]:disabled { opacity: .5; cursor: default; }
.aipcf-wrap .aipcf-main label { display: inline-flex; align-items: center; line-height: 1.4; margin: 2px 0; }
.aipcf-wrap .aipcf-main label + label { margin-left: 10px; }
.aipcf-choices { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; border: 0; }
.aipcf-wrap .aipcf-main .aipcf-choices label + label { margin-left: 0; }
.aipcf-wrap .aipcf-main .aipcf-choices input[type="checkbox"] { margin: 0 6px 0 0; }
.aipcf-unit { margin-left: 8px; color: var(--aipcf-muted); font-size: 13px; }

/* Disclosures */
.aipcf-wrap .aipcf-main details {
  margin: 8px 0;
  padding: 10px 14px;
  border: 1px solid var(--aipcf-line);
  border-radius: 10px;
  background: var(--aipcf-soft);
}
.aipcf-wrap .aipcf-main details > summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--aipcf-ink);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.aipcf-wrap .aipcf-main details > summary::-webkit-details-marker { display: none; }
.aipcf-wrap .aipcf-main details > summary::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--aipcf-accent);
  border-bottom: 2px solid var(--aipcf-accent);
  transform: rotate(-45deg);
  transition: transform .15s;
  flex: 0 0 auto;
}
.aipcf-wrap .aipcf-main details[open] > summary::before { transform: rotate(45deg); }
.aipcf-wrap .aipcf-main details[open] > summary { margin-bottom: 8px; }
.aipcf-wrap .aipcf-main details .form-table th { width: 180px; padding-top: 10px; padding-bottom: 10px; }
.aipcf-wrap .aipcf-main details .form-table td { padding: 8px 0; }

/* == Buttons: one system for every screen ====================================
   WordPress's own .button / .button-primary and the plugin's .aipcf-btn look the same:
   pill shape, white secondary, orange gradient primary (one per view), red danger. */
.aipcf-wrap .button,
.aipcf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--aipcf-line);
  background: #fff;
  color: var(--aipcf-ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  text-shadow: none;
  box-shadow: none;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.aipcf-wrap .button:hover,
.aipcf-btn:hover { border-color: #b8bbc0; background: #fff; color: var(--aipcf-ink); }
.aipcf-wrap .button .dashicons,
.aipcf-btn .dashicons { font-size: 16px; width: 16px; height: 16px; line-height: 1; }
.aipcf-wrap .button-primary,
.aipcf-btn-primary {
  background: linear-gradient(135deg, var(--aipcf-accent), var(--aipcf-accent-2));
  border-color: transparent;
  /* Dark text on the brand orange: 6.2:1 (white was 2.6:1, below WCAG AA's 4.5:1). */
  color: #1d2327;
  padding: 0 18px;
}
.aipcf-wrap .button-primary:hover,
.aipcf-btn-primary:hover { background: linear-gradient(135deg, #e3730f, var(--aipcf-accent)); border-color: transparent; color: #1d2327; box-shadow: 0 4px 12px rgba(246, 130, 31, .3); }
.aipcf-wrap .button-small,
.aipcf-btn-sm { min-height: 28px; padding: 0 11px; font-size: 12.5px; }
.aipcf-wrap .button.aipcf-danger,
.aipcf-btn.aipcf-danger { color: var(--aipcf-bad-ink); border-color: #e7b3b4; }
.aipcf-wrap .button.aipcf-danger:hover,
.aipcf-btn.aipcf-danger:hover { background: #fcf0f1; border-color: var(--aipcf-bad-ink); color: var(--aipcf-bad-ink); }
.aipcf-wrap .button:disabled,
.aipcf-wrap .button[aria-disabled="true"],
.aipcf-btn:disabled { opacity: .55; cursor: default; box-shadow: none; }
.aipcf-wrap .button:focus-visible,
.aipcf-btn:focus-visible,
.aipcf-textlink:focus-visible,
.aipcf-wrap .button-link:focus-visible {
  outline: 2px solid transparent; /* still visible in forced-colours mode */
  box-shadow: var(--aipcf-ring);
}
.aipcf-textlink,
.aipcf-wrap .button-link {
  background: none;
  border: 0;
  padding: 0;
  color: #2271b1;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}
.aipcf-textlink:hover,
.aipcf-wrap .button-link:hover { text-decoration: underline; color: #135e96; }
/* Busy: set by settings.js on a clicked .aipcf-busy action until the page changes. */
.aipcf-is-busy { pointer-events: none; opacity: .7; }
.aipcf-is-busy::after {
  content: "";
  display: inline-block;
  margin-left: 6px;
  vertical-align: -2px;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: aipcf-spin .7s linear infinite;
}
/* Buttons already space their content with a gap. */
.aipcf-wrap .button.aipcf-is-busy::after,
.aipcf-btn.aipcf-is-busy::after { margin-left: 0; }
@keyframes aipcf-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .aipcf-is-busy::after { animation: none; } }

/* Sticky save bar. Keyboard focus must never land hidden behind it (WCAG 2.2, 2.4.11):
   scroll focused fields clear of the bar's height. */
html:has(.aipcf-savebar) { scroll-padding-bottom: 96px; }

/* Sticky save bar */
.aipcf-savebar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  padding: 12px 18px;
  border: 1px solid var(--aipcf-line);
  border-radius: var(--aipcf-radius);
  background: rgba(255, 255, 255, .86);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 -4px 18px rgba(16, 24, 40, .06);
}
.aipcf-savebar p.submit { margin: 0; padding: 0; }
.aipcf-savebar .aipcf-savebar-hint { color: var(--aipcf-muted); font-size: 12.5px; }

/* Notices inside the page */
.aipcf-wrap .notice { border-radius: 10px; margin: 0 0 16px; box-shadow: var(--aipcf-shadow); }

/* == Cards and status colours ================================================ */
.aipcf-card { padding: 18px 20px; }
.aipcf-card p { margin: 5px 0; color: #3c434a; }
.aipcf-ok { color: var(--aipcf-ok-ink); }
.aipcf-warn { color: var(--aipcf-warn); }
.aipcf-bad { color: var(--aipcf-bad); }
.aipcf-fail { color: var(--aipcf-bad); font-weight: 600; }
/* An error shown inline right after a button. */
.aipcf-wrap .button + .aipcf-fail,
.aipcf-btn + .aipcf-fail { margin-left: 10px; vertical-align: middle; }
/* Usage bar: <div class="aipcf-bar"><div class="aipcf-bar-fill is-ok|is-warn|is-bad" style="width:N%"></div></div> */
.aipcf-bar { background: #eceef0; border-radius: 999px; height: 8px; overflow: hidden; margin: 6px 0; }
.aipcf-bar > div,
.aipcf-bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--aipcf-ok); transition: width .4s ease; }
.aipcf-bar-fill.is-ok { background: var(--aipcf-ok); }
.aipcf-bar-fill.is-warn { background: var(--aipcf-warn); }
.aipcf-bar-fill.is-bad { background: var(--aipcf-bad); }
.aipcf-wrap input[type="number"] { width: 8em; }

/* Setup panel (first run) */
.aipcf-wrap .aipcf-setup { padding-bottom: 20px; margin: 16px 0; max-width: 760px; }
.aipcf-wrap .aipcf-setup .aipcf-setup-steps { margin: 0 0 12px 1.2em; }
.aipcf-wrap .aipcf-setup .aipcf-setup-howto { margin: 8px 0 0 1.2em; }
.aipcf-wrap .aipcf-setup .aipcf-setup-skip { margin-left: 12px; }

/* API token show/hide */
.aipcf-toggle-key { margin-left: 6px !important; vertical-align: middle; background: none !important; border: none !important; padding: 0 !important; cursor: pointer; }
.aipcf-toggle-key .dashicons { color: #787c82; font-size: 18px; width: 18px; height: 18px; vertical-align: middle; }
.aipcf-toggle-key:hover .dashicons { color: var(--aipcf-ink); }

/* == Responsive ============================================================== */
@media (max-width: 1180px) {
  .aipcf-wrap .form-table th { width: 170px; padding-right: 14px; }
}
@media (max-width: 960px) {
  .aipcf-layout { grid-template-columns: 1fr; gap: 14px; }
  .aipcf-side { position: static; display: contents; }
  /* The About card (with Reset plugin) moves below the settings instead of disappearing. */
  .aipcf-about { order: 3; }
  .aipcf-main { order: 2; }
  .aipcf-nav {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 5px;
  }
  .aipcf-nav::-webkit-scrollbar { display: none; }
  .aipcf-nav a { padding: 7px 12px 7px 8px; white-space: nowrap; }
  .aipcf-nav .aipcf-nav-desc { display: none; }
  .aipcf-nav .aipcf-nav-icon { width: 26px; height: 26px; }
  .aipcf-header-side { margin-left: 0; width: 100%; }
}
@media (max-width: 782px) {
  .aipcf-wrap { margin-right: 10px; }
  .aipcf-panel { padding: 16px 16px 6px; }
  .aipcf-wrap .form-table th { padding: 12px 0 4px; }
  .aipcf-wrap .form-table tr + tr th { border-top: 1px solid #f0f0f1; }
  .aipcf-wrap .form-table tr + tr td { border-top: 0; }
  .aipcf-wrap .aipcf-main input[type="checkbox"] { width: 38px; height: 22px; }
  .aipcf-wrap .aipcf-main input[type="checkbox"]::before { width: 16px; height: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .aipcf-wrap * { transition: none !important; }
}

/* == 1.8.0: readability ====================================================== */
.aipcf-panel > p { font-size: 13px; }
.aipcf-wrap .form-table .description,
.aipcf-wrap .aipcf-main .description { font-size: 12.5px; line-height: 1.5; }

/* Inline disclosures: a link-like summary, content in a soft box */
.aipcf-wrap .aipcf-main details.aipcf-more {
  display: inline-block;
  margin: 2px 0 0;
  padding: 0;
  border: 0;
  background: none;
  vertical-align: baseline;
}
.aipcf-wrap .aipcf-main details.aipcf-more > summary {
  display: inline-flex;
  font-weight: 500;
  font-size: 12.5px;
  color: #2271b1;
}
.aipcf-wrap .aipcf-main details.aipcf-more > summary::before { border-color: #2271b1; width: 6px; height: 6px; }
.aipcf-wrap .aipcf-main details.aipcf-more[open] > summary { margin-bottom: 6px; }
.aipcf-wrap .aipcf-main details.aipcf-more > div,
.aipcf-wrap .aipcf-main details.aipcf-more > p,
.aipcf-wrap .aipcf-main details.aipcf-more > ol {
  display: block;
  margin: 0 0 4px;
  padding: 10px 14px;
  border: 1px solid var(--aipcf-line);
  border-radius: 10px;
  background: var(--aipcf-soft);
  color: var(--aipcf-muted);
  font-size: 12.5px;
  line-height: 1.55;
  max-width: 560px;
}
.aipcf-wrap .aipcf-main details.aipcf-more > ol { padding-left: 30px; }

/* Advanced rows hidden until toggled. settings.js adds a translated tag to each row's label. */
.aipcf-wrap .aipcf-main:not(.is-advanced) .form-table tr.aipcf-advanced { display: none; }
.aipcf-wrap .form-table tr.aipcf-advanced > th .aipcf-advanced-tag {
  margin-left: 6px;
  padding: 0 7px;
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
  vertical-align: middle;
}

/* Collapsible panel (credentials once connected) */
.aipcf-wrap details.aipcf-collapsible { padding: 0; }
.aipcf-wrap details.aipcf-collapsible > summary {
  cursor: pointer;
  padding: 16px 24px;
  font-size: 14px;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.aipcf-wrap details.aipcf-collapsible > summary::-webkit-details-marker { display: none; }
.aipcf-wrap details.aipcf-collapsible > summary::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--aipcf-muted);
  border-bottom: 2px solid var(--aipcf-muted);
  transform: rotate(-45deg);
  transition: transform .15s;
}
.aipcf-wrap details.aipcf-collapsible[open] > summary::before { transform: rotate(45deg); }
.aipcf-wrap details.aipcf-collapsible > h2 { display: none; }
.aipcf-wrap details.aipcf-collapsible > p,
.aipcf-wrap details.aipcf-collapsible > .form-table { margin-left: 24px; margin-right: 24px; }
.aipcf-wrap details.aipcf-collapsible > .form-table { width: calc(100% - 48px); margin-bottom: 12px; }

/* Overview tiles + actions */
.aipcf-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 14px;
}
.aipcf-tile {
  background: #fff;
  border: 1px solid var(--aipcf-line);
  border-radius: var(--aipcf-radius);
  box-shadow: var(--aipcf-shadow);
  padding: 14px 16px;
  min-width: 0;
}
.aipcf-tile h2,
.aipcf-tile h3 {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--aipcf-muted);
}
.aipcf-tile-value { font-size: 20px; font-weight: 650; line-height: 1.2; margin-bottom: 4px; letter-spacing: -.01em; }
.aipcf-tile-of { font-size: 13px; font-weight: 400; color: var(--aipcf-muted); }
.aipcf-tile p { margin: 4px 0 0; font-size: 12.5px; color: #3c434a; line-height: 1.45; }
.aipcf-tile p.description { color: var(--aipcf-muted); }
.aipcf-tile .aipcf-bar { margin: 6px 0 8px; height: 6px; }
.aipcf-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.aipcf-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 9px;
  border: 1px solid var(--aipcf-line);
  border-radius: 999px;
  background: #fff;
  color: var(--aipcf-ink);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  box-shadow: var(--aipcf-shadow);
  transition: border-color .15s, background .15s;
}
.aipcf-chip .dashicons { font-size: 16px; width: 16px; height: 16px; color: var(--aipcf-muted); }
.aipcf-chip:hover { border-color: #c9ccd1; background: var(--aipcf-soft); color: var(--aipcf-ink); }
.aipcf-chip:focus-visible { box-shadow: var(--aipcf-ring); outline: 2px solid transparent; color: var(--aipcf-ink); }
.aipcf-chip.is-on .dashicons { color: var(--aipcf-ok); }
.aipcf-chip.is-on::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--aipcf-ok); margin-left: 2px; }
.aipcf-callout {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #fde3c8;
  border-radius: var(--aipcf-radius);
  background: #fff8f1;
  font-size: 13px;
  line-height: 1.45;
  color: #3c434a;
}
.aipcf-callout > .dashicons { color: var(--aipcf-accent); font-size: 22px; width: 22px; height: 22px; flex: 0 0 auto; }
.aipcf-callout > div { flex: 1 1 auto; min-width: 0; }
.aipcf-callout .button { flex: 0 0 auto; white-space: nowrap; }
.aipcf-main > .description { margin: 0 0 14px; }
@media (max-width: 960px) {
  .aipcf-tiles { grid-template-columns: 1fr; }
  .aipcf-main { max-width: none; }
}

/* Which model answers what. */
.aipcf-wrap .aipcf-main table.aipcf-modelmap { margin: 16px 0; max-width: 780px; }
.aipcf-wrap .aipcf-main table.aipcf-modelmap caption { text-align: left; font-weight: 600; padding: 0 0 6px; }
.aipcf-wrap .aipcf-main table.aipcf-modelmap th { width: 38%; font-weight: 400; vertical-align: top; }
@media (max-width: 600px) {
    .aipcf-wrap .aipcf-main table.aipcf-modelmap th,
    .aipcf-wrap .aipcf-main table.aipcf-modelmap td { display: block; width: auto; }
}

/* Embeddings: fields of stores that are not selected. */
.aipcf-wrap .form-table tr.aipcf-store-off { display: none; }
.aipcf-wrap .aipcf-embed-danger { margin-top: 4px; }
.aipcf-wrap .aipcf-embed-danger > div { padding: 8px 0 0; }
.aipcf-wrap .aipcf-embed-results li { margin-bottom: 8px; }

/* Budget tab: how the budget is shared */
.aipcf-budget-share tfoot th,
.aipcf-budget-share tfoot td { font-weight: 600; border-top: 1px solid #c3c4c7; }
.aipcf-budget-share tfoot .aipcf-over td:nth-child(3) { color: #b32d2e; }

/* == Page background: soft pastel washes (settings and the plugin's tools) ===== */
body.aipcf-screen #wpcontent {
  background:
    radial-gradient(60rem 42rem at 0% 0%, rgba(186, 214, 252, .85), transparent 68%),
    radial-gradient(46rem 36rem at 24% 52%, rgba(253, 226, 160, .7), transparent 66%),
    radial-gradient(52rem 38rem at 100% 6%, rgba(216, 208, 254, .75), transparent 68%),
    radial-gradient(44rem 32rem at 78% 96%, rgba(253, 208, 170, .5), transparent 70%),
    #f4f6fb;
  background-attachment: fixed;
  min-height: 100vh;
}
/* Cards stay near-white (text contrast is measured on white) with a light frost at the edges. */
body.aipcf-screen .aipcf-panel,
body.aipcf-screen .aipcf-card,
body.aipcf-screen .aipcf-about {
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
body.aipcf-screen .aipcf-nav {
  background: rgba(246, 247, 248, .82); /* muted 12px text stays about 5:1 over the strongest wash */
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
@media (prefers-reduced-transparency: reduce) {
  body.aipcf-screen .aipcf-panel,
  body.aipcf-screen .aipcf-card,
  body.aipcf-screen .aipcf-about { background: #fff; backdrop-filter: none; }
  body.aipcf-screen .aipcf-nav { background: var(--aipcf-soft); backdrop-filter: none; }
}


/* == Shared components (settings tabs and the plugin's tool pages) ============= */
.aipcf-eyebrow {
  margin: 0 0 4px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--aipcf-accent-ink);
}
.aipcf-header .aipcf-eyebrow { margin-bottom: 2px; }
/* A counts line: "162 embedded · 0 waiting · 3 failed". */
.aipcf-counts { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 20px; margin: 8px 0; color: var(--aipcf-muted); overflow: hidden; }
.aipcf-counts strong { color: var(--aipcf-ink); font-size: 15px; font-weight: 600; }
/* The dot sits in the gap before each item; when an item wraps to a new line its dot falls
   outside the box and is clipped, so no line starts with a dot. */
.aipcf-counts > span + span::before { content: "\00B7"; display: inline-block; width: 20px; margin-left: -20px; text-align: center; color: #c3c4c7; }
/* Status tags: On / Off / Already linked ... */
.aipcf-tag { display: inline-block; padding: 2px 9px; border-radius: 999px; background: #eef0f3; color: var(--aipcf-ink); font-size: 11.5px; font-weight: 600; line-height: 1.6; }
.aipcf-tag.is-ok { background: #e7f6ee; color: #166534; } /* 6.3:1 on the pale green (the ok-ink #15803d was 4.49:1) */
.aipcf-tag.is-warn { background: #fdf2e2; color: #8a4b00; }
.aipcf-tag.is-bad { background: #fcf0f1; color: var(--aipcf-bad-ink); }
/* Empty and off states */
.aipcf-empty { text-align: center; padding: 40px 24px; border: 1px dashed #c9ccd1; border-radius: var(--aipcf-radius); background: rgba(255, 255, 255, .6); }
.aipcf-panel .aipcf-empty { padding: 24px 16px; margin: 6px 0 14px; }
.aipcf-empty-icon.dashicons { font-size: 32px; width: 32px; height: 32px; color: var(--aipcf-accent); margin-bottom: 6px; }
.aipcf-empty-title { margin: 0 0 6px; font-size: 15px; font-weight: 600; color: var(--aipcf-ink); }
.aipcf-empty-text { margin: 0 auto; max-width: 480px; color: var(--aipcf-muted); }
.aipcf-empty .aipcf-btn, .aipcf-empty .button { margin-top: 12px; }
/* Segmented control: filters and periods. Buttons use aria-pressed; links use aria-current. */
.aipcf-segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin: 0 0 12px; background: rgba(246, 247, 248, .85); border: 1px solid var(--aipcf-line); border-radius: 16px; }
.aipcf-segmented > button,
.aipcf-segmented > a { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--aipcf-muted); cursor: pointer; text-decoration: none; white-space: nowrap; }
.aipcf-segmented > [aria-pressed="true"],
.aipcf-segmented > [aria-current] { background: #fff; color: var(--aipcf-ink); box-shadow: var(--aipcf-shadow); }
.aipcf-segmented > :focus-visible { outline: 2px solid transparent; box-shadow: var(--aipcf-ring); }
.aipcf-count { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 2px; border-radius: 999px; background: #eef0f3; font-size: 11px; line-height: 18px; text-align: center; color: var(--aipcf-ink); }
/* A match meter: similarity as a percentage. */
.aipcf-meter { flex: 0 0 120px; text-align: right; }
.aipcf-meter-label { display: block; font-size: 12px; font-weight: 600; color: var(--aipcf-ink); margin-bottom: 5px; }
.aipcf-meter-bar { display: block; height: 6px; border-radius: 999px; background: #eef0f3; overflow: hidden; }
.aipcf-meter-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--aipcf-accent), var(--aipcf-accent-2)); }
/* Wide tables scroll on small screens instead of overflowing the page. */
.aipcf-table-wrap { overflow-x: auto; }
/* Tool pages (Link assistant, Search insights) get the frosted panels from body.aipcf-screen above. */

/* Destructive text links (e.g. a prompt's "Reset to default"). */
.aipcf-textlink.aipcf-danger,
.aipcf-wrap .button-link.aipcf-danger { color: var(--aipcf-bad-ink); }
/* The setup card's heading, now an h2 like every panel heading. */
.aipcf-wrap .aipcf-setup h2 { margin: 0 0 8px; font-size: 16px; font-weight: 600; line-height: 1.35; color: var(--aipcf-ink); }

/* Prompts tab textareas. */
.aipcf-wrap textarea.aipcf-prompt { max-width: 760px; }

/* Phones: the setup text link stays on one line; segmented controls fit on one row. */
.aipcf-setup-skip { white-space: nowrap; }
@media (max-width: 600px) {
  .aipcf-segmented > button,
  .aipcf-segmented > a { padding: 7px 10px; }
}

/* Activity: filters on one wrapping row, the entry count beside Download CSV, and the
   changes of an entry folded under it. */
.aipcf-activity-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.aipcf-activity-filters label { display: inline-flex; align-items: center; gap: 6px; }
.aipcf-activity-filters .description { flex-basis: 100%; margin: 0; }
.aipcf-activity-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.aipcf-activity-head h2 { margin: 0; }
.aipcf-activity-table td { vertical-align: top; }
.aipcf-activity-table > tbody > tr > td:first-child { white-space: nowrap; }
.aipcf-activity-changes { margin-top: 8px; }
.aipcf-activity-changes summary { cursor: pointer; color: var(--aipcf-accent-ink); font-weight: 600; }
.aipcf-activity-changes summary:focus-visible { outline: 2px solid transparent; box-shadow: var(--aipcf-ring); border-radius: 4px; }
.aipcf-activity-changes table { margin-top: 6px; }
.aipcf-activity-changes table { table-layout: fixed; }
.aipcf-activity-changes th:nth-child(1) { width: 70%; }
.aipcf-activity-changes td { overflow-wrap: break-word; }
.aipcf-activity-item { font-weight: 600; }
.aipcf-activity-field { color: var(--aipcf-muted); }
.aipcf-activity-field::before { content: "\00b7"; margin-right: 6px; }
.aipcf-activity-diff { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 10px; margin: 6px 0 0; }
.aipcf-activity-diff dt { color: var(--aipcf-muted); font-size: 12px; }
.aipcf-activity-diff dd { margin: 0; overflow-wrap: anywhere; }
.aipcf-activity-changes .description { margin-top: 2px; }
#aipcf-activity-results.aipcf-is-loading { opacity: .55; transition: opacity .15s; }
.aipcf-activity-keep { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.aipcf-activity-pages { margin-top: 12px; }
.aipcf-activity-pages .page-numbers { display: inline-block; padding: 4px 9px; }
.aipcf-activity-pages .current { font-weight: 600; }

/* Activity on phones and narrow screens: each row becomes a card, every cell labelled. */
@media (max-width: 782px) {
  .aipcf-stack, .aipcf-stack tbody, .aipcf-stack tr, .aipcf-stack td { display: block; width: auto; }
  .aipcf-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .aipcf-stack tr { padding: 8px 0; border-bottom: 1px solid var(--aipcf-line); }
  .aipcf-stack td { padding: 4px 10px; }
  .aipcf-stack td::before { content: attr(data-label); display: block; font-size: 11.5px; font-weight: 600; color: var(--aipcf-muted); }
  .aipcf-activity-table > tbody > tr > td:first-child { white-space: normal; }
  .aipcf-activity-changes table { table-layout: auto; }
  .aipcf-activity-changes th { width: auto; }
  .aipcf-activity-filters label { flex: 1 1 140px; }
}

/* Site assistant page: settings beside a live preview of the chat. */
.aipcf-assistant-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.aipcf-assistant-group { margin: 22px 0 6px; padding-top: 14px; border-top: 1px solid var(--aipcf-line); font-size: 14px; }
.aipcf-assistant-form .aipcf-assistant-group:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.aipcf-assistant-form fieldset { margin: 10px 0; }
.aipcf-assistant-form legend { font-weight: 600; margin-bottom: 4px; }
.aipcf-assistant-form label { font-weight: 600; }
.aipcf-assistant-form input[type=checkbox] + *, .aipcf-assistant-form .aipcf-inline-choice { font-weight: 400; }
.aipcf-assistant-form p > label:has(input[type=checkbox]) { font-weight: 400; }
.aipcf-inline-choice { margin-right: 14px; }
.aipcf-assistant-preview { position: sticky; top: 46px; }
.aipcf-assistant-preview .aipcf-chat--inline { border: 1px solid var(--aipcf-line); border-radius: 14px; padding: 12px; background: #fff; box-shadow: var(--aipcf-shadow); }
.aipcf-assistant-preview .aipcf-chat--inline .aipcf-chat__title { position: static; width: auto; height: auto; clip: auto; }
.aipcf-assistant-chat { border-bottom: 1px solid var(--aipcf-line); padding: 10px 0; }
.aipcf-assistant-chat summary { cursor: pointer; }
.aipcf-assistant-chat dl { margin: 10px 0 0 16px; }
.aipcf-assistant-chat dt { font-weight: 600; margin-top: 8px; }
.aipcf-assistant-chat dd { margin: 2px 0 0; color: var(--aipcf-muted); }
@media (max-width: 1100px) {
  .aipcf-assistant-layout { grid-template-columns: 1fr; }
  .aipcf-assistant-preview { position: static; max-width: 420px; }
}

/* Site assistant: readiness checklist, tabs, quick picks, preview states. */
.aipcf-checklist { list-style: none; margin: 4px 0 14px; padding: 0; display: grid; gap: 8px; }
.aipcf-checklist li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.aipcf-checklist-mark { flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.aipcf-checklist .is-ok .aipcf-checklist-mark { background: #e7f6ee; color: #166534; }
.aipcf-checklist .is-ok .aipcf-checklist-mark::before { content: "\2713"; }
.aipcf-checklist .is-todo .aipcf-checklist-mark { background: #fdf2e2; color: #8a4b00; }
.aipcf-checklist .is-todo .aipcf-checklist-mark::before { content: "!"; }
.aipcf-checklist-text { flex: 1 1 auto; }
.aipcf-checklist-action { margin-left: auto; }
.aipcf-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.aipcf-assistant-form.has-tabs .aipcf-assistant-group { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.aipcf-assistant-form.has-tabs .aipcf-assistant-pane { padding-top: 6px; min-height: 360px; }
.aipcf-assistant-tabs { margin-bottom: 10px; }
.aipcf-picks { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 10px; }
.aipcf-pick { min-width: 36px; height: 36px; padding: 0 8px; border: 1px solid var(--aipcf-line); border-radius: 10px; background: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
.aipcf-pick--clear { font-size: 12.5px; font-weight: 600; color: var(--aipcf-muted); }
.aipcf-pick[aria-pressed="true"] { border-color: var(--aipcf-accent); box-shadow: var(--aipcf-ring); }
.aipcf-swatch { width: 30px; height: 30px; padding: 0; border: 2px solid #fff; border-radius: 50%; background: var(--swatch); box-shadow: 0 0 0 1px var(--aipcf-line); cursor: pointer; }
.aipcf-swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--aipcf-ink); }
.aipcf-pick:focus-visible, .aipcf-swatch:focus-visible { outline: 2px solid transparent; box-shadow: var(--aipcf-ring); }
.aipcf-assistant-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.aipcf-assistant-preview-head .aipcf-eyebrow { margin: 0; }
.aipcf-preview-states { margin: 0 0 8px; }
.aipcf-assistant-preview .aipcf-chat__form[hidden] { display: none; }
.aipcf-assistant-form .aipcf-savebar { margin-top: 16px; }
tr.aipcf-related-auto-row[hidden] { display: none; }
#aipcf-related-paragraph { margin-left: 8px; }
#aipcf-related-paragraph[hidden] { display: none; }
