/* MoneyBull Calculator UI v2 — namespace: .mb-calculator-shell */
/* Only calculator pages should load this stylesheet. */
.mb-calculator-shell {
  --mb-bg: #F7F9FC;
  --mb-surface: #FFFFFF;
  --mb-ink: #182230;
  --muted: #667085;
  --mb-line: #e5e9f0;
  --mb-primary: #0f6dff;
  --mb-primary-dark: #0551b7;
  --mb-primary-soft: #eef6ff;
  --mb-success-soft: #e9fbf2;
  --mb-success: #07835b;
  --mb-danger: #D92D20;
  --mb-radius: 18px;
  --mb-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  box-sizing: border-box;
  color: var(--mb-ink);
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI"ans-serif;
  max-wi: 920px;
  margin: 26px auto 44px;
  padding: 0 14px;
}

.mb-calculatorell *,
.mb-culator-shell :before,
.mb-calculator-shell *::after {
  box-sizing: border-box;
}

.mb-calculator-shell img,
.mb-calculator-shell svg {
  display: block;
  max-width: 100%;
}

/* Header */
.mb-calculator-header {
  padding: 26px 24px;
  border-radius: 22px;
  background: linear-gradient(160deg, #07304a 0%, #0f3a63 55%, #0f6dff 100%);
  color: #fff;
  box-shadow: 0 18px 36px rgba(15, 61, 123, 0.22);
}
.mb-calculator-header .mb-eyebrow {
  color: #c7e0ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.mb-calculator-header h1 {
  color: #ffffff !important;
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.18;
  letter-spacing: -0.05em;
  margin: 8px 0 10px !important;
}
.mb-calculator-header .mb-intro {
  color: rgba(255,255,255,0.82);
  font-size: 15px;
  line-height: 1.7;
  margin: 0 !important;
}
.mb-calculator-header .mb-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.mb-calculator-header .mb-tags span {
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  color: #edfff6;
  font-size: 12px;
  font-weight: 700;
}

/* Form card */
.mb-calculator-form {
  margin-top: 18px;
  padding: 22px;
  border-radius: var(--mb-radius);
  border: 1px solid var(--mb-line);
  background: var(--mb-surface);
  box-shadow: var(--mb-shadow);
}
.mb-form-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.mb-form-heading h2 {
  font-size: 22px;
  letter-spacing: -0.04em;
  margin: 0 !important;
}
.mb-form-heading p:not(.mb-eyebrow) {
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0 0 !important;
}
.mb-tip {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--mb-primary-soft);
  color: #08408a;
  font-size: 12px;
  font-weight: 700;
}

/* Grid: 1 column on small screens, 2 columns only when comfortable */
.mb-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 720px) {
  .mb-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Field */
.mb-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--mb-line);
  border-radius: 16px;
  background: #fff;
}
.mb-field__label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
}
.mb-field__title {
  font-size: 14px;
  font-weight: 800;
  color: var(--mb-ink);
}
.mb-field__title small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}
.mb-field__icon {
  display: inline-block;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #f4f7fb;
  text-align: center;
  line-height: 26px;
  font-size: 13px;
  margin-right: 6px;
}
.mb-field__help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.mb-field__control {
  position: relative;
  display: flex;
  align-items: center;
}
.mb-field__control input,
.mb-field__control select {
  width: 100%;
  min-height: 52px;
  padding: 0 52px 0 14px;
  border: 1px solid #d8dfe8;
  border-radius: 12px;
  background: #f6f9fc;
  color: var(--mb-ink);
  font: 700 15px/1.2 inherit;
  font-variant-numeric: tabular-nums;
}
.mb-field__control input:focus {
  outline: 3px solid rgba(15,109,255,0.14);
  border-color: var(--mb-primary);
  background: #fff;
}
.mb-field__unit {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  pointer-events: none;
}
.mb-field__error {
  color: var(--mb-danger);
  font-size: 12px;
  font-weight: 600;
  min-height: 0;
}
.mb-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.mb-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.mb-switch__track {
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: #dbe4ed;
  display: inline-block;
  transition: background .2s;
}
.mb-switch input:checked + .mb-switch__track {
  background: var(--mb-primary);
}
.mb-switch__track::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: left .2s;
}
.mb-switch input:checked + .mb-switch__track::after {
  left: 23px;
}

