/* サイト管理：データ分析タブはページ見出しを抑えてダッシュボード主体に */
body[data-manage-page="sites"] .page-header.compact {
  padding-bottom: 0;
}

body[data-manage-page="sites"] .page-header.compact .lead {
  display: none;
}

body[data-manage-page="sites"] .site-toolbar {
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

body[data-manage-page="sites"] .tabs {
  margin-bottom: 16px;
}

body[data-manage-page="sites"] #app {
  max-width: none;
  width: 100%;
  padding: 0 20px 24px;
  box-sizing: border-box;
}

.tab-panel[data-tab-panel="analytics"] {
  background: #eef1f6;
  margin: 0 -20px;
  padding: 0 24px 28px;
  position: relative;
  min-height: 72vh;
  width: calc(100% + 40px);
  box-sizing: border-box;
}

.mkt-dash {
  --dash-blue: #2563eb;
  --dash-blue-light: #dbeafe;
  --dash-blue-dark: #1d4ed8;
  --dash-surface: #ffffff;
  --dash-border: #e5e7eb;
  --dash-text: #111827;
  --dash-muted: #6b7280;
  --dash-radius: 12px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: none;
}

.mkt-dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.mkt-dash-header-main h2 {
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dash-text);
  letter-spacing: -0.02em;
}

.mkt-dash-header-main .mkt-dash-lead {
  margin: 0;
  color: var(--dash-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.mkt-dash-header-main .mkt-dash-meta {
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: #9ca3af;
}

.mkt-dash-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mkt-dash-period {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--dash-border);
  border-radius: 10px;
  background: var(--dash-surface);
  font-size: 0.86rem;
  color: var(--dash-text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.mkt-dash-period::before {
  content: "";
  width: 16px;
  height: 16px;
  background: center/contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z'/%3E%3C/svg%3E");
  flex-shrink: 0;
}

.mkt-dash-header-actions .primary,
.mkt-dash-header-actions button {
  border-radius: 10px;
  font-size: 0.86rem;
  padding: 9px 16px;
}

/* KPI */
.mkt-dash-kpi-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 0 12px;
}

.mkt-dash-kpi-tabs {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: #eef2f7;
  gap: 2px;
}

.mkt-dash-kpi-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: #475569;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.mkt-dash-kpi-tab.is-active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.mkt-dash-kpi-days-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: #64748b;
}

.mkt-dash-kpi-days-wrap.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.mkt-dash-kpi-days-label {
  white-space: nowrap;
}

.mkt-dash-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
}

.mkt-dash-kpi {
  background: var(--dash-surface);
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-radius);
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  min-height: 108px;
  display: flex;
  flex-direction: column;
}

.mkt-dash-kpi.is-compact {
  min-height: 78px;
  padding: 10px 12px;
}

.mkt-dash-trend-panel {
  margin-bottom: 16px;
}

.mkt-dash-trend-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}

.mkt-dash-trend-metric-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 3px;
  background: #f3f4f6;
  border-radius: 10px;
}

.mkt-dash-trend-metric-tab {
  border: 0;
  background: transparent;
  color: #4b5563;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1.2;
}

.mkt-dash-trend-metric-tab:hover {
  color: #111827;
  background: rgba(255, 255, 255, 0.7);
}

.mkt-dash-trend-metric-tab.is-active {
  background: #fff;
  color: #111827;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.mkt-dash-trend-meta {
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: var(--dash-muted);
}

.mkt-dash-trend-chart-wrap {
  width: 100%;
  overflow-x: auto;
  padding: 4px 0 2px;
}

.mkt-line-chart {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  min-height: 240px;
}

.mkt-line-chart-grid {
  stroke: #e5e7eb;
  stroke-width: 1;
}

.mkt-line-chart-axis {
  stroke: #d1d5db;
  stroke-width: 1.2;
}

.mkt-line-chart-y,
.mkt-line-chart-x {
  fill: #6b7280;
  font-size: 11px;
  font-family: ui-sans-serif, system-ui, sans-serif;
}

.mkt-line-chart-dot {
  cursor: pointer;
}

.mkt-line-chart-dot:hover {
  r: 5.5;
}

.mkt-dash-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.mkt-dash-kpi.is-compact .mkt-dash-kpi-top {
  margin-bottom: 6px;
}

