@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700;800&family=Nunito:wght@300;400;500;600;700&display=swap');

/* ================================================================
   ONTRAPORT STATS v2 — LIGHT DESIGN
   Aesthetic: Clean SaaS. White cards, light gray bg, blue accents.
   All scoped under .opst to avoid theme conflicts.
   ================================================================ */

.opst {
  --blue:       #2563eb;
  --blue-light: #eff6ff;
  --blue-mid:   #bfdbfe;
  --blue-dark:  #1d4ed8;
  --green:      #16a34a;
  --green-bg:   #f0fdf4;
  --red:        #dc2626;
  --red-bg:     #fef2f2;
  --amber:      #d97706;
  --amber-bg:   #fffbeb;
  --gray-50:    #f9fafb;
  --gray-100:   #f3f4f6;
  --gray-200:   #e5e7eb;
  --gray-300:   #d1d5db;
  --gray-400:   #9ca3af;
  --gray-500:   #6b7280;
  --gray-700:   #374151;
  --gray-900:   #111827;
  --white:      #ffffff;
  --sidebar-w:  220px;
  --radius:     10px;
  --radius-lg:  14px;
  --shadow:     0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);

  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  color: var(--gray-900);
  background: var(--gray-50);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

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

/* ================================================================
   DEMO BAR
   ================================================================ */
.opst-demo-bar {
  background: #fef2f2;
  border-bottom: 2px solid #dc2626;
  padding: 0.625rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #991b1b;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.opst-demo-bar a { color: #dc2626; font-weight: 700; text-decoration: underline; }
.opst-demo-bar a:hover { color: #991b1b; }

/* ================================================================
   LAYOUT
   ================================================================ */
.opst-layout {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
  background: var(--gray-50);
}

/* ================================================================
   SIDEBAR
   ================================================================ */
.opst-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 1.25rem 0;
}

.opst-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-100);
  margin-bottom: 1rem;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--gray-900);
}

.opst-sidebar__logo { width: 28px; height: 28px; flex-shrink: 0; border-radius: 6px; }

.opst-sidebar__section-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-400);
  padding: 0 1rem 0.5rem;
}

.opst-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 0.5rem; }

.opst-nav__item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5625rem 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-500);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
}

.opst-nav__item svg { width: 16px; height: 16px; flex-shrink: 0; }
.opst-nav__item:hover { background: var(--gray-100); color: var(--gray-700); }
.opst-nav__item--active { background: var(--blue-light) !important; color: var(--blue) !important; font-weight: 600; }

.opst-sidebar__footer {
  margin-top: auto;
  padding: 1rem 1rem 0;
  font-size: 0.6875rem;
  color: var(--gray-400);
  border-top: 1px solid var(--gray-100);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}

.opst-sidebar__version {
  color: var(--gray-500);
  font-weight: 700;
}

.opst-sidebar__credit {
  color: var(--gray-400);
}

/* ================================================================
   MAIN CONTENT
   ================================================================ */
.opst-main {
  flex: 1;
  min-width: 0;
  min-height: 100vh;
  padding: 1.75rem;
  background: var(--gray-50);
}

.opst-mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: relative;
  top: unset;
  z-index: 100;
}

.opst-hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 6px;
}

.opst-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--gray-700);
  border-radius: 2px;
  transition: all 0.2s;
}

.opst-mobile-brand {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  text-align: center;
  justify-content: center;
}

.opst-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 200;
}

.opst-drawer-overlay--open {
  display: block;
}

.opst--full-viewport .opst-layout {
  height: calc(100vh - var(--wp-admin--admin-bar--height, 0px));
  min-height: unset;
  overflow: hidden;
}

.opst--full-viewport .opst-sidebar {
  height: 100%;
  min-height: unset;
  overflow-y: auto;
  position: sticky;
  top: 0;
}

.opst--full-viewport .opst-main {
  height: 100%;
  min-height: unset;
  overflow-y: auto;
}

.opst-panel--hidden { display: none; }

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

.opst-page-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.02em;
}

.opst-last-updated { font-size: 0.75rem; color: var(--gray-400); }

/* ================================================================
   KPI STRIP
   ================================================================ */
.opst-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.opst-kpi-grid--3 { grid-template-columns: repeat(3, 1fr); }
.opst-kpi-grid--4 { grid-template-columns: repeat(4, 1fr); }
.opst-kpi-grid--5 { grid-template-columns: repeat(5, 1fr); }
.opst-kpi-grid--6 { grid-template-columns: repeat(3, 1fr); }

.opst-kpi {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.125rem 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.opst-kpi__label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: 0.5rem;
}

.opst-kpi__value {
  margin-top: auto;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.02em;
  margin-bottom: 0.375rem;
  line-height: 1.1;
}

.opst-kpi__change {
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.opst-kpi__change--up      { background: var(--green-bg); color: var(--green); }
.opst-kpi__change--down    { background: var(--red-bg);   color: var(--red); }
.opst-kpi__change--neutral { background: var(--gray-100); color: var(--gray-500); }

.opst-kpi--anchor {
  position: relative;
  min-height: 130px;
  background: var(--blue-bg, var(--blue-light));
  border-left: 3px solid var(--blue);
}

.opst-kpi-chip {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--blue);
  background: var(--blue-light);
}

.opst-kpi--yoy .opst-kpi__value {
  font-size: 1.1rem;
}

.opst-yoy-row {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.375rem 0;
  border-top: 1px solid var(--gray-100);
}

.opst-yoy-row:first-child {
  border-top: none;
  padding-top: 0;
}

.opst-yoy-row__label {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-400);
}

.opst-yoy-row__value-line {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
}

/* ================================================================
   CARDS
   ================================================================ */
.opst-grid { display: grid; gap: 1.25rem; margin-bottom: 1.25rem; }
.opst-grid--1 { grid-template-columns: 1fr; }
.opst-grid--2 { grid-template-columns: 1fr 1fr; }

.opst-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.opst-card--full { grid-column: 1 / -1; }

.opst-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 0.75rem;
}

.opst-card__title {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.01em;
  margin-bottom: 0.2rem;
}

.opst-card__desc { font-size: 0.8125rem; color: var(--gray-500); }

/* START Email info bar */
.opst-email-info {
  font-size: 0.8125rem;
  color: var(--gray-500);
  margin: 0 0 0.75rem;
  line-height: 1.5;
}
/* END Email info bar */

.opst-card__stat {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--blue);
  text-align: right;
  flex-shrink: 0;
}

/* ================================================================
   CHARTS
   ================================================================ */
.opst-chart-wrap {
  position: relative;
  height: 220px;
}

.opst-chart-wrap--revenue-trend {
  height: 320px;
}

/* START Contacts panel chart wrap height */
.opst-chart-wrap--contacts2 {
  height: 300px;
}

@media (max-width: 900px) {
  #opst-panel-contacts .opst-chart-wrap.opst-chart-wrap--contacts2 {
    height: 300px;
    min-height: 300px;
  }
}
/* END Contacts panel chart wrap height */

/* ================================================================
   SKELETON LOADING
   ================================================================ */
@keyframes opst-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

.opst-skeleton { animation: opst-pulse 1.5s ease-in-out infinite; }
.opst-skeleton canvas { opacity: 0.3; }

.opst-skel-line {
  background: var(--gray-200);
  border-radius: 4px;
  display: block;
}

.opst-skel-line--lg { height: 28px; width: 80%; margin-bottom: 0.375rem; }
.opst-skel-line--sm { height: 16px; width: 50%; }

/* ================================================================
   TABLES
   ================================================================ */
.opst-table-wrap { overflow-x: auto; }

.opst-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }

.opst-table th {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--gray-500);
  text-align: left;
  padding: 0 0.875rem 0.75rem;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

.opst-table th.right { text-align: right; }

.opst-table td {
  padding: 0.75rem 0.875rem;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
  color: var(--gray-700);
}

.opst-table tr:last-child td { border-bottom: none; }
.opst-table tr:hover td { background: var(--gray-50); }

.opst-table .right { text-align: right; }
.opst-table .bold  { font-weight: 700; color: var(--gray-900); }
.opst-table .blue  { font-weight: 700; color: var(--blue); }
.opst-table .muted { color: var(--gray-400); }

/* Rate bar in email table */
.opst-rate { display: flex; align-items: center; gap: 0.5rem; }
.opst-rate-bar { flex: 1; height: 6px; background: var(--gray-100); border-radius: 3px; overflow: hidden; min-width: 60px; }
.opst-rate-fill { height: 100%; border-radius: 3px; }
.opst-rate-fill--open  { background: var(--blue); }
.opst-rate-fill--click { background: #7c3aed; }
.opst-rate-num { font-size: 0.75rem; font-weight: 600; color: var(--gray-700); width: 38px; text-align: right; flex-shrink: 0; }

/* Source bar */
.opst-src-bar { flex: 1; height: 6px; background: var(--blue-light); border-radius: 3px; overflow: hidden; }
.opst-src-fill { height: 100%; border-radius: 3px; background: var(--blue); }

/* ================================================================
   FUNNEL
   ================================================================ */
.opst-funnel-wrap { display: flex; flex-direction: column; gap: 0.25rem; }

.opst-funnel-row {
  display: grid;
  grid-template-columns: 180px 1fr 72px 56px;
  align-items: center;
  gap: 1rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--gray-100);
}

