/* emi.css — EMI calculator (requires style.css) */

.emi-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
  color: #111111;
}

.story-block {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
}

.story-a,
.story-b {
  background: #f9fafb;
  border-top: none;
}

.sticky-ribbon {
  position: sticky;
  top: 0;
  z-index: 100;
  padding-top: 2px;
}

.sticky-stack {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input-ribbon {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 20px;
  background: #ffffff;
  position: relative;
}

.input-ribbon::before {
  display: none;
}

.ribbon-basic {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 12px;
  align-items: start;
}

.ribbon-basic .field {
  min-width: 0;
}

.ribbon-basic button {
  flex-shrink: 0;
  margin-top: 0;
  padding: 11px 24px;
}

.input-toggle {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: center;
  margin-top: 0;
}

.slider-inline {
  margin-top: 0;
  overflow: hidden;
  max-height: 92px;
}

.input-ribbon .field label {
  font-size: 14px;
  font-weight: 600;
  color: #111111;
}

.input-ribbon .field input {
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
}

.slider-inline input[type="range"] {
  width: 100%;
  accent-color: #1d9e75;
  cursor: pointer;
}

.slider-annotation {
  margin-top: 2px;
  font-size: 12px;
  color: #6b7280;
  font-weight: 600;
  text-align: right;
}

.ribbon-advanced-strip {
  margin-top: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  color: #111111;
  font-weight: 600;
  font-size: 13px;
  text-align: left;
}

.ribbon-advanced-strip:hover {
  background: #e1f5ee;
}

.ribbon-advanced {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
}

.ribbon-advanced:not(.is-collapsed) {
  max-height: 420px;
  opacity: 1;
}

.ribbon-slider .slider-head {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
  margin-bottom: 0;
}

.slider-pill {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 8px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  color: #111111;
  font-weight: 600;
  font-size: 12px;
}

.ribbon-advanced-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
  align-items: end;
}

.ribbon-stepup .stepup-row {
  display: grid;
  grid-template-columns: auto 90px auto;
  gap: 10px;
  align-items: center;
}

.stepup-toggle {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  user-select: none;
  font-weight: 600;
  color: #111111;
  font-size: 15px;
}

