/* Store details — Emails tab (scoped under .std-emails-tab) */

.std-emails-tab {
  --std-emails-surface: #ffffff;
  --std-emails-surface-muted: #f8fafc;
  --std-emails-surface-soft: #fafbfc;
  --std-emails-border: #e5e7eb;
  --std-emails-text: #111827;
  --std-emails-text-muted: #64748b;
  --std-emails-text-faint: #94a3b8;
  --std-emails-accent: #225aea;
  --std-emails-accent-soft: #eff6ff;
  --std-emails-accent-text: #1d4ed8;
  --std-emails-week-highlight: #eff6ff;
  --std-emails-pattern-bar: #e2e8f0;
  --std-emails-pattern-bar-max: #111827;
  --std-emails-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  margin-top: 4px;
  width: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html[data-theme="dark"] .std-emails-accordion-trigger:hover {
  background: rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .std-emails-tab {
  --std-emails-surface: var(--dk-surface, #15181e);
  --std-emails-surface-muted: var(--dk-surface-2, #1b1f27);
  --std-emails-surface-soft: var(--dk-surface-deep, #0b0d11);
  --std-emails-border: var(--dk-border, #2c323d);
  --std-emails-text: var(--dk-text, #eef1f6);
  --std-emails-text-muted: var(--dk-text-3, #a0aabd);
  --std-emails-text-faint: #7b8496;
  --std-emails-accent-soft: rgba(34, 90, 234, 0.14);
  --std-emails-accent-text: #93c5fd;
  --std-emails-week-highlight: rgba(34, 90, 234, 0.14);
  --std-emails-pattern-bar: var(--dk-border-strong, #3a4252);
  --std-emails-pattern-bar-max: #eef1f6;
  --std-emails-shadow: none;
}

body.std-emails-mode #std-details-tab-overview,
body.std-emails-mode #std-details-tab-brand-gate,
body.std-emails-mode #std-hero-pane-store .std-store-hero-body {
  display: none !important;
}

#std-hero-pane-emails.is-loading .std-emails-content,
#std-hero-pane-emails.is-loading .std-emails-empty {
  display: none !important;
}

#std-hero-pane-emails:not(.is-loading) .std-emails-skeleton {
  display: none !important;
}

#std-hero-pane-emails .std-emails-content[hidden],
#std-hero-pane-emails .std-emails-skeleton[hidden],
#std-hero-pane-emails .std-emails-empty[hidden] {
  display: none !important;
}

.std-emails-loading,
.std-emails-empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--std-emails-text-muted);
  font-size: 14px;
}

.std-emails-empty h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--std-emails-text);
}

.std-emails-empty p {
  margin: 0;
}

.std-emails-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.std-emails-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.std-emails-section-icon,
.std-emails-accordion-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--std-emails-text-muted);
}

.std-emails-section-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--std-emails-text);
  letter-spacing: -0.005em;
  line-height: 1.3;
}

/* ── Loading skeleton ── */
@keyframes std-emails-skel-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.std-emails-skeleton {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 2px 0 8px;
}

.std-emails-skel-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.std-emails-skel-line,
.std-emails-skel-stat,
.std-emails-skel-panel,
.std-emails-skel-filters,
.std-emails-skel-card {
  border-radius: 8px;
  background: linear-gradient(90deg, #f1f5f9 0%, #e8edf3 45%, #f8fafc 55%, #f1f5f9 100%);
  background-size: 200% 100%;
  animation: std-emails-skel-shimmer 1.35s ease-in-out infinite;
}

.std-emails-skel-line--head {
  width: 120px;
  height: 16px;
}

.std-emails-skel-panel--flow {
  height: 280px;
  border-radius: 12px;
}

.std-emails-skel-flow-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 16px;
}

.std-emails-skel-panel--flow-side {
  height: 280px;
  border-radius: 14px;
}

.std-emails-skel-panel--flow-main {
  height: 280px;
  border-radius: 14px;
}

.std-emails-skel-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.std-emails-skel-stat {
  height: 84px;
  border-radius: 12px;
}

.std-emails-skel-panel--calendar {
  height: 220px;
  border-radius: 12px;
}

.std-emails-skel-filters {
  height: 44px;
  border-radius: 10px;
}

.std-emails-skel-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.std-emails-skel-card {
  height: 180px;
  border-radius: 12px;
}

