.funnel-page {
    max-width: 1400px;
    margin: 0 auto;
}

.funnel-header {
    margin-bottom: 24px;
}

.funnel-period-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px 12px;
}

.funnel-period-btn {
    padding: 8px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.funnel-period-btn:hover {
    border-color: #007AFF;
    color: #007AFF;
}

.funnel-period-btn.active {
    background: #007AFF;
    border-color: #007AFF;
    color: #fff;
}

.funnel-range-label {
    width: 100%;
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

.funnel-custom-range {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-top: 4px;
}

.funnel-custom-range[hidden] {
    display: none !important;
}

.funnel-date-input {
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    color: #374151;
    background: #fff;
}

.funnel-date-sep {
    font-size: 12px;
    color: #6b7280;
}

.funnel-custom-apply {
    margin-left: 0;
}

.funnel-cards {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.funnel-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 6px 10px;
    min-height: 36px;
    box-shadow: none;
    position: relative;
}

.funnel-card.clickable {
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
    padding-right: 10px;
}

.funnel-card.clickable:hover {
    border-color: #007AFF;
    background: rgba(0, 122, 255, 0.04);
    box-shadow: none;
}

.funnel-card-label {
    flex: 0 0 92px;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.funnel-card-value {
    flex: 0 0 auto;
    min-width: 2.5rem;
    font-size: 18px;
    font-weight: 700;
    color: #1d1d1f;
    line-height: 1;
}

.funnel-card-sub {
    flex: 1 1 auto;
    min-width: 0;
    margin-top: 0;
    font-size: 11px;
    color: #6b7280;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.funnel-card.clickable:has(.funnel-card-rate:not(:empty)) .funnel-card-sub {
    display: none;
}

.funnel-favorite-card:has(.funnel-card-rate:not(:empty)) .funnel-card-sub {
    display: block;
}

.funnel-favorite-card .funnel-card-rate {
    flex: 0 0 auto;
    margin-left: 8px;
}

.funnel-card-rate {
    flex: 1 1 auto;
    min-width: 0;
    margin-top: 0;
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    color: #059669;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
}

.funnel-card-rate--bad {
    color: #dc2626;
}

.funnel-card-rate:empty {
    display: none;
}

.funnel-favorite-card {
    cursor: pointer;
    padding-right: 10px;
}

.funnel-favorite-card:hover {
    border-color: #ffcc00;
    background: rgba(255, 204, 0, 0.06);
    box-shadow: none;
}

.funnel-favorite-unstar {
    position: static;
    flex: 0 0 auto;
    order: 10;
    margin-left: 6px;
    border: none;
    background: transparent;
    color: #ffcc00;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 4px;
    line-height: 1;
    z-index: 1;
}

.funnel-favorite-unstar:hover {
    transform: scale(1.08);
}

.funnel-add-stat-card {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    border-style: dashed;
    border-color: #d1d5db;
    background: #fafafa;
    color: #6b7280;
    width: 100%;
    text-align: left;
    font: inherit;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.funnel-add-stat-card:hover {
    border-color: #007AFF;
    background: rgba(0, 122, 255, 0.04);
    color: #007AFF;
}

.funnel-add-stat-icon {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e5e7eb;
    font-size: 11px;
}

.funnel-add-stat-card:hover .funnel-add-stat-icon {
    border-color: #007AFF;
    background: #007AFF;
    color: #fff;
}

.funnel-add-stat-label {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 600;
    color: inherit;
}

.funnel-add-stat-sub {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 11px;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.funnel-add-stat-card:hover .funnel-add-stat-sub {
    color: #6b7280;
}

.funnel-stat-picker-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.funnel-stat-picker-overlay.open {
    display: flex;
}

.funnel-stat-picker {
    width: min(520px, 100%);
    max-height: min(80vh, 640px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.funnel-stat-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 12px;
    border-bottom: 1px solid #e5e7eb;
}

.funnel-stat-picker-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1d1d1f;
}

.funnel-stat-picker-close {
    border: none;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 4px 8px;
}

.funnel-stat-picker-close:hover {
    color: #1d1d1f;
}

.funnel-stat-picker-desc {
    margin: 0;
    padding: 12px 20px;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.45;
    border-bottom: 1px solid #f3f4f6;
}

.funnel-stat-picker-sections {
    overflow-y: auto;
    padding: 12px 20px 20px;
}

.funnel-stat-picker-section + .funnel-stat-picker-section {
    margin-top: 16px;
}

.funnel-stat-picker-section-title {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.funnel-stat-picker-section-title i {
    margin-right: 6px;
    color: #9ca3af;
}

.funnel-stat-picker-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.funnel-stat-picker-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    font: inherit;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.funnel-stat-picker-option:hover {
    border-color: #007AFF;
    background: rgba(0, 122, 255, 0.04);
}

.funnel-stat-picker-option.active {
    border-color: #007AFF;
    background: rgba(0, 122, 255, 0.08);
}

.funnel-stat-picker-option-check {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    border-radius: 5px;
    border: 1px solid #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: transparent;
    background: #fff;
}

.funnel-stat-picker-option.active .funnel-stat-picker-option-check {
    border-color: #007AFF;
    background: #007AFF;
    color: #fff;
}

.funnel-stat-picker-option-label {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    color: #1d1d1f;
}

.funnel-stat-picker-option-value {
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 700;
    color: #374151;
}

.funnel-marketing-layout-picker {
    width: min(560px, 100%);
}

.funnel-layout-body {
    overflow-y: auto;
    padding: 12px 20px 20px;
    max-height: min(60vh, 520px);
}

.funnel-layout-block + .funnel-layout-block {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #f3f4f6;
}

.funnel-layout-block-title {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.funnel-layout-block-hint {
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: #9ca3af;
    margin-left: 6px;
}

.funnel-layout-active-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.funnel-layout-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    cursor: grab;
}

.funnel-layout-row.is-dragging {
    opacity: 0.55;
    cursor: grabbing;
}

.funnel-layout-row.is-drag-over {
    border-color: #007AFF;
    background: rgba(0, 122, 255, 0.06);
}

.funnel-layout-grip {
    flex: 0 0 auto;
    color: #9ca3af;
    font-size: 12px;
}

.funnel-layout-row-label {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    color: #1d1d1f;
}

.funnel-layout-row-value {
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 700;
    color: #374151;
}

.funnel-layout-toggle {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border-radius: 5px;
    border: 1px solid #d1d5db;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    color: #6b7280;
    background: #fff;
    cursor: pointer;
    padding: 0;
}

.funnel-layout-toggle-option {
    cursor: pointer;
}

.funnel-layout-toggle-option.active {
    border-color: #007AFF;
    background: rgba(0, 122, 255, 0.08);
}

.funnel-layout-toggle.is-active,
.funnel-layout-toggle-option.active .funnel-layout-toggle {
    border-color: #dc2626;
    background: #fef2f2;
    color: #dc2626;
}

.funnel-layout-toggle-option:not(.active) .funnel-layout-toggle {
    border-color: #007AFF;
    background: #eff6ff;
    color: #007AFF;
}

.funnel-layout-row .funnel-layout-toggle:hover {
    background: #fee2e2;
}

.funnel-layout-toggle-option:not(.active):hover .funnel-layout-toggle {
    background: #007AFF;
    color: #fff;
}

.funnel-layout-toggle-option.active:hover .funnel-layout-toggle {
    background: #dc2626;
    color: #fff;
}

.funnel-layout-empty {
    padding: 14px 12px;
    border: 1px dashed #d1d5db;
    border-radius: 10px;
    font-size: 13px;
    color: #6b7280;
    text-align: center;
}

.funnel-card-arrow {
    position: static;
    flex: 0 0 auto;
    order: 11;
    margin-left: 4px;
    transform: none;
    color: #9ca3af;
    font-size: 10px;
}

.funnel-visual {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 24px;
}

.funnel-visual h2 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
}

.funnel-bar-row {
    display: grid;
    grid-template-columns: 120px 1fr 48px;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.funnel-bar-label {
    font-size: 13px;
    color: #374151;
    font-weight: 500;
}

.funnel-bar-track {
    height: 28px;
    background: #f3f4f6;
    border-radius: 999px;
    overflow: hidden;
}

.funnel-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s ease;
}

.funnel-bar-fill.step-1 { background: linear-gradient(90deg, #60a5fa, #3b82f6); }
.funnel-bar-fill.step-2 { background: linear-gradient(90deg, #34d399, #10b981); }
.funnel-bar-fill.step-3 { background: linear-gradient(90deg, #fbbf24, #f59e0b); }

.funnel-bar-count {
    font-size: 14px;
    font-weight: 600;
    color: #1d1d1f;
    text-align: right;
}

.funnel-price-insight {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 24px;
}

.funnel-price-insight-header h2 {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
    display: flex;
    align-items: center;
    gap: 8px;
}

.funnel-price-insight-header h2 i {
    color: #f59e0b;
}

.funnel-price-insight-sub {
    margin: 0 0 16px 0;
    font-size: 13px;
    color: #6b7280;
}

.funnel-price-insight-summary {
    margin: 0 0 14px 0;
    font-size: 13px;
    color: #374151;
    line-height: 1.5;
}

.funnel-price-insight-foot {
    margin: 12px 0 0 0;
    font-size: 12px;
    color: #9ca3af;
}

.funnel-price-insight-loading,
.funnel-price-insight-empty {
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    padding: 20px 12px;
}

.funnel-price-insight-empty i {
    display: block;
    font-size: 24px;
    margin-bottom: 8px;
    color: #d1d5db;
}

.funnel-price-insight-empty span {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #9ca3af;
}

.funnel-price-bucket-head,
.funnel-price-bucket-row {
    display: grid;
    grid-template-columns: 120px 1fr 72px;
    gap: 12px;
    align-items: center;
}

.funnel-price-bucket-head {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #9ca3af;
    margin-bottom: 8px;
}

.funnel-price-bucket-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.funnel-price-bucket-row {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
    padding: 10px 12px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.funnel-price-bucket-row:hover {
    border-color: #007AFF;
    background: #f0f7ff;
}

.funnel-price-bucket-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.funnel-price-bucket-chart {
    min-width: 0;
}

.funnel-price-bucket-track {
    height: 10px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 4px;
}

.funnel-price-bucket-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    transition: width 0.3s ease;
}

.funnel-price-bucket-meta {
    font-size: 11px;
    color: #6b7280;
}

.funnel-price-bucket-rate {
    font-size: 15px;
    font-weight: 700;
    color: #1d1d1f;
    text-align: right;
}

.funnel-loading,
.funnel-error {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    font-size: 14px;
}

.funnel-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.funnel-modal-overlay.open {
    display: flex;
}

.funnel-modal {
    background: #fff;
    border-radius: 14px;
    width: min(720px, 100%);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.funnel-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.funnel-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
}

.funnel-modal-close {
    border: none;
    background: #f3f4f6;
    color: #374151;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
}

.funnel-modal-close:hover {
    background: #e5e7eb;
}

.funnel-modal-body {
    overflow-y: auto;
    padding: 16px 20px 20px;
}

.funnel-modal.funnel-modal--split {
    width: min(920px, 100%);
}

.funnel-modal--split .funnel-modal-body {
    padding: 0;
    overflow: hidden;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.funnel-responses-split {
    display: grid;
    grid-template-columns: 220px 1fr;
    grid-template-rows: minmax(0, 1fr);
    flex: 1 1 auto;
    min-height: 0;
    height: min(520px, calc(85vh - 72px));
    max-height: calc(85vh - 72px);
}

.funnel-responses-names {
    border-right: 1px solid #e5e7eb;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px;
    background: #fafafa;
    min-height: 0;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.funnel-responses-name-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.funnel-responses-name-item:hover {
    background: #f3f4f6;
}

.funnel-responses-name-item.active {
    background: #eff6ff;
    color: #007AFF;
    font-weight: 600;
}

.funnel-responses-thread {
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #fff;
    min-height: 0;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.funnel-message-bubble {
    border-radius: 12px;
    padding: 10px 12px;
    max-width: 85%;
}

.funnel-message-bubble--inbound {
    background: #f3f4f6;
    align-self: flex-start;
}

.funnel-message-bubble--outbound {
    background: #007AFF;
    color: #fff;
    align-self: flex-end;
}

.funnel-message-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.funnel-message-sender {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.funnel-message-bubble--inbound .funnel-message-sender,
.funnel-message-bubble--inbound .funnel-message-time {
    color: #6b7280;
}

.funnel-message-bubble--outbound .funnel-message-sender,
.funnel-message-bubble--outbound .funnel-message-time {
    color: rgba(255, 255, 255, 0.85);
}

.funnel-message-time {
    font-size: 11px;
    white-space: nowrap;
}

.funnel-message-body {
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.funnel-message-bubble--inbound .funnel-message-body {
    color: #1d1d1f;
}

.funnel-message-bubble--outbound .funnel-message-body {
    color: #fff;
}

.funnel-responses-empty {
    color: #6b7280;
    padding: 24px;
    text-align: center;
    font-size: 14px;
}

.funnel-list-item {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
}

.funnel-list-item:last-child {
    margin-bottom: 0;
}

.funnel-list-item-name {
    font-weight: 600;
    color: #1d1d1f;
    font-size: 14px;
    margin-bottom: 4px;
}

.funnel-list-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.funnel-list-item-top .funnel-list-item-name {
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
}

.funnel-responded-check {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #10b981;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    line-height: 1;
}

.funnel-list-item-meta {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 6px;
}

.funnel-list-item-body {
    font-size: 14px;
    color: #374151;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.funnel-empty-list {
    text-align: center;
    color: #6b7280;
    padding: 24px 12px;
    font-size: 14px;
}

.main-content[data-theme="dark"] .funnel-card-value,
.main-content[data-theme="dark"] .funnel-bar-count,
.main-content[data-theme="dark"] .funnel-modal-header h3,
.main-content[data-theme="dark"] .funnel-list-item-name {
    color: #f3f4f6;
}

.main-content[data-theme="dark"] .funnel-period-picker,
.main-content[data-theme="dark"] .funnel-card,
.main-content[data-theme="dark"] .funnel-visual,
.main-content[data-theme="dark"] .funnel-price-insight,
.main-content[data-theme="dark"] .funnel-modal,
.main-content[data-theme="dark"] .funnel-list-item {
    background: #1f2937;
    border-color: #374151;
}

.main-content[data-theme="dark"] .funnel-period-btn {
    background: #111827;
    border-color: #374151;
    color: #d1d5db;
}

.main-content[data-theme="dark"] .funnel-date-input {
    background: #111827;
    border-color: #374151;
    color: #d1d5db;
}

.main-content[data-theme="dark"] .funnel-period-btn.active {
    background: #007AFF;
    border-color: #007AFF;
    color: #fff;
}

.main-content[data-theme="dark"] .funnel-bar-track {
    background: #374151;
}

.main-content[data-theme="dark"] .funnel-price-insight-header h2,
.main-content[data-theme="dark"] .funnel-price-bucket-label,
.main-content[data-theme="dark"] .funnel-price-bucket-rate {
    color: #f3f4f6;
}

.main-content[data-theme="dark"] .funnel-price-insight-summary {
    color: #d1d5db;
}

.main-content[data-theme="dark"] .funnel-price-bucket-row {
    background: #111827;
    border-color: #374151;
}

.main-content[data-theme="dark"] .funnel-price-bucket-row:hover {
    background: #1e3a5f;
    border-color: #007AFF;
}

.main-content[data-theme="dark"] .funnel-price-bucket-track {
    background: #374151;
}

.main-content[data-theme="dark"] .funnel-list-item-body {
    color: #d1d5db;
}

.main-content[data-theme="dark"] .funnel-responses-names {
    background: #111827;
    border-color: #374151;
}

.main-content[data-theme="dark"] .funnel-responses-name-item {
    color: #d1d5db;
}

.main-content[data-theme="dark"] .funnel-responses-name-item:hover {
    background: #1f2937;
}

.main-content[data-theme="dark"] .funnel-responses-name-item.active {
    background: #1e3a5f;
    color: #60a5fa;
}

.main-content[data-theme="dark"] .funnel-responses-thread {
    background: #1f2937;
}

.main-content[data-theme="dark"] .funnel-message-bubble {
    background: #374151;
}

.main-content[data-theme="dark"] .funnel-message-bubble--inbound {
    background: #374151;
}

.main-content[data-theme="dark"] .funnel-message-bubble--outbound {
    background: #2563eb;
}

.main-content[data-theme="dark"] .funnel-message-body {
    color: #f3f4f6;
}

.main-content[data-theme="dark"] .funnel-message-bubble--inbound .funnel-message-body {
    color: #f3f4f6;
}

.main-content[data-theme="dark"] .funnel-add-stat-card {
    background: #1f2937;
    border-color: #4b5563;
    color: #9ca3af;
}

.main-content[data-theme="dark"] .funnel-add-stat-card:hover {
    background: rgba(0, 122, 255, 0.12);
    border-color: #007AFF;
    color: #93c5fd;
}

.main-content[data-theme="dark"] .funnel-add-stat-icon {
    background: #374151;
    border-color: #4b5563;
}

.main-content[data-theme="dark"] .funnel-stat-picker {
    background: #1f2937;
}

.main-content[data-theme="dark"] .funnel-stat-picker-header {
    border-bottom-color: #374151;
}

.main-content[data-theme="dark"] .funnel-stat-picker-header h3,
.main-content[data-theme="dark"] .funnel-stat-picker-option-label {
    color: #f3f4f6;
}

.main-content[data-theme="dark"] .funnel-stat-picker-desc {
    border-bottom-color: #374151;
    color: #9ca3af;
}

.main-content[data-theme="dark"] .funnel-stat-picker-section-title {
    color: #d1d5db;
}

.main-content[data-theme="dark"] .funnel-stat-picker-option {
    background: #111827;
    border-color: #374151;
}

.main-content[data-theme="dark"] .funnel-stat-picker-option-value {
    color: #e5e7eb;
}

.main-content[data-theme="dark"] .funnel-stat-picker-option-check {
    background: #374151;
    border-color: #4b5563;
}

.main-content[data-theme="dark"] .funnel-layout-block + .funnel-layout-block {
    border-top-color: #374151;
}

.main-content[data-theme="dark"] .funnel-layout-block-title,
.main-content[data-theme="dark"] .funnel-layout-row-label {
    color: #f3f4f6;
}

.main-content[data-theme="dark"] .funnel-layout-row {
    background: #111827;
    border-color: #374151;
}

.main-content[data-theme="dark"] .funnel-layout-row-value {
    color: #e5e7eb;
}

.main-content[data-theme="dark"] .funnel-layout-empty {
    border-color: #4b5563;
    color: #9ca3af;
}

.main-content[data-theme="dark"] .funnel-layout-toggle {
    background: #374151;
    border-color: #4b5563;
    color: #9ca3af;
}

.main-content[data-theme="dark"] .funnel-layout-toggle.is-active,
.main-content[data-theme="dark"] .funnel-layout-toggle-option.active .funnel-layout-toggle {
    background: rgba(220, 38, 38, 0.15);
    border-color: #f87171;
    color: #fca5a5;
}

.main-content[data-theme="dark"] .funnel-layout-toggle-option:not(.active) .funnel-layout-toggle {
    background: rgba(0, 122, 255, 0.15);
    border-color: #60a5fa;
    color: #93c5fd;
}

@media (max-width: 900px) {
    .funnel-card-label {
        flex-basis: 76px;
        font-size: 10px;
    }

    .funnel-card-value {
        font-size: 16px;
    }

    .funnel-card-sub,
    .funnel-card-rate {
        font-size: 10px;
    }
}

@media (max-width: 768px) {
    .funnel-bar-row {
        grid-template-columns: 90px 1fr 40px;
    }

    .funnel-price-bucket-head {
        display: none;
    }

    .funnel-price-bucket-row {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        gap: 8px 12px;
    }

    .funnel-price-bucket-label {
        grid-column: 1;
    }

    .funnel-price-bucket-rate {
        grid-column: 2;
        grid-row: 1;
    }

    .funnel-price-bucket-chart {
        grid-column: 1 / -1;
    }

    .funnel-responses-split {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr);
        height: min(640px, calc(85vh - 72px));
        max-height: calc(85vh - 72px);
    }

    .funnel-responses-names {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        max-height: 160px;
        min-height: 0;
    }
}

.funnel-bh-section {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 2px solid #e5e7eb;
}

.funnel-bh-section .bh-container {
    max-width: none;
}

.funnel-bh-section .bh-save-hint {
    display: block;
    min-height: 18px;
    margin-bottom: 8px;
}

.funnel-bh-section .bh-marketing-list-title {
    font-size: 0.95rem;
}
