/**
 * @property registrations — force eager computation of inherited values.
 *
 * Without @property, `--vectex-ctx-fs: 1em` is stored as the string "1em" and
 * resolved lazily at the point of USE. When ::before (inside the mark with
 * font-size:0) reads var(--vectex-ctx-fs), the 1em resolves against 0 → 0px.
 *
 * @property { syntax: '<length>' } makes the browser resolve 1em at the
 * DECLARING element's font-size (e.g. 32px on an h1). The token inherits
 * the computed 32px, and ::before correctly renders at that size.
 *
 * Same principle for --vectex-ctx-color with currentColor.
 */
@property --vectex-ctx-fs {
  syntax: "<length>";
  inherits: true;
  initial-value: 16px;
}

@property --vectex-ctx-color {
  syntax: "<color>";
  inherits: true;
  initial-value: #000;
}

/* =============================================================================
   Vector Expressions — Block Editor Styles
   ============================================================================= */

/**
 * Design tokens — scoped to the WP editor so they do not leak to the frontend.
 */
.editor-styles-wrapper {
  --vectex-upsell-bg: #eaf7f1;
  --vectex-upsell-border: #5df4a3;
  --vectex-upsell-padding: 10px;
  --vectex-font-sm: 12px;
  --vectex-locked-opacity: 0.6;
  --vectex-logo-size: 16px;
  --vectex-logo-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-376 -15 92 126'%3E%3Cg fill='%230d6632'%3E%3Cpath d='M-372.384 54.856V40.32q5.39-.242 7.935-2.12 2.604-1.878 3.937-5.875 1.393-3.998 1.393-13.507 0-11.993 1.09-16.354 1.09-4.421 3.453-7.026 2.422-2.665 7.026-4.361 4.664-1.696 13.386-1.696h3.21v14.537q-6.481 0-8.48.727-1.999.666-2.968 2.241-.909 1.575-.909 5.815 0 7.632-.726 17.02-.485 6.117-3.332 10.963-2.12 3.574-7.329 6.965 4.422 2.544 7.026 6.481 2.605 3.877 3.453 9.873.363 2.604.848 16.96.181 5.269.666 6.541.787 1.878 2.907 2.847 2.181.969 8.843.969v14.476h-3.21q-8.783 0-13.023-1.454-4.24-1.393-6.905-4.179-2.665-2.726-3.876-6.965-1.151-4.18-1.151-14.476 0-11.508-1.272-15.506-1.211-4.058-3.876-6.057-2.605-1.999-8.117-2.302z'/%3E%3Cpath d='M-329.857 54.856V40.32q5.39-.242 7.934-2.12 2.605-1.878 3.937-5.875 1.393-3.998 1.393-13.507 0-11.993 1.09-16.354 1.09-4.421 3.453-7.026 2.423-2.665 7.026-4.361 4.664-1.696 13.386-1.696h3.21v14.537q-6.481 0-8.48.727-1.998.666-2.968 2.241-.908 1.575-.908 5.815 0 7.632-.727 17.02-.485 6.117-3.331 10.963-2.12 3.574-7.329 6.965 4.422 2.544 7.026 6.481 2.605 3.877 3.453 9.873.363 2.604.848 16.96.181 5.269.666 6.541.787 1.878 2.907 2.847 2.181.969 8.843.969v14.476h-3.21q-8.783 0-13.023-1.454-4.24-1.393-6.905-4.179-2.665-2.726-3.876-6.965-1.151-4.18-1.151-14.476 0-11.508-1.272-15.506-1.211-4.058-3.876-6.057-2.605-1.999-8.117-2.302z'/%3E%3C/g%3E%3C/svg%3E");
}

/**
 * Panel title — logo + label inline.
 */
.vectex-panel-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/**
 * Section dividers — VISIBILITY / DYNAMIC CLASS grouping.
 *
 * `.vectex-section` adds consistent vertical rhythm between control groups.
 * `.vectex-section--bordered` adds a top separator to visually distinguish
 * the Dynamic Class section from the Visibility group above it.
 */
.vectex-section {
  padding-bottom: 4px;
}

.vectex-section--bordered {
  padding-top: 16px;
  margin-top: 8px;
  border-top: 1px solid #e0e0e0;
}

