/* ==========================================================================
   COMPONENTS
   ========================================================================== */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  font-family: var(--font-body); font-weight: 600; font-size: var(--fs-small);
  padding: 11px 20px; border-radius: var(--radius-sm); border: 1px solid transparent;
  transition: background var(--dur-fast) var(--ease-standard), border-color var(--dur-fast), color var(--dur-fast), transform var(--dur-fast);
  white-space: nowrap; line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary { background: var(--color-primary-700); color: #fff; }
.btn-primary:hover { background: var(--color-primary-600); }
.btn-primary:focus-visible { box-shadow: var(--shadow-focus); }
.btn-primary:disabled { background: var(--color-border); color: var(--color-muted-soft); cursor: not-allowed; }

.btn-accent { background: var(--color-accent-500); color: var(--color-ink); }
.btn-accent:hover { background: var(--color-accent-600); }

.btn-secondary { background: var(--color-surface); color: var(--color-ink); border-color: var(--color-border); }
.btn-secondary:hover { border-color: var(--color-primary-600); color: var(--color-primary-700); }
.btn-secondary:disabled { color: var(--color-muted-soft); border-color: var(--color-border-soft); cursor: not-allowed; }

.btn-ghost { background: transparent; color: var(--color-ink-soft); }
.btn-ghost:hover { background: var(--color-bg-sunken); }

.btn-danger { background: var(--color-error-500); color: #fff; }
.btn-danger:hover { background: var(--color-error-700); }
.btn-danger-ghost { background: transparent; color: var(--color-error-700); border-color: var(--color-error-100); }
.btn-danger-ghost:hover { background: var(--color-error-100); }

.btn-lg { padding: 14px 26px; font-size: var(--fs-body); }
.btn-sm { padding: 7px 14px; font-size: var(--fs-caption); }
.btn-block { width: 100%; }
.btn-icon { padding: 9px; }

.btn-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn-loading::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.5); border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}
.btn-secondary.btn-loading::after, .btn-ghost.btn-loading::after { border-color: rgba(23,118,126,0.25); border-top-color: var(--color-primary-700); }
@keyframes spin { to { transform: rotate(360deg); } }

.link { color: var(--color-primary-700); font-weight: 600; text-underline-offset: 3px; }
.link:hover { text-decoration: underline; }

/* ---------- Badges / Tags / Pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-mono); font-size: var(--fs-caption); font-weight: 600;
  padding: 3px 9px; border-radius: var(--radius-pill); letter-spacing: 0.01em;
}
.badge-verified { background: var(--color-primary-100); color: var(--color-primary-700); }
.badge-featured { background: var(--color-featured-100); color: var(--color-featured-700); }
.badge-new { background: var(--color-info-100); color: var(--color-info-700); }
.badge-success { background: var(--color-success-100); color: var(--color-success-700); }
.badge-warning { background: var(--color-warning-100); color: var(--color-warning-700); }
.badge-error { background: var(--color-error-100); color: var(--color-error-700); }
.badge-neutral { background: var(--color-bg-sunken); color: var(--color-ink-soft); }

.tag {
  display: inline-flex; align-items: center; font-size: var(--fs-caption);
  padding: 5px 10px; border-radius: var(--radius-sm); background: var(--color-bg-sunken);
  color: var(--color-ink-soft); border: 1px solid var(--color-border-soft);
}

.pill-filter {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px;
  border-radius: var(--radius-pill); border: 1px solid var(--color-border);
  background: var(--color-surface); font-size: var(--fs-small); font-weight: 500;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.pill-filter:hover { border-color: var(--color-primary-600); }
.pill-filter[aria-pressed="true"] { background: var(--color-primary-700); border-color: var(--color-primary-700); color: #fff; }

/* ---------- Cards ---------- */
.card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); overflow: hidden;
  transition: border-color var(--dur-fast) var(--ease-standard), transform var(--dur-fast);
}
a.card:hover, .card.is-hoverable:hover { border-color: var(--color-primary-500); }

