.mvi-root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #083141;
  max-width: 1000px;
  margin: 0 auto 3rem;
  padding: 1rem;
  box-sizing: border-box;
}

.mvi-loading {
  padding: 1rem;
  background: #f0f8ff;
  border-radius: 10px;
  border: 1px solid #d1e7dd;
  text-align: center;
}

.mvi-header {
  margin-bottom: 1.5rem;
}

.mvi-title {
  margin: 0 0 0.25rem;
  font-size: 1.8rem;
}

.mvi-subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: #35515d;
}

.mvi-inputs {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.mvi-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #d1e7dd;
  padding: 1rem 1.2rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.03);
}

.mvi-card-title {
  margin: 0 0 0.25rem;
  font-size: 1.2rem;
}

.mvi-card-intro {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: #486571;
}

.mvi-grid-1,
.mvi-grid-2,
.mvi-grid-3 {
  display: grid;
  gap: 0.75rem 1rem;
}

.mvi-grid-1 {
  grid-template-columns: minmax(0, 1fr);
}

.mvi-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mvi-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 800px) {
  .mvi-grid-2,
  .mvi-grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
}

.mvi-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mvi-label {
  font-size: 0.85rem;
  font-weight: 600;
}

.mvi-input {
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  padding: 0.4rem 0.55rem;
  font-size: 0.9rem;
  width: 100%;
  box-sizing: border-box;
}

.mvi-input:focus {
  outline: none;
  border-color: #59747c;
  box-shadow: 0 0 0 1px rgba(89,116,124,0.3);
}

/* Money inputs with £ symbol */
.mvi-field-wrapper-money {
  position: relative;
}

.mvi-field-wrapper-money .mvi-input {
  padding-left: 1.5rem;
}

.mvi-field-wrapper-money::before {
  content: '£';
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 600;
  color: #64748b;
  pointer-events: none;
  font-size: 0.9rem;
}

/* Percentage inputs with % symbol */
.mvi-field-wrapper-pct {
  position: relative;
}

.mvi-field-wrapper-pct .mvi-input {
  padding-right: 1.8rem;
}

.mvi-field-wrapper-pct::after {
  content: '%';
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 600;
  color: #64748b;
  pointer-events: none;
  font-size: 0.9rem;
}

.mvi-help {
  font-size: 0.75rem;
  color: #64748b;
}

/* Summary */

.mvi-summary {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f0f8ff 0%, #e8f4f8 100%);
  border-radius: 16px;
  border: 2px solid #d1e7dd;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.mvi-summary-title {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: #083141;
  text-align: center;
}

.mvi-verdict-banner {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
  line-height: 1.5;
}

.mvi-summary-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 800px) {
  .mvi-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.mvi-summary-card {
  background: #ffffff;
  border-radius: 14px;
  border: 2px solid #e2f0f3;
  padding: 1.25rem;
  position: relative;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.mvi-summary-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.mvi-summary-card.mvi-winner {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  border: 3px solid #28a745;
  box-shadow: 0 8px 20px rgba(40, 167, 69, 0.2);
}

.mvi-winner-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  padding: 6px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
  z-index: 10;
}

.mvi-summary-heading {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #083141;
}

.mvi-big-number {
  font-size: 2.25rem;
  font-weight: 800;
  color: #083141;
  margin: 0.5rem 0 0.25rem;
  line-height: 1.1;
}

.mvi-summary-sublabel {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 500;
}

.mvi-wealth-breakdown {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 0.75rem;
  margin: 1rem 0;
  border: 1px solid #e9ecef;
}

.mvi-breakdown-title {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #495057;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mvi-breakdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid #e9ecef;
  font-size: 0.85rem;
}

.mvi-breakdown-item:last-child {
  border-bottom: none;
}

.mvi-breakdown-label {
  color: #495057;
  font-weight: 500;
}

.mvi-breakdown-value {
  color: #083141;
  font-weight: 600;
  text-align: right;
}

.mvi-breakdown-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0 0;
  margin-top: 0.5rem;
  border-top: 2px solid #28a745;
  font-size: 0.9rem;
  font-weight: 700;
}

