/* 
  Sleek Light Theme (White & Blue)
  Premium UI CSS Framework 
*/

:root {
  /* Color Palette */
  --bg: #edf2f8;
  --bg-gradient: linear-gradient(135deg, #edf2f8 0%, #e1e9f5 100%);
  --card: #f5f8fc;
  --card-blur: rgba(245, 248, 252, 0.9);
  
  --ink: #0f172a;
  --ink-light: #334155;
  --muted: #64748b;
  --line: #cfd9e6;
  
  /* Primary Blues */
  --primary: #1546b4;
  --primary-hover: #123b95;
  --primary-glow: rgba(21, 70, 180, 0.36);
  --primary-soft: #e8eef9;
  --accent: #1f5ad6;
  --accent-light: #dbe7fb;
  
  /* Status Colors */
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --warning-light: #fffbeb;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body[data-theme="patriot"] {
  --bg: #f1f4f8;
  --bg-gradient: linear-gradient(135deg, #f7f9fc 0%, #e6ecf4 100%);
  --card: #f8fafc;
  --card-blur: rgba(248, 250, 252, 0.92);
  --ink: #101621;
  --ink-light: #2f3948;
  --muted: #5f6f86;
  --line: #cfd7e4;
  --primary: #c4162a;
  --primary-hover: #9f1020;
  --primary-glow: rgba(196, 22, 42, 0.28);
  --primary-soft: #fae8eb;
  --accent: #153f78;
  --accent-light: #e7eef8;
}

body[data-theme="red"] {
  --bg: #f7f3f4;
  --bg-gradient: linear-gradient(135deg, #fff7f8 0%, #f1e7ea 100%);
  --card: #fffafa;
  --card-blur: rgba(255, 250, 250, 0.92);
  --ink: #1c1215;
  --ink-light: #3f2b30;
  --muted: #745b63;
  --line: #ead0d6;
  --primary: #b91c1c;
  --primary-hover: #991b1b;
  --primary-glow: rgba(185, 28, 28, 0.25);
  --primary-soft: #fee2e2;
  --accent: #334155;
  --accent-light: #fee2e2;
}

body[data-theme="slate"] {
  --bg: #eef2f5;
  --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  --card: #f8fafc;
  --card-blur: rgba(248, 250, 252, 0.92);
  --ink: #0f172a;
  --ink-light: #334155;
  --muted: #64748b;
  --line: #cbd5e1;
  --primary: #334155;
  --primary-hover: #1f2937;
  --primary-glow: rgba(51, 65, 85, 0.24);
  --primary-soft: #e2e8f0;
  --accent: #0f766e;
  --accent-light: #dff4ef;
}

* { 
  box-sizing: border-box; 
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

img,
svg {
  max-width: 100%;
}

body.modal-open {
  overflow: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--ink);
  font-weight: 600;
  line-height: 1.2;
}

h1 { font-size: 2.25rem; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; margin-bottom: 0.5rem; letter-spacing: -0.01em; }
p { margin-bottom: 1rem; }

.muted { color: var(--muted); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.85rem; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.font-lg { font-size: 0.95rem; }
.w-full { width: 100%; }
.mb-05 { margin-bottom: 0.5rem; }

.icon-sm { font-size: 1.1rem; }
.icon-md { font-size: 1.15rem; }
.icon-lg { font-size: 1.25rem; }
.icon-primary { color: var(--primary); }
.icon-success { color: var(--success); }
.icon-warning { color: var(--warning); }
.icon-inline-gap { margin-left: 0.25rem; }
.icon-leading-gap { margin-right: 0.25rem; }
.svg-icon {
  width: 1.1rem;
  height: 1.1rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.svg-icon-md {
  width: 1.15rem;
  height: 1.15rem;
}
.flex-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.spacer-xs { height: 0.5rem; }
.mb-075 { margin-bottom: 0.75rem; }
.page-shell-padded { padding-top: 2rem; padding-bottom: 2rem; }
.landing-band-flush-top { padding-top: 0; }
.tag-inline-current {
  margin-left: 0.5rem;
  font-size: 0.75rem;
}

.catalog-retention-banner {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 14px max(20px, calc((100vw - 1400px) / 2));
  border-bottom: 1px solid color-mix(in srgb, var(--warning) 42%, var(--line));
  background: color-mix(in srgb, var(--warning-light) 88%, var(--card));
  color: var(--text);
}

.integration-disconnect-button {
  margin-top: 1rem;
}

.catalog-retention-banner > i {
  flex: 0 0 auto;
  margin-top: 3px;
  color: var(--warning);
  font-size: 22px;
}

.catalog-retention-banner div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.catalog-retention-banner span,
.catalog-retention-banner small {
  overflow-wrap: anywhere;
}

.catalog-retention-banner small {
  color: var(--muted);
}

/* Layout Grid */
.container {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 4rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0 2.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-brand {
  margin-bottom: 2rem;
  color: var(--primary);
  font-size: 2rem;
  justify-content: center;
}

.brand-logo {
  width: auto;
  height: 2.9rem;
  object-fit: contain;
  max-width: 12rem;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.profile-chip {
  gap: 0.75rem;
}

.profile-chip-avatar,
.profile-avatar-large {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--card);
}

.profile-chip-fallback,
.profile-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #ffffff;
  font-weight: 700;
}

.profile-chip-fallback {
  width: 2rem;
  height: 2rem;
  font-size: 0.8rem;
}

/* Workspace Dropdown */
.workspace-dropdown {
  position: relative;
}

.workspace-dropdown summary::-webkit-details-marker {
  display: none;
}

.workspace-dropdown summary {
  list-style: none;
}

.workspace-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  min-width: 200px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.workspace-dropdown-item {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--ink);
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workspace-dropdown-item:hover,
.workspace-dropdown-item:focus {
  background: var(--accent-light);
  color: var(--primary);
  text-decoration: none;
}

.profile-hero {
  background:
    radial-gradient(circle at top right, rgba(31, 90, 214, 0.2), transparent 35%),
    linear-gradient(135deg, rgba(245, 248, 252, 0.97) 0%, rgba(226, 235, 247, 0.95) 100%);
}

.profile-hero-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.products-panel-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.25rem 1.5rem;
}

.panel-header h2 {
  margin-bottom: 0.5rem;
}

.panel-header .muted {
  margin-bottom: 0;
}

.collapsible-panel {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--line);
}

.collapsible-panel[hidden] {
  display: none !important;
}

.profile-avatar-large,
.profile-avatar-fallback.profile-avatar-large {
  width: 5.75rem;
  height: 5.75rem;
}

.profile-avatar-fallback.profile-avatar-large {
  font-size: 1rem;
  box-shadow: var(--shadow-md);
}

.branding-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.sync-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  min-width: 14.5rem;
}

.dashboard-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
  min-width: 12rem;
  padding: 1rem 1.1rem;
  border-radius: 18px;
  border: 1px solid rgba(122, 141, 176, 0.18);
  background: linear-gradient(180deg, rgba(248, 250, 253, 0.98), rgba(239, 244, 251, 0.98));
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.9rem;
  margin: 1rem 0 0.5rem;
}

.dashboard-stat::before {
  content: "";
  width: 2.5rem;
  height: 0.28rem;
  border-radius: 999px;
  margin-bottom: 0.2rem;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.dashboard-stat-label {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.dashboard-stat-value {
  font-family: 'Space Grotesk', 'Outfit', system-ui, sans-serif;
  font-size: 1.85rem;
  line-height: 1;
  color: var(--primary);
}

.dashboard-stat-success::before {
  background: linear-gradient(90deg, #059669, #10b981);
}

.dashboard-stat-success .dashboard-stat-value {
  color: #047857;
}

.dashboard-stat-accent::before {
  background: linear-gradient(90deg, #4338ca, #6366f1);
}

.dashboard-stat-accent .dashboard-stat-value {
  color: #4338ca;
}

.dashboard-stat-warning::before {
  background: linear-gradient(90deg, #d97706, #f59e0b);
}

.dashboard-stat-warning .dashboard-stat-value {
  color: #b45309;
}

.dashboard-stat-muted::before {
  background: linear-gradient(90deg, #64748b, #94a3b8);
}

.dashboard-stat-muted .dashboard-stat-value {
  color: #475569;
}


.dashboard-stat-payment {
  justify-content: flex-start;
  gap: 0.55rem;
  padding: 0.85rem;
}

.dashboard-stat-payment::before {
  margin-left: 0.15rem;
}

.payment-card-mini {
  display: grid;
  gap: 0.7rem;
  width: 100%;
  min-height: 7.4rem;
  padding: 0.9rem;
  border-radius: 14px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 42%),
    linear-gradient(135deg, #16213f 0%, #2456c8 55%, #0f766e 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 14px 24px rgba(15, 23, 42, 0.16);
}

.payment-card-top,
.payment-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 0.7rem;
}

.payment-card-brand {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
}

.payment-card-chip {
  width: 2.1rem;
  height: 1.45rem;
  flex: 0 0 auto;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: linear-gradient(135deg, #f8d47a, #b9872d);
  box-shadow: inset 0 0 0 1px rgba(60, 38, 5, 0.16);
}

.payment-card-number {
  display: block;
  font-family: 'Space Grotesk', 'Outfit', system-ui, sans-serif;
  font-size: 1.35rem;
  line-height: 1;
  letter-spacing: 0.04em;
  color: #fff;
  white-space: nowrap;
}

.payment-card-name,
.payment-card-exp {
  min-width: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}

.payment-card-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-card-exp {
  flex: 0 0 auto;
}

.payment-card-empty {
  align-self: center;
  color: rgba(255, 255, 255, 0.88);
  font-family: 'Space Grotesk', 'Outfit', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
}
.status-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.import-status-header .icon-button {
  background: rgba(255, 255, 255, 0.38);
  border-color: rgba(148, 163, 184, 0.35);
}

.button.button-compact {
  min-height: 2.35rem;
  padding: 0.52rem 0.85rem;
  font-size: 0.82rem;
  line-height: 1.1;
}

.import-status-card {
  position: relative;
  margin-top: 1.5rem;
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(219, 231, 251, 0.72), rgba(245, 248, 252, 0.94));
}

.import-status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}

.progress-track {
  position: relative;
  overflow: hidden;
  height: 0.8rem;
  border-radius: 999px;
  background: #c8d9f8;
  margin-bottom: 1rem;
}

.progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.25s ease;
}

.progress-bar-active { width: 42%; }
.progress-bar-complete { width: 100%; }

.progress-bar-indeterminate {
  position: relative;
  overflow: hidden;
}

.progress-bar-indeterminate::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 45%;
  background: linear-gradient(90deg, rgba(255,255,255,0.15), rgba(255,255,255,0.65), rgba(255,255,255,0.15));
  animation: progressSlide 1.2s infinite ease-in-out;
}

@keyframes progressSlide {
  from { transform: translateX(-140%); }
  to { transform: translateX(260%); }
}

.import-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.9rem;
}

.import-status-grid div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.import-status-grid strong {
  font-size: 1.1rem;
}

.product-search-shell {
  position: relative;
  width: 100%;
  min-width: min(18rem, 100%);
  display: block;
}

.product-filters-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.9rem;
}

.product-controls {
  width: auto;
  margin-left: auto;
}

.product-search-container {
  margin-top: 1rem;
  width: 100%;
}

.product-action-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.65rem;
  width: 100%;
  margin: 1rem 0 1.1rem;
}

.product-action-bar button,
.product-action-bar .button {
  min-height: 3.15rem;
  width: 100%;
  white-space: nowrap;
}

.product-filter-shell {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.65rem;
  min-width: 11rem;
}

.product-filter-label {
  margin-bottom: 0;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
}

.product-filter-select {
  min-height: 3.15rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(245, 248, 252, 0.96);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.98rem;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08), inset 0 1px 2px rgba(0,0,0,0.02);
  min-width: 15.5rem;
}

.product-filter-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--accent-light);
  background: var(--card);
}

.product-search-input {
  width: 100%;
  margin-bottom: 0;
  padding-left: 1rem !important;
  padding-right: 1rem !important;
  border-radius: 14px;
  background: rgba(245, 248, 252, 0.96);
  min-height: 3.35rem;
  line-height: 1.2;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08), inset 0 1px 2px rgba(0,0,0,0.02);
}

.branding-preview-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  padding: 1rem 1.1rem;
}

.sync-settings-card {
  margin-bottom: 1.35rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(219, 231, 251, 0.72), rgba(245, 248, 252, 0.96));
  padding: 1.1rem 1.15rem;
}

.sync-settings-header {
  margin-bottom: 1rem;
}

.sync-settings-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.2rem;
}

.sync-settings-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.15fr) minmax(180px, 0.85fr);
  gap: 1rem 1.25rem;
  align-items: start;
}

.sync-settings-toggle,
.sync-settings-interval {
  border: 1px solid rgba(191, 219, 254, 0.8);
  border-radius: 16px;
  background: rgba(245, 248, 252, 0.94);
  padding: 1rem;
}

.sync-checkbox-label {
  margin-bottom: 0.6rem;
  font-weight: 600;
}

.sync-settings-interval input[type="number"] {
  max-width: 8rem;
  margin-bottom: 0.5rem;
}