.opst-funnel-row:last-child { border-bottom: none; }
.opst-funnel-stage { font-size: 0.8125rem; font-weight: 500; color: var(--gray-700); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.opst-funnel-bar-wrap { background: var(--gray-100); border-radius: 4px; height: 10px; overflow: hidden; }
.opst-funnel-bar { height: 100%; border-radius: 4px; background: var(--blue); transition: width 0.8s cubic-bezier(0.16,1,0.3,1); }

.opst-funnel-count { font-family: 'Montserrat', sans-serif; font-size: 0.875rem; font-weight: 700; color: var(--gray-900); text-align: right; }
.opst-funnel-pct   { font-size: 0.75rem; color: var(--gray-400); text-align: right; }

.opst-funnel-dropoff {
  font-size: 0.6875rem;
  color: var(--red);
  font-weight: 600;
  padding: 0.15rem 0 0.15rem 192px;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* ================================================================
   LTV STATS
   ================================================================ */
.opst-ltv-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 0 0 1rem;
}

.opst-ltv-stat__label { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gray-500); margin-bottom: 0.3rem; }
.opst-ltv-stat__value { font-family: 'Montserrat', sans-serif; font-size: 1.25rem; font-weight: 700; color: var(--gray-900); }

/* ================================================================
   NOTICE
   ================================================================ */
.opst-notice {
  padding: 0.875rem 1.125rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin: 1rem 0;
}
.opst-notice--warning { background: var(--amber-bg); border: 1px solid #fde68a; color: var(--amber); }
.opst-notice--error   { background: var(--red-bg);   border: 1px solid #fecaca; color: var(--red); }
.opst-notice a { font-weight: 600; color: inherit; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 900px) {
  .opst-layout {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }

  .opst-main {
    height: auto;
    overflow-y: visible;
    padding: 1rem;
  }

  .opst-mobile-header {
    display: flex;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  }

  .opst-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 260px;
    height: 100vh;
    z-index: 300;
    transition: left 0.25s ease;
    overflow-y: auto;
    padding-top: calc(var(--wp-admin--admin-bar--height, 0px) + 1.25rem);
  }

  .opst-sidebar--open {
    left: 0;
  }

  .opst-kpi {
    min-width: 0;
    overflow: hidden;
  }

  .opst-kpi__value {
    word-break: break-word;
  }

  .opst-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .opst-kpi-grid--3 { grid-template-columns: repeat(2, 1fr); }
  .opst-kpi-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .opst-kpi-grid--5 { grid-template-columns: repeat(2, 1fr); }
  .opst-kpi-grid--6 { grid-template-columns: repeat(2, 1fr); }
  .opst-grid--2 { grid-template-columns: 1fr; }

  .opst-product-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .opst-product-toolbar__controls {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .opst-product-toolbar__controls select,
  .opst-product-toolbar__controls input {
    flex: 1 1 calc(50% - 0.25rem);
    min-width: 0;
  }

  .opst-product-toolbar__search {
    flex: 1 1 100%;
  }

  #opst-overview-top-products .opst-overview-signal-body {
    min-height: 180px;
    max-height: 320px;
  }

  #opst-panel-contacts .opst-page-header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  #opst-panel-contacts .opst-page-header .opst-page-subtitle {
    flex-basis: 100%;
    margin-top: 0;
  }

  #opst-panel-contacts .opst-chart-wrap {
    height: 220px;
  }

  .opst--full-viewport .opst-layout {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .opst--full-viewport .opst-sidebar {
    height: 100vh;
    min-height: unset;
    overflow-y: auto;
    position: fixed;
  }

  .opst--full-viewport .opst-main {
    height: auto;
    min-height: unset;
    overflow-y: visible;
  }

  .opst-page-header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .opst-last-updated {
    display: none;
  }

  .opst-page-header .opst-range-trigger {
    flex: 0 0 auto;
    margin-left: 0;
    max-width: 100%;
  }

  .opst-header-actions {
    flex-wrap: wrap;
    gap: 0.5rem;
    max-width: 100%;
  }

  .opst-kpi__label {
    font-size: 0.6rem;
    line-height: 1.2;
  }

  .opst-kpi__change {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  #opst-products-table table {
    min-width: 600px;
  }

  #opst-products-table th,
  #opst-products-table td {
    white-space: nowrap;
  }

  #opst-products-table th:nth-child(2),
  #opst-products-table td:nth-child(2) {
    min-width: 160px;
    white-space: normal;
  }

  #opst-panel-contacts .opst-contact-growth-comparison,
  #opst-panel-contacts .opst-cg-headline,
  #opst-panel-contacts .opst-contact-growth-chart-shell,
  #opst-panel-contacts .opst-card__header.opst-contact-growth-header {
    min-height: unset;
  }
}

@media (max-width: 600px) {
  .opst-main { padding: 1rem; }
  .opst-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .opst-kpi-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .opst-kpi-grid--5 { grid-template-columns: repeat(2, 1fr); }
  .opst-kpi-grid--6 { grid-template-columns: repeat(2, 1fr); }
  .opst-funnel-row { grid-template-columns: 100px 1fr 50px; }
  .opst-funnel-pct { display: none; }
  .opst-funnel-dropoff { padding-left: 110px; }
}

/* ================================================================
   START Sync button styles
   ================================================================ */

.opst-sync-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  background: #2563eb;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.15s, opacity 0.15s;
  padding: 0;
}

.opst-sync-btn svg {
  width: 13px;
  height: 13px;
  fill: #fff;
  flex-shrink: 0;
}

.opst-sync-btn:hover {
  background: #1d4ed8;
  transform: scale(1.08);
}

.opst-sync-btn:active {
  transform: scale(0.95);
}

.opst-sync-btn--global {
  width: 32px;
  height: 32px;
  min-width: 32px;
}

.opst-sync-btn--global svg {
  width: 15px;
  height: 15px;
}

/* KPI card sync button -- positioned bottom-right of card */
.opst-kpi {
  position: relative;
}

.opst-sync-btn--kpi {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  min-width: 22px;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, transform 0.15s;
}

.opst-sync-btn--kpi svg {
  width: 10px;
  height: 10px;
}

.opst-kpi:hover .opst-sync-btn--kpi {
  opacity: 1;
}

/* Spin animation applied to the svg itself for fill-based icons */
.opst-sync-btn--spinning svg {
  animation: opst-spin 0.8s linear infinite;
}

@keyframes opst-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.opst-sync-btn--spinning {
  opacity: 0.7 !important;
  pointer-events: none;
}

.opst-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ================================================================
   END Sync button styles
   ================================================================ */

   /* START Email performance panel */
.opst-page-subtitle {
  font-size: 0.8125rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
}

.opst-email-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(100%, 620px);
  flex-shrink: 0;
}

.opst-email-controls__top {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
}

.opst-email-controls__search {
  width: 100%;
}

.opst-email-search,
.opst-email-group,
.opst-email-limit {
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  background: var(--white);
  color: var(--gray-700);
  font-family: 'Nunito', sans-serif;
  font-size: 0.8125rem;
  min-height: 34px;
}

.opst-email-search {
  width: 100%;
  padding: 0.45rem 0.75rem;
}

.opst-email-group,
.opst-email-limit {
  padding: 0.45rem 0.65rem;
}

.opst-email-limit {
  min-width: 96px;
}