.mvi-highlight {
  color: #28a745 !important;
  font-size: 0.95rem !important;
}

.mvi-summary-stats {
  margin: 1rem 0 0.5rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.mvi-summary-stats p {
  margin: 0.35rem 0;
  font-size: 0.85rem;
  color: #495057;
}

.mvi-summary-line {
  margin: 0.15rem 0;
  font-size: 0.85rem;
}

.mvi-summary-footnote {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 600;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 6px;
}

.mvi-verdict {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
}

/* Table */

.mvi-table-wrap {
  margin-top: 1.2rem;
}

.mvi-table-title {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.mvi-table-note {
  margin: 0.5rem 0 0.75rem;
  padding: 0.75rem;
  background: #fff3cd;
  border-left: 4px solid #ffc107;
  border-radius: 6px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #856404;
}

.mvi-mortgage-clear {
  background: #d4edda !important;
  font-weight: 700;
  color: #155724;
}

.mvi-table-scroller {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid #e2f0f3;
  background: #ffffff;
}

.mvi-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.mvi-table th,
.mvi-table td {
  padding: 0.4rem 0.5rem;
  text-align: right;
  border-bottom: 1px solid #eef2f7;
}

.mvi-table th:first-child,
.mvi-table td:first-child {
  text-align: left;
}

.mvi-table thead {
  background: #ebf2f4;
  position: sticky;
  top: 0;
  z-index: 1;
}

/* Assumptions Section */

.mvi-assumptions {
  margin-top: 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  border-radius: 16px;
  border: 2px solid #ffc107;
  box-shadow: 0 6px 20px rgba(255, 193, 7, 0.15);
}

.mvi-assumptions-title {
  margin: 0 0 1.25rem;
  font-size: 1.4rem;
  font-weight: 700;
  color: #856404;
  text-align: center;
}

.mvi-assumptions-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 800px) {
  .mvi-assumptions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.mvi-assumption-section {
  background: white;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  border: 1px solid #ffc107;
}

.mvi-assumption-section.mvi-full-width {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  border: 2px solid #28a745;
}

.mvi-assumption-section h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  color: #083141;
}

.mvi-assumption-section ul {
  margin: 0;
  padding-left: 1.25rem;
  list-style: none;
}

.mvi-assumption-section li {
  margin: 0.5rem 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #495057;
  position: relative;
  padding-left: 0.5rem;
}

.mvi-assumption-section li::before {
  content: '';
  position: absolute;
  left: -1rem;
  top: 0.5rem;
  width: 6px;
  height: 6px;
  background: #28a745;
  border-radius: 50%;
}

.mvi-assumption-section p {
  margin: 0.75rem 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #495057;
}

.mvi-advice {
  background: rgba(255, 255, 255, 0.8);
  padding: 1rem;
  border-radius: 10px;
  border-left: 4px solid #28a745;
  margin-top: 1rem;
  font-size: 0.95rem !important;
  line-height: 1.6 !important;
}

.mvi-disclaimer {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: rgba(220, 53, 69, 0.1);
  border-radius: 10px;
  border: 2px solid #dc3545;
}

.mvi-disclaimer p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #721c24;
}

/* Table Enhancements */

.mvi-table tbody tr:nth-child(odd) {
  background: #f8f9fa;
}

.mvi-table tbody tr:hover {
  background: #e9ecef;
  cursor: default;
}

.mvi-table tbody tr:last-child {
  background: #fff3cd;
  font-weight: 700;
  border-top: 2px solid #ffc107;
}

/* Print */

@media print {
  .mvi-root {
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-shadow: none;
  }

  .mvi-header {
    margin-bottom: 0.5rem;
  }

  .mvi-inputs {
    page-break-after: always;
  }

  .mvi-card {
    box-shadow: none;
    border: 1px solid #cbd5e1;
  }

  .mvi-winner-badge {
    position: static;
    transform: none;
    display: inline-block;
    margin-bottom: 0.5rem;
  }
}
