/* رایزن — میز تصمیم، آزمایشگاه سناریو، برنامه اقدام */

/* ---------- میز تصمیم ---------- */
.decide-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 20px; align-items: start; }
.dl { position: sticky; top: calc(var(--top-h) + 16px); display: grid; gap: 4px; }
.dl-head { font-size: 12.5px; color: var(--muted); padding: 0 10px 6px; }
.dl-item { display: grid; gap: 4px; text-align: start; border: 1px solid transparent; background: transparent; padding: 10px 12px; border-radius: var(--r-md); position: relative; }
.dl-item:hover { background: var(--surface); border-color: var(--line); }
.dl-item.on { background: var(--surface); border-color: var(--line-strong); box-shadow: var(--shadow); }
.dl-item.on::before { content: ''; position: absolute; inset-inline-start: -1px; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--turq); }
.dl-title { font-weight: 600; font-size: 13.5px; line-height: 1.6; }
.dl-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.dl-meta .chip { height: 20px; font-size: 11px; padding: 0 7px; }
.dl-src { color: var(--faint); }

.dw { display: grid; gap: 16px; min-width: 0; }
.dw-frame { border-top: 3px solid var(--ink); }
.dw-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12.5px; }
.dw-title { font-size: 22px; margin: 6px 0 2px; }
.dw-q { font-size: 16px; color: var(--ink-2); line-height: 1.95; max-width: 72ch; }
.dw-evidence { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 12px; }
.dw-ask { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

.opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.opt { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.opt.best { border-color: var(--turq); box-shadow: 0 0 0 1px var(--turq) inset; }
.opt.chosen { background: color-mix(in srgb, var(--turq-tint) 45%, var(--surface)); }
.opt-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.opt-key { width: 30px; height: 30px; border-radius: 99px; display: grid; place-items: center; background: var(--surface-3); font-weight: 700; font-size: 13px; }
.opt.best .opt-key { background: var(--turq); color: #fff; }
.opt-head h4 { font-size: 14.5px; line-height: 1.6; }
.opt-rank small { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.opt-sum { font-size: 12.5px; color: var(--ink-2); line-height: 1.85; min-height: 3.6em; }
.opt-effect { background: var(--surface-2); border-radius: var(--r-md); padding: 10px 12px; }
.oe-label { display: flex; justify-content: space-between; gap: 6px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.oe-p50 { font-size: 19px; font-weight: 700; margin: 2px 0 6px; white-space: nowrap; }
.rbar { position: relative; height: 14px; margin: 2px 0 4px; }
.rbar::before { content: ''; position: absolute; left: 0; right: 0; top: 6px; height: 2px; background: var(--line); border-radius: 2px; }
.rb-zero { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--ink-2); opacity: 0.55; }
.rb-range { position: absolute; top: 3px; height: 8px; border-radius: 8px; background: var(--turq); opacity: 0.35; }
.rb-mid { position: absolute; top: 0; width: 3px; height: 14px; margin-left: -1.5px; border-radius: 2px; background: var(--turq-strong); }
.oe-p50.neg ~ .rbar .rb-range { background: var(--pom); }
.oe-p50.neg ~ .rbar .rb-mid { background: var(--pom); }
.oe-range { display: flex; justify-content: space-between; gap: 6px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.oe-prob { font-size: 12px; margin-top: 4px; color: var(--ink-2); }
.opt-crit { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 0; font-size: 12.5px; align-items: center; }
.opt-crit dt { color: var(--muted); }
.opt-crit dd { margin: 0; justify-self: end; }
.dots { display: inline-flex; gap: 3px; direction: ltr; }
.dots i { width: 8px; height: 8px; border-radius: 99px; background: var(--line); display: inline-block; }
.dots i.f { background: var(--leaf); }
.dots.inv i.f { background: var(--amber); }
.opt-dept { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; color: var(--muted); line-height: 1.7; }
.opt-dept svg { width: 14px; height: 14px; flex: none; margin-top: 4px; }
.opt-score { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); margin-top: auto; }
.opt-score b { color: var(--ink); font-size: 15px; }
.opt .btn { align-self: flex-start; }
.small-note { font-size: 12px; margin-top: -6px; }

.dw-bottom { grid-template-columns: minmax(0, 1.55fr) minmax(290px, 1fr); align-items: start; }
.dw-side { display: grid; gap: 16px; }
.rec { border-inline-start: 3px solid var(--brass); }
.rec-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.rec-mark { width: 38px; height: 38px; border-radius: 12px; background: var(--brass-tint); color: var(--brass-strong); display: grid; place-items: center; flex: none; }
.rec-mark svg { width: 20px; height: 20px; }
.rec-head h3 { font-size: 17px; line-height: 1.6; }
.rec-head p { font-size: 12.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rec-reasons { margin: 0 0 14px; padding-inline-start: 20px; display: grid; gap: 6px; font-size: 13.5px; line-height: 1.95; color: var(--ink-2); }
.rec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rec-block { background: var(--surface-2); border-radius: var(--r-md); padding: 10px 12px; font-size: 12.5px; line-height: 1.85; color: var(--ink-2); }
.rec-block h4 { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); margin-bottom: 4px; }
.rec-block h4 svg { width: 15px; height: 15px; }
.rec-block ul { margin: 0; padding-inline-start: 16px; }
.rec-block.devil { background: var(--pom-tint); }
.rec-block.devil h4 { color: var(--pom); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.weights { display: grid; gap: 6px; }
.reg-form { display: grid; gap: 12px; }
.reg-form .seg { width: fit-content; }
.reg-actions { display: grid; gap: 6px; }
.reg-actions .btn { width: 100%; }
.reg-actions [data-reg-msg] { font-size: 12px; color: var(--pom); }

/* ---------- آزمایشگاه ---------- */
.lab-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -8px 0 16px; font-size: 12.5px; }
.lab-presets .chip { cursor: pointer; height: 28px; }
.lab-presets .chip:hover { border-color: var(--turq); color: var(--turq-strong); }
.lab-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 18px; align-items: start; }
.lab-levers { position: sticky; top: calc(var(--top-h) + 14px); max-height: calc(100vh - var(--top-h) - 28px); overflow-y: auto; scrollbar-width: thin; }
.lab-target { background: var(--brass-tint); border-radius: var(--r-md); padding: 8px 10px; margin-bottom: 6px; }
.lev-group { border: 0; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.lev-group legend { font-size: 12px; color: var(--muted); font-weight: 600; padding: 0 0 4px; border-bottom: 1px solid var(--line); width: 100%; margin-bottom: 4px; }
.lev { display: grid; gap: 0; }
.lev-help { font-size: 11.5px; color: var(--faint); line-height: 1.7; margin-top: -2px; }
.lev-toggle { margin-top: 2px; }
.lab-results { min-width: 0; }
.lab-verdict { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 10px 24px; background: var(--deep); color: var(--on-deep); border-radius: var(--r-lg); padding: 18px 22px; margin-bottom: 14px; }
:root[data-theme='dark'] .lab-verdict { background: var(--surface-3); color: var(--ink); }
.lab-verdict .muted { color: color-mix(in srgb, currentColor 65%, transparent); font-size: 12.5px; }
.lv-num { font-size: 30px; font-weight: 800; line-height: 1.5; white-space: nowrap; }
.lab-verdict .lv-num.pos { color: var(--on-deep-pos); }
.lab-verdict .lv-num.neg { color: var(--on-deep-neg); }
:root[data-theme='dark'] .lab-verdict .lv-num.pos { color: var(--leaf); }
:root[data-theme='dark'] .lab-verdict .lv-num.neg { color: var(--pom); }
.lv-side { display: grid; gap: 4px; align-content: center; }
.lv-side > div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; border-bottom: 1px solid color-mix(in srgb, currentColor 14%, transparent); padding: 4px 0; }
.lv-side > div:last-child { border: 0; }
.lv-side b { font-size: 15px; }
.lv-prov { grid-column: 1 / -1; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.lab-verdict .prov { color: color-mix(in srgb, currentColor 75%, transparent); }
.lab-verdict .prov.sim i { box-shadow: inset 0 0 0 1.5px var(--on-deep-pos); }
.lab-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lab-kpis .kpi:nth-child(n + 4) { border-top: 1px solid var(--line); }
.lab-kpis .kpi:nth-child(4) { border-inline-start: 0; }
.lab-kpis .kpi .k-value { font-size: 21px; }
.lab-charts { margin-top: 16px; }
.lab-table td, .lab-table th { font-size: 12.5px; }

/* ---------- برنامه اقدام ---------- */
.act-kpis { margin-bottom: 4px; }
.acts { display: grid; gap: 14px; }
.act { padding: 0; overflow: hidden; }
.act.focus { box-shadow: 0 0 0 2px var(--turq); }
.act-head { display: flex; justify-content: space-between; gap: 16px; padding: 16px 20px 12px; }
.act-title { min-width: 0; }
.act-chips { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.act-title h3 { font-size: 16.5px; line-height: 1.6; }
.act-title p { font-size: 13px; }
.act-deadline { display: grid; justify-items: center; align-content: start; min-width: 92px; padding: 8px 10px; border-radius: var(--r-md); background: var(--surface-2); text-align: center; line-height: 1.35; flex: none; }
.act-deadline b { font-size: 24px; font-weight: 800; }
.act-deadline span { font-size: 11.5px; color: var(--muted); }
.act-deadline small { font-size: 11px; color: var(--faint); margin-top: 2px; }
.act-deadline.soon { background: var(--pom-tint); }
.act-deadline.soon b { color: var(--pom); }
.act-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; padding: 0 20px 14px; }
.act-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 14px; margin: 0; font-size: 13px; align-content: start; }
.act-facts dt { color: var(--muted); white-space: nowrap; }
.act-facts dd { margin: 0; line-height: 1.8; }
.act-facts.compact { padding: 0 20px 12px; }
.act-kill { color: var(--ink-2); font-size: 12.5px; }
.act-track { min-width: 0; background: var(--surface-2); border-radius: var(--r-md); padding: 10px 12px; }
.act-track h4 { font-size: 13px; }
.act-learn { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; margin-top: 6px; line-height: 1.8; }
.act-learn svg { width: 15px; height: 15px; flex: none; margin-top: 4px; color: var(--muted); }
.act-foot { border-top: 1px solid var(--line); padding: 12px 20px 14px; display: grid; gap: 10px; background: color-mix(in srgb, var(--surface-2) 50%, var(--surface)); }
.act-status { grid-auto-flow: column; justify-content: start; align-items: center; gap: 10px; }
.act-checkin { display: grid; grid-template-columns: minmax(0, 1fr) 150px auto; gap: 8px; }
.act-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 12.5px; }
.act-log li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 10px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.act-log time { color: var(--muted); }
.act-more { display: flex; gap: 6px; flex-wrap: wrap; }
.act.seed { border-style: dashed; }
.act.seed .act-more { padding: 0 20px 16px; }
.act-empty p { max-width: 60ch; margin: 0 auto; }

/* ---------- واکنش‌گرا ---------- */
@media (max-width: 1280px) {
  .opts { grid-template-columns: minmax(0, 1fr); }
  .opt { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); column-gap: 18px; }
  .opt > .opt-head, .opt > .opt-sum { grid-column: 1; }
  .opt > .opt-effect { grid-column: 2; grid-row: 1 / span 3; align-self: start; }
  .opt-sum { min-height: 0; }
}
@media (max-width: 1100px) {
  .decide-layout { grid-template-columns: minmax(0, 1fr); }
  .dl { position: static; display: flex; overflow-x: auto; gap: 8px; padding-bottom: 4px; }
  .dl-head { display: none; }
  .dl-item { min-width: 210px; background: var(--surface); border-color: var(--line); }
  .dw-bottom { grid-template-columns: minmax(0, 1fr); }
  .lab-layout { grid-template-columns: minmax(0, 1fr); }
  .lab-levers { position: static; max-height: none; }
}
@media (max-width: 720px) {
  .opt { display: flex; }
  .rec-grid { grid-template-columns: minmax(0, 1fr); }
  .lab-verdict { grid-template-columns: minmax(0, 1fr); padding: 14px 16px; }
  .lab-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lab-kpis .kpi { border-inline-start: 0; border-top: 1px solid var(--line); }
  .lv-num { font-size: 24px; white-space: normal; }
  .act-head { flex-direction: column-reverse; }
  .act-deadline { grid-auto-flow: column; justify-content: start; gap: 8px; align-items: baseline; min-width: 0; width: fit-content; }
  .act-body { grid-template-columns: minmax(0, 1fr); padding: 0 14px 12px; }
  .act-head, .act-foot { padding-inline: 14px; }
  .act-checkin { grid-template-columns: minmax(0, 1fr); }
  .act-status { grid-auto-flow: row; }
  .act-status .seg { overflow-x: auto; max-width: 100%; }
  .dw-title { font-size: 19px; }
  .dw-q { font-size: 14.5px; }
  .oe-p50 { white-space: normal; }
}