.listing-card { display: flex; flex-direction: column; height: 100%; }
.listing-card__media { position: relative; aspect-ratio: 4/3; background: var(--color-bg-sunken); overflow: hidden; }
.listing-card__media img { width: 100%; height: 100%; object-fit: cover; }
.listing-card__save {
  position: absolute; top: 10px; right: 10px; width: 34px; height: 34px;
  background: rgba(255,255,255,0.92); border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--color-border-soft);
}
.listing-card__save:hover { background: #fff; }
.listing-card__save svg { width: 17px; height: 17px; stroke: var(--color-ink-soft); fill: none; }
.listing-card__save.is-saved svg { fill: var(--color-accent-500); stroke: var(--color-accent-700); }
.listing-card__badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; }
.listing-card__body { padding: var(--space-4); display: flex; flex-direction: column; gap: 6px; flex: 1; }
.listing-card__cat { font-family: var(--font-mono); font-size: var(--fs-caption); color: var(--color-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.listing-card__title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; }
.listing-card__meta { color: var(--color-muted); font-size: var(--fs-small); }
.listing-card__rating { display: flex; align-items: center; gap: 4px; font-size: var(--fs-small); font-weight: 600; }
.listing-card__rating svg { width: 14px; height: 14px; fill: var(--color-accent-500); }
.listing-card__footer { margin-top: auto; padding-top: var(--space-2); display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--color-border-soft); }

.category-card {
  display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-5);
  border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface);
}
.category-card:hover { border-color: var(--color-primary-600); background: var(--color-primary-50); }
.category-card__icon { width: 42px; height: 42px; border-radius: var(--radius-sm); background: var(--color-primary-100); display: grid; place-items: center; }
.category-card__icon svg { width: 22px; height: 22px; stroke: var(--color-primary-700); fill: none; stroke-width: 1.6; }
.category-card__count { font-family: var(--font-mono); font-size: var(--fs-caption); color: var(--color-muted); }

.location-card {
  position: relative; border-radius: var(--radius-md); overflow: hidden; aspect-ratio: 5/4;
  display: flex; align-items: flex-end; background: var(--color-primary-700);
}
.location-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.75; }
.location-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(10,59,62,0.85)); }
.location-card__label { position: relative; z-index: 1; padding: var(--space-4); color: #fff; }
.location-card__label .name { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.location-card__label .count { font-family: var(--font-mono); font-size: var(--fs-caption); opacity: 0.85; }

/* Directory index — signature component: mono index numerals like a lobby directory board */
.directory-index { border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; background: var(--color-surface); }
.directory-index__row {
  display: flex; align-items: center; gap: var(--space-4); padding: 14px var(--space-5);
  border-bottom: 1px solid var(--color-border-soft);
}
.directory-index__row:last-child { border-bottom: 0; }
.directory-index__row:hover { background: var(--color-primary-50); }
.directory-index__num { font-family: var(--font-mono); font-size: var(--fs-small); color: var(--color-primary-600); font-weight: 700; width: 32px; }
.directory-index__name { font-weight: 600; flex: 1; }
.directory-index__count { font-family: var(--font-mono); font-size: var(--fs-caption); color: var(--color-muted); }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: var(--fs-caption); color: var(--color-muted); }
.breadcrumbs a:hover { color: var(--color-primary-700); text-decoration: underline; }
.breadcrumbs .sep { color: var(--color-border); }
.breadcrumbs .current { color: var(--color-ink-soft); font-weight: 600; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--color-border); overflow-x: auto; }
.tab {
  padding: 12px 4px; margin-right: var(--space-6); font-weight: 600; font-size: var(--fs-small);
  color: var(--color-muted); border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab:hover { color: var(--color-ink); }
.tab[aria-selected="true"] { color: var(--color-primary-700); border-bottom-color: var(--color-primary-700); }

/* ---------- Accordion ---------- */
.accordion-item { border-bottom: 1px solid var(--color-border); }
.accordion-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-4) 0; font-weight: 600; text-align: left; font-family: var(--font-body);
}
.accordion-trigger svg { width: 18px; height: 18px; transition: transform var(--dur-med) var(--ease-standard); flex-shrink: 0; }
.accordion-trigger[aria-expanded="true"] svg { transform: rotate(45deg); }
.accordion-panel { padding-bottom: var(--space-4); color: var(--color-ink-soft); display: none; }
.accordion-panel.is-open { display: block; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field[hidden] { display: none; }
.field-label { font-size: var(--fs-label); font-weight: 600; color: var(--color-ink); }
.field-label .optional { font-weight: 400; color: var(--color-muted); font-size: var(--fs-caption); }
.field-hint { font-size: var(--fs-caption); color: var(--color-muted); }
.field-error { font-size: var(--fs-caption); color: var(--color-error-700); display: flex; align-items: center; gap: 4px; }
.field-error svg { width: 13px; height: 13px; flex-shrink: 0; }

.input, .textarea, .select {
  width: 100%; padding: 11px 14px; border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  background: var(--color-surface); font-size: var(--fs-body);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.input::placeholder, .textarea::placeholder { color: var(--color-muted-soft); }
.input:hover, .textarea:hover, .select:hover { border-color: var(--color-muted-soft); }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--color-primary-600); box-shadow: var(--shadow-focus); }
.input:disabled, .textarea:disabled, .select:disabled { background: var(--color-bg-sunken); color: var(--color-muted); cursor: not-allowed; }
.field.has-error .input, .field.has-error .textarea, .field.has-error .select { border-color: var(--color-error-500); }
.field.has-error .input:focus { box-shadow: 0 0 0 3px rgba(195,64,42,0.18); }
.field.is-success .input { border-color: var(--color-success-500); }
.textarea { resize: vertical; min-height: 110px; }
/* Contact form helpers */
.dxp-contact-form .field-error[hidden] { display:none; }
.dxp-contact-counter { margin-left:auto; white-space:nowrap; }
.dxp-contact-counter.is-short { color:var(--color-error-700); }
.dxp-contact-counter.is-ready { color:var(--color-success-700); }