.sync-run-card {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.sync-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.branding-preview-logo {
  width: 3.5rem;
  height: 3.5rem;
}

.favicon-preview {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  border-radius: 0.5rem;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 0.2rem;
}

/* Cards & Glassmorphism */
.card {
  background: var(--card-blur);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

/* Add a subtle highlight to cards */
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(31, 90, 214, 0.3), transparent);
  opacity: 0.5;
}

/* Auth Specific */
.auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: clamp(1rem, 4vh, 2rem) 1rem;
  background: radial-gradient(circle at top left, var(--accent-light), var(--bg));
}

.auth-card {
  width: min(100%, 420px);
  padding: 2.5rem 2rem;
}

.auth-heading {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-label-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.auth-label-row label {
  margin-bottom: 0;
}

.auth-label-row a {
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}

.auth-label-row a:hover {
  text-decoration: underline;
}

.auth-back-link {
  justify-content: center;
  margin-top: 0.85rem;
  text-decoration: none;
}

.rate-limit-icon {
  font-size: 3rem;
  color: var(--warning);
  margin-bottom: 1rem;
}

.rate-limit-title {
  margin-bottom: 0.75rem;
}

.auth-field {
  margin-bottom: 1.25rem;
}

.auth-field-spaced {
  margin-bottom: 1.5rem;
}

.auth-input-shell {
  position: relative;
}

.auth-input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  line-height: 0;
  pointer-events: none;
}

.auth-input-with-left-icon {
  padding-left: 2.75rem !important;
  margin-bottom: 0 !important;
}

.auth-password-input {
  padding-right: 3rem !important;
}

.auth-password-toggle {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
}

.auth-password-toggle:hover,
.auth-password-toggle:active {
  transform: translateY(-50%);
}

.turnstile-shell {
  display: flex;
  justify-content: center;
  margin: 1.45rem 0 1.5rem;
  max-width: 100%;
  overflow: hidden;
}

.captcha-status {
  margin: -0.8rem 0 1rem;
  min-height: 1.1rem;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.captcha-status-ready {
  color: #047857;
}

.workspace-url-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 0.75rem 1.75rem rgba(15, 23, 42, 0.05);
}

.workspace-url-main {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
}

.workspace-url-main > i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.85rem;
  background: rgba(29, 78, 216, 0.1);
  color: var(--primary);
  font-size: 1.15rem;
}

.workspace-url-main span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.workspace-url-main strong {
  display: block;
  min-width: 0;
  margin-top: 0.18rem;
  color: var(--ink);
  font-size: 1.02rem;
  overflow-wrap: anywhere;
}

.slug-status {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 0.42rem;
  min-height: 2.3rem;
  padding: 0.48rem 0.78rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.slug-status:empty {
  display: none;
}

.slug-status i {
  flex: 0 0 auto;
  font-size: 1rem;
}

.slug-status span {
  min-width: 0;
}

.slug-status-valid {
  border-color: rgba(16, 185, 129, 0.36);
  background: rgba(236, 253, 245, 0.86);
  color: #047857;
}

.slug-status-invalid {
  border-color: rgba(239, 68, 68, 0.34);
  background: rgba(254, 242, 242, 0.92);
  color: #b91c1c;
}

.slug-status-checking {
  border-color: rgba(96, 117, 147, 0.26);
  background: rgba(255, 255, 255, 0.64);
  color: var(--muted);
}

input.field-valid {
  border-color: rgba(16, 185, 129, 0.55);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

input.field-invalid {
  border-color: rgba(239, 68, 68, 0.6);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.password-rule-hint {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
  margin: -0.5rem 0 1.25rem;
}

.provider-choice-section {
  margin-bottom: 1.35rem;
}

.provider-choice-heading {
  display: grid;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.provider-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.provider-choice-card,
.locked-provider-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 0.9rem;
  box-shadow: var(--shadow-sm);
}

.provider-choice-card {
  flex-direction: column;
  align-items: stretch;
  cursor: pointer;
  min-height: 7rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.provider-choice-card:hover,
.provider-choice-card.is-selected {
  border-color: var(--primary);
  box-shadow: 0 10px 24px var(--primary-glow);
  transform: translateY(-1px);
}

.provider-choice-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.provider-brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.provider-brand-lockup strong,
.locked-provider-card strong {
  display: block;
  color: var(--ink);
  line-height: 1.1;
}

.provider-brand-lockup small,
.locked-provider-card small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
  margin-top: 0.25rem;
}

.provider-logo {
  width: 4rem;
  height: 3rem;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem;
}

.provider-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.provider-logo-shopify img,
.provider-logo-bigcommerce img {
  max-width: 2.7rem;
}

.locked-provider-card {
  justify-content: space-between;
  margin: 1rem 0;
}

.locked-provider-card > span:nth-child(2) {
  flex: 1;
}

.checkout-provider-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.85rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

.checkout-provider-summary .provider-logo {
  width: 2.6rem;
  height: 1.8rem;
  padding: 0;
}

/* Forms */
label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink-light);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
textarea {
  width: 100%;
  padding: 0.85rem 1.15rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.25s ease;
  margin-bottom: 1.2rem;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}

.theme-select,
select {
  width: 100%;
  padding: 0.85rem 1.15rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.25s ease;
  margin-bottom: 0.5rem;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}

.theme-select:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--accent-light);
  background: var(--card);
}

input[type="file"] {
  width: 100%;
  margin-bottom: 0.35rem;
  padding: 0.7rem;
  border: 1px dashed #9fb9eb;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--card) 0%, #edf3fa 100%);
  color: var(--ink-light);
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  margin-right: 0.9rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  padding: 0.7rem 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--primary-glow);
}

input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3.5rem;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: none;
  cursor: pointer;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 10px;
}

input[type="color"]:hover {
  border-color: var(--primary);
}

.provider-trial-note {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.3;
}

.provider-trial-note.is-available {
  color: #047857;
}

.provider-trial-note.is-used {
  color: #9a3412;
}

.provider-trial-status {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.provider-trial-status > i {
  margin-top: 0.15rem;
  font-size: 1.15rem;
}

.provider-trial-status strong,
.provider-trial-status span {
  display: block;
}

.provider-trial-status span {
  margin-top: 0.2rem;
  color: var(--muted);
  line-height: 1.45;
}

.provider-trial-status.is-available {
  border-color: #a7f3d0;
  color: #047857;
  background: rgba(236, 253, 245, 0.78);
}

.provider-trial-status.is-unavailable {
  border-color: #fed7aa;
  color: #9a3412;
  background: rgba(255, 247, 237, 0.82);
}

.custom-theme-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--accent-light);
  background: var(--card);
}

input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--primary);
  border-radius: 4px;
  margin-right: 0.5rem;
  cursor: pointer;
  vertical-align: middle;
}

.checkbox-label {
  display: flex;
  width: fit-content;
  align-items: center;
  margin-bottom: 1.2rem;
  font-weight: 500;
  cursor: pointer;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}

.form-field-wide {
  grid-column: 1 / -1;
}

.file-upload-field {
  position: relative;
}

.file-hint {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: -0.1rem;
  margin-bottom: 1rem;
}

.settings-help-text {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.secret-field-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.secret-field-header label {
  margin-bottom: 0;
}

.secret-status {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.secret-status-saved {
  color: #047857;
  background: rgba(209, 250, 229, 0.8);
  border: 1px solid #a7f3d0;
}

.secret-status-empty {
  color: #64748b;
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid #cbd5e1;
}

@media (max-width: 720px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-field-wide {
    grid-column: auto;
  }

  .custom-theme-grid {
    grid-template-columns: 1fr;
  }

  .workspace-url-preview {
    align-items: stretch;
    flex-direction: column;
  }

  .slug-status {
    width: 100%;
  }

  .provider-choice-grid {
    grid-template-columns: 1fr;
  }

  .locked-provider-card {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .sync-settings-grid {
    grid-template-columns: 1fr;
  }
}

/* Buttons */
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  padding: 0.85rem 1.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px var(--primary-glow);
}

button:hover, .button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--primary-glow);
}

button:active, .button:active {
  transform: scale(0.97) translateY(0);
}

