:root{
  --sfpm-text: #0b1220;
  --sfpm-muted: #52606d;

  --sfpm-red-900: #3b0a0a;
  --sfpm-red-800: #5b0f0f;
  --sfpm-red-700: #991b1b;
  --sfpm-red-600: #dc2626;

  --sfpm-panel: #ffffff;
  --sfpm-border: rgba(11,18,32,0.18);
  --sfpm-border-2: rgba(11,18,32,0.14);

  --sfpm-radius: 18px;
  --sfpm-shadow: 0 22px 60px rgba(2,6,23,0.32);
  --sfpm-shadow-soft: 0 10px 25px rgba(2,6,23,0.14);

  --sfpm-font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
  --sfpm-logo-url: url("/wp-content/uploads/logo_i.gif");

  --sfpm-accent-warm: #f59e0b;
  --sfpm-danger: #b91c1c;
}


/* ===== Header buttons ===== */
.sfpm-bhpm-login-open-btn,
.sfpm-bhpm-open-btn,
.sfpm-bhpm-logout-btn{
  font-family: var(--sfpm-font);
  border: 1px solid rgba(153,27,27,0.35);
  padding: 5px 9px;
  cursor: pointer;
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(153,27,27,0.92), rgba(91,15,15,0.92));
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1px;
  text-shadow: 0 1px 0 rgba(0,0,0,0.18);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sfpm-bhpm-login-open-btn:hover,
.sfpm-bhpm-open-btn:hover,
.sfpm-bhpm-logout-btn:hover{
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 12px 22px rgba(153,27,27,0.20);
}
.sfpm-bhpm-login-open-btn:active,
.sfpm-bhpm-open-btn:active,
.sfpm-bhpm-logout-btn:active{
  transform: translateY(0);
}
.sfpm-bhpm-logout-btn{ margin-left: 6px; }

/* ===== Modal wrapper ===== */
.sfpm-bhpm-modal{ display:none; font-family: var(--sfpm-font); }
.sfpm-bhpm-modal.is-open{
  display:flex;
  position: fixed;
  inset: 0;
  z-index: 100000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}
.sfpm-bhpm-backdrop{
  position:absolute; inset:0;
  background:
    radial-gradient(1000px 700px at 20% 30%, rgba(153,27,27,0.16), transparent 60%),
    rgba(2,6,23,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.sfpm-bhpm-panel{
  position: relative;
  margin: 0;
  width: min(1040px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  background: var(--sfpm-panel);
  border-radius: var(--sfpm-radius);
  overflow: hidden;
  box-shadow: var(--sfpm-shadow);
  border: 1px solid rgba(255,255,255,0.14);
  transform: translateY(10px) scale(0.985);
  opacity: 0;
  animation: sfpmPop .18s ease forwards;

  display:flex;
  flex-direction: column;
}
@keyframes sfpmPop{ to{ transform: translateY(0) scale(1); opacity: 1; } }

.sfpm-bhpm-login-modal .sfpm-bhpm-panel{
  width: min(400px, calc(100% - 32px));
}

/* ===== Header ===== */
.sfpm-bhpm-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 16px;
  color: #fff;
  background: linear-gradient(135deg, rgba(153,27,27,0.96), rgba(91,15,15,0.92));
}
.sfpm-bhpm-title{
  display:flex;
  align-items:center;
  gap: 12px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .1px;
}
.sfpm-bhpm-title::before{
  content:"";
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--sfpm-logo-url) center/70% no-repeat, rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.26);
  box-shadow: 0 10px 18px rgba(0,0,0,.16);
}
.sfpm-bhpm-header-actions{
  display:flex;
  gap: 10px;
  align-items:center;
}
.sfpm-bhpm-wpbadge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.20);
}
.sfpm-bhpm-wpbadge .dashicons{
  color: #fff;
  font-size: 20px;
  width: 20px;
  height: 20px;
}
.sfpm-bhpm-close-btn{
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.18);
  width: 38px; height: 38px;
  border-radius: 12px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: #fff;
  transition: transform .12s ease, background .12s ease;
}
.sfpm-bhpm-close-btn:hover{ background: rgba(255,255,255,0.22); transform: translateY(-1px); }
.sfpm-bhpm-close-btn:active{ transform: translateY(0); }
.sfpm-bhpm-new-btn{
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.14);
  color: #fff;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