/**
 * Condition field — extra top margin to separate from the Action select.
 */
.vectex-condition-field {
  margin-top: 12px;
}

/**
 * Expression field wrapper — flanks the textarea with decorative {{ }}.
 */
.vectex-expr-field {
  position: relative;
  display: flex;
  align-items: center;
}

.vectex-expr-field .vectex-class-textarea {
  flex: 1;
  min-width: 0;
  padding-left: 24px;
  padding-right: 24px;
  background: transparent;
  border: none;
  box-shadow: none;
}

.vectex-expr-field .vectex-class-textarea:focus {
  border: none;
  box-shadow: none;
  background: transparent;
}

.vectex-expr-brace {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 12.5px;
  font-weight: 500;
  color: #b0b0b0;
  user-select: none;
  pointer-events: none;
  letter-spacing: -1px;
}

.vectex-expr-brace:first-child {
  left: 8px;
}

.vectex-expr-brace:last-child {
  right: 8px;
}

/**
 * Section label — small uppercase category header, matching WP's
 * ToolsPanel and similar grouping patterns in the block editor.
 */
.vectex-section-label {
  margin: 0 0 10px;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #757575;
}

.vectex-logo {
  width: var(--vectex-logo-size);
  height: var(--vectex-logo-size);
  flex-shrink: 0;
}

/**
 * Locked panel — used for Pro-gated UI sections.
 * Greys out and disables pointer interaction on non-Pro installs.
 */
.vectex-locked-panel {
  opacity: var(--vectex-locked-opacity);
  pointer-events: none;
  filter: grayscale(100%);
}

/**
 * Upsell notice — displayed beneath locked panels when Pro is not active.
 */
.vectex-upsell {
  margin-top: var(--vectex-upsell-padding);
  padding: var(--vectex-upsell-padding);
  background: var(--vectex-upsell-bg);
  border-left: 4px solid var(--vectex-upsell-border);
  font-size: var(--vectex-font-sm);
}

.vectex-upsell a {
  text-decoration: none;
  font-weight: bold;
}

/**
 * Syntax reference toggle + table — now lives inside .vectex-section,
 * so top border/padding replaces the former standalone separator.
 */
.vectex-syntax-ref-wrap {
  margin-top: 10px;
}

.vectex-syntax-ref-toggle {
  font-size: var(--vectex-font-sm);
  color: #757575;
  text-decoration: none !important;
  padding: 0 !important;
}

.vectex-syntax-ref {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--vectex-font-sm);
  margin-top: 6px;
}

.vectex-syntax-ref td,
.vectex-syntax-ref th {
  padding: 3px 4px;
  text-align: left;
  vertical-align: middle;
}

.vectex-syntax-ref td:first-child {
  width: 55%;
  white-space: nowrap;
}

.vectex-syntax-ref code {
  font-size: 11px;
  background: #f0f0f0;
  padding: 1px 4px;
  border-radius: 3px;
}

.vectex-ref-head th {
  padding-top: 8px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #999;
}

/**
 * Parent-context capture for token pseudo-element rendering.
 *
 * font-size:0 on the token element hides the inner {{ expr }} storage text,
 * but ::before inherits that 0 — making em units useless there. The trick:
 * declare --vectex-ctx-fs and --vectex-ctx-color on *every element except the token
 * itself*. Because .vectex-expr-token is excluded, it inherits the parent's
 * already-computed values (e.g. 32px on an <h1>, white inside a dark block)
 * rather than re-evaluating them against its own font-size:0 / color.
 */
.editor-styles-wrapper *:not(.vectex-expr-token) {
  --vectex-ctx-fs: 1em; /* resolves at each element's own size */
  --vectex-ctx-color: currentColor; /* resolves at each element's own color */
}

/**
 * Expression token — context-integrated inline indicator.
 *
 * Appears as plain text at the surrounding font size and color, marked only
 * by a dotted brand-green underline so it reads naturally in any context
 * (headings, body copy, dark/light blocks) without imposing a fixed size
 * or obtrusive badge chrome.
 *
 * font-size:0 erases the inner {{ expr }} storage text from the layout.
 * ::before re-renders the view value at the captured parent size/color.
 */