.button.secondary {
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.button.secondary:hover {
  border-color: var(--muted);
  box-shadow: var(--shadow-md);
}

.button.danger {
  background: var(--danger);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.button.danger:hover {
  background: #dc2626;
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

button:disabled,
.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.icon-button {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  box-shadow: none;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  flex: 0 0 1.1rem;
  overflow: hidden;
}

.nav-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button:hover {
  background: var(--line);
  color: var(--ink);
  transform: none;
  box-shadow: none;
}

.icon-button.auth-password-toggle:hover,
.icon-button.auth-password-toggle:active {
  transform: translateY(-50%);
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  margin-top: 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #ffffff;
}

#models-table-shell .table-wrapper {
  overflow-x: auto;
}

.models-table {
  table-layout: auto;
}

.models-table th:nth-child(1),
.models-table td:nth-child(1) {
  width: 26%;
}

.models-table th:nth-child(2),
.models-table td:nth-child(2) {
  width: 12%;
}

.models-table th:nth-child(3),
.models-table td:nth-child(3) {
  width: 12%;
}

.models-table th:nth-child(4),
.models-table td:nth-child(4) {
  width: 12%;
}

.models-table th:nth-child(5),
.models-table td:nth-child(5) {
  width: 12%;
}

.models-table th:nth-child(6),
.models-table td:nth-child(6) {
  width: 26%;
}

.models-table th:nth-child(2),
.models-table th:nth-child(3),
.models-table th:nth-child(4),
.models-table th:nth-child(5),
.models-table td:nth-child(2),
.models-table td:nth-child(3),
.models-table td:nth-child(4),
.models-table td:nth-child(5) {
  text-align: center;
}

.models-table th:nth-child(6) {
  text-align: right;
}

.model-actions-cell {
  text-align: right;
}

.model-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  width: 100%;
  flex-wrap: wrap;
}

.model-actions .button {
  padding: 0.72rem 1.1rem;
  white-space: nowrap;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

th, td {
  text-align: left;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  background: var(--bg);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.05em;
}

tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: background-color 0.2s ease;
}

tbody tr:hover {
  background-color: var(--accent-light);
}

.product-actions-cell {
  min-width: 15rem;
}

.product-row-actions {
  align-items: center;
  justify-content: flex-start;
}

.product-row-actions button,
.product-row-actions .button {
  white-space: nowrap;
}

/* Tags / Badges */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-imported { background: rgba(239, 246, 255, 0.9); color: #1d4ed8; border: 1px solid #bfdbfe; }
.status-refreshed { background: rgba(248, 250, 252, 0.95); color: #475569; border: 1px solid #cbd5e1; }
.status-removed-from-store { background: rgba(255, 247, 237, 0.96); color: #c2410c; border: 1px solid #fdba74; }
.status-pending { background: var(--warning-light); color: #d97706; border: 1px solid #fde68a; }
.status-generated,
.status-seo-generated { background: rgba(224, 231, 255, 0.92); color: #4338ca; border: 1px solid #c7d2fe; }
.status-published { background: var(--success-light); color: #059669; border: 1px solid #a7f3d0; }
.status-failed,
.status-import-failed,
.status-seo-failed,
.status-publish-failed { background: var(--danger-light); color: #b91c1c; border: 1px solid #fecaca; }

/* Flashes */
.flash-list {
  list-style: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  width: min(24rem, calc(100vw - 2rem));
  z-index: 1200;
  pointer-events: none;
}

.flash {
  padding: 1rem 1rem 1rem 1.1rem;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
  animation: slideInToast 0.28s ease;
  box-shadow: var(--shadow-xl);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: auto;
  border-left-width: 5px;
  border-left-style: solid;
  position: relative;
}

.flash.is-dismissing {
  opacity: 0;
  transform: translate3d(16px, 8px, 0) scale(0.98);
  transition: all 0.3s ease;
}

@keyframes slideInToast {
  from { opacity: 0; transform: translate3d(24px, 12px, 0) scale(0.98); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

.flash.success {
  background: rgba(236, 253, 245, 0.96);
  color: #065f46;
  border: 1px solid #a7f3d0;
  border-left-color: #10b981;
}

.flash.warning {
  background: rgba(255, 251, 235, 0.97);
  color: #92400e;
  border: 1px solid #fde68a;
  border-left-color: #f59e0b;
}

.flash.danger {
  background: rgba(254, 242, 242, 0.97);
  color: #991b1b;
  border: 1px solid #fecaca;
  border-left-color: #ef4444;
}

.flash.info {
  background: rgba(239, 246, 255, 0.97);
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  border-left-color: #2563eb;
}

.flash .icon-button {
  margin-left: auto;
  width: 1.75rem;
  height: 1.75rem;
  min-width: 1.75rem;
  color: inherit;
  opacity: 0.7;
}

.flash .icon-button:hover {
  background: rgba(255, 255, 255, 0.55);
  opacity: 1;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 1rem;
  z-index: 1000;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.3s ease;
  overflow-y: auto;
}

/* Confirmation dialogs can be opened from another modal and must always win
   the stacking order without relying on DOM position. */
.modal-backdrop[data-confirm-modal] {
  z-index: 1100;
}

.modal-backdrop[hidden] {
  display: none !important;
  opacity: 0;
}

.modal-card {
  width: min(100%, 480px);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: var(--shadow-xl);
  cursor: default;
  transform: scale(1);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-card .actions {
  margin-top: 1.5rem;
}

.billing-modal-counter {
  margin: 1.25rem 0 1rem;
}

.seo-preview-modal-card {
  width: min(100%, 760px);
  padding: 0;
  overflow-x: hidden;
}

.seo-preview-modal-card .modal-header-row {
  padding: 2rem 2rem 0;
  margin-bottom: 1.5rem;
}

.seo-preview-subtitle {
  margin: 0.35rem 0 0;
}

.seo-preview-content {
  display: grid;
  gap: 1rem;
  margin-bottom: 0;
  padding: 0 2rem 1.25rem;
}

.seo-preview-block,
.seo-preview-meta-grid > div {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(255, 255, 255, 1));
  padding: 1rem 1.1rem;
}

.seo-preview-block p,
.seo-preview-meta-grid p {
  margin: 0;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

.seo-preview-block input,
.seo-preview-block textarea {
  margin-bottom: 0;
  background: #ffffff;
}

.seo-preview-block textarea {
  resize: vertical;
  min-height: 7rem;
}

.rich-description-editor {
  background: #ffffff;
  resize: vertical;
  overflow: auto;
  height: 300px;
  min-height: 220px;
  max-height: 620px;
}

.rich-description-editor .ql-editor {
  min-height: 180px;
  height: auto;
  max-height: none;
  overflow-y: auto;
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--ink);
}

.seo-preview-block .ql-toolbar.ql-snow {
  border-color: var(--line);
  border-radius: 14px 14px 0 0;
  background: #f8fafc;
}

.seo-preview-block .ql-container.ql-snow {
  border-color: var(--line);
  border-radius: 0 0 14px 14px;
  font-family: inherit;
  height: 252px;
  min-height: 180px;
}

.seo-preview-label {
  display: inline-block;
  margin-bottom: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.seo-preview-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.seo-preview-attempts-value {
  font-weight: 700;
}

.seo-preview-attempts-source {
  display: block;
  margin-top: 0.3rem;
  line-height: 1.35;
}

.seo-preview-meta-grid > .is-exhausted {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
}

.seo-preview-meta-grid > .is-exhausted .seo-preview-attempts-value {
  color: var(--danger);
}

.seo-preview-meta-grid > .is-unpaid .seo-preview-attempts-value {
  color: var(--muted);
}

.seo-preview-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  justify-content: flex-end;
  align-items: center;
  margin: 0;
  padding: 1rem 2rem 1.35rem;
  background: #ffffff;
  border-top: 1px solid var(--line);
  border-radius: 0 0 24px 24px;
  box-shadow: 0 -12px 28px rgba(15, 23, 42, 0.06);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.seo-preview-save-state {
  margin-right: auto;
  font-weight: 600;
}

.seo-preview-save-state.is-saving {
  color: #d97706;
}

.seo-preview-save-state.is-saved {
  color: #059669;
}

.seo-preview-save-state.is-dirty {
  color: #475569;
}

.seo-preview-save-state.is-error {
  color: #b91c1c;
}

.modal-backdrop[hidden] .modal-card {
  transform: scale(0.95);
}

.modal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.modal-header-row h2 {
  margin: 0;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  justify-content: flex-end;
}

.pagination-link, .pagination-current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}

.pagination-link {
  background: #ffffff;
  color: var(--muted);
  border: 1px solid var(--line);
}

.pagination-link:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pagination-icon,
.pagination-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  color: currentColor;
}

.pagination-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pagination-arrow {
  width: auto;
  height: auto;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
}

.pagination-current {
  background: var(--primary);
  color: white;
  border: 1px solid var(--primary);
}

/* Utilities */
.inline-form { display: inline; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.panel-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
}
.table-wrapper-padded {
  padding: 1rem 1.25rem;
}
.products-section {
  margin-top: 1rem;
}

@media (max-width: 1080px) {
  .dashboard-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .products-panel-header {
    grid-template-columns: 1fr;
  }

  .product-controls {
    width: 100%;
    margin-left: 0;
  }

  .product-filters-bar {
    justify-content: flex-start;
  }

  .product-search-shell {
    width: 100%;
  }
}


@media (max-width: 860px) {

  .container {
    width: min(100% - 1.25rem, 1120px);
    padding-top: 1rem;
  }

  .topbar {
    align-items: flex-start;
    gap: 1.25rem;
  }

  .topbar > div:first-child {
    min-width: 0;
  }

  .actions {
    justify-content: flex-start;
  }

  .panel-toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .sync-actions {
    min-width: 0;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Responsive adjustments */
@media (max-width: 640px) {
  body {
    line-height: 1.5;
  }

  .container {
    width: 100%;
    padding: 0.75rem 0.75rem 3rem;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 0 1.25rem;
    margin-bottom: 1.25rem;
  }
  
  .actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .actions .button,
  .actions button,
  .actions form {
    width: 100%;
  }
  
  .card {
    padding: 1rem;
    border-radius: 18px;
  }
  
  .brand {
    font-size: 1.25rem;
    min-width: 0;
  }

  .brand span {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .brand-logo {
    max-width: 9.5rem;
    height: 2.4rem;
  }
  
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1rem; }
  
  .flash {
    width: 100%;
  }

  .flash-list {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    width: auto;
  }

  #models-table-shell .table-wrapper {
    overflow-x: auto;
  }

  .models-table {
    table-layout: auto;
  }

  .product-filters-bar {
    width: 100%;
  }

  .product-action-bar {
    grid-template-columns: 1fr;
    max-width: none;
  }

  .products-panel-header {
    grid-template-columns: 1fr;
  }

  .product-filter-shell,
  .product-search-shell {
    width: 100%;
    min-width: 0;
  }

  .product-action-bar button,
  .product-action-bar .button {
    white-space: normal;
  }

  .dashboard-stat {
    width: 100%;
    min-width: 0;
  }

  .dashboard-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .dashboard-stat-value {
    font-size: 1.55rem;
  }

  .dashboard-stat-label {
    font-size: 0.68rem;
  }

  .import-status-header {
    display: block;
    padding-right: 2.9rem;
  }

  
.dashboard-stat-payment {
  justify-content: flex-start;
  gap: 0.55rem;
  padding: 0.85rem;
}

.dashboard-stat-payment::before {
  margin-left: 0.15rem;
}

.payment-card-mini {
  display: grid;
  gap: 0.7rem;
  width: 100%;
  min-height: 7.4rem;
  padding: 0.9rem;
  border-radius: 14px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 42%),
    linear-gradient(135deg, #16213f 0%, #2456c8 55%, #0f766e 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 14px 24px rgba(15, 23, 42, 0.16);
}

.payment-card-top,
.payment-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 0.7rem;
}

.payment-card-brand {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
}

.payment-card-chip {
  width: 2.1rem;
  height: 1.45rem;
  flex: 0 0 auto;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: linear-gradient(135deg, #f8d47a, #b9872d);
  box-shadow: inset 0 0 0 1px rgba(60, 38, 5, 0.16);
}

.payment-card-number {
  display: block;
  font-family: 'Space Grotesk', 'Outfit', system-ui, sans-serif;
  font-size: 1.35rem;
  line-height: 1;
  letter-spacing: 0.04em;
  color: #fff;
  white-space: nowrap;
}

.payment-card-name,
.payment-card-exp {
  min-width: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}

.payment-card-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-card-exp {
  flex: 0 0 auto;
}

.payment-card-empty {
  align-self: center;
  color: rgba(255, 255, 255, 0.88);
  font-family: 'Space Grotesk', 'Outfit', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
}
.status-header-actions {
    justify-content: flex-start;
    margin-top: 0.7rem;
  }

  .import-status-header .icon-button[data-dismiss-job-card] {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
  }

  .product-filter-shell {
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
  }

  .product-filter-select {
    min-width: 0;
  }

  .seo-preview-meta-grid {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    align-items: center;
    place-items: center;
    padding: 0.65rem;
  }

  .modal-card {
    width: min(100%, 480px);
    max-height: calc(100dvh - 1.3rem);
    border-radius: 18px;
    padding: 1.15rem;
  }

  .modal-card .actions {
    width: 100%;
  }

  .seo-preview-modal-card {
    width: 100%;
  }

  .seo-preview-modal-card .modal-header-row {
    padding: 1rem 1rem 0;
    margin-bottom: 1rem;
  }

  .seo-preview-content {
    padding: 0 1rem 1rem;
    gap: 0.85rem;
  }

  .seo-preview-block,
  .seo-preview-meta-grid > div {
    padding: 0.85rem;
    border-radius: 14px;
  }

  .seo-preview-block .ql-container.ql-snow {
    height: 220px;
  }

  .seo-preview-actions {
    display: grid;
    grid-template-columns: 1fr;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.85rem 1rem 1rem;
    border-radius: 0 0 18px 18px;
  }

  .seo-preview-save-state {
    width: 100%;
    margin-right: 0;
  }

  .seo-preview-actions button,
  .seo-preview-actions .button {
    width: 100%;
  }

  #products-table-shell .table-wrapper {
    overflow-x: visible;
    border: 0;
    background: transparent;
    margin-top: 1rem;
  }

  #products-table-shell table,
  #products-table-shell thead,
  #products-table-shell tbody,
  #products-table-shell tr,
  #products-table-shell td {
    display: block;
    width: 100%;
  }

  #products-table-shell thead {
    display: none;
  }

  #products-table-shell tbody {
    display: grid;
    gap: 0.9rem;
  }

  #products-table-shell tr {
    background: linear-gradient(180deg, rgba(248, 250, 253, 0.98), rgba(239, 244, 251, 0.98));
    border: 1px solid rgba(122, 141, 176, 0.18);
    border-radius: 22px;
    padding: 1rem;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
  }

  #products-table-shell td {
    padding: 0;
    border: 0;
  }

  #products-table-shell td + td {
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px solid rgba(191, 209, 234, 0.8);
  }

  #products-table-shell td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
  }

  #products-table-shell .product-actions-cell {
    display: block;
  }

  #products-table-shell .product-row-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    text-align: left;
  }

  #products-table-shell .product-actions-cell::before {
    margin-bottom: 0.1rem;
  }

  #products-table-shell .product-row-actions button {
    width: 100%;
  }

  #products-table-shell .product-row-actions button + button {
    margin-left: 0;
  }

  .pagination {
    justify-content: center;
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .auth-shell {
    display: block;
    padding: 1rem 0.75rem;
  }

  .auth-brand {
    margin: 0.5rem 0 1.25rem;
    font-size: 1.55rem;
    line-height: 1.15;
    text-align: center;
    flex-wrap: wrap;
  }

  .auth-card {
    width: 100%;
    padding: 1.35rem 1rem;
    border-radius: 18px;
  }

  .auth-heading {
    margin-bottom: 1.35rem;
  }

  .auth-heading h1 {
    font-size: 1.8rem;
  }

  .auth-field,
  .auth-field-spaced {
    margin-bottom: 1rem;
  }

  .turnstile-shell {
    justify-content: center;
  }

  .turnstile-shell .cf-turnstile,
  .cf-turnstile {
    transform: scale(0.88);
    transform-origin: center center;
  }

  .sync-actions {
    grid-template-columns: 1fr;
  }

  .dashboard-stats-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-stat {
    padding: 0.9rem;
  }

  .import-status-card {
    padding: 1rem;
    border-radius: 16px;
  }

  .import-status-header {
    align-items: flex-start;
  }

  .import-status-header > .muted,
  
.dashboard-stat-payment {
  justify-content: flex-start;
  gap: 0.55rem;
  padding: 0.85rem;
}

.dashboard-stat-payment::before {
  margin-left: 0.15rem;
}

.payment-card-mini {
  display: grid;
  gap: 0.7rem;
  width: 100%;
  min-height: 7.4rem;
  padding: 0.9rem;
  border-radius: 14px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 42%),
    linear-gradient(135deg, #16213f 0%, #2456c8 55%, #0f766e 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 14px 24px rgba(15, 23, 42, 0.16);
}

.payment-card-top,
.payment-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 0.7rem;
}

.payment-card-brand {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
}

.payment-card-chip {
  width: 2.1rem;
  height: 1.45rem;
  flex: 0 0 auto;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: linear-gradient(135deg, #f8d47a, #b9872d);
  box-shadow: inset 0 0 0 1px rgba(60, 38, 5, 0.16);
}

.payment-card-number {
  display: block;
  font-family: 'Space Grotesk', 'Outfit', system-ui, sans-serif;
  font-size: 1.35rem;
  line-height: 1;
  letter-spacing: 0.04em;
  color: #fff;
  white-space: nowrap;
}

.payment-card-name,
.payment-card-exp {
  min-width: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}

.payment-card-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-card-exp {
  flex: 0 0 auto;
}

.payment-card-empty {
  align-self: center;
  color: rgba(255, 255, 255, 0.88);
  font-family: 'Space Grotesk', 'Outfit', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
}
.status-header-actions {
    width: 100%;
  }

  
.dashboard-stat-payment {
  justify-content: flex-start;
  gap: 0.55rem;
  padding: 0.85rem;
}

.dashboard-stat-payment::before {
  margin-left: 0.15rem;
}

.payment-card-mini {
  display: grid;
  gap: 0.7rem;
  width: 100%;
  min-height: 7.4rem;
  padding: 0.9rem;
  border-radius: 14px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 42%),
    linear-gradient(135deg, #16213f 0%, #2456c8 55%, #0f766e 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 14px 24px rgba(15, 23, 42, 0.16);
}

.payment-card-top,
.payment-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 0.7rem;
}

