/* رایزن — مالی و تورم، درآمد و کانال‌ها، سازمان متصل، تنظیمات */

/* نوار پیشرفت درون span */
.fp-row .bar-track, .fp-row .bar-fill, .bar-row span.bar-track, .bar-row span.bar-fill { display: block; }

/* ---------- درخت علت (مالی) ---------- */
.fin-diagnosis { padding-bottom: 16px; }
.dtree { display: grid; grid-template-columns: minmax(170px, 220px) minmax(0, 1fr); gap: 0 28px; align-items: center; }
.dt-node { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 14px; position: relative; border-inline-start: 3px solid var(--line-strong); }
.dt-node.tone-pom { border-inline-start-color: var(--pom); }
.dt-node.tone-leaf { border-inline-start-color: var(--leaf); }
.dt-node.dim { opacity: 0.8; background: transparent; }
.dt-title { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.dt-value { font-size: 19px; font-weight: 800; line-height: 1.5; white-space: nowrap; }
.dt-foot { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 11.5px; color: var(--muted); }
.dt-prov { margin-top: 4px; }
.dtree > .dt-node { background: var(--surface); box-shadow: var(--shadow); }
.dtree > .dt-node .dt-value { font-size: 23px; }
.dt-branches { display: grid; gap: 12px; position: relative; padding-inline-start: 22px; }
.dt-branches::before { content: ''; position: absolute; inset-inline-start: 0; top: 34px; bottom: 34px; border-inline-start: 1.5px solid var(--line-strong); }
.dt-branch { display: grid; grid-template-columns: minmax(170px, 230px) minmax(0, 1fr); gap: 14px; align-items: center; position: relative; }
.dt-branch::before { content: ''; position: absolute; inset-inline-start: -22px; top: 50%; width: 22px; border-top: 1.5px solid var(--line-strong); }
.dt-leaves { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.dt-leaf { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 12.5px; padding: 6px 10px; border-radius: 8px; background: var(--surface-3); }
.dt-leaf b { font-weight: 700; font-size: 13px; }
.dt-leaf small { color: var(--muted); font-size: 11.5px; }
.dt-l-title { color: var(--ink-2); font-weight: 600; }
.dt-rooms { gap: 4px 14px; }
.dt-mini { display: inline-flex; gap: 5px; align-items: baseline; }
.dt-mini em { font-style: normal; color: var(--muted); font-size: 11.5px; }
.dt-note { background: transparent; padding-inline: 2px; flex-basis: 100%; }
.dt-verdict-no { background: var(--leaf-tint); color: var(--leaf); align-items: center; }
.dt-verdict-no svg { width: 14px; height: 14px; }
.fin-verdict { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 14px; align-items: center; margin-top: 16px; padding: 12px 14px; border-radius: var(--r-md); background: var(--deep); color: var(--on-deep); }
:root[data-theme='dark'] .fin-verdict { background: var(--surface-3); color: var(--ink); }
.fin-verdict .fv-mark svg { width: 28px; height: 28px; color: #e7a77c; }
.fin-verdict b { font-size: 13.5px; }
.fin-verdict p { font-size: 13px; line-height: 1.9; opacity: 0.92; max-width: 90ch; }
.fv-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.fin-verdict .btn { background: transparent; color: inherit; border-color: rgba(255, 255, 255, 0.3); }
:root[data-theme='dark'] .fin-verdict .btn { border-color: var(--line-strong); }

.fin-eq { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
.eq-box { display: grid; gap: 1px; padding: 8px 12px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); min-width: 120px; }
.eq-box small { color: var(--muted); font-size: 11.5px; }
.eq-box b { font-size: 13px; font-weight: 600; white-space: nowrap; }
.eq-box em { font-style: normal; font-weight: 800; font-size: 16px; }
.eq-result { border-style: solid; border-color: var(--turq); background: var(--turq-tint); }
.eq-op { align-self: center; font-size: 20px; color: var(--muted); font-weight: 700; }
.fin-recon-text { font-size: 13.5px; color: var(--ink-2); line-height: 1.95; max-width: 95ch; }

.fin-infl-strip { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; flex-wrap: wrap; }
.fin-infl-strip > div { padding: 10px 16px; display: grid; gap: 0; border-inline-start: 1px solid var(--line); flex: 1 1 110px; }
.fin-infl-strip > div:first-child { border-inline-start: 0; }
.fin-infl-strip span { font-size: 12px; color: var(--muted); }
.fin-infl-strip b { font-size: 20px; font-weight: 800; color: var(--pom); }
.fin-infl-strip small { font-size: 11.5px; color: var(--muted); }
.fin-infl-strip .fis-note { background: var(--surface-2); flex: 1.4 1 160px; align-content: center; }
.fin-infl-strip .fis-note span { color: var(--ink); font-weight: 700; font-size: 13px; }
.fin-insight { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; font-size: 13px; line-height: 1.9; color: var(--ink-2); margin-top: 12px; }
.fin-insight svg { width: 18px; height: 18px; color: var(--pom); margin-top: 4px; }

.fin-pressure { display: grid; gap: 2px; font-size: 12.5px; }
.fp-head, .fp-row { display: grid; grid-template-columns: minmax(0, 1.5fr) 46px 64px minmax(60px, 1fr); gap: 10px; align-items: center; }
.fp-head { color: var(--muted); font-size: 11.5px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.fp-row { padding: 5px 0; border-bottom: 1px solid var(--line); }
.fp-row:last-child { border-bottom: 0; }
.fp-label { display: grid; line-height: 1.45; }
.fp-label small { color: var(--faint); font-size: 11px; }

.fin-pnl { max-height: 640px; }
.fin-pnl table { font-size: 12.5px; }
.fin-pnl th[scope='row'] { font-weight: 500; color: var(--ink-2); white-space: nowrap; position: sticky; inset-inline-start: 0; background: var(--surface); z-index: 1; }
.fin-pnl thead th:first-child { position: sticky; inset-inline-start: 0; z-index: 2; font-weight: 500; }
.fin-pnl thead th small { display: block; font-size: 10.5px; color: var(--faint); font-weight: 400; }
.fin-pnl .fin-sec td { background: var(--surface-2); font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 5px 10px; }
.fin-pnl .fin-strong th, .fin-pnl .fin-strong td { font-weight: 700; color: var(--ink); }
.fin-pnl .fin-shock { background-image: repeating-linear-gradient(45deg, transparent 0 5px, var(--surface-3) 5px 7px); }
.fin-pnl .fin-partial { background: var(--brass-tint); }
.fin-years { display: flex; gap: 22px; margin-bottom: 8px; flex-wrap: wrap; }
.fin-years span { display: grid; }
.fin-years small { font-size: 11.5px; color: var(--muted); }
.fin-years b { font-size: 18px; font-weight: 800; }

/* ---------- درآمد و کانال‌ها ---------- */
.ktree { display: grid; gap: 12px; }
.kt-row { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; }
.kt-sub { padding-top: 12px; border-top: 1px dashed var(--line); }
.kt-box { flex: 1 1 180px; display: grid; gap: 1px; padding: 10px 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid transparent; }
.kt-root { background: var(--surface); border-color: var(--ink); }
.kt-label { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.kt-val { font-size: 24px; font-weight: 800; white-space: nowrap; line-height: 1.4; }
.kt-val small { font-size: 12px; font-weight: 500; color: var(--muted); margin-inline-start: 4px; }
.kt-ly { font-size: 11.5px; color: var(--muted); }
.kt-d { display: flex; gap: 10px; flex-wrap: wrap; }
.kt-op { align-self: center; font-size: 22px; color: var(--muted); font-weight: 700; }
.kt-foot { font-size: 12px; color: var(--muted); }
.rev-sw { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-inline-end: 7px; vertical-align: middle; }
.rev-ota { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: 14px; border: 1px solid var(--line); border-radius: var(--r-md); }
.rev-ota > div { display: grid; padding: 10px 14px; border-inline-start: 1px solid var(--line); }
.rev-ota > div:first-child { border-inline-start: 0; }
.rev-ota span { font-size: 12px; color: var(--muted); }
.rev-ota b { font-size: 17px; font-weight: 800; }
.rev-ota small { font-size: 11px; color: var(--faint); line-height: 1.5; }
.rev-weeks td, .rev-weeks th { padding: 7px 8px; }
.rev-pricing-sum { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-size: 13px; margin-bottom: 12px; }
.rev-pricing-sum i { font-style: normal; margin-inline-end: 4px; }
.rps-impact { margin-inline-start: auto; }
.rps-impact b { font-size: 15px; }
.rev-price-table { max-height: 560px; }
.rev-price-table table { font-size: 12.5px; }
.rev-price-table td { padding: 7px 8px; }
.rev-price-table tr.rev-comp td:first-child { box-shadow: inset -3px 0 0 var(--pom); }
.rev-price-table tr.rev-valley td:first-child { box-shadow: inset -3px 0 0 var(--turq); }
.rev-price-table tr.rev-high td:first-child { box-shadow: inset -3px 0 0 var(--amber); }
.rev-ev { max-width: 170px; }
.rev-ev small { display: block; color: var(--muted); font-size: 11px; line-height: 1.5; }
.rev-act { min-width: 190px; font-size: 12px; color: var(--ink-2); line-height: 1.6; }
.rev-occbar { display: inline-block; width: 46px; height: 6px; border-radius: 6px; background: var(--surface-3); margin-inline-end: 6px; vertical-align: middle; overflow: hidden; }
.rev-occbar i { display: block; height: 100%; background: var(--turq); }
.rev-stay .bar-row { grid-template-columns: minmax(90px, 120px) minmax(0, 1fr) auto; }

/* ---------- سازمان متصل ---------- */
.org-map { padding: 8px; background: radial-gradient(ellipse at center, var(--surface) 30%, var(--surface-2) 100%); }
.org-svg { width: 100%; height: auto; max-height: 560px; display: block; margin: 0 auto; }
.org-node { width: 100%; height: 100%; display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); text-align: start; font-family: var(--font-ui); box-shadow: var(--shadow); }
.org-node svg { width: 20px; height: 20px; flex: none; color: var(--ink-2); }
.org-node span { display: grid; line-height: 1.35; min-width: 0; }
.org-node b { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-node small { font-size: 10.5px; color: var(--muted); }
.org-node:hover { border-color: var(--turq); }
.org-node.st-obs { border-inline-start: 3px solid var(--ink); }
.org-node.st-gen { border-inline-start: 3px solid var(--brass); }
.org-node.st-gen svg { color: var(--brass); }
.org-node.st-demo { border-style: dashed; background: var(--surface-2); box-shadow: none; }
.org-node.st-demo svg { color: var(--faint); }
.org-list { display: none; }
.org-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.org-legend span { display: inline-flex; align-items: center; gap: 6px; }
.org-legend i { width: 18px; height: 0; border-top: 2px solid var(--ink-2); display: inline-block; }
.org-legend .st-gen i { border-color: var(--brass); }
.org-legend .st-demo i { border-top-style: dashed; border-color: var(--line-strong); }
.org-pipe { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.org-pipe li { padding: 14px 14px 16px; position: relative; border-inline-start: 1px solid var(--line); display: grid; gap: 4px; align-content: start; }
.org-pipe li:first-child { border-inline-start: 0; }
.org-pipe li:not(:last-child)::after { content: ''; position: absolute; inset-inline-end: -7px; top: 26px; width: 12px; height: 12px; background: var(--surface); border-top: 1px solid var(--line); border-inline-end: 1px solid var(--line); transform: rotate(-45deg); z-index: 1; }
.org-pipe svg { width: 22px; height: 22px; color: var(--turq); }
.op-step { position: absolute; inset-inline-end: 12px; top: 10px; font-size: 11px; color: var(--faint); }
.org-pipe b { font-size: 13.5px; }
.org-pipe p { font-size: 12px; color: var(--muted); line-height: 1.8; }
.org-sec { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.org-sec h4 { font-size: 13.5px; display: flex; align-items: center; gap: 7px; margin: 0 0 3px; }
.org-sec h4 svg { width: 16px; height: 16px; color: var(--turq); }
.org-sec p { font-size: 12.5px; color: var(--ink-2); line-height: 1.85; }
.org-gap { font-size: 13.5px; color: var(--ink-2); line-height: 1.95; margin-bottom: 12px; }
.org-gap-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.org-gap-grid > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; padding: 9px 12px; background: var(--surface-2); border-radius: var(--r-md); align-items: center; }
.org-gap-grid b { font-size: 13px; }
.org-gap-grid span { font-size: 11.5px; color: var(--muted); grid-column: 1; }
.org-gap-grid i { font-style: normal; grid-row: 1 / span 2; grid-column: 2; }
.org-dl { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.org-dl li { display: flex; gap: 8px; align-items: flex-start; line-height: 1.8; }
.org-dl svg { width: 15px; height: 15px; color: var(--turq); margin-top: 5px; flex: none; }
.org-fields { display: flex; flex-wrap: wrap; gap: 6px; direction: ltr; justify-content: flex-end; }
.org-fields code { font-family: var(--font-code); font-size: 12px; background: var(--surface-3); border-radius: 6px; padding: 2px 8px; }
.org-score { display: grid; justify-items: center; gap: 12px; text-align: center; align-content: start; }
.org-score p { font-size: 12.5px; color: var(--muted); }
.org-score .kv { width: 100%; text-align: start; }
.os-ring { width: 128px; height: 128px; border-radius: 50%; display: grid; place-content: center; text-align: center; background: conic-gradient(var(--amber) calc(var(--p) * 1%), var(--surface-3) 0); position: relative; }
.os-ring::before { content: ''; position: absolute; inset: 12px; border-radius: 50%; background: var(--surface); }
.os-ring b, .os-ring small { position: relative; }
.os-ring b { font-size: 32px; font-weight: 800; line-height: 1.1; }
.os-ring small { font-size: 11.5px; color: var(--muted); }

/* ---------- تنظیمات ---------- */
.set-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.set-col { display: grid; gap: 16px; }
.panel-head h3 svg { width: 17px; height: 17px; display: inline-block; vertical-align: -3px; margin-inline-end: 4px; color: var(--turq); }
.set-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.set-form .span-all { grid-column: 1 / -1; }
.set-form [hidden] { display: none !important; }
.set-providers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.set-prov { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-md); cursor: pointer; position: relative; }
.set-prov input { position: absolute; opacity: 0; pointer-events: none; }
.set-prov b { font-size: 13px; line-height: 1.5; }
.set-prov small { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.set-prov.on { border-color: var(--turq); background: var(--turq-tint); box-shadow: inset 0 0 0 1px var(--turq); }
.set-prov:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.ltr-input { direction: ltr; text-align: left; font-family: var(--font-code); font-size: 13px; }
.set-key { display: flex; gap: 6px; }
.set-key .icon-btn { flex: none; }
.set-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.set-result { font-size: 12.5px; color: var(--muted); }
.set-rows { display: grid; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.set-row:last-child { border-bottom: 0; }
.set-row > div:first-child { display: grid; max-width: 44ch; }
.set-row b { font-size: 13.5px; }
.set-row small { font-size: 12px; color: var(--muted); line-height: 1.7; }
.set-macro th[scope='row'] { font-weight: 500; white-space: nowrap; color: var(--ink-2); }
.set-macro td, .set-macro th { padding: 5px 3px; }
.set-cell { width: 46px; height: 30px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); text-align: center; font-size: 13px; }
.set-cell:focus { border-color: var(--turq); outline: 2px solid var(--turq-soft); }
.set-cell.bad { border-color: var(--pom); background: var(--pom-tint); }
.set-conf small { font-size: 10.5px; color: var(--faint); white-space: nowrap; }
.set-sub { font-size: 13.5px; margin: 16px 0 8px; }
.set-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.set-legend li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; font-size: 12.5px; color: var(--ink-2); align-items: baseline; }
.set-about-brand { display: flex; align-items: center; gap: 14px; padding: 12px; background: var(--deep); border-radius: var(--r-md); margin-bottom: 14px; }
.set-about-brand svg { width: 48px; height: 48px; }
.set-about-brand .brand-name { margin-top: -6px; }
.set-about-brand small { color: var(--on-deep-muted); font-size: 12px; display: block; margin-top: 10px; }
.set-reset { display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.set-reset > div { display: grid; }
.set-reset small { font-size: 12px; color: var(--muted); }

/* ---------- واکنش‌گرا ---------- */
@media (max-width: 1180px) {
  .org-pipe { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .org-pipe li:nth-child(3)::after { display: none; }
  .org-pipe li:nth-child(n + 4) { border-top: 1px solid var(--line); }
  .set-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .dtree { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .dt-branches { padding-inline-start: 14px; }
  .dt-branch { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .dt-branch::before { inset-inline-start: -14px; width: 14px; top: 28px; }
  .fin-verdict { grid-template-columns: minmax(0, 1fr); }
  .fin-verdict .fv-mark { display: none; }
  .rev-ota { grid-template-columns: minmax(0, 1fr); }
  .rev-ota > div { border-inline-start: 0; border-top: 1px solid var(--line); }
  .rev-ota > div:first-child { border-top: 0; }
  .rps-impact { margin-inline-start: 0; flex-basis: 100%; }
  .org-map-wide { display: none; }
  .org-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 6px; }
  .org-list .org-node { height: auto; min-height: 50px; }
  .org-pipe { grid-template-columns: minmax(0, 1fr); }
  .org-pipe li { border-inline-start: 0; border-top: 1px solid var(--line); }
  .org-pipe li:first-child { border-top: 0; }
  .org-pipe li::after { display: none; }
  .org-sec, .org-gap-grid { grid-template-columns: minmax(0, 1fr); }
  .set-providers { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .fp-head, .fp-row { grid-template-columns: minmax(0, 1.4fr) 40px 52px minmax(40px, 0.8fr); gap: 6px; }
  .kt-op { display: none; }
  .kt-val { font-size: 20px; }
  .eq-op { display: none; }
  .eq-box { flex: 1 1 45%; min-width: 0; }
  .org-list { grid-template-columns: minmax(0, 1fr); }
  .set-form { grid-template-columns: minmax(0, 1fr); }
  .set-legend li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .set-reset { flex-wrap: wrap; }
}