.vectex-expr-token {
  /* Erase badge chrome */
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;

  /* Inherit typographic context (except size — handled via ::before) */
  font-family: inherit;
  font-weight: inherit;
  font-style: inherit;
  color: inherit !important;

  /* Hide the inner {{ expr }} storage text */
  font-size: 0;

  /* Layout */
  display: inline-block;
  vertical-align: baseline;
  cursor: pointer !important;
}

.vectex-expr-token::before {
  content: attr(data-vectex-view);

  /* Restore parent size and color via the captured custom properties */
  font-size: var(--vectex-ctx-fs, 1rem);

  /* Keep surrounding typographic context */
  font-family: inherit;
  font-weight: inherit;
  font-style: inherit;
  line-height: normal;

  /* Brand-green dotted underline — the dynamic indicator */
  text-decoration: underline dotted hsl(147 65% 42%);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 2px;
}

/*
 * Placeholder: shown when view is absent or empty (no [data-vectex-view] attr).
 * Shown before PHP hydrate_editor_previews() injects the live value.
 */
.vectex-expr-token:not([data-vectex-view])::before,
.vectex-expr-token[data-vectex-view=""]::before {
  content: "Dynamic";
  opacity: 0.55;
  font-style: italic;
  padding-left: 1.1em;
  background-image: var(--vectex-logo-icon);
  background-repeat: no-repeat;
  background-size: 0.85em 0.85em;
  background-position: left center;
}

/*
 * [data-vectex-empty] is set by JS Pass-2 when the expression resolved to a
 * visually-empty value: boolean false → "", 0 → "0", whitespace-only, etc.
 * The chip must still be visible and selectable so the user can find and
 * edit or delete it.
 */
.vectex-expr-token[data-vectex-empty]::before {
  content: "Dynamic";
  opacity: 0.55;
  font-style: italic;
  padding-left: 1.1em;
  background-image: var(--vectex-logo-icon);
  background-repeat: no-repeat;
  background-size: 0.85em 0.85em;
  background-position: left center;
  /* Ensure minimum width so a zero-content token is never invisible */
  min-width: 4ch;
  display: inline-block;
}

/* Hover: signal interactivity by solidifying the underline */
.vectex-expr-token:hover::before {
  text-decoration-style: solid;
  text-decoration-color: #5df4a3;
  outline-width: 0 !important;
  outline-style: solid !important;
  transition: outline 0.2s ease-in-out;
}

/**
 * Active / cursor-on-token state.
 *
 * [data-vectex-active] is managed by our useEffect (reliable, toggles with isActive).
 * [data-rich-text-format-boundary] is Gutenberg's native attribute (kept as
 * fallback but we clean it up when isActive=false to prevent persistence).
 */
.vectex-expr-token[data-vectex-active]::before,
.vectex-expr-token[data-rich-text-format-boundary]::before {
  outline: 2px solid #5df4a3 !important;
  outline-offset: 2px;
  border-radius: 2px;
  text-decoration-style: solid;
}

/**
 * Popover expression editor.
 */

/* Make the TextControl input visually stronger — higher contrast text + border */
.vectex-pill-popover .components-text-control__input {
  background: #fff;
  color: #1e1e1e;
  border: 1.5px solid #949494;
  border-radius: 4px;
  font-size: 13px;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  padding: 6px 10px;
}
.vectex-pill-popover .components-text-control__input:focus {
  border-color: #5df4a3;
  box-shadow: 0 0 0 1.5px #5df4a3;
  outline: none;
}

/* Brand styling for the primary apply button */
.vectex-pill-popover .components-button.is-primary {
  background: #5df4a3;
  color: #0b4a26;
  border-color: #5df4a3;
  transition:
    background 0.1s,
    border-color 0.1s;
}
.vectex-pill-popover .components-button.is-primary:hover,
.vectex-pill-popover .components-button.is-primary:focus {
  background: #4de695;
  color: #0b4a26;
  border-color: #4de695;
}

/**
 * Autocomplete dropdown option — structural alignment.
 */
.vectex-autocompleter-option {
  display: flex;
  align-items: center;
  width: 320px;
}

/* Override WordPress's aggressive blue highlight with our brand green */
.components-autocomplete__results
  .components-autocomplete__option:has(.vectex-autocompleter-option).is-active,
