/* ============================================================
   SD Gift Vouchers — Client Portal Stylesheet
   Design: Dark editorial SaaS dashboard
   Fonts: Cormorant Garamond (display) + DM Sans (UI)
   ============================================================ */

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

:root {
  --sp-bg:        var(--vora-page-bg, #fbfaf7);  /* Page background — storefront inherited */
  --sp-surface:   var(--vora-surface, #ffffff);  /* Card / sidebar surface */
  --sp-surface2:  #f8f9ff;                       /* Input background (portal-local) */
  --sp-border:    var(--vora-border, #e7dfd2);   /* Subtle border — storefront inherited */
  --sp-border2:   #c8ccd8;                       /* Stronger border (portal-local) */
  --sp-text:      var(--vora-primary, #001d36);  /* Primary text — storefront inherited */
  --sp-text-sub:  #3a4455;                       /* Secondary text (portal-local) */
  --sp-text-muted:var(--vora-muted, #6f7680);    /* Muted text — storefront inherited */
  --sp-accent:    var(--vora-accent, #b8872a);   /* Gold accent — storefront inherited */
  --sp-accent2:   #96681a;                       /* Darker gold (portal-local) */
  --sp-green:     #166534;
  --sp-red:       #991b1b;
  --sp-amber:     #92400e;
  --sp-sidebar-w: 240px;
  --sp-radius:    6px;
  --sp-radius-lg: 10px;
  --sp-trans:     0.18s ease;
  --sp-serif:     'Cormorant Garamond', Georgia, serif;
  --sp-sans:      'DM Sans', system-ui, sans-serif;
  --sp-shadow:    0 2px 16px rgba(0,0,0,0.09);
}

html, body { height: 100%; background: var(--sp-bg); color: var(--sp-text); font-family: var(--sp-body-font, var(--sp-sans)); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: hidden; }

a { color: inherit; text-decoration: none; }
button { font-family: var(--sp-sans); cursor: pointer; }
input, textarea, select { font-family: var(--sp-sans); }

/* ── Login page ────────────────────────────────────────────── */
.sdgv-portal--login { background: var(--sp-bg); }

.sp-login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 480px 1fr;
}

@media (max-width: 860px) { .sp-login { grid-template-columns: 1fr; } .sp-login__visual { display: none; } }

.sp-login__panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 56px;
  background: var(--sp-surface);
  border-right: 1px solid var(--sp-border);
}

.sp-login__brand { text-align: center; margin-bottom: 48px; }
.sp-login__logo { max-height: 52px; max-width: 180px; margin: 0 auto 10px; }
.sp-login__brandname { font-family: var(--sp-serif); font-size: 30px; letter-spacing: 2px; color: var(--sp-text); }
.sp-login__subtitle { font-size: 16px; letter-spacing: 2px; text-transform: uppercase; color: var(--sp-text-sub); margin-top: 6px; }

.sp-login__title { font-family: var(--sp-serif); font-size: 36px; font-weight: 500; color: var(--sp-text); margin-bottom: 8px; }
.sp-login__hint { color: var(--sp-text-sub); font-size: 18px; margin-bottom: 32px; }

.sp-login__footer { margin-top: 40px; text-align: center; font-size: 16px; color: var(--sp-text-muted); }
.sp-login__footer a { color: var(--sp-accent); }

.sp-login__visual { position: relative; overflow: hidden; background: #0d0d0d; }

/* Two stacked image layers for crossfade transition */
.sp-login__bg-layer {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transition: opacity 1.4s ease;
}
.sp-login__bg-layer--front { opacity: 1; z-index: 1; }
.sp-login__bg-layer--back  { opacity: 0; z-index: 0; }

/* Dark gradient overlay */
.sp-login__overlay {
  position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.15) 0%,
    rgba(0,0,0,0.1)  40%,
    rgba(0,0,0,0.65) 100%
  );
}

/* Location badge — bottom left */
.sp-login__location {
  position: absolute; bottom: 56px; left: 48px;
  z-index: 3; color: rgba(255,255,255,0.75);
  font-size: 16px; letter-spacing: 0.05em;
  display: flex; flex-direction: column; gap: 3px;
  transition: opacity 0.6s ease;
}
.sp-login__photo-credit {
  display: block;
  font-size: 14px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.05em;
}

/* Quote — bottom right / centre */
.sp-login__visual-inner {
  position: absolute; inset: 0; z-index: 3;
  display: flex; align-items: flex-end; justify-content: flex-end;
  padding: 56px 48px;
  text-align: right;
}
.sp-login__quote { max-width: 380px; }
.sp-login__quote p {
  font-family: var(--sp-serif); font-size: 28px; font-style: italic;
  color: #fff; line-height: 1.35; margin-bottom: 10px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}
.sp-login__quote cite {
  font-size: 16px; color: rgba(255,255,255,0.55);
  font-style: normal; letter-spacing: 1px;
}

/* ── Dashboard layout ──────────────────────────────────────── */
.sdgv-portal--dashboard { background: var(--sp-bg); }

.sp-layout {
  display: grid;
  grid-template-columns: var(--sp-sidebar-w) 1fr;
  min-height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────────────  */
.sp-sidebar {
  background: var(--sp-surface);
  border-right: 1px solid var(--sp-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
}

.sp-sidebar__brand {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--sp-border);
}

.sp-sidebar__logo { max-height: 36px; max-width: 160px; object-fit: contain; margin-bottom: 6px; }
.sp-sidebar__brandname { font-family: var(--sp-serif); font-size: 15px; letter-spacing: 1px; display: block; }
.sp-sidebar__tag { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: #a09a90; display: block; margin-top: 4px; }

/* Nav */
.sp-nav { padding: 12px 0; flex: 1; }

.sp-nav__item {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 11px 22px;
  font-size: 13px;
  color: #3a4455;
  border-left: 2px solid transparent;
  transition: all var(--sp-trans);
}

.sp-nav__icon { display: none; }
.sp-nav__label { font-size: 13px; }
.sp-nav__item svg { display: none; }
.sp-nav__item:hover { color: var(--sp-text); background: var(--sp-surface2); }
.sp-nav__item.is-active { color: var(--sp-accent); border-left-color: var(--sp-accent); background: rgba(201,169,110,0.06); }
.sp-nav-group { margin: 4px 0; }
.sp-nav-group summary { cursor: pointer; padding: 9px 18px; color: var(--sp-text-muted); font-size: 10px; font-weight: 800; letter-spacing: .12em; list-style: none; text-transform: uppercase; }
.sp-nav-group summary::-webkit-details-marker { display: none; }
.sp-nav-group summary::after { content: '+'; float: right; font-size: 14px; line-height: 10px; }
.sp-nav-group[open] summary::after { content: '−'; }
.sp-nav-group .sp-nav__item { padding-left: 30px; }

/* Footer */
.sp-sidebar__footer { padding: 16px 20px; border-top: 1px solid var(--sp-border); display: flex; flex-direction: column; gap: 10px; }
.sp-sidebar__viewstore, .sp-logout {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--sp-text-muted);
  background: none; border: none; padding: 0; text-align: left;
  transition: color var(--sp-trans);
}
.sp-sidebar__viewstore svg, .sp-logout svg { display: none; }
.sp-sidebar__viewstore:hover, .sp-logout:hover { color: var(--sp-accent); }
.sp-sidebar__credit { font-size: 11px; color: var(--sp-text-muted); }
.sp-sidebar__credit a { color: var(--sp-accent); }

/* ── Main area ───────────────────────────────────────────────  */
.sp-main {
  min-width: 0;
  overflow-x: auto;
  overflow-y: auto;
  height: 100vh;
}
.sp-main__inner {
  padding: 36px 40px 80px;
  min-width: 600px; /* ensures scroll bar appears rather than content being clipped */
}

/* ── Edit-voucher: keep grid wide enough for all three columns ── */
.sp-editor--with-preview {
  min-width: 860px;   /* form + preview + display-options never collapse */
}

/* ── Page header ─────────────────────────────────────────────  */
.sp-page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 32px; gap: 16px; flex-wrap: wrap; }
.sp-page-title { font-family: var(--sp-serif); font-size: 38px; font-weight: 500; color: var(--sp-text); line-height: 1.1; }
.sp-page-sub { font-size: 18px; color: #6b7280; margin-top: 4px; }
.sp-header-actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
.sp-breadcrumb { font-size: 18px; color: #6b7280; }
.sp-breadcrumb:hover { color: var(--sp-accent); }

/* ── Stats ───────────────────────────────────────────────────  */
.sp-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--sp-border);
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-lg);
  overflow: hidden;
  margin-bottom: 32px;
}

.sp-stat {
  background: var(--sp-surface);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sp-stat__label { font-size: 16px; letter-spacing: 1.5px; text-transform: uppercase; color: #a09a90; }
.sp-stat__value { font-family: var(--sp-serif); font-size: 32px; font-weight: 600; color: var(--sp-text); }

/* ── Quick actions ───────────────────────────────────────────  */
.sp-quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 40px; }

.sp-quick {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--sp-surface);
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius);
  padding: 18px 16px;
  transition: all var(--sp-trans);
}

.sp-quick:hover { border-color: var(--sp-accent); background: var(--sp-surface2); }
.sp-quick__icon { font-size: 28px; flex-shrink: 0; }
.sp-quick__title { font-size: 17px; font-weight: 600; color: var(--sp-text); }
.sp-quick__sub { font-size: 16px; color: var(--sp-text-sub); margin-top: 2px; }

/* ── Cards ───────────────────────────────────────────────────  */
.sp-card {
  background: var(--sp-surface);
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
}

.sp-card--sm { margin-bottom: 16px; }

.sp-card--cta {
  background: transparent;
  border: none;
  padding: 0;
}

.sp-card__header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--sp-border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sp-card__header h2 { font-family: var(--sp-serif); font-size: 28px; font-weight: 600; color: var(--sp-text); }
.sp-card__header h3 { font-size: 19px; font-weight: 600; }
.sp-card__num {
  width: 26px; height: 26px;
  background: var(--sp-accent);
  color: #000;
  font-size: 16px;
  font-weight: 700;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.sp-card__body { padding: 24px; }

/* ── Editor layout ───────────────────────────────────────────  */
.sp-editor {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 24px;
  align-items: start;
}
.sp-editor--with-preview {
  grid-template-columns: 1fr 300px 220px;
}
@media (max-width: 1200px) { .sp-editor--with-preview { grid-template-columns: 1fr 260px 200px; } }
@media (max-width: 960px)  { .sp-editor--with-preview { grid-template-columns: 1fr 200px; } .sp-editor__preview { display: none; } }
@media (max-width: 900px)  { .sp-editor { grid-template-columns: 1fr; } }

/* ── Preview pane ── */
.sp-editor__preview { position: sticky; top: 24px; }
.sp-preview-pane { background: #f4f5f7; border: 1px solid #e2e4ea; border-radius: 12px; overflow: hidden; }
.sp-preview-pane__header { padding: 11px 16px; border-bottom: 1px solid #e2e4ea; display: flex; align-items: center; justify-content: space-between; }
.sp-preview-pane__title { font-size: 16px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sp-text); }
.sp-preview-pane__live { display: flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 600; color: #14532d; letter-spacing: 0.08em; text-transform: uppercase; }
.sp-preview-pane__live::before { content:''; width:6px; height:6px; border-radius:50%; background:#14532d; animation: sp-pulse 1.8s ease-in-out infinite; }
@keyframes sp-pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.4;transform:scale(0.8)} }

.sp-preview-card { margin: 14px; border-radius: 12px; overflow: hidden; background: #f8f9ff; box-shadow: 0 4px 20px rgba(0,0,0,0.35); font-family: Georgia,serif; }
.sp-preview-card__img-wrap { width:100%; aspect-ratio:3/2; position:relative; overflow:hidden; }
.sp-preview-card__img-wrap img { width:100%; height:100%; object-fit:cover; display:block; }
.sp-preview-card__placeholder { width:100%; aspect-ratio:3/2; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; background:linear-gradient(135deg,rgba(184,135,42,0.06),rgba(195,198,207,0.08)); }
.sp-preview-card__placeholder-icon { font-size: 30px; opacity:0.4; }
.sp-preview-card__placeholder-text { font-size: 14px; font-family:sans-serif; color:rgba(195,198,207,0.6); letter-spacing:0.1em; text-transform:uppercase; }
.sp-preview-card__badge { position:absolute; top:9px; left:9px; background:rgba(184,135,42,0.92); color:#fff; font-size: 13px; font-weight:700; letter-spacing:0.1em; text-transform:uppercase; padding:3px 8px; border-radius:9999px; font-family:sans-serif; }
.sp-preview-card__body { padding:12px 14px 14px; background:#faf9f7; }
.sp-preview-card__title { font-size: 19px; font-style:italic; font-weight:400; color:var(--sp-text); margin:0 0 5px; line-height:1.2; }
.sp-preview-card__price { font-size: 15px; color:#5c5f61; margin:0 0 10px; font-family:sans-serif; }
.sp-preview-card__cta { display:block; width:100%; padding:9px 0; background:var(--sdgv-btn-bg); color:var(--sdgv-btn-text); text-align:center; border-radius:8px; font-size: 14px; font-weight:700; letter-spacing:0.12em; text-transform:uppercase; font-family:sans-serif; }
.sp-preview-hint { padding:9px 14px 12px; font-size: 16px; color:#a09a90; text-align:center; line-height:1.5; border-top:1px solid var(--sp-border); }

/* ── Form controls ───────────────────────────────────────────  */
.sp-field { margin-bottom: 20px; }
.sp-field:last-child { margin-bottom: 0; }

.sp-field label, .sp-label {
  display: block;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--sp-text);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.sp-hint { font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 17px; color: #b8b4aa; }
.sp-req { color: var(--sp-accent); }
.sp-field-hint { font-size: 18px; color: #b8b4aa; margin-top: 6px; line-height: 1.6; }
.sp-field-hint code { background: var(--sp-surface2); padding: 2px 6px; border-radius: 3px; font-size: 15px; }

.sp-input, .sp-textarea, .sp-select {
  width: 100%;
  background: var(--sp-surface2);
  border: 1px solid var(--sp-border2);
  border-radius: var(--sp-radius);
  color: var(--sp-text);
  font-family: var(--sp-sans);
  font-size: 20px;
  padding: 11px 14px;
  outline: none;
  transition: border-color var(--sp-trans), box-shadow var(--sp-trans);
  line-height: 1.4;
}

.sp-input--lg { font-size: 23px; padding: 12px 14px; }
.sp-input:focus, .sp-textarea:focus, .sp-select:focus {
  border-color: var(--sp-accent);
  box-shadow: 0 0 0 2px rgba(201,169,110,0.15);
}

.sp-textarea { resize: vertical; min-height: 80px; }
.sp-textarea--sm { min-height: 60px; }
.sp-textarea--code { font-family: 'Courier New', monospace; font-size: 17px; color: #ccc; }

.sp-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23001d36' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
  padding-right: 36px;
  cursor: pointer;
}

.sp-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Checkbox */
.sp-checkbox { display: flex; align-items: center; gap: 8px; font-size: 17px; color: var(--sp-text); cursor: pointer; margin-bottom: 10px; }
.sp-checkbox input { accent-color: var(--sp-accent); width: 14px; height: 14px; }

/* Toggle */
.sp-toggle { display: flex; align-items: center; gap: 10px; font-size: 17px; color: var(--sp-text); cursor: pointer; margin-bottom: 12px; }
.sp-toggle input { display: none; }
.sp-toggle__track {
  width: 36px; height: 20px;
  background: var(--sp-border2);
  border-radius: 10px;
  position: relative;
  flex-shrink: 0;
  transition: background var(--sp-trans);
}
.sp-toggle__track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--sp-trans);
}
.sp-toggle input:checked + .sp-toggle__track { background: var(--sp-accent); }
.sp-toggle input:checked + .sp-toggle__track::after { transform: translateX(16px); }

/* ── Buttons ─────────────────────────────────────────────────  */
.sp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sp-sans); font-size: 17px; font-weight: 600;
  letter-spacing: 0.3px; border-radius: var(--sp-radius);
  padding: 9px 18px; cursor: pointer; border: 1px solid #1a1a1a;
  background: #1a1a1a; color: #fff;
  transition: all var(--sp-trans); white-space: nowrap; text-decoration: none;
}
.sp-btn:hover { background: #333; border-color: #333; color: #fff; }
.sp-btn--primary { background: #1a1a1a; color: #fff; border-color: #1a1a1a; font-weight: 700; }
.sp-btn--primary:hover { background: #333; border-color: #333; color: #fff; }

/* High-prominence "New Voucher" CTA button */
.sp-btn--new-voucher {
  background: var(--sp-accent);
  color: #0f0f0f;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 12px 26px;
  border-radius: 9999px;
  border: none;
  box-shadow: 0 2px 16px rgba(184,135,42,0.35), 0 0 0 0 rgba(184,135,42,0.4);
  transition: box-shadow 0.25s ease, transform 0.15s ease, background 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.sp-btn--new-voucher:hover {
  background: var(--sp-accent2);
  box-shadow: 0 4px 24px rgba(184,135,42,0.5), 0 0 0 4px rgba(184,135,42,0.15);
  transform: translateY(-1px);
}
.sp-btn--new-voucher:active { transform: translateY(0); }
.sp-btn--outline { background: transparent; color: var(--sp-text); border-color: var(--sp-border2); }
.sp-btn--outline:hover { border-color: var(--sp-accent); color: var(--sp-accent); }
.sp-btn--ghost { background: transparent; color: var(--sp-text-sub); border-color: transparent; }
.sp-btn--ghost:hover { color: var(--sp-red); }
.sp-btn--full { width: 100%; }
.sp-btn--sm { font-size: 16px; padding: 6px 12px; }
.sp-btn--icon { padding: 6px 8px; width: 28px; height: 28px; }
.sp-btn.is-loading { opacity: 0.6; pointer-events: none; }
.sp-error { color: var(--sp-red); font-size: 17px; margin-top: 8px; padding: 10px 14px; background: rgba(193,18,31,0.1); border-radius: var(--sp-radius); border: 1px solid rgba(193,18,31,0.2); }

/* ── Image uploader ──────────────────────────────────────────  */
/* ── Image uploader zone — no border on outer wrapper ─── */
.sp-image-uploader {
  border-radius: var(--sp-radius-lg);
  overflow: hidden;
  cursor: pointer;
}

/* ── Empty state: prominent upload box ─────────────────── */
.sp-image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 24px 36px;
  border: 2px solid rgba(0,29,54,0.12);
  border-radius: var(--sp-radius-lg);
  background: rgba(0,29,54,0.02);
  transition: background 0.2s, border-color 0.2s;
  gap: 0;
}
.sp-image-uploader:hover .sp-image-placeholder,
.sp-image-placeholder.is-dragging {
  background: rgba(184,135,42,0.06);
  border-color: var(--sp-accent);
}

/* Upload arrow icon */
.sp-upload-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(184,135,42,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  color: var(--sp-accent);
}

/* Main CTA button inside the drop zone */
.sp-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  background: var(--sp-accent);
  color: #fff;
  border: none;
  border-radius: 9999px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: opacity 0.2s;
  margin-bottom: 14px;
  font-family: inherit;
}
.sp-upload-btn:hover { opacity: 0.85; }

/* "or drag & drop" text */
.sp-upload-or {
  font-size: 16px;
  color: var(--sp-text-muted);
  margin-bottom: 16px;
  margin-top: 0;
}

/* Format specs row */
.sp-upload-specs {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}
.sp-upload-spec {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 15px;
  color: rgba(0,29,54,0.45);
  letter-spacing: 0.05em;
}
.sp-upload-spec svg { color: var(--sp-accent); flex-shrink: 0; }

/* ── Image preview (once uploaded) ─────────────────────── */
.sp-image-preview {
  position: relative;
  border-radius: var(--sp-radius-lg);
  overflow: hidden;
}
.sp-image-preview img {
  width: 100%;
  aspect-ratio: 3/2;
  object-fit: cover;
  display: block;
}
.sp-image-preview__overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 14px 14px;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.2s;
}
.sp-image-preview:hover .sp-image-preview__overlay { opacity: 1; }
.sp-image-change-btn,
.sp-image-remove {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 9999px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s;
  font-family: inherit;
}
.sp-image-change-btn {
  background: rgba(255,255,255,0.15);
  color: #fff;
  backdrop-filter: blur(8px);
}
.sp-image-remove {
  background: rgba(186,26,26,0.8);
  color: #fff;
  backdrop-filter: blur(8px);
}
.sp-image-change-btn:hover { background: rgba(255,255,255,0.25); }
.sp-image-remove:hover { background: var(--sp-red); }

/* ── Progress bar ───────────────────────────────────────── */
.sp-image-progress {
  height: 3px;
  background: var(--sp-border);
  margin-top: 10px;
  border-radius: 2px;
  overflow: hidden;
}
.sp-image-progress__bar {
  height: 100%;
  background: var(--sp-accent);
  width: 0%;
  transition: width 0.3s ease;
}

/* ── Pricing tabs ────────────────────────────────────────────  */
.sp-pricing-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.sp-ptab {
  padding: 8px 16px; font-size: 17px; font-weight: 500;
  background: var(--sp-surface2); border: 1px solid var(--sp-border2);
  border-radius: var(--sp-radius); color: var(--sp-text-sub); cursor: pointer;
  transition: all var(--sp-trans);
}
.sp-ptab:hover { border-color: var(--sp-accent); color: var(--sp-text); }
.sp-ptab.is-active { background: var(--sp-accent); color: #0f0f0f; border-color: var(--sp-accent); font-weight: 600; }

/* Variant rows */
.sp-variant-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sp-variant-row .sp-input { flex: 1; }
.sp-variant-price-wrap { position: relative; width: 140px; flex-shrink: 0; }
.sp-currency {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 18px; color: var(--sp-text-sub); pointer-events: none;
}
.sp-variant-price-wrap .sp-input { padding-left: 28px; }
.sp-variant-price-wrap .sp-currency {
  left: 14px;
  z-index: 1;
  color: var(--sp-text) !important;
  font-weight: 700;
}
.sp-variant-price-wrap .sp-input,
.sp-variant-price-wrap input[type="number"] {
  padding-left: 42px !important;
  color: var(--sp-text) !important;
  background: #fff !important;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  caret-color: var(--sp-text);
}

/* ── Template picker ─────────────────────────────────────────  */
.sp-template-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }

.sp-tpl {
  border: 2px solid var(--sp-border);
  border-radius: var(--sp-radius);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--sp-trans);
  position: relative;
}
.sp-tpl:hover { border-color: var(--sp-accent); }
.sp-tpl.is-selected { border-color: var(--sp-accent); }

.sp-tpl__preview {
  aspect-ratio: 3/4;
  background: var(--sp-surface2);
  display: flex; align-items: center; justify-content: center;
  padding: 12px;
}

.sp-tpl__preview--classic  { background: #1a1a1a; }
.sp-tpl__preview--minimal  { background: #f8f8f8; }
.sp-tpl__preview--elegant  { background: #f2ede2; }
.sp-tpl__preview--bold     { background: #2c5f2e; }
.sp-tpl__preview--seasonal { background: #8b2500; }

.sp-tpl__mock { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.sp-tpl__mock-header { height: 16px; background: rgba(255,255,255,0.15); border-radius: 2px; }
.sp-tpl__mock-code { height: 22px; border: 1px dashed rgba(255,255,255,0.3); border-radius: 2px; }
.sp-tpl__mock-text { height: 8px; background: rgba(255,255,255,0.1); border-radius: 2px; width: 70%; }

.sp-tpl__preview--minimal .sp-tpl__mock-header { background: rgba(0,0,0,0.15); }
.sp-tpl__preview--minimal .sp-tpl__mock-code   { border-color: rgba(0,0,0,0.2); }
.sp-tpl__preview--minimal .sp-tpl__mock-text   { background: rgba(0,0,0,0.1); }
.sp-tpl__preview--elegant .sp-tpl__mock-header { background: rgba(201,169,110,0.4); }
.sp-tpl__preview--elegant .sp-tpl__mock-code   { border-color: rgba(201,169,110,0.5); }
.sp-tpl__preview--elegant .sp-tpl__mock-text   { background: rgba(0,0,0,0.1); }

.sp-tpl__name { font-size: 17px; padding: 8px; text-align: center; color: var(--sp-text); font-weight: 600; border-top: 1px solid var(--sp-border); background: var(--sp-surface); }
.sp-tpl__check { position: absolute; top: 6px; right: 6px; background: var(--sp-accent); color: #000; font-size: 14px; font-weight: 700; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

/* Template showcase */
.sp-template-showcase { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 32px; }
.sp-tpl-card { border: 1px solid var(--sp-border); border-radius: var(--sp-radius); overflow: hidden; background: var(--sp-surface); }
.sp-tpl-card__preview { aspect-ratio: 3/2; display: flex; align-items: center; justify-content: center; }
.sp-tpl-card__preview--vora { align-items: stretch; justify-content: stretch; overflow: hidden; }
.sp-tpl-card__preview--vora .sdgv-vora-card { box-shadow: 0 6px 18px rgba(0,0,0,0.18) !important; }
.sp-tpl .sdgv-vora-card { box-shadow: 0 6px 18px rgba(0,0,0,0.18) !important; }
.sp-tpl-card__preview--custom { background: var(--sp-surface2); color: var(--sp-text-muted); font-size: 17px; }
.sp-tpl-card__mock { width: 70%; display: flex; flex-direction: column; gap: 8px; }
.sp-tpl-card__mock-bar { height: 12px; background: rgba(255,255,255,0.15); border-radius: 2px; }
.sp-tpl-card__mock-code { height: 20px; border: 1px dashed rgba(255,255,255,0.25); border-radius: 2px; }
.sp-tpl-card__info { padding: 12px 14px; }
.sp-tpl-card__info h3 { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.sp-tpl-card__info p { font-size: 16px; color: var(--sp-text-sub); }

/* ── Voucher grid (list) ─────────────────────────────────────  */
.sp-voucher-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.sp-vcard {
  background: #ffffff;
  border: 1px solid #e2e4ea;
  border-radius: 14px;
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}
.sp-vcard:hover { border-color: var(--sp-accent); box-shadow: 0 4px 16px rgba(0,0,0,0.1); }

.sp-vcard__image { position: relative; aspect-ratio: 3/2; background: #e8eaf0; overflow: hidden; }
.sp-vcard__image img { width: 100%; height: 100%; object-fit: cover; }
.sp-vcard__image-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 44px; background: linear-gradient(135deg,#e8eaf0,#d8dce8); }
.sp-vcard__status { position: absolute; top: 10px; right: 10px; font-size: 13px; font-weight: 800; padding: 4px 10px; border-radius: 9999px; letter-spacing: 0.1em; text-transform: uppercase; }
.sp-vcard__status--publish { background: rgba(22,101,52,0.9); color: #fff; }
.sp-vcard__status--draft   { background: rgba(133,100,4,0.85); color: #fff; }

.sp-vcard__body { padding: 16px 18px 14px; background: #faf9f7; }
.sp-vcard__cat { font-size: 14px; letter-spacing: 0.15em; text-transform: uppercase; color: #9ca3af; margin-bottom: 4px; }
.sp-vcard__title { font-family: 'Cormorant Garamond', Georgia, serif; font-style: italic; font-size: 22px; font-weight: 400; color: var(--sp-text); margin-bottom: 4px; line-height: 1.2; }
.sp-vcard__price { font-size: 18px; font-weight: 600; color: var(--sp-accent); font-family: sans-serif; }
.sp-vcard__badge { display: inline-block; margin-top: 6px; font-size: 13px; padding: 3px 10px; background: var(--sp-accent); color: #fff; border-radius: 9999px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }

.sp-vcard__actions { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid #e2e4ea; background: #ffffff; }
.sp-vcard__actions .sp-btn { font-size: 16px; padding: 7px 16px; border-radius: 8px; }

/* ── Section / table ─────────────────────────────────────────  */
.sp-section { margin-bottom: 40px; }
.sp-section__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sp-section__title { font-family: var(--sp-serif); font-size: 26px; font-weight: 500; }
.sp-link { font-size: 17px; color: var(--sp-accent); }

.sp-table-wrap { overflow-x: auto; border: 1px solid var(--sp-border); border-radius: var(--sp-radius-lg); }
.sp-table { width: 100%; border-collapse: collapse; font-size: 17px; min-width: 900px; table-layout: auto; }
.sp-table th { background: var(--sp-surface); padding: 12px 14px; text-align: left; font-size: 15px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: var(--sp-text-muted); border-bottom: 1px solid var(--sp-border); white-space: nowrap; min-width: 80px; }
.sp-table td { padding: 12px 14px; border-bottom: 1px solid var(--sp-border); color: var(--sp-text); vertical-align: middle; white-space: nowrap; }
.sp-table tr:last-child td { border-bottom: none; }
.sp-table tr:hover td { background: var(--sp-surface2); }
.sp-table small { font-size: 16px; color: var(--sp-text-sub); }

/* ── Badges ──────────────────────────────────────────────────  */
.sp-badge { display: inline-block; padding: 3px 8px; border-radius: 4px; font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.sp-badge--complete  { background: rgba(22,101,52,0.15);  color: #14532d; }
.sp-badge--pending   { background: rgba(133,100,4,0.15);  color: #78350f; }
.sp-badge--redeemed  { background: rgba(30,64,175,0.15);  color: #1e3a8a; }
.sp-badge--cancelled { background: rgba(153,27,27,0.15);  color: #7f1d1d; }

/* ── Code ────────────────────────────────────────────────────  */
.sp-code { font-family: 'Courier New', monospace; font-size: 16px; background: var(--sp-surface2); padding: 2px 6px; border-radius: 3px; color: var(--sp-text-sub); }
.sp-code--voucher { font-size: 17px; letter-spacing: 1px; color: var(--sp-accent); }

/* ── Empty state ─────────────────────────────────────────────  */
.sp-empty { text-align: center; padding: 80px 24px; }
.sp-empty__icon { font-size: 48px; margin-bottom: 20px; }
.sp-empty h2 { font-family: var(--sp-serif); font-size: 30px; font-weight: 500; margin-bottom: 10px; }
.sp-empty p { color: var(--sp-text-sub); margin-bottom: 28px; }

/* ── Settings grid ───────────────────────────────────────────  */
.sp-settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 780px) { .sp-settings-grid { grid-template-columns: 1fr; } }

/* ── Save feedback ───────────────────────────────────────────  */
.sp-save-feedback { padding: 12px 16px; border-radius: var(--sp-radius); font-size: 17px; font-weight: 500; }
.sp-save-feedback--success { background: rgba(22,101,52,0.1); border: 1px solid rgba(22,101,52,0.3); color: #14532d; }
.sp-save-feedback--error   { background: rgba(127,29,29,0.08); border: 1px solid rgba(127,29,29,0.2); color: #7f1d1d; }

/* ── Toast ───────────────────────────────────────────────────  */
.sp-toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  background: var(--sp-surface);
  border: 1px solid var(--sp-border2);
  padding: 14px 18px; border-radius: var(--sp-radius-lg);
  font-size: 17px; color: var(--sp-text);
  box-shadow: var(--sp-shadow);
  transform: translateY(10px); opacity: 0; pointer-events: none;
  transition: all 0.22s ease; max-width: 300px;
}
.sp-toast.is-visible { transform: translateY(0); opacity: 1; pointer-events: all; }
.sp-toast--success { border-color: rgba(45,106,79,0.5); }
.sp-toast--error   { border-color: rgba(193,18,31,0.4);  }

/* ── Responsive ──────────────────────────────────────────────  */
@media (max-width: 1024px) {
  .sp-stats { grid-template-columns: repeat(2, 1fr); }
  .sp-quick-actions { grid-template-columns: repeat(2, 1fr); }
  .sp-voucher-grid { grid-template-columns: repeat(2, 1fr); }
  .sp-template-grid { grid-template-columns: repeat(3, 1fr); }
  .sp-template-showcase { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 780px) {
  :root { --sp-sidebar-w: 0px; }
  .sp-sidebar { display: none; }
  .sp-layout { grid-template-columns: 1fr; }
  .sp-main__inner { padding: 24px 20px 60px; }
  .sp-voucher-grid { grid-template-columns: 1fr; }
  .sp-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   v2.1 — Requirements batch: preview pane, safe zone, categories,
           plain language, typography, New Voucher button
   ============================================================ */

/* ── Image safe zone overlay ─────────────────────────────── */
.sp-image-preview {
  position: relative;
  overflow: hidden; /* CRITICAL: clips safe zone and any absolute children */
}
/* Dim the area OUTSIDE the safe zone using two gradient overlays */
.sp-image-preview::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.22);
  z-index: 1;
  pointer-events: none;
}
/* Safe zone "cut-out" is handled by the dashed border on the child */
.sp-image-safezone {
  position: absolute;
  top: 10%; left: 10%;
  width: 80%; height: 80%;
  border: 2px dashed rgba(255,255,255,0.65);
  border-radius: 4px;
  pointer-events: none;
  z-index: 2;
  /* Use outline instead of box-shadow — it cannot bleed outside overflow:hidden parent */
  outline: none;
}
.sp-image-safezone::after {
  content: 'Safe Zone — keep your main subject inside here';
  position: absolute;
  bottom: -26px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  font-family: sans-serif;
  color: rgba(255,255,255,0.6);
  white-space: nowrap;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(0,0,0,0.4);
  padding: 2px 8px;
  border-radius: 4px;
}

/* ── Category pill grid ─────────────────────────────────── */
.sp-cat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 6px;
}
.sp-cat-pill {
  display: flex;
  align-items: center;
  gap: 0;
  cursor: pointer;
}
.sp-cat-pill input[type="checkbox"] {
  display: none;
}
.sp-cat-pill__label {
  padding: 8px 18px;
  border-radius: 9999px;
  background: rgba(0,29,54,0.05);
  border: 1px solid var(--sp-border);
  font-size: 17px;
  font-weight: 500;
  color: var(--sp-text-sub);
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}
.sp-cat-pill input:checked + .sp-cat-pill__label {
  background: var(--sp-accent);
  border-color: var(--sp-accent);
  color: #0f0f0f;
  font-weight: 700;
}
.sp-cat-pill:hover .sp-cat-pill__label {
  border-color: var(--sp-accent);
  color: var(--sp-text);
}

/* ── T&C instructions box ───────────────────────────────── */
.sp-tc-instructions {
  background: rgba(0,29,54,0.03);
  border: 1px solid var(--sp-border);
  border-left: 3px solid var(--sp-accent);
  font-size: 17px;
  color: var(--sp-text-sub);
  line-height: 1.7;
}
.sp-tc-instructions strong {
  color: var(--sp-text);
  font-weight: 600;
  display: block;
  margin-bottom: 8px;
}
.sp-tc-instructions ul {
  margin: 0;
  padding-left: 20px;
}
.sp-tc-instructions li { margin-bottom: 4px; }

/* ── Template description text ─────────────────────────── */
.sp-tpl__desc {
  font-size: 15px;
  color: var(--sp-text-muted);
  margin-top: 3px;
  line-height: 1.4;
  text-align: center;
}

/* ── Sort select on vouchers list ──────────────────────── */
.sp-select {
  background: var(--sp-surface2);
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius);
  color: var(--sp-text);
  padding: 8px 12px;
  font-size: 17px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23001d36' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 12px;
  padding-right: 28px;
}
.sp-select:focus { border-color: var(--sp-accent); }

/* ── Preview pane image position fix ──────────────────── */
.sp-preview-card__img-wrap { position: relative; overflow: hidden; }

/* ── Sidebar logged-in user pill ────────────────────────── */
.sp-sidebar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(0,29,54,0.06);
  border-radius: var(--sp-radius);
  margin-bottom: 16px;
  border: 1px solid rgba(0,29,54,0.1);
}
.sp-sidebar__user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(184,135,42,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700;
  color: var(--sp-accent);
  flex-shrink: 0;
}
.sp-sidebar__user-info { display: flex; flex-direction: column; min-width: 0; }
.sp-sidebar__user-name {
  font-size: 17px; font-weight: 600; color: var(--sp-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sp-sidebar__user-role {
  font-size: 14px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--sp-accent); font-weight: 600; margin-top: 1px;
}

/* ============================================================
   v2.1 — Preview card rebuild + template modals + text fixes
   ============================================================ */

/* ── Fix 1: Proper storefront preview card ───────────────── */
.sp-preview-pane {
  background: rgba(0,29,54,0.03);
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-lg);
  overflow: hidden;
}
.sp-preview-pane__header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--sp-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
/* The actual storefront card — mirrors real frontend card exactly */
.sp-preview-card {
  margin: 12px;
  border-radius: 16px;
  overflow: hidden;
  background: #faf9f7;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
}
.sp-preview-card__img-wrap {
  position: relative !important;
  width: 100% !important;
  aspect-ratio: 3/2 !important;
  overflow: hidden !important;
  background: #1a1a2e;
  display: block;
}
.sp-preview-card__img-wrap img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}
.sp-preview-card__img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.sp-preview-card__placeholder {
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #1a1a2e, #2a2015);
}
.sp-preview-card__placeholder-icon { font-size: 34px; opacity: 0.35; }
.sp-preview-card__placeholder-text {
  font-size: 14px;
  font-family: 'Barlow', sans-serif;
  color: rgba(255,255,255,0.25);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
/* NEW badge — absolute top-left just like the real card */
.sp-preview-card__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--sp-accent);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 9999px;
  font-family: 'Barlow', sans-serif;
}
/* Card body — cream background matching storefront */
.sp-preview-card__body {
  padding: 16px 18px 18px;
  background: #faf9f7;
}
/* Italic serif title — exactly as on storefront */
.sp-preview-card__title {
  font-family: 'Cormorant Garamond', 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-size: 23px;
  font-weight: 400;
  color: var(--sp-text);
  margin: 0 0 6px;
  line-height: 1.15;
  min-height: 22px;
}
/* Dotted separator line like the real card */
.sp-preview-card__sep {
  border: none;
  border-top: 1px dashed rgba(195,198,207,0.5);
  margin: 10px 0;
}
/* Price + select row */
.sp-preview-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0;
}
.sp-preview-card__price {
  font-size: 17px;
  color: #5c5f61;
  font-family: 'Barlow', sans-serif;
  font-weight: 400;
}
/* SELECT button — matches real storefront exactly */
.sp-preview-card__cta {
  display: inline-block;
  padding: 9px 20px;
  background: var(--sdgv-btn-bg);
  color: var(--sdgv-btn-text);
  border-radius: 9999px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: 'Barlow', sans-serif;
  border: none;
  cursor: default;
}

/* ── Fix 3: Template preview modal ──────────────────────── */
.sp-tpl-preview-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.sp-tpl-preview-modal.is-open {
  display: flex;
}
.sp-tpl-preview-inner {
  background: #1a1a1a;
  border-radius: 16px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 24px 80px rgba(0,0,0,0.7);
  overflow: hidden;
  position: relative;
}
.sp-tpl-preview-close {
  position: absolute;
  top: 12px; right: 14px;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  font-size: 22px;
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
  transition: background 0.2s;
}
.sp-tpl-preview-close:hover { background: rgba(255,255,255,0.2); }
.sp-tpl-preview-voucher {
  padding: 32px 32px 28px;
}
.sp-tpl-preview-badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 9999px;
  margin-bottom: 20px;
  font-family: 'Barlow', sans-serif;
}
.sp-tpl-preview-to {
  font-size: 16px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.55;
  margin-bottom: 4px;
  font-family: 'Barlow', sans-serif;
}
.sp-tpl-preview-recipient {
  font-size: 32px;
  font-weight: 400;
  font-style: italic;
  margin-bottom: 4px;
  line-height: 1.1;
}
.sp-tpl-preview-title {
  font-size: 19px;
  opacity: 0.7;
  margin-bottom: 24px;
  font-family: 'Barlow', sans-serif;
}
.sp-tpl-preview-code-label {
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.5;
  margin-bottom: 6px;
  font-family: 'Barlow', sans-serif;
}
.sp-tpl-preview-code {
  font-family: 'Courier New', monospace;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 4px;
  padding: 14px 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  display: inline-block;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
  border: 1.5px dashed;
}
.sp-tpl-preview-value-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 16px;
  border-top: 1px solid;
  opacity: 0.6;
}
.sp-tpl-preview-value-label { font-size: 15px; letter-spacing: 0.1em; text-transform: uppercase; font-family: 'Barlow', sans-serif; }
.sp-tpl-preview-value { font-size: 26px; font-weight: 600; }
.sp-tpl-preview-footer {
  padding: 14px 32px;
  font-size: 15px;
  text-align: center;
  opacity: 0.45;
  border-top: 1px solid rgba(255,255,255,0.06); /* dark modal — keep */
  font-family: 'Barlow', sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Template card clickable */
.sp-tpl { cursor: pointer; position: relative; background: #ffffff; border-radius: 8px; }
.sp-tpl__preview-btn {
  position: absolute;
  bottom: 44px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 5px 12px;
  border-radius: 9999px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.sp-tpl:hover .sp-tpl__preview-btn { opacity: 1; }

/* ============================================================
   v2.1 FINAL — Nuclear white text, image fixes, full coverage
   ============================================================ */

/* ── ALL text in portal = dark navy — readable on light backgrounds ──── */
.sp-sidebar,
.sp-sidebar *,
.sp-main,
.sp-main *,
.sp-card,
.sp-card *,
.sp-nav,
.sp-nav *,
.sp-editor,
.sp-editor * {
  color: var(--sp-text) !important;
}

/* Exclude template preview cards — they set their own text colours.
   Higher specificity + !important so the universal rule above does not
   flatten the rendered voucher artwork in the template browser / picker. */
.sp-template-showcase .sdgv-vora-card,
.sp-template-showcase .sdgv-vora-card *,
.sp-design-picker .sdgv-vora-card,
.sp-design-picker .sdgv-vora-card *,
.sp-preview-card,
.sp-preview-card * {
  color: inherit !important;
  -webkit-text-fill-color: currentColor !important;
}

/* Chatbot preview: ID-specificity custom-property rules beat the .sp-card * !important
   above. The CSS variables are set via inline style (and updated live by JS).          */
#sp-chatbot-prev-header { color: var(--_cprev-hdr-c, #ffffff) !important; }
#sp-chatbot-prev-user   { color: var(--_cprev-usr-c, #ffffff) !important; }
#sp-chatbot-prev-action { color: var(--_cprev-act-c, #ffffff) !important; }

/* Input placeholders — muted but readable */
.sp-input::placeholder,
.sp-textarea::placeholder { color: rgba(0,29,54,0.35) !important; }

/* Active nav item — gold, not navy */
.sp-nav__item.is-active,
.sp-nav__item.is-active * { color: var(--sp-accent) !important; }

/* Inactive nav items — readable dark grey */
.sp-nav__item { color: #3a4455 !important; }
.sp-nav__item:hover { color: var(--sp-text) !important; }

/* Accent buttons — text uses storefront button-text colour */
.sp-btn--new-voucher,
.sp-btn--new-voucher * { color: var(--sdgv-btn-text) !important; }

/* Preview card — this is a light card simulating storefront.
   Inherits text colour from the universal rule exclusion above; do NOT
   force navy on it (some storefront templates use their own colours). */
.sp-preview-card,
.sp-preview-card * { color: inherit !important; -webkit-text-fill-color: currentColor !important; }
.sp-preview-card__price { color: #5c5f61 !important; }
.sp-preview-card__cta,
.sp-preview-card__cta * { color: #ffffff !important; }
.sp-preview-card__badge,
.sp-preview-card__badge * { color: #ffffff !important; }

/* Template preview modal */
.sp-tpl-preview-modal { color: inherit !important; }

/* Role/status badges in team view */
.sp-role-badge--full    { color: #14532d !important; }
.sp-role-badge--editor  { color: #1e3a8a !important; }
.sp-role-badge--admin   { color: var(--sp-accent2) !important; }

/* Account rows — keep functional colours, adapted for light background */
.sdgv-order-row__status--complete  { color: #166534 !important; }
.sdgv-order-row__status--redeemed  { color: #1e40af !important; }

/* Accent links */
a[href] { color: var(--sp-accent) !important; }
a[href]:hover { color: #d4a84b !important; }

/* Login screen — special (dark background image, white text is correct) */
.sp-login__panel,
.sp-login__panel * { color: #ffffff !important; }
.sp-login__footer a { color: var(--sp-accent) !important; }

/* Category pill — active state */
.sp-cat-pill input:checked + .sp-cat-pill__label { color: var(--sdgv-btn-text) !important; }

.sp-image-preview img {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 3/2 !important;
  object-fit: cover !important;
  display: block !important;
  position: relative !important; /* NOT absolute in upload zone */
}
.sp-image-safezone {
  position: absolute !important;
  z-index: 3 !important;
}

/* ── Template grid readable text ────────────────────────── */
.sp-tpl__name { color: var(--sp-text) !important; font-weight: 600 !important; }
.sp-tpl__desc { color: #3a4455 !important; }

/* ── Form labels always fully dark navy ─────────────────── */
.sp-field label,
.sp-label,
.sp-card__header h2,
.sp-card__header h3 {
  color: var(--sp-text) !important;
}
.sp-field-hint,
.sp-hint,
.sp-page-sub,
.sp-breadcrumb {
  color: #6b7280 !important;
}

/* ═══════════════════════════════════════════════════════════
   VORA v2.1 FINAL — Single definitive block, no conflicts
   ══════════════════════════════════════════════════════════ */

/* ── Upload zone: hard-constrained, never overflows ─────── */
.sp-image-uploader {
  max-height: 280px !important;
  overflow: hidden !important;
  border-radius: 12px !important;
  display: block !important;
}
.sp-image-preview {
  position: relative !important;
  max-height: 280px !important;
  overflow: hidden !important;
  display: block !important;
}
.sp-image-preview img {
  width: 100% !important;
  height: 280px !important;
  object-fit: cover !important;
  display: block !important;
  position: relative !important;
}

/* Safe zone — contained within overflow:hidden parent, no bleed */
.sp-image-safezone {
  position: absolute !important;
  top: 10% !important; left: 10% !important;
  width: 80% !important; height: 80% !important;
  border: 2px dashed rgba(255,255,255,0.55) !important;
  border-radius: 4px !important;
  pointer-events: none !important;
  z-index: 2 !important;
  box-shadow: none !important; /* NEVER use spread box-shadow — bleeds outside overflow */
}

/* ── Preview card: self-contained card mockup ───────────── */
.sp-preview-card {
  margin: 12px !important;
  border-radius: 14px !important;
  overflow: hidden !important;
  background: #faf9f7 !important;
  box-shadow: 0 6px 24px rgba(0,0,0,0.4) !important;
  font-family: Georgia, serif !important;
  max-width: 100% !important;
}
.sp-preview-card__img-wrap {
  position: relative !important;
  width: 100% !important;
  aspect-ratio: 3/2 !important;
  overflow: hidden !important;
  background: #1a1a2e !important;
  display: block !important;
}
.sp-preview-card__img-wrap img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}
.sp-preview-card__body {
  padding: 14px 16px 16px !important;
  background: #faf9f7 !important;
}
.sp-preview-card__title {
  font-family: 'Cormorant Garamond', Georgia, serif !important;
  font-style: italic !important;
  font-size: 20px !important;
  font-weight: 400 !important;
  color: var(--sp-text) !important;
  margin: 0 0 8px !important;
}
.sp-preview-card__sep {
  border: none !important;
  border-top: 1px dashed rgba(195,198,207,0.5) !important;
  margin: 8px 0 !important;
}
.sp-preview-card__footer {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}
.sp-preview-card__price { font-size: 16px !important; color: #5c5f61 !important; font-family: sans-serif !important; }
.sp-preview-card__cta   { display: inline-block !important; padding: 7px 16px !important; background: var(--sdgv-btn-bg) !important; color: var(--sdgv-btn-text) !important; border-radius: 9999px !important; font-size: 14px !important; font-weight: 700 !important; letter-spacing: 0.1em !important; text-transform: uppercase !important; font-family: sans-serif !important; }
.sp-preview-card__badge { position: absolute !important; top: 9px !important; left: 9px !important; background: var(--sp-accent) !important; color: #fff !important; font-size: 13px !important; font-weight: 800 !important; padding: 3px 9px !important; border-radius: 9999px !important; letter-spacing: 0.1em !important; text-transform: uppercase !important; font-family: sans-serif !important; }
.sp-preview-hint { padding: 8px 12px 10px !important; font-size: 15px !important; color: #6b7280 !important; text-align: center !important; line-height: 1.4 !important; border-top: 1px solid var(--sp-border) !important; }

/* ============================================================
   PORTAL DESIGN IMPROVEMENTS — Impeccable Skill Applied
   ============================================================ */

/* ── Edit voucher: ensure horizontal scroll works perfectly ─── */
.sp-main {
  min-width: 0;
  overflow-x: auto;
  overflow-y: auto;
  height: 100vh;
  scroll-behavior: smooth;
}
.sp-main__inner { padding: 32px 36px 80px; }
.sp-editor--with-preview { min-width: 880px; }

/* Scrollbar styling for main area */
.sp-main::-webkit-scrollbar { height: 6px; width: 6px; }
.sp-main::-webkit-scrollbar-track { background: transparent; }
.sp-main::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 3px; }
.sp-main::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.22); }

/* ── Cards: more refined ─── */
.sp-card {
  border-radius: 16px !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 8px 24px rgba(0,0,0,0.04) !important;
  border: 1px solid rgba(0,0,0,0.06) !important;
  transition: box-shadow 0.25s ease;
}
.sp-card:hover { box-shadow: 0 2px 6px rgba(0,0,0,0.06), 0 12px 32px rgba(0,0,0,0.07) !important; }
.sp-card__header {
  border-bottom: 1px solid rgba(0,0,0,0.06) !important;
  padding: 18px 24px !important;
}
.sp-card__header h2 { font-size: 15px !important; font-weight: 600 !important; letter-spacing: -0.01em; }
.sp-card__body { padding: 22px 24px !important; }

/* ── Inputs: more refined ─── */
.sp-input, .sp-textarea, .sp-select {
  border-radius: 10px !important;
  border: 1px solid rgba(0,0,0,0.1) !important;
  font-size: 14px !important;
  transition: border-color 0.2s, box-shadow 0.2s !important;
}
.sp-input:focus, .sp-textarea:focus, .sp-select:focus {
  border-color: var(--sp-accent) !important;
  box-shadow: 0 0 0 3px rgba(var(--sp-accent-rgb, 0,145,255), 0.12) !important;
  outline: none !important;
}

/* ── Buttons: more refined ─── */
.sp-btn--primary {
  border-radius: 9999px !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em !important;
  transition: all 0.2s !important;
}
.sp-btn--primary:hover { background: #333; border-color: #333; color: #fff; transform: translateY(-1px); }

/* ── Voucher cards in grid ─── */
.sp-vcard {
  border-radius: 14px !important;
  border: 1px solid rgba(0,0,0,0.07) !important;
  transition: all 0.25s ease !important;
  overflow: hidden !important;
}
.sp-vcard:hover { box-shadow: 0 8px 28px rgba(0,0,0,0.1) !important; transform: translateY(-3px) !important; }

/* ── Template picker cards ─── */
.sp-tpl {
  border-radius: 14px !important;
  border: 2px solid transparent !important;
  cursor: pointer;
  transition: all 0.2s ease !important;
}
.sp-tpl:hover { transform: scale(1.03); box-shadow: 0 8px 24px rgba(0,0,0,0.15) !important; }
.sp-tpl.is-selected { border-color: var(--sp-accent) !important; }

/* ── Table: cleaner ─── */
.sp-table th {
  font-size: 10px !important;
  letter-spacing: 0.15em !important;
  font-weight: 700 !important;
}
.sp-table td { font-size: 13px !important; }
.sp-badge { border-radius: 6px !important; font-size: 10px !important; font-weight: 700 !important; letter-spacing: 0.1em !important; }

/* ── Page header: more refined ─── */
.sp-page-title { font-size: 24px !important; letter-spacing: -0.02em !important; font-weight: 700 !important; }
.sp-page-sub { font-size: 13px !important; }

/* ── Sidebar: polished ─── */
.sp-nav__item {
  border-radius: 10px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  transition: all 0.18s ease !important;
}


/* ============================================================
   MOBILE OPTIMISATION — v2.5.3
   Breakpoint: ≤768px = mobile, ≤1024px = tablet
   ============================================================ */

/* ── Fix remaining desktop font-size overrides ──────────── */
.sp-page-title          { font-size: 22px !important; font-weight: 700 !important; letter-spacing: -0.01em !important; }
.sp-page-sub            { font-size: 13px !important; }
.sp-breadcrumb          { font-size: 13px !important; }
.sp-stat__label         { font-size: 10px !important; letter-spacing: 0.12em !important; }
.sp-stat__value         { font-size: 22px !important; }
.sp-quick__title        { font-size: 13px !important; }
.sp-quick__sub          { font-size: 12px !important; }
.sp-quick__icon         { font-size: 22px !important; }
.sp-field label, .sp-label { font-size: 11px !important; letter-spacing: 0.1em !important; }
.sp-hint                { font-size: 12px !important; }
.sp-field-hint          { font-size: 12px !important; }
.sp-input, .sp-textarea, .sp-select { font-size: 14px !important; padding: 10px 12px !important; }
.sp-input--lg           { font-size: 16px !important; }
.sp-btn                 { font-size: 13px !important; padding: 9px 16px !important; }
.sp-btn--new-voucher    { font-size: 13px !important; }
.sp-btn--sm             { font-size: 12px !important; padding: 6px 10px !important; }
.sp-section__title      { font-size: 16px !important; }
.sp-link                { font-size: 13px !important; }
.sp-cat-pill__label     { font-size: 13px !important; }
.sp-select              { font-size: 13px !important; }
.sp-save-feedback       { font-size: 13px !important; }
.sp-toast               { font-size: 13px !important; }
.sp-sidebar__user-name  { font-size: 13px !important; }
.sp-sidebar__user-role  { font-size: 11px !important; }
.sp-sidebar__user-avatar { font-size: 13px !important; }
.sp-vcard__cat          { font-size: 10px !important; }
.sp-vcard__title        { font-size: 17px !important; }
.sp-vcard__price        { font-size: 14px !important; }
.sp-vcard__badge        { font-size: 10px !important; }
.sp-vcard__actions .sp-btn { font-size: 12px !important; padding: 6px 12px !important; }
.sp-tc-instructions     { font-size: 13px !important; }
.sp-code                { font-size: 13px !important; }
.sp-code--voucher       { font-size: 13px !important; }
.sp-empty h2            { font-size: 20px !important; }
.sp-empty p             { font-size: 13px !important; }
.sp-card__header h2, .sp-card__header h3 { font-size: 14px !important; font-weight: 600 !important; }

/* ── Portal top bar ─────────────────── */
.sp-mobile-topbar {
  display: flex;
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 56px;
  background: var(--sp-surface);
  border-bottom: 1px solid var(--sp-border);
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.05);
  grid-column: 1 / -1;
}
.sp-mobile-topbar__logo {
  font-family: var(--sp-serif);
  font-size: 16px;
  font-weight: 500;
  color: var(--sp-text);
  max-width: 55vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sp-hamburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #fff;
  border: 1px solid var(--sp-border);
  cursor: pointer;
  padding: 0;
  border-radius: 10px;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  color: var(--sp-text);
}
.sp-hamburger:hover {
  background: var(--sp-surface2);
  border-color: rgba(184,135,42,0.42);
  box-shadow: 0 8px 18px rgba(0,29,54,0.08);
}
.sp-dashboard-toggle__icon {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}
/* PATCH 2.8.9: fill the 4 squares so the icon reads clearly at 18–22px */
.sp-dashboard-toggle__icon rect {
  fill: currentColor;
  stroke: none;
}
.sp-hamburger__line {
  width: 22px;
  height: 2px;
  background: var(--sp-text);
  border-radius: 2px;
  transition: all 0.25s ease;
  display: block;
}
.sp-hamburger.is-open .sp-hamburger__line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.sp-hamburger.is-open .sp-hamburger__line:nth-child(2) { opacity: 0; transform: scaleX(0); }
.sp-hamburger.is-open .sp-hamburger__line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (min-width: 769px) {
  /* PATCH 2.8.9: topbar is mobile-only — hide it on desktop so it
     does not create a spurious extra grid row that breaks the layout */
  .sp-mobile-topbar {
    display: none !important;
  }
}

/* ── Sidebar overlay on mobile ──────────────────────────── */
.sp-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 998;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.sp-sidebar-overlay.is-visible { display: block; }

/* ── MAIN MOBILE BREAKPOINT (≤ 768px) ───────────────────── */
@media (max-width: 768px) {

  /* Layout: single column, push main below topbar */
  .sp-layout {
    grid-template-columns: 1fr;
    min-height: 100vh;
    padding-top: 0;
  }
  .sp-mobile-topbar {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1200;
  }
  .sp-hamburger {
    visibility: visible !important;
    pointer-events: auto !important;
  }

  /* Sidebar: slide-in drawer */
  .sp-sidebar {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    z-index: 1190;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
    padding-top: 0;
    height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sp-sidebar.is-open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0,0,0,0.18);
  }

  /* Main content: full width; the topbar already occupies its own grid row. */
  .sp-main {
    height: calc(100vh - 56px);
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sp-main__inner {
    padding: 20px 16px 100px;
    min-width: 0;
  }

  /* Page header: stack vertically */
  .sp-page-header {
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
  }
  .sp-header-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }
  .sp-header-actions .sp-btn,
  .sp-header-actions a,
  .sp-header-actions button {
    flex: 1;
    min-width: 0;
    justify-content: center;
    text-align: center;
    font-size: 12px !important;
    padding: 10px 12px !important;
  }
  .sp-page-title { font-size: 20px !important; }

  /* Stats: 2 columns */
  .sp-stats {
    grid-template-columns: repeat(2, 1fr) !important;
    margin-bottom: 20px;
  }
  .sp-stat { padding: 16px 14px; }
  .sp-stat__value { font-size: 18px !important; }

  /* Quick actions: 2 columns */
  .sp-quick-actions {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
    margin-bottom: 24px;
  }
  .sp-quick {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 14px 12px;
  }
  .sp-quick__icon { font-size: 20px !important; }
  .sp-quick__sub { display: none; }

  /* Voucher grid: single column */
  .sp-voucher-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  /* Template grid: 2 columns */
  .sp-template-grid,
  .sp-template-showcase {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Tables: horizontal scroll with fixed styling */
  .sp-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--sp-radius);
  }
  .sp-table { min-width: 560px !important; font-size: 12px !important; }
  .sp-table th { font-size: 10px !important; padding: 10px 10px !important; }
  .sp-table td { padding: 10px 10px !important; font-size: 12px !important; white-space: nowrap; }

  /* Editor: stack main + preview + sidebar vertically */
  .sp-editor--with-preview,
  .sp-editor {
    grid-template-columns: 1fr !important;
    gap: 16px;
    min-width: 0 !important;
  }
  .sp-editor__preview { display: none !important; } /* hide preview on mobile */
  .sp-editor__sidebar { min-width: 0; }

  /* Settings grid: single column */
  .sp-settings-grid { grid-template-columns: 1fr !important; gap: 12px; }

  /* Cards */
  .sp-card { border-radius: 10px; margin-bottom: 14px; }
  .sp-card__header { padding: 14px 16px; }
  .sp-card__body { padding: 14px 16px; }
  .sp-card__header h2 { font-size: 13px !important; }

  /* Forms: full width, bigger touch targets */
  .sp-input, .sp-textarea, .sp-select {
    font-size: 16px !important; /* prevents iOS auto-zoom */
    padding: 12px 14px !important;
    border-radius: 8px !important;
  }
  .sp-field label { font-size: 11px !important; margin-bottom: 6px !important; }
  .sp-field { margin-bottom: 16px; }

  /* Buttons: full tap target */
  .sp-btn { min-height: 44px; font-size: 13px !important; }
  .sp-btn--full { width: 100%; }

  /* Financial dashboard */
  .fin-grid { grid-template-columns: repeat(2,1fr) !important; gap: 10px; }
  .fin-card { padding: 14px 14px; }
  .fin-card__value { font-size: 18px; }
  .fin-bottom { grid-template-columns: 1fr !important; }
  .fin-export { padding: 18px 16px; }
  .fin-preset-row { gap: 6px; }
  .fin-preset { padding: 6px 12px; font-size: 11px; }
  .fin-range-row { flex-direction: column; gap: 10px; }
  .fin-range-row > div { width: 100%; }
  .fin-range-row input,
  .fin-range-row select { width: 100%; font-size: 16px !important; }
  .fin-dl-btn { width: 100%; justify-content: center; min-height: 48px; }

  /* Arrivals */
  .fin-panel { padding: 14px 14px; }

  /* Bookings table: hide less important columns via JS-free approach */
  /* Hide Notes column on mobile */

  /* Portal redeem */
  .sp-card__body .sp-btn { width: 100%; }

  /* Modals: full screen on mobile */
  .sp-tpl-preview-inner { max-width: 100% !important; border-radius: 16px 16px 0 0 !important; }
  .sp-tpl-preview-modal { padding: 0; align-items: flex-end !important; }

  /* Toast: bottom center on mobile */
  .sp-toast { left: 16px; right: 16px; bottom: 20px; max-width: none; text-align: center; }
}

/* 2.9.40 — voucher editor: stable preview/options layout after offers. */
body.sdgv-portal--dashboard .sp-main__inner {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
}
.sp-editor--with-preview {
  display: grid !important;
  width: 100% !important;
  min-width: 0 !important;
  grid-template-columns: minmax(440px, 1fr) minmax(260px, 330px) minmax(250px, 310px) !important;
  gap: clamp(16px, 2vw, 26px) !important;
  align-items: start !important;
}
.sp-editor--with-preview > :is(.sp-editor__main, .sp-editor__preview, .sp-editor__sidebar),
.sp-editor--with-preview .sp-card,
.sp-editor--with-preview .sp-preview-pane {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}
.sp-editor--with-preview .sp-editor__preview,
.sp-editor--with-preview .sp-editor__sidebar {
  position: sticky;
  top: 18px;
}
.sp-special-offer-editor {
  min-width: 0;
}
.sp-special-offer-editor__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.sp-special-offer-editor__fields .sp-field {
  min-width: 0;
  margin: 0 !important;
}
.sp-special-offer-editor__fields :is(input, select) {
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}
@media (max-width: 1240px) {
  .sp-editor-mobile-switch {
    position: sticky;
    top: 0;
    z-index: 38;
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 8px;
    margin: -4px 0 14px;
    border: 1px solid var(--sp-border);
    border-radius: 999px;
    background: color-mix(in srgb, var(--sp-surface) 94%, transparent);
    box-shadow: 0 10px 28px rgba(0,29,54,.08);
  }
  .sp-editor-mobile-switch button {
    min-height: 40px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--sp-text) !important;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
  }
  .sp-editor-mobile-switch button.is-active {
    background: var(--sp-accent);
    color: #fff !important;
  }
  .sp-editor--with-preview {
    display: block !important;
  }
  .sp-editor--with-preview > :is(.sp-editor__main, .sp-editor__preview, .sp-editor__sidebar) {
    display: none !important;
    position: static !important;
  }
  .sp-editor--with-preview[data-mobile-panel="edit"] > .sp-editor__main,
  .sp-editor--with-preview[data-mobile-panel="preview"] > .sp-editor__preview,
  .sp-editor--with-preview[data-mobile-panel="options"] > .sp-editor__sidebar {
    display: block !important;
  }
}

@media (max-width: 600px) {
  .sp-special-offer-editor__fields {
    grid-template-columns: minmax(0, 1fr);
  }
  .sp-editor--with-preview :is(input, textarea, select) {
    font-size: 16px !important;
  }
}

/* ── Tablet (769px–1024px) ───────────────────────────────── */
@media (min-width: 769px) and (max-width: 1024px) {
  :root { --sp-sidebar-w: 200px; }
  .sp-main__inner { padding: 28px 24px 60px; min-width: 400px; }
  .sp-stats { grid-template-columns: repeat(2,1fr) !important; }
  .sp-quick-actions { grid-template-columns: repeat(2,1fr) !important; }
  .sp-voucher-grid { grid-template-columns: repeat(2,1fr) !important; }
  .sp-editor--with-preview { grid-template-columns: 1fr 220px !important; }
  .sp-editor__preview { display: block !important; }
  .fin-grid { grid-template-columns: repeat(2,1fr) !important; }
  .fin-bottom { grid-template-columns: 1fr !important; }
  .sp-nav__item { font-size: 12px !important; padding: 9px 14px !important; }
}

/* ============================================================
   v2.5.8 — Mobile containment pass for portal screens
   ============================================================ */
@media (max-width: 768px) {
  html,
  body,
  .sdgv-portal,
  .sdgv-portal-body,
  .sp-layout,
  .sp-main,
  .sp-main__inner {
    width: 100% !important;
    max-width: 100% !important;
  }

  .sp-main {
    overflow-x: hidden !important;
  }

  .sp-main__inner,
  .sp-card,
  .sp-card__body,
  .sp-card__header,
  .sp-editor,
  .sp-settings-grid,
  .sp-page-header,
  .sp-header-actions,
  .sp-voucher-grid,
  .sp-template-grid,
  .sp-template-showcase,
  .sp-accounts-header,
  .sp-accounts-filters {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .sp-card,
  .sp-page-header,
  .sp-field,
  .sp-settings-grid > *,
  .sp-editor > *,
  .sp-accounts-header > *,
  .sp-accounts-filters > * {
    overflow-wrap: anywhere;
  }

  .sp-accounts-stats {
    grid-template-columns: 1fr !important;
  }

  .sp-accounts-search {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    font-size: 16px !important;
  }

  .sp-accounts-table,
  .sp-table {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  .sp-card__body table:not(.sp-table) {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sp-image-uploader,
  .sp-image-placeholder,
  .sp-preview-pane,
  .sp-preview-card,
  .sp-tpl,
  .sp-vcard {
    max-width: 100% !important;
  }

}

/* Voucher design picker */
.sp-design-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(0,29,54,0.52);
}
.sp-design-picker-modal.is-open {
  display: flex;
}
.sp-design-picker {
  width: min(1120px, 100%);
  max-height: min(780px, calc(100dvh - 56px));
  overflow: auto;
  border-radius: 18px;
  background: #f7f5f1;
  box-shadow: 0 32px 90px rgba(0,0,0,0.34);
  padding: 24px;
  position: relative;
}
.sp-design-picker__close {
  position: sticky;
  top: 0;
  float: right;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(0,29,54,0.12);
  border-radius: 999px;
  background: #fff;
  color: var(--sp-text) !important;
  font-size: 22px;
  line-height: 1;
}
.sp-design-picker__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 18px;
}
.sp-design-picker__head h3 {
  margin: 0;
  font-family: var(--sp-serif);
  font-size: 28px;
  font-weight: 600;
  color: var(--sp-text) !important;
}
.sp-design-picker__head p {
  margin: 4px 0 0;
  color: var(--sp-text-sub) !important;
  font-size: 13px;
}
.sp-design-picker__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.sp-design-option {
  display: grid;
  gap: 12px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  text-align: left;
  box-shadow: 0 8px 28px rgba(0,29,54,0.08);
}
.sp-design-option.is-selected {
  border-color: var(--sp-accent);
  box-shadow: 0 12px 34px rgba(184,135,42,0.18);
}
.sp-design-option__preview {
  display: block;
}
.sp-design-option__meta {
  display: block;
}
.sp-design-option__meta strong {
  display: block;
  font-size: 14px;
  color: var(--sp-text) !important;
}
.sp-design-option__meta small {
  display: block;
  margin-top: 3px;
  color: var(--sp-text-sub) !important;
  font-size: 12px;
  line-height: 1.45;
}
.sp-design-option__select {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 36px;
  border-radius: 999px;
  background: var(--sp-text);
  color: #fff !important;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.sp-design-option.is-selected .sp-design-option__select {
  background: var(--sp-accent);
}
@media (max-width: 768px) {
  .sp-design-picker-modal {
    padding: 10px;
    align-items: flex-end;
  }
  .sp-design-picker {
    max-height: calc(100dvh - 20px);
    border-radius: 18px 18px 0 0;
    padding: 18px;
  }
  .sp-design-picker__grid {
    grid-template-columns: 1fr;
  }
  .sp-design-picker__head h3 {
    font-size: 23px;
  }
}

/* v2.8.3 — Redeem Voucher portal workflow */
.sp-portal-redeem {
  width: min(100%, 760px);
  max-width: 760px;
}
@media (min-width: 1400px) {
  /* A wide desktop monitor still gets a readable single column (this is a
     linear 1-2-3 step form, not something that benefits from stretching
     edge-to-edge) but a little more breathing room than the 760px used on
     laptop-sized screens. */
  .sp-portal-redeem {
    width: min(100%, 900px);
    max-width: 900px;
  }
}
.sp-portal-redeem__intro {
  margin-bottom: 28px;
}
.sp-portal-redeem__lookup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}
.sp-portal-redeem__field {
  min-width: 0;
}
.sp-portal-redeem__label {
  display: block;
  margin-bottom: 8px;
  color: var(--sp-text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.25;
  text-transform: uppercase;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
}

.sp-qr-scanner {
  position: relative;
  width: min(100%, 560px);
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--sp-border);
  border-radius: 14px;
  background: #050505;
  color: #fff;
}
.sp-qr-scanner[hidden] { display: none !important; }
.sp-qr-scanner video { display: block; width: 100%; min-height: 280px; max-height: 60vh; object-fit: cover; }
.sp-qr-scanner__target { position: absolute; inset: 18% 15% 28%; border: 2px solid var(--sp-accent, #c9a84c); border-radius: 16px; box-shadow: 0 0 0 999px rgba(0,0,0,.34); pointer-events: none; }
.sp-qr-scanner p { position: relative; z-index: 2; margin: 0; padding: 12px 16px; background: rgba(0,0,0,.82); font-size: 12px; }
.sp-qr-scanner .sp-btn { position: absolute; z-index: 3; right: 12px; top: 12px; border-color: rgba(255,255,255,.55); background: rgba(0,0,0,.72); color: #fff !important; }
/* .sp-detail-grid ("2. Confirm the details") had never actually been given
   a grid — the <dl> and its <dt>/<dd> rows fell back to bare browser
   defaults (an indented dd, no column alignment), which is a large part of
   why this step read as unfinished on both desktop and mobile. */
.sp-detail-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}
#pr-voucher-body > div {
  min-width: 0;
  display: grid;
  grid-template-columns: 160px 1fr;
  column-gap: 16px;
  row-gap: 2px;
  align-items: baseline;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--sp-border);
}
#pr-voucher-body > div:last-child {
  padding-bottom: 0;
  border-bottom: none;
}
#pr-voucher-body dt {
  color: var(--sp-text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
#pr-voucher-body dd {
  margin: 0;
  color: var(--sp-text);
  font-size: 15px;
  font-weight: 600;
  word-break: break-word;
}
@media (min-width: 1400px) {
  #pr-voucher-body > div {
    grid-template-columns: 200px 1fr;
  }
}
@media (max-width: 768px) {
  .sp-portal-redeem {
    width: 100% !important;
    max-width: 100% !important;
  }
  .sp-portal-redeem__lookup {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
  .sp-portal-redeem__lookup .sp-btn,
  #pr-redeem-btn {
    width: 100% !important;
    min-height: 48px;
    justify-content: center;
  }
  #pr-voucher-body > div {
    grid-template-columns: 1fr !important;
    row-gap: 4px;
  }
  #pr-staff-name {
    max-width: 100% !important;
  }
  .sp-portal-redeem__label {
    letter-spacing: 0.08em !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
  }
}

@media (max-width: 420px) {
  .sp-mobile-topbar {
    padding: 0 12px;
  }
  .sp-mobile-topbar__logo {
    max-width: 48vw;
    font-size: 15px;
  }
  .sp-stats,
  .sp-quick-actions,
  .fin-grid {
    grid-template-columns: 1fr !important;
  }
  .sp-template-grid,
  .sp-template-showcase {
    grid-template-columns: 1fr !important;
  }
}

/* v2.6.0 — full mobile editor containment */
@media (max-width: 768px) {
  body.sdgv-portal-body {
    overflow-x: hidden !important;
  }

  .sp-main {
    width: 100vw !important;
    max-width: 100vw !important;
  }

  .sp-main__inner {
    width: 100% !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .sp-page-title,
  .sp-section__title,
  .sp-card__header h2,
  .sp-card__header h3,
  .sp-field label,
  .sp-label,
  .sp-field-hint,
  .sp-hint {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    max-width: 100% !important;
  }

  .sp-field label,
  .sp-label {
    display: block !important;
    line-height: 1.35 !important;
  }

  .sp-field-hint,
  .sp-hint {
    display: block !important;
    margin-top: 6px !important;
    line-height: 1.45 !important;
  }

  .sp-input,
  .sp-textarea,
  .sp-select,
  input[type="text"],
  input[type="url"],
  input[type="email"],
  input[type="number"],
  textarea,
  select {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .sp-editor--with-preview {
    display: block !important;
    width: 100% !important;
  }

  .sp-editor__main,
  .sp-editor__sidebar,
  .sp-editor__preview,
  .sp-card,
  .sp-card__body,
  .sp-card__header {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .sp-editor__sidebar {
    position: static !important;
  }

  .sp-card__body {
    overflow: hidden !important;
  }

  .sp-variant-row,
  .sp-cat-grid,
  .sp-pricing-grid,
  .sp-form-grid,
  .sp-grid,
  .sp-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .sp-upload-btn,
  .sp-image-change-btn,
  #sp-save-voucher,
  #sp-save-voucher-2,
  .sp-header-actions .sp-btn {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  .sp-image-uploader,
  .sp-image-placeholder {
    width: 100% !important;
  }
}

/* v2.6.2 — voucher image frame + preview button contrast */
#sp-image-zone {
  aspect-ratio: 3 / 2 !important;
  padding-top: 0 !important;
  height: auto !important;
  min-height: 260px !important;
  max-height: none !important;
  position: relative !important;
  background:
    linear-gradient(rgba(232,234,240,0.94), rgba(232,234,240,0.94)),
    repeating-linear-gradient(45deg, rgba(0,29,54,0.08) 0 10px, rgba(0,29,54,0.03) 10px 20px) !important;
}
#sp-image-zone::before {
  content: '3:2 gift-card image frame';
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 6;
  padding: 4px 9px;
  border-radius: 9999px;
  background: rgba(255,255,255,0.88);
  color: var(--sp-text);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  pointer-events: none;
}
#sp-image-zone > div,
#sp-image-zone #sp-image-preview,
#sp-image-zone #sp-image-placeholder {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
}
#sp-image-zone #sp-image-preview img,
#sp-image-zone .sp-image-preview img {
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: auto !important;
  object-fit: cover !important;
  display: block !important;
  position: relative !important;
}
#sp-image-zone .sp-image-safezone {
  top: 10% !important;
  left: 10% !important;
  width: 80% !important;
  height: 80% !important;
  max-height: none !important;
  border: 2px dashed rgba(255,255,255,0.82) !important;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.16) !important;
}
#sp-preview-select-btn,
.sp-preview-card__cta {
  min-width: 90px !important;
  background: var(--sdgv-btn-bg) !important;
  color: var(--sdgv-btn-text) !important;
  -webkit-text-fill-color: var(--sdgv-btn-text) !important;
  text-align: center !important;
  line-height: 1.2 !important;
}
#sp-preview-select-btn *,
.sp-preview-card__cta * {
  color: var(--sdgv-btn-text) !important;
  -webkit-text-fill-color: var(--sdgv-btn-text) !important;
}

/* v2.7.0 — settings media upload zones */
.ss-media-upload-zone {
  position: relative;
  min-height: 150px;
  border: 1.5px dashed var(--sp-border, #c8ccd8);
  border-radius: 12px;
  background: rgba(246,247,251,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.ss-media-upload-zone.is-dragover {
  border-color: var(--sp-accent, #b8872a);
  background: rgba(184,135,42,0.08);
  box-shadow: 0 12px 32px rgba(0,29,54,0.08);
}
.ss-media-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  color: var(--sp-text-sub, #667085);
  padding: 20px;
}
.ss-media-upload-placeholder strong {
  color: var(--sp-text, #001d36);
  font-size: 14px;
}
.ss-media-upload-placeholder span {
  font-size: 12px;
}
.ss-media-upload-preview {
  width: 100%;
  height: 100%;
  min-height: 150px;
}
.ss-media-upload-preview img,
.ss-media-upload-preview video {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}
.ss-media-upload-progress {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  height: 6px;
  border-radius: 999px;
  background: rgba(0,29,54,0.14);
  overflow: hidden;
}
.ss-media-upload-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--sp-accent, #b8872a);
  transition: width .18s ease;
}

/* v2.8.8 portal UX fixes: navigation, persistent save, flexible editor */
.sp-layout {
  transition: grid-template-columns 0.22s ease;
}
.sp-sidebar-collapse {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border: 1px solid var(--sp-border);
  border-radius: 999px;
  background: #fff;
  color: var(--sp-text) !important;
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,29,54,0.08);
  padding: 0;
}
.sp-sidebar-expand {
  position: fixed;
  left: 14px;
  top: 78px;
  z-index: 1100;
  width: 38px;
  height: 38px;
  border: 1px solid var(--sp-border);
  border-radius: 999px;
  background: #fff;
  color: var(--sp-text) !important;
  font-size: 24px;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 28px rgba(0,29,54,0.14);
  padding: 0;
}
body.sp-sidebar-collapsed .sp-sidebar-expand {
  display: inline-flex;
}
body.sp-sidebar-collapsed .sp-layout {
  grid-template-columns: 0 1fr;
}
body.sp-sidebar-collapsed .sp-sidebar {
  transform: translateX(-100%);
  pointer-events: none;
  overflow: hidden;
}
body.sp-sidebar-collapsed .sp-main__inner {
  max-width: 1480px;
}
.sp-main__inner {
  min-width: 0 !important;
}
.sp-settings-jump {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0 18px;
  margin: -8px 0 14px;
  background: linear-gradient(180deg, var(--sp-bg) 0%, rgba(244,245,247,0.92) 78%, rgba(244,245,247,0) 100%);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.sp-settings-jump::-webkit-scrollbar {
  display: none;
}
.sp-settings-jump button {
  flex: 0 0 auto;
  border: 1px solid rgba(0,29,54,0.12);
  border-radius: 999px;
  background: #fff;
  color: var(--sp-text) !important;
  padding: 9px 14px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 6px 18px rgba(0,29,54,0.06);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.sp-settings-jump button:hover {
  transform: translateY(-2px);
  border-color: var(--sp-accent);
  background: #fff8ee;
}
.sp-settings-floating-save {
  position: fixed;
  right: 26px;
  bottom: 24px;
  z-index: 90;
  border: 0;
  border-radius: 999px;
  background: var(--sp-accent);
  color: #fff !important;
  min-height: 48px;
  padding: 0 24px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 18px 40px rgba(184,135,42,0.34);
}
.sp-editor-mobile-switch {
  display: none;
}
.sp-editor--with-preview {
  min-width: 0 !important;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 300px) minmax(190px, 220px) !important;
}
.sp-editor__main,
.sp-editor__preview,
.sp-editor__sidebar {
  min-width: 0;
}
@media (max-width: 1180px) {
  .sp-editor--with-preview {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 280px) !important;
  }
  .sp-editor__sidebar {
    grid-column: 1 / -1;
  }
}
@media (max-width: 768px) {
  .sp-sidebar-collapse {
    display: none;
  }
  .sp-sidebar-expand {
    display: none !important;
  }
  body.sp-sidebar-collapsed .sp-layout {
    grid-template-columns: 1fr;
  }
  body.sp-sidebar-collapsed .sp-sidebar {
    transform: translateX(-100%);
  }
  .sp-settings-floating-save {
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    min-height: 46px;
    padding: 0 18px;
    font-size: 11px;
  }
  .sp-settings-jump {
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
  }
  .sp-editor-mobile-switch {
    position: sticky;
    top: 0;
    z-index: 38;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 8px;
    margin: -4px 0 14px;
    border: 1px solid var(--sp-border);
    border-radius: 999px;
    background: rgba(255,255,255,0.94);
    box-shadow: 0 10px 28px rgba(0,29,54,0.08);
  }
  .sp-editor-mobile-switch button {
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--sp-text) !important;
    min-height: 38px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .sp-editor-mobile-switch button.is-active {
    background: var(--sp-accent);
    color: #fff !important;
  }
  .sp-editor--with-preview {
    display: block !important;
    width: 100% !important;
  }
  .sp-editor--with-preview .sp-editor__main,
  .sp-editor--with-preview .sp-editor__preview,
  .sp-editor--with-preview .sp-editor__sidebar {
    display: none !important;
    width: 100% !important;
  }
  .sp-editor--with-preview[data-mobile-panel="edit"] .sp-editor__main,
  .sp-editor--with-preview[data-mobile-panel="preview"] .sp-editor__preview,
  .sp-editor--with-preview[data-mobile-panel="options"] .sp-editor__sidebar {
    display: block !important;
  }
  .sp-editor--with-preview[data-mobile-panel="preview"] .sp-preview-pane {
    position: static !important;
    margin-bottom: 16px;
  }
}


/* ── v2.8.9: check-for-updates spinner ──────────────────────── */
@keyframes sdgvSpin {
  from { transform: rotate(0deg);   }
  to   { transform: rotate(360deg); }
}

/* ── v2.9.1: notification panel on mobile — pop up from sidebar bottom ─ */
@media (max-width: 768px) {
  .sp-notification-panel {
    bottom: 64px !important;
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
  }
}

/* v2.9.5.7 — Template browser readability.
   Keep portal UI labels readable without flattening the rendered voucher artwork.
   Colours are driven by storefront-inherited CSS variables. */
.sp-template-showcase,
.sp-design-picker,
.sp-design-picker-modal {
  color: var(--sp-text) !important;
  -webkit-text-fill-color: var(--sp-text);
}
.sp-template-showcase .sp-tpl-card,
.sp-template-showcase .sp-tpl-card__info,
.sp-design-picker .sp-design-option,
.sp-design-picker .sp-design-option__meta {
  background-color: var(--sp-surface) !important;
  color: var(--sp-text) !important;
  -webkit-text-fill-color: var(--sp-text);
}
.sp-template-showcase .sp-tpl-card__info h3,
.sp-template-showcase .sp-tpl-card__info h3 *,
.sp-design-picker .sp-design-picker__head h3,
.sp-design-picker .sp-design-picker__head h3 *,
.sp-design-picker .sp-design-option__meta strong,
.sp-design-picker .sp-design-option__meta strong * {
  color: var(--sp-text) !important;
  -webkit-text-fill-color: var(--sp-text) !important;
  opacity: 1 !important;
  visibility: visible !important;
}
.sp-template-showcase .sp-tpl-card__info p,
.sp-template-showcase .sp-tpl-card__info p *,
.sp-design-picker .sp-design-picker__head p,
.sp-design-picker .sp-design-picker__head p *,
.sp-design-picker .sp-design-option__meta small,
.sp-design-picker .sp-design-option__meta small * {
  color: var(--sp-text-sub) !important;
  -webkit-text-fill-color: var(--sp-text-sub) !important;
  opacity: 1 !important;
  visibility: visible !important;
}
.sp-design-picker .sp-design-option__select,
.sp-design-picker .sp-design-option__select *,
.sp-template-showcase .sp-btn,
.sp-template-showcase .sp-btn * {
  color: var(--sdgv-btn-text) !important;
  -webkit-text-fill-color: var(--sdgv-btn-text) !important;
  opacity: 1 !important;
  visibility: visible !important;
}
.sp-design-picker .sp-design-option.is-selected .sp-design-option__select,
.sp-design-picker .sp-design-option.is-selected .sp-design-option__select * {
  color: var(--sdgv-btn-text) !important;
  -webkit-text-fill-color: var(--sdgv-btn-text) !important;
}
.sp-design-picker .sdgv-vora-card,
.sp-design-picker .sdgv-vora-card *,
.sp-template-showcase .sdgv-vora-card,
.sp-template-showcase .sdgv-vora-card * {
  -webkit-text-fill-color: currentColor;
  opacity: 1;
}

/* v2.9.5.10 — Portal polish: brand buttons via storefront vars, image focus, template contrast.
   Removed forced-navy selectors: sp-btn--new-voucher, sp-ptab, sp-design-option__select,
   sp-template-showcase .sp-btn — they inherit brand vars via .sp-btn / their own rules. */
.sp-btn,
.sp-btn--primary,
.sp-btn--secondary,
.sp-settings-jump button,
.sp-settings-floating-save,
.sp-upload-btn,
.sp-card button:not(.sp-design-picker__close):not(.sp-image-focus-dot),
.sp-header-actions a,
.sp-header-actions button {
  background: var(--sdgv-btn-bg) !important;
  border-color: var(--sdgv-btn-bg) !important;
  color: var(--sdgv-btn-text) !important;
  -webkit-text-fill-color: var(--sdgv-btn-text) !important;
}
.sp-btn--ghost {
  background: transparent !important;
  color: var(--sp-text-muted) !important;
  -webkit-text-fill-color: var(--sp-text-muted) !important;
}
.sp-btn--outline {
  background: var(--sp-surface) !important;
  color: var(--sp-text) !important;
  -webkit-text-fill-color: var(--sp-text) !important;
  border: 1px solid var(--sp-border) !important;
}
.sp-btn:hover,
.sp-settings-jump button:hover,
.sp-header-actions a:hover,
.sp-header-actions button:hover {
  background: var(--sdgv-hover-bg, var(--sdgv-btn-bg)) !important;
  border-color: var(--sdgv-hover-bg, var(--sdgv-btn-bg)) !important;
  color: var(--sdgv-hover-text, var(--sdgv-btn-text)) !important;
  -webkit-text-fill-color: var(--sdgv-hover-text, var(--sdgv-btn-text)) !important;
  transform: translateY(-1px);
}
.sp-ptab.is-active {
  background: var(--sp-accent) !important;
  border-color: var(--sp-accent) !important;
  color: var(--sdgv-btn-text) !important;
}
.sp-design-picker__close,
.sp-design-picker__close *,
.sp-image-focus-dot,
.sp-image-focus-dot * {
  -webkit-text-fill-color: currentColor !important;
}
.sp-image-focus-tools {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(0,29,54,0.12);
  border-radius: 12px;
  background: #f8f9ff;
}
.sp-image-focus-tools span {
  color: #3a4455 !important;
  font-size: 12px;
  line-height: 1.45;
}
.sp-image-focus-dot {
  position: absolute;
  z-index: 5;
  width: 28px;
  height: 28px;
  padding: 0 !important;
  border: 2px solid #ffffff !important;
  border-radius: 999px !important;
  background: var(--sdgv-btn-bg) !important;
  box-shadow: 0 0 0 6px rgba(0,29,54,0.16), 0 8px 20px rgba(0,0,0,0.28) !important;
  cursor: grab !important;
  transform: translate(-50%, -50%);
}
.sp-image-focus-dot::before,
.sp-image-focus-dot::after {
  content: "";
  position: absolute;
  background: #ffffff;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.sp-image-focus-dot::before { width: 12px; height: 2px; }
.sp-image-focus-dot::after { width: 2px; height: 12px; }
.sp-image-focus-dot:active { cursor: grabbing !important; }
.sp-inline-create {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.sp-chatbot-prev-card strong,
.sp-chatbot-prev-card span {
  color: inherit !important;
  -webkit-text-fill-color: currentColor !important;
}
/* Template preview cards — keep visibility but do NOT force text colour.
   The rendered voucher template sets its own text colours per template. */
.sp-design-picker .sdgv-vora-card--preview-dark,
.sp-template-showcase .sdgv-vora-card--preview-dark,
.sp-design-picker .sdgv-vora-card--preview-dark *,
.sp-template-showcase .sdgv-vora-card--preview-dark *,
.sp-design-picker .sdgv-vora-card--preview-light,
.sp-template-showcase .sdgv-vora-card--preview-light,
.sp-design-picker .sdgv-vora-card--preview-light *,
.sp-template-showcase .sdgv-vora-card--preview-light * {
  opacity: 1 !important;
  visibility: visible !important;
  -webkit-text-fill-color: currentColor !important;
}
.sp-design-picker .sdgv-vora-card__overlay,
.sp-template-showcase .sdgv-vora-card__overlay {
  -webkit-text-fill-color: initial !important;
}
@media (max-width: 640px) {
  .sp-inline-create {
    grid-template-columns: 1fr;
  }
  .sp-image-focus-tools {
    align-items: stretch;
    flex-direction: column;
  }
}

/* v2.9.5.10 — Settings polish. */
.fin-dl-btn,
.fin-dl-btn * {
  background-color: var(--sdgv-btn-bg) !important;
  border-color: var(--sdgv-btn-bg) !important;
  color: var(--sdgv-btn-text) !important;
  -webkit-text-fill-color: var(--sdgv-btn-text) !important;
}
.sp-mobile-voucher-settings {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: 22px;
  align-items: stretch;
}
.sp-mobile-voucher-settings__fields {
  display: grid;
  gap: 14px;
  align-content: start;
}
.sp-mobile-voucher-preview {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(0,29,54,0.12);
  border-radius: 18px;
  background: #f8f9ff;
}
.sp-mobile-voucher-preview__phone {
  width: 168px;
  min-height: 300px;
  padding: 10px;
  border-radius: 30px;
  background: #101317;
  box-shadow: 0 22px 46px rgba(0,29,54,0.16);
}
.sp-mobile-voucher-preview__screen {
  overflow: hidden;
  min-height: 280px;
  border-radius: 22px;
  background: #050505;
  color: #ffffff;
  display: flex;
  flex-direction: column;
}
.sp-mobile-voucher-preview[data-theme="light"] .sp-mobile-voucher-preview__screen {
  background: #f4f1eb;
  color: #001d36;
}
.sp-mobile-voucher-preview[data-theme="brand"] .sp-mobile-voucher-preview__screen {
  background: linear-gradient(135deg, #b8872a, #093f4f 35%, #f2c1c8 70%, #11351f);
  color: #ffffff;
}
.sp-mobile-voucher-preview[data-layout="contained"] .sp-mobile-voucher-preview__screen {
  margin: 18px 8px;
  min-height: 232px;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}
.sp-mobile-voucher-preview__image {
  height: 92px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.3), rgba(255,255,255,0)),
    linear-gradient(120deg, #d8b35f, #6d5df4 52%, #001d36);
}
.sp-mobile-voucher-preview__content {
  display: grid;
  gap: 8px;
  padding: 18px;
  color: inherit;
}
.sp-mobile-voucher-preview__content span,
.sp-mobile-voucher-preview__content small {
  color: inherit !important;
  -webkit-text-fill-color: currentColor !important;
  opacity: 0.74;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.sp-mobile-voucher-preview__content strong {
  color: inherit !important;
  -webkit-text-fill-color: currentColor !important;
  font-family: Georgia, serif;
  font-size: 22px;
  line-height: 1.05;
}
.sp-mobile-voucher-preview__content em {
  justify-self: start;
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  color: inherit !important;
  -webkit-text-fill-color: currentColor !important;
  font-style: normal;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}
.sp-mobile-voucher-preview p {
  margin: 0;
  color: #6b7280 !important;
  -webkit-text-fill-color: #6b7280 !important;
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}
.sp-app-icon-panel {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
}
.sp-app-icon-panel__preview {
  display: grid;
  place-items: center;
  min-height: 210px;
  border: 1px solid rgba(0,29,54,0.12);
  border-radius: 18px;
  background: #f8f9ff;
}
.sp-app-icon-panel__phone {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 14px;
  border-radius: 22px;
  background: #17191d;
  box-shadow: 0 20px 42px rgba(0,29,54,0.18);
}
.sp-app-icon-panel__icon {
  width: 74px;
  height: 74px;
  overflow: hidden;
  border-radius: 18px;
  background: var(--sdgv-btn-bg);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1), 0 8px 18px rgba(0,0,0,0.28);
}
.sp-app-icon-panel__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sp-app-icon-panel__phone span {
  max-width: 82px;
  overflow: hidden;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-size: 10px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sp-app-icon-panel__fields {
  display: grid;
  gap: 12px;
  align-content: start;
}
.sp-app-icon-panel__guide {
  padding: 12px 14px;
  border: 1px solid rgba(0,29,54,0.1);
  border-radius: 12px;
  background: #fff;
}
.sp-app-icon-panel__guide p {
  margin: 0;
  color: #3a4455 !important;
  -webkit-text-fill-color: #3a4455 !important;
  font-size: 11px;
  line-height: 1.7;
}
@media (max-width: 760px) {
  .sp-mobile-voucher-settings,
  .sp-app-icon-panel {
    grid-template-columns: 1fr;
  }
  .sp-service-row {
    grid-template-columns: 1fr !important;
  }
  .sp-service-row .sp-btn--icon {
    width: 100%;
  }
}

/* ══ v2.9.5.18 — Floating sticky save + hover hardening ══════════════════ */

/* Floating save button — always-visible bottom-right on edit-voucher */
.sp-float-save-wrap {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
}
.sp-float-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  background: var(--sp-accent);
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border: none;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(184,135,42,0.45), 0 2px 8px rgba(0,0,0,0.18);
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  white-space: nowrap;
  text-decoration: none;
}
.sp-float-save-btn svg {
  flex-shrink: 0;
  stroke: #ffffff;
}
.sp-float-save-btn:hover {
  background: #9a6f22 !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(184,135,42,0.55), 0 2px 8px rgba(0,0,0,0.2) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
.sp-float-save-btn:active {
  transform: translateY(0);
}
.sp-float-save-btn:disabled {
  opacity: 0.65;
  pointer-events: none;
}
@media (max-width: 760px) {
  .sp-float-save-wrap { bottom: 16px; right: 16px; }
  .sp-float-save-btn { padding: 11px 18px; font-size: 13px; }
}

/* Single-service pill on voucher page — shown via sdgv-public.css companion rule */
.sdgv-sv__single-service-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(184,135,42,0.1);
  border: 1px solid rgba(184,135,42,0.4);
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--vora-tertiary, #b8872a);
}
.sdgv-sv__single-service-pill svg {
  stroke: var(--vora-tertiary, #b8872a);
  flex-shrink: 0;
}

/* ── Button hover hardening — drive from storefront vars ─── */
/* Ensures ALL portal button variants stay readable on hover */
.sp-btn--outline {
  background: var(--sp-surface) !important;
  border-color: var(--sp-border) !important;
  color: var(--sp-text) !important;
  -webkit-text-fill-color: var(--sp-text) !important;
}
.sp-btn--ghost {
  background: transparent !important;
  color: var(--sp-text-muted) !important;
  -webkit-text-fill-color: var(--sp-text-muted) !important;
}
.sp-btn--secondary {
  background: var(--sdgv-btn-bg) !important;
  border-color: var(--sdgv-btn-bg) !important;
  color: var(--sdgv-btn-text) !important;
  -webkit-text-fill-color: var(--sdgv-btn-text) !important;
}
.sp-btn--outline:hover,
.sp-btn--ghost:hover,
.sp-btn--secondary:hover {
  background: var(--sdgv-hover-bg, var(--sdgv-btn-bg)) !important;
  border-color: var(--sdgv-hover-bg, var(--sdgv-btn-bg)) !important;
  color: var(--sdgv-hover-text, var(--sdgv-btn-text)) !important;
  -webkit-text-fill-color: var(--sdgv-hover-text, var(--sdgv-btn-text)) !important;
  transform: translateY(-1px);
}
/* "Add Category" / "New Voucher" buttons use the storefront primary button palette. */
.sp-btn--new-voucher,
.sp-btn--new-voucher:hover {
  background: var(--sdgv-btn-bg) !important;
  border-color: var(--sdgv-btn-bg) !important;
  color: var(--sdgv-btn-text) !important;
  -webkit-text-fill-color: var(--sdgv-btn-text) !important;
}

/* v2.9.7.5 - Portal experience refresh, visual only */
body.sdgv-portal-body {
  --sp-surface2: color-mix(in srgb, var(--sp-bg, #fbfaf7) 82%, #eef1f6 18%) !important;
  --sp-focus: color-mix(in srgb, var(--sp-accent, #b8872a) 22%, transparent) !important;
  --sp-panel-shadow: 0 14px 34px rgba(0,29,54,.08), 0 1px 0 rgba(255,255,255,.74) inset !important;
  --sp-control-shadow: 0 1px 2px rgba(0,29,54,.05) !important;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--sp-bg, #fbfaf7) 92%, #ffffff 8%) 0, var(--sp-surface2, #f4f5f7) 440px),
    var(--sp-surface2, #f4f5f7) !important;
}
body.sdgv-portal-body .sp-layout {
  background: transparent !important;
}
body.sdgv-portal-body .sp-sidebar {
  width: var(--sp-sidebar-w);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--sp-surface, #fff) 96%, var(--sp-accent, #b8872a) 4%), var(--sp-surface, #fff)) !important;
  border-right: 1px solid color-mix(in srgb, var(--sp-border, #e7dfd2) 72%, var(--sp-text, #001d36) 8%) !important;
  box-shadow: 8px 0 24px rgba(0,29,54,.035);
}
body.sdgv-portal-body .sp-sidebar__brand {
  min-height: 88px;
  padding: 22px 18px 18px !important;
}
body.sdgv-portal-body .sp-sidebar__logo {
  max-height: 40px;
}
body.sdgv-portal-body .sp-sidebar__brandname {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: .03em;
}
body.sdgv-portal-body .sp-sidebar__tag {
  color: color-mix(in srgb, var(--sp-text, #001d36) 48%, transparent) !important;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
}
body.sdgv-portal-body .sp-sidebar__user {
  margin: 14px 16px 10px;
  border: 1px solid color-mix(in srgb, var(--sp-border, #e7dfd2) 70%, var(--sp-accent, #b8872a) 20%) !important;
  border-radius: 8px !important;
  background: color-mix(in srgb, var(--sp-surface, #fff) 88%, var(--sp-accent, #b8872a) 7%) !important;
}
body.sdgv-portal-body .sp-nav {
  display: grid;
  gap: 3px;
  padding: 10px 10px 14px;
}
body.sdgv-portal-body .sp-nav__item {
  min-height: 42px;
  gap: 10px !important;
  padding: 10px 12px !important;
  border: 1px solid transparent !important;
  border-left: 0 !important;
  border-radius: 8px !important;
  color: var(--sp-text-sub, #3a4455) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.2;
}
body.sdgv-portal-body .sp-nav__item svg {
  display: block !important;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  stroke: currentColor !important;
}
body.sdgv-portal-body .sp-nav__label {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.sdgv-portal-body .sp-nav__item:hover {
  background: color-mix(in srgb, var(--sp-accent, #b8872a) 9%, #ffffff 91%) !important;
  border-color: color-mix(in srgb, var(--sp-accent, #b8872a) 18%, transparent) !important;
  color: var(--sp-text, #001d36) !important;
}
body.sdgv-portal-body .sp-nav__item.is-active {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--sp-accent, #b8872a) 16%, transparent), transparent 82%),
    color-mix(in srgb, var(--sp-accent, #b8872a) 10%, #ffffff 90%) !important;
  border-color: color-mix(in srgb, var(--sp-accent, #b8872a) 32%, transparent) !important;
  color: var(--sp-text, #001d36) !important;
  box-shadow: inset 3px 0 0 var(--sp-accent, #b8872a);
}
body.sdgv-portal-body .sp-nav-group {
  margin: 8px 0 4px;
}
body.sdgv-portal-body .sp-nav-group summary {
  padding: 8px 12px;
  color: color-mix(in srgb, var(--sp-text, #001d36) 52%, transparent) !important;
  font-size: 10px;
  font-weight: 900;
}
body.sdgv-portal-body .sp-nav-group .sp-nav__item {
  margin-left: 8px;
  padding-left: 14px !important;
}
body.sdgv-portal-body .sp-sidebar__footer {
  gap: 9px;
  padding: 14px 16px 18px !important;
}
body.sdgv-portal-body .sp-sidebar__viewstore,
body.sdgv-portal-body .sp-logout,
body.sdgv-portal-body .sp-notification-btn {
  min-height: 38px;
  padding: 8px 10px !important;
  border-radius: 8px;
}
body.sdgv-portal-body .sp-sidebar__viewstore svg,
body.sdgv-portal-body .sp-logout svg {
  display: block !important;
  flex: 0 0 14px;
}
body.sdgv-portal-body .sp-main {
  background: transparent !important;
}
body.sdgv-portal-body .sp-main__inner {
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 34px clamp(24px, 3vw, 46px) 92px;
}
body.sdgv-portal-body .sp-page-header {
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid color-mix(in srgb, var(--sp-border, #e7dfd2) 76%, transparent);
}
body.sdgv-portal-body .sp-page-title {
  color: var(--sp-text, #001d36) !important;
  font-family: var(--sp-sans, system-ui, sans-serif) !important;
  font-size: clamp(24px, 2vw, 32px) !important;
  font-weight: 850 !important;
  letter-spacing: 0 !important;
}
body.sdgv-portal-body .sp-page-sub,
body.sdgv-portal-body .sp-breadcrumb {
  color: color-mix(in srgb, var(--sp-text, #001d36) 56%, transparent) !important;
  font-size: 13px !important;
}
body.sdgv-portal-body .sp-header-actions {
  gap: 8px;
}
body.sdgv-portal-body .sp-stats {
  gap: 12px;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
}
body.sdgv-portal-body .sp-stat {
  min-height: 116px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--sp-border, #e7dfd2) 82%, var(--sp-text, #001d36) 5%) !important;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,255,255,.38)),
    var(--sp-surface, #fff) !important;
  box-shadow: var(--sp-control-shadow);
}
body.sdgv-portal-body .sp-stat__label {
  color: color-mix(in srgb, var(--sp-text, #001d36) 50%, transparent) !important;
  font-size: 10px !important;
  font-weight: 900;
}
body.sdgv-portal-body .sp-stat__value {
  color: var(--sp-text, #001d36) !important;
  font-family: var(--sp-sans, system-ui, sans-serif);
  font-size: 28px !important;
  font-weight: 850;
  letter-spacing: 0;
}
body.sdgv-portal-body .sp-quick-actions {
  gap: 12px;
}
body.sdgv-portal-body .sp-quick {
  min-height: 86px;
  border-radius: 8px !important;
  background: var(--sp-surface, #fff) !important;
  box-shadow: var(--sp-control-shadow);
}
body.sdgv-portal-body .sp-quick:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0,29,54,.08);
}
body.sdgv-portal-body .sp-card,
body.sdgv-portal-body .sp-vcard,
body.sdgv-portal-body .sp-tpl-card,
body.sdgv-portal-body .sp-preview-pane,
body.sdgv-portal-body .fin-panel,
body.sdgv-portal-body .fin-card {
  border: 1px solid color-mix(in srgb, var(--sp-border, #e7dfd2) 82%, var(--sp-text, #001d36) 5%) !important;
  border-radius: 8px !important;
  background: var(--sp-surface, #fff) !important;
  box-shadow: var(--sp-panel-shadow) !important;
}
body.sdgv-portal-body .sp-card:hover,
body.sdgv-portal-body .sp-vcard:hover {
  box-shadow: 0 18px 38px rgba(0,29,54,.1) !important;
}
body.sdgv-portal-body .sp-card__header {
  min-height: 58px;
  padding: 16px 20px !important;
  background: color-mix(in srgb, var(--sp-surface, #fff) 96%, var(--sp-accent, #b8872a) 4%) !important;
}
body.sdgv-portal-body .sp-card__header h2,
body.sdgv-portal-body .sp-card__header h3 {
  font-family: var(--sp-sans, system-ui, sans-serif) !important;
  font-size: 14px !important;
  font-weight: 850 !important;
  letter-spacing: .02em !important;
}
body.sdgv-portal-body .sp-card__body {
  padding: 20px !important;
}
body.sdgv-portal-body .sp-field {
  margin-bottom: 18px;
}
body.sdgv-portal-body .sp-field label,
body.sdgv-portal-body .sp-label {
  margin-bottom: 7px;
  color: color-mix(in srgb, var(--sp-text, #001d36) 88%, #000 12%) !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  letter-spacing: .11em !important;
}
body.sdgv-portal-body .sp-field-hint,
body.sdgv-portal-body .sp-hint {
  color: color-mix(in srgb, var(--sp-text, #001d36) 48%, transparent) !important;
  font-size: 12px !important;
}
body.sdgv-portal-body .sp-input,
body.sdgv-portal-body .sp-textarea,
body.sdgv-portal-body .sp-select,
body.sdgv-portal-body input[type="text"],
body.sdgv-portal-body input[type="url"],
body.sdgv-portal-body input[type="email"],
body.sdgv-portal-body input[type="number"],
body.sdgv-portal-body textarea,
body.sdgv-portal-body select {
  min-height: 42px;
  border: 1px solid color-mix(in srgb, var(--sp-border, #e7dfd2) 82%, var(--sp-text, #001d36) 8%) !important;
  border-radius: 8px !important;
  background: color-mix(in srgb, var(--sp-surface, #fff) 92%, var(--sp-bg, #fbfaf7) 8%) !important;
  box-shadow: var(--sp-control-shadow);
  color: var(--sp-text, #001d36) !important;
  font-size: 14px !important;
}
body.sdgv-portal-body .sp-input:focus,
body.sdgv-portal-body .sp-textarea:focus,
body.sdgv-portal-body .sp-select:focus,
body.sdgv-portal-body input:focus,
body.sdgv-portal-body textarea:focus,
body.sdgv-portal-body select:focus {
  border-color: var(--sp-accent, #b8872a) !important;
  box-shadow: 0 0 0 3px var(--sp-focus), var(--sp-control-shadow) !important;
}
body.sdgv-portal-body .sp-btn,
body.sdgv-portal-body .sp-upload-btn,
body.sdgv-portal-body .sp-float-save-btn {
  min-height: 42px;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 850 !important;
  letter-spacing: .03em !important;
  box-shadow: 0 8px 18px rgba(0,29,54,.08);
}
body.sdgv-portal-body .sp-btn:hover,
body.sdgv-portal-body .sp-upload-btn:hover,
body.sdgv-portal-body .sp-float-save-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0,29,54,.11) !important;
}
body.sdgv-portal-body .sp-btn--outline,
body.sdgv-portal-body .sp-btn--ghost {
  box-shadow: none;
}
body.sdgv-portal-body .sp-table-wrap {
  border-radius: 8px;
  background: var(--sp-surface, #fff);
  box-shadow: var(--sp-panel-shadow);
}
body.sdgv-portal-body .sp-table th {
  background: color-mix(in srgb, var(--sp-surface, #fff) 92%, var(--sp-bg, #fbfaf7) 8%) !important;
  color: color-mix(in srgb, var(--sp-text, #001d36) 54%, transparent) !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  letter-spacing: .13em !important;
}
body.sdgv-portal-body .sp-table td {
  background: #ffffff;
  font-size: 13px !important;
  vertical-align: middle;
}
body.sdgv-portal-body .sp-table tr:hover td {
  background: color-mix(in srgb, var(--sp-accent, #b8872a) 6%, #ffffff 94%) !important;
}
body.sdgv-portal-body .sp-badge {
  border-radius: 999px !important;
  padding: 4px 9px;
}
body.sdgv-portal-body .sp-voucher-grid,
body.sdgv-portal-body .sp-template-grid,
body.sdgv-portal-body .sp-template-showcase {
  gap: 14px;
}
body.sdgv-portal-body .sp-vcard {
  overflow: hidden;
}
body.sdgv-portal-body .sp-vcard__body,
body.sdgv-portal-body .sp-vcard__actions {
  background: var(--sp-surface, #fff) !important;
}
body.sdgv-portal-body .sp-vcard__title {
  font-size: 20px !important;
}
body.sdgv-portal-body .sp-vcard__actions {
  gap: 8px;
}
body.sdgv-portal-body .sp-image-placeholder {
  border-radius: 8px !important;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--sp-accent, #b8872a) 8%, transparent), transparent),
    color-mix(in srgb, var(--sp-surface, #fff) 86%, var(--sp-bg, #fbfaf7) 14%) !important;
}
body.sdgv-portal-body .sp-cat-pill__label,
body.sdgv-portal-body .sp-ptab {
  border-radius: 8px !important;
}
body.sdgv-portal-body .sp-toast,
body.sdgv-portal-body .sp-notification-panel,
body.sdgv-portal-body .sp-design-picker {
  border-radius: 8px !important;
  box-shadow: 0 24px 70px rgba(0,29,54,.18) !important;
}
body.sdgv-portal-body.sdgv-portal--login .sp-login {
  background: var(--sp-surface2, #f4f5f7);
}
body.sdgv-portal-body.sdgv-portal--login .sp-login__panel {
  border-right-color: color-mix(in srgb, var(--sp-border, #e7dfd2) 82%, var(--sp-text, #001d36) 8%) !important;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--sp-surface, #fff) 96%, var(--sp-accent, #b8872a) 4%), var(--sp-surface, #fff)) !important;
}
body.sdgv-portal-body.sdgv-portal--login .sp-login__panel,
body.sdgv-portal-body.sdgv-portal--login .sp-login__panel * {
  color: var(--sp-text, #001d36) !important;
  -webkit-text-fill-color: currentColor !important;
}
body.sdgv-portal-body.sdgv-portal--login .sp-login__hint,
body.sdgv-portal-body.sdgv-portal--login .sp-login__footer {
  color: color-mix(in srgb, var(--sp-text, #001d36) 55%, transparent) !important;
}

@media (max-width: 1024px) {
  body.sdgv-portal-body .sp-main__inner {
    padding-inline: 22px;
  }
  body.sdgv-portal-body .sp-stats,
  body.sdgv-portal-body .sp-quick-actions {
    gap: 10px;
  }
}

@media (max-width: 768px) {
  body.sdgv-portal-body .sp-mobile-topbar {
    background: color-mix(in srgb, var(--sp-surface, #fff) 96%, var(--sp-accent, #b8872a) 4%);
    box-shadow: 0 8px 24px rgba(0,29,54,.08);
  }
  body.sdgv-portal-body .sp-main__inner {
    padding: 18px 12px 76px !important;
  }
  body.sdgv-portal-body .sp-page-header {
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
  }
  body.sdgv-portal-body .sp-header-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  body.sdgv-portal-body .sp-header-actions .sp-btn,
  body.sdgv-portal-body .sp-header-actions a,
  body.sdgv-portal-body .sp-header-actions button {
    flex: 1 1 160px;
  }
  body.sdgv-portal-body .sp-stats,
  body.sdgv-portal-body .sp-quick-actions,
  body.sdgv-portal-body .fin-grid {
    grid-template-columns: 1fr !important;
  }
  body.sdgv-portal-body .sp-card__body,
  body.sdgv-portal-body .sp-card__header {
    padding-inline: 16px !important;
  }
  body.sdgv-portal-body .sp-sidebar {
    box-shadow: 18px 0 42px rgba(0,29,54,.16);
  }
}

/* Phase A — targeted premium portal login */
/* Login — brand-owned, deterministic and independent of third-party images */
body.sdgv-portal--login { min-height: 100vh; background: var(--sp-surface) !important; }
body.sdgv-portal--login .sp-login { min-height: 100vh; grid-template-columns: minmax(420px, .86fr) minmax(500px, 1.14fr); background: var(--sp-surface); }
body.sdgv-portal--login .sp-login__panel {
  display: block;
  padding: clamp(32px, 5vw, 76px);
  background: var(--sp-surface) !important;
  color: var(--sp-text) !important;
}
body.sdgv-portal--login .sp-login__panel * { color: inherit !important; }
.sp-login__panel-inner { display: flex; flex-direction: column; width: min(100%, 480px); min-height: calc(100vh - clamp(64px, 10vw, 152px)); margin: auto; }
body.sdgv-portal--login .sp-login__brand { margin: 0 0 clamp(52px, 10vh, 108px); text-align: left; }
body.sdgv-portal--login .sp-login__logo { margin: 0 0 10px; }
body.sdgv-portal--login .sp-login__brandname { font-size: 25px; letter-spacing: .12em; }
body.sdgv-portal--login .sp-login__subtitle { margin: 6px 0 0; color: var(--sp-text-muted) !important; font-size: 9px; letter-spacing: .2em; }
body.sdgv-portal--login .sp-login__form { width: 100%; }
body.sdgv-portal--login .sp-login__title { margin: 0 0 12px; color: var(--sp-text) !important; font-size: clamp(42px, 5vw, 62px); line-height: 1; font-weight: 400; letter-spacing: -.025em; }
body.sdgv-portal--login .sp-login__hint { max-width: 420px; margin: 0 0 34px; color: var(--sp-text-sub) !important; font-size: 14px; line-height: 1.7; }
body.sdgv-portal--login .sp-field { margin-bottom: 19px; }
body.sdgv-portal--login .sp-field label { color: var(--sp-text) !important; font-size: 9px; letter-spacing: .14em; text-transform: uppercase; }
body.sdgv-portal--login .sp-input {
  min-height: 54px;
  border: 1px solid var(--sp-border) !important;
  border-radius: 10px;
  background: color-mix(in srgb, var(--sp-page-bg) 76%, white) !important;
  color: var(--sp-text) !important;
  font-size: 14px;
}
.sp-password-field { position: relative; }
.sp-password-field .sp-input { padding-right: 68px; }
.sp-password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  min-width: 52px;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--sp-text-muted) !important;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
}
body.sdgv-portal--login .sp-remember { margin: 6px 0 25px; color: var(--sp-text-sub) !important; font-size: 11px; }
body.sdgv-portal--login .sp-login__submit { min-height: 54px; border-radius: 999px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
body.sdgv-portal--login .sp-login__privacy { margin: 18px 8px 0; color: var(--sp-text-muted) !important; font-size: 10px; line-height: 1.6; text-align: center; }
body.sdgv-portal--login .sp-login__error { margin-bottom: 20px; border-radius: 10px; font-size: 12px; }
body.sdgv-portal--login .sp-login__footer { margin: auto 0 0; padding-top: 48px; color: var(--sp-text-muted) !important; font-size: 10px; text-align: left; }
body.sdgv-portal--login .sp-login__footer a { color: var(--sp-accent) !important; }
body.sdgv-portal--login .sp-login__visual {
  isolation: isolate;
  display: flex;
  min-height: 100vh;
  padding: clamp(48px, 6vw, 90px);
  background-image: linear-gradient(145deg, rgba(0,29,54,.93), rgba(0,29,54,.62)), var(--sp-login-image, linear-gradient(135deg, #001d36 0%, #173f56 47%, #755d32 130%));
  background-size: cover;
  background-position: center;
}
body.sdgv-portal--login .sp-login__visual::before,
body.sdgv-portal--login .sp-login__visual::after { content: ''; position: absolute; z-index: -1; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; }
body.sdgv-portal--login .sp-login__visual::before { width: min(60vw, 760px); height: min(60vw, 760px); top: -22%; right: -18%; }
body.sdgv-portal--login .sp-login__visual::after { width: min(38vw, 480px); height: min(38vw, 480px); bottom: -17%; left: -12%; border-color: rgba(184,135,42,.32); }
body.sdgv-portal--login .sp-login__overlay { background: linear-gradient(180deg, transparent 45%, rgba(0,16,30,.4)); }
body.sdgv-portal--login .sp-login__visual-inner { position: relative; z-index: 1; display: block; width: 100%; max-width: 680px; margin: auto; }
.sp-login__mark { width: 52px; margin-bottom: 42px; }
.sp-login__mark svg { display: block; width: 100%; stroke: #d8b875; stroke-width: 1.3; }
.sp-login__visual-kicker { margin-bottom: 22px; color: #d8b875; font-size: 10px; font-weight: 700; letter-spacing: .21em; text-transform: uppercase; }
body.sdgv-portal--login .sp-login__visual h2 { max-width: 640px; margin: 0 0 24px; color: #fff; font-family: var(--sp-serif); font-size: clamp(54px, 6vw, 88px); font-weight: 400; line-height: .98; letter-spacing: -.035em; }
body.sdgv-portal--login .sp-login__visual-inner > p { max-width: 550px; margin: 0; color: rgba(255,255,255,.76); font-size: 15px; line-height: 1.75; }
.sp-login__benefits { display: flex; flex-wrap: wrap; gap: 12px 24px; margin: 42px 0 0; padding: 26px 0 0; border-top: 1px solid rgba(255,255,255,.16); color: rgba(255,255,255,.74); list-style: none; }
.sp-login__benefits li { position: relative; padding-left: 17px; font-size: 10px; letter-spacing: .05em; }
.sp-login__benefits li::before { content: ''; position: absolute; left: 0; top: 4px; width: 6px; height: 6px; border: 1px solid #d8b875; border-radius: 50%; }
.sp-login__visual-footer { position: absolute; z-index: 1; right: clamp(48px, 6vw, 90px); bottom: 38px; left: clamp(48px, 6vw, 90px); display: flex; justify-content: space-between; color: rgba(255,255,255,.58); font-size: 9px; letter-spacing: .13em; text-transform: uppercase; }
/* Keyboard clarity */
body.sdgv-portal-body :focus-visible { outline: 3px solid color-mix(in srgb, var(--sp-accent) 72%, white); outline-offset: 3px; }

@media (max-width: 1050px) {
  .sp-workspace-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.sdgv-portal--login .sp-login { grid-template-columns: minmax(390px, .95fr) minmax(430px, 1.05fr); }
}
@media (max-width: 860px) {
  body.sdgv-portal--login .sp-login { display: block; }
  body.sdgv-portal--login .sp-login__panel { min-height: 100vh; padding: 30px 22px; }
  .sp-login__panel-inner { min-height: calc(100vh - 60px); }
  body.sdgv-portal--login .sp-login__brand { margin-bottom: 62px; }
  body.sdgv-portal--login .sp-login__visual { display: none; }
  body.sdgv-portal--login .sp-login__footer { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
body.sdgv-portal-body.sdgv-portal--login .sp-login__submit { color: var(--sdgv-btn-text, #fff) !important; }


/* Phase B — targeted portal visual improvements */
:root {
  --sp-sidebar-w: 272px;
  --sp-lux-shadow: 0 18px 54px rgba(0,29,54,.075);
  --sp-lux-shadow-hover: 0 24px 64px rgba(0,29,54,.12);
}
.sp-skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 10001;
  padding: 10px 16px; border-radius: 8px;
  background: var(--sp-text, #001d36); color: #fff;
  transform: translateY(-150%);
}
.sp-skip-link:focus { transform: translateY(0); }
body.sdgv-portal--dashboard .sp-layout { grid-template-columns: var(--sp-sidebar-w) minmax(0, 1fr); }
body.sdgv-portal--dashboard .sp-main {
  background:
    radial-gradient(circle at 94% 0%, color-mix(in srgb, var(--sp-accent) 8%, transparent), transparent 28%),
    var(--sp-surface2, #f6f5f1) !important;
}
body.sdgv-portal--dashboard .sp-main__inner {
  width: min(100%, 1440px); margin-inline: auto;
  padding: 46px clamp(28px, 4vw, 64px) 96px;
}
body.sdgv-portal--dashboard .sp-sidebar {
  width: var(--sp-sidebar-w); padding: 0;
  box-shadow: 8px 0 34px rgba(0,29,54,.025);
}
body.sdgv-portal--dashboard .sp-sidebar__brand {
  min-height: 106px; padding: 24px 20px 20px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  border-bottom: 1px solid var(--sp-border);
}
.sp-sidebar__brand-lockup { min-width: 0; }
body.sdgv-portal--dashboard .sp-sidebar__brandname {
  font-family: var(--sp-serif); font-size: 18px; line-height: 1.15; letter-spacing: .08em;
}
body.sdgv-portal--dashboard .sp-sidebar__tag { margin-top: 8px; font-size: 9px; letter-spacing: .19em; }
.sp-sidebar-close {
  display: none; flex: 0 0 auto; width: 36px; height: 36px;
  align-items: center; justify-content: center;
  border: 1px solid var(--sp-border); border-radius: 50%;
  background: var(--sp-surface); color: var(--sp-text);
  font: 300 23px/1 var(--sp-sans); cursor: pointer;
}
body.sdgv-portal--dashboard .sp-sidebar__user {
  margin: 18px 16px 8px; padding: 12px !important; gap: 10px !important;
  border-radius: 12px;
  background: color-mix(in srgb, var(--sp-accent) 6%, var(--sp-surface)) !important;
}
body.sdgv-portal--dashboard .sp-sidebar__user-avatar {
  display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px;
  border-radius: 50%; background: var(--sp-text); color: var(--sp-surface) !important;
  font-size: 12px !important; font-weight: 700;
}
body.sdgv-portal--dashboard .sp-sidebar__user-info { display: grid; gap: 3px; min-width: 0; }
body.sdgv-portal--dashboard .sp-sidebar__user-name {
  overflow: hidden; font-size: 12px !important; line-height: 1.25;
  text-overflow: ellipsis; white-space: nowrap;
}
body.sdgv-portal--dashboard .sp-sidebar__user-role {
  color: var(--sp-accent) !important; font-size: 9px !important; font-weight: 700;
  letter-spacing: .11em; text-transform: uppercase;
}
body.sdgv-portal--dashboard .sp-nav { padding: 8px 14px 20px; overflow-y: auto; }
body.sdgv-portal--dashboard .sp-nav__item {
  min-height: 44px; margin: 2px 0; padding: 10px 12px !important; gap: 11px;
  border: 0 !important; border-radius: 10px; font-size: 12px !important;
  font-weight: 600; letter-spacing: .01em;
}
body.sdgv-portal--dashboard .sp-nav__item.is-active {
  background: color-mix(in srgb, var(--sp-accent) 11%, var(--sp-surface)) !important;
  box-shadow: inset 2px 0 0 var(--sp-accent);
}
body.sdgv-portal--dashboard .sp-nav-group { margin: 12px 0 4px; }
body.sdgv-portal--dashboard .sp-nav-group summary {
  padding: 7px 12px; color: var(--sp-text-muted);
  font-size: 9px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
}
body.sdgv-portal--dashboard .sp-nav-group .sp-nav__item { padding-left: 12px !important; }
body.sdgv-portal--dashboard .sp-sidebar__footer { padding: 16px; gap: 4px; }
body.sdgv-portal--dashboard .sp-sidebar__viewstore,
body.sdgv-portal--dashboard .sp-logout,
body.sdgv-portal--dashboard .sp-notification-btn {
  min-height: 38px; padding: 9px 10px; gap: 9px;
  border-radius: 9px; font-size: 11px;
}
.sp-eyebrow {
  display: block; margin-bottom: 10px; color: var(--sp-accent);
  font-size: 10px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
}
body.sdgv-portal--dashboard .sp-page-header { margin-bottom: 30px; gap: 22px; }
body.sdgv-portal--dashboard .sp-page-title {
  font-family: var(--sp-serif); color: var(--sp-text); font-weight: 400 !important;
  letter-spacing: -.02em; font-size: clamp(38px, 4vw, 58px) !important; line-height: 1.02;
}
body.sdgv-portal--dashboard .sp-page-sub {
  max-width: 650px; font-size: 14px !important; line-height: 1.7;
}
body.sdgv-portal--dashboard .sp-card,
body.sdgv-portal--dashboard .fin-card,
body.sdgv-portal--dashboard .fin-panel,
body.sdgv-portal--dashboard .fin-export {
  border-color: color-mix(in srgb, var(--sp-border) 88%, transparent);
  border-radius: 16px; background: var(--sp-surface) !important;
  box-shadow: 0 8px 30px rgba(0,29,54,.035);
}
body.sdgv-portal--dashboard .sp-btn {
  min-height: 42px; border-radius: 999px !important; padding-inline: 20px;
  letter-spacing: .08em; text-transform: uppercase; font-size: 10px !important;
}
@media (max-width: 768px) {
  :root { --sp-sidebar-w: 0px; }
  body.sdgv-portal--dashboard .sp-layout { display: block; }
  body.sdgv-portal--dashboard .sp-mobile-topbar {
    display: grid !important; grid-template-columns: 42px minmax(0,1fr) auto;
    align-items: center; min-height: 70px; padding: 8px 16px;
    border-bottom: 1px solid var(--sp-border);
    background: color-mix(in srgb, var(--sp-surface) 94%, transparent);
    backdrop-filter: blur(14px);
  }
  .sp-mobile-topbar__context { display: flex; flex-direction: column; min-width: 0; padding: 0 11px; }
  .sp-mobile-topbar__business {
    overflow: hidden; color: var(--sp-text); font-family: var(--sp-serif);
    font-size: 13px; text-overflow: ellipsis; white-space: nowrap;
  }
  .sp-mobile-topbar__page {
    overflow: hidden; margin-top: 2px; color: var(--sp-text-muted);
    font-size: 8px; font-weight: 700; letter-spacing: .13em;
    text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap;
  }
  .sp-mobile-topbar__role {
    color: var(--sp-accent); font-size: 8px; font-weight: 700;
    letter-spacing: .1em; text-transform: uppercase; white-space: nowrap;
  }
  body.sdgv-portal--dashboard .sp-sidebar { display: flex; width: min(86vw, 320px); }
  body.sdgv-portal--dashboard .sp-sidebar__brand { min-height: 94px; }
  .sp-sidebar-close { display: flex; }
  body.sdgv-portal--dashboard .sp-sidebar-collapse { display: none; }
  body.sdgv-portal--dashboard .sp-main { padding-top: 70px; }
  body.sdgv-portal--dashboard .sp-main__inner { width: 100%; min-width: 0; padding: 32px 18px 74px; }
  body.sdgv-portal--dashboard .sp-page-header { align-items: flex-start; }
  body.sdgv-portal--dashboard .sp-page-title { font-size: clamp(38px, 12vw, 50px) !important; }
}

/* 2.9.40 final cascade authority for the voucher editor. */
@media (min-width: 1241px) {
  .sp-editor--with-preview {
    display: grid !important;
    width: 100% !important;
    min-width: 0 !important;
    grid-template-columns: minmax(440px, 1fr) minmax(260px, 330px) minmax(250px, 310px) !important;
    gap: clamp(16px, 2vw, 26px) !important;
    align-items: start !important;
  }
  .sp-editor--with-preview > :is(.sp-editor__main, .sp-editor__preview, .sp-editor__sidebar) {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
  }
}
@media (max-width: 1240px) {
  .sp-editor-mobile-switch { display: grid !important; }
  .sp-editor--with-preview { display: block !important; width: 100% !important; min-width: 0 !important; }
  .sp-editor--with-preview > :is(.sp-editor__main, .sp-editor__preview, .sp-editor__sidebar) { display: none !important; position: static !important; width: 100% !important; min-width: 0 !important; }
  .sp-editor--with-preview[data-mobile-panel="edit"] > .sp-editor__main,
  .sp-editor--with-preview[data-mobile-panel="preview"] > .sp-editor__preview,
  .sp-editor--with-preview[data-mobile-panel="options"] > .sp-editor__sidebar { display: block !important; }
}

/* 2.9.41 — service editor and voucher action spacing. */
.sp-service-row {
  container-type: inline-size;
  min-width: 0;
}
.sp-service-row__primary {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(86px, .55fr)) 42px;
  gap: 12px;
  align-items: end;
  min-width: 0;
}
.sp-service-row__primary .sp-field {
  min-width: 0;
  margin: 0 !important;
}
.sp-service-row__primary .sp-field > label {
  display: flex;
  min-height: 32px;
  align-items: flex-end;
  line-height: 1.25;
}
.sp-service-row__primary :is(input, select, textarea) {
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}
.sp-service-row__primary .sp-remove-service {
  width: 42px !important;
  min-width: 42px !important;
  height: 42px !important;
  padding: 0 !important;
}
@container (max-width: 700px) {
  .sp-service-row__primary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
  .sp-service-row__primary .sp-field > label { min-height: 0; }
  .sp-service-row__primary .sp-remove-service { grid-column: 2; justify-self: end; }
}
@container (max-width: 420px) {
  .sp-service-row__primary { grid-template-columns: minmax(0, 1fr); }
  .sp-service-row__primary .sp-remove-service { grid-column: 1; justify-self: end; }
}
.sp-voucher-actions {
  display: grid !important;
  gap: 12px !important;
  padding: 16px !important;
}
.sp-voucher-actions > :is(button, a) {
  width: 100% !important;
  min-height: 44px !important;
  margin: 0 !important;
  justify-content: center !important;
}
@media (max-width: 1240px) {
  .sp-editor__sidebar { padding-bottom: 84px; }
}

/* 2.16.12 final cascade authority — readable portal and single mobile header offset. */
body.sdgv-portal--dashboard { font-size:16px; }
body.sdgv-portal--dashboard .sp-main { min-width:0; }
body.sdgv-portal--dashboard .sp-main__inner { overflow:visible; }
body.sdgv-portal--dashboard .sp-page-sub { font-size:17px !important; line-height:1.65; }
body.sdgv-portal--dashboard :is(.sp-field label,.sp-label) { font-size:14px !important; line-height:1.35; }
body.sdgv-portal--dashboard :is(.sp-field-hint,.sp-hint,.sp-card p) { font-size:14px; line-height:1.6; }
body.sdgv-portal--dashboard :is(.sp-input,.sp-textarea,.sp-select,select,input,textarea) { font-size:16px; }
body.sdgv-portal--dashboard .sp-btn { min-height:46px; font-size:13px !important; }
body.sdgv-portal--dashboard :is(.sp-table td,.sp-table th) { font-size:14px; line-height:1.45; }
body.sdgv-portal--dashboard .sp-card__header h2 { font-size:18px; }
@media (max-width:768px) {
  body.sdgv-portal--dashboard .sp-mobile-topbar {
    position:sticky !important; top:0; z-index:1000; min-height:62px; padding:7px 12px;
  }
  body.sdgv-portal--dashboard .sp-main { padding-top:0 !important; }
  body.sdgv-portal--dashboard .sp-main__inner { padding:20px 14px 72px !important; }
  body.sdgv-portal--dashboard .sp-page-header { margin-bottom:22px; }
  body.sdgv-portal--dashboard .sp-page-title { font-size:clamp(34px,9.5vw,44px) !important; overflow-wrap:anywhere; }
  body.sdgv-portal--dashboard .sp-page-sub { font-size:17px !important; }
  body.sdgv-portal--dashboard .sp-card__body { padding:20px 16px; }
  body.sdgv-portal--dashboard .fin-card,
  body.sdgv-portal--dashboard .fin-panel,
  body.sdgv-portal--dashboard .fin-export { padding:22px 18px; }
}

/* 2.16.14 final cascade authority — simpler market controls and larger portal type. */
body.sdgv-portal--dashboard { font-size:18px; }
body.sdgv-portal--dashboard .sp-sidebar__brandname { font-size:21px !important; }
body.sdgv-portal--dashboard .sp-sidebar__tag { font-size:11px !important; line-height:1.35; }
body.sdgv-portal--dashboard .sp-sidebar__user-name { font-size:16px !important; }
body.sdgv-portal--dashboard .sp-sidebar__user-role { font-size:11px !important; }
body.sdgv-portal--dashboard .sp-sidebar__user-avatar { font-size:14px !important; }
body.sdgv-portal--dashboard .sp-nav__item {
  min-height:50px; padding:13px 14px !important; gap:13px; font-size:16px !important;
}
body.sdgv-portal--dashboard .sp-nav__item svg { width:21px; height:21px; flex-basis:21px; }
body.sdgv-portal--dashboard .sp-nav-group summary { padding:10px 12px; font-size:12px !important; line-height:1.4; }
body.sdgv-portal--dashboard .sp-sidebar__viewstore,
body.sdgv-portal--dashboard .sp-logout,
body.sdgv-portal--dashboard .sp-notification-btn { min-height:44px; font-size:15px !important; }
body.sdgv-portal--dashboard .sp-sidebar__credit { font-size:13px; }
body.sdgv-portal--dashboard .sp-eyebrow { font-size:12px; }
body.sdgv-portal--dashboard .sp-page-sub { font-size:19px !important; }
body.sdgv-portal--dashboard :is(.sp-field label,.sp-label) { font-size:15px !important; }
body.sdgv-portal--dashboard :is(.sp-field-hint,.sp-hint,.sp-card p) { font-size:16px; }
body.sdgv-portal--dashboard :is(.sp-input,.sp-textarea,.sp-select,select,input,textarea) { font-size:17px; }
body.sdgv-portal--dashboard .sp-btn { font-size:15px !important; }
body.sdgv-portal--dashboard :is(.sp-table td,.sp-table th) { font-size:16px; }
body.sdgv-portal--dashboard .sp-card__header h2 { font-size:21px; }
body.sdgv-portal--dashboard .sp-mobile-topbar__business { font-size:16px; }
body.sdgv-portal--dashboard .sp-mobile-topbar__page,
body.sdgv-portal--dashboard .sp-mobile-topbar__role { font-size:10px; }

/* 2.16.47 — keep expanded portal navigation usable at every viewport height. */
body.sdgv-portal--dashboard .sp-sidebar {
  overflow: hidden !important;
}
body.sdgv-portal--dashboard :is(
  .sp-sidebar__brand,
  .sp-sidebar__user,
  .sp-active-property,
  .sp-sidebar__property,
  .sp-sidebar__active-property,
  .sp-sidebar__footer
) {
  flex: 0 0 auto;
}
body.sdgv-portal--dashboard .sp-nav {
  flex: 1 1 auto;
  min-height: 0;
  align-content: start;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}
body.sdgv-portal--dashboard .sp-sidebar__footer {
  position: relative;
  z-index: 1;
  background: var(--sp-surface);
}
.sp-property-setup-steps {
  display: grid;
  gap: 10px;
  margin: 16px 0 20px;
  padding-left: 24px;
  color: var(--sp-text-sub);
  font-size: 15px;
  line-height: 1.55;
}
.sp-property-storefront { min-width: 300px; }
.sp-property-storefront .sp-input { min-width: 280px; font-size: 12px !important; }
.sp-property-link-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

#sp-settings-market .sp-settings-intro {
  max-width:720px; margin:0 0 24px; color:var(--sp-text-muted); line-height:1.65;
}
#sp-settings-market .sp-market-options {
  min-width:0; margin:24px 0; padding:0; border:0;
}
#sp-settings-market .sp-market-options legend {
  margin-bottom:7px; color:var(--sp-text); font-size:15px; font-weight:800; letter-spacing:.08em; text-transform:uppercase;
}
#sp-settings-market .sp-market-choice-grid {
  display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:10px; margin-top:14px;
}
#sp-settings-market .sp-market-choice {
  display:flex; min-height:64px; align-items:center; gap:12px; padding:12px 14px;
  border:1px solid var(--sp-border); border-radius:12px; background:var(--sp-surface); cursor:pointer;
}
#sp-settings-market .sp-market-choice:has(input:checked) {
  border-color:var(--sp-accent); background:color-mix(in srgb,var(--sp-accent) 8%,var(--sp-surface));
  box-shadow:inset 3px 0 0 var(--sp-accent);
}
#sp-settings-market .sp-market-choice:has(input:disabled) { cursor:default; }
#sp-settings-market .sp-market-choice input { width:19px; height:19px; flex:0 0 19px; accent-color:var(--sp-accent); }
#sp-settings-market .sp-market-choice span { display:grid; gap:2px; color:var(--sp-text-muted); font-size:14px; line-height:1.25; }
#sp-settings-market .sp-market-choice strong { color:var(--sp-text); font-size:16px; }
#sp-settings-market .sp-market-auto {
  display:flex; align-items:flex-start; gap:13px; margin-top:26px; padding:16px;
  border:1px solid var(--sp-border); border-radius:12px; background:var(--sp-surface2); cursor:pointer;
}
#sp-settings-market .sp-market-auto input { width:20px; height:20px; margin-top:2px; flex:0 0 20px; accent-color:var(--sp-accent); }
#sp-settings-market .sp-market-auto span { display:grid; gap:5px; }
#sp-settings-market .sp-market-auto strong { color:var(--sp-text); font-size:16px; }
#sp-settings-market .sp-market-auto small { color:var(--sp-text-muted); font-size:14px; line-height:1.5; }
@media (max-width:600px) {
  #sp-settings-market .sp-market-choice-grid { grid-template-columns:1fr; }
}

/* 2.16.15 — remove the duplicated mobile header spacer on every portal page. */
@media (max-width:768px) {
  body.sdgv-portal--dashboard .sp-layout {
    display:grid !important;
    height:100vh;
    height:100dvh;
    min-height:0 !important;
    grid-template-columns:minmax(0,1fr) !important;
    grid-template-rows:auto minmax(0,1fr) !important;
    overflow:hidden !important;
  }
  body.sdgv-portal--dashboard .sp-mobile-topbar {
    position:relative !important;
    top:auto !important;
    grid-column:1 !important;
    grid-row:1 !important;
  }
  body.sdgv-portal--dashboard .sp-main {
    grid-column:1 !important;
    grid-row:2 !important;
    height:auto !important;
    min-height:0 !important;
    margin:0 !important;
    padding:0 !important;
    overflow-x:hidden !important;
    overflow-y:auto !important;
  }
}

/* 2.16.17 — keep portal actions compact while preserving readable page copy. */
body.sdgv-portal--dashboard .sp-btn {
  min-height:38px !important;
  padding:8px 14px !important;
  border-radius:9px;
  font-size:13px !important;
  line-height:1.2;
}
body.sdgv-portal--dashboard .sp-btn--sm {
  min-height:32px !important;
  padding:6px 10px !important;
  font-size:12px !important;
}
body.sdgv-portal--dashboard .sp-btn--icon {
  width:36px !important;
  height:36px !important;
  min-height:36px !important;
  padding:0 !important;
}
body.sdgv-portal--dashboard .sp-btn--new-voucher {
  min-height:40px !important;
  padding:9px 16px !important;
  font-size:13px !important;
}
body.sdgv-portal--dashboard .sp-vcard__actions .sp-btn {
  padding:7px 12px !important;
  font-size:12px !important;
}
body.sdgv-portal--dashboard :is(.sp-settings-floating-save,.sp-float-save-btn) {
  width:auto !important;
  min-height:42px !important;
  padding:0 16px !important;
  font-size:12px !important;
}
@media (max-width:768px) {
  body.sdgv-portal--dashboard .sp-btn {
    min-height:42px !important;
    padding:9px 13px !important;
    font-size:13px !important;
  }
  body.sdgv-portal--dashboard .sp-btn--sm {
    min-height:38px !important;
    padding:7px 10px !important;
    font-size:12px !important;
  }
  body.sdgv-portal--dashboard .sp-btn--icon {
    width:40px !important;
    height:40px !important;
    min-height:40px !important;
  }
  body.sdgv-portal--dashboard :is(.sp-settings-floating-save,.sp-float-save-btn) {
    min-height:42px !important;
    padding:0 15px !important;
    font-size:12px !important;
  }
}