html[data-theme="dark"] .std-emails-skel-line,
html[data-theme="dark"] .std-emails-skel-stat,
html[data-theme="dark"] .std-emails-skel-panel,
html[data-theme="dark"] .std-emails-skel-filters,
html[data-theme="dark"] .std-emails-skel-card {
  background: linear-gradient(90deg, var(--dk-surface-deep, #0b0d11) 0%, var(--dk-surface-2, #1b1f27) 45%, var(--dk-surface-3, #232936) 55%, var(--dk-surface-deep, #0b0d11) 100%);
  background-size: 200% 100%;
}

/* Inline skeletons for on-demand loads (period list + grid) */
.std-emails-week-skel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border-radius: 7px;
  background: var(--std-emails-surface-soft);
}

.std-emails-week-skel-line,
.std-emails-card-skel-line {
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(90deg, #f1f5f9 0%, #e8edf3 45%, #f8fafc 55%, #f1f5f9 100%);
  background-size: 200% 100%;
  animation: std-emails-skel-shimmer 1.35s ease-in-out infinite;
}

.std-emails-week-skel-line {
  width: 78%;
}

.std-emails-week-skel-line--sm {
  width: 42%;
  height: 8px;
}

.std-emails-card-skel {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--std-emails-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--std-emails-surface);
}

.std-emails-card-skel-preview {
  height: 262px;
  background: linear-gradient(90deg, #f1f5f9 0%, #e8edf3 45%, #f8fafc 55%, #f1f5f9 100%);
  background-size: 200% 100%;
  animation: std-emails-skel-shimmer 1.35s ease-in-out infinite;
}

.std-emails-card-skel-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px 11px 12px;
}

.std-emails-card-skel-line {
  width: 85%;
}

.std-emails-card-skel-line--sm {
  width: 50%;
  height: 8px;
}

html[data-theme="dark"] .std-emails-week-skel-line,
html[data-theme="dark"] .std-emails-card-skel-line,
html[data-theme="dark"] .std-emails-card-skel-preview {
  background: linear-gradient(90deg, var(--dk-surface-deep, #0b0d11) 0%, var(--dk-surface-2, #1b1f27) 45%, var(--dk-surface-3, #232936) 55%, var(--dk-surface-deep, #0b0d11) 100%);
  background-size: 200% 100%;
}

@media (prefers-reduced-motion: reduce) {
  .std-emails-skel-line,
  .std-emails-skel-stat,
  .std-emails-skel-panel,
  .std-emails-skel-filters,
  .std-emails-skel-card,
  .std-emails-week-skel-line,
  .std-emails-card-skel-line,
  .std-emails-card-skel-preview {
    animation: none;
    background: #e8edf3;
  }
}

/* ── Flows accordion ── */
.std-emails-accordion {
  border: 1px solid var(--std-emails-border);
  border-radius: 12px;
  background: var(--std-emails-surface);
  overflow: hidden;
}

.std-emails-accordion-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s ease;
}

.std-emails-accordion-trigger:hover {
  background: var(--std-emails-surface-muted);
}

.std-emails-accordion-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  color: var(--std-emails-text-faint);
  transition: transform 0.2s ease, color 0.15s ease;
}

.std-emails-accordion.is-open .std-emails-accordion-chevron {
  transform: rotate(90deg);
  color: var(--std-emails-text-muted);
}

.std-emails-accordion-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--std-emails-text);
  line-height: 1.3;
}

.std-emails-accordion-panel {
  border-top: 1px solid var(--std-emails-border);
}

.std-emails-accordion-panel[hidden] {
  display: none !important;
}

.std-emails-accordion-panel-inner {
  padding: 0 16px 16px;
}

.std-emails-flow-toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding-top: 12px;
  margin-bottom: 14px;
}

.std-emails-flow-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
}

.std-emails-flows .std-emails-flow-pill {
  margin-top: 0;
}

.std-emails-all {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.std-emails-all .std-emails-section-title {
  margin: 0;
}

.std-emails-all-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
}

.std-emails-grid-empty {
  border: 1px dashed var(--std-emails-border);
  border-radius: 12px;
  background: var(--std-emails-surface-muted);
  padding: 32px 20px;
  text-align: center;
}

.std-emails-grid-empty-text {
  margin: 0;
  font-size: 14px;
  color: var(--std-emails-text-muted);
  line-height: 1.5;
}

.std-emails-flow-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  max-width: 100%;
  flex: 0 0 auto;
  margin-top: 0;
  padding: 4px 9px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--std-emails-text-muted);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.35;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.std-emails-flow-pill svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  opacity: 0.75;
}

.std-emails-flow-pill:hover {
  background: var(--std-emails-surface-muted);
  color: var(--std-emails-text);
}

.std-emails-flow-pill:hover svg {
  opacity: 0.9;
}

