/* 行銷決策計算機（放大版 v2，2026-10-15 重新設計：決策手帳）
   設計規則（改動前先讀）：
   1. 只用站上的色票（site.css :root），資料色只有 5 個：主色橘、成本黃、負值粉、對照棕、中性米。
   2. 字重只用 400 / 700 / 900（站上只載入這三種，其他字重會被瀏覽器合成，造成粗細不一）。
   3. 字級只用這幾級：14（說明、圖軸）／16（內文、欄位）／18（引導）／22（區塊標題）／clamp 28–36（模組標題）／clamp 32–64（結論數字）。
   4. 卡片只有一層：左邊參數卡、右邊結果卡；裡面的圖、指標、提示都是平面區塊，不再套卡片。
   5. 一律不寫英文小標。 */

.lv-calc{
  --c-main:#F08A12; --c-cost:#FFD84D; --c-neg:#F4A6A6; --c-alt:#9E4600; --c-mute:#B9A68D;
  --c-good:#2F7D4F; --c-bad:#B3261E;
  --tap:44px;
  color:var(--ink); font-size:16px; line-height:1.7; font-weight:400;
}
.lv-calc,.lv-calc *{box-sizing:border-box}
.lv-calc section{padding:0}
.lv-calc h1,.lv-calc h2,.lv-calc h3,.lv-calc p,.lv-calc ul,.lv-calc ol{margin:0}
.lv-calc ul,.lv-calc ol{list-style:none;padding:0}
.lv-calc button,.lv-calc input,.lv-calc select{font:inherit;color:inherit}
.lv-calc button{cursor:pointer}
.lv-calc button:disabled{opacity:.45;cursor:not-allowed}
.lv-calc :is(button,input,select,summary,a,[tabindex]):focus-visible{outline:3px solid var(--ink);outline-offset:3px}
.lv-calc ::selection{background:var(--yellow-soft);color:var(--ink)}
.lv-calc .calc{max-width:1120px;margin:0 auto;padding:44px 24px 56px;position:relative}
.lv-calc .content{min-width:0}
.lv-calc :is(.empty-value){color:var(--muted)!important;font-weight:700!important}

/* NT$ 金額與關鍵數值強制不換行 */
.lv-calc :is(.v-value, .s-value, .metric-value, .budget-model strong, .ladder-row strong, .flow-row strong, .scenario-compare b, .planning-bar-label strong, .reach-overview strong, .reach-overview b, .test-sensitivity button b, .kol-card b){
  white-space:nowrap;
  font-variant-numeric:tabular-nums;
}

/* ── 選單：我要決定什麼 ── */
.lv-calc .decide{margin-bottom:32px}
.lv-calc .decide-ask{font-size:18px;font-weight:900;margin-bottom:12px}
.lv-calc .gtabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.lv-calc .gtab{display:flex;flex-direction:column;gap:4px;text-align:left;background:var(--white);border:3px solid var(--ink);border-radius:var(--r-m);padding:14px 18px;min-height:84px;transition:transform .15s,box-shadow .15s}
.lv-calc .gtab b{font-size:18px;font-weight:900;line-height:1.4}
.lv-calc .gtab span{font-size:14px;color:var(--muted)}
.lv-calc .gtab:hover{transform:translateY(-2px);box-shadow:6px 6px 0 var(--ink)}
.lv-calc .gtab:active{transform:translateY(0);box-shadow:none}
.lv-calc .gtab.active{background:var(--orange);box-shadow:6px 6px 0 var(--ink)}
.lv-calc .gtab.active span{color:var(--ink);opacity:.9}
.lv-calc .mods{display:flex;flex-wrap:wrap;gap:10px;margin-top:16px}
.lv-calc .mod{min-height:var(--tap);padding:6px 20px;border-radius:999px;background:var(--white);border:2px solid var(--ink);font-weight:700;transition:background .15s,color .15s}
.lv-calc .mod:hover{background:var(--yellow-soft)}
.lv-calc .mod.active{background:var(--ink);color:var(--yellow)}

/* ── 模組標題 ── */
.lv-calc .mod-head{margin-bottom:24px}
.lv-calc .mod-kicker{display:inline-block;background:var(--ink);color:var(--yellow);font-weight:700;font-size:14px;letter-spacing:.12em;padding:4px 14px;border-radius:999px;margin-bottom:12px}
.lv-calc .calc-title{font-size:clamp(28px,3.4vw,36px);font-weight:900;line-height:1.35;text-wrap:balance}
.lv-calc .calc-title:focus{outline:none}
.lv-calc .calc-title:focus-visible{outline:3px solid var(--orange);outline-offset:6px;border-radius:12px}
.lv-calc .mod-desc{margin-top:8px;color:var(--muted);max-width:38em}