.payment-card-brand {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
}

.payment-card-chip {
  width: 2.1rem;
  height: 1.45rem;
  flex: 0 0 auto;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: linear-gradient(135deg, #f8d47a, #b9872d);
  box-shadow: inset 0 0 0 1px rgba(60, 38, 5, 0.16);
}

.payment-card-number {
  display: block;
  font-family: 'Space Grotesk', 'Outfit', system-ui, sans-serif;
  font-size: 1.35rem;
  line-height: 1;
  letter-spacing: 0.04em;
  color: #fff;
  white-space: nowrap;
}

.payment-card-name,
.payment-card-exp {
  min-width: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}

.payment-card-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-card-exp {
  flex: 0 0 auto;
}

.payment-card-empty {
  align-self: center;
  color: rgba(255, 255, 255, 0.88);
  font-family: 'Space Grotesk', 'Outfit', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
}
.status-header-actions {
    justify-content: flex-start;
  }

  .status-header-actions .icon-button {
    width: 2.25rem;
    min-width: 2.25rem;
    height: 2.25rem;
    min-height: 2.25rem;
    padding: 0;
  }

  .import-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-search-input,
  .product-filter-select {
    min-height: 3rem;
  }

  button,
  .button {
    width: 100%;
    min-height: 2.85rem;
    padding: 0.75rem 1rem;
  }

  .icon-button {
    width: 2.25rem;
    min-width: 2.25rem;
    height: 2.25rem;
    min-height: 2.25rem;
    padding: 0;
  }

  .auth-password-toggle {
    width: 2.25rem;
    min-width: 2.25rem;
  }
}

/* SaaS admin */
.admin-shell {
  width: min(1240px, calc(100% - 2rem));
}

.admin-topbar .brand i {
  font-size: 1.65rem;
}

.admin-stats-grid {
  margin-top: 0;
  margin-bottom: 2rem;
}

.admin-stat-text {
  font-size: 1.15rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.admin-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.admin-status-tile {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.admin-status-tile strong {
  font-size: 1.5rem;
  color: var(--primary);
}

.admin-search-form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: min(100%, 34rem);
}

.admin-search-form input {
  margin-bottom: 0;
}

.admin-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}



.tenant-subscription-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
}

.tenant-plan-rules {
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
  margin-top: 0.25rem;
  min-width: 0;
}

.tenant-subscription-form,
.tenant-plan-rules,
.tenant-admin-card {
  min-width: 0;
}

.tenant-admin-card .form-grid {
  align-items: end;
}
.form-submit-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.plan-rules-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.plan-rule-item {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.plan-rule-item span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.plan-rule-item strong {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  color: var(--primary);
  font-size: 1.05rem;
  line-height: 1.3;
  text-align: right;
  overflow-wrap: anywhere;
}

.catalog-picker-card {
  width: min(760px, 96vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.catalog-picker-list {
  min-height: 280px;
  max-height: 52vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
}

.catalog-loading {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
}

.catalog-loading-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.5rem;
}

.catalog-loading-heading > span:last-child {
  display: grid;
  gap: 0.1rem;
}

.catalog-loading-heading small {
  color: var(--muted);
}

.catalog-loading-spinner {
  width: 1.65rem;
  height: 1.65rem;
  flex: 0 0 auto;
  border: 3px solid color-mix(in srgb, var(--primary) 18%, transparent);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: catalog-spin 720ms linear infinite;
}

.catalog-loading-progress {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}

.catalog-loading-progress span {
  display: block;
  width: 38%;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  animation: catalog-progress 1.25s ease-in-out infinite;
}

.catalog-skeleton-list {
  display: grid;
  border: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  border-radius: 0.7rem;
  overflow: hidden;
}

.catalog-skeleton-row {
  display: grid;
  grid-template-columns: 1.1rem 1fr;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.45rem;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--line);
  opacity: 0;
  animation: catalog-row-in 260ms ease forwards;
}

.catalog-skeleton-row:nth-child(2) { animation-delay: 70ms; }
.catalog-skeleton-row:nth-child(3) { animation-delay: 140ms; }
.catalog-skeleton-row:nth-child(4) { animation-delay: 210ms; }
.catalog-skeleton-row:nth-child(5) { animation-delay: 280ms; }
.catalog-skeleton-row:nth-child(6) { animation-delay: 350ms; }

.catalog-skeleton-row:last-child { border-bottom: 0; }
.catalog-skeleton-row > span:last-child { display: grid; gap: 0.45rem; }
.catalog-skeleton-check,
.catalog-skeleton-row i {
  display: block;
  overflow: hidden;
  position: relative;
  border-radius: 0.35rem;
  background-color: #e5ebf4;
  background-image: linear-gradient(
    100deg,
    rgba(135, 151, 177, 0.18) 20%,
    rgba(255, 255, 255, 0.92) 42%,
    rgba(135, 151, 177, 0.18) 64%
  );
  background-size: 220% 100%;
  animation: catalog-cell-loading 1.25s ease-in-out infinite;
}
.catalog-skeleton-check { width: 1rem; height: 1rem; }
.catalog-skeleton-row i:first-child { width: min(72%, 25rem); height: 0.82rem; }
.catalog-skeleton-row i:last-child { width: min(46%, 15rem); height: 0.62rem; }
.catalog-skeleton-check::after,
.catalog-skeleton-row i::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
  animation: catalog-shimmer 1.35s ease-in-out infinite;
}

@keyframes catalog-spin { to { transform: rotate(360deg); } }
@keyframes catalog-progress {
  0% { transform: translateX(-115%); }
  50% { transform: translateX(105%); }
  100% { transform: translateX(275%); }
}
@keyframes catalog-shimmer { to { transform: translateX(100%); } }
@keyframes catalog-cell-loading {
  0% { background-position: 115% 0; opacity: 0.62; }
  50% { opacity: 1; }
  100% { background-position: -115% 0; opacity: 0.62; }
}
@keyframes catalog-row-in { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .catalog-loading-spinner,
  .catalog-loading-progress span,
  .catalog-skeleton-check::after,
  .catalog-skeleton-row i::after,
  .catalog-skeleton-check,
  .catalog-skeleton-row i,
  .catalog-skeleton-row {
    animation: none;
  }
  .catalog-skeleton-row { opacity: 1; }
}

.catalog-picker-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.catalog-picker-item:last-child { border-bottom: 0; }
.catalog-picker-item span { display: grid; gap: 0.2rem; }
.catalog-picker-item small { color: var(--muted); }
.catalog-picker-item:has(input:disabled) { cursor: default; opacity: 0.65; }
.catalog-picker-state {
  min-height: 278px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 2rem;
  color: var(--muted);
  text-align: center;
}

.catalog-picker-state-icon {
  width: 3.25rem;
  height: 3.25rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, white);
  font-size: 1.65rem;
}

.catalog-picker-state strong {
  color: var(--text);
  font-size: 1.05rem;
}

.catalog-picker-state p {
  max-width: 30rem;
  margin: 0;
  line-height: 1.55;
}