.opst-email-search:focus,
.opst-email-group:focus,
.opst-email-limit:focus {
  border-color: var(--blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

@media (max-width: 820px) {
  .opst-card__header {
    align-items: stretch;
    flex-direction: column;
  }

  .opst-email-controls {
    width: 100%;
  }

  .opst-email-controls__top {
    grid-template-columns: 1fr;
  }
}

.opst-email-confidence {
  background: var(--blue-light);
  border: 1px solid var(--blue-mid);
  color: var(--blue-dark);
  border-radius: 8px;
  padding: 0.625rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.opst-email-subject {
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.35;
}

.opst-email-alias {
  color: var(--gray-400);
  font-size: 0.75rem;
  margin-top: 0.2rem;
  line-height: 1.3;
}

.opst-email-type {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.45rem;
  border-radius: 999px;
  background: var(--gray-100);
  color: var(--gray-500);
  font-size: 0.6875rem;
  font-weight: 700;
  margin-left: 0.35rem;
  vertical-align: middle;
}

.opst-email-attribution-card {
  margin-top: 1rem;
}

.opst-beta-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: var(--blue-light);
  color: var(--blue-dark);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  vertical-align: middle;
  margin-left: 0.4rem;
}

.opst-email-attribution-status {
  color: var(--gray-500);
  font-size: 0.8125rem;
  font-weight: 700;
  margin-bottom: 1rem;
}


/* START Email subject deep link */
.opst-email-subject a.opst-ontraport-link {
  color: inherit;
  text-decoration: none;
  font-weight: 700;
}

.opst-email-subject a.opst-ontraport-link:hover {
  color: var(--blue);
  text-decoration: underline;
}

.opst-ontraport-link__arrow {
  font-size: 0.75em;
  opacity: 0.5;
  margin-left: 0.2em;
}

.opst-email-subject a.opst-ontraport-link:hover .opst-ontraport-link__arrow {
  opacity: 1;
}
/* END Email subject deep link */


.opst-empty-state {
  padding: 2rem;
  text-align: center;
  color: var(--gray-500);
  background: var(--gray-50);
  border-radius: 10px;
  border: 1px dashed var(--gray-300);
}
/* END Email performance panel */


/* START Sender Health settings action alignment */
.opst .opst-sh-settings-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.opst .opst-sh-settings-status {
  flex: 1 1 auto;
  min-width: 180px;
  text-align: right;
}

.opst .opst-sh-save-settings-btn {
  margin-left: auto;
}
/* END Sender Health settings action alignment */


/* START Sender Health loading and actions */
.opst-sh-loading-card{display:flex;align-items:center;gap:.9rem;background:#fff;border:1px solid #e5e7eb;border-radius:14px;box-shadow:0 1px 3px rgba(0,0,0,.08);padding:1.25rem}
.opst-sh-loading-icon{width:34px;height:34px;border-radius:999px;background:#eff6ff;color:#2563eb;display:flex;align-items:center;justify-content:center;font-weight:900;animation:opst-spin-ccw .9s linear infinite}
.opst-sh-loading-title{font-family:'Montserrat',sans-serif;font-weight:800;color:#111827;font-size:.95rem}
.opst-sh-loading-message{font-size:.84rem;color:#6b7280;margin-top:.15rem}
.opst-sh-card-actions{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;justify-content:flex-end}
.opst-sh-mini-btn{border:1px solid #bfdbfe;background:#fff;color:#2563eb;border-radius:999px;padding:.32rem .65rem;font-family:'Nunito',sans-serif;font-size:.72rem;font-weight:900;cursor:pointer}
.opst-sh-mini-btn:hover{background:#eff6ff;border-color:#93c5fd}
.opst-sh-mini-btn:disabled{opacity:.6;cursor:not-allowed}
/* END Sender Health loading and actions */

/* START Lifetime Value chart polish */
.opst-chart-wrap--ltv { height: 210px; }

@media (max-width: 700px) {
  .opst-ltv-stats { grid-template-columns: 1fr; }
  .opst-chart-wrap--ltv { height: 240px; }
}
/* END Lifetime Value chart polish */

/* START Contacts Funnel MVP */
.opst-contacts-funnel-app {
  font-family: 'Nunito', sans-serif;
  color: #374151;
  min-height: 180px;
}

.opst-contacts-funnel-topbar {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  margin: -.15rem 0 .85rem;
}

.opst-contacts-funnel-topbar label {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  min-width: min(100%, 320px);
  font-size: .75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #6b7280;
}

.opst-contacts-funnel-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.opst-contacts-funnel-panel-label {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  min-width: min(100%, 260px);
  padding-top: .12rem;
}

.opst-contacts-funnel-panel-label strong {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-size: .9rem;
  color: #111827;
}

.opst-contacts-funnel-panel-label span {
  display: block;
  font-size: .8rem;
  line-height: 1.35;
  color: #6b7280;
}

.opst-contacts-funnel-actions {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.opst-contacts-funnel-actions [aria-pressed="true"] {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.opst-contacts-funnel-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}

.opst-contacts-funnel-kpi {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  padding: .8rem .9rem;
}

.opst-contacts-funnel-kpi span {
  display: block;
  font-size: .68rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #6b7280;
  margin-bottom: .25rem;
}

.opst-contacts-funnel-kpi strong {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.2rem;
  line-height: 1.15;
  color: #111827;
}

.opst-contacts-funnel-body {
  margin-top: .75rem;
}

.opst-contacts-table-wrap {
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}

.opst-contacts-table {
  margin: 0;
}

.opst-contacts-id {
  font-weight: 900;
  color: #111827;
}

.opst-contacts-stage-list {
  display: grid;
  gap: .85rem;
}

.opst-contacts-stage-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  padding: .9rem;
}

.opst-contacts-stage-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .65rem;
}

.opst-contacts-stage-card__head strong {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-size: .95rem;
  color: #111827;
}

.opst-contacts-stage-card__head span,
.opst-contacts-stage-card__head em {
  font-size: .78rem;
  color: #6b7280;
  font-style: normal;
  font-weight: 800;
}

.opst-contacts-stage-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-bottom: .7rem;
}

.opst-contacts-stage-tags span {
  display: inline-flex;
  gap: .35rem;
  align-items: center;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 999px;
  padding: .3rem .55rem;
  font-size: .75rem;
  color: #6b7280;
}

.opst-contacts-stage-tags strong {
  color: #111827;
}

.opst-contacts-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.opst-contacts-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #2563eb;
  border-radius: 999px;
  padding: .26rem .52rem;
  font-size: .75rem;
  font-weight: 900;
  text-decoration: none;
}

.opst-contacts-chip:hover {
  border-color: #93c5fd;
  background: #dbeafe;
  color: #1d4ed8;
}

.opst-contacts-muted,
.opst-contacts-note,
.opst-contacts-confidence {
  font-size: .8125rem;
  color: #6b7280;
  line-height: 1.45;
}

.opst-contacts-note {
  margin: .55rem 0;
}

.opst-contacts-confidence {
  margin-top: .85rem;
  border-top: 1px solid #eef2f7;
  padding-top: .75rem;
}

.opst-contacts-empty {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: 1rem;
  border: 1px dashed #d1d5db;
  border-radius: 12px;
  background: #f9fafb;
  color: #6b7280;
}

.opst-contacts-empty strong {
  color: #111827;
  font-family: 'Montserrat', sans-serif;
}

.opst-contacts-empty--error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

@media (max-width: 900px) {
  .opst-contacts-funnel-kpis {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}

@media (max-width: 640px) {
  .opst-contacts-funnel-topbar,
  .opst-contacts-funnel-toolbar,
  .opst-contacts-funnel-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .opst-contacts-funnel-topbar label,
  .opst-contacts-funnel-panel-label,
  .opst-contacts-funnel-actions {
    width: 100%;
    margin-left: 0;
  }

  .opst-contacts-funnel-kpis {
    grid-template-columns: 1fr;
  }
}
/* END Contacts Funnel MVP */

/* START Contacts deep link context */
.opst-contacts-funnel-context{
  display:flex;
  flex-direction:column;
  gap:.15rem;
  margin:0 0 .85rem;
  padding:.75rem .85rem;
  border:1px solid #e5e7eb;
  border-radius:12px;
  background:#f9fafb;
}
.opst-contacts-funnel-context span{
  font-size:.72rem;
  font-weight:900;
  letter-spacing:.05em;
  text-transform:uppercase;
  color:#6b7280;
}
.opst-contacts-funnel-context strong{
  font-family:'Montserrat',sans-serif;
  font-size:.98rem;
  color:#111827;
}
/* END Contacts deep link context */


/* START Funnel inline contacts panel */
.opst-funnel-inline-contacts {
  margin-top: 1rem;
  border: 1px solid #dbeafe;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  padding: 1rem;
}

.opst-funnel-inline-contacts__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.opst-funnel-inline-contacts__eyebrow {
  color: #2563eb;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: .15rem;
}

.opst-funnel-inline-contacts__title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  color: #111827;
}

.opst-funnel-inline-contacts__desc {
  color: #6b7280;
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.35;
  margin-top: .18rem;
}

.opst-funnel-inline-contacts__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .55rem;
  flex-wrap: wrap;
}

.opst-funnel-inline-contacts__kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: .65rem;
  margin-bottom: .85rem;
}

.opst-funnel-inline-contacts__kpis > div {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  padding: .72rem .78rem;
}

.opst-funnel-inline-contacts__kpis span {
  display: block;
  color: #6b7280;
  font-size: .66rem;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: .22rem;
}

.opst-funnel-inline-contacts__kpis strong {
  display: block;
  color: #111827;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.1rem;
  line-height: 1.15;
}

.opst-funnel-inline-contacts__section-title {
  color: #374151;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin: .35rem 0 .5rem;
}

.opst-funnel-inline-contact-list {
  display: grid;
  gap: .45rem;
}

.opst-funnel-inline-contact-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  padding: .65rem .7rem;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
}

.opst-funnel-inline-contact-row strong {
  display: block;
  color: #111827;
  font-size: .88rem;
  font-weight: 900;
}

.opst-funnel-inline-contact-row span {
  display: block;
  color: #6b7280;
  font-size: .76rem;
  font-weight: 800;
  margin-top: .12rem;
}

.opst-funnel-inline-contact-row a {
  flex-shrink: 0;
  color: #2563eb;
  font-size: .78rem;
  font-weight: 900;
  text-decoration: none;
}

.opst-funnel-inline-stages {
  margin-top: .85rem;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  padding: .75rem .85rem;
}

.opst-funnel-inline-stages summary {
  cursor: pointer;
  color: #374151;
  font-size: .82rem;
  font-weight: 900;
}

.opst-funnel-inline-stage-list {
  display: grid;
  gap: .4rem;
  margin-top: .65rem;
}

.opst-funnel-inline-stage-row {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  color: #4b5563;
  font-size: .8rem;
  font-weight: 800;
}

.opst-funnel-inline-stage-row strong {
  color: #111827;
}

.opst-funnel-inline-contacts__loading,
.opst-funnel-inline-contacts__empty,
.opst-funnel-inline-contacts__note,
.opst-funnel-inline-contacts__confidence {
  color: #6b7280;
  font-size: .8rem;
  font-weight: 800;
  line-height: 1.4;
}

.opst-funnel-inline-contacts__empty {
  border: 1px dashed #d1d5db;
  border-radius: 12px;
  background: #fff;
  padding: .8rem .85rem;
}

.opst-funnel-inline-contacts__empty strong,
.opst-funnel-inline-contacts__empty span {
  display: block;
}

.opst-funnel-inline-contacts__empty strong {
  color: #374151;
  margin-bottom: .18rem;
}

.opst-funnel-inline-contacts__note {
  margin-top: .55rem;
}

.opst-funnel-inline-contacts__confidence {
  margin-top: .85rem;
  padding-top: .75rem;
  border-top: 1px solid #e5e7eb;
}

@media (max-width: 760px) {
  .opst-funnel-inline-contacts__kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .opst-funnel-inline-contact-row {
    align-items: flex-start;
    flex-direction: column;
  }
}
/* END Funnel inline contacts panel */


/* START Contact hydration display polish */
.opst-contacts-table td > span,
.opst-funnel-inline-contact-row span {
  display: block;
  margin-top: 3px;
  color: #667085;
  font-size: 12px;
  line-height: 1.35;
}

.opst-contacts-table td > strong,
.opst-funnel-inline-contact-row strong {
  color: #101828;
}
/* END Contact hydration display polish */

/* ================================================================
   CONTACTS PAGE POLISH
   ================================================================ */
.opst-contact-growth-header {
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.opst-contact-growth-header > div:first-child {
  flex: 1 1 220px;
  min-width: 0;
}

.opst-contact-growth-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 0.75rem;
  flex: 0 1 360px;
  min-width: min(100%, 340px);
}

#opst-panel-contacts .opst-chart-wrap {
  max-width: 100%;
  overflow: hidden;
}

#opst-panel-contacts .opst-chart-wrap canvas {
  max-width: 100%;
}