/* ── 結論卡：三種底色與狀態標籤高對比度規範 ── */
.lv-calc .verdict{display:grid;gap:8px;margin-bottom:32px;padding:26px 30px;background:var(--yellow-soft);border:3px solid var(--ink);border-radius:var(--r-l);box-shadow:8px 8px 0 var(--ink)}
.lv-calc .verdict.is-bad{background:var(--pink-soft)}
.lv-calc .verdict.is-neutral{background:var(--white)}
.lv-calc .v-label{font-size:16px;font-weight:700;color:var(--ink)}
.lv-calc .v-value{display:block;font-size:clamp(36px,5.5vw,64px);font-weight:900;line-height:1.15;font-variant-numeric:tabular-nums;white-space:nowrap}
.lv-calc .v-line{font-size:18px;max-width:40em;color:var(--ink);text-wrap:pretty}
.lv-calc .v-chip{justify-self:start;margin-top:6px;padding:4px 14px;border-radius:999px;background:var(--ink);color:var(--yellow);font-size:14px;font-weight:700}
.lv-calc .verdict.is-bad .v-chip{background:var(--c-bad);color:var(--white)}

/* ── 版面 ── */
.lv-calc .workspace{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,6fr);gap:28px;align-items:start}
.lv-calc .stack{display:flex;flex-direction:column;gap:24px;min-width:0}
.lv-calc .panel{min-width:0;background:var(--white);border:3px solid var(--yellow);border-radius:var(--r-l);padding:28px}
.lv-calc .result{min-width:0;background:var(--white);border:3px solid var(--ink);border-radius:var(--r-l);padding:28px;box-shadow:6px 6px 0 var(--yellow)}
.lv-calc .panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:18px}
.lv-calc .panel-head h2{font-size:22px;font-weight:900;line-height:1.4}
.lv-calc .panel-head p{font-size:14px;color:var(--muted);margin-top:2px}
.lv-calc .panel-tag{flex:none;font-size:14px;font-weight:700;background:var(--cream-2);border-radius:999px;padding:2px 14px;white-space:nowrap}
.lv-calc .section-label{font-size:16px;font-weight:900;margin:20px 0 10px}
.lv-calc .section-label:first-child{margin-top:0}
.lv-calc .rule{border:0;border-top:2px dashed var(--line);margin:24px 0}

/* ── 切換（分段） ── */
.lv-calc .segment{display:flex;gap:4px;padding:4px;background:var(--cream-2);border:2px solid var(--line);border-radius:999px;margin-bottom:20px}
.lv-calc .segment button{flex:1;min-height:var(--tap);border:0;border-radius:999px;background:transparent;padding:4px 12px;font-weight:700;min-width:0;transition:background .15s}
.lv-calc .segment button.active{background:var(--ink);color:var(--yellow)}
.lv-calc .segment button:not(.active):hover{background:var(--white)}

/* ── 輸入 ── */
.lv-calc .field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 16px}
.lv-calc .field{display:flex;flex-direction:column;gap:6px;min-width:0}
.lv-calc .field.wide{grid-column:1/-1}
.lv-calc .field label{font-size:16px;font-weight:700;line-height:1.5}
.lv-calc .field small{font-size:14px;color:var(--muted);line-height:1.6}
.lv-calc .input-wrap{display:flex;align-items:stretch;min-height:48px;border:2px solid var(--ink);border-radius:12px;background:var(--white);overflow:hidden}
.lv-calc .input-wrap:focus-within{box-shadow:0 0 0 4px var(--yellow-soft)}
.lv-calc .input-wrap input{min-width:0;width:100%;border:0;background:transparent;padding:8px 12px;font-size:18px;font-weight:700;font-variant-numeric:tabular-nums;outline:0}
.lv-calc .input-wrap input[type=number]{appearance:textfield;-moz-appearance:textfield}
.lv-calc .input-wrap input[type=number]::-webkit-inner-spin-button,.lv-calc .input-wrap input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
.lv-calc .input-wrap span{display:flex;align-items:center;padding:0 12px 0 0;font-size:14px;color:var(--muted);white-space:nowrap}
.lv-calc :is(.select,.input-text){width:100%;min-height:48px;border:2px solid var(--ink);border-radius:12px;background:var(--white);padding:8px 12px;font-weight:700}
.lv-calc .formula{margin-top:18px;padding:12px 16px;background:var(--cream-2);border-radius:12px;font-size:14px;line-height:1.8}
.lv-calc .formula b{font-weight:900}
.lv-calc .inline-note{margin-top:14px;padding:12px 16px;background:var(--cream-2);border-left:5px solid var(--orange);border-radius:0 12px 12px 0;font-size:14px;line-height:1.8}
.lv-calc .action-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:16px}
.lv-calc .ghost-button{min-height:var(--tap);padding:6px 18px;border:2px solid var(--ink);border-radius:999px;background:var(--white);font-weight:700;transition:background .15s}
.lv-calc .ghost-button:hover{background:var(--yellow-soft)}
.lv-calc .warning{margin-top:16px;padding:12px 16px;background:var(--pink-soft);border:2px solid var(--ink);border-radius:12px;font-size:14px;line-height:1.7;color:var(--ink)}

