/* Planner presentation only: inputs and computed results have distinct treatments. */
body:not([data-app-view="plans"]) .planner-introduction { display: none; }
body[data-app-view="plans"] #manualFireTargetControls[hidden] { display: none !important; }

body[data-app-view="plans"] .planner-introduction {
  padding: 24px 0 8px;
  max-width: 100%;
}
body[data-app-view="plans"] .planner-introduction h2 {
  margin: 6px 0 10px;
  color: #172f42;
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  letter-spacing: -0.025em;
}
body[data-app-view="plans"] .planner-introduction > p:not(.eyebrow) {
  margin: 0;
  color: #536575;
  line-height: 1.7;
  font-weight: 400;
}
.planner-field-guide {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
  margin-top: 20px;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #536575;
}
.planner-field-guide > span { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.planner-field-guide strong { color: #263e4b; font-weight: 650; }
.planner-field-guide i { width: 24px; height: 20px; border-radius: 4px; }
.input-example { border: 1.5px solid #8da4ad; background: white; }
.result-example { border-left: 3px solid #167662; background: #eaf4f0; }

body[data-app-view="plans"] .planner-form .panel {
  border: 1px solid #dce4e8;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 2px 5px rgb(23 47 66 / 3%);
  margin-bottom: 24px;
  padding: clamp(18px, 2.5vw, 30px);
}
body[data-app-view="plans"] .planner-form .panel > .section-head {
  align-items: flex-start;
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid #e3eaed;
}
body[data-app-view="plans"] .panel > .section-head .eyebrow,
body[data-app-view="plans"] .planner-introduction .eyebrow {
  display: block;
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  color: #13715e;
}
body[data-app-view="plans"] .panel > .section-head h2 {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.4;
  color: #172f42;
}
body[data-app-view="plans"] .section-description {
  margin: 8px 0 0;
  max-width: 65ch;
  color: #536575;
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.65;
}
body[data-app-view="plans"] .assumptions-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 24px !important;
  align-items: start;
}
body[data-app-view="plans"] .assumptions-grid > label {
  grid-column: auto !important;
  width: 100%;
}
body[data-app-view="plans"] .planner-form :is(input[type="number"], input[type="text"], select, textarea):not([readonly]):not(:disabled) {
  background: #fff !important;
  border: 1.5px solid #8da4ad !important;
  border-radius: 8px;
  color: #18333c;
  box-shadow: none;
  min-height: 44px;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 500;
}
body[data-app-view="plans"] .planner-form :is(input, select, textarea):focus-visible {
  outline: 3px solid #a6dace;
  outline-offset: 2px;
}
body[data-app-view="plans"] .planner-form :is(input, select, textarea).refresh-required-empty {
  border-color: #b64134 !important;
  background: #fff8f6 !important;
}
body[data-app-view="plans"] .planner-form :is(input, select, textarea):disabled,
body[data-app-view="plans"] .planner-form input[readonly] {
  background: #edf1f3 !important;
  border: 1px dashed #aab8c1 !important;
  color: #536575;
  box-shadow: none;
}
body[data-app-view="plans"] .planner-form label {
  color: #344c58;
  font-weight: 600;
  line-height: 1.5;
}
body[data-app-view="plans"] .planner-form :is(.field-help, .repayment-status, .retirement-contribution-note) {
  color: #536575;
  font-weight: 400;
  line-height: 1.65;
  font-size: 0.82rem;
}
body[data-app-view="plans"] .planner-form :is(.field-help, .repayment-status).warning {
  color: #9b4c06;
}
body[data-app-view="plans"] :is(.section-total-card, .asset-return-summary, .cash-flow-saving) {
  background: #eef6f3 !important;
  border: 0 !important;
  border-left: 3px solid #288270 !important;
  border-radius: 0 10px 10px 0 !important;
  box-shadow: none !important;
  padding: 16px 18px;
  cursor: default;
}
body[data-app-view="plans"] :is(.section-total-card, .asset-return-summary) {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 20px;
  margin: 0 0 18px;
}
body[data-app-view="plans"] :is(.section-total-card, .asset-return-summary) output {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  color: #135b4d;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
body[data-app-view="plans"] :is(.section-total-card, .asset-return-summary, .cash-flow-saving) .calculated-label {
  display: block;
  grid-column: 1 / -1;
  margin: 0 0 4px;
  color: #3e655c;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
body[data-app-view="plans"] .calculated-help {
  grid-column: 1 / -1;
  margin: 0;
  color: #48665e;
  font-size: 0.82rem;
  line-height: 1.6;
  font-weight: 400;
}
body[data-app-view="plans"] .asset-return-summary .asset-return-toggle {
  grid-column: 1 / -1;
  padding-top: 8px;
  border-top: 1px solid #d5e6df;
  text-transform: none;
}
body[data-app-view="plans"] .cash-flow-saving :is(strong, span, small) { color: #254d44; }
body[data-app-view="plans"] .cash-flow-saving strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
body[data-app-view="plans"] .cash-flow-saving small:not(.calculated-label) { font-weight: 400; line-height: 1.55; }
body[data-app-view="plans"] .cash-flow-saving.is-not-used { border-left-color: #899aa5 !important; background: #f0f3f5 !important; }
body[data-app-view="plans"] .cash-flow-saving.is-not-used :is(strong, span, small) { color: #526571; }
body[data-app-view="plans"] :is(.asset-entry, .liability-entry) {
  padding: 22px 0 !important;
  border: 0 !important;
  border-bottom: 1px solid #e2e9ec !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
body[data-app-view="plans"] :is(.asset-entry, .liability-entry) .entry-title {
  color: #213b48;
  font-size: 1rem;
  font-weight: 700;
}
body[data-app-view="plans"] :is(.cash-flow-row, .allocation-range-row) {
  border: 1px solid #dce4e8;
  border-radius: 12px;
  margin-top: 22px;
  padding: 20px;
  background: #fff;
}
body[data-app-view="plans"] .cash-flow-subhead {
  background: transparent !important;
  border: 0 !important;
  border-top: 1px solid #e2e9ec !important;
  border-radius: 0 !important;
  padding: 20px 0 12px !important;
}
body[data-app-view="plans"] .cash-flow-subhead h3 { color: #213b48; font-size: 1.1rem; }
body[data-app-view="plans"] .completion-actions {
  padding: 24px;
  margin-top: 24px;
  border-radius: 12px;
  background: #eef6f3;
}
@media (max-width: 640px) {
  .planner-field-guide { flex-direction: column; gap: 12px; }
  body[data-app-view="plans"] :is(.section-total-card, .asset-return-summary) { grid-template-columns: minmax(0, 1fr); }
  body[data-app-view="plans"] .planner-form .panel { padding: 18px; }
  body[data-app-view="plans"] :is(.cash-flow-row, .allocation-range-row) { padding: 12px; }
  body[data-app-view="plans"] .cash-flow-card-head > .cash-flow-saving { grid-column: 1 / -1; }
  body[data-app-view="plans"] .assumptions-grid { grid-template-columns: minmax(0, 1fr) !important; }
}
/* Keep paired range inputs level even when the first field has a helper note. */
body[data-app-view="plans"] .cash-flow-card-head { align-items: start; }
body[data-app-view="plans"] .cash-flow-card-head > label {
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-content: start;
  align-self: start;
  padding: 8px 10px;
  gap: 8px;
  min-width: 0;
}
body[data-app-view="plans"] .range-field-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  font-size: 0.82rem;
  white-space: nowrap;
}
body[data-app-view="plans"] .limit-enforce-wrap { align-items: start; }
body[data-app-view="plans"] .limit-enforce-label {
  display: flex;
  align-items: start;
  gap: 8px;
  min-width: 0;
}
body[data-app-view="plans"] .limit-enforce-label input { flex: 0 0 auto; }
body[data-app-view="plans"] .limit-enforce-wrap > .planner-help-button { flex: 0 0 auto; }

/* Keep adding a range visible alongside the existing year ranges. */
.range-toolbar { display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap; margin-bottom: 16px; }
.range-toolbar .timeline-summary { flex: 1 1 280px; min-width: 0; margin: 0; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 8px; }
.range-toolbar .timeline-chip { flex: 0 0 auto; max-width: 320px; white-space: normal; }
.range-tab-dates, .range-tab-summary { display: block; margin-top: 6px; }
.range-section-title { margin: 0; color: #132644; font-size: 1.2rem; }
#plannerReviewStatus { flex-basis: 100%; color: #304a48; line-height: 1.6; }
#viewProjectionsFromSavings:disabled { opacity: 0.5; cursor: not-allowed; }
.refresh-required-message { display: block; background: #fff1ef; border-left: 3px solid #a72c24; padding: 12px; color: #822019; }
.range-validation-error { padding: 12px 16px; border-left: 4px solid #a72c24; background: #fff1ef; color: #822019; line-height: 1.6; margin: 0; }
.range-validation-error[hidden] { display: none; }
.cash-flow-card-head input[aria-invalid="true"] { border: 2px solid #a72c24; }
.cash-flow-card-head input[data-automatic-end="true"] { background: #eaf2f1; border-style: dashed; color: #304a48; }
.cash-flow-row, .allocation-range-row { scroll-margin-top: 100px; }
.range-toolbar .cash-flow-add-controls { flex: 0 1 auto; justify-content: flex-start; padding: 16px; border: 1px solid #cdded7; border-radius: 12px; background: #f2f8f5; }
.range-toolbar .range-add-title { flex-basis: 100%; }
.range-toolbar .cash-flow-add-controls label { flex: 1 1 160px; min-width: 0; }
.range-toolbar .cash-flow-add-controls select { width: 100%; }
.range-toolbar .cash-flow-add-controls button { background: #155c4c; color: #fff; border-color: #155c4c; }
@media (max-width: 700px) {
  .range-toolbar .cash-flow-add-controls { flex: 1 1 100%; }
  .range-toolbar .cash-flow-add-controls button { flex: 1 1 150px; }
}
