/* #region zone:finance.style.plan — แผนการเงิน: สถานการณ์ ตัวเลื่อน ช่องติ๊ก และรายการแนะนำ */
.plan {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  min-width: 0;
}
.plan-note {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-inner);
  background: var(--amber-soft);
  color: var(--amber);
  font-weight: 600;
}
.plan-dynamic {
  display: grid;
  gap: var(--sp-4);
  min-width: 0;
}
.plan-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--sp-4);
}

/* Slider: label + live value above a 44px-high track; the filled part is --fill, set from script. */
.ui-slider {
  display: grid;
  gap: var(--sp-1);
  padding: var(--sp-3) var(--sp-4) var(--sp-1);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-inner);
  min-width: 0;
}
.ui-slider-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--sp-3);
}
.ui-slider-head label {
  font-size: var(--t-label);
  font-weight: 600;
}
.ui-slider-head output {
  font-size: var(--t-section);
  font-weight: 650;
}
.ui-slider input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 44px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  --fill: 0%;
}
.ui-slider input[type='range']::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--accent) var(--fill), var(--line) var(--fill));
}
.ui-slider input[type='range']::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: var(--line);
}
.ui-slider input[type='range']::-moz-range-progress {
  height: 6px;
  border-radius: 3px;
  background: var(--accent);
}
.ui-slider input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  margin-top: -9px;
  border-radius: 50%;
  background: var(--panel);
  border: 2px solid var(--accent);
  box-shadow: var(--card-shadow);
}
.ui-slider input[type='range']::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--panel);
  border: 2px solid var(--accent);
  box-shadow: var(--card-shadow);
}
.ui-slider input[type='range']:focus-visible {
  outline: none;
}
.ui-slider input[type='range']:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px var(--acc-ring);
}
.ui-slider input[type='range']:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 4px var(--acc-ring);
}
.ui-slider input[type='range']:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Scenario cards: side by side while each keeps ~240px, one column on a phone. */
.plan-scenarios {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--sp-4);
}
.plan-card {
  gap: var(--sp-3);
  border-top: 3px solid var(--muted);
}
.plan-card.is-cut {
  border-top-color: var(--accent);
}
.plan-card.is-pay {
  border-top-color: var(--series-pay);
}
.panel-head h3 {
  font-size: var(--t-section);
  line-height: 1.4;
  font-weight: 650;
}
.plan-figure {
  display: grid;
  gap: var(--sp-1);
}
.plan-figure strong {
  font-size: var(--t-kpi);
  line-height: 1.25;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.plan-figure small {
  font-size: var(--t-caption);
  font-weight: 600;
}
.plan-lead {
  color: var(--muted);
}
.plan-facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--sp-2);
}
.plan-facts li {
  padding-top: var(--sp-2);
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
}

/* Suggestion and action rows. */
.plan-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}
.plan-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-top: 1px solid var(--line);
}
.plan-item:first-child,
.plan-action:first-child {
  border-top: 0;
}
.plan-item-text {
  display: grid;
  min-width: 0;
}
.plan-item-text b {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.plan-item-text small {
  color: var(--muted);
  font-size: var(--t-caption);
}
.plan-item .row-end small {
  font-size: var(--t-caption);
}
.plan-action {
  display: grid;
  gap: var(--sp-1);
  padding: var(--sp-1) 0;
  border-top: 1px solid var(--line);
}
.plan-check {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  min-height: 44px;
  padding: var(--sp-2) 0;
  cursor: pointer;
}
.plan-check input {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  display: grid;
  place-content: center;
  width: 24px;
  height: 24px;
  margin: 0;
  border: 2px solid var(--muted);
  border-radius: 6px;
  background: var(--panel);
  cursor: pointer;
}
.plan-check input:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.plan-check input:checked::after {
  content: '';
  width: 6px;
  height: 11px;
  margin-top: -2px;
  border: solid var(--on-accent);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.plan-check input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.plan-action.is-done .plan-item-text b {
  color: var(--muted);
}
.plan-progress {
  display: grid;
  gap: var(--sp-1);
  margin: 0 0 var(--sp-2) 36px;
}
.plan-progress small {
  color: var(--muted);
  font-size: var(--t-caption);
}
.plan-luna {
  display: grid;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
  justify-items: start;
}
.plan-luna-out {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-inner);
  background: var(--panel2);
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.plan-luna-out.is-error {
  background: var(--error-soft);
  color: var(--error);
}

@media (max-width: 900px) {
  .plan-lists {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 600px) {
  .plan-item {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .plan-item .status-badge {
    grid-column: 1 / -1;
    justify-self: start;
  }
}
/* #endregion */