.catalog-picker-state-error {
  color: color-mix(in srgb, #991b1b 76%, var(--muted));
  background: linear-gradient(
    180deg,
    color-mix(in srgb, #ef4444 5%, transparent),
    transparent 68%
  );
}

.catalog-picker-state-error .catalog-picker-state-icon {
  color: #dc2626;
  background: #fef2f2;
}

.catalog-picker-state-search .catalog-picker-state-icon {
  color: #64748b;
  background: #f1f5f9;
}

.catalog-search-notice {
  margin: 0;
  padding: 0.75rem 1rem;
  color: var(--muted);
  background: color-mix(in srgb, var(--primary) 6%, transparent);
}
.catalog-picker-actions { flex-wrap: wrap; }

.product-ai-attempts {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.55rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  color: var(--success);
  background: color-mix(in srgb, var(--success) 10%, transparent);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.product-ai-attempts.is-exhausted {
  color: var(--warning);
  background: color-mix(in srgb, var(--warning) 12%, transparent);
}

.product-ai-attempts.is-unpaid {
  color: var(--muted);
  background: color-mix(in srgb, var(--muted) 10%, transparent);
}

.usage-confirm-card { width: min(620px, 96vw); }
.usage-confirm-summary {
  display: grid;
  gap: 0.65rem;
  margin: 1rem 0;
}
.usage-confirm-summary > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}
.usage-confirm-summary span { color: var(--muted); }
.usage-confirm-total { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.usage-confirm-total strong { color: var(--primary); font-size: 1.2rem; }

[data-pagination-region] {
  scroll-margin-top: 1.5rem;
  transition: opacity 160ms ease;
}

[data-pagination-region].is-pagination-loading {
  opacity: 0.55;
  pointer-events: none;
}

[data-plans-list] > .pagination {
  grid-column: 1 / -1;
}

.plan-rule-item .detail-value-compact {
  font-size: 0.92rem;
  line-height: 1.35;
}
.admin-tenant-hero h1 {
  margin-bottom: 0.35rem;
}

.tenant-integration-card {
  display: grid;
  gap: 1.1rem;
}

.tenant-integration-header {
  align-items: flex-start;
}

.integration-health-state {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.65);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.integration-health-ready {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 30%, var(--line));
}

.integration-health-success {
  color: #047857;
  border-color: #a7f3d0;
  background: rgba(209, 250, 229, 0.82);
}

.integration-health-failed {
  color: #b91c1c;
  border-color: #fecaca;
  background: rgba(254, 226, 226, 0.82);
}

.tenant-integration-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-block: 1px solid var(--line);
}

.tenant-integration-facts > div {
  min-width: 0;
  padding: 1rem;
}

.tenant-integration-facts > div + div {
  border-left: 1px solid var(--line);
}

.tenant-integration-facts span,
.tenant-integration-capabilities > span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.tenant-integration-facts strong,
.tenant-integration-facts a {
  color: var(--text);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.tenant-integration-capabilities {
  display: grid;
  gap: 0.45rem;
}

.tenant-integration-capabilities > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.integration-capability {
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink-light);
  background: rgba(255, 255, 255, 0.55);
  font-size: 0.8rem;
  font-weight: 700;
}

.tenant-connection-test {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.25rem;
}

.tenant-connection-test > div {
  min-width: 0;
}

.tenant-connection-test p {
  margin: 0.25rem 0 0;
  overflow-wrap: anywhere;
}

.tenant-connection-test a {
  display: inline-block;
  margin-top: 0.35rem;
  color: var(--primary);
  font-weight: 700;
}

@media (max-width: 760px) {
  .tenant-integration-header,
  .tenant-connection-test {
    align-items: stretch;
    flex-direction: column;
  }

  .integration-health-state {
    align-self: flex-start;
  }

  .tenant-integration-facts {
    grid-template-columns: 1fr;
  }

  .tenant-integration-facts > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .tenant-connection-test button {
    width: 100%;
  }
}

.status-trialing { background: rgba(239, 246, 255, 0.95); color: #1d4ed8; border: 1px solid #bfdbfe; }
.status-active { background: var(--success-light); color: #059669; border: 1px solid #a7f3d0; }
.status-pending-payment { background: var(--warning-light); color: #b45309; border: 1px solid #fde68a; }
.status-pending-verification { background: rgba(238, 242, 255, 0.95); color: #4338ca; border: 1px solid #c7d2fe; }
.status-past-due { background: var(--warning-light); color: #b45309; border: 1px solid #fde68a; }
.status-cancelled,
.status-suspended { background: var(--danger-light); color: #b91c1c; border: 1px solid #fecaca; }


.plan-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.plan-card form {
  margin: 0;
}

.plan-card-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding-top: 0.25rem;
}

.plan-card-actions .inline-form {
  display: inline-flex;
}

.plan-card-actions button,
.plan-card-actions .button {
  min-height: 2.75rem;
  padding-inline: 1.15rem;
}
@media (max-width: 860px) {
  .tenant-subscription-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .tenant-plan-rules {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 1.5rem;
  }
  .admin-two-column {
    grid-template-columns: 1fr;
  }

  .admin-search-form {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }
}







/* Marketing and subscription checkout */
.landing-shell {
  min-height: 100vh;
  background: var(--bg-gradient);
  color: var(--ink);
}

.landing-nav,
.landing-hero,
.landing-band {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 0 18px;
}

.landing-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
}

.landing-nav-toggle {
  display: none;
}

.landing-nav-actions,
.landing-actions,
.landing-proof-row,
.section-heading-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.82fr);
  gap: 44px;
  align-items: center;
  min-height: calc(100vh - 220px);
  padding: 44px 0 56px;
}

.landing-hero-copy,
.landing-visual,
.landing-band,
.public-page-hero,
.public-content-band,
.public-page-actions,
.public-document {
  animation: fadeUp .7s ease both;
}

.landing-visual {
  animation-delay: .12s;
}

.landing-band {
  animation-delay: .08s;
}

.public-content-band,
.public-document {
  animation-delay: .08s;
}

.public-page-actions {
  animation-delay: .14s;
}

.landing-band[id],
.public-page-hero[id] {
  scroll-margin-top: 28px;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.portal-card,
.admin-status-tile,
.tenant-list-card,
.subscription-card,
.review-card,
.card {
  animation: fadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.portal-card:nth-child(2),
.admin-status-tile:nth-child(2),
.dashboard-stat:nth-child(2),
.review-card:nth-child(2) { animation-delay: 0.05s; }
.portal-card:nth-child(3),
.admin-status-tile:nth-child(3),
.dashboard-stat:nth-child(3),
.review-card:nth-child(3) { animation-delay: 0.1s; }
.portal-card:nth-child(4),
.admin-status-tile:nth-child(4),
.dashboard-stat:nth-child(4),
.review-card:nth-child(4) { animation-delay: 0.15s; }

.landing-hero-copy h1 {
  margin: 0;
  max-width: 680px;
  font-size: clamp(3.2rem, 7vw, 6rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.landing-lede {
  max-width: 620px;
  margin: 22px 0 28px;
  color: var(--muted);
  font-size: 1.28rem;
  line-height: 1.55;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--primary);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.landing-proof-row {
  margin-top: 28px;
  color: var(--muted);
  font-weight: 700;
}

.landing-proof-row span,
.plan-features li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.landing-visual {
  position: relative;
  overflow: hidden;
  min-height: 440px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, var(--card-blur), var(--accent-light));
  box-shadow: var(--shadow-lg);
}

.landing-demo-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 61px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

@media (prefers-reduced-motion: reduce) {
  .landing-hero-copy,
  .landing-visual,
  .landing-band,
  .public-page-hero,
  .public-content-band,
  .public-page-actions,
  .public-document,
  .landing-demo-step-state {
    animation: none !important;
  }

  .landing-demo-progress span,
  .landing-demo-step,
  .landing-demo-stage,
  .landing-demo-field strong,
  .landing-demo-description p {
    transition: none !important;
  }

  .landing-nav,
  .landing-nav-toggle i,
  .landing-nav-actions,
  .faq-item summary i {
    transition: none !important;
  }
}

.landing-demo-dots {
  display: flex;
  gap: 8px;
}

.landing-demo-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  opacity: .65;
}

.landing-demo-stage {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card-blur);
  color: var(--primary);
  font-size: .8rem;
  font-weight: 800;
  transition: color .25s ease, border-color .25s ease, background-color .25s ease;
}

.landing-demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 18px;
}

.landing-demo-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-blur);
  box-shadow: var(--shadow-sm);
}

.landing-demo-main {
  grid-column: 1 / -1;
  display: grid;
  gap: 13px;
  min-height: 274px;
  padding: 18px;
}

.landing-demo-product,
.landing-demo-step {
  display: flex;
  align-items: center;
}

.landing-demo-product {
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}

.landing-demo-product > div,
.landing-demo-step > div {
  min-width: 0;
}

.landing-demo-product strong,
.landing-demo-field strong,
.landing-demo-step strong,
.landing-demo-step span,
.landing-demo-label {
  display: block;
}

.landing-demo-product strong,
.landing-demo-field strong {
  overflow: hidden;
  text-overflow: ellipsis;
}

.landing-demo-product strong {
  white-space: nowrap;
}

.landing-demo-label {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.landing-demo-product-status {
  flex: 0 0 auto;
  color: #07825f;
  font-size: .78rem;
  font-weight: 800;
}

.landing-demo-field {
  min-width: 0;
  min-height: 45px;
}

.landing-demo-field strong,
.landing-demo-description p {
  margin: 0;
  transition: opacity .2s ease, transform .2s ease;
}

.landing-demo-field strong {
  white-space: nowrap;
}

.landing-demo-description p {
  min-height: 2.7em;
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.landing-demo-progress {
  align-self: end;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.landing-demo-progress span {
  display: block;
  width: 8%;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width .65s cubic-bezier(.16, 1, .3, 1), background-color .25s ease;
}

.landing-demo-step {
  gap: 12px;
  min-height: 94px;
  padding: 16px;
  transition: border-color .25s ease, background-color .25s ease, transform .25s ease;
}

.landing-demo-step > i:first-child {
  flex: 0 0 auto;
  color: var(--primary);
  font-size: 1.55rem;
}

.landing-demo-step div {
  flex: 1;
}

.landing-demo-step span {
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: .76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.landing-demo-step-state {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 1.1rem;
}

.landing-visual[data-demo-state="generating"] [data-demo-step="generate"],
.landing-visual[data-demo-state="publishing"] [data-demo-step="publish"] {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 7%, var(--card-blur));
  transform: translateY(-2px);
}

.landing-visual[data-demo-state="generating"] [data-demo-step="generate"] .landing-demo-step-state,
.landing-visual[data-demo-state="publishing"] [data-demo-step="publish"] .landing-demo-step-state {
  color: var(--primary);
  animation: demoSpin 1s linear infinite;
}

.landing-visual[data-demo-state="ready"] [data-demo-step="generate"],
.landing-visual[data-demo-state="publishing"] [data-demo-step="generate"],
.landing-visual[data-demo-state="published"] .landing-demo-step {
  border-color: rgba(16, 185, 129, .45);
  background: rgba(16, 185, 129, .08);
}

.landing-visual[data-demo-state="ready"] [data-demo-step="generate"] .landing-demo-step-state,
.landing-visual[data-demo-state="publishing"] [data-demo-step="generate"] .landing-demo-step-state,
.landing-visual[data-demo-state="published"] .landing-demo-step-state,
.landing-visual[data-demo-state="published"] .landing-demo-stage {
  color: #07825f;
}

.landing-visual[data-demo-state="published"] .landing-demo-stage {
  border-color: rgba(16, 185, 129, .45);
  background: rgba(16, 185, 129, .1);
}

.landing-visual[data-demo-state="published"] [data-demo-progress] {
  background: #10b981;
}

@keyframes demoSpin {
  to { transform: rotate(360deg); }
}

.landing-band {
  padding: 48px 0;
  border-top: 1px solid var(--line);
}

.landing-band h2 {
  margin: 0 0 10px;
  font-size: 2rem;
}

.feature-grid,
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 26px;
}

.feature-grid article,
.pricing-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.feature-grid i {
  color: var(--primary);
  font-size: 1.8rem;
}

.pricing-card {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.plan-carousel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  margin-top: 26px;
}

.plan-carousel-viewport {
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-inline: contain;
}

.plan-carousel-viewport::-webkit-scrollbar {
  display: none;
}

.pricing-grid.plan-carousel-track {
  display: flex;
  align-items: stretch;
  gap: 18px;
  width: 100%;
  margin-top: 0;
}

.plan-carousel-track .pricing-card {
  flex: 0 0 calc((100% - 36px) / 3);
  min-width: 0;
  scroll-snap-align: start;
}

.plan-carousel-arrow {
  width: 2.85rem;
  height: 2.85rem;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
}

.plan-carousel-arrow:disabled {
  opacity: 0.38;
  cursor: default;
  transform: none;
}

.plan-carousel-dots {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  min-height: 0.7rem;
}

.plan-carousel-dots button {
  width: 0.58rem;
  height: 0.58rem;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 24%, #cbd5e1);
  box-shadow: none;
  transition: width 180ms ease, background-color 180ms ease;
}

.plan-carousel-dots button.is-active {
  width: 1.55rem;
  background: var(--primary);
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.price-row strong {
  color: var(--primary);
  font-size: 2.7rem;
  line-height: 1;
}

.plan-features {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
  color: var(--muted);
  font-weight: 700;
}

.plan-features i {
  color: var(--success);
}

.marketing-rich-text {
  color: var(--ink-light);
  font-size: 1rem;
  line-height: 1.65;
}

.marketing-rich-text p,
.marketing-rich-text ol,
.marketing-rich-text ul,
.marketing-rich-text blockquote {
  margin: 0 0 1rem;
}

.marketing-rich-text ol,
.marketing-rich-text ul {
  display: grid;
  gap: 0.75rem;
  padding-left: 1.25rem;
}

.marketing-rich-text a {
  color: var(--primary);
  font-weight: 800;
}

.how-section {
  display: grid;
  grid-template-columns: minmax(280px, .78fr) minmax(0, 1.22fr);
  gap: 28px;
  align-items: stretch;
}

.how-section-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 100%;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, var(--card-blur), var(--accent-light));
  box-shadow: var(--shadow-sm);
}

.how-it-works-content {
  margin: 1rem 0 1.3rem;
}

.how-flow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.how-step {
  position: relative;
  overflow: hidden;
  min-height: 210px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-blur);
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.how-step:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.how-step span {
  color: var(--primary);
  font-size: .82rem;
  font-weight: 900;
}

.how-step i {
  display: block;
  margin: 18px 0;
  color: var(--primary);
  font-size: 2rem;
}

.how-step h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.how-step p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.review-card,
.empty-public-state,
.locked-review-state {
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.review-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 220px);
  grid-template-areas:
    "rating author"
    "title author"
    "body author";
  align-items: center;
  gap: 16px 22px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 280px;
}

.review-card > * {
  min-width: 0;
}

.review-rating {
  grid-area: rating;
  display: flex;
  gap: 4px;
  color: var(--warning);
}

.review-card h3 {
  grid-area: title;
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.2;
  overflow-wrap: break-word;
}

.review-card p {
  grid-area: body;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  overflow-wrap: break-word;
}

.review-author {
  grid-area: author;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
  min-width: 0;
}

.review-author img,
.review-author span {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.review-author img {
  object-fit: cover;
}

.review-author span {
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  font-weight: 900;
}

.review-author strong,
.review-author small {
  display: block;
  min-width: 0;
  overflow-wrap: break-word;
}

.review-author small {
  color: var(--muted);
}

.empty-public-state {
  grid-column: 1 / -1;
  display: grid;
  justify-items: start;
  gap: 0.75rem;
}

.empty-public-state i,
.locked-review-state i {
  color: var(--primary);
  font-size: 1.8rem;
}

.public-page-hero,
.public-content-band {
  width: min(900px, calc(100% - 40px));
  margin: 0 auto;
}

.public-page-hero {
  padding: 72px 0 40px;
}

.public-page-hero h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.public-rich-text {
  font-size: 1.08rem;
}

.review-form-layout {
  display: grid;
  grid-template-columns: minmax(280px, .55fr) minmax(0, 1fr);
  gap: 28px;
  align-items: stretch;
}

.review-form-card {
  margin: 0;
  display: grid;
  gap: 1.25rem;
}

.locked-review-state {
  display: grid;
  gap: 0.75rem;
}

.reviews-showcase-band {
  max-width: calc(100% - 40px);
  overflow: hidden;
}

.review-carousel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 760px);
  align-items: center;
  justify-content: center;
  margin-top: 26px;
  width: 100%;
  max-width: 100%;
  padding-inline: 58px;
  overflow: hidden;
  box-sizing: border-box;
}

.review-carousel-page {
  grid-template-columns: minmax(0, 980px);
  margin-top: 0;
}

.review-carousel-viewport {
  position: relative;
  min-height: 320px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.review-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  opacity: 0;
  transform: translateX(12px);
  pointer-events: none;
  transition: opacity .28s ease, transform .28s ease;
}

.review-slide.is-active {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}

.review-carousel .carousel-arrow {
  position: absolute;
  z-index: 2;
  top: calc(50% - 23px);
}

.review-carousel .carousel-arrow-prev {
  left: 0;
}

.review-carousel .carousel-arrow-next {
  right: 0;
}

.carousel-arrow {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.86);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.carousel-arrow:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.carousel-arrow[hidden] {
  display: none;
}

.customer-review-management {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.review-edit-card {
  position: relative;
}

.review-edit-card .form-control,
.review-edit-card input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
.review-edit-card textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 60px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.72);
  color: var(--ink);
  font: inherit;
  box-shadow: none;
}

.review-edit-card textarea {
  min-height: 160px;
  resize: vertical;
}

.review-owner-display {
  display: grid;
  gap: .75rem;
}

.review-owner-display h3,
.review-owner-display p {
  margin: 0;
}

.review-action-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

.review-delete-form {
  margin-top: .75rem;
}

.review-action-row .review-delete-form {
  margin-top: 0;
}

.review-pagination {
  justify-content: center;
}

.review-prompt-card {
  align-self: stretch;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(255,255,255,.92), rgba(219,231,251,.62));
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
}

.review-prompt-card h2 {
  margin-top: 0;
  margin-bottom: 0;
}

.review-prompt-card .muted {
  margin: 0;
}

.review-prompt-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: rgba(33, 86, 211, .1);
  color: var(--primary);
  font-size: 1.5rem;
}