.components-autocomplete__results
  .components-autocomplete__result:has(
    .vectex-autocompleter-option
  ).is-selected {
  background-color: rgb(93, 244, 163) !important;
  color: black !important;
}
.components-autocomplete__results
  .components-autocomplete__option:has(.vectex-autocompleter-option).is-active
  code,
.components-autocomplete__results
  .components-autocomplete__option:has(.vectex-autocompleter-option).is-active
  .vectex-ac-icon
  svg
  path,
.components-autocomplete__results
  .components-autocomplete__option:has(.vectex-autocompleter-option).is-active
  .vectex-ac-icon
  svg
  circle,
.components-autocomplete__results
  .components-autocomplete__result:has(
    .vectex-autocompleter-option
  ).is-selected
  code,
.components-autocomplete__results
  .components-autocomplete__result:has(
    .vectex-autocompleter-option
  ).is-selected
  .vectex-ac-icon
  svg
  path,
.components-autocomplete__results
  .components-autocomplete__result:has(
    .vectex-autocompleter-option
  ).is-selected
  .vectex-ac-icon
  svg
  circle {
  color: black !important;
}

/* Allow text truncation within the autocompleter flex row and expand the hover box */
.components-autocomplete__results
  .components-button:has(.vectex-autocompleter-option) {
  width: 320px;
  padding: 8px 12px;
}

/* ── Popover suggestion chips ─────────────────────────────────────────────── */

/* Wrapping chip grid — max 3 rows before scrolling. */
.vectex-pill-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 90px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 0 2px;
  margin: 0 0 8px;
  scrollbar-width: thin;
}

/* Base chip */
.vectex-pill-suggestion-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 10px;
  border: 1px solid #d0d5d8;
  background: #f6f7f7;
  color: #1e1e1e;
  font-size: 11.5px;
  line-height: 1.5;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 0.1s,
    border-color 0.1s;
}
.vectex-pill-suggestion-btn:hover,
.vectex-pill-suggestion-btn:focus-visible {
  background: #eaf7f1;
  border-color: #39b074;
  outline: none;
}

/* Text label inside any chip */
.vectex-pill-suggestion-label {
  font-size: 11.5px;
  color: #1e1e1e;
}

/* Monospace expression shown inside non-root, non-pattern chips */
.vectex-pill-suggestion-expr {
  font-size: 10px;
  opacity: 0.6;
  font-family: monospace;
}

/* Root entry-point chip — slightly heavier with SVG icon */
.vectex-pill-suggestion-btn--root {
  padding: 4px 10px;
  border-radius: 8px;
  font-weight: 500;
  border-color: #c3d9ce;
  background: #f0faf5;
}
.vectex-pill-suggestion-btn--root:hover {
  background: #ddf5ea;
  border-color: #39b074;
}

/* SVG icon in root chips — fix size and vertical alignment */
.vectex-pill-suggestion-icon {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}
.vectex-pill-suggestion-icon svg {
  width: 14px;
  height: 14px;
  vertical-align: middle;
}

/* Pattern chips — subtle pink/rose tint to distinguish from data chips */
.vectex-pill-suggestion-btn--pattern {
  background: #fdf2f8;
  border-color: #f0c4e0;
  color: #7a1548;
}
.vectex-pill-suggestion-btn--pattern .vectex-pill-suggestion-label {
  color: #7a1548;
}
.vectex-pill-suggestion-btn--pattern:hover {
  background: #fce7f3;
  border-color: #d946a8;
  color: #6b1040;
}

/* Layout utility — replaces inline style spacer divs */
.vectex-spacer {
  height: 5px;
}

/* ── Dynamic Class textarea ───────────────────────────────────────────────── */

.vectex-class-field {
  margin-bottom: 0;
}

.vectex-class-field .components-base-control__label {
  display: block;
  margin-bottom: 4px;
}

.vectex-class-field .components-base-control__help {
  margin-top: 6px;
  font-size: 11px;
  color: #757575;
}

/**
 * Code-block treatment: light gray background + neutral border signals
 * "this is a template expression field", visually distinct from plain
 * text inputs while staying within the WP editor palette.
 */