.std-emails-flow-pill.is-active {
  background: #eef1f5;
  border-color: rgba(148, 163, 184, 0.5);
  color: var(--std-emails-text);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.std-emails-flow-pill.is-active svg {
  opacity: 1;
}

html[data-theme="dark"] .std-emails-flow-pill {
  color: var(--dk-text-3, #a0aabd);
}

html[data-theme="dark"] .std-emails-flow-pill:hover {
  background: rgba(148, 163, 184, 0.1);
  color: var(--dk-text, #eef1f6);
}

html[data-theme="dark"] .std-emails-flow-pill.is-active {
  background: var(--dk-surface-2, #1b1f27);
  border-color: var(--dk-border-strong, #3a4252);
  color: var(--dk-text, #eef1f6);
  box-shadow: none;
}

html[data-theme="dark"] .std-emails-flow-pill.is-active svg {
  opacity: 1;
}

.std-emails-flow-meta {
  margin: 0;
  min-width: 0;
  font-size: 11px;
  font-weight: 400;
  color: var(--std-emails-text-faint);
  line-height: 1.45;
}

.std-emails-flow-meta:empty {
  display: none;
}

.std-emails-flow-layout {
  --std-emails-flow-panel-height: 420px;
  display: grid;
  grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
  gap: 16px;
  height: var(--std-emails-flow-panel-height);
  align-items: stretch;
}

.std-emails-flow-timeline {
  --std-emails-flow-rail-color: rgba(148, 163, 184, 0.55);
  position: relative;
  border: 0;
  border-radius: 0;
  padding: 0 12px 0 0;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: transparent;
  box-shadow: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
}

html[data-theme="dark"] .std-emails-flow-timeline {
  --std-emails-flow-rail-color: rgba(148, 163, 184, 0.28);
}

.std-emails-flow-timeline::-webkit-scrollbar {
  width: 6px;
}

.std-emails-flow-timeline::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.45);
}

.std-emails-flow-step {
  position: relative;
}

.std-emails-flow-step-card {
  position: relative;
  width: 100%;
  border: 1px solid var(--std-emails-border);
  border-radius: 10px;
  background: var(--std-emails-surface);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  color: inherit;
}

.std-emails-flow-step-card:hover,
.std-emails-flow-step-card.is-active {
  border-color: var(--std-emails-border);
  background: var(--std-emails-surface-muted);
  box-shadow: none;
}

.std-emails-flow-step-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.std-emails-flow-step-num {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid var(--std-emails-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--std-emails-text-muted);
  background: var(--std-emails-surface);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.std-emails-flow-step-card.is-active .std-emails-flow-step-num {
  border-color: rgba(34, 90, 234, 0.35);
  color: var(--std-emails-accent-text, #225aea);
}

.std-emails-flow-step-title {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--std-emails-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.std-emails-flow-step-subject {
  margin: 4px 0 0 28px;
  font-size: 11px;
  color: var(--std-emails-text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.std-emails-flow-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 0;
  padding: 0;
  min-height: 44px;
}

.std-emails-flow-connector::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  transform: translateX(-50%);
  background: var(--std-emails-flow-rail-color);
  z-index: 0;
}

.std-emails-flow-connector-line {
  display: none;
}

.std-emails-flow-connector:not(.has-pill) {
  min-height: 28px;
}

.std-emails-flow-delay-pill {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--std-emails-text);
  color: var(--std-emails-surface);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
}

.std-emails-flow-delay-pill svg {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

html[data-theme="dark"] .std-emails-flow-delay-pill {
  background: var(--dk-surface-3, #232936);
  color: var(--std-emails-text);
  border: 1px solid var(--std-emails-border);
}

.std-emails-flow-preview {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--std-emails-border);
  border-radius: 14px;
  background: var(--std-emails-surface-muted);
  box-shadow: var(--std-emails-shadow);
}

.std-emails-flow-preview-head {
  flex-shrink: 0;
  padding: 0;
  background: var(--std-emails-surface);
  border-bottom: 1px solid var(--std-emails-border);
  overflow: hidden;
}

.std-emails-flow-preview-head-track {
  position: relative;
  overflow: hidden;
  min-height: 58px;
}

.std-emails-flow-preview-head-panel {
  padding: 14px 18px 12px;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
}

.std-emails-flow-preview-head-panel.is-incoming {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.std-emails-flow-preview-head-panel.is-incoming.is-prepping {
  transition: none;
}

.std-emails-flow-preview-head-panel.is-incoming.is-prepping.is-dir-down {
  transform: translateY(100%);
  opacity: 0;
}

.std-emails-flow-preview-head-panel.is-incoming.is-prepping.is-dir-up {
  transform: translateY(-100%);
  opacity: 0;
}

.std-emails-flow-preview-head-track.is-settling .std-emails-flow-preview-head-panel {
  transition: none !important;
}

.std-emails-flow-preview-head-track.is-transitioning.is-dir-down .std-emails-flow-preview-head-panel.is-current {
  transform: translateY(-100%);
  opacity: 0;
}

.std-emails-flow-preview-head-track.is-transitioning.is-dir-down .std-emails-flow-preview-head-panel.is-incoming {
  transform: translateY(0);
  opacity: 1;
}

.std-emails-flow-preview-head-track.is-transitioning.is-dir-up .std-emails-flow-preview-head-panel.is-current {
  transform: translateY(100%);
  opacity: 0;
}

.std-emails-flow-preview-head-track.is-transitioning.is-dir-up .std-emails-flow-preview-head-panel.is-incoming {
  transform: translateY(0);
  opacity: 1;
}

.std-emails-flow-preview-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.std-emails-flow-preview-num {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(34, 90, 234, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  color: var(--std-emails-accent-text, #225aea);
  background: var(--std-emails-surface);
}

.std-emails-flow-preview-title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.35;
  color: var(--std-emails-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.std-emails-flow-preview-subject {
  margin: 3px 0 0 28px;
  font-size: 12px;
  font-weight: 400;
  color: var(--std-emails-text-muted);
  line-height: 1.4;
}

.std-emails-flow-preview-media {
  flex: 1;
  min-height: 0;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  background: var(--std-emails-surface-muted);
  transition: opacity 0.24s ease;
}

.std-emails-flow-preview-media-frame {
  position: relative;
  width: min(100%, 340px);
  max-height: 100%;
  overflow: auto;
  border-radius: 10px;
  background: var(--std-emails-surface);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
  transition: box-shadow 0.22s ease, transform 0.22s ease;
}

.std-emails-flow-preview-media-frame.is-clickable {
  cursor: pointer;
}

.std-emails-flow-preview-media-frame.is-clickable:hover {
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}

.std-emails-flow-preview-media-frame.is-clickable:focus-visible {
  outline: 2px solid rgba(34, 90, 234, 0.45);
  outline-offset: 2px;
}

html[data-theme="dark"] .std-emails-flow-preview-media-frame.is-clickable:hover {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.std-emails-flow-preview-image-skeleton {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  min-height: 300px;
  margin: 0;
  padding: 18px 16px 16px;
  border-radius: 0;
  background: var(--std-emails-surface);
  box-sizing: border-box;
}

.std-emails-flow-preview-image-skeleton[hidden] {
  display: none !important;
}

.std-emails-flow-preview-skel-line,
.std-emails-flow-preview-skel-media {
  border-radius: 6px;
  background: linear-gradient(90deg, #f1f5f9 0%, #e8edf3 45%, #f8fafc 55%, #f1f5f9 100%);
  background-size: 200% 100%;
  animation: std-emails-skel-shimmer 1.35s ease-in-out infinite;
}

.std-emails-flow-preview-skel-line {
  height: 10px;
  width: 100%;
}

.std-emails-flow-preview-skel-line--lg {
  width: 78%;
  height: 12px;
}

.std-emails-flow-preview-skel-line--sm {
  width: 56%;
}

.std-emails-flow-preview-skel-media {
  flex: 1;
  min-height: 170px;
  margin-top: 4px;
}

html[data-theme="dark"] .std-emails-flow-preview-image-skeleton {
  background: var(--std-emails-surface);
}

html[data-theme="dark"] .std-emails-flow-preview-skel-line,
html[data-theme="dark"] .std-emails-flow-preview-skel-media {
  background: linear-gradient(90deg, #1b1f27 0%, #232936 45%, #1b1f27 55%, #1b1f27 100%);
  background-size: 200% 100%;
}

.std-emails-flow-preview-media-frame.is-loading .std-emails-flow-preview-image {
  display: none !important;
}

.std-emails-flow-preview-media-frame::-webkit-scrollbar {
  width: 6px;
}

.std-emails-flow-preview-media-frame::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.45);
}

.std-emails-flow-preview-image:not([hidden]) {
  display: block;
  width: 72%;
  max-width: 240px;
  height: auto;
  margin: 14px auto 18px;
  border-radius: 8px;
  box-shadow: none;
}

.std-emails-flow-preview-image[hidden],
.std-emails-flow-preview-empty[hidden] {
  display: none !important;
}

.std-emails-flow-preview-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  padding: 24px;
  color: var(--std-emails-text-faint);
  font-size: 13px;
}

.std-emails-flow-preview.is-media-changing .std-emails-flow-preview-media {
  opacity: 0.92;
}

/* ── Campaigns panel ── */
.std-emails-campaigns {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.std-emails-campaigns-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.std-emails-stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.std-emails-stat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
  border: 1px solid var(--std-emails-border);
  border-radius: 12px;
  background: var(--std-emails-surface);
  box-shadow: var(--std-emails-shadow);
  min-height: 84px;
}

.std-emails-stat-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.std-emails-stat-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--std-emails-text);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.std-emails-stat-sub {
  margin-top: 2px;
  font-size: 10px;
  font-weight: 400;
  color: var(--std-emails-text-muted);
  line-height: 1.3;
}

.std-emails-stat-aside {
  flex: 0 0 auto;
  text-align: right;
}

.std-emails-stat-value {
  font-family: Figtree, "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--std-emails-text);
}

.std-emails-stat-unit {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 400;
  color: var(--std-emails-text-muted);
  line-height: 1.3;
}

.std-emails-stat-aside--chart {
  display: flex;
  align-items: flex-end;
}

.std-emails-pattern-chart {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 5px;
  flex: 0 0 auto;
  min-width: 108px;
}

.std-emails-pattern-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  max-width: 11px;
}

.std-emails-pattern-bar-track {
  display: flex;
  align-items: flex-end;
  width: 100%;
  height: 32px;
}

.std-emails-pattern-bar-fill {
  width: 100%;
  min-height: 3px;
  border-radius: 2px;
  background: var(--std-emails-pattern-bar);
  transition: background-color 0.15s ease;
}

.std-emails-pattern-bar-fill.is-max {
  background: var(--std-emails-pattern-bar-max);
}

.std-emails-pattern-bar-label {
  font-size: 9px;
  font-weight: 500;
  color: var(--std-emails-text-faint);
  line-height: 1;
}

.std-emails-calendar-layout {
  display: flex;
  flex-direction: column;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.std-emails-calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px 8px;
  border: 0;
  background: transparent;
}

.std-emails-calendar-toolbar .std-emails-calendar-title {
  margin-bottom: 0;
}

.std-emails-view-toggle {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  padding: 2px;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  background: #eef2f7;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  flex-shrink: 0;
}

.std-emails-view-toggle-btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 28px;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #71717b;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

.std-emails-view-toggle-btn:hover:not(.is-active) {
  color: #374151;
}

.std-emails-view-toggle-btn.is-active {
  background: #fff;
  color: #374151;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

html[data-theme="dark"] .std-emails-view-toggle {
  background: rgba(148, 163, 184, 0.12);
  border-color: var(--dk-border, #2c323d);
  box-shadow: none;
}

html[data-theme="dark"] .std-emails-view-toggle-btn {
  color: var(--dk-text-2, #cbd5e1);
}

html[data-theme="dark"] .std-emails-view-toggle-btn:hover:not(.is-active) {
  color: var(--dk-text, #eef1f6);
}

html[data-theme="dark"] .std-emails-view-toggle-btn.is-active {
  background: var(--dk-surface-2, #1b1f27);
  color: var(--dk-text, #eef1f6);
  box-shadow: none;
  border: 1px solid var(--dk-border-strong, #3a4252);
}

.std-emails-calendar-layout-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  min-width: 0;
  align-items: stretch;
  height: 392px;
}

.std-emails-calendar-panel,
.std-emails-week-panel {
  min-width: 0;
}

.std-emails-calendar-panel {
  padding: 8px 4px 4px;
  border: 0;
  background: transparent;
}

.std-emails-week-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  padding: 14px;
  border: 1px solid var(--std-emails-border);
  border-radius: 10px;
  background: var(--std-emails-surface);
  box-shadow: var(--std-emails-shadow);
  font-family: Figtree, "Plus Jakarta Sans", Inter, sans-serif;
}

.std-emails-calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.std-emails-calendar-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--std-emails-text);
  letter-spacing: -0.005em;
}

.std-emails-calendar-month {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--std-emails-text);
  text-align: center;
}

.std-emails-calendar-nav-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.std-emails-calendar-nav-btn svg {
  display: block;
}

.std-emails-calendar-nav-btn:hover {
  background: #fff;
  border-color: #225aea;
  color: #225aea;
}

html[data-theme="dark"] .std-emails-calendar-nav-btn {
  background: var(--dk-surface-2, #1b1f27);
  border-color: var(--dk-border, #2c323d);
  color: var(--dk-text-2, #cbd5e1);
}

html[data-theme="dark"] .std-emails-calendar-nav-btn:hover {
  background: var(--dk-surface, #15181e);
  border-color: rgba(34, 90, 234, 0.45);
  color: #93c5fd;
}

.std-emails-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.std-emails-calendar-dow {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--std-emails-text-faint);
  padding: 2px 0 6px;
}

.std-emails-calendar-day {
  height: 44px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 7px;
  background: transparent;
  color: var(--std-emails-text);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 7px;
  box-sizing: border-box;
}

.std-emails-calendar-day:not(.is-muted):hover {
  background: var(--std-emails-surface-muted);
  border-color: rgba(148, 163, 184, 0.35);
}

.std-emails-calendar-day.is-muted {
  color: var(--std-emails-text-faint);
  cursor: default;
  opacity: 0.45;
  border-color: rgba(148, 163, 184, 0.12);
}

.std-emails-calendar-day.has-email {
  background: transparent;
  font-weight: 500;
}

.std-emails-calendar-day.has-email::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 7px;
  bottom: auto;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--std-emails-accent);
  transform: translateX(-50%);
}

.std-emails-calendar-day.is-selected {
  background: var(--std-emails-week-highlight);
  border-color: rgba(34, 90, 234, 0.35);
  box-shadow: inset 0 0 0 1px rgba(34, 90, 234, 0.16);
  font-weight: 650;
}

.std-emails-calendar-day.is-in-week {
  background: var(--std-emails-week-highlight);
}

.std-emails-calendar-day.is-in-week.is-selected {
  border-color: rgba(34, 90, 234, 0.35);
  box-shadow: inset 0 0 0 1px rgba(34, 90, 234, 0.16);
}

html[data-theme="dark"] .std-emails-calendar-day {
  border-color: rgba(148, 163, 184, 0.16);
}

html[data-theme="dark"] .std-emails-calendar-day.is-muted {
  border-color: rgba(148, 163, 184, 0.08);
}

html[data-theme="dark"] .std-emails-calendar-day.is-selected,
html[data-theme="dark"] .std-emails-calendar-day.is-in-week.is-selected {
  border-color: rgba(147, 197, 253, 0.34);
  box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.12);
}

.std-emails-week-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--std-emails-border);
  flex-shrink: 0;
}

.std-emails-week-title {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--std-emails-text);
  line-height: 1.35;
  letter-spacing: -0.01em;
  min-width: 0;
}

.std-emails-week-count {
  font-size: 10.5px;
  color: var(--std-emails-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 1px;
}

.std-emails-week-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
}

.std-emails-week-list::-webkit-scrollbar {
  width: 6px;
}

.std-emails-week-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.45);
}

.std-emails-week-empty {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 0;
  width: 100%;
  color: var(--std-emails-text-muted);
  font-size: 12px;
  text-align: center;
}

.std-emails-week-empty-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--std-emails-border);
  border-radius: 9px;
  background: var(--std-emails-surface-soft);
  color: var(--std-emails-text-faint);
}

.std-emails-week-empty-icon svg {
  width: 17px;
  height: 17px;
}

.std-emails-week-empty-copy {
  color: var(--std-emails-text-muted);
}

.std-emails-week-day-group + .std-emails-week-day-group {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--std-emails-border);
}

.std-emails-week-day-group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--std-emails-text-muted);
  margin-bottom: 5px;
}

.std-emails-week-day-group-items {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.std-emails-week-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  background: var(--std-emails-surface-soft);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
  color: inherit;
}

.std-emails-week-item:hover {
  background: var(--std-emails-surface-muted);
  box-shadow: inset 0 0 0 1px var(--std-emails-border);
}

.std-emails-week-item-subject {
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--std-emails-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.std-emails-week-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.std-emails-week-item-date {
  font-size: 10px;
  color: var(--std-emails-text-muted);
}

/* Week view — flat TrendTrack-style list */
.std-emails-week-panel.is-week-view .std-emails-week-head {
  margin-bottom: 12px;
  padding-bottom: 10px;
}

.std-emails-week-panel.is-week-view .std-emails-week-title {
  font-size: 12.5px;
  font-weight: 650;
}

.std-emails-week-panel.is-week-view .std-emails-week-count {
  font-size: 10.5px;
}

.std-emails-week-panel.is-week-view .std-emails-week-list {
  gap: 4px;
}

.std-emails-week-panel.is-week-view .std-emails-week-item {
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  background: var(--std-emails-surface-soft);
}

.std-emails-week-panel.is-week-view .std-emails-week-item:hover {
  background: var(--std-emails-surface-muted);
  box-shadow: inset 0 0 0 1px var(--std-emails-border);
}

.std-emails-week-panel.is-week-view .std-emails-week-item-subject {
  font-size: 11.5px;
  font-weight: 500;
}

.std-emails-week-panel.is-week-view .std-emails-week-item-date {
  font-size: 10px;
}

/* Unified campaign tag for both day & week — subtle neutral pill */
.std-emails-week-item .email-tag {
  padding: 2px 7px;
  border: 0;
  border-radius: 5px;
  background: #eef1f5;
  color: #64748b;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
}

html[data-theme="dark"] .std-emails-week-item .email-tag {
  background: rgba(148, 163, 184, 0.14);
  color: var(--dk-text-2, #cbd5e1);
}

.std-emails-all-count-row {
  display: flex;
  align-items: center;
  margin: 3px 0 11px;
  min-height: 16px;
}

.std-emails-all-count {
  font-size: 12px;
  color: var(--std-emails-text-muted);
  font-weight: 500;
}

/* ── All emails filter bar (store tab) ── */
.std-emails-tab .std-emails-filters-bar.emails-filters-explore {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  padding: 0;
  margin-bottom: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  --es-filter-text: var(--std-emails-text);
  --es-filter-surface: var(--std-emails-surface);
  --es-filter-surface-hover: var(--std-emails-surface-soft);
  --es-filter-surface-focus: var(--std-emails-accent-soft);
  --es-border: var(--std-emails-border);
  --es-border-hover: rgba(34, 90, 234, 0.42);
  --es-border-focus: var(--std-emails-accent);
  --es-control-shadow: none;
  --es-control-shadow-hover: 0 1px 2px rgba(15, 23, 42, 0.05);
  --es-control-focus-ring: 0 0 0 3px rgba(34, 90, 234, 0.14);
}

.std-emails-tab .std-emails-filters-bar .emails-filter-field {
  flex: 0 1 auto;
  min-width: 0;
}

.std-emails-tab .std-emails-filters-bar .std-emails-filter-field--search {
  flex: 1 1 auto;
  min-width: min(100%, 200px);
}

.std-emails-tab .std-emails-filters-bar .std-emails-filter-field--date {
  flex: 0 0 auto;
  min-width: 0;
}

.std-emails-tab .std-emails-filters-bar .std-emails-filter-field--sort {
  flex: 0 0 auto;
  min-width: 0;
}

/* Date range + sort trigger buttons — exact /landers control (tts-cp-btn) */
.std-emails-daterange-wrapper {
  position: relative;
}

.std-emails-tab .tts-cp-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e4e4e7;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #71717b;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.std-emails-tab .tts-cp-btn:hover {
  background: #f4f4f5;
  border-color: #d1d5db;
  color: #374151;
}

.std-emails-tab .tts-cp-btn svg {
  flex-shrink: 0;
}

.std-emails-tab .explore-landers-sort-btn {
  max-width: min(280px, 46vw);
}

.std-emails-tab .explore-landers-sort-btn__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.std-emails-tab .explore-landers-sort-btn__chev,
.std-emails-trigger-chevron {
  flex-shrink: 0;
  opacity: 0.55;
  margin-left: -1px;
  transition: transform 0.15s ease;
}

.std-emails-tab .explore-landers-sort-btn__dir {
  flex-shrink: 0;
  opacity: 0.65;
  margin-right: -1px;
}

.std-emails-daterange-wrapper.open .std-emails-trigger-chevron,
.std-emails-sort-btn.is-open .std-emails-trigger-chevron {
  transform: rotate(180deg);
}

.std-emails-daterange-trigger.has-value {
  padding-right: 30px;
}

.std-emails-daterange-trigger.has-value .std-emails-trigger-chevron {
  display: none;
}

html[data-theme="dark"] .std-emails-tab .tts-cp-btn {
  background: var(--dk-surface, #15181e);
  border-color: var(--dk-border, #2c323d);
  color: var(--dk-text-2, #cbd5e1);
  box-shadow: none;
}

html[data-theme="dark"] .std-emails-tab .tts-cp-btn:hover {
  background: var(--dk-surface-2, #1b1f27);
  border-color: var(--dk-border-strong, #3a4252);
  color: var(--dk-text, #eef1f6);
}

.std-emails-daterange-clear {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--std-emails-text-faint);
  cursor: pointer;
  z-index: 3;
}

.std-emails-daterange-clear:hover {
  background: var(--std-emails-surface-muted);
  color: var(--std-emails-text);
}

.std-emails-daterange-clear[hidden] {
  display: none !important;
}

.std-emails-tab .std-emails-filters-bar .emails-filter-input {
  min-height: 32px;
  font-size: 12px;
  border-color: var(--std-emails-border);
  background: var(--std-emails-surface);
  color: var(--std-emails-text);
}

.std-emails-tab .std-emails-filters-bar .emails-filter-input::placeholder {
  color: var(--std-emails-text-faint);
}

.std-emails-tab .std-emails-filters-bar .emails-filter-input:hover {
  border-color: #d1d5db;
  background: var(--std-emails-surface-soft);
}

.std-emails-tab .std-emails-filters-bar .emails-filter-input:focus {
  border-color: #d1d5db;
  background: var(--std-emails-surface);
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.06);
  outline: 0;
}

.std-emails-daterange-trigger:focus-visible,
.std-emails-sort-btn:focus-visible {
  outline: 0;
  border-color: #d1d5db;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.06);
}

html[data-theme="dark"] .std-emails-tab .std-emails-filters-bar .emails-filter-input:focus,
html[data-theme="dark"] .std-emails-daterange-trigger:focus-visible,
html[data-theme="dark"] .std-emails-sort-btn:focus-visible {
  border-color: var(--dk-border-strong, #3a4252);
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.12);
}

.std-emails-tab .std-emails-filters-bar .emails-filter-control--search .emails-filter-search-icon {
  color: var(--std-emails-text-faint);
}

.std-emails-tab .std-emails-filter-control--date::before,
.std-emails-tab .std-emails-filter-control--sort::before {
  content: none;
  position: absolute;
  left: 10px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  pointer-events: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px 14px;
  opacity: 0.72;
  z-index: 2;
}

.std-emails-tab .std-emails-filter-control--date::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
}

.std-emails-tab .std-emails-filter-control--sort::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 5.5h8M4 8h5.5M4 10.5h3' stroke='%2394a3b8' stroke-width='1.6' stroke-linecap='round'/%3E%3Cpath d='M11.5 4.5v7M9.5 6.5l2-2 2 2' stroke='%2394a3b8' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.std-emails-tab .std-emails-filters-bar .emails-filter-control:has(.emails-filter-select)::after {
  border-color: var(--std-emails-text-faint);
  right: 12px;
}

.std-emails-tab .std-emails-filters-bar .emails-filter-date::-webkit-calendar-picker-indicator {
  opacity: 0.5;
  cursor: pointer;
  filter: none;
}

html[data-theme="dark"] .std-emails-tab .std-emails-filters-bar .emails-filter-date {
  color-scheme: dark;
}

html[data-theme="dark"] .std-emails-tab .std-emails-filters-bar .emails-filter-date::-webkit-calendar-picker-indicator {
  filter: invert(0.82);
  opacity: 0.7;
}

html[data-theme="dark"] .std-emails-tab .std-emails-filter-control--date::before,
html[data-theme="dark"] .std-emails-tab .std-emails-filter-control--sort::before {
  opacity: 0.85;
  filter: invert(0.78);
}

.std-emails-tab .emails-filters-explore {
  margin-bottom: 0;
}

.std-emails-tab .std-emails-grid {
  margin-top: 0;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 1280px) {
  .std-emails-tab .std-emails-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 992px) {
  .std-emails-tab .std-emails-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .std-emails-tab .std-emails-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.std-emails-tab .email-card {
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.std-emails-tab .email-card:hover {
  transform: none;
  border-color: rgba(148, 163, 184, 0.45);
  box-shadow: 0 5px 16px rgba(15, 23, 42, 0.09);
}

.std-emails-tab .email-card-preview {
  height: 262px;
  background: #eef1f5;
  overflow: hidden;
  box-sizing: border-box;
  padding: 0 clamp(40px, 26%, 72px);
}

/* Framed from the top; long emails scroll (marquee) on hover */
.std-emails-tab .email-card-preview-image {
  background: transparent;
  object-fit: cover;
  object-position: center top;
  transition: object-position 0.6s ease;
}

.std-emails-tab .email-card:hover .email-card-preview-image {
  object-position: center bottom;
  transition: object-position 12s ease;
}

.std-emails-tab .email-card-preview-frame {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: transparent;
  overflow: hidden;
  pointer-events: none;
}

.std-emails-tab .email-card-preview-frame[hidden] {
  display: none !important;
}

html[data-theme="dark"] .std-emails-tab .email-card-preview-frame {
  background: transparent;
}

.std-emails-tab .email-card-body {
  padding: 10px 11px 11px;
}

.std-emails-tab .email-card-subject {
  min-height: 0;
  font-size: 12px;
  font-weight: 600;
  -webkit-line-clamp: 1;
}

.std-emails-tab .email-card-meta {
  margin-top: 7px;
  font-size: 10px;
}

/* Shared Landers picker shell is JS-injected on explore pages; keep it solid here too. */
.tts-cp-dropdown.explore-landers-sort-dropdown {
  position: absolute;
  z-index: 9999;
  min-width: 240px;
  max-width: 300px;
  overflow: hidden;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.11), 0 2px 8px rgba(0, 0, 0, 0.06);
}

html[data-theme="dark"] .tts-cp-dropdown.explore-landers-sort-dropdown {
  border-color: var(--dk-border, #2c323d);
  background: var(--dk-surface, #15181e);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.std-emails-tab .email-card-campaign-tag {
  flex-shrink: 0;
  padding: 2px 7px;
  border: 0;
  border-radius: 5px;
  background: #eef1f5;
  color: #64748b;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
}

html[data-theme="dark"] .std-emails-tab .email-card-campaign-tag {
  background: rgba(148, 163, 184, 0.14);
  color: var(--dk-text-2, #cbd5e1);
}

html[data-theme="dark"] .std-emails-tab .email-card {
  background: var(--dk-surface, #15181e);
  border-color: var(--dk-border, #2c323d);
}

html[data-theme="dark"] .std-emails-tab .email-card-subject,
html[data-theme="dark"] .std-emails-tab .email-card-brand {
  color: var(--dk-text, #eef1f6);
}

html[data-theme="dark"] .std-emails-tab .email-card-preview {
  background: #1a1e26;
}

@media (max-width: 1100px) {
  .std-emails-flow-layout {
    grid-template-columns: 1fr;
    --std-emails-flow-panel-height: auto;
    height: auto;
    gap: 12px;
  }

  .std-emails-flow-timeline {
    height: 320px;
  }

  .std-emails-flow-preview {
    height: 400px;
  }

  .std-emails-stats-row {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 768px) {
  .std-emails-tab .std-emails-filters-bar.emails-filters-explore {
    flex-direction: column;
    gap: 8px;
  }

  .std-emails-tab .std-emails-filters-bar .std-emails-filter-field--search,
  .std-emails-tab .std-emails-filters-bar .std-emails-filter-field--date,
  .std-emails-tab .std-emails-filters-bar .std-emails-filter-field--sort {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
  }

  .std-emails-tab .emails-filters-explore {
    --es-filter-col-min: 140px;
  }

  .std-emails-calendar-layout-body {
    grid-template-columns: 1fr;
    height: auto;
  }

  .std-emails-calendar-panel {
    padding: 4px 0;
  }

  .std-emails-week-panel {
    min-height: 260px;
    max-height: 320px;
  }

  .std-emails-skel-stats {
    grid-template-columns: 1fr;
  }

  .std-emails-skel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .std-emails-campaigns-panel {
    padding: 12px;
  }

  .std-emails-accordion-panel-inner {
    padding: 0 12px 12px;
  }

  .std-emails-accordion-trigger {
    padding: 12px 14px;
  }

  .std-emails-week-head {
    flex-direction: column;
    gap: 6px;
  }
}