.opst-contact-growth-stat {
  border: 1px solid var(--gray-200);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-radius: 0.8rem;
  padding: 0.7rem 0.85rem;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.opst-contact-growth-stat--wide {
  grid-column: span 2;
}

.opst-contact-growth-stat span {
  display: block;
  font-size: 0.67rem;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: 0.35rem;
}

.opst-contact-growth-stat strong {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.15rem;
  line-height: 1.15;
  color: var(--gray-900);
}

.opst-contacts-action-grid {
  margin-top: 1rem;
}

.opst-contacts-preview-card .opst-card__header {
  align-items: flex-start;
}

.opst-contacts-placeholder-card {
  min-height: 12rem;
}

.opst-contacts-placeholder-card .opst-card__desc {
  max-width: 28rem;
}


.opst-contacts-coming-soon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--blue-200, #bfdbfe);
  background: #eff6ff;
  color: var(--blue, #2563eb);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

.opst-contacts-preview-card__body {
  border: 1px dashed var(--blue-200, #bfdbfe);
  background: #f8fbff;
  border-radius: 0.9rem;
  padding: 1rem;
  min-height: 6.25rem;
}

.opst-contacts-preview-card__body strong {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  color: var(--gray-900);
  margin-bottom: 0.45rem;
}

.opst-contacts-preview-card__body span {
  display: block;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--gray-500);
}

@media (max-width: 900px) {
  .opst-contact-growth-header {
    flex-direction: column;
  }

  .opst-contact-growth-header > div:first-child {
    flex: 0 0 auto;
  }

  .opst-contact-growth-stats {
    width: 100%;
    min-width: 0;
    flex-basis: 100%;
  }
}

@media (max-width: 640px) {
  .opst-contact-growth-stats {
    grid-template-columns: 1fr;
  }

  .opst-contact-growth-stat--wide {
    grid-column: span 1;
  }
}

/* START Contacts spacing and mobile polish v2.2.155 */
#opst-panel-contacts,
#opst-panel-contacts .opst-card,
#opst-panel-contacts .opst-chart-wrap {
  min-width: 0;
}

#opst-panel-contacts .opst-card__header.opst-contact-growth-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

#opst-panel-contacts .opst-contact-growth-stats {
  justify-content: end;
}

#opst-panel-contacts .opst-chart-wrap {
  width: 100%;
  max-width: 100%;
  height: clamp(210px, 28vw, 320px);
}

#opst-panel-contacts .opst-chart-wrap canvas {
  max-width: 100% !important;
}

.opst-contacts-funnel-topbar {
  margin: -2.45rem 0 .75rem;
}

.opst-contacts-funnel-context {
  margin-bottom: .7rem;
}

.opst-contacts-funnel-toolbar {
  align-items: center;
  margin-bottom: .75rem;
}

.opst-contacts-funnel-panel-label {
  gap: .12rem;
  padding-top: 0;
}

.opst-contacts-funnel-panel-eyebrow {
  display: block;
  font-size: .66rem;
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: .065em;
  text-transform: uppercase;
  color: #6b7280;
}

.opst-contacts-funnel-panel-label strong {
  font-size: .98rem;
  line-height: 1.2;
}

.opst-contacts-funnel-panel-desc {
  display: block;
  max-width: 560px;
  font-size: .8rem;
  line-height: 1.35;
  color: #6b7280;
}

.opst-contacts-funnel-kpis {
  margin-bottom: .75rem;
}

.opst-contacts-funnel-body {
  margin-top: .35rem;
}

.opst-contacts-table-wrap .opst-contacts-table th {
  padding-top: .45rem;
  padding-bottom: .55rem;
  vertical-align: middle;
}

@media (max-width: 900px) {
  .opst-contacts-funnel-topbar {
    margin: 0 0 .75rem;
  }

  #opst-panel-contacts .opst-contact-growth-stats {
    justify-content: stretch;
  }
}

@media (max-width: 820px) {
  #opst-panel-contacts .opst-card__header.opst-contact-growth-header {
    flex-direction: column;
    align-items: stretch;
  }

  #opst-panel-contacts .opst-contact-growth-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 640px) {
  #opst-panel-contacts .opst-card {
    padding: 1rem;
  }

  #opst-panel-contacts .opst-contact-growth-stats {
    grid-template-columns: 1fr;
  }

  #opst-panel-contacts .opst-chart-wrap {
    height: 240px;
  }

  .opst-contacts-funnel-toolbar {
    gap: .75rem;
  }

  .opst-contacts-funnel-panel-label {
    width: 100%;
  }

  .opst-contacts-funnel-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .opst-contacts-funnel-actions .opst-funnel-secondary {
    width: 100%;
    justify-content: center;
  }
}
/* END Contacts spacing and mobile polish v2.2.155 */

/* START Contacts funnel header cleanup v2.2.156 */
.opst-contacts-funnel-card {
  overflow: hidden;
}

.opst-contacts-funnel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1rem;
}

.opst-contacts-funnel-heading {
  min-width: 0;
}

.opst-contacts-funnel-header .opst-contacts-funnel-topbar {
  flex: 0 1 360px;
  margin: 0 !important;
  align-self: flex-start;
}

.opst-contacts-funnel-header .opst-contacts-funnel-topbar label {
  min-width: 0;
  width: 100%;
}

.opst-contacts-funnel-context {
  margin-top: .45rem;
  margin-bottom: 1rem;
}

.opst-contacts-funnel-toolbar {
  align-items: flex-start;
  gap: 1rem;
  margin-top: .15rem;
  margin-bottom: .85rem;
}

.opst-contacts-funnel-panel-label {
  gap: .24rem;
  padding-top: .15rem;
}

.opst-contacts-funnel-panel-eyebrow {
  display: none;
}

.opst-contacts-funnel-panel-label strong {
  font-size: 1rem;
  line-height: 1.2;
}

.opst-contacts-funnel-panel-desc {
  max-width: 620px;
  font-size: .82rem;
  line-height: 1.45;
}

.opst-contacts-funnel-body {
  margin-top: .45rem;
}

@media (max-width: 820px) {
  .opst-contacts-funnel-header {
    flex-direction: column;
    align-items: stretch;
    gap: .85rem;
  }

  .opst-contacts-funnel-header .opst-contacts-funnel-topbar {
    flex-basis: auto;
    width: 100%;
  }

  #opst-panel-contacts .opst-card__header.opst-contact-growth-header {
    gap: .85rem;
  }
}

@media (max-width: 640px) {
  .opst-contacts-funnel-context {
    margin-bottom: .9rem;
  }

  .opst-contacts-funnel-toolbar {
    gap: .85rem;
  }

  .opst-contacts-funnel-panel-desc {
    font-size: .8rem;
  }
}
/* END Contacts funnel header cleanup v2.2.156 */