/* ===== Body ===== */
.sfpm-bhpm-body{
  padding: 14px;
  background: #d1eef4;
  overflow:auto;
  flex: 1 1 auto;
}
.sfpm-bhpm-field{ margin: 12px 0; }
.sfpm-bhpm-field label{
  display:block;
  font-weight: 600;
  color: var(--sfpm-text);
  margin-bottom: 7px;
  margin-left. 5px;
  font-size: 14px;
}
.sfpm-bhpm-help{
  color: var(--sfpm-muted);
  font-size: 12px;
  margin-top: 6px;
  line-height: 1.35;
}

/* Inputs */
.sfpm-bhpm-body input[type="text"],
.sfpm-bhpm-body input[type="password"],
.sfpm-bhpm-body input[type="search"],
.sfpm-bhpm-body select{
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--sfpm-border);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.97);
  color: var(--sfpm-text);
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.sfpm-bhpm-body input:focus,
.sfpm-bhpm-body select:focus{
  border-color: rgba(153,27,27,0.55);
  box-shadow: 0 0 0 4px rgba(153,27,27,0.14);
}

/* PASSWORD TOGGLE */
.sfpm-bhpm-pass-wrap{ position: relative; }
.sfpm-bhpm-pass-wrap input[type="password"],
.sfpm-bhpm-pass-wrap input[type="text"]{ padding-right: 44px; }
.sfpm-bhpm-pass-toggle{
  position:absolute;
  right: 8px;
  width: 34px;
  height: 34px;
  top: 2px;
  border-radius: 10px;
  border: 1px solid rgba(15,23,42,0.10);
  background: rgba(255,255,255,0.2);
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow: 0 8px 14px rgba(2,6,23,0.06);
}
.sfpm-bhpm-pass-toggle svg{ width: 18px; height: 18px; fill: rgba(91,15,15,0.85); }

/* Buttons */
.sfpm-bhpm-body button{
  font-family: var(--sfpm-font);
  font-weight: 600;
}
.sfpm-bhpm-body button:not(.sfpm-bhpm-close-btn):not(.sfpm-bhpm-new-btn){
  border: 1px solid var(--sfpm-border);
  background: #e7e7e7;
  padding: 9px 12px;
  border-radius: 12px;
  cursor: pointer;
  color: #0f172a;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  box-shadow: 0 8px 16px rgba(2,6,23,0.06);
}
.sfpm-bhpm-body button:hover{
  transform: translateY(-1px);
  border-color: rgba(15,23,42,0.14);
  box-shadow: 0 12px 22px rgba(2,6,23,0.10);
}

/* Toolbar */
.sfpm-bhpm-toolbar{
  display:flex;
  gap: 10px;
  margin-bottom: 12px;
  align-items:center;
  flex-wrap: wrap;
}
.sfpm-bhpm-search{ flex: 1 1 260px; min-width: 220px; }

.sfpm-bhpm-sort-wrap{
  display:flex;
  align-items:center;
  gap: 8px;
  flex: 0 0 auto;
}
.sfpm-bhpm-sort-label{
  font-size: 12px;
  color: var(--sfpm-muted);
  font-weight: 600;
  white-space: nowrap;
}
.sfpm-bhpm-sort-by,
.sfpm-bhpm-sort-dir{
  width: auto !important;
  min-width: 140px;
}

/* List cards */
.sfpm-bhpm-list{ display:flex; flex-direction: column; gap: 12px; }
.sfpm-bhpm-item{
  border: 1px solid var(--sfpm-border-2);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255,255,255,0.94);
  box-shadow: var(--sfpm-shadow-soft);
  display:grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
}
.sfpm-bhpm-item-title{ font-weight: 700; color: #0b1220; }
.sfpm-bhpm-item-meta{ color: var(--sfpm-muted); font-size: 12px; }
.sfpm-bhpm-item-actions{ display:flex; gap: 8px; align-items:center; justify-content:flex-end; }
.sfpm-bhpm-item-langs{ grid-column: 1 / -1; display:flex; flex-wrap: wrap; gap: 8px; }

/* indentation for hierarchical pages */
.sfpm-bhpm-item-title-indent{
  padding-left: var(--sfpm-indent, 0px);
  position: relative;
}
.sfpm-bhpm-item-title-indent::before{
  content:"";
  display:block;
  position:absolute;
  left: calc(var(--sfpm-indent, 0px) - 10px);
  top: 50%;
  width: 6px;
  height: 1px;
  background: rgba(15,23,42,0.18);
  transform: translateY(-50%);
}
.sfpm-bhpm-item[style*="--sfpm-indent:0px"] .sfpm-bhpm-item-title-indent::before{
  display:none;
}

.sfpm-bhpm-lang-chip{
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,0.10);
  background: rgba(255,255,255,0.75);
  color: #0f172a;
}
.sfpm-bhpm-lang-missing{ border-color: rgba(153,27,27,0.35); background: rgba(255,0,0,0.20); }
.sfpm-bhpm-lang-draft{ border-color: rgba(245,158,11,0.40); background: rgba(245,158,11,0.20); }
.sfpm-bhpm-lang-publish{ border-color: rgba(34,197,94,0.35); background: rgba(34,197,94,0.20); }