/* ── 結果卡裡面：圖卡、指標 ── */
.lv-calc .visual-card{margin:0 0 24px}
.lv-calc .visual-heading h3{font-size:22px;font-weight:900;line-height:1.4}
.lv-calc .visual-heading p{font-size:14px;color:var(--muted);margin-top:2px}
.lv-calc .visual-tabs{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:14px 0 4px}
.lv-calc .visual-tabs .vt-label{font-size:14px;color:var(--muted);margin-right:4px}
.lv-calc .visual-tabs button{min-height:var(--tap);padding:4px 16px;border:2px solid var(--ink);border-radius:999px;background:var(--white);font-size:14px;font-weight:700;transition:background .15s}
.lv-calc .visual-tabs button.active{background:var(--ink);color:var(--yellow)}
.lv-calc .visual-body{margin-top:14px}
.lv-calc .visual-insight{margin-top:16px;padding:14px 18px;background:var(--cream-2);border-radius:12px;font-size:16px;line-height:1.8;color:var(--ink)}
.lv-calc .visual-insight b{font-weight:900;color:var(--ink)}
.lv-calc .chart-caption{margin-top:12px;font-size:14px;color:var(--muted);line-height:1.7}
.lv-calc .chart-legend{display:flex;flex-wrap:wrap;gap:6px 16px;margin-top:12px;font-size:14px}
.lv-calc .chart-legend span{display:inline-flex;align-items:center;gap:6px}
.lv-calc .chart-legend i{display:inline-block;width:14px;height:14px;border:2px solid var(--ink);border-radius:4px}
.lv-calc .legend-cyan{background:var(--c-main)}
.lv-calc .legend-orange{background:var(--c-cost)}
.lv-calc .legend-blue{background:var(--c-alt)}
.lv-calc .legend-red{background:var(--c-neg)}
.lv-calc .legend-muted{background:var(--c-mute)}
.lv-calc .legend-better{background:#FFE0A8}
.lv-calc .legend-worse{background:var(--pink-soft)}
.lv-calc .text-cyan{color:var(--orange-text)!important}
.lv-calc .text-red{color:var(--c-bad)!important}
.lv-calc .chart-empty{padding:36px 12px;text-align:center;color:var(--muted)}
.lv-calc .chart-scroll{overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin}
.lv-calc .scroll-hint{display:none;margin:4px 0 6px;font-size:14px;color:var(--muted)}
.lv-calc .scroll-hint.is-overflow{display:block}

.lv-calc .metric-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:24px}
.lv-calc .metric{min-width:0;padding:14px 16px;background:var(--cream);border-radius:14px}
.lv-calc .metric-label{font-size:14px;font-weight:700;color:var(--muted);line-height:1.5}
.lv-calc .metric-value{margin-top:2px;font-size:22px;font-weight:900;line-height:1.35;font-variant-numeric:tabular-nums;white-space:nowrap}
.lv-calc .metric small{display:block;margin-top:2px;font-size:14px;color:var(--muted);line-height:1.5}
.lv-calc .data-details{margin-top:24px;border-top:2px dashed var(--line);padding-top:8px}
.lv-calc .data-details summary{cursor:pointer;min-height:var(--tap);display:flex;align-items:center;font-weight:700}
.lv-calc .flow{margin-top:8px}
.lv-calc .flow-list{display:flex;flex-direction:column}
.lv-calc .flow-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 0;border-bottom:1px solid var(--line);font-size:16px}
.lv-calc .flow-row:last-child{border-bottom:0}
.lv-calc .flow-row strong{font-weight:900;font-variant-numeric:tabular-nums;white-space:nowrap}
.lv-calc .flow-row em{margin-left:6px;font-style:normal;font-size:14px;color:var(--muted)}
.lv-calc .footnote{margin-top:16px;font-size:14px;color:var(--muted);line-height:1.8}
.lv-calc .footnote a{display:inline-flex;align-items:center;min-height:var(--tap);color:var(--orange-text)}
.lv-calc .page-footer{margin-top:34px;text-align:center;font-size:14px;color:var(--muted)}

