/* Marketing workspace — intentionally shares the cabinet tokens and overlay model. */
.material-symbols-rounded {
  font-family: "Material Symbols Rounded";
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
}

#marketing-panel-wrap {
  position: fixed;
  inset: 0 0 var(--nav-h);
  z-index: 50;
  background: var(--bg);
  overflow: hidden;
  padding-top: var(--safe-top);
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  #marketing-panel-wrap { bottom: calc(var(--nav-h) + var(--safe-bottom)); }
}

#marketing-standalone-host,
#marketing-admin-host,
.mkt-workspace { min-height: 100%; }

.mkt-workspace {
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--bg);
}

.mkt-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 7px 10px;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(14px);
}

.mkt-tab {
  min-width: 0;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-soft);
  font: 600 .82rem/1 "Outfit", sans-serif;
  cursor: pointer;
}

.mkt-tab .material-symbols-rounded { font-size: 19px; }
.mkt-tab.active { background: var(--brand); color: #fff; }

.mkt-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.mkt-view {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 14px 16px 28px;
}

.mkt-view.active { display: block; }
.mkt-period-row { display: flex; gap: 8px; margin-bottom: 9px; }
.mkt-period-row .mkt-icon-btn { display: none; }

.mkt-period,
.mkt-filters input,
.mkt-filters select,
.mkt-field input,
.mkt-field select,
.mkt-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  padding: 13px 14px;
  font: 500 .92rem/1.25 "Outfit", sans-serif;
  outline: none;
}

.mkt-field textarea { min-height: 84px; resize: vertical; }
.mkt-period { flex: 1; min-height: 44px; font-size: .94rem; }

.mkt-icon-btn {
  width: 50px;
  min-width: 50px;
  min-height: 50px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink-soft);
  cursor: pointer;
}

.mkt-status {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border-radius: 14px;
  background: #202127;
  color: #f8f8fa;
  margin-bottom: 10px;
}