/* Editor layout */
.sfpm-bhpm-grid{
  display:grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 12px;
  align-items:start;
}
@media (max-width: 860px){ .sfpm-bhpm-grid{ grid-template-columns: 1fr; } }

/* Featured preview */
.sfpm-bhpm-featured-preview{
  border: 1px dashed rgba(15,23,42,0.18);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255,255,255,0.72);
  min-height: 110px;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
.sfpm-bhpm-featured-preview img{ max-width: 100%; height: auto; border-radius: 12px; }
.sfpm-bhpm-placeholder{ color: var(--sfpm-muted); font-size: 13px; }

/* Tabs */
.sfpm-bhpm-lang-tabs,
.sfpm-bhpm-mode-tabs,
.sfpm-bhpm-section-tabs{
  display:flex;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,0.08);
  background: rgba(255,255,255,0.85);
  box-shadow: 0 10px 18px rgba(2,6,23,0.05);
  flex-wrap: wrap;
}
.sfpm-bhpm-section-tabs{ margin-top: -4px; }

.sfpm-bhpm-tab{
  border: 1px solid rgba(15,23,42,0.12) !important;
  background: #fff !important;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700 !important;
  letter-spacing: .1px;
  color: #0f172a !important;
  box-shadow: 0 8px 14px rgba(2,6,23,0.05);
}
.sfpm-bhpm-tab.is-active{
  background: rgba(255,255,0,0.2) !important;
  border-color: rgba(0,0,0,0.5) !important;
  color: var(--sfpm-red-800) !important;
}

/* Context pill */
.sfpm-bhpm-context-row{ margin: 6px 0 10px; }
.sfpm-bhpm-context-pill{
  display:inline-flex;
  align-items:center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(153,27,27,0.25);
  background: rgba(153,27,27,0.08);
  color: var(--sfpm-red-800);
  font-size: 12px;
  font-weight: 600;
}

/* Actions */
.sfpm-bhpm-actions{
  display:flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(15,23,42,0.08);
}
.sfpm-bhpm-actions-right{ display:flex; gap: 10px; align-items:center; }
.sfpm-bhpm-save-btn{
  border: 1px solid rgba(153,27,27,0.25) !important;
  background: linear-gradient(180deg, rgba(153,27,27,0.96), rgba(91,15,15,0.92)) !important;
  color: #fff !important;
}

/* Status message */
.sfpm-bhpm-msg{
  margin-top: 10px;
  font-size: 13px;
  color: #0f172a;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,0.08);
  background: rgba(255,255,255,0.82);
}