.mkt-dash-kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.mkt-dash-kpi.is-compact .mkt-dash-kpi-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 0.82rem;
}

.mkt-dash-kpi-icon.is-cost { background: #fef3c7; color: #d97706; }
.mkt-dash-kpi-icon.is-traffic { background: #dbeafe; color: #2563eb; }
.mkt-dash-kpi-icon.is-lead { background: #ede9fe; color: #7c3aed; }
.mkt-dash-kpi-icon.is-deal { background: #dcfce7; color: #16a34a; }
.mkt-dash-kpi-icon.is-revenue { background: #fce7f3; color: #db2777; }
.mkt-dash-kpi-icon.is-cpa { background: #ffedd5; color: #ea580c; }

.mkt-dash-kpi-label {
  font-size: 0.76rem;
  color: var(--dash-muted);
  line-height: 1.3;
}

.mkt-dash-kpi.is-compact .mkt-dash-kpi-label {
  font-size: 0.7rem;
}

.mkt-dash-kpi-body {
  display: block;
}

.mkt-dash-kpi.has-today .mkt-dash-kpi-body {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.mkt-dash-kpi-value {
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--dash-text);
  letter-spacing: -0.02em;
}

.mkt-dash-kpi.is-compact .mkt-dash-kpi-value {
  font-size: 1.2rem;
}

.mkt-dash-kpi-today {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  flex-shrink: 0;
}

.mkt-dash-kpi-today-value {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.1;
  color: #2563eb;
  letter-spacing: -0.02em;
}

.mkt-dash-kpi-today-label {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--dash-muted);
  letter-spacing: 0.02em;
}

.mkt-dash-kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: auto;
  padding-top: 8px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--dash-muted);
}

.mkt-dash-kpi.is-compact .mkt-dash-kpi-delta {
  padding-top: 4px;
  font-size: 0.66rem;
}

.mkt-dash-kpi-delta.is-up { color: #059669; }
.mkt-dash-kpi-delta.is-down { color: #dc2626; }

/* Panel */
.mkt-dash-panel {
  background: var(--dash-surface);
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-radius);
  padding: 20px 22px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.mkt-dash-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.mkt-dash-panel-head h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--dash-text);
}

.mkt-dash-panel-head .mkt-dash-panel-sub {
  margin: 0;
  font-size: 0.78rem;
  color: var(--dash-muted);
}

.mkt-dash-select {
  padding: 6px 10px;
  border: 1px solid var(--dash-border);
  border-radius: 8px;
  background: #f9fafb;
  font-size: 0.78rem;
  color: var(--dash-text);
}

/* Funnel */
.mkt-dash-funnel {
  display: flex;
  align-items: stretch;
  min-height: 88px;
  overflow-x: auto;
  padding: 4px 0;
}

.mkt-dash-funnel-step {
  flex: 1 1 0;
  min-width: 100px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 14px 22px 14px 16px;
  color: #fff;
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%, 18px 50%);
}

.mkt-dash-funnel-step:first-child {
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%);
  border-radius: 10px 0 0 10px;
  padding-left: 18px;
}

.mkt-dash-funnel-step:last-child {
  clip-path: polygon(18px 0, 100% 0, 100% 100%, 18px 100%, 0 50%);
  border-radius: 0 10px 10px 0;
  padding-right: 18px;
}

.mkt-dash-funnel-step:nth-child(1) { background: linear-gradient(135deg, #1e40af, #2563eb); }
.mkt-dash-funnel-step:nth-child(2) { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.mkt-dash-funnel-step:nth-child(3) { background: linear-gradient(135deg, #3b82f6, #60a5fa); }
.mkt-dash-funnel-step:nth-child(4) { background: linear-gradient(135deg, #60a5fa, #93c5fd); }
.mkt-dash-funnel-step:nth-child(5) { background: linear-gradient(135deg, #93c5fd, #bfdbfe); color: #1e3a8a; }
.mkt-dash-funnel-step:nth-child(6) { background: linear-gradient(135deg, #bfdbfe, #dbeafe); color: #1e3a8a; }
.mkt-dash-funnel-step:nth-child(7) { background: linear-gradient(135deg, #dbeafe, #eff6ff); color: #1e3a8a; }

.mkt-dash-funnel-step .label {
  font-size: 0.7rem;
  opacity: 0.92;
  margin-bottom: 4px;
  white-space: nowrap;
}

.mkt-dash-funnel-step .value {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.1;
}

.mkt-dash-funnel-step .rate {
  font-size: 0.68rem;
  opacity: 0.85;
  margin-top: 4px;
}

.mkt-dash-funnel-detail,
.mkt-dash-journey-detail {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--dash-border);
}

.mkt-dash-funnel-note {
  font-size: 0.75rem;
  color: var(--dash-muted);
  margin: 0 0 10px;
}

.mkt-dash-lp-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.mkt-dash-lp-pill {
  border: 1px solid var(--dash-border);
  background: #fff;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--dash-text);
}

.mkt-dash-lp-pill.is-active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.mkt-dash-lp-pill .count {
  opacity: 0.85;
  margin-left: 4px;
}

.mkt-dash-funnel-detail-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 0.82rem;
}

.mkt-dash-funnel-detail-meta {
  color: var(--dash-muted);
  font-size: 0.75rem;
}

.mkt-dash-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  background: #dbeafe;
  color: #1e40af;
  font-size: 0.65rem;
  font-weight: 700;
}

.mkt-dash-journey-bar {
  display: block;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, #3b82f6, #93c5fd);
  min-width: 4px;
}

.mkt-dash-funnel-detail .bar-cell,
.mkt-dash-journey-detail .bar-cell {
  width: 28%;
  min-width: 100px;
}

.mkt-dash-journey-subhead {
  margin: 0 0 8px;
  font-size: 0.88rem;
  color: #334155;
}

.mkt-dash-journey-tables-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
  margin-top: 12px;
  align-items: start;
}

.mkt-dash-journey-table-col {
  min-width: 0;
}

.mkt-dash-journey-table-col .mkt-dash-table-wrap {
  margin-bottom: 0;
}

.mkt-dash-sa-grid {
  margin-top: 16px;
}

.mkt-dash-sa-grid .mkt-dash-journey-subhead {
  margin-top: 12px;
}

.mkt-dash-session-paths-main {
  margin-bottom: 8px;
}

.mkt-dash-session-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.mkt-dash-session-toolbar .mkt-dash-session-pager {
  margin: 0;
  flex: 1 1 auto;
}

.mkt-dash-session-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.mkt-dash-session-filter-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--dash-muted);
}

.mkt-dash-access-at {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-size: 0.84rem;
}

.mkt-dash-session-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid var(--dash-border);
  border-radius: 10px;
  font-size: 0.84rem;
}

.mkt-dash-session-paths-main .mkt-dash-session-pager:last-child {
  margin: 10px 0 0;
}

.mkt-dash-session-pager-info {
  color: #475569;
  font-weight: 600;
}

.mkt-dash-session-pager-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mkt-dash-session-pager-btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 0.82rem;
  cursor: pointer;
}

.mkt-dash-session-pager-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.mkt-dash-session-pager-current {
  min-width: 4.5em;
  text-align: center;
  color: #334155;
  font-weight: 600;
}

.mkt-dash-session-paths-main .mkt-dash-session-paths {
  margin-top: 12px;
  padding-top: 0;
  border-top: none;
}

.mkt-dash-session-paths-lead {
  margin: 0 0 12px;
  font-size: 0.88rem;
  color: #475569;
}

.mkt-dash-session-paths.is-test {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed #cbd5e1;
}

.mkt-dash-test-note {
  color: #b45309;
}

.mkt-dash-test-ip-panel {
  margin-bottom: 16px;
  padding: 0 16px 14px;
  border: 1px solid #fde68a;
  border-radius: 10px;
  background: #fffbeb;
}

.mkt-dash-test-ip-panel > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 14px 0;
}

.mkt-dash-test-ip-panel > summary::-webkit-details-marker {
  display: none;
}

.mkt-dash-test-ip-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.mkt-dash-test-ip-summary-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #92400e;
}

.mkt-dash-test-ip-summary-title::before {
  content: "▸ ";
  display: inline-block;
  transition: transform 0.15s ease;
}

.mkt-dash-test-ip-panel[open] .mkt-dash-test-ip-summary-title::before {
  transform: rotate(90deg);
}

.mkt-dash-test-ip-summary-meta {
  font-size: 0.78rem;
  color: #b45309;
}

.mkt-dash-test-ip-body {
  padding-top: 2px;
}

.mkt-dash-test-ip-head h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.mkt-dash-test-ip-lead {
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: #92400e;
}

.mkt-dash-test-ip-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.mkt-dash-client-ip {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  color: #64748b;
}

.mkt-dash-test-ip-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.mkt-dash-test-ip-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #fcd34d;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
}

.mkt-dash-test-ip-journey-ip,
.mkt-dash-test-ip-journey {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: #2563eb;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mkt-dash-test-ip-journey {
  margin-left: 4px;
  font-size: 0.78rem;
  font-weight: 600;
}

.mkt-dash-test-ip-remove {
  margin-left: 4px;
  border: none;
  background: transparent;
  color: #b45309;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
}

.mkt-dash-test-ip-recent {
  margin: 0;
  font-size: 0.82rem;
  color: #78350f;
}

.mkt-dash-test-ip-add {
  margin: 2px 4px 2px 0;
  padding: 2px 8px;
  border: 1px solid #d97706;
  border-radius: 4px;
  background: #fff;
  color: #92400e;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  cursor: pointer;
}

.mkt-dash-test-summary {
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  font-size: 0.84rem;
  color: #475569;
}

.mkt-dash-test-summary-label {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 8px;
  border-radius: 4px;
  background: #fef3c7;
  color: #92400e;
  font-weight: 600;
  font-size: 0.78rem;
}

.mkt-dash-test-summary-note {
  color: #94a3b8;
  font-size: 0.78rem;
}

.mkt-dash-empty-inline {
  margin: 0;
  font-size: 0.82rem;
  color: #94a3b8;
}

.mkt-dash-test-badge {
  display: inline-block;
  margin-right: 4px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  vertical-align: middle;
}

.mkt-dash-goal-badge {
  display: inline-block;
  margin-right: 4px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #166534;
  background: #dcfce7;
  border: 1px solid #86efac;
  vertical-align: middle;
}

.mkt-dash-session-paths tbody tr.is-deal {
  background: #f0fdf4;
}

.mkt-dash-session-paths tbody tr.is-test-row {
  background: #fffbeb;
}

.mkt-dash-ip-test-tag {
  margin-left: 2px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #b45309;
  white-space: nowrap;
}

.mkt-dash-journey-step.is-goal .mkt-dash-journey-step-label {
  color: #15803d;
  font-weight: 700;
}

.mkt-dash-journey-step.is-goal .mkt-dash-journey-step-num {
  background: #22c55e;
  color: #fff;
}

.mkt-dash-ip-cell {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  color: #64748b;
  white-space: nowrap;
}

.mkt-dash-ip-cell .mkt-dash-ip-journey-btn {
  white-space: nowrap;
}

.mkt-dash-meta-cell {
  font-size: 0.82rem;
  color: #475569;
  white-space: nowrap;
}

.mkt-dash-session-table-wrap {
  overflow-x: auto;
}

.mkt-dash-session-table {
  table-layout: auto;
  width: 100%;
}

.mkt-dash-session-table .col-access,
.mkt-dash-session-table .mkt-dash-access-at,
.mkt-dash-session-table .col-ip,
.mkt-dash-session-table .mkt-dash-ip-cell,
.mkt-dash-session-table .col-device,
.mkt-dash-session-table .col-country,
.mkt-dash-session-table .col-channel,
.mkt-dash-session-table .mkt-dash-channel-cell,
.mkt-dash-session-table .col-pv,
.mkt-dash-session-table .mkt-dash-pv-cell {
  width: 1%;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.mkt-dash-session-table .mkt-dash-channel-cell {
  font-size: 0.82rem;
}

.mkt-dash-session-table .col-path,
.mkt-dash-session-table .mkt-dash-path-cell {
  width: auto;
  min-width: 12em;
  white-space: normal;
  overflow: visible;
}

.mkt-dash-keyword-cell {
  font-weight: 600;
  color: #1e3a8a;
  white-space: nowrap;
}

.mkt-dash-keyword-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 700;
  color: #1d4ed8;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.mkt-dash-keyword-btn:hover {
  color: #1e40af;
}

.mkt-dash-keyword-sess-count {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 0.72rem;
  font-weight: 600;
}

body.mkt-keyword-journey-open {
  overflow: hidden;
}

.mkt-keyword-journey-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.mkt-keyword-journey-modal.hidden {
  display: none;
}

.mkt-keyword-journey-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.mkt-keyword-journey-dialog {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  max-height: min(86vh, 820px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}

.mkt-keyword-journey-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #f8fafc, #fff);
}

.mkt-keyword-journey-title {
  margin: 0;
  font-size: 1.05rem;
  color: #0f172a;
}

.mkt-keyword-journey-meta {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: #64748b;
}

.mkt-keyword-journey-close {
  border: 0;
  background: #f1f5f9;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  color: #334155;
}

.mkt-keyword-journey-body {
  padding: 14px 18px 18px;
  overflow: auto;
}

.mkt-keyword-journey-hint {
  margin: 10px 0 0;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.5;
}

.mkt-keyword-journey-hint code {
  font-size: 0.75rem;
  background: #f1f5f9;
  padding: 1px 4px;
  border-radius: 4px;
}

.mkt-dash-session-table th,
.mkt-dash-session-table td {
  padding: 8px 10px;
  vertical-align: middle;
}

.mkt-dash-session-table .mkt-dash-path-summary {
  display: none !important;
}

.mkt-dash-journey-flow.is-compact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 2px;
}

.mkt-dash-journey-flow.is-compact .mkt-dash-journey-step {
  padding: 3px 6px;
  gap: 4px;
  border-radius: 6px;
  flex-shrink: 0;
}

.mkt-dash-journey-flow.is-compact .mkt-dash-journey-step-num {
  width: 1.15em;
  height: 1.15em;
  font-size: 0.68rem;
}

.mkt-dash-journey-flow.is-compact .mkt-dash-journey-step-label {
  font-size: 0.78rem;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.mkt-dash-journey-flow.is-compact .mkt-dash-path-arrow {
  font-size: 0.75rem;
  margin: 0 1px;
  flex-shrink: 0;
}

.mkt-dash-lp-pills-main {
  margin-bottom: 12px;
}

.mkt-dash-journey-aggregate {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--dash-border);
}

.mkt-dash-journey-aggregate > summary {
  cursor: pointer;
  font-size: 0.88rem;
  color: #64748b;
  user-select: none;
  padding: 8px 0;
}

.mkt-dash-journey-aggregate[open] > summary {
  margin-bottom: 12px;
}

.mkt-dash-panel-full {
  grid-column: 1 / -1;
}

.mkt-dash-session-paths {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--dash-border);
}

.mkt-dash-session-paths.is-compact {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.mkt-dash-path-cell {
  min-width: 0;
}

.mkt-dash-session-paths:not(.is-compact) .mkt-dash-path-cell {
  min-width: 0;
}

.mkt-dash-path-summary {
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 500;
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.mkt-dash-path-summary.is-single {
  color: #94a3b8;
  font-style: italic;
}

.mkt-dash-journey-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 2px;
}

.mkt-dash-journey-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 8px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border: 1px solid #bfdbfe;
}

.mkt-dash-journey-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  flex-shrink: 0;
}