/* ── KOL ── */
.lv-calc .kol-list{display:flex;flex-direction:column;gap:10px}
.lv-calc .kol-card{width:100%;display:flex;justify-content:space-between;align-items:center;gap:12px;text-align:left;padding:12px 16px;border:2px solid var(--line);border-radius:12px;background:var(--white)}
.lv-calc .kol-card:hover{border-color:var(--ink)}
.lv-calc .kol-card.active{border-color:var(--ink);background:var(--yellow-soft)}
.lv-calc .kol-card.active small{color:var(--ink);opacity:.85}
.lv-calc .kol-card strong{display:block;font-weight:900}
.lv-calc .kol-card small{display:block;font-size:14px;color:var(--muted)}
.lv-calc .kol-card b{font-weight:900;white-space:nowrap}
.lv-calc .kol-editor-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 0 14px}
.lv-calc .kol-editor-head h3{font-size:18px;font-weight:900}
.lv-calc .kol-editor-head button{min-height:var(--tap);padding:0 6px;border:0;background:transparent;color:var(--c-bad);font-weight:700;text-decoration:underline;text-underline-offset:3px}
.lv-calc .kol-spotlight{margin-top:22px;padding-top:18px;border-top:2px dashed var(--line)}
.lv-calc .kol-spotlight h3{font-size:18px;font-weight:900;margin-bottom:10px}
.lv-calc .spotlight-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.lv-calc .spotlight-grid .metric-value{font-size:18px;white-space:nowrap}

/* ── 進度條與長條圖軌道：徹底修復 Chromium 圓角 overflow 裁切黑邊毛邊 ── */
.lv-calc :is(.budget-model-track,.ladder-track,.planning-bar-track,.progress,.retention-track){
  height:18px;
  margin-top:8px;
  background:var(--cream-2);
  border:2px solid var(--ink);
  border-radius:999px;
  overflow:hidden;
  background-clip:padding-box;
  isolation:isolate;
  transform:translateZ(0);
}
.lv-calc :is(.budget-model-track,.ladder-track,.planning-bar-track,.progress,.retention-track) :is(i,span){
  display:block;
  height:100%;
  border-radius:999px 0 0 999px;
}
.lv-calc :is(.budget-model-track,.ladder-track,.planning-bar-track,.progress,.retention-track) :is(i,span)[style*="width: 100%"],
.lv-calc :is(.budget-model-track,.ladder-track,.planning-bar-track,.progress,.retention-track) :is(i,span)[style*="width:100%"]{
  border-radius:999px;
}

.lv-calc .progress{height:16px;margin:18px 0 8px}
.lv-calc .progress span{background:var(--c-main)}
.lv-calc .progress-markers{display:flex;justify-content:space-between;gap:10px;font-size:14px;font-weight:700}
.lv-calc .stage-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:18px}
.lv-calc .stage-step{padding:12px 14px;background:var(--cream);border-radius:12px;min-width:0}
.lv-calc .stage-step span{display:block;font-size:14px;color:var(--muted)}
.lv-calc .stage-step b{display:block;font-size:18px;font-weight:900;overflow-wrap:anywhere}

/* ── 圖：漏斗留存 ── */
.lv-calc .flow-origin{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 16px;background:var(--cream);border-radius:12px}
.lv-calc .flow-origin strong{font-size:22px;font-weight:900;font-variant-numeric:tabular-nums;white-space:nowrap}
.lv-calc .retention-chart{display:flex;flex-direction:column;margin-top:6px}
.lv-calc .retention-row{position:relative;display:flex;align-items:center;gap:12px;width:100%;padding:12px 0;border:0;border-bottom:1px solid var(--line);background:transparent;text-align:left}
.lv-calc .retention-row:last-child{border-bottom:0}
.lv-calc button.retention-row:hover{background:var(--cream)}
.lv-calc .retention-node{align-self:stretch;display:flex;align-items:center;justify-content:center;position:relative;flex:none;width:34px}
.lv-calc .retention-node:before{content:"";position:absolute;left:16px;top:-12px;bottom:-12px;width:2px;background:var(--line)}
.lv-calc .retention-row:last-child .retention-node:before{bottom:50%}
.lv-calc .retention-node span{position:relative;z-index:1;display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:var(--yellow);border:2px solid var(--ink);font-size:14px;font-weight:900}
.lv-calc .retention-row.destination .retention-node span{background:var(--orange)}
.lv-calc .retention-main{flex:1;min-width:0}
.lv-calc .retention-label{display:flex;align-items:baseline;justify-content:space-between;gap:10px}
.lv-calc .retention-label b{font-weight:700}
.lv-calc .retention-label strong{font-size:22px;font-weight:900;font-variant-numeric:tabular-nums;white-space:nowrap}
.lv-calc .retention-label small{margin-left:4px;font-size:14px;font-weight:400;color:var(--muted)}
.lv-calc .retention-track{height:14px;margin:6px 0}
.lv-calc .retention-track i{background:var(--c-main)}
.lv-calc .retention-meta{display:flex;flex-wrap:wrap;justify-content:space-between;gap:4px 12px;font-size:14px;color:var(--muted)}