.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236E756E' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px; }

.input-icon-wrap { position: relative; }
.input-icon-wrap .input { padding-left: 40px; }
.input-icon-wrap svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; stroke: var(--color-muted); fill: none; }
.input-icon-wrap .input-trailing-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: var(--fs-caption); font-weight: 600; color: var(--color-primary-700); padding: 6px 8px; }

.checkbox-row, .radio-row { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.checkbox-row input, .radio-row input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--color-primary-700); flex-shrink: 0; }
.checkbox-row .label, .radio-row .label { font-size: var(--fs-small); color: var(--color-ink-soft); }

.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--color-border); border-radius: var(--radius-pill); transition: background var(--dur-fast); }
.switch .track::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform var(--dur-fast) var(--ease-standard); box-shadow: var(--shadow-sm); }
.switch input:checked + .track { background: var(--color-primary-700); }
.switch input:checked + .track::before { transform: translateX(18px); }
.switch input:focus-visible + .track { box-shadow: var(--shadow-focus); }

.pw-strength { display: flex; gap: 4px; }
.pw-strength span { height: 4px; flex: 1; background: var(--color-border); border-radius: 2px; }
.pw-strength[data-level="1"] span:nth-child(1) { background: var(--color-error-500); }
.pw-strength[data-level="2"] span:nth-child(-n+2) { background: var(--color-warning-500); }
.pw-strength[data-level="3"] span:nth-child(-n+3) { background: var(--color-accent-500); }
.pw-strength[data-level="4"] span { background: var(--color-success-500); }

.upload-zone {
  border: 1.5px dashed var(--color-border); border-radius: var(--radius-md);
  padding: var(--space-8); text-align: center; background: var(--color-bg-sunken);
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.upload-zone.is-dragover { border-color: var(--color-primary-600); background: var(--color-primary-50); }
.upload-zone svg { width: 30px; height: 30px; margin: 0 auto var(--space-2); stroke: var(--color-muted); fill: none; }

.upload-thumb { position: relative; border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 1; border: 1px solid var(--color-border); }
.upload-thumb img { width: 100%; height: 100%; object-fit: cover; }
.upload-thumb .remove { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; border-radius: 50%; background: rgba(22,33,31,0.7); display: grid; place-items: center; }
.upload-thumb .remove svg { width: 13px; height: 13px; stroke: #fff; }
.upload-thumb .progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,0.4); }
.upload-thumb .progress span { display: block; height: 100%; background: var(--color-primary-600); }