/* Actions */
.mb-calculator-actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}
.mb-calculator-btn {
  min-height: 54px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font: 800 15px/1.2 inherit;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.mb-calculator-btn--primary {
  flex: 1;
  color: #fff;
  background: linear-gradient(125deg, #0f6dff, #0551b7);
  box-shadow: 0 9px 18px rgba(15, 109, 255, 0.24);
}
.mb-calculator-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 22px rgba(15, 109, 255, 0.3);
}
.mb-calculator-btn--primary:active {
  transform: translateY(0);
}
.mb-calculator-btn--secondary {
  min-width: 110px;
  color: #30425e;
  background: #eef2f7;
}
.mb-calculator-btn--secondary:hover {
  background: #e3eaf2;
}

/* Result card */
.mb-calculator-result {
  margin-top: 18px;
  padding: 22px;
  border-radius: var(--mb-radius);
  border: 1px solid var(--mb-line);
  background: var(--mb-surface);
  box-shadow: var(--mb-shadow);
}
.mb-calculator-result__header {
  margin-bottom: 10px;
}
.mb-calculator-result__header h3 {
  margin: 6px 0 0 !important;
  font-size: 20px;
  color: var(--mb-ink);
}
.mb-calculator-result__hero {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.mb-calculator-result__hero strong {
  color: var(--mb-success);
  font-size: clamp(32px, 6.5vw, 50px);
  letter-spacing: -0.06em;
}

/* FIRE-only: requiredMonthlyContribution card readability */
.mb-calculator--fire .mb-result-highlight {
  background: #f7f9fc !important;
  border: 1px solid var(--mb-line) !important;
  color: #111827 !important;
  border-radius: 12px;
  padding: 16px !important;
  word-break: keep-all;
}
.mb-calculator--fire .mb-result-highlight *,
.mb-calculator--fire .mb-result-highlight *::before,
.mb-calculator--fire .mb-result-highlight *::after {
  color: inherit !important;
}
.mb-calculator--fire .mb-result-highlight span,
.mb-calculator--fire .mb-result-highlight small {
  color: #596579 !important;
}
.mb-calculator--fire .mb-result-highlight strong,
.mb-calculator--fire .mb-result-highlight .mb-amount,
.mb-calculator--fire .mb-result-highlight b {
  color: #047857 !important;
  font-weight: 800 !important;
  font-size: 20px !important;
  text-align: left !important;
  letter-spacing: -0.06em;
  line-height: 1.15;
}
@media (min-width: 720px) {
  .mb-calculator--fire .mb-result-highlight {
    grid-template-columns: 1fr auto;
  }
  .mb-calculator--fire .mb-result-highlight strong,
  .mb-calculator--fire .mb-result-highlight .mb-amount,
  .mb-calculator--fire .mb-result-highlight b {
    text-align: right !important;
    font-size: clamp(32px, 5vw, 48px) !important;
  }
}

/* 가독성 강제 덮어쓰기 v3 - 최종 */
body .mb-result-highlight,
html body .mb-result-highlight {
  background: #f7f9fc !important;
  color: #111827 !important;
  border: 1px solid #e5e7eb !important;
}
body .mb-result-highlight *,
body .mb-result-highlight strong,
body .mb-result-highlight b,
body .mb-result-highlight .mb-amount,
body .mb-result-highlight .amount,
body .mb-result-highlight span {
  color: #047857 !important;
  font-weight: 800 !important;
  text-shadow: none !important;
}

/* v6 - 완전 격리 */
html body .mb-chart-card {
  height: auto !important;
  min-height: 380px !important;
  overflow: visible !important;
  contain: none !important;
  isolation: isolate !important;
  position: relative !important;
  display: block !important;
  margin-bottom: 24px !important;
}

html body .mb-chart-card * {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

html body .mb-chart-card > div {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: 100% !important;
  height: auto !important;
  transform: none !important;
  overflow: visible !important;
}

html body .mb-chart-card canvas {
  position: relative !important;
  left: 0 !important;
  top: 0 !important;
  width: 100% !important;
  height: 320px !important;
  max-width: 100% !important;
  max-height: 320px !important;
}

/* 다음 섹션 밀어내기 */
body .mb-chart-card + * {
  margin-top: 20px !important;
  position: relative !important;
  z-index: 2 !important;
}

@media (max-width: 768px) {
  body .mb-result-highlight {
    padding: 16px !important;
    border-radius: 12px !important;
  }
  body .mb-result-highlight .mb-amount {
    font-size: 20px !important;
    line-height: 1.4 !important;
    word-break: keep-all !important;
  }
}

/* Dividend result hero override */
.mb-calculator--dividend .mdf-result-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 8px;
}
@media (min-width: 720px) {
  .mb-calculator--dividend .mdf-result-hero {
    grid-template-columns: 1.1fr 1fr;
  }
}
.mb-calculator--dividend .mdf-result-hero h2 {
  margin: 0 !important;
  font-size: clamp(24px, 4.5vw, 34px);
  line-height: 1.25;
  letter-spacing: -0.04em;
  color: var(--mb-success);
}
.mb-calculator--dividend .mdf-result-hero strong {
  color: var(--mb-success);
}
.mb-calculator--dividend .mdf-result-hero > span {
  grid-column: 1/-1;
  display: inline-block;
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--mb-success-soft);
  color: var(--mb-success);
  font-size: 12px;
  font-weight: 800;
  margin-top: 6px;
}
.mb-calculator--dividend .mdf-result-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}
@media (min-width: 720px) {
  .mb-calculator--dividend .mdf-result-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.mb-calculator--dividend .mdf-result-stats article {
  min-height: 120px;
  padding: 16px;
  border: 1px solid var(--mb-line);
  border-radius: 16px;
  background: #f8fafd;
}
.mb-calculator--dividend .mdf-result-stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.mb-calculator--dividend .mdf-result-stats p {
  margin: 7px 0 0 !important;
  color: #62758d;
  font-size: 11px;
  font-weight: 700;
}
.mb-calculator--dividend .mdf-result-stats strong {
  display: block;
  margin: 7px 0 0;
  color: var(--mb-ink);
  font-size: 18px;
  letter-spacing: -0.04em;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.mb-calculator--dividend .mdf-result-stats small {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  color: #8b9aae;
  font-weight: 500;
}
.mb-calculator--dividend .mdf-disclaimer {
  grid-column: 1/-1;
  padding-top: 13px;
  border-top: 1px dashed var(--mb-line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  margin-top: 10px !important;
}
.mb-badge {
  display: inline-block;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--mb-success-soft);
  color: var(--mb-success);
  font-size: 12px;
  font-weight: 800;
}
.mb-calculator-result__note {
  margin-top: 10px !important;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

/* Results grid */
.mb-results {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}
@media (min-width: 720px) {
  .mb-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.mb-results article {
  min-height: 120px;
  padding: 16px;
  border: 1px solid var(--mb-line);
  border-radius: 16px;
  background: #f8fafd;
}
.mb-results article span,
.mb-results article small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.mb-results article small {
  margin-top: 6px;
  font-size: 11px;
  color: #8a98aa;
  font-weight: 500;
}
.mb-results article strong {
  display: block;
  margin: 8px 0 0;
  color: var(--mb-ink);
  font-size: 20px;
  letter-spacing: -0.04em;
}
.mb-result-green { background: var(--mb-success-soft); border-color:#ccefdc; }
.mb-result-green strong { color: var(--mb-success); }
.mb-result-coral { background:#fff6f3; border-color:#ffe1d8; }
.mb-result-coral strong { color:#d85b46; }
.mb-result-blue { background: var(--mb-primary-soft); border-color:#d6e9fc; }
.mb-result-blue strong { color:#2876bf; }
.mb-result-purple { background:#f7f2ff; border-color:#e8dbff; }
.mb-result-purple strong { color:#7953b7; }
.mb-wide { grid-column: 1/-1; }
.mb-result-highlight {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: center;
  background: #f7f9fc !important;
  border: 1px solid var(--mb-line) !important;
  color: #111827 !important;
  padding: 18px;
  word-break: keep-all;
}
.mb-result-highlight span,
.mb-result-highlight small {
  color: #596579 !important;
}
.mb-result-highlight strong,
.mb-result-highlight .mb-amount,
.mb-result-highlight b {
  color: #047857 !important;
  font-size: clamp(28px, 5.5vw, 44px) !important;
  font-weight: 800 !important;
  text-align: left !important;
  letter-spacing: -0.06em;
  line-height: 1.15;
}
@media (min-width: 720px) {
  .mb-result-highlight {
    grid-template-columns: 1fr auto;
  }
  .mb-result-highlight strong,
  .mb-result-highlight .mb-amount,
  .mb-result-highlight b {
    text-align: right !important;
    font-size: clamp(32px, 5vw, 48px) !important;
  }
}

/* chartSection card wrapper + spacing for FIRE */
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 12px !important;
  padding: 20px !important;
  margin-bottom: 24px !important;
  overflow: visible !important;
  height: auto !important;
/* FIRE calculator chart card + chartSection - consolidated */
.mb-calculator--fire #chartSection {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 12px !important;
  padding: 20px !important;
  margin-bottom: 24px !important;
  overflow: visible !important;
  height: auto !important;
}
.mb-calculator--fire #chartSection .mb-section-heading {
  min-height: 0 !important;
  height: auto !important;
  margin-bottom: 8px !important;
}
.mb-calculator--fire #chartSection .mb-help {
  margin-top: 0 !important;
  margin-bottom: 10px !important;
}
.mb-calculator--fire #chartSection .mb-help::after {
  content: " (X축: 연도, Y축: 자산 금액)";
  color: #9ca3af;
  font-size: 11px;
}
.mb-calculator--fire #chartSection #fireChart {
  margin-top: 0 !important;
  display: block !important;
}
.mb-calculator--fire #chartSection::after {
  content: "예상 자산: 파란 실선 | 목표 FIRE 자산: 빨간 점선";
  display: block;
  text-align: center;
  font-size: 12px;
  color: #596579;
  margin-top: 8px;
}
.mb-calculator--fire .mb-chart-card {
  height: auto !important;
  min-height: 380px !important;
  margin-bottom: 24px !important;
  overflow: visible !important;
  position: relative !important;
  contain: none !important;
}
.mb-calculator--fire .mb-chart-card canvas {
  height: 320px !important;
  width: 100% !important;
  max-width: 100% !important;
  max-height: 320px !important;
  position: relative !important;
}
.mb-calculator--fire #chartSection .mb-section-heading {
  min-height: 0 !important;
  height: auto !important;
  margin-bottom: 8px !important;
}
.mb-calculator--fire #chartSection .mb-help {
  margin-top: 0 !important;
  margin-bottom: 10px !important;
}
.mb-calculator--fire #chartSection .mb-help::after {
  content: " (X축: 연도, Y축: 자산 금액)";
  color: #9ca3af;
  font-size: 11px;
}
.mb-calculator--fire #chartSection #fireChart {
  margin-top: 0 !important;
  display: block !important;
}
.mb-calculator--fire #chartSection::after {
  content: "예상 자산: 파란 실선 | 목표 FIRE 자산: 빨간 점선";
  display: block;
  text-align: center;
  font-size: 12px;
  color: #596579;
  margin-top: 8px;
}
.mb-calculator--fire #chartSection .mb-help::after {
  content: " (X축: 연도, Y축: 자산 금액)";
  color: #9ca3af;
  font-size: 11px;
}