.review-prompt-list {
  display: grid;
  gap: .75rem;
  padding: 0;
  margin: .25rem 0 0;
  list-style: none;
  color: var(--muted);
}

.review-prompt-list li {
  display: flex;
  align-items: center;
  gap: .55rem;
}

.review-prompt-list i {
  color: #0b9f73;
}

.review-form-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.review-form-header h2,
.review-form-header p {
  margin: 0;
}

.review-star-field select.sr-only,
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.star-rating-input {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem .6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.72);
}

.star-rating-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  box-shadow: none;
}

.star-rating-button:hover,
.star-rating-button.is-active {
  color: #f59e0b;
  background: rgba(245, 158, 11, .11);
  transform: none;
  box-shadow: none;
}

.signup-shell .auth-card,
.checkout-card {
  width: min(760px, calc(100vw - 36px));
}

.checkout-shell-premium {
  position: relative;
  padding-top: 4.75rem;
}

.checkout-top-nav {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
}

.checkout-card {
  padding: 34px;
}

.checkout-card-premium {
  width: min(860px, calc(100vw - 36px));
  max-width: 860px;
  margin: 0 auto;
}

.compact-brand {
  justify-content: center;
  margin-bottom: 20px;
}

.checkout-overview {
  display: grid;
  gap: 14px;
  margin: 22px 0 26px;
}

.checkout-plan-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}

.checkout-plan-summary > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}

.checkout-plan-summary .checkout-provider-summary {
  flex: 0 0 auto;
  margin-top: 0;
}

.checkout-plan-summary strong {
  color: var(--primary);
}

.checkout-eyebrow {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.checkout-plan-name {
  display: block;
  color: var(--ink) !important;
  font-size: 1.1rem;
}

.checkout-price-block {
  display: flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}

.checkout-price-block strong {
  color: var(--primary);
  font-size: 1.35rem;
  line-height: 1;
}

.checkout-price-block span {
  color: var(--muted);
  font-weight: 700;
}

.checkout-trial-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.95), rgba(255, 255, 255, 0.78));
  box-shadow: var(--shadow-sm);
}

.checkout-trial-icon {
  display: inline-flex;
  width: 2.35rem;
  height: 2.35rem;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 1.2rem;
  box-shadow: 0 10px 22px var(--primary-glow);
}

.checkout-trial-note strong {
  display: block;
  color: var(--ink);
  font-size: 1rem;
}

.checkout-trial-note p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.checkout-features {
  margin-bottom: 24px;
}

.mt-1 {
  margin-top: 1rem;
}

@media (max-width: 920px) {
  .landing-hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .landing-visual {
    min-height: 360px;
  }

  .feature-grid,
  .pricing-grid:not(.plan-carousel-track),
  .how-section,
  .how-flow,
  .review-form-layout {
    grid-template-columns: 1fr;
  }

  .plan-carousel-track .pricing-card {
    flex-basis: calc((100% - 18px) / 2);
  }

  .review-carousel,
  .review-carousel-page {
    grid-template-columns: 1fr;
  }

  .review-carousel-viewport {
    width: 100%;
    min-height: 340px;
  }

  .review-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "rating"
      "title"
      "body"
      "author";
    align-items: start;
  }

  .carousel-arrow {
    position: absolute;
    z-index: 2;
    top: calc(50% - 23px);
  }

  .carousel-arrow-prev {
    left: -6px;
  }

  .carousel-arrow-next {
    right: -6px;
  }
}

@media (max-width: 920px) {
  .landing-nav {
    position: sticky;
    z-index: 50;
    top: 0;
    align-items: center;
    flex-direction: row;
    width: calc(100% - 24px);
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--line));
    border-top: 0;
    border-radius: 0 0 8px 8px;
    background: var(--card-blur);
    background: color-mix(in srgb, var(--primary) 10%, var(--card-blur));
    box-shadow: 0 8px 24px color-mix(in srgb, var(--primary) 12%, transparent);
    backdrop-filter: blur(14px);
    transition: border-radius 180ms ease, background-color 180ms ease;
  }

  .landing-nav-toggle {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--line));
    background: var(--primary-soft);
    color: var(--primary);
    box-shadow: none;
  }

  .landing-nav-toggle i {
    grid-area: 1 / 1;
    transition: opacity 160ms ease, transform 160ms ease;
  }

  .landing-nav-toggle-close {
    opacity: 0;
    transform: rotate(-45deg) scale(.8);
  }

  .landing-nav-toggle[aria-expanded="true"] {
    color: #fff;
    border-color: transparent;
    background: var(--primary);
    box-shadow: 0 10px 22px var(--primary-glow);
  }

  .landing-nav-toggle[aria-expanded="true"] .landing-nav-toggle-open {
    opacity: 0;
    transform: rotate(45deg) scale(.8);
  }

  .landing-nav-toggle[aria-expanded="true"] .landing-nav-toggle-close {
    opacity: 1;
    transform: rotate(0) scale(1);
  }

  .landing-nav:has(.landing-nav-toggle[aria-expanded="true"]) {
    border-radius: 0;
  }

  body.nav-open {
    overflow: hidden;
  }

  body.nav-open::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(14, 25, 40, 0.25);
    backdrop-filter: blur(6px);
  }

  .landing-nav-actions {
    position: absolute;
    z-index: 20;
    top: calc(100% - 1px);
    left: -1px;
    right: -1px;
    display: flex;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-6px) scale(.985);
    transform-origin: top center;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    width: auto;
    padding: 10px;
    border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--line));
    border-top-color: color-mix(in srgb, var(--primary) 16%, var(--line));
    border-radius: 0 0 8px 8px;
    background: var(--card);
    background: color-mix(in srgb, var(--primary) 10%, var(--card));
    box-shadow: 0 18px 34px color-mix(in srgb, var(--primary) 18%, transparent);
    transition: opacity 180ms ease, transform 180ms cubic-bezier(.16, 1, .3, 1), visibility 180ms;
  }

  .landing-nav-actions.is-open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    display: flex;
  }

  .landing-nav-actions .button,
  .landing-nav-actions button {
    width: 100%;
    min-height: 44px;
    justify-content: flex-start;
    padding: 9px 12px;
    border-radius: 6px;
    box-shadow: none;
  }

  .landing-nav-actions .button.secondary,
  .landing-nav-actions button.secondary {
    border-color: transparent;
    background: transparent;
    color: var(--ink);
  }

  .landing-nav-actions .button.secondary:hover,
  .landing-nav-actions button.secondary:hover {
    background: color-mix(in srgb, var(--primary) 12%, var(--card));
    color: var(--primary);
  }

  .landing-nav-actions > .button:not(.secondary),
  .landing-nav-actions form button:not(.secondary) {
    justify-content: center;
  }

  .landing-nav-actions form {
    width: 100%;
  }
}

@media (max-width: 620px) {
  .landing-actions {
    width: 100%;
  }

  .landing-actions .button {
    flex: 1 1 180px;
  }

  .landing-demo-grid {
    grid-template-columns: 1fr;
  }

  .landing-demo-main {
    grid-column: auto;
  }

  .checkout-plan-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .checkout-card {
    padding: 24px;
  }

  .checkout-top-nav {
    position: static;
    display: flex;
    justify-content: flex-end;
    width: min(860px, calc(100vw - 36px));
    margin: 0 auto 1rem;
  }

  .checkout-shell-premium {
    padding-top: 1.25rem;
  }

  .checkout-provider-summary {
    align-self: flex-start;
  }

  .payment-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}
.checkout-blocked {
  margin: 22px 0;
  padding: 18px;
  border: 1px solid var(--warning);
  border-radius: 8px;
  background: var(--warning-light);
}

.checkout-blocked strong {
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
}

button[disabled],
.button[disabled] {
  cursor: not-allowed;
  opacity: .62;
  box-shadow: none;
}
.status-warning { background: var(--warning-light); color: #b45309; border: 1px solid #fde68a; }
.status-muted { background: rgba(248, 250, 252, 0.95); color: #64748b; border: 1px solid #cbd5e1; }
.plan-status-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.checkout-card-wide {
  width: min(980px, calc(100vw - 36px));
}

.embedded-checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(360px, 1fr);
  gap: 28px;
  align-items: start;
}

.checkout-summary-panel,
.checkout-payment-panel {
  min-width: 0;
}

.payment-section-heading h2 {
  margin: 0 0 4px;
  font-size: 1.35rem;
}

.payment-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 2px;
}

.payment-secure-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.payment-secure-mark {
  display: block;
  width: 5.35rem;
  height: 2.7rem;
  object-fit: contain;
}

.shift4-card-frame {
  min-height: 72px;
  margin: 18px 0 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.72);
}

.payment-error {
  margin: 0 0 14px;
  color: var(--danger);
  font-weight: 700;
}

.checkout-turnstile {
  margin: 18px auto 18px;
  justify-content: center;
}

@media (max-width: 820px) {
  .embedded-checkout-layout {
    grid-template-columns: 1fr;
  }
}
.embedded-payment-form {
  display: grid;
  gap: 16px;
}

.shift4-payment-form {
  display: grid;
  gap: 16px;
}

.payment-field,
.payment-field-wide {
  display: grid;
  gap: 8px;
}

.payment-field span {
  color: var(--ink-light);
  font-size: .92rem;
  font-weight: 800;
}

.payment-field input,
.shift4-component {
  width: 100%;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.88);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

.payment-field input {
  padding: 0 16px;
  font: inherit;
  font-weight: 600;
}

.shift4-component {
  display: block;
  min-height: 56px;
  padding: 0;
  overflow: hidden;
}

.shift4-component iframe {
  width: 100% !important;
}

#shift4-card-number.shift4-component,
#account-shift4-card-number.shift4-component {
  padding-inline: 14px;
  box-sizing: border-box;
}

.payment-field-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.payment-field-grid .shift4-component {
  padding-inline: 12px;
  box-sizing: border-box;
}

.checkout-security-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 20px;
  padding: 14px;
  border: 1px solid rgba(16,185,129,.28);
  border-radius: 8px;
  background: rgba(236,253,245,.72);
}

.checkout-security-note i {
  color: var(--success);
  font-size: 1.55rem;
}

.checkout-security-note strong,
.checkout-security-note span {
  display: block;
}

.checkout-security-note span {
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.35;
}

.payment-footnote {
  display: inline-flex;
  justify-content: center;
  gap: 8px;
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 700;
  text-align: center;
}

.checkout-pending-note {
  text-align: center;
}

@media (max-width: 620px) {
  .payment-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .payment-secure-badge {
    align-self: flex-start;
  }
}

@media (max-width: 620px) {
  .payment-field-grid {
    grid-template-columns: 1fr;
  }
}
/* Embedded Shift4 checkout refinements */
.checkout-provider-note {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 20px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.76);
  box-shadow: var(--shadow-sm);
}

.shift4-mark-image {
  flex: 0 0 auto;
  width: 96px;
  height: 48px;
  object-fit: contain;
}

.checkout-provider-note strong,
.checkout-provider-note span {
  display: block;
}

.checkout-provider-note span {
  margin-top: 2px;
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.35;
}

.supported-cards-panel {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.72);
  box-shadow: var(--shadow-sm);
}

.supported-cards-label {
  display: block;
  margin-bottom: 10px;
  color: var(--ink-light);
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.supported-cards-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.supported-cards-strip img {
  width: auto;
  height: 32px;
  max-width: 92px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.checkout-card .supported-cards-panel {
  border: none;
  background: none;
  box-shadow: none;
  padding: 0;
  text-align: center;
}

.checkout-card .supported-cards-strip {
  justify-content: center;
}

.checkout-card .supported-cards-strip img {
  height: 28px;
  opacity: 0.6;
}

.payment-field input,
.shift4-component {
  background: #fff;
  color: #111827;
}

.shift4-component {
  min-height: 56px;
}

.shift4-component iframe {
  display: block;
  width: 100% !important;
  min-height: 56px !important;
  height: 56px !important;
  background: #fff !important;
}

.payment-field input {
  caret-color: #111827;
}
/* Customer subscription management */
.subscription-management-card {
  display: grid;
  gap: 1.25rem;
}

.subscription-stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 0;
}

.subscription-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.75rem;
}

.subscription-detail-grid .plan-rule-item {
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  justify-items: center;
  gap: 0.35rem;
  min-height: 112px;
  text-align: center;
}

.subscription-detail-grid .plan-rule-item span,
.subscription-detail-grid .plan-rule-item strong {
  justify-content: center;
  margin: 0;
  text-align: center;
}

.subscription-detail-grid .plan-rule-item strong {
  width: 100%;
}

.subscription-actions-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(360px, 1fr);
  gap: 1rem;
  align-items: start;
}

#subscription-activation {
  scroll-margin-top: 2rem;
}

.subscription-actions-row {
  display: flex;
  justify-content: flex-start;
}

.subscription-action-panel {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.64);
}

.subscription-action-panel h3 {
  margin: 0;
  font-size: 1rem;
}

.subscription-action-panel .muted {
  margin: 0;
}

.account-payment-form {
  gap: 0.85rem;
}

.subscription-alert {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  font-weight: 700;
}

.subscription-alert.warning {
  border: 1px solid #fde68a;
  background: var(--warning-light);
  color: #92400e;
}

