:root{--page-bg:#f5f7fb;--sidebar-bg:#3d4b59;--line:#e3eaf3;--line-soft:#edf1f6;--text:#2f3c4d;--muted:#8795a7;--brand:#3f86ff;--font:"Microsoft YaHei UI","Microsoft YaHei","PingFang SC","Noto Sans SC",sans-serif}*{box-sizing:border-box}html,body{margin:0;height:100%;font-family:var(--font);color:var(--text);background:var(--page-bg)}button,input,select{font:inherit}button{cursor:pointer}a{text-decoration:none;color:inherit}[hidden]{display:none!important}.app{display:flex;height:100vh}.sidebar{width:146px;flex:none;background:var(--sidebar-bg);color:#fff;display:flex;flex-direction:column;justify-content:space-between;padding:14px 8px 10px}.sidebar-main{display:flex;flex-direction:column;gap:10px}.user-badge{width:28px;height:28px;border-radius:50%;background:linear-gradient(145deg,#4fd0ff,#26a8ef);display:grid;place-items:center;font-size:12px;font-weight:700;margin-left:4px}.menu-group{display:flex;flex-direction:column;gap:4px}.menu-group.with-line{border-top:1px solid rgba(255,255,255,.12);padding-top:8px}.menu-item{height:30px;display:flex;align-items:center;gap:8px;padding:4px 8px;border-radius:4px;color:rgba(255,255,255,.92);font-size:14px;white-space:nowrap}.menu-item.active{background:rgba(255,255,255,.16);font-weight:700}.menu-icon,.footer-icon,.title-chip{width:16px;height:16px;display:inline-flex;flex:none}.menu-icon img,.footer-icon img,.title-chip img,.topbar-icon img{width:100%;height:100%;object-fit:contain}.menu-badge{margin-left:auto;min-width:18px;padding:0 4px;border-radius:20px;background:#ff4d5d;color:#fff;font-size:10px;text-align:center}.sidebar-meta{height:24px;display:flex;justify-content:flex-end;align-items:center;gap:4px;color:rgba(255,255,255,.72);font-size:12px}.sidebar-footer{display:flex;gap:8px;padding-left:8px;height:38px}.footer-icon{width:22px;height:22px}.main{min-width:0;min-height:0;flex:1;display:flex;flex-direction:column}.topbar{height:38px;flex:none;background:var(--sidebar-bg);color:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 14px 0 12px}.topbar-title{display:flex;align-items:center;gap:8px;font-size:15px;font-weight:700}.topbar-icon{display:block;width:74px;height:22px}.page-shell{padding:4px;min-height:0;flex:1}.page-card{height:100%;display:flex;flex-direction:column;background:#fff;border-radius:8px;box-shadow:0 2px 8px rgba(28,45,79,.05);overflow:hidden}.page-heading{min-height:78px;padding:18px 24px 14px;display:flex;justify-content:space-between;align-items:center;gap:20px;border-bottom:1px solid var(--line-soft)}h1,h2,p{margin:0}h1{font-size:19px;line-height:28px}.page-heading p{font-size:12px;color:var(--muted);margin-top:4px}.demo-tag{display:inline-block;margin-left:7px;color:#d4841b;background:#fff5e5;border:1px solid #ffe0a9;border-radius:3px;padding:1px 6px}.heading-actions,.toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.heading-actions{justify-content:flex-end}.inline-field,.toolbar label{display:flex;align-items:center;gap:7px;font-size:12px;color:#627185}.toolbar{min-height:54px;padding:8px 24px;border-bottom:1px solid var(--line-soft);gap:16px}.toolbar-note{font-size:11px;color:#a1aaba;margin-left:auto}select,input{border:1px solid #dce5f0;border-radius:4px;background:#fff;color:var(--text);height:32px;padding:0 9px;outline:none}select:focus,input:focus{border-color:var(--brand);box-shadow:0 0 0 2px rgba(63,134,255,.12)}input[type=date]{width:126px}.button{height:32px;border-radius:4px;border:1px solid #dce5f0;background:#fff;color:#526376;padding:0 13px;font-size:12px}.button:hover{border-color:#9ec3ff;color:var(--brand)}.button.primary{background:var(--brand);border-color:var(--brand);color:#fff}.button.primary:hover{background:#2c75eb}.dirty-badge{font-size:11px;color:#e09123;background:#fff7e9;padding:4px 8px;border-radius:3px}.workspace{min-height:0;flex:1;display:flex;background:#f9fbfe}.config-panel{width:334px;min-width:334px;background:#fff;border-right:1px solid var(--line);display:flex;flex-direction:column}.config-head{height:50px;flex:none;display:flex;align-items:center;justify-content:space-between;padding:0 16px 0 20px;border-bottom:1px solid var(--line-soft);font-size:14px}.icon-button{border:0;background:transparent;font-size:25px;color:#8192a6;line-height:25px;padding:2px 7px}.icon-button:hover{color:var(--brand)}.config-scroll{overflow:auto;padding:0 16px 25px}.config-section{padding:19px 3px 20px;border-bottom:1px solid var(--line-soft)}.section-title{font-size:13px;font-weight:700;margin-bottom:15px;display:flex;gap:9px;align-items:center}.section-title span{font-size:11px;color:#fff;background:#8fb9ff;border-radius:50%;width:21px;height:21px;display:grid;place-items:center}.field-label{display:flex;flex-direction:column;gap:6px;font-size:12px;color:#66778a;margin-bottom:10px}.field-label select,.field-label input{width:100%;font-size:12px}.help-text{font-size:11px;line-height:1.55;color:#9ba8b7;margin-top:8px}.condition-row{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin:8px 0}.condition-row .wide{grid-column:1/-1}.stage-card{border:1px solid var(--line);border-radius:6px;background:#fff;margin:9px 0;overflow:hidden}.stage-card.selected{border-color:#8db8ff;box-shadow:0 0 0 2px rgba(63,134,255,.08)}.stage-header{display:flex;align-items:center;gap:7px;padding:10px;background:#f8faff}.stage-index{background:#e7f0ff;color:#3979dc;border-radius:4px;padding:2px 5px;font-size:11px;font-weight:700}.stage-toggle{flex:1;border:0;text-align:left;background:none;color:#35485e;font-size:12px;font-weight:700;padding:0}.stage-actions{display:flex;gap:1px}.stage-actions button{border:0;background:none;color:#8594a8;font-size:13px;width:20px;height:21px;padding:0}.stage-actions button:hover{color:var(--brand)}.stage-body{padding:10px}.stage-body .field-label{margin-bottom:8px}.stage-error{color:#df5a51;font-size:11px;padding:0 10px 9px}.add-stage{height:31px;width:100%;border:1px dashed #a7c4ef;border-radius:5px;background:#f7faff;color:#4484e4;display:flex;align-items:center;justify-content:center;gap:5px;font-size:12px}.add-stage img{width:14px;height:14px}.expand-config{align-self:start;margin:18px 0 0 12px;border:1px solid #cfe1fc;background:#fff;color:#3979dc;border-radius:4px;padding:8px 10px;font-size:12px}.funnel-panel{min-width:0;flex:1;overflow:auto;padding:22px 30px 24px}.result-head{display:flex;align-items:start;justify-content:space-between;gap:15px;padding-bottom:17px;border-bottom:1px solid var(--line-soft)}.result-head h2{font-size:17px}.result-head p{color:#8b99a9;font-size:12px;margin-top:6px}.result-meta{display:flex;gap:12px;align-items:center;font-size:11px;color:#8795a7;white-space:nowrap}.result-meta span:first-child{background:#eaf2ff;color:#3678dc;border-radius:3px;padding:4px 7px}.result-notice{margin:13px 0;padding:9px 12px;border-radius:4px;background:#fff8e9;color:#956918;font-size:12px}.funnel-result{padding:24px 12px 10px;display:flex;flex-direction:column;align-items:center}.funnel-stage{width:min(95%,700px);border:1px solid #d9e7ff;background:linear-gradient(90deg,#d8e8ff,#eef5ff);border-radius:8px;min-height:68px;padding:12px 18px;display:flex;justify-content:space-between;align-items:center;gap:12px;text-align:left;color:#244b7f;box-shadow:0 2px 8px rgba(63,134,255,.08)}.funnel-stage:hover{border-color:#74a7f4;box-shadow:0 4px 15px rgba(63,134,255,.16)}.funnel-stage.selected{outline:2px solid #3f86ff}.funnel-stage .stage-name{font-size:15px;font-weight:700}.funnel-stage .stage-desc{display:block;font-size:11px;font-weight:400;color:#68809e;margin-top:4px}.funnel-stage .stage-count{font-size:25px;font-weight:700;white-space:nowrap}.stage-count small{font-size:12px;font-weight:400;margin-left:4px}.funnel-stage[data-level="1"]{background:linear-gradient(90deg,#b8d3ff,#e4efff)}.funnel-stage[data-level="2"]{background:linear-gradient(90deg,#a8caff,#dceaff)}.funnel-stage[data-level="3"]{background:linear-gradient(90deg,#94bdf9,#d4e7ff)}.funnel-stage[data-level="4"],.funnel-stage[data-level="5"]{background:linear-gradient(90deg,#7faef1,#cce2ff)}.funnel-connector{min-height:54px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;color:#6b7f99;font-size:12px}.funnel-connector .arrow{color:#73a4ef;font-size:15px;line-height:12px}.funnel-connector strong{color:#397bdc}.funnel-connector button{border:0;background:none;color:#6a88b0;font-size:11px;text-decoration:underline}.funnel-stage.has-group{display:block}.stage-main{display:flex;align-items:center;justify-content:space-between}.group-mini{display:flex;height:8px;border-radius:8px;overflow:hidden;background:#e8eef8;margin-top:9px}.group-mini span{height:100%}.group-legend{display:flex;justify-content:center;gap:12px;flex-wrap:wrap;font-size:11px;color:#6a7d92;margin:0 0 14px}.legend-dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:4px}.result-foot{border-top:1px solid var(--line-soft);padding-top:15px;color:#8493a5;font-size:11px;line-height:1.7}.result-foot button{border:0;background:none;color:var(--brand);padding:0;text-decoration:underline}.status-box{width:min(100%,550px);text-align:center;margin:90px auto 0;color:#7d8ca0;font-size:13px}.status-box img{width:150px;height:120px;object-fit:contain;display:block;margin:0 auto 15px}.status-box strong{display:block;color:#43536a;font-size:16px;margin-bottom:5px}.detail-overlay,.dialog-overlay{position:fixed;inset:0;z-index:20}.detail-scrim,.dialog-scrim{position:absolute;inset:0;background:rgba(31,49,72,.28)}.detail-panel{position:absolute;right:0;top:0;bottom:0;width:min(620px,90vw);background:#fff;box-shadow:-8px 0 24px rgba(28,45,79,.13);display:flex;flex-direction:column}.detail-head{padding:20px 24px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:start}.detail-head h2{font-size:17px}.detail-head p{font-size:12px;color:#8d9bae;margin-top:7px}.detail-body{overflow:auto;padding:18px 24px}.detail-table{width:100%;border-collapse:collapse;font-size:12px}.detail-table th{text-align:left;background:#edf2f8;color:#627388;padding:10px}.detail-table td{border-bottom:1px solid var(--line-soft);padding:11px 10px;color:#536377}.detail-table a{color:var(--brand)}.detail-note{margin-bottom:12px;padding:9px 11px;background:#f4f8fe;border-radius:4px;color:#73849c;font-size:11px;line-height:1.6}.save-dialog{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);background:#fff;border-radius:8px;box-shadow:0 12px 35px rgba(22,47,87,.17);padding:23px 25px;width:390px}.save-dialog h2{font-size:17px;margin-bottom:20px}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:23px}.toast{position:fixed;top:54px;left:50%;transform:translateX(-50%);z-index:30;background:#fff;border:1px solid #d9e9d0;box-shadow:0 4px 18px rgba(20,40,70,.14);border-radius:5px;color:#438837;font-size:12px;padding:10px 18px}
.funnel-stage .stage-main{width:100%}.funnel-stage .stage-main>div{min-width:0}.funnel-stage .stage-name{display:block}.funnel-stage .stage-count{margin-left:auto}
@media(max-width:1100px){.config-panel{width:305px;min-width:305px}.funnel-panel{padding:18px}.page-heading{padding:13px 16px}.toolbar{padding:8px 16px}.toolbar-note{display:none}}@media(max-width:850px){.sidebar{display:none}.page-heading{align-items:flex-start}.workspace{min-width:800px}.page-card{overflow:auto}.toolbar{flex-wrap:nowrap;overflow:auto}.funnel-panel{min-width:430px}}
/* 无效配置只保留上次有效图形供对照，不允许用旧结果下钻。 */
.funnel-result.stale { opacity: .55; pointer-events: none; }
.detail-table td { vertical-align: top; line-height: 1.5; }
.detail-table td strong { display: block; font-weight: 600; color: #34475e; }
.detail-table td strong.detail-record-link { color: var(--brand); }
.exception-order + .exception-order { margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--line-soft); }
.detail-table td small { display: block; margin-top: 3px; font-size: 11px; color: #8b99a9; }
.detail-type { display: inline-block; margin-bottom: 4px; padding: 1px 5px; border-radius: 3px; background: #edf4ff; color: #4b80cf; font-size: 10px; }
.detail-panel.missed-wide { width: min(820px, 94vw); }
.missed-table-scroll { overflow-x: auto; }
.missed-table { min-width: 690px; }
.missed-table th:nth-child(1) { width: 27%; }
.missed-table th:nth-child(2) { width: 22%; }
.missed-table th:nth-child(3) { width: 21%; }
.missed-table th:nth-child(4) { width: 15%; }
.missed-table th:nth-child(5) { width: 15%; }
.missed-table.without-status { min-width: 0; }
.missed-table.without-status th:nth-child(1) { width: 32%; }
.missed-table.without-status th:nth-child(2) { width: 27%; }
.missed-table.without-status th:nth-child(3) { width: 26%; }
.missed-table.without-status th:nth-child(4) { width: 15%; }
.detail-panel.stage-wide { width: min(900px, 94vw); }
.stage-table-scroll { overflow-x: auto; }
.stage-detail-table td { overflow-wrap: anywhere; }
.business-stage-detail-table { min-width: 760px; table-layout: auto; }
.business-stage-detail-table th:nth-child(n) { width: auto; }
.business-stage-detail-table th { white-space: nowrap; }
.business-stage-quote { min-width: 960px; }
.business-stage-contract { min-width: 1120px; }

.analysis-toolbar {
  position: relative;
  z-index: 6;
  min-height: 58px;
  padding: 9px 20px;
  flex-wrap: nowrap;
  align-items: center;
  gap: 16px;
}
.analysis-toolbar .toolbar-left,
.analysis-toolbar .heading-actions { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: nowrap; }
.analysis-toolbar .heading-actions { flex: none; }
.analysis-toolbar .inline-field { white-space: nowrap; }
.analysis-toolbar .inline-field select { width: min(285px, 27vw); min-width: 190px; }
.scope-filter-wrap { position: relative; }
.scope-filter-toggle {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid #dce5f0;
  border-radius: 4px;
  background: #fff;
  color: #526376;
  font-size: 12px;
  white-space: nowrap;
}
.scope-filter-toggle:hover,
.scope-filter-toggle.has-filters { border-color: #9ec3ff; color: #397bdc; }
.scope-filter-toggle svg { width: 15px; height: 15px; fill: currentColor; }
.filter-count { min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #eaf2ff; color: #3678dc; line-height: 17px; text-align: center; font-size: 10px; }
.scope-filter-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 15;
  width: min(460px, calc(100vw - 180px));
  padding: 16px;
  border: 1px solid #dce5f0;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 8px 26px rgba(28,45,79,.16);
}
.scope-filter-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; color: #35485e; font-size: 13px; }
.text-button { border: 0; background: none; color: #397bdc; font-size: 12px; padding: 3px 0; }
.scope-filter-grid { display: flex; flex-direction: column; gap: 12px; }
.scope-field { display: grid; grid-template-columns: 92px minmax(0,1fr); align-items: center; gap: 10px; min-width: 0; color: #66778a; font-size: 12px; }
.scope-field select { width: 100%; min-width: 0; font-size: 12px; }
.scope-date-fields { display: flex; align-items: center; gap: 6px; color: #8795a7; }
.scope-date-fields input { width: 100%; min-width: 0; padding: 0 7px; font-size: 12px; }
@media(max-width:1100px) {
  .analysis-toolbar { padding: 9px 14px; gap: 8px; }
  .analysis-toolbar .toolbar-left, .analysis-toolbar .heading-actions { gap: 7px; }
  .analysis-toolbar .inline-field select { min-width: 165px; width: min(235px, 24vw); }
  .analysis-toolbar .button { padding: 0 9px; }
  .scope-filter-panel { width: min(460px, calc(100vw - 165px)); }
}
@media(max-width:850px) {
  .analysis-toolbar { min-width: 800px; }
  .scope-filter-panel { width: min(460px, calc(100vw - 32px)); }
}
@media(max-width:700px) {
  .scope-field { grid-template-columns: 90px minmax(0,1fr); }
}
.result-meta span:first-child { background: none; color: #8795a7; padding: 0; }
.config-panel { width: 350px; min-width: 350px; }
.config-section { padding-top: 17px; padding-bottom: 18px; }
.section-title { margin-bottom: 13px; }
.section-hint { margin: -3px 0 12px; color: #8795a7; font-size: 11px; line-height: 1.6; }
.start-date-fields { display: flex; align-items: center; gap: 6px; color: #8795a7; }
.start-date-fields input { min-width: 0; width: 100%; padding: 0 5px; font-size: 11px; }
.section-title .reset-start { margin-left: auto; flex: none; font-size: 11px; font-weight: 400; }
.stage-toggle { min-width: 0; line-height: 1.45; }
.stage-toggle small { display: block; margin-top: 3px; color: #71849d; font-size: 11px; font-weight: 400; overflow-wrap: anywhere; }
.stage-question { margin-bottom: 12px; padding: 8px 10px; border-radius: 4px; background: #f3f7ff; color: #3f6597; font-size: 12px; line-height: 1.55; }
.stage-body .field-label { line-height: 1.5; }
.funnel-stage .stage-desc { max-width: 275px; line-height: 1.4; overflow-wrap: anywhere; }

/* 现代轻商务：保留系统外壳，以轻卡片承载配置与分析。 */
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.platform-switch { height: 24px; display: inline-flex; align-items: center; padding: 2px; border-radius: 4px; background: rgba(255,255,255,.12); }
.platform-option { min-width: 48px; height: 20px; display: inline-flex; align-items: center; justify-content: center; padding: 0 8px; border-radius: 3px; color: rgba(255,255,255,.78); font-size: 12px; white-space: nowrap; }
.platform-option:hover { color: #fff; }
.platform-option.active { background: #fff; color: #3d4b59; font-weight: 700; }
.page-shell { padding: 12px; }
.page-card { box-shadow: 0 2px 8px rgba(28,45,79,.04); }
.analysis-toolbar { min-height: 64px; padding: 12px 22px; }
.analysis-toolbar .inline-field { gap: 12px; color: #65758b; }
.analysis-toolbar .inline-field select { height: 32px; font-size: 13px; font-weight: 600; color: #34465e; border-color: #e3e9f1; background-color: #f8fafc; }
.analysis-toolbar .heading-actions { gap: 10px; }
.button { transition: background .15s, border-color .15s, color .15s; }
.button.primary { box-shadow: 0 2px 4px rgba(63,134,255,.14); }
#resetView { border-color: transparent; color: #718096; }
#resetView:hover { background: #f3f7fd; color: var(--brand); }
.workspace { gap: 16px; padding: 12px 22px; background: #f5f7fb; }
.config-panel { width: 320px; min-width: 320px; border: 1px solid #e8edf4; border-radius: 8px; overflow: hidden; }
.config-head { height: 52px; padding: 0 18px; border-bottom-color: #edf1f6; color: #34465e; }
.config-head strong { font-size: 14px; font-weight: 600; }
.icon-button { border-radius: 4px; }
.icon-button:hover { background: #f1f6ff; }
.config-scroll { padding: 0 16px 20px; scrollbar-width: thin; scrollbar-color: #dce3ed transparent; }
.config-section { padding: 20px 0; border-bottom-color: #eef2f7; }
.config-section:last-child { border-bottom: 0; }
.section-title { gap: 8px; margin-bottom: 16px; font-size: 13px; color: #34465e; }
.section-title > span { width: 24px; height: 24px; border-radius: 6px; background: #eef4ff; color: #4a83d8; font-size: 11px; font-weight: 600; }
.section-title strong { font-weight: 600; }
.section-title .reset-start { font-size: 11px; }
.field-label { color: #6b7b90; gap: 7px; margin-bottom: 13px; line-height: 1.5; }
.field-label select, .field-label input { height: 32px; border-color: #e2e8f0; border-radius: 4px; color: #34465e; }
select:hover, input:hover { border-color: #b9cdea; }
input::placeholder { color: #a0adbc; }
.section-hint, .help-text { color: #8996a7; line-height: 1.7; }
.start-date-fields { gap: 5px; }
.start-date-fields input { padding: 0 5px; }
.condition-row { padding: 10px; gap: 8px; border-radius: 6px; background: #f7f9fc; margin: 8px 0 10px; }
.condition-row select, .condition-row input { width: 100%; min-width: 0; font-size: 12px; }
.condition-row .button { border: 0; background: none; height: 24px; padding: 0; color: #8b99aa; text-align: right; }
.condition-row .button:hover { color: #d26a61; }
#startCondition > .button, .stage-body > .button { border-color: #e2eaf5; background: #fff; color: #4d85d4; }
.stage-card { border-color: #e8edf4; border-radius: 6px; margin: 10px 0; box-shadow: none; }
.stage-card.selected { border-color: #9fc1f4; box-shadow: 0 0 0 2px rgba(63,134,255,.05); }
.stage-header { padding: 12px 10px; gap: 8px; background: #fafbfd; }
.stage-card.is-expanded .stage-header { background: #f4f8ff; border-bottom: 1px solid #eaf0fa; }
.stage-index { flex: none; background: #edf3fd; color: #6185b8; padding: 3px 5px; font-weight: 500; }
.stage-toggle { font-weight: 600; color: #3c4e66; }
.stage-toggle small { color: #8b98aa; font-weight: 400; }
.stage-actions { gap: 1px; }
.stage-actions button { color: #9ba8b9; border-radius: 3px; }
.stage-actions button:hover { background: #e8f1ff; }
.stage-body { padding: 14px 12px; }
.stage-question { margin-bottom: 13px; padding: 0; background: none; color: #6b809b; font-size: 11px; }
.add-stage { margin-top: 12px; height: 32px; border-color: #cad9ef; background: #fff; border-radius: 4px; }
.add-stage:hover { background: #f5f9ff; border-color: #8db6f0; }
.add-stage:disabled { cursor: not-allowed; opacity: .45; background: #f7f9fc; border-color: #d9e0e9; color: #8d9bad; }
.expand-config { margin: 0; height: 32px; padding: 0 10px; border-color: #e1e8f2; white-space: nowrap; }
.funnel-panel { padding: 24px; border: 1px solid #e8edf4; border-radius: 8px; background: #fff; scrollbar-width: thin; scrollbar-color: #dce3ed transparent; }
.result-head { gap: 12px; padding-bottom: 20px; border-bottom-color: #f0f3f7; }
.result-head h2 { font-size: 18px; color: #2e4058; letter-spacing: .2px; font-weight: 600; }
.result-head p { margin-top: 8px; font-size: 12px; color: #8996a8; line-height: 1.7; }
.result-meta { padding-top: 5px; color: #a1acba; font-size: 10px; }
.result-meta span:first-child { color: inherit; }
.funnel-result { --metrics-width: 218px; --metrics-gap: 24px; width: min(100%, 1040px); margin: 0 auto; padding: 24px 0 12px; gap: 0; align-items: flex-start; }
.funnel-stage, .funnel-bridge, .group-legend { width: calc(100% - var(--metrics-width) - var(--metrics-gap)); flex: none; }
.funnel-stage, .funnel-connector { clip-path: polygon(var(--top-inset) 0, calc(100% - var(--top-inset)) 0, calc(100% - var(--bottom-inset)) 100%, var(--bottom-inset) 100%); }
.funnel-stage { --stage-fill: #e7f0ff; --stage-ink: #3766a4; display: block; min-height: clamp(84px, calc((100dvh - 390px) / 4), 104px); padding: 12px 0; border: 0; border-radius: 0; background: var(--stage-fill); color: var(--stage-ink); box-shadow: none; transition: filter .15s; }
.funnel-stage[data-level="1"] { --stage-fill: #cce0ff; --stage-ink: #305e9b; background: var(--stage-fill); }
.funnel-stage[data-level="2"] { --stage-fill: #a7c8fa; --stage-ink: #264f88; background: var(--stage-fill); }
.funnel-stage[data-level="3"] { --stage-fill: #729fe9; --stage-ink: #fff; background: var(--stage-fill); }
.funnel-stage[data-level="4"] { --stage-fill: #5088dd; --stage-ink: #fff; background: var(--stage-fill); }
.funnel-stage[data-level="5"] { --stage-fill: #3974ce; --stage-ink: #fff; background: var(--stage-fill); }
.funnel-stage:hover { box-shadow: none; filter: brightness(.96); }
.funnel-stage.selected { outline: 0; background: var(--stage-fill); }
.funnel-stage:focus-visible { outline: 0; filter: brightness(.9); }
.funnel-stage .stage-main { width: calc(100% - var(--bottom-inset) - var(--bottom-inset) - 16px); max-width: 400px; margin: 0 auto; display: flex; flex-direction: column-reverse; gap: 5px; text-align: center; }
.funnel-stage .stage-main > div { width: 100%; }
.funnel-stage .stage-name { color: var(--stage-ink); font-size: 13px; font-weight: 500; line-height: 1.5; }
.funnel-stage .stage-count { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", var(--font); font-size: 32px; font-weight: 600; line-height: 1.1; letter-spacing: -.6px; font-variant-numeric: tabular-nums; }
.stage-count small { color: var(--stage-ink); font-family: var(--font); font-size: 11px; font-weight: 400; letter-spacing: 0; margin-left: 6px; opacity: .8; }
.funnel-stage .stage-desc { max-width: none; margin-top: 4px; font-size: 10px; color: var(--stage-ink); opacity: .75; line-height: 1.5; overflow-wrap: anywhere; }
.funnel-stage.has-group { min-height: clamp(98px, calc((100dvh - 350px) / 4), 116px); }
.funnel-stage .group-mini { width: calc(100% - var(--bottom-inset) - var(--bottom-inset) - 24px); max-width: 240px; height: 5px; margin: 9px auto 0; }
.funnel-bridge { height: 18px; position: relative; }
.funnel-bridge .funnel-connector { min-height: 0; width: 100%; height: 18px; background: #f1f6fd; }
.transition-stats { position: absolute; top: 50%; left: calc(100% + var(--metrics-gap)); width: var(--metrics-width); transform: translateY(-50%); padding: 0 0 0 14px; border-left: 2px solid #e7effb; background: none; font-size: 11px; color: #8a97a9; line-height: 1.6; }
.transition-stats::before { content: ""; position: absolute; top: 50%; right: calc(100% + 6px); width: 14px; border-top: 1px dashed #c8d9ef; }
.transition-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; white-space: nowrap; font-size: 12px; font-weight: 500; color: #53677f; }
.transition-heading strong { color: #397bdc; font-size: 22px; line-height: 1.3; font-weight: 600; font-variant-numeric: tabular-nums; }
.transition-summary { margin-top: 3px; font-size: 10px; }
.transition-time { margin-top: 2px; font-size: 10px; }
.transition-links { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 5px; }
.transition-links button { padding: 0; border: 0; background: none; color: #5485c9; font-size: 11px; line-height: 1.5; text-decoration: none; }
.transition-links button:hover { color: #256cd4; text-decoration: underline; }
.group-legend { margin: 22px 0 0; gap: 10px 16px; align-self: flex-start; line-height: 1.8; font-size: 11px; color: #78889c; }
.legend-dot { width: 7px; height: 7px; }
.group-choice { border: 0; padding: 3px 7px; border-radius: 4px; background: transparent; color: #78889c; font-size: 11px; line-height: 1.8; }
.group-choice:hover { background: #f0f5fc; color: #3f78c8; }
.group-choice.active { background: #eaf2ff; color: #256eca; font-weight: 600; }
.group-choice.active .legend-dot { box-shadow: 0 0 0 2px #fff, 0 0 0 3px #6d9ee5; }
.status-box { width: 100%; }
.detail-head { padding: 23px 26px 20px; border-bottom-color: #edf1f6; }
.detail-head h2 { font-size: 18px; font-weight: 600; color: #34465e; }
.detail-head p { color: #8997a9; }
.detail-body { padding: 20px 26px; background: #fff; }
.detail-note { margin-bottom: 16px; padding: 12px 14px; background: #f6f9fe; color: #74859d; font-size: 12px; border-radius: 4px; }
.detail-table { font-size: 12px; }
.detail-table th { height: 38px; padding: 10px 14px; background: #f2f5fa; color: #7c8b9e; font-size: 11px; font-weight: 500; }
.detail-table td { padding: 15px 14px; border-bottom-color: #edf1f6; line-height: 1.65; color: #607187; }
.detail-table tbody tr:hover { background: #fafcff; }
.detail-table td strong { font-weight: 500; }
.detail-table td strong.detail-record-link { color: var(--brand); }
.detail-table td small { margin-top: 4px; color: #98a4b4; }
.detail-breakdown { margin-bottom: 18px; }
.detail-breakdown-heading { margin-bottom: 10px; color: #455a73; font-size: 12px; font-weight: 600; }
.detail-breakdown-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-breakdown-choice { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 6px 11px; border: 1px solid #e1e9f3; border-radius: 4px; background: #fff; color: #63758c; font-size: 12px; }
.detail-breakdown-choice strong { color: #344d6e; font-size: 13px; font-weight: 600; }
.detail-breakdown-choice:hover { border-color: #9fc2f5; color: #3375d4; }
.detail-breakdown-choice.active { border-color: #8db7ef; background: #edf5ff; color: #286cc9; }
.detail-breakdown-choice.active strong { color: #286cc9; }
.detail-breakdown-choice:disabled { cursor: default; opacity: .5; }
.detail-breakdown p { margin-top: 9px; color: #97a3b2; font-size: 11px; line-height: 1.5; }
@media (max-width: 1250px) {
  .page-shell { padding: 8px; }
  .workspace { padding: 9px 14px; gap: 12px; }
  .config-panel { width: 300px; min-width: 300px; }
  .config-scroll { padding-left: 14px; padding-right: 14px; }
  .funnel-panel { padding: 20px; }
  .funnel-result { --metrics-width: 192px; --metrics-gap: 18px; }
  .transition-stats { padding-left: 10px; }
  .transition-heading { font-size: 11px; }
  .transition-heading strong { font-size: 20px; }
  .result-head { flex-wrap: wrap; gap: 5px; }
  .result-meta { padding-top: 0; }
}
@media (max-width: 1000px) {
  .workspace { min-width: 820px; }
  .funnel-panel { min-width: 484px; padding: 18px; }
  .funnel-result { --metrics-width: 172px; --metrics-gap: 14px; }
  .transition-heading { gap: 4px; }
  .transition-heading strong { font-size: 18px; }
  .funnel-stage .stage-count { font-size: 28px; }
  .analysis-toolbar { min-width: 0; }
  .workspace:has(.config-panel[hidden]) { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .button, .funnel-stage { transition: none; }
}