/* START Overview/Sales responsive chart cleanup v2.2.160 */
#opst-panel-overview,
#opst-panel-revenue,
#opst-panel-overview .opst-card,
#opst-panel-revenue .opst-card,
#opst-panel-overview .opst-chart-wrap,
#opst-panel-revenue .opst-chart-wrap {
  min-width: 0;
}

#opst-panel-overview .opst-chart-wrap,
#opst-panel-revenue .opst-chart-wrap {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

#opst-panel-overview .opst-chart-wrap canvas,
#opst-panel-revenue .opst-chart-wrap canvas {
  display: block;
  max-width: 100% !important;
}

#opst-panel-overview .opst-chart-wrap {
  height: clamp(220px, 28vw, 320px);
}

#opst-panel-revenue .opst-chart-wrap--revenue-trend,
#opst-panel-revenue .opst-chart-wrap--ltv {
  height: clamp(240px, 32vw, 340px);
}

.opst-ltv-empty-state {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.25rem;
  border: 1px dashed var(--blue-mid);
  background: #f8fbff;
  border-radius: 0.9rem;
  color: var(--gray-500);
  font-size: 0.875rem;
  line-height: 1.45;
}

.opst-ltv-empty-state strong {
  display: block;
  font-family: 'Montserrat', sans-serif;
  color: var(--gray-900);
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

@media (max-width: 900px) {
  #opst-panel-overview .opst-chart-wrap,
  #opst-panel-revenue .opst-chart-wrap--revenue-trend,
  #opst-panel-revenue .opst-chart-wrap--ltv {
    height: 260px;
  }
}

@media (max-width: 640px) {
  .opst-card {
    padding: 1rem;
  }

  #opst-panel-overview .opst-chart-wrap,
  #opst-panel-revenue .opst-chart-wrap--revenue-trend,
  #opst-panel-revenue .opst-chart-wrap--ltv {
    height: 240px;
  }

  #opst-panel-overview .opst-card__header,
  #opst-panel-revenue .opst-card__header {
    align-items: flex-start;
    gap: 0.55rem;
    margin-bottom: 0.85rem;
  }

  .opst-ltv-empty-state {
    min-height: 180px;
    padding: 1rem;
  }
}
/* END Overview/Sales responsive chart cleanup v2.2.160 */