.stepup-suffix {
  color: #6b7280;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}

.ribbon-personal {
  margin-top: 12px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
}

.ribbon-personal:not(.is-collapsed) {
  max-height: 260px;
  opacity: 1;
}

.ribbon-personal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.results-hero .results-hero-top {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 12px;
  align-items: stretch;
}

.hero-emi {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  border-bottom: 1px solid #e5e7eb;
  padding: 20px;
}

.hero-label {
  font-size: 11px;
  color: #6b7280;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

.hero-value {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #111111;
  line-height: 1.12;
}

.hero-sub {
  margin-top: 8px;
  font-size: 15px;
  color: #6b7280;
  line-height: 1.6;
}

.hero-cards {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.hero-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.hero-card .label {
  font-size: 11px;
  color: #6b7280;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

.hero-card .value {
  margin-top: 8px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  color: #111111;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.milestones-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.locked-callout {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border-radius: 8px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}

.locked-title {
  font-weight: 600;
  font-size: 15px;
  color: #111111;
}

.locked-sub {
  margin-top: 8px;
  color: #6b7280;
  font-size: 15px;
  line-height: 1.6;
}

.ghost-btn {
  background: #ffffff;
  color: #1d9e75;
  border: 1px solid #1d9e75;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 13px;
}

.ghost-btn:hover {
  background: #e1f5ee;
  color: #085041;
}

.ribbon-chips {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  gap: 8px;
  align-items: baseline;
  padding: 10px 12px;
  border-radius: 8px;
  background: #e1f5ee;
  border: 1px solid #e5e7eb;
}

.chip-k {
  font-size: 11px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.chip-v {
  font-size: 15px;
  font-weight: 600;
  color: #085041;
}

.ribbon-link {
  margin-left: auto;
  font-size: 15px;
  color: #1d9e75;
  font-weight: 600;
  text-decoration: none;
}

.ribbon-link:hover {
  background-color: #e1f5ee;
  color: #085041;
}

.results-row .hero-kpi .value {
  font-size: 15px;
  letter-spacing: -0.02em;
}

.results-row .results-grid {
  align-items: stretch;
}

.pi-bar {
  margin-top: 12px;
}

.pi-bar-track {
  height: 16px;
  border-radius: 8px;
  overflow: hidden;
  background: #f9fafb;
  display: flex;
  border: 1px solid #e5e7eb;
}

.pi-bar-principal {
  height: 100%;
  width: 0%;
  background: #1d9e75;
}

.pi-bar-interest {
  height: 100%;
  width: 0%;
  background: #e24b4a;
}

.pi-bar-meta {
  margin-top: 8px;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.6;
}

.emi-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  align-items: start;
}

.emi-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.lhn {
  position: sticky;
  top: 100px;
  z-index: 40;
}

.lhn.is-hidden {
  opacity: 0.4;
  pointer-events: none;
}

.lhn-inner {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
}

.lhn-title {
  font-weight: 600;
  letter-spacing: -0.015em;
  font-size: 15px;
  color: #111111;
}

.lhn-subtitle {
  margin-top: 8px;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.6;
}

.lhn-group {
  margin-top: 12px;
}

.lhn-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}

.lhn-label {
  font-size: 13px;
  color: #6b7280;
  font-weight: 600;
}

.lhn-value {
  font-size: 15px;
  font-weight: 600;
  color: #111111;
}

.lhn input[type="range"] {
  width: 100%;
  accent-color: #1d9e75;
}

.lhn-inline {
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: 10px;
  align-items: center;
}

.lhn-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: #111111;
  font-size: 15px;
  user-select: none;
}

.lhn-divider {
  margin-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.lhn-cta {
  margin-top: 12px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  background: #e1f5ee;
  color: #085041;
  border: 1px solid #1d9e75;
  font-weight: 600;
}

.lhn-cta:hover {
  background: #ffffff;
  color: #1d9e75;
}

.lhn-personal {
  margin-top: 12px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
}

.lhn-personal:not(.is-collapsed) {
  max-height: 260px;
  opacity: 1;
}

.lhn-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.journey-card .journey-head {
  margin-bottom: 24px;
}

.journey-card .section-title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin-bottom: 8px;
  color: #111111;
}

.section-intent {
  margin-top: 8px;
  margin-bottom: 0;
  display: block;
  padding: 0;
  border-radius: 0;
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0;
}

.head-row {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
}

.inline-enable {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: #111111;
  font-weight: 600;
  user-select: none;
}

.info-line {
  margin-top: 8px;
  font-size: 15px;
  color: #6b7280;
  line-height: 1.6;
}

.info-good {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #085041;
  font-size: 15px;
  font-weight: 600;
}

.ok-dot {
  width: 20px;
  height: 20px;
  border-radius: 8px;
  border: 1px solid #1d9e75;
  background: #e1f5ee;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  color: #085041;
  font-weight: 600;
}

.compact-controls {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
}

#personal-inputs.compact-controls {
  grid-template-columns: 1fr 1fr 1fr;
}

.kpi-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.kpi {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  border-bottom: 1px solid #e5e7eb;
  padding: 20px;
}

.kpi-label {
  font-size: 11px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.kpi-value {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: #111111;
  line-height: 1.2;
}

.kpi-sub {
  margin-top: 8px;
  font-size: 15px;
  color: #6b7280;
  line-height: 1.6;
}

.insight-box {
  margin-bottom: 24px;
}

.prepayment-box {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #e5e7eb;
}

.prepayment-box h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #111111;
}

.insight-section {
  padding-top: 24px;
  margin-top: 24px;
  border-top: 1px solid #e5e7eb;
}

.insight-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.insight-title {
  font-weight: 600;
  font-size: 15px;
  color: #111111;
}

.question-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #e1f5ee;
  border: 1px solid #1d9e75;
  color: #085041;
  font-weight: 600;
  letter-spacing: 0;
  font-size: 15px;
}

.question-title::before {
  content: none;
}

.segmented {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
}

.seg-btn {
  border: none;
  background: transparent;
  padding: 8px 12px;
  border-radius: 8px;
  color: #6b7280;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  margin-top: 0;
}

.seg-btn:hover {
  background: #e1f5ee;
  color: #085041;
}

.seg-btn[aria-selected="true"],
.seg-btn.is-active {
  background: #1d9e75;
  color: #ffffff;
}

.mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.mini-kpi {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
}

.mini-kpi:hover {
  background: #e1f5ee;
  border-color: #1d9e75;
}

.mini-label {
  font-size: 12px;
  color: #6b7280;
  letter-spacing: 0.02em;
}

.mini-value {
  margin-top: 8px;
  font-weight: 600;
  font-size: 15px;
  color: #111111;
}

.delta-line {
  margin-top: 12px;
  font-size: 15px;
  color: #6b7280;
  line-height: 1.6;
}

.supporting-copy {
  margin-top: 8px;
  font-size: 15px;
  color: #6b7280;
  line-height: 1.6;
  max-width: 90ch;
}

.more-copy {
  margin-top: 12px;
  border-left: 3px solid #1d9e75;
  padding-left: 12px;
}

.more-copy summary {
  cursor: pointer;
  font-size: 15px;
  color: #1d9e75;
  font-weight: 600;
  margin-bottom: 8px;
  user-select: none;
}

.more-copy summary:hover {
  background-color: #e1f5ee;
}

.more-copy p {
  margin-top: 8px;
  font-size: 15px;
  color: #6b7280;
  line-height: 1.6;
}

.static-checklist {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.check-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: start;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
}

.check-no {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: #e1f5ee;
  border: 1px solid #1d9e75;
  color: #085041;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.check-row p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: #6b7280;
}

.scenario-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}