.payment-method-card-shell {
  position: relative;
  display: grid;
  gap: 0.85rem;
}

.payment-method-card-body {
  display: grid;
  gap: 0.75rem;
  justify-items: center;
}

.payment-method-edit-button {
  align-self: start;
  justify-self: end;
}

.payment-card-mini-summary {
  width: min(100%, 280px);
}

.payment-update-modal-card {
  width: min(100%, 620px);
}

.payment-update-actions {
  justify-content: flex-end;
  margin-top: 0.75rem;
}

@media (max-width: 640px) {
  .payment-method-edit-button {
    justify-self: end;
  }

  .payment-method-card-shell {
    justify-items: center;
  }

  .payment-method-card-body {
    justify-items: center;
  }

  .payment-method-card-body .payment-card-mini-summary {
    justify-self: center;
  }

  .payment-update-actions {
    justify-content: stretch;
  }

  .payment-update-actions .button,
  .payment-update-actions button {
    width: 100%;
  }
}

@media (max-width: 980px) {
  .subscription-stats-grid,
  .subscription-detail-grid,
  .subscription-actions-grid {
    grid-template-columns: 1fr;
  }
}

.plan-rule-card-item {
  display: grid;
  align-items: stretch;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.plan-rule-card-item > span {
  align-self: start;
}

.plan-rule-card-item .payment-card-mini {
  width: 100%;
}

.payment-card-mini-compact {
  min-height: 6.45rem;
  gap: 0.55rem;
  padding: 0.75rem;
  border-radius: 12px;
}

.payment-card-mini-compact .payment-card-number {
  font-size: 1.15rem;
}

.payment-card-mini-compact .payment-card-chip {
  width: 1.85rem;
  height: 1.25rem;
}
/* Normalize saved-card preview across customer and platform admin */
.payment-card-mini {
  width: min(100%, 280px);
  max-width: 280px;
  aspect-ratio: 1.586;
  min-height: auto;
  align-content: space-between;
}

.dashboard-stat-payment .payment-card-mini,
.plan-rule-card-item .payment-card-mini {
  width: min(100%, 280px);
  max-width: 280px;
  justify-self: start;
}

.payment-card-mini-compact {
  aspect-ratio: 1.586;
  min-height: auto;
  gap: 0.7rem;
  padding: 0.9rem;
  border-radius: 14px;
}

.payment-card-mini .payment-card-brand,
.plan-rule-card-item .payment-card-brand {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.payment-card-mini .payment-card-number,
.plan-rule-card-item .payment-card-number {
  color: #ffffff;
  font-family: 'Space Grotesk', 'Outfit', system-ui, sans-serif;
  font-size: 1.35rem;
  line-height: 1;
  letter-spacing: 0.04em;
  text-align: left;
}

.payment-card-mini-compact .payment-card-number {
  font-size: 1.35rem;
}

.payment-card-mini .payment-card-name,
.payment-card-mini .payment-card-exp,
.plan-rule-card-item .payment-card-name,
.plan-rule-card-item .payment-card-exp {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.payment-card-mini .payment-card-empty,
.plan-rule-card-item .payment-card-empty {
  color: rgba(255, 255, 255, 0.88);
}

.payment-card-mini-compact .payment-card-chip {
  width: 2.1rem;
  height: 1.45rem;
}
/* Keep subscription metric tiles independent from the payment card height */
.subscription-stats-grid {
  align-items: start;
}

.subscription-stats-grid > .dashboard-stat {
  align-self: start;
  height: auto;
}

.subscription-stats-grid > .dashboard-stat:not(.dashboard-stat-payment) {
  min-height: 7.75rem;
}

.subscription-stats-grid > .dashboard-stat-payment {
  min-height: 0;
}
/* Tenant detail keeps plan rules compact beside the subscription form */
.tenant-subscription-layout {
  align-items: start;
}

.tenant-subscription-form,
.tenant-plan-rules {
  align-self: start;
}

.tenant-plan-rules .plan-rules-list {
  align-content: start;
}

.tenant-plan-rules .plan-rule-card-item {
  padding: 0.9rem 1rem;
}

.tenant-plan-rules .payment-card-mini-compact {
  width: min(100%, 220px);
  max-width: 220px;
  min-height: 118px;
  gap: 0.5rem;
  padding: 0.75rem;
}

.tenant-plan-rules .payment-card-mini-compact .payment-card-number {
  font-size: 1.05rem;
}

.tenant-plan-rules .payment-card-mini-compact .payment-card-chip {
  width: 1.75rem;
  height: 1.15rem;
}

.tenant-plan-rules .payment-card-mini-compact .payment-card-brand,
.tenant-plan-rules .payment-card-mini-compact .payment-card-name,
.tenant-plan-rules .payment-card-mini-compact .payment-card-exp {
  font-size: 0.66rem;
}
/* Final sizing for saved-card previews */
.subscription-stats-grid > .dashboard-stat {
  min-height: 7.75rem;
}

.subscription-stats-grid > .dashboard-stat-payment {
  min-height: 7.75rem;
  padding: 0.85rem 1rem;
}

.subscription-stats-grid .payment-card-mini {
  width: min(100%, 240px);
  max-width: 240px;
  min-height: 118px;
  gap: 0.5rem;
  padding: 0.75rem;
  border-radius: 12px;
}

.subscription-stats-grid .payment-card-number {
  font-size: 1.1rem;
}

.subscription-stats-grid .payment-card-chip {
  width: 1.75rem;
  height: 1.15rem;
}

.subscription-stats-grid .payment-card-brand,
.subscription-stats-grid .payment-card-name,
.subscription-stats-grid .payment-card-exp {
  font-size: 0.66rem;
}

.tenant-plan-rules .plan-rule-card-item {
  justify-items: center;
}

.tenant-plan-rules .plan-rule-card-item > span {
  justify-self: start;
}

.tenant-plan-rules .plan-rule-card-item .payment-card-mini {
  justify-self: center;
}

.admin-billing-notice {
  display: grid;
  gap: 0.6rem;
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid #fde68a;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,251,235,0.96), rgba(255,248,221,0.96));
  color: #92400e;
}

.admin-billing-notice-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.admin-billing-notice-head i {
  color: #d97706;
  font-size: 1.15rem;
}

.admin-billing-notice p {
  margin: 0;
  line-height: 1.45;
}

.admin-billing-notice p strong {
  display: inline;
  margin-right: 0.35rem;
}

/* Platform settings section navigation */
.settings-section-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.settings-section-tab {
  min-height: 3rem;
}

.settings-section-tab.is-active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 24px var(--primary-glow);
}

.settings-section[hidden] {
  display: none !important;
}

.settings-section-heading {
  margin-bottom: 1rem;
}

.platform-operations-section {
  display: grid;
  gap: 1.25rem;
}

.platform-operations-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.settings-config-panel {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.42);
}

.settings-config-panel-wide {
  grid-column: 1 / -1;
}

.settings-config-panel-horizontal {
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.8fr);
  gap: 1.5rem;
  align-items: center;
  padding: 1.25rem;
}

.settings-config-panel-intro {
  display: grid;
  align-content: start;
  gap: 0.5rem;
  min-width: 0;
}

.settings-config-form,
.settings-config-control {
  min-width: 0;
}

.settings-config-form-compact {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.settings-config-control {
  display: grid;
  align-content: start;
  gap: 0.45rem;
}

.settings-credential-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  min-width: 0;
}

.settings-section .settings-config-form > button[type="submit"] {
  justify-self: end;
  margin-top: 0;
  white-space: nowrap;
}

.settings-config-panel h3,
.settings-config-panel p {
  margin: 0;
}

.settings-config-panel form {
  display: grid;
  gap: 0.75rem;
}

.settings-config-panel input,
.settings-config-panel select,
.settings-config-panel textarea {
  margin-bottom: 0;
}

.settings-section form > button[type="submit"] {
  margin-top: 1rem;
}

.compact-heading {
  margin: 0 0 0.75rem;
}

.compact-heading h3 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
}

.email-provider-panel {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.email-provider-panel[hidden] {
  display: none !important;
}
.email-template-grid {
  display: grid;
  gap: 1rem;
}

.email-template-audience-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.email-template-audience-switch .button.is-active {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

.email-template-card {
  display: grid;
  gap: 0.8rem;
}

.email-template-card[hidden] {
  display: none !important;
}

.email-template-audience-label {
  width: fit-content;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, #fff);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.email-template-card h3 {
  margin: 0;
  font-size: 1.15rem;
}

.template-variable-row {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.58);
}

.template-variable-row code,
.settings-section-heading code {
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 800;
}

.email-template-body-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.email-template-textarea {
  min-height: 14rem;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
  line-height: 1.45;
}

.public-template-grid {
  display: grid;
  gap: 1rem;
}

.public-template-card {
  display: grid;
  gap: 1rem;
}

.public-template-card h3 {
  margin: 0;
  font-size: 1.15rem;
}

.publication-toggle {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  min-width: 250px;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-blur);
  cursor: pointer;
}

.publication-toggle-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.publication-toggle-track {
  position: relative;
  width: 46px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  transition: background-color 160ms ease, border-color 160ms ease;
}

.publication-toggle-track span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 160ms ease, background-color 160ms ease;
}

.publication-toggle-input:checked ~ .publication-toggle-track {
  border-color: var(--success);
  background: var(--success-light);
}

.publication-toggle-input:checked ~ .publication-toggle-track span {
  transform: translateX(20px);
  background: var(--success);
}

.publication-toggle-input:focus-visible ~ .publication-toggle-track {
  outline: 3px solid var(--primary-soft);
  outline-offset: 2px;
}

.publication-toggle-copy {
  display: grid;
  gap: 0.1rem;
}

.publication-toggle-copy strong {
  color: var(--ink);
  line-height: 1.2;
}

.publication-toggle-copy small {
  color: var(--muted);
  line-height: 1.3;
}

.publication-toggle-input:checked ~ .publication-toggle-copy .publication-state-off,
.publication-toggle-input:not(:checked) ~ .publication-toggle-copy .publication-state-on {
  display: none;
}

.how-template-flow ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  list-style-position: inside;
}

.how-template-flow li {
  min-height: 150px;
  padding: 1.5rem;
  background: var(--card-blur);
  color: var(--muted);
  line-height: 1.55;
}

.how-template-flow li::marker {
  color: var(--primary);
  font-weight: 800;
}

.how-template-flow li strong {
  display: block;
  margin: 0.8rem 0 0.35rem;
  color: var(--ink);
  font-size: 1.05rem;
}

.feature-template-content > ul {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
}

.feature-template-content > ul > li {
  padding: 1.25rem 0 1.25rem 1.25rem;
  border-left: 3px solid var(--primary);
  color: var(--muted);
  line-height: 1.55;
}

.feature-template-content > ul > li strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--ink);
  font-size: 1.05rem;
}

.public-page-actions {
  width: min(1180px, calc(100% - 40px));
  margin: -1rem auto 0;
  padding-bottom: 4rem;
}

.faq-section {
  display: grid;
  grid-template-columns: minmax(220px, .72fr) minmax(0, 1.28fr);
  align-items: start;
  gap: 3rem;
}

.faq-section-heading {
  position: sticky;
  top: 1.5rem;
}

.faq-section-heading h2 {
  margin: 0 0 .75rem;
}

.faq-list {
  border-top: 1px solid var(--line);
}

.faq-page-band {
  width: min(900px, calc(100% - 40px));
  padding-top: 0;
  border-top: 0;
}

.faq-item {
  border-bottom: 1px solid var(--line);
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.25rem 0;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary i {
  flex: 0 0 auto;
  color: var(--primary);
  font-size: 1.2rem;
  transition: transform 180ms ease;
}

.faq-item[open] summary i {
  transform: rotate(45deg);
}

.faq-item.is-closing summary i {
  transform: rotate(0);
}

.faq-answer {
  padding: 0 2.5rem 1.35rem 0;
  color: var(--muted);
}

.faq-answer > :first-child,
.public-document-content > :first-child {
  margin-top: 0;
}

.faq-answer > :last-child,
.public-document-content > :last-child {
  margin-bottom: 0;
}

.public-document {
  width: min(900px, calc(100% - 40px));
  margin: 3rem auto 5rem;
}

.public-document-header {
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.public-document-header h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.6rem, 6vw, 4.8rem);
  line-height: 1;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.public-document-content {
  padding: 2.5rem 0;
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.75;
}

.public-document-content h2,
.public-document-content h3 {
  margin-top: 2.25rem;
}

.marketing-footer {
  border-top: 1px solid var(--line);
  background: var(--card-blur);
}

.marketing-footer-inner {
  display: grid;
  grid-template-columns: minmax(210px, .75fr) minmax(280px, 1.2fr) minmax(180px, .7fr);
  align-items: center;
  gap: 1.5rem;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 1.6rem 0;
}

.marketing-footer-brand,
.marketing-footer-content {
  min-width: 0;
}

.marketing-footer-brand p,
.marketing-footer-content p {
  margin: 0.65rem 0 0;
}

.marketing-footer-content h2 {
  margin: 0;
  font-size: 1.05rem;
}

.marketing-footer-content .marketing-rich-text p {
  color: var(--muted);
}

.marketing-footer-brand p,
.marketing-footer-content p,
.marketing-footer-content .marketing-rich-text {
  font-size: .84rem;
  line-height: 1.45;
}

.marketing-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .55rem 1rem;
}