/* START 2.2.165 Contact revenue buyer panels */
.opst-contacts-live-pill{display:inline-flex;align-items:center;justify-content:center;border:1px solid #bfdbfe;background:#eff6ff;color:#1d4ed8;border-radius:999px;padding:.28rem .58rem;font-size:.68rem;font-weight:800;letter-spacing:.04em;text-transform:uppercase;white-space:nowrap}
.opst-contacts-buyer-list{gap:.65rem}
.opst-contacts-buyer-list__rows{display:flex;flex-direction:column;gap:.55rem;width:100%}
.opst-contacts-buyer-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.75rem;align-items:flex-start;border:1px solid #eef2f7;background:#fff;border-radius:12px;padding:.72rem .78rem}
.opst-contacts-buyer-row__main{display:flex;flex-direction:column;gap:.16rem;min-width:0}
.opst-contacts-buyer-row__main strong{font-size:.88rem;line-height:1.25;color:#111827;overflow-wrap:anywhere}
.opst-contacts-buyer-row__main span{font-size:.76rem;color:#6b7280;line-height:1.35}
.opst-contacts-buyer-row__main small{font-size:.72rem;color:#4b5563;line-height:1.35;overflow-wrap:anywhere}
.opst-contacts-buyer-row__value{display:flex;flex-direction:column;gap:.18rem;align-items:flex-end;text-align:right;white-space:nowrap}
.opst-contacts-buyer-row__value strong{font-family:'Montserrat',sans-serif;font-size:.95rem;color:#111827;line-height:1.2}
.opst-contacts-buyer-row__value span{font-size:.68rem;color:#6b7280;background:#f3f4f6;border-radius:999px;padding:.18rem .42rem}
.opst-contacts-buyer-meta{font-size:.72rem;color:#6b7280;border-top:1px solid #eef2f7;padding-top:.65rem;width:100%}
.opst-contacts-buyer-empty{display:flex;flex-direction:column;gap:.25rem;border:1px dashed #d1d5db;background:#f9fafb;border-radius:12px;padding:.9rem;width:100%}
.opst-contacts-buyer-empty strong{font-size:.86rem;color:#111827}.opst-contacts-buyer-empty span{font-size:.78rem;color:#6b7280;line-height:1.4}.opst-contacts-buyer-empty--error{border-color:#fecaca;background:#fef2f2}.opst-contacts-buyer-empty--error strong{color:#991b1b}
@media(max-width:760px){.opst-contacts-buyer-row{grid-template-columns:1fr}.opst-contacts-buyer-row__value{align-items:flex-start;text-align:left;white-space:normal}}
/* END 2.2.165 Contact revenue buyer panels */

/* START 2.2.177 Contact buyer card controls */
.opst-contacts-buyer-controls{display:flex;justify-content:flex-end;width:100%;margin-bottom:.45rem;font-size:.75rem;color:#4b5563}
.opst-contacts-buyer-controls label{display:inline-flex;align-items:center;gap:.35rem;font-weight:800}
.opst-contacts-buyer-controls select{min-height:32px;border:1px solid #d1d5db;border-radius:8px;background:#fff;padding:.25rem .55rem;font:inherit;color:#374151}
/* END 2.2.177 Contact buyer card controls */


/* START 2.2.179 fixed-height buyer and funnel contact lists */
.opst-contacts-buyer-list__rows--scroll,
.opst-funnel-inline-contact-list--scroll { max-height: 520px; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; }
/* END 2.2.179 fixed-height buyer and funnel contact lists */

/* START 2.2.180 MVP stabilization styles */
.opst-funnel-stage-report-card:last-child::after{display:none!important}
.opst-funnel-path__arrow:last-child{display:none!important}
.opst-contacts-buyer-scroll-hint{font-size:.75rem;font-weight:800;color:#6b7280;margin:.45rem 0 .2rem;line-height:1.35}
/* END 2.2.180 MVP stabilization styles */

/* START Funnel cohort filtering UI */
.opst-funnel-grid--cohort {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(200px, 1fr);
  gap: 0.85rem;
  align-items: end;
}

.opst-funnel-cohort-help {
  grid-column: 1 / -1;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.45;
}

.opst-funnel-cohort-notice {
  border: 1px solid #2563eb;
  background: #eff6ff;
  color: #1e3a8a;
  border-radius: 14px;
  padding: 0.8rem 0.9rem;
  margin: 0 0 1rem;
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1.45;
}

.opst-funnel-cohort-notice strong {
  display: block;
  color: #172554;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.opst-funnel-cohort-notice span {
  display: block;
}

.opst-funnel-cohort-notice ul {
  margin: 0.45rem 0 0 1.1rem;
  padding: 0;
}

.opst-funnel-cohort-notice.is-approximate {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #92400e;
}

.opst-funnel-cohort-notice.is-approximate strong {
  color: #78350f;
}

@media (max-width: 900px) {
  .opst-funnel-grid--cohort {
    grid-template-columns: 1fr;
  }
}
/* END Funnel cohort filtering UI */

/* START 2.2.215 Contacts buyer value summary card */
.opst-contacts-buyer-summary{gap:.75rem}
.opst-buyer-value-summary-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.65rem;width:100%}
.opst-buyer-value-summary-stat{border:1px solid #e5e7eb;background:#fff;border-radius:12px;padding:.78rem .82rem;min-width:0}
.opst-buyer-value-summary-stat span{display:block;font-size:.68rem;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:#6b7280;margin-bottom:.32rem}
.opst-buyer-value-summary-stat strong{font-family:'Montserrat',sans-serif;font-size:1.08rem;line-height:1.15;color:#111827;overflow-wrap:anywhere}
.opst-buyer-value-summary-foot{border-top:1px solid #eef2f7;padding-top:.7rem;width:100%;display:flex;flex-direction:column;gap:.22rem;color:#6b7280;font-size:.76rem;line-height:1.35}
.opst-buyer-value-summary-foot strong{font-family:'Montserrat',sans-serif;font-size:.88rem;color:#111827;margin:0}
.opst-buyer-value-summary-foot span{font-size:.76rem;color:#4b5563}
.opst-buyer-value-summary-foot em{font-style:normal;font-size:.72rem;color:#6b7280}
@media(max-width:640px){.opst-buyer-value-summary-grid{grid-template-columns:1fr}}
/* END 2.2.215 Contacts buyer value summary card */

/* START 2.2.216 Contacts buyer summary expansion and warning cleanup */
.opst-contacts-buyer-list,
.opst-contacts-buyer-summary {
  border: 1px solid #e5e7eb;
  background: #fbfdff;
  border-radius: 0.9rem;
}
.opst-buyer-sample-note {
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #92400e;
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.4;
  width: 100%;
}
.opst-buyer-sample-note strong {
  display: block;
  color: #78350f;
  margin: 0 0 0.2rem;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.84rem;
}
.opst-buyer-value-summary-grid--dense {
  gap: 0.55rem;
}
.opst-buyer-value-summary-grid--dense .opst-buyer-value-summary-stat {
  padding: 0.62rem 0.68rem;
}
.opst-buyer-value-summary-grid--dense .opst-buyer-value-summary-stat strong {
  font-size: 0.98rem;
}
.opst-buyer-value-insight {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
  border-radius: 12px;
  padding: 0.72rem 0.78rem;
  width: 100%;
  line-height: 1.4;
}
.opst-buyer-value-insight strong {
  display: block;
  margin: 0 0 0.24rem;
  color: #172554;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.84rem;
}
.opst-buyer-value-insight span {
  display: block;
  color: #1e40af;
  font-size: 0.76rem;
  font-weight: 800;
}
.opst-buyer-value-distribution {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  width: 100%;
  border-top: 1px solid #eef2f7;
  padding-top: 0.7rem;
}
.opst-buyer-value-distribution > strong {
  color: #111827;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.86rem;
  margin: 0 0 0.1rem;
}
.opst-buyer-value-bucket {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: #6b7280;
}
.opst-buyer-value-bucket div {
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}
.opst-buyer-value-bucket i {
  display: block;
  height: 100%;
  background: #2563eb;
  border-radius: inherit;
}
.opst-buyer-value-bucket b {
  color: #111827;
  text-align: right;
}
@media(max-width:640px){.opst-buyer-value-bucket{grid-template-columns:64px minmax(0,1fr) 40px}}
/* END 2.2.216 Contacts buyer summary expansion and warning cleanup */

/* START 2.2.218 Contacts buyer value summary layout restore */
.opst-contacts-value-summary-card .opst-card__header {
  margin-bottom: 1.25rem;
}

.opst-contacts-value-summary-card .opst-contacts-buyer-summary {
  padding: 1rem;
  gap: 0.9rem;
  align-content: start;
}

.opst-contacts-value-summary-card .opst-buyer-value-summary-grid,
.opst-contacts-value-summary-card .opst-buyer-value-summary-grid--dense {
  gap: 0.75rem;
}

.opst-contacts-value-summary-card .opst-buyer-value-summary-stat,
.opst-contacts-value-summary-card .opst-buyer-value-summary-grid--dense .opst-buyer-value-summary-stat {
  padding: 0.82rem 0.9rem;
  border-radius: 12px;
}

.opst-contacts-value-summary-card .opst-buyer-value-summary-stat span {
  margin-bottom: 0.35rem;
  font-size: 0.68rem;
}

.opst-contacts-value-summary-card .opst-buyer-value-summary-stat strong,
.opst-contacts-value-summary-card .opst-buyer-value-summary-grid--dense .opst-buyer-value-summary-stat strong {
  font-size: 1.02rem;
}

.opst-contacts-value-summary-card .opst-buyer-value-insight {
  padding: 0.82rem 0.9rem;
  border-radius: 12px;
  line-height: 1.42;
}

.opst-contacts-value-summary-card .opst-buyer-value-insight strong {
  margin-bottom: 0.25rem;
  font-size: 0.86rem;
}

.opst-contacts-value-summary-card .opst-buyer-value-insight span {
  font-size: 0.76rem;
  line-height: 1.4;
}

.opst-contacts-value-summary-card .opst-buyer-value-distribution {
  gap: 0.48rem;
  padding-top: 0.82rem;
}

.opst-contacts-value-summary-card .opst-buyer-value-distribution > strong {
  font-size: 0.86rem;
  margin-bottom: 0.05rem;
}

.opst-contacts-value-summary-card .opst-buyer-value-bucket {
  grid-template-columns: 76px minmax(0, 1fr) 48px;
  gap: 0.58rem;
  font-size: 0.72rem;
}

.opst-contacts-value-summary-card .opst-buyer-value-bucket div {
  height: 8px;
}

.opst-contacts-value-summary-card .opst-buyer-value-summary-foot {
  padding-top: 0.82rem;
  gap: 0.22rem;
  line-height: 1.35;
}

.opst-contacts-value-summary-card .opst-buyer-value-summary-foot strong {
  font-size: 0.88rem;
}

.opst-contacts-value-summary-card .opst-buyer-value-summary-foot span {
  font-size: 0.76rem;
}

.opst-contacts-value-summary-card .opst-buyer-value-summary-foot em {
  font-size: 0.72rem;
}

@media(max-width:640px){
  .opst-contacts-value-summary-card .opst-contacts-buyer-summary{padding:0.85rem}
  .opst-contacts-value-summary-card .opst-buyer-value-bucket{grid-template-columns:64px minmax(0,1fr) 42px}
}
/* END 2.2.218 Contacts buyer value summary layout restore */

/* START 2.2.219 Buyer value summary height balance */
.opst-contacts-value-summary-card {
  display: flex;
  flex-direction: column;
}

.opst-contacts-value-summary-card .opst-contacts-buyer-summary {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  justify-content: space-between;
  padding-bottom: 1.25rem;
}

.opst-contacts-value-summary-card .opst-buyer-value-summary-foot {
  margin-top: 0.25rem;
  padding-bottom: 0.15rem;
}

.opst-contacts-value-summary-card .opst-buyer-value-distribution {
  margin-bottom: 0.25rem;
}
/* END 2.2.219 Buyer value summary height balance */




/* START 2.2.265 Contacts buyer card height alignment */
#opst-panel-contacts .opst-contacts-action-grid {
  align-items: stretch;
}

#opst-panel-contacts .opst-contacts-buyer-card {
  display: flex;
  flex-direction: column;
}

#opst-panel-contacts .opst-contacts-buyer-card .opst-contacts-preview-card__body {
  flex: 1 1 auto;
}
/* END 2.2.265 Contacts buyer card height alignment */

/* START 2.2.270 Contacts second-row height reset */
#opst-panel-contacts [data-opst-buyer-panel="repeat_buyers"] .opst-contacts-buyer-list__rows--scroll {
  flex: 0 1 auto;
  max-height: 520px;
}

#opst-panel-contacts .opst-contacts-value-summary-card .opst-contacts-buyer-summary {
  flex: 0 1 auto;
  justify-content: flex-start;
}
/* END 2.2.270 Contacts second-row height reset */

/* START Contact segment breakdown */
.opst-contacts-tabs {
  display: flex;
  gap: .5rem;
  margin: 1rem 0 .85rem;
  border-bottom: 1px solid #e5e7eb;
}
.opst-contacts-tab {
  border: 0;
  background: transparent;
  color: #6b7280;
  font: 800 .875rem 'Nunito', sans-serif;
  padding: .7rem .9rem;
  border-bottom: 3px solid transparent;
  cursor: pointer;
}
.opst-contacts-tab.is-active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}
.opst-contacts-tab-panel { margin-top: .85rem; }
/* START Contact Segment Breakdown row layout */
.opst-segment-breakdown { width: 100%; }

.opst-segment-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .9rem;
  padding-bottom: .85rem;
  border-bottom: 1px solid #e5e7eb;
}
.opst-segment-card-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  color: #111827;
  line-height: 1.2;
}
.opst-segment-card-title small {
  color: #6b7280;
  font-weight: 800;
}
.opst-segment-actions { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.opst-segment-action,
.opst-segment-apply,
.opst-segment-export {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #2563eb;
  border-radius: 10px;
  min-height: 34px;
  padding: .38rem .7rem;
  font-size: .75rem;
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
}
.opst-segment-action:hover,
.opst-segment-apply:hover,
.opst-segment-export:hover { background: #dbeafe; }
.opst-segment-field-picker {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: .65rem;
  align-items: center;
  margin-top: .75rem;
}
.opst-segment-field-picker input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  min-height: 38px;
  padding: .45rem .7rem;
  font: 800 .875rem 'Nunito', sans-serif;
}
.opst-segment-field-results {
  grid-column: 1 / -1;
  display: grid;
  gap: .45rem;
  max-height: 260px;
  overflow: auto;
}
.opst-segment-field-option {
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 12px;
  padding: .65rem .75rem;
  text-align: left;
  cursor: pointer;
}
.opst-segment-field-option strong { display: block; color: #111827; font-weight: 900; }
.opst-segment-field-option span { color: #6b7280; font-size: .75rem; font-weight: 800; }
.opst-segment-field-option:hover { border-color: #93c5fd; background: #eff6ff; }
.opst-segment-summary {
  font-size: .8rem;
  color: #6b7280;
  font-weight: 800;
  margin-bottom: .75rem;
}

.opst-segment-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(120px, 240px) 72px 48px;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--gray-100);
}
.opst-segment-row:last-child { border-bottom: none; }

.opst-segment-row__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.opst-segment-row__bar-wrap {
  background: var(--gray-100);
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
}

.opst-segment-row__bar-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 4px;
  min-width: 4px;
}

.opst-segment-row__count {
  text-align: right;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--gray-900);
  font-variant-numeric: tabular-nums;
}

.opst-segment-row__pct {
  text-align: right;
  font-size: 0.8rem;
  color: var(--gray-400);
  font-weight: 600;
}

.opst-segment-header-link {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--blue);
  white-space: nowrap;
  text-decoration: none;
}
.opst-segment-header-link:hover { text-decoration: underline; }

.opst-segment-meta {
  font-size: 0.78rem;
  color: var(--gray-400);
  margin-bottom: 0.75rem;
}


/* START Segment breakdown unknown row */
.opst-segment-divider {
  border-top: 1px solid var(--gray-200);
  margin: 0.35rem 0;
}

.opst-segment-row--unknown {
  opacity: 0.75;
}

.opst-segment-row__bar-fill--unknown {
  background: var(--gray-300);
}

.opst-segment-row__label--muted {
  color: var(--gray-500);
  font-weight: 500;
  font-style: italic;
}

.opst-segment-row__count--muted {
  color: var(--gray-500);
}
/* END Segment breakdown unknown row */

.opst-segment-empty { color: #6b7280; font-size: .875rem; line-height: 1.45; }
@media (max-width: 900px) {
  .opst-segment-row { grid-template-columns: 1fr; gap: .35rem; }
  .opst-segment-row__count,
  .opst-segment-row__pct { text-align: left; }
  .opst-segment-card-header { flex-direction: column; }
  .opst-segment-actions { justify-content: flex-start; }
}
@media (max-width: 600px) {
  .opst-segment-field-picker { grid-template-columns: 1fr; }
}
/* END Contact Segment Breakdown row layout */

/* START Contact Growth backfill progress */
.opst-backfill-progress {
  width: 100%;
  max-width: 520px;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #e5e7eb;
  margin: 0 0 0.5rem;
}

.opst-backfill-progress__bar {
  height: 100%;
  min-width: 6px;
  border-radius: 999px;
  background: #2563eb;
  transition: width 0.25s ease;
}
/* END Contact Growth backfill progress */


/* START Dashboard access denied card */
.opst-access-denied {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 2rem;
}
.opst-access-denied__card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 3rem 2.5rem;
    text-align: center;
    max-width: 420px;
    box-shadow: 0 1px 3px rgba(0,0,0,.07);
}
.opst-access-denied__icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}
.opst-access-denied__title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 .75rem;
}
.opst-access-denied__message {
    font-size: .9rem;
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
}
/* END Dashboard access denied card */

/* START Submission form */
.opst-submit-trigger {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 999;
}
.opst-submit-trigger__btn {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: .65rem 1.25rem;
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37,99,235,.35);
    transition: background .15s, box-shadow .15s;
}
.opst-submit-trigger__btn:hover {
    background: #1d4ed8;
    box-shadow: 0 6px 16px rgba(37,99,235,.45);
}
.opst-submit-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.opst-submit-modal--open {
    display: flex;
}
.opst-submit-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.45);
}
.opst-submit-modal__panel {
    position: relative;
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    margin: 1rem;
    box-shadow: 0 20px 60px rgba(0,0,0,.18);
    display: flex;
    flex-direction: column;
}
.opst-submit-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid #f3f4f6;
}
.opst-submit-modal__title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}
.opst-submit-modal__close {
    background: none;
    border: none;
    font-size: 1rem;
    color: #6b7280;
    cursor: pointer;
    padding: .25rem;
    line-height: 1;
}
.opst-submit-modal__body {
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.opst-submit-modal__foot {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
    padding: 1rem 1.5rem 1.25rem;
    border-top: 1px solid #f3f4f6;
}
.opst-submit-modal__cancel {
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: .5rem 1.1rem;
    font-size: .875rem;
    color: #374151;
    cursor: pointer;
}
.opst-submit-modal__submit {
    background: #2563eb;
    border: none;
    border-radius: 8px;
    padding: .5rem 1.25rem;
    font-size: .875rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
}
.opst-submit-modal__submit:disabled {
    opacity: .6;
    cursor: not-allowed;
}
.opst-submit-field {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.opst-submit-label {
    font-size: .8rem;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.opst-submit-type-toggle {
    display: flex;
    gap: .5rem;
}
.opst-submit-type-btn {
    flex: 1;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: .5rem .75rem;
    font-size: .875rem;
    color: #374151;
    cursor: pointer;
    transition: background .12s, border-color .12s;
}
.opst-submit-type-btn--active {
    background: #eff6ff;
    border-color: #2563eb;
    color: #1d4ed8;
    font-weight: 600;
}
.opst-submit-input,
.opst-submit-textarea {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: .6rem .8rem;
    font-size: .875rem;
    color: #111827;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
}
.opst-submit-input:focus,
.opst-submit-textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.opst-submit-status {
    font-size: .85rem;
    min-height: 1.2em;
}
.opst-submit-status--error { color: #dc2626; }
.opst-submit-status--success { color: #16a34a; }
/* END Submission form */

/* START Feedback sidebar link */
.opst-sidebar__footer--feedback-sidebar {
  border-top: 0;
}
.opst-feedback-sidebar-link {
  display: block;
  font-size: .78rem;
  color: #9ca3af;
  text-decoration: none;
  padding: .25rem 0 .6rem;
  transition: color .15s;
  line-height: 1.4;
  text-align: left;
}
.opst-feedback-sidebar-link:hover {
  color: #6b7280;
  text-decoration: none;
}
.opst-feedback-sidebar-divider {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--gray-100);
  margin: 0;
  padding: 0;
  background-color: transparent;
}
/* END Feedback sidebar link */

/* START Tags tab */
.opst-tag-header-card {
  display: flex;
  align-items: center;
  gap: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
}
.opst-tag-header-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  gap: .2rem;
}
.opst-tag-header-stat__value {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.1;
}
.opst-tag-header-stat__value--small {
  font-size: .9rem;
  font-weight: 600;
  color: #374151;
}
.opst-tag-header-stat__label {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #9ca3af;
}
.opst-tag-header-divider {
  width: 1px;
  height: 2.5rem;
  background: #e5e7eb;
  flex: 0 0 1px;
  margin: 0 1rem;
}

.opst-tag-info-note {
  font-size: .95rem;
  color: #9ca3af;
  margin: -.75rem 0 1.25rem;
  line-height: 1.55;
}
.opst-tag-header-stat__sublabel {
  font-size: .7rem;
  color: #93c5fd;
  font-weight: 500;
  line-height: 1.2;
  margin-top: .1rem;
  min-height: 1em;
}
.opst-tag-row--pinned .opst-tag-row__name {
  font-weight: 600;
  color: #1e3a8a;
}
.opst-tag-row--pinned .opst-tag-row__count {
  font-size: 1rem;
  font-weight: 800;
  color: #1d4ed8;
  background: #dbeafe;
  border-radius: 6px;
  padding: .1rem .5rem;
  min-width: 3.5rem;
  text-align: center;
}
.opst-tag-row__reorder {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 0 0 auto;
}
.opst-tag-reorder-btn {
  background: none;
  border: none;
  font-size: .6rem;
  color: #93c5fd;
  cursor: pointer;
  padding: 0 .2rem;
  line-height: 1;
  transition: color .12s;
}
.opst-tag-reorder-btn:hover {
  color: #2563eb;
}
.opst-tag-row--pinned:first-of-type .opst-tag-reorder-btn[data-dir="up"],
.opst-tag-row--pinned:last-of-type .opst-tag-reorder-btn[data-dir="down"] {
  opacity: .2;
  pointer-events: none;
}

.opst-tag-section-label {
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #6b7280;
}
.opst-tag-watching {
  margin-bottom: 1.5rem;
}
.opst-tag-watching__head {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .65rem;
}
.opst-tag-refresh-btn {
  margin-left: auto;
  background: none;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: .78rem;
  color: #6b7280;
  padding: .2rem .65rem;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  white-space: nowrap;
  flex-shrink: 0;
}
.opst-tag-refresh-btn:hover:not(:disabled) {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #374151;
}
.opst-tag-refresh-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.opst-tag-watching__count {
  background: #f3f4f6;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
  padding: .1rem .45rem;
  color: #374151;
}
.opst-tag-watching__empty {
  font-size: .85rem;
  color: #9ca3af;
  padding: .75rem 0;
}
.opst-tag-watching__updated {
  font-size: .75rem;
  color: #9ca3af;
  margin-top: .5rem;
}
.opst-tag-watching__list {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.opst-tag-row {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem .75rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: .875rem;
}
.opst-tag-row--pinned {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-left: 4px solid #2563eb;
  border-radius: 10px;
  padding: .65rem .75rem;
}
.opst-tag-row--already-pinned {
  opacity: .6;
}
.opst-tag-row__pin-icon {
  flex: 0 0 auto;
  font-size: .85rem;
}
.opst-tag-row__name {
  flex: 1;
  color: #111827;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.opst-tag-row__count {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #374151;
  font-size: .875rem;
  min-width: 3rem;
  text-align: right;
}
.opst-tag-row__action {
  flex: 0 0 auto;
  background: none;
  border: none;
  cursor: pointer;
  font-size: .85rem;
  color: #9ca3af;
  padding: .15rem .3rem;
  border-radius: 4px;
  transition: color .12s, background .12s;
}
.opst-tag-row__action:hover {
  color: #374151;
  background: #f3f4f6;
}
.opst-tag-row__action:disabled {
  cursor: default;
  color: #16a34a;
}
.opst-tag-search-section {
  margin-top: 1rem;
}
.opst-tag-search-wrap {
  margin-bottom: .75rem;
}
.opst-tag-search-hint {
  font-size: .82rem;
  color: #9ca3af;
  margin-bottom: .75rem;
  line-height: 1.5;
}
.opst-tag-search-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: .65rem .9rem;
  font-size: .9rem;
  color: #111827;
  font-family: inherit;
  background: #fff;
}
.opst-tag-search-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.opst-tag-search-results {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.opst-tag-search-loading,
.opst-tag-search-empty,
.opst-tag-search-error {
  font-size: .85rem;
  color: #9ca3af;
  padding: .65rem 0;
}
.opst-tag-search-error { color: #dc2626; }

.opst-tag-row__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .1rem;
  overflow: hidden;
}
.opst-tag-row__id {
  font-size: .72rem;
  color: #9ca3af;
  font-weight: 400;
}
.opst-tag-count-fetch {
  background: none;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: .75rem;
  color: #6b7280;
  padding: .15rem .5rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.opst-tag-count-fetch:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}
.opst-tag-count-fetch:disabled {
  opacity: .5;
  cursor: not-allowed;
}
/* END Tags tab */

/* START Funnel type selector and status badges */
.opst-funnel-type-options {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-top: .35rem;
}
.opst-funnel-type-option {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: .75rem 1rem;
  cursor: pointer;
  transition: border-color .12s, background .12s;
  background: #fff;
}
.opst-funnel-type-option--active {
  border-color: #2563eb;
  background: #eff6ff;
}
.opst-funnel-type-option input[type="radio"] {
  margin-top: .2rem;
  flex: 0 0 auto;
  accent-color: #2563eb;
}
.opst-funnel-type-option strong {
  display: block;
  font-size: .875rem;
  color: #111827;
  margin-bottom: .15rem;
}
.opst-funnel-type-option span span {
  display: block;
  font-size: .8rem;
  color: #6b7280;
  line-height: 1.4;
}
.opst-funnel-field-note {
  font-size: .78rem;
  color: #9ca3af;
  margin: .35rem 0 0;
  line-height: 1.5;
}
.opst-funnel-tz-note {
  font-size: .75rem;
  color: #93c5fd;
  margin: .25rem 0 0;
}
.opst-funnel-date-input {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: .5rem .75rem;
  font-size: .875rem;
  color: #111827;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
  max-width: 220px;
}
.opst-funnel-date-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.opst-required {
  color: #dc2626;
  margin-left: .1rem;
}
.opst-funnel-status {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: .15rem .6rem;
  margin-left: .5rem;
  vertical-align: middle;
}
.opst-funnel-status--green  { background: #dcfce7; color: #166534; }
.opst-funnel-status--amber  { background: #fef3c7; color: #92400e; }
.opst-funnel-status--red    { background: #fee2e2; color: #991b1b; }
.opst-funnel-status--gray   { background: #f3f4f6; color: #4b5563; }
.opst-funnel-status--yellow { background: #fefce8; color: #854d0e; }
.opst-funnel-notice {
  font-size: .8rem;
  border-radius: 8px;
  padding: .55rem .8rem;
  margin-top: .5rem;
  line-height: 1.5;
}
.opst-funnel-notice--red { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.opst-funnel-notice--amber { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* Funnel card header: name left, status badge right */
.opst-funnel-card__main {
  position: static;
  padding-right: .85rem;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}
.opst-funnel-status {
  position: static;
  align-self: auto;
  margin-left: 0;
}
.opst-funnel-notice {
  margin-right: 0;
}
.opst-funnel-card__top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  width: 100%;
}
.opst-funnel-card__name {
  flex: 1 1 auto;
  min-width: 0;
}
.opst-funnel-card__top-row .opst-funnel-status {
  flex: 0 0 auto;
  margin-top: .05rem;
}

/* Fix: pin card footer to bottom regardless of card content height */
.opst-funnel-card {
  display: flex;
  flex-direction: column;
}
.opst-funnel-card__footer {
  margin-top: auto;
}


.opst-funnel-card__report-meta {
  display: block;
  margin-top: auto;
  padding-top: 0.25rem;
  padding-bottom: 0.6rem;
  color: inherit;
  line-height: 1.25;
}
.opst-funnel-card__count-hero {
  display: inline;
  color: #111827;
  font-size: 1.35rem;
  font-weight: 900;
}
.opst-funnel-card__count-label {
  display: inline;
  color: #111827;
  font-size: 0.82rem;
  font-weight: 700;
}
.opst-funnel-card__freshness {
  display: inline;
  color: var(--opst-muted, #6b7280);
  font-size: 0.78rem;
  font-weight: 700;
}
.opst-funnel-campaign-run-notice {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  margin-top: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.45;
}
.opst-funnel-cohort-help + .opst-funnel-audience-segment {
  margin-top: 1rem;
}
.opst-funnel-audience-segment .opst-funnel-cohort-help {
  margin-top: 1rem;
}
.opst-funnel-stage-report-grid {
  width: 100%;
  max-width: none;
  justify-content: stretch;
}



/* START Funnel card count freshness indicator */
.opst-funnel-card__count-freshness {
  display: block;
  font-size: .7rem;
  color: #9ca3af;
  font-weight: 700;
  margin-top: .2rem;
  line-height: 1.3;
}
.opst-funnel-card__count-freshness--stale {
  color: #b45309;
}
/* END Funnel card count freshness indicator */

/* END Funnel type selector and status badges */

/* START Funnel report full-width spacing polish */
.opst-funnel-report-card__body {
  padding-left: 0;
  padding-right: 0;
}
.opst-funnel-path,
.opst-funnel-audience-breakdown,
.opst-funnel-confidence,
.opst-funnel-inline-contacts {
  padding-left: 1rem;
  padding-right: 1rem;
}
/* END Funnel report full-width spacing polish */


/* START Sync helper disclosures */
.opst-sync-helper {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--gray-50, #f8fafc);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 6px;
  font-size: 0.875rem;
}

.opst-sync-helper > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--gray-700, #374151);
  padding: 0.25rem 0;
  list-style: none;
}

.opst-sync-helper > summary::-webkit-details-marker {
  display: none;
}

.opst-sync-helper > summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 0.5rem;
  transition: transform 0.15s;
}

.opst-sync-helper[open] > summary::before {
  transform: rotate(90deg);
}

.opst-sync-helper__body {
  padding-top: 0.5rem;
  color: var(--gray-600, #4b5563);
  line-height: 1.5;
}

.opst-sync-helper__body p {
  margin: 0.5rem 0;
}

.opst-sync-helper__body ul {
  margin: 0.25rem 0 0.75rem 1.5rem;
}

.opst-sync-helper__body li {
  margin-bottom: 0.25rem;
}
/* END Sync helper disclosures */


/* START Overview Top Products matched-height scroll body */
#opst-overview-signal-row {
  align-items: stretch;
}

#opst-overview-top-products {
  display: flex;
  flex-direction: column;
}

#opst-overview-top-products .opst-overview-signal-body {
  flex: 1 1 0;
  overflow-y: auto;
  min-height: 0;
}

@media (max-width: 900px) {
  #opst-overview-top-products .opst-overview-signal-body {
    flex: 0 0 auto;
    min-height: 180px;
    max-height: 320px;
    overflow-y: auto;
  }
}
/* END Overview Top Products matched-height scroll body */


/* START Funnel tag overflow fix */
#opst-panel-funnel .opst-funnel-stage__tag,
#opst-panel-funnel .opst-funnel-stage-list__tag,
#opst-panel-funnel [class*="opst-tag"] {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#opst-panel-funnel .opst-funnel-stage-list__tag strong,
#opst-panel-funnel .opst-funnel-stage-list__tag span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* END Funnel tag overflow fix */


/* START Build 9c mobile select and top products fixes */
@media (max-width: 900px) {
  .opst-funnel-inline-contacts select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}
/* END Build 9c mobile select and top products fixes */


/* START Build 12 mobile contact growth and funnel saved list fixes */
@media (max-width: 900px) {
  #opst-panel-contacts .opst-chart-wrap.opst-cg-wrap--mobile {
    height: auto !important;
    min-height: 240px !important;
  }

  .opst-cg-shell--mobile {
    min-height: 240px !important;
    flex: 1 1 auto !important;
  }

  .opst-funnel-saved-list__head {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .opst-funnel-saved-list__tools {
    width: 100%;
  }

  .opst-funnel-view-tabs {
    width: 100%;
    display: flex;
  }

  .opst-funnel-view-tab {
    flex: 1 1 50%;
    justify-content: center;
    text-align: center;
  }
}
/* END Build 12 mobile contact growth and funnel saved list fixes */

/* START 2.2.430 Buyer value summary full-width layout */
#opst-contacts-tab-buyers .opst-contacts-value-summary-card .opst-contacts-buyer-summary {
  flex: 0 1 auto;
  justify-content: flex-start;
}
/* END 2.2.430 Buyer value summary full-width layout */