.mkt-status strong { font-size: .92rem; }
.mkt-status time { margin-left: auto; color: #b6b7c0; font-size: .8rem; }
.mkt-live-dot { width: 11px; height: 11px; border-radius: 50%; background: #12b76a; box-shadow: 0 0 0 5px rgba(18,183,106,.12); }

.mkt-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 8px;
}

.mkt-metrics article {
  min-width: 0;
  padding: 12px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.mkt-metrics strong { display: block; font-size: clamp(1.1rem, 5.2vw, 1.5rem); line-height: 1.1; white-space: nowrap; }
.mkt-metrics span { display: block; margin-top: 5px; color: var(--ink-soft); font-size: .82rem; }
.mkt-positive { color: #17a05d; }

.mkt-section {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  overflow: hidden;
  margin-top: 8px;
}

.mkt-section > summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  list-style: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
}

.mkt-section > summary::-webkit-details-marker { display: none; }
.mkt-section > summary .material-symbols-rounded { transition: transform .18s ease; }
.mkt-section[open] > summary .material-symbols-rounded { transform: rotate(180deg); }
.mkt-section summary em { color: var(--ink-soft); font-style: normal; font-weight: 500; }
.mkt-funnel { border-top: 1px solid var(--line); padding: 5px 16px 12px; }
.mkt-funnel > div:not(.mkt-bars) { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.mkt-funnel span { color: var(--ink-soft); }

.mkt-bars {
  height: 47px;
  display: flex;
  align-items: end;
  gap: 5px;
  padding-top: 10px;
}

.mkt-bars i { flex: 1; min-width: 3px; max-width: 18px; height: var(--h, 5%); border-radius: 4px 4px 2px 2px; background: #ff8744; opacity: .92; }

.mkt-primary {
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 12px;
  border: 0;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
  font: 700 1rem/1 "Outfit", sans-serif;
  cursor: pointer;
}

.mkt-primary-compact { width: auto; min-height: 42px; margin: 0; padding: 0 15px; font-size: .84rem; }
.mkt-list-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.mkt-list-head h2 { margin: 0; font-size: 1.45rem; }
.mkt-eyebrow { margin: 0 0 2px; color: var(--brand); font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.mkt-help { margin: -8px 0 14px; color: var(--ink-soft); font-size: .84rem; }
.mkt-filters { display: grid; grid-template-columns: minmax(0, 1fr) 130px; gap: 8px; margin-bottom: 14px; }
.mkt-card-list, .mkt-preview-list { display: flex; flex-direction: column; gap: 9px; }
.mkt-preview-list { padding: 0 14px 14px; border-top: 1px solid var(--line); }

.mkt-list-card,
.mkt-preview-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card);
  color: var(--ink);
  text-align: left;
}

button.mkt-list-card, button.mkt-preview-item { cursor: pointer; }
.mkt-list-card:hover, button.mkt-preview-item:hover { border-color: color-mix(in srgb, var(--brand) 60%, var(--line)); }
.mkt-card-avatar { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; background: var(--brand-surface); color: var(--brand); font-weight: 800; }
.mkt-card-copy { min-width: 0; flex: 1; }
.mkt-card-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mkt-card-copy span { display: block; color: var(--ink-soft); font-size: .78rem; }
.mkt-badge { flex: 0 0 auto; padding: 3px 8px; border-radius: 999px; color: #17a05d; background: rgba(23,160,93,.1); font-size: .68rem; font-weight: 700; }
.mkt-badge.archived, .mkt-badge.disabled { color: var(--ink-soft); background: var(--card-elevated); }
.mkt-badge.recovery_required { color: var(--danger); background: var(--danger-bg); }
.mkt-empty { padding: 22px 14px; border: 1px dashed var(--line); border-radius: 13px; color: var(--ink-soft); text-align: center; }
.mkt-loading { opacity: .72; pointer-events: none; }

.mkt-visits-frame { width: 100%; height: 72vh; min-height: 560px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }

.mkt-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(0,0,0,.58);
  backdrop-filter: blur(3px);
}

.mkt-modal-card {
  width: min(100%, 620px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--bg);
  box-shadow: var(--shadow-lg);
}

.mkt-modal-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); background: var(--bg); }
.mkt-modal-head h2 { margin: 0; font-size: 1.18rem; }
.mkt-modal-body { padding: 16px 18px 22px; }
.mkt-close { border: 0; background: var(--card); color: var(--ink-soft); width: 38px; height: 38px; border-radius: 11px; cursor: pointer; }
.mkt-form-grid { display: grid; gap: 12px; }
.mkt-form-grid.two { grid-template-columns: 1fr 1fr; }
.mkt-field { display: flex; flex-direction: column; gap: 5px; color: var(--ink-soft); font-size: .76rem; font-weight: 600; }
.mkt-form-section { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.mkt-form-section h3 { margin: 0 0 10px; font-size: .95rem; }
.mkt-channel-row { display: grid; grid-template-columns: 115px 1fr 86px 38px; gap: 6px; margin-bottom: 7px; }
.mkt-secondary, .mkt-danger { min-height: 40px; border: 1px solid var(--line); border-radius: 11px; background: var(--card); color: var(--ink); padding: 0 13px; font: 600 .8rem "Outfit", sans-serif; cursor: pointer; }
.mkt-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.mkt-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.mkt-actions .mkt-primary { width: auto; min-height: 42px; margin: 0; padding: 0 18px; font-size: .86rem; }
.mkt-kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .84rem; }
.mkt-kv span { color: var(--ink-soft); }
.mkt-linkbox { display: flex; gap: 7px; margin-top: 8px; }
.mkt-linkbox input { min-width: 0; flex: 1; }
.mkt-timeline { display: flex; flex-direction: column; gap: 8px; }
.mkt-timeline-item { padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--card); }
.mkt-timeline-item strong { display: block; font-size: .83rem; }
.mkt-timeline-item time { color: var(--ink-soft); font-size: .72rem; }

.nav-item-marketing { color: var(--brand); }
.nav-item-marketing .material-symbols-rounded { font-size: 1.3rem; }

@media (min-width: 640px) {
  .mkt-view { padding: 20px 24px 28px; }
  .mkt-modal { align-items: center; }
}

@media (max-width: 500px) {
  .mkt-tab { flex-direction: column; gap: 3px; padding: 6px 3px; font-size: .68rem; }
  .mkt-tabs { padding: 6px 7px; }
  .mkt-view { padding: 12px 12px 24px; }
  .mkt-status { padding: 0 14px; }
  .mkt-status time { font-size: .72rem; }
  .mkt-metrics { gap: 7px; }
  .mkt-metrics article { padding: 11px 10px; }
  .mkt-metrics strong { font-size: 1.25rem; }
  .mkt-metrics span { font-size: .72rem; }
  .mkt-form-grid.two { grid-template-columns: 1fr; }
  .mkt-channel-row { grid-template-columns: 105px 1fr 38px; }
  .mkt-channel-row [data-channel-audience] { grid-column: 1 / 3; }
  .mkt-modal { padding: 0; }
  .mkt-modal-card { max-height: 94dvh; border-radius: 20px 20px 0 0; border-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .mkt-section > summary .material-symbols-rounded { transition: none; }
}