/* ---------- Alerts / Inline notices ---------- */
.alert { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-md); border: 1px solid; font-size: var(--fs-small); }
.alert svg { width: 19px; height: 19px; flex-shrink: 0; margin-top: 1px; }
.alert-title { font-weight: 700; margin-bottom: 2px; }
.alert-info { background: var(--color-info-100); border-color: #CADCEB; color: var(--color-info-700); }
.alert-success { background: var(--color-success-100); border-color: #C7E7D3; color: var(--color-success-700); }
.alert-warning { background: var(--color-warning-100); border-color: #F0DBAF; color: var(--color-warning-700); }
.alert-error { background: var(--color-error-100); border-color: #F0C8BD; color: var(--color-error-700); }

/* ---------- Toasts ---------- */
.toast-region { position: fixed; bottom: var(--space-5); right: var(--space-5); z-index: var(--z-toast); display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.toast {
  display: flex; align-items: flex-start; gap: 10px; background: var(--color-ink); color: #fff;
  padding: 14px 16px; border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  animation: toast-in var(--dur-med) var(--ease-standard);
}
.toast svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.toast.toast-success svg { stroke: var(--color-success-500) }
.toast.toast-error svg { stroke: var(--color-error-500) }
.toast-close { margin-left: auto; opacity: 0.6; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) { .toast-region { left: var(--space-4); right: var(--space-4); max-width: none; } }

/* ---------- Tooltip ---------- */
.tooltip { position: relative; }
.tooltip [role="tooltip"] {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--color-ink); color: #fff; font-size: var(--fs-caption); padding: 6px 10px;
  border-radius: var(--radius-sm); white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity var(--dur-fast);
}
.tooltip:hover [role="tooltip"], .tooltip:focus-within [role="tooltip"] { opacity: 1; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: var(--color-overlay); display: flex; align-items: center;
  justify-content: center; padding: var(--space-4); z-index: var(--z-modal);
}
.modal { background: var(--color-surface); border-radius: var(--radius-lg); max-width: 480px; width: 100%; box-shadow: var(--shadow-lg); max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: var(--space-5) var(--space-5) 0; }
.modal-body { padding: var(--space-5); }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 0 var(--space-5) var(--space-5); }
.modal-close { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; }
.modal-close:hover { background: var(--color-bg-sunken); }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; gap: 6px; justify-content: center; }
.page-btn { min-width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--radius-sm); font-size: var(--fs-small); font-weight: 600; color: var(--color-ink-soft); }
.page-btn:hover { background: var(--color-bg-sunken); }
.page-btn[aria-current="page"] { background: var(--color-primary-700); color: #fff; }
.page-btn:disabled { color: var(--color-border); cursor: not-allowed; }

/* ---------- Skeleton / shimmer ---------- */
.skel { position: relative; overflow: hidden; background: var(--color-border-soft); border-radius: var(--radius-sm); }
.skel::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.75), transparent);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }
.skel-text { height: 12px; margin-bottom: 8px; }
.skel-title { height: 18px; width: 60%; margin-bottom: 10px; }
.skel-media { aspect-ratio: 4/3; border-radius: var(--radius-md); }
.skel-avatar { width: 44px; height: 44px; border-radius: 50%; }
.skel-btn { height: 40px; border-radius: var(--radius-sm); }

/* ---------- Empty / error states ---------- */
.state-block { text-align: center; padding: var(--space-16) var(--space-4); max-width: 440px; margin-inline: auto; }
.state-block__icon { width: 64px; height: 64px; margin: 0 auto var(--space-5); border-radius: 50%; background: var(--color-primary-50); display: grid; place-items: center; }
.state-block__icon svg { width: 30px; height: 30px; stroke: var(--color-primary-600); fill: none; stroke-width: 1.5; }
.state-block h3 { margin-bottom: var(--space-2); }
.state-block p { color: var(--color-muted); margin-bottom: var(--space-6); }
.state-block--error .state-block__icon { background: var(--color-error-100); }
.state-block--error .state-block__icon svg { stroke: var(--color-error-700); }

/* ---------- Rating stars ---------- */
.stars { display: inline-flex; gap: 2px; }
.stars svg { width: 15px; height: 15px; fill: var(--color-border); }
.stars svg.filled { fill: var(--color-accent-500); }