.mkt-dash-journey-step-label {
  font-size: 0.82rem;
  color: #1e3a8a;
  font-weight: 600;
}

a.mkt-dash-path-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(30, 58, 138, 0.35);
}

a.mkt-dash-path-link:hover {
  color: #1d4ed8;
  text-decoration-color: #1d4ed8;
}

.mkt-dash-journey-step-time {
  font-size: 0.72rem;
  color: #64748b;
}

.mkt-dash-path-node {
  display: inline-block;
  padding: 2px 8px;
  margin: 2px 0;
  border-radius: 6px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 0.8rem;
  font-family: ui-monospace, monospace;
}

.mkt-dash-path-arrow {
  display: inline-block;
  margin: 0 6px;
  color: #94a3b8;
  font-weight: 700;
}

.mkt-dash-pill-channel {
  font-size: 0.7rem;
  opacity: 0.9;
}

.mkt-dash-flow-node.is-exit {
  border-color: #f87171;
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  color: #991b1b;
}

.mkt-dash-flow-node.is-landing {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* Flow (Sankey風) */
.mkt-dash-flow {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid var(--dash-border);
  border-radius: 10px;
  padding: 20px 16px;
  min-height: 140px;
}

.mkt-dash-flow-lanes {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mkt-dash-flow-lane {
  display: flex;
  align-items: center;
  gap: 0;
  min-height: 36px;
}

.mkt-dash-flow-band {
  height: 28px;
  border-radius: 6px;
  opacity: 0.35;
  flex-shrink: 0;
}

.mkt-dash-flow-band.is-blue { background: #3b82f6; }
.mkt-dash-flow-band.is-gray { background: #9ca3af; }
.mkt-dash-flow-band.is-green { background: #22c55e; }

.mkt-dash-flow-node {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  white-space: nowrap;
  border: 1px solid transparent;
  flex-shrink: 0;
  z-index: 1;
}

.mkt-dash-flow-node.is-source {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.mkt-dash-flow-node.is-page {
  background: #fff;
  border-color: var(--dash-border);
  color: var(--dash-text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.mkt-dash-flow-node.is-goal {
  background: #16a34a;
  color: #fff;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.25);
}

.mkt-dash-flow-node .count {
  font-weight: 800;
  font-size: 0.9rem;
}

.mkt-dash-flow-node .path {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mkt-dash-flow-connector {
  flex: 1;
  min-width: 24px;
  height: 2px;
  background: linear-gradient(90deg, #93c5fd, #cbd5e1);
  margin: 0 4px;
  position: relative;
}

.mkt-dash-flow-connector::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-left-color: #94a3b8;
}

.mkt-dash-flow-foot {
  margin: 12px 0 0;
  font-size: 0.76rem;
  color: var(--dash-muted);
  text-align: right;
}

.mkt-dash-flow-foot a {
  color: var(--dash-blue);
  text-decoration: none;
}

/* Grid */
.mkt-dash-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.mkt-dash-sa-grid .mkt-dash-panel-head h3 {
  font-size: 0.88rem;
}

.mkt-dash-sa-grid .mkt-dash-table {
  font-size: 0.8rem;
}

.mkt-dash-sa-grid .mkt-dash-table th,
.mkt-dash-sa-grid .mkt-dash-table td {
  padding: 6px 8px;
}

.mkt-dash-grid-2 {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 18px;
}

.mkt-dash-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.mkt-dash-grid-2.mkt-dash-bottom .mkt-dash-panel:last-child {
  align-self: start;
}

/* Tables */
.mkt-dash-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 0 -4px;
}

.mkt-dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.mkt-dash-table thead th {
  text-align: left;
  padding: 10px 12px;
  background: #f9fafb;
  color: var(--dash-muted);
  font-weight: 600;
  font-size: 0.74rem;
  border-bottom: 1px solid var(--dash-border);
  white-space: nowrap;
}

.mkt-dash-table tbody td {
  padding: 11px 12px;
  border-bottom: 1px solid #f3f4f6;
  color: var(--dash-text);
  vertical-align: middle;
}

.mkt-dash-table tbody tr:hover td {
  background: #fafbfc;
}

.mkt-dash-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.mkt-dash-table .page-path-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.76rem;
}

.mkt-dash-table-link {
  display: block;
  text-align: right;
  margin-top: 10px;
  font-size: 0.78rem;
}

.mkt-dash-table-link a {
  color: var(--dash-blue);
  text-decoration: none;
}

.mkt-dash-table-link a:hover {
  text-decoration: underline;
}

/* Donut */
.mkt-dash-device-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 8px 0;
}

.mkt-dash-donut-ring {
  position: relative;
  width: 132px;
  height: 132px;
  flex-shrink: 0;
}

.mkt-dash-donut {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.mkt-dash-donut-hole {
  position: absolute;
  inset: 28px;
  background: var(--dash-surface);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  color: var(--dash-muted);
  font-weight: 600;
}

.mkt-dash-device-legend {
  flex: 1;
  min-width: 0;
}

.mkt-dash-device-legend ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mkt-dash-device-legend li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 0.82rem;
}

.mkt-dash-device-legend .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: 8px;
}

.mkt-dash-device-legend .name {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  color: var(--dash-text);
}

.mkt-dash-device-legend .pct {
  font-weight: 700;
  color: var(--dash-text);
  font-variant-numeric: tabular-nums;
}

/* Insights */
.mkt-dash-insights {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mkt-dash-insight-item {
  display: flex;
  gap: 12px;
  padding: 14px 14px;
  border-radius: 10px;
  background: #f9fafb;
  border: 1px solid #f3f4f6;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--dash-text);
}

.mkt-dash-insight-item .icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
}

.mkt-dash-insight-item.is-warn .icon { background: #fee2e2; color: #dc2626; }
.mkt-dash-insight-item.is-caution .icon { background: #ffedd5; color: #ea580c; }
.mkt-dash-insight-item.is-info .icon { background: #dbeafe; color: #2563eb; }
.mkt-dash-insight-item.is-ok .icon { background: #dcfce7; color: #16a34a; }

/* Footer */
.mkt-dash-footer {
  text-align: center;
  color: #9ca3af;
  font-size: 0.76rem;
  padding: 12px 0 0;
}

.mkt-dash-empty {
  color: var(--dash-muted);
  font-size: 0.86rem;
  margin: 0;
  padding: 20px 8px;
  text-align: center;
}

.tab-panel[data-tab-panel="analytics"] .sync-errors {
  border-radius: 10px;
}

@media (max-width: 1280px) {
  .mkt-dash-kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mkt-dash-grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mkt-dash-grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .mkt-dash-kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mkt-dash-grid-2,
  .mkt-dash-grid-3,
  .mkt-dash-grid-5 { grid-template-columns: 1fr; }
  .mkt-dash-journey-tables-grid { grid-template-columns: 1fr; }
  .tab-panel[data-tab-panel="analytics"] { margin: 0 -12px; padding: 0 12px 20px; width: calc(100% + 24px); }
}

@media (max-width: 640px) {
  body[data-manage-page="sites"] #app {
    padding: 0 12px 20px;
  }

  .tab-panel[data-tab-panel="analytics"] {
    margin: 0 -12px;
    padding: 0 12px 20px;
    width: calc(100% + 24px);
    min-height: 0;
  }

  .mkt-dash-kpi-row {
    grid-template-columns: 1fr;
  }

  .mkt-dash-grid-5 {
    grid-template-columns: 1fr;
  }

  .mkt-dash-header {
    flex-direction: column;
    align-items: stretch;
  }

  .mkt-dash-header-actions {
    width: 100%;
  }

  .mkt-dash-header-actions .primary,
  .mkt-dash-header-actions button {
    flex: 1 1 auto;
    min-width: 0;
  }

  .mkt-dash-period {
    width: 100%;
    justify-content: center;
  }

  .mkt-dash-kpi-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .mkt-dash-kpi-tabs {
    width: 100%;
    justify-content: center;
  }

  .mkt-dash-kpi-days-wrap {
    width: 100%;
  }

  .mkt-dash-select {
    width: 100%;
  }
}

.mkt-dash-loading {
  position: absolute;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(238, 241, 246, 0.88);
  backdrop-filter: blur(3px);
}

.mkt-dash-loading.hidden {
  display: none !important;
}

.mkt-dash-loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px 40px;
  background: #fff;
  border: 1px solid var(--dash-border);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  font-size: 0.95rem;
  color: #334155;
  font-weight: 600;
  min-width: 200px;
}

.mkt-dash-spinner-lg {
  display: block;
  width: 52px;
  height: 52px;
  border: 4px solid rgba(37, 99, 235, 0.15);
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: mkt-dash-spin 0.75s linear infinite;
}

@keyframes mkt-dash-spin {
  to {
    transform: rotate(360deg);
  }
}

.mkt-dash-loading-text {
  text-align: center;
  line-height: 1.4;
}

.mkt-dash.is-loading .mkt-dash-kpi-row,
.mkt-dash.is-loading .mkt-dash-panel,
.mkt-dash.is-loading .mkt-dash-footer {
  visibility: hidden;
}

.mkt-dash-ip-journey-btn {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: #2563eb;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mkt-dash-ip-journey-btn:hover {
  color: #1d4ed8;
}

body.mkt-journey-viewer-open {
  overflow: hidden;
}

.mkt-journey-viewer {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.mkt-journey-viewer.hidden {
  display: none;
}

.mkt-journey-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.mkt-journey-viewer-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(1280px, 96vw);
  height: min(92vh, 900px);
  margin: auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}

.mkt-journey-viewer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--dash-border);
  background: #f8fafc;
}

.mkt-journey-viewer-head h3 {
  margin: 0;
  font-size: 1rem;
}

.mkt-journey-viewer-meta {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: #64748b;
}

.mkt-journey-viewer-close {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  padding: 0 4px;
}

.mkt-journey-viewer-body {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  flex: 1;
  min-height: 0;
}

.mkt-journey-viewer-steps {
  border-right: 1px solid var(--dash-border);
  padding: 12px;
  overflow: auto;
  background: #fafafa;
}

.mkt-journey-viewer-steps-lead {
  margin: 0 0 10px;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.45;
}

.mkt-journey-viewer-step-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mkt-journey-viewer-step-btn {
  width: 100%;
  text-align: left;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  padding: 8px 10px;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 8px;
  align-items: center;
}

.mkt-journey-viewer-step-btn.is-active {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.mkt-journey-viewer-step-btn.is-exit-step {
  border-color: #fca5a5;
  background: #fff1f2;
}

.mkt-journey-viewer-step-btn.is-goal-step.is-active {
  border-color: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.15);
}

.mkt-journey-step-num {
  grid-row: span 2;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mkt-journey-viewer-step-btn.is-active .mkt-journey-step-num {
  background: #2563eb;
  color: #fff;
}

.mkt-journey-step-path {
  font-size: 0.84rem;
  font-weight: 600;
  color: #0f172a;
  word-break: break-all;
}

.mkt-journey-step-dur {
  grid-column: 2;
  font-size: 0.72rem;
  color: #64748b;
}

.mkt-journey-step-badges {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.mkt-journey-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
}

.mkt-journey-badge.is-exit {
  background: #fee2e2;
  color: #b91c1c;
}

.mkt-journey-badge.is-cta {
  background: #ede9fe;
  color: #6d28d9;
}

.mkt-journey-badge.is-goal {
  background: #dcfce7;
  color: #15803d;
}

.mkt-journey-viewer-preview {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 12px;
}

.mkt-journey-viewer-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.mkt-journey-viewer-step-indicator {
  flex: 1;
  font-size: 0.82rem;
  color: #475569;
  min-width: 120px;
}

.mkt-journey-viewer-nav {
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.82rem;
  cursor: pointer;
}

.mkt-journey-viewer-nav:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.mkt-journey-viewer-frame-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: #f1f5f9;
}

.mkt-journey-viewer-frame-wrap.is-mobile {
  max-width: 390px;
  margin: 0 auto;
  width: 100%;
}

.mkt-journey-viewer-frame-wrap.is-exit {
  box-shadow: inset 0 0 0 3px rgba(239, 68, 68, 0.35);
}

.mkt-journey-viewer-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}

.mkt-journey-viewer-exit-banner {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  background: #ef4444;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.mkt-journey-viewer-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  text-align: center;
  background: #fff;
  font-size: 0.88rem;
  color: #475569;
}

.mkt-journey-viewer-fallback.hidden,
.mkt-journey-viewer-exit-banner.hidden {
  display: none;
}

.mkt-journey-viewer-foot {
  margin: 8px 0 0;
  font-size: 0.72rem;
  color: #94a3b8;
}

@media (max-width: 900px) {
  .mkt-journey-viewer-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .mkt-journey-viewer-steps {
    max-height: 180px;
    border-right: none;
    border-bottom: 1px solid var(--dash-border);
  }

  .mkt-journey-viewer-dialog {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
}

/* URL流入元ラベル（ref）編集 */
.marketing-ref-labels-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border, #e2e8f0);
}
.marketing-ref-labels-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.marketing-ref-labels-head .marketing-mini-heading {
  margin: 0;
}
.mkt-ref-label-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0;
}
.mkt-ref-label-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.mkt-ref-label-field {
  flex: 1 1 140px;
  min-width: 120px;
}
.mkt-ref-label-caption {
  display: block;
  font-size: 12px;
  color: var(--muted, #64748b);
  margin-bottom: 4px;
}
.mkt-ref-label-row input[type="text"] {
  width: 100%;
}
.mkt-ref-label-arrow {
  padding-bottom: 10px;
  color: var(--muted, #64748b);
  font-weight: 600;
}
.mkt-ref-label-remove {
  flex: 0 0 auto;
  margin-bottom: 1px;
}
.mkt-ref-label-actions {
  margin-top: 4px;
}