/* ── 圖：預算對照、成本階梯、分布、橫條 ── */
.lv-calc .budget-target{display:flex;flex-direction:column;align-items:center;gap:2px;padding:14px;background:var(--cream);border-radius:12px;text-align:center}
.lv-calc .budget-target span,.lv-calc .budget-target small{font-size:14px;color:var(--muted)}
.lv-calc .budget-target strong{font-size:clamp(24px,3vw,28px);font-weight:900;white-space:nowrap}
.lv-calc .budget-model{margin-top:20px}
.lv-calc .budget-model>div:first-child{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.lv-calc .budget-model strong{margin-left:auto;font-size:22px;font-weight:900;white-space:nowrap}
.lv-calc .model-number{display:grid;place-items:center;min-width:30px;height:30px;border:2px solid var(--ink);border-radius:50%;font-size:14px;font-weight:900;background:var(--yellow)}
.lv-calc .budget-model p{margin-top:6px;font-size:14px;color:var(--muted)}
.lv-calc .budget-gap{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px;margin-top:20px;padding-top:14px;border-top:2px dashed var(--line)}
.lv-calc .budget-gap strong{font-size:22px;font-weight:900;color:var(--orange-text);white-space:nowrap}
.lv-calc .cost-ladder{display:flex;flex-direction:column;gap:20px}
.lv-calc .ladder-row>div:first-child{display:flex;justify-content:space-between;gap:10px}
.lv-calc .ladder-row strong{font-size:22px;font-weight:900;white-space:nowrap}
.lv-calc .ladder-row small{font-size:14px;color:var(--muted)}
.lv-calc .allocation-chart{display:flex;flex-direction:column;gap:16px}
.lv-calc .allocation-row{display:block;width:100%;padding:0;border:0;background:transparent;text-align:left}
.lv-calc .allocation-row>div:first-child{display:flex;justify-content:space-between;gap:12px;margin-bottom:6px}
.lv-calc .allocation-row b{font-weight:700;overflow-wrap:anywhere}
.lv-calc .allocation-row span{white-space:nowrap}
.lv-calc .allocation-track{display:flex;height:22px;background:var(--cream-2);border:2px solid var(--ink);border-radius:10px;overflow:hidden;background-clip:padding-box}
.lv-calc .allocation-track span{display:block;height:100%}
.lv-calc .planning-bars{display:flex;flex-direction:column;gap:16px;margin:8px 0 18px}
.lv-calc .planning-bar-label{display:flex;justify-content:space-between;gap:10px}
.lv-calc .planning-bar-label strong{font-size:18px;font-weight:900;white-space:nowrap}

/* ── 圖：矩陣、情境表 ── */
.lv-calc .axis-switch{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:16px}
.lv-calc .axis-switch button{min-height:var(--tap);padding:4px 16px;border:2px solid var(--ink);border-radius:999px;background:var(--white);font-size:14px;font-weight:700;transition:background .15s}
.lv-calc .axis-switch button.active{background:var(--ink);color:var(--yellow)}
.lv-calc .matrix-y-label,.lv-calc .matrix-x-label{font-size:14px;color:var(--muted)}
.lv-calc .matrix-x-label{text-align:right}
.lv-calc .matrix-frame{padding:6px 14px 30px 48px}
.lv-calc .matrix-plot{position:relative;height:230px;border-left:2px solid var(--ink);border-bottom:2px solid var(--ink);background-image:linear-gradient(var(--line) 1px,transparent 1px),linear-gradient(90deg,var(--line) 1px,transparent 1px);background-size:25% 25%}
.lv-calc .matrix-y-tick{position:absolute;left:-8px;transform:translateX(-100%);font-size:14px;color:var(--muted);white-space:nowrap}
.lv-calc .matrix-y-tick.top{top:-10px}
.lv-calc .matrix-y-tick.middle{top:calc(50% - 10px)}
.lv-calc .matrix-y-tick.bottom{bottom:-10px}
.lv-calc .matrix-x-tick{position:absolute;bottom:-28px;font-size:14px;color:var(--muted)}
.lv-calc .matrix-x-tick.left{left:0}
.lv-calc .matrix-x-tick.middle{left:50%;transform:translateX(-50%)}
.lv-calc .matrix-x-tick.right{right:0}
.lv-calc .matrix-point{position:absolute;z-index:1;display:grid;place-items:center;width:34px;height:34px;transform:translate(-50%,50%);border:2px solid var(--ink);border-radius:50%;background:var(--c-main);color:var(--ink);font-size:14px;font-weight:900}
.lv-calc .matrix-point.goal-traffic{background:var(--c-alt);color:var(--white)}
.lv-calc .matrix-point.goal-orders{background:var(--c-cost)}
.lv-calc .matrix-point.selected{box-shadow:0 0 0 3px var(--white),0 0 0 6px var(--ink);z-index:3}
.lv-calc .matrix-point::after{content:"";position:absolute;inset:-6px;border-radius:50%}
.lv-calc .matrix-key{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.lv-calc .matrix-key button{min-height:var(--tap);padding:4px 14px;border:2px solid var(--line);border-radius:999px;background:var(--white);font-size:14px;overflow-wrap:anywhere}
.lv-calc .matrix-key button b{padding-right:6px;font-weight:900}
.lv-calc .matrix-key button.active{border-color:var(--ink);background:var(--yellow-soft)}
.lv-calc .scenario-compare{display:grid;grid-template-columns:1fr 24px 1fr;gap:8px;align-items:center}
.lv-calc .scenario-compare>div{padding:12px 14px;background:var(--cream);border-radius:12px}
.lv-calc .scenario-compare span{display:block;font-size:14px;color:var(--muted)}
.lv-calc .scenario-compare b{font-size:22px;font-weight:900;white-space:nowrap}
.lv-calc .scenario-compare .scenario-separator{padding:0;background:none;text-align:center;font-size:18px}
.lv-calc :is(.sensitivity-table,.profit-matrix){width:100%;min-width:430px;border-spacing:4px;font-variant-numeric:tabular-nums}
.lv-calc :is(.sensitivity-table,.profit-matrix) caption{text-align:left;font-size:14px;color:var(--muted);padding:6px 4px}
.lv-calc :is(.sensitivity-table,.profit-matrix) th{font-size:14px;font-weight:700;padding:6px 2px;line-height:1.5;text-align:center}
.lv-calc :is(.sensitivity-table,.profit-matrix) td{padding:0}
.lv-calc :is(.sensitivity-table,.profit-matrix) button{width:100%;min-height:52px;padding:6px 2px;border:2px solid transparent;border-radius:10px;background:var(--cream-2);font-weight:700}
.lv-calc .sensitivity-table b{display:block;font-weight:900}
.lv-calc .sensitivity-table small{display:block;font-size:14px;font-weight:400}
.lv-calc :is(.sensitivity-table .better,.profit-matrix .positive){background:#FFE0A8}
.lv-calc :is(.sensitivity-table .worse,.profit-matrix .negative){background:var(--pink-soft)}
.lv-calc :is(.sensitivity-table,.profit-matrix) .selected{border-color:var(--ink);border-width:3px}
.lv-calc :is(.sensitivity-table,.profit-matrix) button:hover{border-color:var(--ink)}
.lv-calc .profit-matrix tr>th:first-child{position:sticky;left:0;z-index:1;background:var(--white);min-width:76px}

/* ── 圖：素材測試、觸及、損益瀑布 ── */
.lv-calc .test-sensitivity{display:grid;grid-template-columns:1fr;border:2px solid var(--ink);border-radius:12px;overflow:hidden}
.lv-calc .test-sensitivity button{display:grid;grid-template-columns:minmax(8em,auto) 1fr;grid-template-areas:"lift budget" "lift meta";align-items:center;column-gap:14px;min-height:60px;padding:10px 16px;border:0;border-top:2px solid var(--line);background:var(--white);text-align:left}
.lv-calc .test-sensitivity button:first-child{border-top:0}
.lv-calc .test-sensitivity button span{grid-area:lift;font-weight:700}
.lv-calc .test-sensitivity button b{grid-area:budget;font-size:18px;font-weight:900;white-space:nowrap}
.lv-calc .test-sensitivity button small{grid-area:meta;font-size:14px;color:var(--muted)}
.lv-calc .test-sensitivity button.active{background:var(--yellow-soft)}
.lv-calc .test-sensitivity button.active small{color:var(--ink);opacity:.85}
.lv-calc .sample-row{margin:14px 0}
.lv-calc .sample-row>div:first-child{display:flex;justify-content:space-between;gap:8px}
.lv-calc .sample-row small{font-size:14px;color:var(--muted)}
.lv-calc .sample-row .progress{margin:8px 0}
.lv-calc .test-timeline{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:20px;padding-top:16px;border-top:2px dashed var(--line)}
.lv-calc .test-timeline>div{display:flex;flex-direction:column;gap:4px;min-width:0}
.lv-calc .test-timeline b{font-weight:900;color:var(--orange-text)}
.lv-calc .test-timeline span{font-size:14px;color:var(--muted);line-height:1.6}
.lv-calc .reach-overview{display:grid;grid-template-columns:minmax(0,1fr) minmax(110px,.6fr);align-items:center;gap:24px;margin:18px 0}
.lv-calc .reach-grid{display:grid;grid-template-columns:repeat(10,1fr);gap:4px}
.lv-calc .reach-grid i{aspect-ratio:1;border-radius:3px;background:var(--cream-2)}
.lv-calc .reach-grid i.reached{background:var(--c-main)}
.lv-calc .reach-overview>div:last-child{display:flex;flex-direction:column;gap:2px}
.lv-calc .reach-overview strong{font-size:clamp(28px,4vw,36px);font-weight:900;line-height:1.2;white-space:nowrap}
.lv-calc .reach-overview b{margin-top:8px;font-size:22px;font-weight:900;white-space:nowrap}
.lv-calc .reach-overview span{font-size:14px;color:var(--muted)}
.lv-calc .visual-body .planning-waterfall{display:block;margin-top:24px}

/* ── SVG 圖表 ── */
.lv-calc :is(.decision-svg,.planning-svg){display:block;width:100%;height:auto;overflow:visible}
.lv-calc .decision-svg{min-width:420px}
.lv-calc :is(.decision-svg,.planning-svg) text{font-family:inherit}
.lv-calc .decision-svg rect{stroke:var(--ink);stroke-width:2}
.lv-calc .chart-grid-line{stroke:var(--line);stroke-width:1}
.lv-calc .zero-line{stroke:var(--ink);stroke-width:1.5}
.lv-calc .axis-text,.lv-calc .axis-title{fill:var(--muted);font-size:14px}
.lv-calc .value-text{fill:var(--ink);font-size:14px;font-weight:700}
.lv-calc .accent-text{fill:var(--orange-text);font-size:14px;font-weight:700}
.lv-calc .waterfall-connector{stroke:var(--muted);stroke-dasharray:3 3;stroke-width:1}
.lv-calc .mobile-chart{display:none}
.lv-calc .mobile-waterfall{padding-top:4px}
.lv-calc .mobile-waterfall-row{margin-bottom:16px}
.lv-calc .mobile-waterfall-row>div:first-child{display:flex;justify-content:space-between;gap:10px;margin-bottom:6px}
.lv-calc .mobile-waterfall-row b{font-weight:900;font-variant-numeric:tabular-nums;white-space:nowrap}
.lv-calc .mobile-waterfall-track{position:relative;height:26px;background:var(--cream-2);border:2px solid var(--ink);border-radius:8px;overflow:hidden;background-clip:padding-box}
.lv-calc .mobile-waterfall-track>span{position:absolute;top:0;bottom:0;border-radius:4px;border-left:2px solid var(--ink);border-right:2px solid var(--ink)}
.lv-calc .waterfall-zero{position:absolute;top:0;bottom:0;border-left:2px solid var(--ink);z-index:1}

/* ── 底部固定的即時結論列 ── */
.lv-calc .sticky-result{position:sticky;bottom:14px;z-index:6;width:max-content;max-width:100%;margin:28px auto 0;display:flex;align-items:center;gap:14px;padding:8px 8px 8px 22px;background:var(--ink);color:var(--cream);border-radius:999px;box-shadow:0 8px 0 rgb(31 26 23 / .14)}
.lv-calc .sticky-result .s-label{font-size:14px}
.lv-calc .sticky-result .s-value{font-size:22px;font-weight:900;color:var(--yellow);font-variant-numeric:tabular-nums;white-space:nowrap}
.lv-calc .sticky-result button{min-height:var(--tap);padding:4px 18px;border:0;border-radius:999px;background:var(--yellow);color:var(--ink);font-size:14px;font-weight:700;white-space:nowrap}

@media(max-width:820px){
  /* 站上手機版有固定在底部的「預約」列（.dock，約 74px），結論列疊在它上方，留出足夠空間 */
  .lv-calc .sticky-result{bottom:calc(82px + env(safe-area-inset-bottom))}
}
@media(max-width:980px){
  .lv-calc .workspace{grid-template-columns:minmax(0,1fr)}
  .lv-calc .gtabs{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:600px){
  .lv-calc .calc{padding:24px 16px 36px}
  .lv-calc .gtab{padding:12px 14px;min-height:76px}
  .lv-calc .gtab b{font-size:16px}
  .lv-calc .mod{padding:4px 16px}
  .lv-calc .verdict{padding:20px;box-shadow:6px 6px 0 var(--ink)}
  .lv-calc .v-value{font-size:clamp(30px,7vw,44px);white-space:nowrap}
  .lv-calc .v-line{font-size:16px}
  .lv-calc :is(.panel,.result){padding:20px 16px}
  .lv-calc .field-grid{grid-template-columns:minmax(0,1fr)}
  .lv-calc .field.wide{grid-column:auto}
  .lv-calc .desktop-chart{display:none}
  .lv-calc .mobile-chart{display:block}
  .lv-calc .mobile-chart .decision-svg{min-width:0}
  .lv-calc .spotlight-grid,.lv-calc .stage-steps,.lv-calc .test-timeline{grid-template-columns:minmax(0,1fr)}
  .lv-calc .test-sensitivity button{grid-template-columns:1fr;grid-template-areas:"lift" "budget" "meta"}
  .lv-calc .matrix-frame{padding-left:40px}

  /* 手機版指標格字級與版面 */
  .lv-calc .metric-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .lv-calc .metric{padding:12px}
  .lv-calc .metric-label{font-size:14px}
  .lv-calc .metric-value{font-size:clamp(16px,4.5vw,20px);white-space:nowrap}
  .lv-calc .metric small{font-size:14px}

  .lv-calc .sticky-result{width:100%;justify-content:space-between;padding:6px 8px 6px 16px}
  .lv-calc .sticky-result .s-label{display:none}
  .lv-calc .sticky-result .s-value{font-size:18px}
}

@media(prefers-reduced-motion:reduce){
  .lv-calc :is(.gtab,.mod,.ghost-button,.visual-tabs button,.segment button){transition:none!important}
}

/* ===== 列印樣式 ===== */
@media print{
  .lv-calc .sticky-result,.lv-calc .decide,.lv-calc .visual-tabs,.lv-calc .segment,.lv-calc .action-row{display:none!important}
  .lv-calc .calc{padding:0}
  .lv-calc :is(.verdict,.panel,.result){box-shadow:none!important;border-color:#000!important}
  .lv-calc .workspace{grid-template-columns:1fr 1fr}
  .lv-calc .v-value,.lv-calc .v-line{color:#000!important}
}

/* 結論句末行不留一兩個字（Opus 視覺審查 2026-10-15） */
.lv-calc .v-line{text-wrap:pretty}

/* 二次視覺檢視 D（2026-10-15）：結論卡一律白底、狀態看標籤；數字螢光筆底；試算紙式指標列 */
.lv-calc .calc-title:focus,.lv-calc .calc-title:focus-visible{outline:none}
.lv-calc .verdict,.lv-calc .verdict.is-bad,.lv-calc .verdict.is-neutral,.lv-calc .verdict.is-good{background:var(--white)}
.lv-calc .verdict.is-good{box-shadow:8px 8px 0 var(--orange)}
.lv-calc .verdict.is-bad{box-shadow:8px 8px 0 var(--pink)}
.lv-calc .verdict.is-neutral{box-shadow:8px 8px 0 var(--yellow)}
.lv-calc .v-value span{background:linear-gradient(transparent 58%,var(--yellow) 58%,var(--yellow) 92%,transparent 92%);padding:0 .08em}
.lv-calc .verdict.is-bad .v-value span{background:linear-gradient(transparent 58%,var(--pink-soft) 58%,var(--pink-soft) 92%,transparent 92%)}
.lv-calc .v-chip,.lv-calc .verdict .v-chip{justify-self:start;background:var(--cream-2);color:var(--ink);border:2px solid var(--ink)}
.lv-calc .verdict.is-good .v-chip{background:var(--orange);color:var(--ink)}
.lv-calc .verdict.is-bad .v-chip{background:var(--c-bad);color:var(--white);border-color:var(--c-bad)}
.lv-calc .stack>*{margin:0}
.lv-calc .panel-head h2,.lv-calc .visual-heading h3{text-wrap:balance}
.lv-calc .metric-grid{gap:0 24px}
.lv-calc .metric{display:flex;justify-content:space-between;align-items:baseline;flex-wrap:wrap;gap:2px 12px;background:transparent;border-radius:0;padding:12px 0;border-bottom:2px dotted var(--line)}
.lv-calc .metric-label{color:var(--ink);font-weight:700}
.lv-calc .metric-value{font-size:20px;margin:0}
.lv-calc .metric small{flex-basis:100%}
.lv-calc .mobile-chart .axis-text,.lv-calc .mobile-chart .axis-title,.lv-calc .mobile-chart .value-text{font-size:17px}
@media(max-width:600px){
  .lv-calc .profit-matrix{min-width:0}
  .lv-calc .profit-matrix th,.lv-calc .profit-matrix button{font-size:14px}
  .lv-calc .profit-matrix button{min-height:46px;padding:4px 0}
  .lv-calc .profit-matrix tr>th:first-child{min-width:54px}
  .lv-calc .metric-grid{grid-template-columns:minmax(0,1fr)}
}
@media(max-width:980px){
  /* 手機與平板：先看結論與圖，再往下調參數（底部固定列會即時顯示新數字） */
  .lv-calc .workspace{display:flex;flex-direction:column}
  .lv-calc .result{order:-1}
}