/* ---------- Progress / stepper (wizards) ---------- */
.stepper { display: flex; align-items: center; gap: 0; }
.stepper__step { display: flex; align-items: center; gap: 8px; flex: 1; position: relative; }
.stepper__dot { width: 28px; height: 28px; border-radius: 50%; background: var(--color-bg-sunken); border: 1px solid var(--color-border); display: grid; place-items: center; font-family: var(--font-mono); font-size: var(--fs-caption); font-weight: 700; color: var(--color-muted); flex-shrink: 0; }
.stepper__label { font-size: var(--fs-caption); font-weight: 600; color: var(--color-muted); white-space: nowrap; }
.stepper__line { flex: 1; height: 1px; background: var(--color-border); margin: 0 6px; }
.stepper__step.is-done .stepper__dot { background: var(--color-primary-700); border-color: var(--color-primary-700); color: #fff; }
.stepper__step.is-active .stepper__dot { border-color: var(--color-primary-700); color: var(--color-primary-700); box-shadow: var(--shadow-focus); }
.stepper__step.is-active .stepper__label, .stepper__step.is-done .stepper__label { color: var(--color-ink); }
@media (max-width: 640px) { .stepper__label { display: none; } }

/* ---------- Table (dashboards) ----------
   v1.6.88: consistent header/row treatment. Mobile stacking (<=768px) is driven by
   data-label attributes added in main.js and applies only to .dtable--stack, so the
   SAME rows/forms/nonces are used at every width (no cloned cards). Without JS the
   table remains a table inside its horizontally scrollable wrapper. */
.dtable { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-small); }
.dtable th { text-align: left; font-family: var(--font-mono); font-size: var(--fs-caption); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-muted); padding: 12px 16px; background: var(--color-bg-sunken); border-bottom: 1px solid var(--color-border); white-space: nowrap; }
.dtable td { padding: 14px 16px; border-bottom: 1px solid var(--color-border-soft); vertical-align: middle; }
.dtable tbody tr:last-child td { border-bottom: 0; }
.dtable tbody tr:hover td { background: var(--color-primary-50); }
.dtable-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); box-shadow: var(--shadow-sm); }
.dtable-wrap .dtable { border: 0; width: 100%; min-width: 0; }
.dtable-wrap th:first-child, .dtable-wrap td:first-child { padding-left: 20px; }
.dtable-wrap th:last-child, .dtable-wrap td:last-child { padding-right: 20px; }
.dtable td .hstack { gap: 12px; min-width: 0; }
.dtable td .badge { white-space: nowrap; }
.dtable td.dtable-empty { text-align: center; color: var(--color-muted); padding: var(--space-10) var(--space-4); }
.featured-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.table-actions { display:flex; align-items:center; gap:4px; }
.table-action { width:34px; height:34px; border:0; background:transparent; color:var(--color-ink-soft); display:grid; place-items:center; border-radius:50%; padding:0; transition: background var(--dur-fast) var(--ease-standard), color var(--dur-fast); }
.table-action:hover { background:var(--color-bg-sunken); color:var(--color-ink); }
.table-action--danger:hover { background:var(--color-error-100); color:var(--color-error-700); }
.table-action svg { width:17px; height:17px; }
.table-action-form { margin:0; }