/* Login form */
.sfpm-bhpm-login-form p{ margin: 10px 0; }
.sfpm-bhpm-login-form label{
  display:block;
  font-size: 12px;
  font-weight: 500;
  color: var(--sfpm-text);
  margin-bottom: 6px;
}
.sfpm-bhpm-login-form input[type="submit"]{
  border: 1px solid rgba(153,27,27,0.25);
  background: linear-gradient(180deg, rgba(153,27,27,0.96), rgba(91,15,15,0.92));
  color: #fff;
  padding: 9px 14px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

/* WP editor container */
.sfpm-bhpm-editor-wrap{
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 18px rgba(2,6,23,0.05);
  background: rgba(255,255,255,0.88);
}

/* Hide buttons under 1000px */
@media (max-width: 1000px){
  .sfpm-bhpm-header-widget,
  .sfpm-bhpm-login-open-btn,
  .sfpm-bhpm-open-btn,
  .sfpm-bhpm-logout-btn{
    display: none !important;
  }
}

/* ===== USTARCH-ish colorful refresh + editor layout (style-only) ===== */

/* Manager header: blue → teal */
.sfpm-bhpm-header{
  background: linear-gradient(135deg, rgba(153,27,27,0.96), rgba(220,38,38,0.92)) !important;
}

/* Backdrop glow: teal (no pink) */
.sfpm-bhpm-backdrop{
  background:
    radial-gradient(1000px 700px at 20% 30%, rgba(220,38,38,0.18), transparent 60%),
    rgba(2,6,23,0.58) !important;
}

/* Body subtle tint */
.sfpm-bhpm-body{
  background:
    radial-gradient(900px 520px at 12% 0%, rgba(220,38,38,0.10), transparent 62%),
    radial-gradient(900px 520px at 92% 20%, rgba(245,158,11,0.08), transparent 60%),
    #fbfdff !important;
}

/* Primary buttons (header + save/login submit) */
.sfpm-bhpm-login-open-btn,
.sfpm-bhpm-open-btn,
.sfpm-bhpm-logout-btn{
  border-color: rgba(220,38,38,0.40) !important;
  background: linear-gradient(180deg, rgba(153,27,27,0.96), rgba(91,15,15,0.92)) !important;
  box-shadow: 0 10px 18px rgba(153,27,27,0.18);
}
.sfpm-bhpm-login-open-btn:hover,
.sfpm-bhpm-open-btn:hover,
.sfpm-bhpm-logout-btn:hover{
  box-shadow: 0 14px 26px rgba(220,38,38,0.20) !important;
}

.sfpm-bhpm-save-btn,
.sfpm-bhpm-login-form input[type="submit"]{
  border-color: rgba(220,38,38,0.35) !important;
  background: linear-gradient(180deg, rgba(220,38,38,0.96), rgba(153,27,27,0.92)) !important;
}

/* Focus ring: teal */
.sfpm-bhpm-body input:focus,
.sfpm-bhpm-body select:focus{
  border-color: rgba(220,38,38,0.70) !important;
  box-shadow: 0 0 0 4px rgba(220,38,38,0.16) !important;
}

/* Tabs active: teal */
.sfpm-bhpm-tab.is-active{
  background: rgba(255,255,0,0.2) !important;
  border-color: rgba(0,0,0,0.5) !important;
  color: #991b1b !important;
}

/* Context pill: warm accent */
.sfpm-bhpm-context-pill{
  border-color: rgba(245,158,11,0.28) !important;
  background: rgba(245,158,11,0.10) !important;
  color: #92400e !important;
}

/* Language chips: missing = warm */
.sfpm-bhpm-lang-missing{
  border-color: rgba(245,158,11,0.45) !important;
  background: rgba(255,0,0,0.2) !important;
  color: #92400e !important;
}

/* Password toggle icon color */
.sfpm-bhpm-pass-toggle svg{ fill: rgba(153,27,27,0.90) !important; }

/* -------- Editor re-layout: Content 2/3 + Sidebar 1/3 -------- */
.sfpm-bhpm-view-editor{
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  column-gap: 14px;
  row-gap: 12px;
  align-items: start;
}

/* Full-width rows */
.sfpm-bhpm-view-editor > .sfpm-bhpm-context-row,
.sfpm-bhpm-view-editor > .sfpm-bhpm-lang-tabs,
.sfpm-bhpm-view-editor > .sfpm-bhpm-parent-field,
.sfpm-bhpm-view-editor > .sfpm-bhpm-field:not(:has(.sfpm-bhpm-editor-wrap)),
.sfpm-bhpm-view-editor > .sfpm-bhpm-msg{
  grid-column: 1 / -1;
}

/* Content field (the one containing wp_editor) -> left column */
.sfpm-bhpm-view-editor > .sfpm-bhpm-field:has(.sfpm-bhpm-editor-wrap){
  grid-column: 1;
  margin-top: 10px;
}

/* Featured + Status stack -> right column */
.sfpm-bhpm-view-editor > .sfpm-bhpm-grid{
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
}
.sfpm-bhpm-view-editor > .sfpm-bhpm-grid > .sfpm-bhpm-field{ margin: 0; }

/* Make sidebar controls feel like cards */
.sfpm-bhpm-view-editor > .sfpm-bhpm-grid .sfpm-bhpm-field{
  border: 1px solid rgba(11,18,32,0.10);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 10px 18px rgba(2,6,23,0.06);
}

/* Featured preview fixed aspect */
.sfpm-bhpm-featured-preview{
  border-style: solid;
  border-color: rgba(153,27,27,0.14);
  background: linear-gradient(180deg, rgba(220,38,38,0.06), rgba(255,255,255,0.72));
  min-height: 150px;
}
.sfpm-bhpm-featured-preview img{
  width: 100%;
  height: 150px;
  object-fit: cover;
}

/* Status + Save on the right, under featured */
.sfpm-bhpm-view-editor > .sfpm-bhpm-actions{
  grid-column: 2;
  margin: 0;
  padding: 0;
  border-top: 0;
  justify-content: flex-end;
}
.sfpm-bhpm-actions-right{ justify-content: flex-end; }

/* Back button: top-right corner */
.sfpm-bhpm-back-btn{
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  border-radius: 999px !important;
  padding: 8px 12px !important;
  border-color: rgba(153,27,27,0.55) !important;
  background: rgba(255,255,255,0.96) !important;
  color: #991b1b !important;
  box-shadow: 0 12px 22px rgba(2,6,23,0.10) !important;
}
.sfpm-bhpm-back-btn::before{ content: "←"; margin-right: 8px; opacity: .9; }
.sfpm-bhpm-lang-tabs{ padding-right: 120px; }

/* Responsive: stack editor on small screens */
@media (max-width: 900px){
  .sfpm-bhpm-view-editor{ display: block; }
  .sfpm-bhpm-lang-tabs{ padding-right: 10px; }
  .sfpm-bhpm-back-btn{
    position: static;
    margin: 0 0 10px auto;
    display: inline-flex;
  }
  .sfpm-bhpm-view-editor > .sfpm-bhpm-grid{
    display: grid;
    grid-template-columns: 1fr;
    margin-top: 12px;
  }
  .sfpm-bhpm-view-editor > .sfpm-bhpm-actions{ margin-top: 10px; }
}

/* Stronger hover/active for primary buttons (contrast) */
.sfpm-bhpm-login-open-btn:hover,
.sfpm-bhpm-open-btn:hover,
.sfpm-bhpm-logout-btn:hover,
.sfpm-bhpm-save-btn:hover{
  box-shadow: 0 14px 28px rgba(153,27,27,0.22) !important;
}

.sfpm-bhpm-login-open-btn:active,
.sfpm-bhpm-open-btn:active,
.sfpm-bhpm-logout-btn:active,
.sfpm-bhpm-save-btn:active{
  filter: brightness(0.98) !important;
}

/* Back button hover (top-right) */
.sfpm-bhpm-back-btn:hover{
  background: rgba(220,38,38,0.08) !important;
  border-color: rgba(153,27,27,0.70) !important;
  box-shadow: 0 14px 28px rgba(153,27,27,0.18) !important;
}

/* Higher-contrast separators for common shells (safe even if some selectors don't exist) */
.sfpm-bhpm-card,
.sfpm-bhpm-panel,
.sfpm-bhpm-editor,
.sfpm-bhpm-box{
  border-color: rgba(11,18,32,0.18) !important;
}

/* Red accent marker for section titles if present */
.sfpm-bhpm-section-title,
.sfpm-bhpm-subtitle{
  position: relative;
}
.sfpm-bhpm-section-title::before,
.sfpm-bhpm-subtitle::before{
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 8px;
  background: linear-gradient(180deg, rgba(220,38,38,1), rgba(91,15,15,1));
  vertical-align: middle;
}


/* =========================================================
   Red layout tweaks v2 (style-only)
   - Featured same height as Content
   - Featured label outside card
   - Status + Save under both columns, right aligned
   - Back button red, single arrow
   ========================================================= */

/* Make the 2-column editor row stretch to the tallest column */
.sfpm-bhpm-view-editor{
  align-items: stretch !important;
}

/* Ensure the main content editor block participates in stretching */
.sfpm-bhpm-view-editor > .sfpm-bhpm-field:has(.sfpm-bhpm-editor-wrap){
  align-self: stretch !important;
  min-height: 0 !important;
}

/* Flatten the sidebar container so Featured + Status can be placed independently */
.sfpm-bhpm-view-editor > .sfpm-bhpm-grid{
  display: contents !important;
}

/* Featured field (assumed first) sits in the right column, same row as Content */
.sfpm-bhpm-view-editor > .sfpm-bhpm-grid > .sfpm-bhpm-field:first-child{
  grid-column: 2 !important;
  align-self: stretch !important;
  height: 100% !important;

  /* label OUTSIDE the card: remove card styling from the field wrapper */
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;

  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  min-height: 0 !important;
}

/* Put the 'card' styling onto the preview box itself */
.sfpm-bhpm-view-editor > .sfpm-bhpm-grid > .sfpm-bhpm-field:first-child .sfpm-bhpm-featured-preview{
  flex: 1 1 auto !important;
  min-height: 0 !important;
  border: 1px solid rgba(153,27,27,0.22) !important;
  border-radius: 16px !important;
  background: linear-gradient(180deg, rgba(220,38,38,0.08), rgba(255,255,255,0.86)) !important;
  box-shadow: 0 14px 26px rgba(2,6,23,0.10) !important;
  padding: 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Make featured image fill available height within the preview */
.sfpm-bhpm-view-editor > .sfpm-bhpm-grid > .sfpm-bhpm-field:first-child .sfpm-bhpm-featured-preview img{
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  object-fit: cover !important;
  border-radius: 12px !important;
}

/* Make featured action buttons area look like a small card, under preview */
.sfpm-bhpm-view-editor > .sfpm-bhpm-grid > .sfpm-bhpm-field:first-child .sfpm-bhpm-featured-actions{
  border: 1px solid rgba(11,18,32,0.16) !important;
  border-radius: 16px !important;
  background: rgba(255,255,255,0.95) !important;
  box-shadow: 0 10px 18px rgba(2,6,23,0.08) !important;
  padding: 10px !important;
}

/* Status field (assumed last) goes under BOTH columns and aligns right */
.sfpm-bhpm-view-editor > .sfpm-bhpm-grid > .sfpm-bhpm-field:last-child{
  grid-column: 1 / -1 !important;
  justify-self: center !important;
  width: min(900px, 100%) !important;

  border: 1px solid rgba(11,18,32,0.16) !important;
  border-radius: 16px !important;
  background: rgba(255,255,255,0.95) !important;
  box-shadow: 0 10px 18px rgba(2,6,23,0.08) !important;
  padding: 12px !important;
  margin-top: 2px !important;
}

/* Actions row (Save) under BOTH columns, right aligned */
.sfpm-bhpm-view-editor > .sfpm-bhpm-actions{
  grid-column: 1 / -1 !important;
  justify-content: flex-end !important;
  margin-top: 0 !important;
}

/* Optional: slightly larger, higher-contrast Save */
.sfpm-bhpm-save-btn{
  box-shadow: 0 14px 26px rgba(153,27,27,0.22) !important;
}

/* Back button: red, top-right, and only ONE arrow */
.sfpm-bhpm-back-btn{
  background: linear-gradient(180deg, rgba(220,38,38,0.98), rgba(153,27,27,0.95)) !important;
  border-color: rgba(255,255,255,0.22) !important;
  color: #fff !important;
  text-shadow: 0 1px 0 rgba(0,0,0,0.22) !important;
}
.sfpm-bhpm-back-btn::before{ content: none !important; display:none !important; }
.sfpm-bhpm-back-btn::after{ content: none !important; display:none !important; }

/* If an icon is present and creates a second arrow, hide it */
.sfpm-bhpm-back-btn .dashicons{ display:none !important; }

.sfpm-bhpm-back-btn:hover{
  filter: brightness(1.03) !important;
  box-shadow: 0 16px 30px rgba(153,27,27,0.24) !important;
}

/* Responsive: keep the new placement when stacked */
@media (max-width: 900px){
  .sfpm-bhpm-view-editor > .sfpm-bhpm-grid > .sfpm-bhpm-field:first-child{
    grid-column: 1 / -1 !important;
    height: auto !important;
  }
  .sfpm-bhpm-view-editor > .sfpm-bhpm-grid > .sfpm-bhpm-field:last-child{
    width: 100% !important;
    justify-self: stretch !important;
  }
}