.scenario-apply {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  border: 1px solid #1d9e75;
}

#opt-emi10,
#opt-annual1l,
#debt-till-age,
#emi-income-now {
  color: #1d9e75;
  font-weight: 600;
}

#debt-guidance {
  color: #1d9e75;
  font-weight: 600;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.slider-row input[type="range"] {
  width: 100%;
  accent-color: #1d9e75;
}

.slider-value {
  min-width: 60px;
  text-align: right;
  color: #111111;
  font-weight: 600;
  font-size: 15px;
}

.compare-pill {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  background: #e1f5ee;
  border: 1px solid #e5e7eb;
  color: #085041;
  font-weight: 600;
  font-size: 13px;
}

.ring-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 24px;
  align-items: center;
  margin-top: 12px;
}

.progress-ring {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #e5e7eb;
  display: grid;
  place-items: center;
}

.ring-inner {
  width: 92px;
  height: 92px;
  background: #ffffff;
  border-radius: 50%;
  border: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.ring-big {
  font-weight: 600;
  font-size: 15px;
  color: #111111;
}

.ring-small {
  color: #6b7280;
  font-size: 12px;
  font-weight: 600;
}

.ring-copy {
  color: #6b7280;
  font-size: 15px;
  line-height: 1.6;
}

.bar-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bar-item {
  display: grid;
  grid-template-columns: 56px 1fr 52px;
  gap: 12px;
  align-items: center;
}

.bar-label {
  font-size: 13px;
  color: #6b7280;
}

.bar-track {
  height: 12px;
  border-radius: 8px;
  background: #f9fafb;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.bar-fill {
  height: 100%;
  border-radius: 8px;
  background: #1d9e75;
  width: 0%;
}

.bar-val {
  font-size: 13px;
  color: #6b7280;
  text-align: right;
}

.emi-main .chart-wrap {
  min-height: 360px;
}

.results-row.results-hero {
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

@media (max-width: 992px) {
  .ribbon-basic {
    grid-template-columns: 1fr;
  }

  .ribbon-advanced-row {
    grid-template-columns: 1fr;
  }

  .results-hero .results-hero-top {
    grid-template-columns: 1fr;
  }

  .hero-cards {
    grid-template-columns: 1fr;
  }

  .milestones-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .emi-layout {
    grid-template-columns: 1fr;
  }

  .lhn {
    position: static;
  }

  .lhn.is-hidden {
    opacity: 1;
    pointer-events: auto;
  }

  .kpi-strip {
    grid-template-columns: 1fr;
  }

  .compact-controls,
  #personal-inputs.compact-controls {
    grid-template-columns: 1fr;
  }

  .ribbon-personal-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .page {
    padding: 16px 16px 40px;
    padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
  }

  .sticky-ribbon {
    position: static;
  }

  .ribbon-basic {
    grid-template-columns: 1fr;
  }

  .ribbon-advanced-row {
    grid-template-columns: 1fr;
  }

  .compact-controls,
  #personal-inputs.compact-controls {
    grid-template-columns: 1fr;
  }

  .section-intent {
    display: block;
    border-radius: 8px;
    line-height: 1.6;
  }

  .ribbon-personal-grid {
    grid-template-columns: 1fr;
  }

  .results-hero .results-hero-top {
    grid-template-columns: 1fr;
  }

  .hero-cards {
    grid-template-columns: 1fr;
  }

  .milestones-grid {
    grid-template-columns: 1fr;
  }

  .sticky-stack {
    position: static;
  }

  .input-ribbon {
    flex-direction: column;
    align-items: stretch;
  }

  .ribbon-basic button {
    width: 100%;
    text-align: center;
  }

  .ribbon-basic .field {
    min-width: 100%;
  }

  .emi-layout {
    grid-template-columns: 1fr;
  }

  .lhn {
    position: static;
  }

  .lhn.is-hidden {
    opacity: 1;
    pointer-events: auto;
  }

  .kpi-strip {
    grid-template-columns: 1fr;
  }

  .ribbon-stepup .stepup-row {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .head-row {
    flex-wrap: wrap;
  }

  .insight-row {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
  }

  .segmented {
    flex-wrap: wrap;
    width: 100%;
    justify-content: flex-start;
  }

  .mini-grid {
    grid-template-columns: 1fr;
  }

  .locked-callout {
    flex-direction: column;
    align-items: stretch;
  }

  .ghost-btn {
    width: 100%;
    text-align: center;
    min-height: 44px;
  }

  .lhn-2col {
    grid-template-columns: 1fr;
  }

  .scenario-row {
    grid-template-columns: 1fr;
  }

  .scenario-apply {
    width: 100%;
    min-height: 44px;
  }

  .ring-row {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .ring-copy {
    max-width: 100%;
  }

  .bar-item {
    grid-template-columns: 48px 1fr 48px;
    gap: 8px;
  }

  .bar-label,
  .bar-val {
    font-size: 12px;
  }

  .journey-card .section-title {
    font-size: clamp(1.25rem, 5vw, 1.65rem);
  }

  .hero-value {
    font-size: clamp(1.35rem, 6vw, 1.75rem);
    overflow-wrap: anywhere;
  }

  .kpi-value {
    font-size: clamp(1.25rem, 6vw, 1.65rem);
    overflow-wrap: anywhere;
  }

  .slider-row {
    flex-wrap: wrap;
  }

  .slider-value {
    min-width: 0;
    flex: 1 1 100%;
    text-align: left;
  }

  .emi-main .chart-wrap {
    min-height: 260px;
    padding: 12px;
  }

  .question-title {
    flex-wrap: wrap;
    max-width: 100%;
  }

  .ribbon-chips {
    max-width: 100%;
  }

  .chip {
    max-width: 100%;
    flex-wrap: wrap;
  }

  .ribbon-link {
    margin-left: 0;
    margin-top: 8px;
    display: inline-block;
  }

  .check-row {
    grid-template-columns: 24px 1fr;
    gap: 10px;
    padding: 12px;
  }

  .pi-bar-meta {
    font-size: 12px;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 480px) {
  .input-ribbon {
    padding: 16px;
  }

  .input-ribbon .field input,
  .compact-controls .field input,
  .lhn-inline input[type="number"] {
    font-size: 16px;
  }

  .hero-card .value {
    font-size: 14px;
  }

  .seg-btn {
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
  }
}