.marketing-footer-links a {
  color: var(--ink);
  font-size: .86rem;
  font-weight: 650;
  text-decoration: none;
}

.marketing-footer-links a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.public-content-create-card,
.public-content-item {
  padding: 1.5rem;
}

.public-content-create-card {
  margin-bottom: 1.25rem;
}

.public-content-create-card > h3 {
  margin-top: 0;
}

.public-content-list {
  display: grid;
  gap: 1.25rem;
}

.public-content-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.public-content-summary h3 {
  margin: 0;
}

.public-content-summary a {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  margin-top: .35rem;
  color: var(--primary);
  font-size: .9rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.public-content-kicker {
  display: block;
  margin-bottom: .3rem;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.public-content-summary-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex: 0 0 auto;
}

.public-content-edit-panel {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.public-content-edit-panel > form:first-child {
  display: grid;
  gap: 1rem;
}

.public-content-delete-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.public-page-editor {
  min-height: 260px;
}

.public-template-source {
  display: none;
}

.public-template-editor {
  min-height: 220px;
  background: #fff;
}

.public-template-editor .ql-editor {
  min-height: 220px;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.55;
}

.public-template-editor.ql-container,
.public-template-card .ql-toolbar {
  border-color: var(--line);
}

.public-template-editor.ql-container {
  margin-bottom: 1rem;
}

@media (max-width: 900px) {
  .platform-operations-grid,
  .email-template-body-grid {
    grid-template-columns: 1fr;
  }

  .settings-config-panel-horizontal,
  .settings-config-form-compact,
  .settings-credential-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .settings-section .settings-config-form > button[type="submit"] {
    justify-self: stretch;
  }

  .publication-toggle {
    min-width: 0;
    width: 100%;
  }

  .how-template-flow ol,
  .feature-template-content > ul,
  .faq-section,
  .marketing-footer-inner {
    grid-template-columns: 1fr;
  }

  .faq-section {
    gap: 1.25rem;
  }

  .faq-section-heading {
    position: static;
  }

  .marketing-footer-links {
    justify-content: flex-start;
  }

  .public-content-summary {
    align-items: flex-start;
  }

  .public-content-summary-actions {
    align-items: flex-end;
    flex-direction: column;
  }
}
/* Platform account management */
.platform-accounts-layout {
  align-items: start;
}

.platform-admin-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 16rem;
}

.platform-account-actions {
  gap: 0.5rem;
  flex-wrap: wrap;
}

.platform-account-actions .inline-form {
  display: inline-flex;
}
[data-catalog-provider-panel] {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

[data-catalog-provider-panel][hidden] {
  display: none !important;
}

.settings-subtitle {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.dashboard-stat-interactive {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-stat-interactive:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

.dashboard-stat-interactive i {
  margin-left: 0.25rem;
  transition: transform 0.2s ease;
}

.dashboard-stat-interactive:hover i {
  transform: translateX(3px);
}

.pricing-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.pricing-card > *:last-child {
  margin-top: auto;
}

.portal-shell {
  width: min(1480px, calc(100% - 48px));
  margin: 0 auto;
  padding: 32px 0 64px;
}

.portal-header,
.portal-hero,
.portal-store-top,
.portal-card-actions,
.portal-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.portal-header,
.portal-hero,
.portal-store-top,
.portal-card-actions {
  justify-content: space-between;
}

.portal-header {
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.portal-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.portal-hero {
  padding: 38px 0 26px;
}

.portal-hero h1 {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 4.5rem);
}

.portal-store-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

@media (max-width: 760px) {
  .portal-store-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.portal-store-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 280px;
  overflow: hidden;
}

.portal-store-card h2 {
  margin: 0 0 4px;
  overflow-wrap: anywhere;
}

.portal-store-title {
  min-width: 0;
}

.portal-store-top .status-pill {
  flex: 0 0 auto;
  max-width: 45%;
  text-align: center;
  white-space: normal;
}

.portal-workspace-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.5);
}

.portal-workspace-link > i {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 0.7rem;
  background: rgba(29, 78, 216, 0.1);
  color: var(--primary);
}

.portal-workspace-link > div {
  min-width: 0;
}

.portal-workspace-link span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.portal-workspace-link a,
.portal-workspace-link strong {
  display: block;
  min-width: 0;
  margin-top: 0.12rem;
  color: var(--primary);
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-trial-summary {
  display: grid;
  gap: 0.55rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--primary) 7%, transparent);
}

.portal-trial-summary > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.portal-trial-summary span {
  color: var(--muted);
  font-weight: 700;
}

.portal-trial-summary strong {
  color: var(--primary);
}

.portal-trial-track {
  display: block;
  width: 100%;
  height: 6px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 15%, var(--surface));
  appearance: none;
}

.portal-trial-track::-webkit-progress-bar {
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 15%, var(--surface));
}

.portal-trial-track::-webkit-progress-value,
.portal-trial-track::-moz-progress-bar {
  border-radius: 999px;
  background: var(--primary);
}

.product-trial-banner {
  justify-content: space-between;
}

.product-trial-banner > div {
  flex: 1;
}

.product-trial-banner p {
  margin: 0.2rem 0 0;
  font-weight: 500;
}

.portal-store-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.portal-store-meta > div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.42);
}

.portal-store-meta span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.portal-store-meta strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.portal-card-actions {
  margin-top: auto;
  flex-wrap: wrap;
}

.portal-card-actions .button {
  flex: 1 1 180px;
  min-width: 0;
  line-height: 1.2;
  text-align: center;
}

.portal-card-actions .button > i {
  flex: 0 0 auto;
}

.portal-card-actions .button > span {
  display: block;
  min-width: 0;
  line-height: 1.25;
  text-align: center;
}

@media (max-width: 560px) {
  .subscription-detail-grid .plan-rule-item {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .subscription-detail-grid .plan-rule-item strong {
    justify-content: center;
    text-align: center;
  }
}

.team-access-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.team-access-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.team-access-card h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.team-access-card p {
  margin: 0;
}

.team-access-icon {
  display: grid;
  place-items: center;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 1.5rem;
}

.team-access-limit {
  margin-top: 12px !important;
  color: var(--muted);
}

.access-type-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.access-type-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.access-type-option:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.access-type-option input {
  width: auto;
  margin-top: 3px;
}

.access-type-option span,
.access-type-option small {
  display: block;
}

.access-type-option small {
  margin-top: 4px;
  color: var(--muted);
}

.workspace-assignment {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.workspace-assignment legend {
  padding: 0 8px;
  font-weight: 700;
}

.workspace-check-grid,
.portal-member-workspaces,
.team-tenant-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.workspace-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
}

.workspace-check input {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--primary);
}

.workspace-check:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.field-validation {
  min-height: 1.25rem;
  margin: 6px 0 0;
  font-size: 0.85rem;
}

.field-validation:empty {
  display: none;
}

.field-validation.is-valid {
  color: var(--success);
}

.field-validation.is-invalid {
  color: var(--danger);
}

input.field-valid {
  border-color: var(--success);
}

input.field-invalid {
  border-color: var(--danger);
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 12px;
  text-align: center;
  min-height: 300px;
}

.empty-state > i {
  color: var(--primary);
  font-size: 3rem;
}

.form-actions-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.portal-profile-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding-top: 34px;
}

.portal-profile-summary {
  display: grid;
  gap: 18px;
  justify-items: start;
}

.portal-profile-summary h1 {
  margin: 0 0 4px;
}

.portal-profile-summary p {
  margin: 0.25rem 0;
}

.portal-profile-card {
  min-width: 0;
}

@media (max-width: 760px) {
  .portal-shell {
    width: min(100% - 24px, 680px);
    padding-top: 18px;
  }

  .portal-header,
  .portal-hero,
  .portal-store-top,
  .portal-card-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-actions,
  .portal-actions .button,
  .portal-hero .button,
  .portal-card-actions .button {
    width: 100%;
  }

  .portal-store-meta {
    grid-template-columns: 1fr;
  }

  .portal-store-top .status-pill {
    max-width: none;
  }

  .portal-profile-layout {
    grid-template-columns: 1fr;
  }

  .team-access-grid,
  .access-type-options {
    grid-template-columns: 1fr;
  }
}

.settings-config-control-wide {
  grid-column: 1 / -1;
}

.shift4shop-connection-header,
.copy-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.integration-provider-panel {
  display: grid;
  gap: 1.15rem;
  margin-top: 1.35rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--line);
}

.integration-settings-submit {
  margin-top: 1.35rem;
}

.shift4shop-connect-steps {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 0.75rem 0.85rem;
  align-items: center;
  margin: 1rem 0;
}

.shift4shop-preparation-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.45);
}

.shift4shop-preparation-row p {
  margin: 0.25rem 0 0;
}

.prepare-connection-button {
  justify-self: start;
  margin: 0;
}

.settings-advanced-connection {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.settings-advanced-connection summary {
  cursor: pointer;
  font-weight: 700;
}

.settings-advanced-connection[open] summary {
  margin-bottom: 0.75rem;
}

.shift4shop-connect-steps p {
  margin: 0;
}

.connection-step-number,
.connection-icon {
  display: grid;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
}

.connection-step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-weight: 700;
}

.copy-field-row input {
  min-width: 0;
  flex: 1;
  margin-bottom: 0;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.copy-field-row .button,
.copy-field-row button {
  flex: 0 0 auto;
  margin: 0;
}

.shift4shop-connected-store,
.connection-notice {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
}

.shift4shop-connected-store > i {
  color: var(--success);
  font-size: 1.6rem;
}

.shift4shop-connected-store span {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.shift4shop-connected-store strong {
  overflow-wrap: anywhere;
}

.shift4shop-connected-store small {
  color: var(--muted);
  font-weight: 700;
}

.connected-store-url-field {
  display: grid;
  gap: 0.45rem;
}

.connected-store-url-field label,
.connected-store-url-field input {
  margin-bottom: 0;
}

.connection-notice-danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, var(--line));
  background: color-mix(in srgb, var(--danger) 8%, white);
}

.connection-notice-compact {
  margin: 0;
  max-width: 760px;
}

.connection-notice-compact > i {
  flex: 0 0 auto;
  font-size: 1.35rem;
}

.connection-notice-compact span,
.connection-target span {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.connection-notice-compact small,
.connection-target small {
  color: var(--muted);
}

.connection-target {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
}

.connection-target > i {
  color: var(--primary);
  font-size: 1.5rem;
}

.connection-shell {
  max-width: 900px;
}

.connection-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem 1.25rem;
  align-items: start;
}

.connection-card h1,
.connection-card p {
  margin-top: 0;
}

.connection-icon {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  font-size: 1.6rem;
}

.connection-card > .connection-form,
.connection-card > .connection-notice {
  grid-column: 1 / -1;
}

.connection-form {
  display: grid;
  gap: 0.75rem;
}

.connection-form button {
  justify-self: start;
}

@media (max-width: 640px) {
  .shift4shop-connection-header,
  .copy-field-row,
  .shift4shop-preparation-row {
    align-items: stretch;
    flex-direction: column;
  }

  .copy-field-row button,
  .connection-form button {
    width: 100%;
  }
}
@keyframes control-spinner {
  to {
    transform: rotate(360deg);
  }
}

.button .spinner {
  animation: control-spinner 0.75s linear infinite;
}
.tenant-refund-console .panel-header {
  align-items: center;
}

.tenant-refund-state {
  margin: 0 0 1rem;
}

.refund-table {
  min-width: 980px;
}

.refund-table td:nth-child(2) strong {
  display: block;
  max-width: 230px;
  overflow-wrap: anywhere;
}

.refund-table td:nth-child(3),
.refund-table td:nth-child(4),
.refund-table td:nth-child(5) {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.refund-pagination {
  margin-top: 1rem;
}

.refund-modal-card {
  width: min(680px, calc(100vw - 2rem));
}

.refund-modal-card form {
  margin-top: 1.25rem;
}

.refund-form-grid textarea {
  min-height: 110px;
}

.refund-warning {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--warning-border, #f2c66d);
  border-radius: 8px;
  background: var(--warning-soft, #fff8e8);
  color: var(--text-primary);
}

.refund-warning i {
  flex: 0 0 auto;
  margin-top: 0.15rem;
  color: var(--warning, #b85c00);
}

@media (max-width: 720px) {
  .refund-modal-card .actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .refund-modal-card .actions .button {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .plan-carousel {
    position: relative;
    grid-template-columns: minmax(0, 1fr);
  }

  .plan-carousel-viewport {
    grid-column: 1;
  }

  .plan-carousel-track .pricing-card {
    flex-basis: 100%;
  }

  .plan-carousel-arrow {
    position: absolute;
    z-index: 2;
    top: 50%;
    margin-top: -1.425rem;
  }

  .plan-carousel-arrow-prev {
    left: 0.5rem;
  }

  .plan-carousel-arrow-next {
    right: 0.5rem;
  }
}