.vectex-class-textarea {
  display: block;
  width: 100%;
  min-height: 36px;
  padding: 6px 8px;
  font-size: 12.5px;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  line-height: 1.6;
  color: #1e1e1e;
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  resize: none;
  overflow: hidden;
  box-sizing: border-box;
  transition:
    border-color 0.1s,
    box-shadow 0.1s,
    background 0.1s;
}

.vectex-class-textarea:focus {
  border-color: #007cba;
  box-shadow: 0 0 0 1.5px #007cba;
  outline: none;
  background: #fff;
}

.vectex-class-textarea::placeholder {
  color: #a0adb8;
  font-style: italic;
}

/* ── Vector Sidebar ──────────────────────────────────────────────────────── */

/* Empty state when no block is selected */
.vectex-sidebar-empty {
  padding: 32px 16px;
  color: #757575;
  font-size: 13px;
  text-align: center;
}

/* Tab strip — icon-only, scrollable overflow */
.vectex-sidebar-tabs .components-tab-panel__tabs {
  display: flex;
  border-bottom: 1px solid #e0e0e0;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.vectex-sidebar-tabs .components-tab-panel__tabs::-webkit-scrollbar {
  display: none;
}

.vectex-sidebar-tabs .components-tab-panel__tabs button {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  color: #757575;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition:
    color 0.15s,
    border-color 0.15s;
}

.vectex-sidebar-tabs .components-tab-panel__tabs button:hover {
  color: #1e1e1e;
}

.vectex-sidebar-tabs .components-tab-panel__tabs button.is-active {
  color: #1e1e1e;
  border-bottom-color: #5df4a3;
}

/* Tab icon wrapper */
.vectex-tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

/* Tab content panel — consistent padding */
.vectex-sidebar-tab-content {
  padding: 16px;
}

/* ── Quick Start ────────────────────────────────────────────────────────── */

.vectex-suggestions-quickstart {
  margin-top: 8px;
  padding: 10px;
  background: linear-gradient(135deg, #f0faf5, #eaf7f1);
  border: 1px solid #c3d9ce;
  border-radius: 6px;
}

.vectex-suggestions-quickstart-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #0d6632;
  margin-bottom: 6px;
}

.vectex-suggestions-quickstart-items {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.vectex-suggestion-chip--quickstart.components-button {
  background: #fff;
  border: 1px solid #5df4a3;
  color: #0d6632;
  font-weight: 500;
}

.vectex-suggestion-chip--quickstart.components-button:hover {
  background: #ddf5ea;
  border-color: #39b074;
}

/* ── Root Strip (horizontal icon nav) ───────────────────────────────────── */

.vectex-root-strip {
  display: flex;
  gap: 4px;
  padding: 6px 2px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 4px;
}

.vectex-root-strip::-webkit-scrollbar {
  display: none;
}

.vectex-root-strip-btn {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: #f6f7f7;
  color: #757575;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  transition: all 0.15s ease;
}

.vectex-root-strip-btn svg {
  width: 16px;
  height: 16px;
}

.vectex-root-strip-btn:hover {
  background: #e8eaed;
  color: #1e1e1e;
  border-color: #c4c4c4;
}

.vectex-root-strip-btn.is-active {
  background: #5df4a3;
  color: #1a1a1a;
  border-color: #5df4a3;
}

.vectex-root-strip-btn.is-active:hover {
  background: #42d88a;
}

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

.vectex-console-card {
  background: #f6f7f7;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
}

.vectex-console-card .vectex-expr-field {
  padding: 10px 12px;
}

.vectex-console-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-top: 2px solid #e0e0e0;
  background: #fff;
  min-height: 28px;
}

.vectex-console-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #cc1818;
}

.vectex-console-dot.is-valid {
  background: #39b074;
}

.vectex-console-preview {
  font-size: 11px;
  font-family: monospace;
  color: #757575;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vectex-console-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  margin-bottom: 4px;
}

.vectex-console-actions .components-button.vectex-console-btn-remove {
  font-size: 11px;
  padding: 2px 6px;
  min-height: 24px;
  height: 24px;
  color: #a0a0a0;
  text-decoration: none;
  box-shadow: none;
  border: none;
  background: transparent;
}

.vectex-console-actions .components-button.vectex-console-btn-remove:hover {
  color: #cc1818;
  background: transparent;
}