/* ---------- Stat card (dashboards) ---------- */
.stat-card { border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-5); background: var(--color-surface); }
.stat-card__label { font-family: var(--font-mono); font-size: var(--fs-caption); color: var(--color-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stat-card__value { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; margin: 6px 0 4px; }
.stat-card__delta { font-size: var(--fs-caption); font-weight: 600; }
.stat-card__delta.up { color: var(--color-success-700); }
.stat-card__delta.down { color: var(--color-error-700); }

/* ---------- Plan / pricing card ---------- */
.plan-card { border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-6); background: var(--color-surface); display: flex; flex-direction: column; gap: var(--space-4); position: relative; }
.plan-card.is-highlight { border-color: var(--color-primary-700); box-shadow: var(--shadow-md); }
.plan-card__ribbon { position: absolute; top: -13px; left: var(--space-6); background: var(--color-primary-700); color: #fff; font-size: var(--fs-caption); font-weight: 700; padding: 4px 12px; border-radius: var(--radius-pill); }
.plan-card__price { font-family: var(--font-display); font-size: 2.1rem; font-weight: 700; }
.plan-card__price span { font-family: var(--font-body); font-size: var(--fs-small); font-weight: 500; color: var(--color-muted); }
.plan-card__list { display: flex; flex-direction: column; gap: 10px; font-size: var(--fs-small); }
.plan-card__list li { display: flex; gap: 8px; align-items: flex-start; }
.plan-card__list svg { width: 16px; height: 16px; stroke: var(--color-success-600, var(--color-success-500)); flex-shrink: 0; margin-top: 2px; }

/* ---------- Status dot ---------- */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.status-dot.published { background: var(--color-success-500); }
.status-dot.pending { background: var(--color-warning-500); }
.status-dot.draft { background: var(--color-muted-soft); }
.status-dot.rejected { background: var(--color-error-500); }
.status-dot.expired { background: var(--color-muted-soft); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: var(--radius-pill); font-size: var(--fs-caption); font-weight: 600; line-height: 1.5; white-space: nowrap; background: var(--color-bg-sunken); color: var(--color-ink-soft); }
.status-pill .status-dot { margin-right: 0; }
.status-pill--published { background: var(--color-success-100); color: var(--color-success-700); }
.status-pill--pending { background: var(--color-warning-100); color: var(--color-warning-700); }
.status-pill--rejected { background: var(--color-error-100); color: var(--color-error-700); }


/* DXP public image fallbacks */
.dxp-image-frame{position:relative;width:100%;height:100%;min-height:100%;overflow:hidden;border:1px solid var(--color-border);border-radius:var(--radius-sm);background:var(--color-bg-sunken);}
.dxp-image-frame img{position:relative;z-index:1;width:100%;height:100%;display:block;object-fit:cover;border-radius:inherit;}
.dxp-image-frame .dxp-placeholder{position:absolute;inset:0;display:grid;place-items:center;}
.dxp-image-frame.is-broken .dxp-placeholder{z-index:2;}
.dxp-placeholder{border:1px solid var(--color-border);border-radius:var(--radius-sm);background:linear-gradient(135deg,var(--color-bg-sunken),var(--color-surface));color:var(--color-muted);font-family:var(--font-mono);font-size:var(--fs-caption);letter-spacing:.12em;}
.listing-card__media{border-radius:var(--radius-sm);}
.listing-card__media .dxp-image-frame{border:0;border-radius:inherit;}
.dxp-placeholder--location{position:absolute;inset:0;border:0;border-radius:inherit;}

/* v1.6.88 image loading: subtle brand-neutral shimmer -> fade-in; broken images fall back to the DXP placeholder.
   Classes are set by main.js (.is-loading / .is-loaded / .is-broken); without JS images just display. */
.dxp-image-frame img, .dxp-detail-image-frame img, .dxp-detail-gallery-image img { opacity: 1; transition: opacity var(--dur-med) var(--ease-standard); }
.dxp-image-frame.is-loading img, .dxp-detail-image-frame.is-loading img, .dxp-detail-gallery-image.is-loading img { opacity: 0; }
.dxp-image-frame.is-loading, .dxp-detail-image-frame.is-loading, .dxp-detail-gallery-image.is-loading {
  background: linear-gradient(100deg, var(--color-bg-sunken) 30%, var(--color-surface) 50%, var(--color-bg-sunken) 70%);
  background-size: 200% 100%; animation: dxp-shimmer 1.4s linear infinite;
}
.dxp-image-frame.is-loading .dxp-placeholder, .dxp-detail-image-frame.is-loading .dxp-placeholder, .dxp-detail-gallery-image.is-loading .dxp-placeholder { opacity: 0; }
.dxp-image-frame.is-broken img, .dxp-detail-image-frame.is-broken img, .dxp-detail-gallery-image.is-broken img { display: none; }
@keyframes dxp-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.dxp-suggest-wrap{position:relative;}
.dxp-location-suggestions{position:absolute;z-index:1000;top:calc(100% + 6px);left:0;right:0;background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-sm);box-shadow:var(--shadow-lg);padding:6px;max-height:280px;overflow:auto;}
.dxp-location-option{width:100%;display:flex;align-items:center;gap:10px;padding:10px 12px;border:0;background:transparent;border-radius:6px;text-align:left;color:var(--color-ink);cursor:pointer;font:inherit;}
.dxp-location-option:hover{background:var(--color-bg-sunken);}
.dxp-location-option__icon{color:var(--color-primary-700);font-size:14px;}


/* Category feature images */
.category-card__image{display:block;width:100%;height:150px;object-fit:cover;border-radius:var(--radius-md);margin-bottom:14px;border:1px solid var(--line,#e5e7eb);}
.category-card:has(.category-card__image){display:block;overflow:hidden;}

.analytics-chart-wrap { width:100%; overflow:hidden; }
.analytics-chart { width:100%; height:auto; min-height:220px; display:block; color:var(--color-primary-700); }
.analytics-chart__label { font-family:var(--font-mono); font-size:11px; fill:var(--color-muted); }
.analytics-chart__value { font-family:var(--font-mono); font-size:10.5px; font-weight:600; fill:var(--color-ink); paint-order:stroke; stroke:var(--color-surface); stroke-width:3px; stroke-linejoin:round; }
.analytics-chart__dot { fill:currentColor; stroke:var(--color-surface); stroke-width:1.5px; }
@media (max-width:768px){ .analytics-chart { min-width:620px; } .analytics-chart-wrap { overflow-x:auto; } }

/* Current membership plan emphasis */
.plan-card.is-current { border-color: var(--color-primary-700); background: var(--color-primary-50); box-shadow: var(--shadow-md); }
.plan-card.is-current .plan-card__ribbon.dxp-plan-current-ribbon { background: var(--color-primary-700); }
.dxp-your-plan-badge { background: var(--color-primary-100); color: var(--color-primary-700); font-weight: 700; }
.dxp-current-plan-card { border-color: var(--color-primary-700) !important; background: var(--color-primary-50) !important; box-shadow: var(--shadow-md); }
.dxp-current-plan-card .badge-featured { background: var(--color-primary-100); color: var(--color-primary-700); }
.plan-card.is-highlight.is-current .plan-card__ribbon.dxp-plan-current-ribbon { top: 28px; }
.dxp-plan-notice { border-color: var(--color-primary-700); background: var(--color-primary-50); }
.dxp-plan-lock { display:block; }
.table-action--premium { color: var(--color-accent, #9a7b00); }
.table-action--premium:hover { color: var(--color-accent, #9a7b00); background: var(--color-bg-sunken); }

/* ---------- Star rating (v1.6.92) ----------
   Two stacked layers of five stars (grey base + gold fill clipped to the average, so 4.5 shows a half
   star) with five transparent buttons on top. Separate from Reviews. */
.dxp-stars { --star: 22px; --gap: 3px; --gold: #f5b301; --grey: #d3d6d4; margin: 0; }
.dxp-stars__row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.dxp-stars__visual { position: relative; display: inline-block; flex: none; width: calc(5 * var(--star) + 4 * var(--gap)); height: var(--star); }
.dxp-stars__layer { position: absolute; top: 0; left: 0; height: 100%; display: flex; gap: var(--gap); }
.dxp-stars__layer svg { flex: none; display: block; max-width: none; width: var(--star); height: var(--star); fill: currentColor; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; }
.dxp-stars__layer--base { color: var(--grey); width: 100%; }
.dxp-stars__layer--fill { color: var(--gold); overflow: hidden; width: calc(var(--n, 0) * (var(--star) + var(--gap)) + var(--frac, 0) * var(--star)); transition: width var(--dur-fast) var(--ease-standard); }
.dxp-stars__hit { position: absolute; inset: 0; display: flex; gap: var(--gap); }
.dxp-stars__btn { flex: none; width: var(--star); height: var(--star); padding: 0; border: 0; border-radius: 4px; background: transparent; cursor: default; }
.dxp-stars.is-interactive:not(.is-locked) .dxp-stars__btn { cursor: pointer; }
.dxp-stars__btn:focus-visible { outline: 2px solid var(--color-primary-500); outline-offset: 2px; }
.dxp-stars__summary { display: inline-flex; align-items: baseline; gap: 6px; font-size: var(--fs-small); }
.dxp-stars__score { font-size: 1rem; font-weight: 700; color: var(--color-ink); }
.dxp-stars__count { color: var(--color-muted); }
.dxp-stars__hint { display: none; margin: 4px 0 0; min-height: 1.2em; font-size: var(--fs-caption); color: var(--color-muted); }
.dxp-stars.is-interactive .dxp-stars__hint { display: block; }
.dxp-stars__hint.is-error { color: var(--color-error-700); }
.dxp-stars.is-busy { opacity: 0.7; pointer-events: none; }
@media (max-width: 640px) { .dxp-stars { --star: 26px; } }

