.fvc-wrap {
  --fvc-ink: #1f2937;
  --fvc-muted: #6b7280;
  --fvc-line: #e2eaee;
  --fvc-soft: #f6fafc;
  --fvc-card: #fff;
  --fvc-brand: #6e8f9f;
  --fvc-brand-dark: #4e7080;
  --fvc-brand-light: #8bb0c1;
  --fvc-positive: #4f9f7a;
  --fvc-gold: #c4a35a;
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px;
  color: var(--fvc-ink);
  font-family: inherit;
}

.fvc-wrap * { box-sizing: border-box; }
.fvc-shell { display: flex; flex-direction: column; gap: 20px; }
.fvc-panel { min-width: 0; overflow: hidden; background: var(--fvc-card); border: 1px solid var(--fvc-line); border-radius: 16px; box-shadow: 0 10px 26px rgba(17, 24, 39, .06); }
.fvc-panel-head, .fvc-results-head { padding: 18px 18px 9px; }
.fvc-title { margin: 0; color: #23303a; font-size: clamp(22px, 3vw, 27px); line-height: 1.2; }
.fvc-subtitle, .fvc-results-summary { margin: 6px 0 0; color: var(--fvc-muted); font-size: 13px; }
.fvc-results-title { margin: 0; color: #23303a; font-size: 20px; }

.fvc-currency-buttons { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; padding: 10px 18px 6px; }
.fvc-currency-btn { padding: 10px 0; cursor: pointer; border: 1px solid #dce6eb; border-radius: 12px; background: var(--fvc-soft); color: #22313a; font-size: 21px; font-weight: 900; transition: background .15s, border-color .15s, transform .05s; }
.fvc-currency-btn:active { transform: translateY(1px); }
.fvc-currency-btn.is-active { color: #fff; border-color: var(--fvc-brand); background: var(--fvc-brand); }

.fvc-form { padding: 10px 18px 18px; }
.fvc-form-grid { display: grid; gap: 14px; }
.fvc-form-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fvc-field { min-width: 0; margin: 7px 0; }
.fvc-field label { display: block; margin-bottom: 6px; color: #22313a; font-size: 13px; font-weight: 800; }
.fvc-input-row { display: flex; align-items: stretch; gap: 9px; width: 100%; }
.fvc-prefix, .fvc-suffix { display: flex; flex: 0 0 auto; align-items: center; justify-content: center; min-width: 44px; padding: 10px 12px; border: 1px solid #dce6eb; border-radius: 12px; background: var(--fvc-soft); color: #22313a; font-weight: 900; }
.fvc-input-row input { flex: 1 1 auto; min-width: 0; }
.fvc-wrap input[type="number"], .fvc-wrap input[type="date"], .fvc-wrap select { width: 100%; min-width: 0; padding: 12px; border: 1px solid #dce6eb; border-radius: 12px; outline: none; background: #fdffff; color: #111827; font: inherit; font-size: 16px; }
.fvc-wrap input:focus, .fvc-wrap select:focus, .fvc-wrap button:focus-visible, .fvc-wrap summary:focus-visible { outline: 3px solid rgba(110, 143, 159, .28); outline-offset: 2px; border-color: var(--fvc-brand); }
.fvc-term-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fvc-under-label { display: block; margin-top: 4px; color: var(--fvc-muted); font-size: 11px; text-align: center; }
.fvc-divider { height: 1px; margin: 13px 0; background: #eef3f6; }
.fvc-section-title { margin: 3px 0 5px; color: #22313a; font-weight: 900; }
.fvc-field-help { margin: 6px 2px 0; color: var(--fvc-muted); font-size: 11px; line-height: 1.45; }
.fvc-compounding-field.is-disabled { opacity: .68; }
.fvc-compounding-field.is-disabled select { cursor: not-allowed; background: #f0f3f5; }

.fvc-advanced { margin: 16px 0 8px; border: 1px solid var(--fvc-line); border-radius: 14px; background: var(--fvc-soft); }
.fvc-advanced summary, .fvc-assumptions summary { padding: 13px 15px; cursor: pointer; color: #29404c; font-weight: 850; }
.fvc-advanced-body { padding: 0 15px 12px; }
.fvc-error { margin-top: 12px; padding: 10px 12px; border: 1px solid #efb6b6; border-radius: 10px; background: #fff3f3; color: #9b1c1c; font-size: 13px; font-weight: 700; }

.fvc-actions { margin-top: 16px; }
.fvc-actions-row { display: flex; gap: 10px; margin-top: 10px; }
.fvc-btn { flex: 1 1 auto; padding: 12px 14px; cursor: pointer; border: 1px solid #dce6eb; border-radius: 14px; background: #fff; color: #22313a; font: inherit; font-size: 14px; font-weight: 800; }
.fvc-btn-primary { width: 100%; padding: 14px; border-color: var(--fvc-brand); background: linear-gradient(180deg, var(--fvc-brand-light), var(--fvc-brand)); color: #fff; font-size: 16px; }
.fvc-btn-light { background: var(--fvc-soft); }
.fvc-reset { width: 100%; margin-top: 10px; background: #fff; }
.fvc-note { margin: 9px 0 0; color: var(--fvc-muted); font-size: 12px; }

.fvc-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; padding: 10px 18px; }
.fvc-kpi { min-width: 0; padding: 13px; border: 1px solid var(--fvc-line); border-radius: 14px; background: #fdffff; }
.fvc-kpi span { display: block; color: var(--fvc-muted); font-size: 10px; font-weight: 900; letter-spacing: .045em; text-transform: uppercase; }
.fvc-kpi strong { display: block; overflow-wrap: anywhere; margin-top: 6px; color: #111827; font-size: clamp(17px, 2vw, 22px); line-height: 1.15; }
.fvc-kpi-primary { border-color: #b8cbd4; background: #f1f7f9; }
.fvc-kpi-primary strong { color: var(--fvc-brand-dark); }

.fvc-formula-box { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 12px; margin: 4px 18px 14px; padding: 13px 15px; border: 1px solid var(--fvc-line); border-radius: 13px; background: var(--fvc-soft); }
.fvc-formula-box > span { color: var(--fvc-muted); font-size: 10px; font-weight: 900; letter-spacing: .045em; text-transform: uppercase; }
.fvc-formula-box strong { color: #29404c; font-size: 15px; }
.fvc-formula-box small { flex: 1 1 100%; color: var(--fvc-muted); font-size: 11px; }

.fvc-viewbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin: 6px 18px 12px; padding: 10px; border: 1px solid var(--fvc-line); border-radius: 14px; background: var(--fvc-soft); }
.fvc-viewbar-label { display: block; margin: 0 0 5px 2px; color: var(--fvc-muted); font-size: 10px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.fvc-view-toggle, .fvc-mini-actions { display: flex; gap: 7px; }
.fvc-view-btn, .fvc-mini-btn { min-width: 72px; padding: 9px 12px; cursor: pointer; border: 1px solid #dce6eb; border-radius: 11px; background: #fff; color: #22313a; font: inherit; font-size: 12px; font-weight: 800; }
.fvc-view-btn.is-active { border-color: var(--fvc-brand); background: var(--fvc-brand); color: #fff; }

.fvc-chart-wrap { margin: 0 18px 12px; padding: 12px; overflow-x: auto; border: 1px solid var(--fvc-line); border-radius: 14px; background: #fff; }
.fvc-chart { display: block; max-width: none; }
.fvc-legend { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 0 0 8px; color: var(--fvc-muted); font-size: 11px; }
.fvc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.fvc-swatch { display: inline-block; width: 18px; height: 3px; border-radius: 2px; background: var(--fvc-brand); }
.fvc-swatch-low { background: #93a8b2; }
.fvc-swatch-high { background: var(--fvc-positive); }
.fvc-swatch-invested { background: var(--fvc-gold); }

.fvc-table-scroll { margin: 0 18px 12px; overflow-x: auto; border: 1px solid var(--fvc-line); border-radius: 14px; }
.fvc-table { width: 100%; min-width: 800px; border-collapse: collapse; font-size: 13px; }
.fvc-table th, .fvc-table td { padding: 10px 12px; border-bottom: 1px solid var(--fvc-line); text-align: right; white-space: nowrap; }
.fvc-table th { position: sticky; top: 0; background: #eef5f7; color: #304650; font-size: 11px; letter-spacing: .025em; text-transform: uppercase; }
.fvc-table th:first-child, .fvc-table td:first-child, .fvc-table th:nth-child(2), .fvc-table td:nth-child(2) { text-align: left; }
.fvc-table tbody tr:nth-child(even) { background: #f9fbfc; }
.fvc-table tbody tr:last-child td { border-bottom: 0; font-weight: 800; }
.fvc-results-empty { margin: 0; padding: 20px; color: var(--fvc-muted); text-align: center; }
.fvc-cards { display: none; padding: 0 18px 10px; }
.fvc-card { margin-bottom: 10px; overflow: hidden; border: 1px solid var(--fvc-line); border-radius: 13px; }
.fvc-card header { display: flex; justify-content: space-between; padding: 10px 12px; background: #eef5f7; color: #304650; }
.fvc-card header span { color: var(--fvc-muted); font-size: 12px; }
.fvc-card dl { margin: 0; padding: 5px 12px; }
.fvc-card dl div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #edf2f4; }
.fvc-card dl div:last-child { border-bottom: 0; }
.fvc-card dt { color: var(--fvc-muted); font-size: 12px; }
.fvc-card dd { margin: 0; font-size: 13px; font-weight: 800; text-align: right; }

.fvc-assumptions { margin: 8px 18px 16px; border-top: 1px solid var(--fvc-line); }
.fvc-assumptions summary { padding-left: 0; font-size: 13px; }
.fvc-assumptions-content { padding: 0 0 12px; color: var(--fvc-muted); font-size: 12px; line-height: 1.55; }
.fvc-view-panel[hidden] { display: none !important; }

@media (max-width: 900px) {
  .fvc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fvc-kpi:first-child { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  .fvc-wrap { padding: 8px 0; }
  .fvc-form-grid-2 { grid-template-columns: 1fr; gap: 2px; }
  .fvc-kpis { grid-template-columns: 1fr; }
  .fvc-kpi:first-child { grid-column: auto; }
  .fvc-viewbar { align-items: stretch; }
  .fvc-viewbar > div { width: 100%; }
  .fvc-view-toggle, .fvc-mini-actions { display: grid; grid-template-columns: repeat(3, 1fr); }
  .fvc-view-toggle { grid-template-columns: repeat(2, 1fr); }
  .fvc-view-btn, .fvc-mini-btn { min-width: 0; }
  .fvc-table-scroll { display: none; }
  .fvc-cards { display: block; }
  .fvc-chart-wrap { padding: 8px; }
}

@media (max-width: 420px) {
  .fvc-currency-buttons { gap: 6px; }
  .fvc-currency-btn { font-size: 18px; }
  .fvc-actions-row { gap: 6px; }
  .fvc-btn { padding-left: 9px; padding-right: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .fvc-wrap * { scroll-behavior: auto !important; transition: none !important; }
}

@media print {
  .fvc-panel-form, .fvc-viewbar, .fvc-actions, .fvc-assumptions { display: none !important; }
  .fvc-panel { border: 0; box-shadow: none; }
  .fvc-table-scroll { display: block; overflow: visible; }
  .fvc-cards { display: none; }
}