.vectex-console-actions .components-button.vectex-console-btn-apply {
  font-size: 12px;
  padding: 2px 14px;
  min-height: 26px;
  height: 26px;
  border-radius: 4px;
}

/* ── Discovery Header ──────────────────────────────────────────────────────── */

.vectex-discovery-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 0;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 4px;
}

.vectex-discovery-label {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #757575;
}

.vectex-discovery-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f6f7f7;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 0 6px;
}

.vectex-discovery-search-icon {
  flex-shrink: 0;
  color: #949494;
}

.vectex-discovery-search input {
  flex: 1;
  border: none;
  background: none;
  font-size: 11px;
  padding: 4px 0;
  outline: none;
  color: #1e1e1e;
}

.vectex-discovery-search input::placeholder {
  color: #949494;
}

/* ── Accordion Suggestions ──────────────────────────────────────────────────── */

.vectex-suggestions {
  margin-top: 16px;
}

.vectex-suggestions-group {
  border-top: 1px solid #e0e0e0;
}

.vectex-suggestions-group:last-child {
  border-bottom: 1px solid #e0e0e0;
}

.vectex-suggestions-header {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 8px 0;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #757575;
  background: none;
  border: none;
  cursor: pointer;
  gap: 6px;
}

.vectex-suggestions-header:hover {
  color: #1e1e1e;
}

.vectex-suggestions-header.is-open {
  color: #1e1e1e;
}

.vectex-suggestions-count {
  font-size: 10px;
  font-weight: 400;
  color: #949494;
  background: #f0f0f0;
  border-radius: 8px;
  padding: 1px 6px;
  min-width: 16px;
  text-align: center;
}

.vectex-suggestions-arrow {
  margin-left: auto;
  font-size: 8px;
  color: #949494;
}

.vectex-suggestions-items {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 4px 0 10px 0;
}

/* Branded pill chip — overrides WP component button styles completely */
.vectex-suggestion-chip.components-button {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 10px;
  border: 1px solid #d0d5d8;
  background: #f6f7f7;
  color: #1e1e1e;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.5;
  height: auto;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: none;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease;
}

.vectex-suggestion-chip.components-button:hover,
.vectex-suggestion-chip.components-button:focus-visible {
  background: #eaf7f1;
  border-color: #39b074;
  color: #0d6632;
  box-shadow: none;
  outline: none;
}

.vectex-suggestion-chip.components-button:active {
  background: #ddf5ea;
  border-color: #2d9460;
}

/* ── Nested Group Structure ──────────────────────────────────────────────── */

/* Parent group wrapper — slight left border accent on all integrations */
.vectex-suggestions-group--parent {
  border-top: 1px solid #d0d5d8;
}

/* Group-level header — stronger visual weight than sub-headers */
.vectex-suggestions-header--group {
  font-size: 11.5px;
  font-weight: 700;
  color: #1e1e1e;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 0;
}

.vectex-suggestions-header--group:hover {
  color: #0d6632;
}

/* Group icon (SVG) */
.vectex-suggestions-group-icon {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.vectex-suggestions-group-icon svg {
  width: 14px;
  height: 14px;
}

/* Body container for nested sub-categories */
.vectex-suggestions-group-body {
  padding-left: 4px;
  border-left: 2px solid #e0e0e0;
  margin-left: 4px;
}

/* Nested sub-category — indented, smaller text */
.vectex-suggestions-group--nested {
  border-top: none;
}

.vectex-suggestions-header--sub {
  font-size: 10.5px;
  font-weight: 600;
  padding: 6px 0 6px 8px;
  color: #757575;
}

.vectex-suggestions-header--sub:hover {
  color: #1e1e1e;
}

.vectex-suggestions-group--nested .vectex-suggestions-items {
  padding-left: 8px;
}

/* ── Accent bars — colored left border for integration sub-categories ────── */

.vectex-suggestions-accent {
  display: inline-block;
  width: 3px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}

.vectex-suggestions-accent--acf {
  background: #0073aa;
}

.vectex-suggestions-accent--metabox {
  background: #00838f;
}

.vectex-suggestions-accent--woo {
  background: #7b1fa2;
}

.vectex-suggestions-accent--modifier {
  background: #e65100;
}
