/* Shared comparison styles used by performance, metals-vs-etfs, and diversification pages */

@import url("https://fonts.googleapis.com/css2?family=Instrument+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&display=swap");

/* Shared Chart Type Toggle - High specificity to override theme styles */
#chart-type-toggle-container.chart-type-toggle-container {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  margin-bottom: 15px !important;
  padding: 5px 0 !important;
}

#chart-type-toggle-container .toggle-chart-title {
  font-size: 18px !important;
  color: rgba(255, 255, 255, 0.7) !important;
  text-transform: none !important;
  letter-spacing: 0.5px !important;
  margin-bottom: 4px !important;
  font-weight: 400 !important;
  font-family: "Instrument Sans", sans-serif !important;
  text-align: center !important;
  display: block !important;
  width: auto !important;
}

/* Hidden state - override flex when explicitly hidden */
#chart-type-toggle-container.chart-type-toggle-container[style*="display: none"] {
  display: none !important;
}

#chart-type-toggle-container .chart-type-toggle {
  display: flex !important;
  align-items: center !important;
  gap: 7px !important;
  background: rgba(215, 174, 81, 0.1) !important;
  padding: 5px 10px !important;
  border-radius: 19px !important;
  border: 1.5px solid #d7ae51 !important;
}

#chart-type-toggle-container .chart-toggle-btn {
  background: transparent !important;
  border: none !important;
  color: #d7ae51 !important;
  cursor: pointer !important;
  padding: 4px !important;
  border-radius: 50% !important;
  transition: all 0.3s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: auto !important;
  width: auto !important;
  height: auto !important;
  line-height: 1 !important;
  font-size: inherit !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  box-shadow: none !important;
  margin: 0 !important;
}

#chart-type-toggle-container .chart-toggle-btn svg {
  width: 17px !important;
  height: 17px !important;
  display: block !important;
}

#chart-type-toggle-container .chart-toggle-btn:hover {
  background: rgba(215, 174, 81, 0.2) !important;
  transform: scale(1.1) !important;
  color: #d7ae51 !important;
  border: none !important;
}

#chart-type-toggle-container .chart-toggle-btn.active {
  background: #d7ae51 !important;
  color: #001347 !important;
  border: none !important;
}

#chart-type-toggle-container .toggle-switch {
  width: 38px !important;
  height: 19px !important;
  background: rgba(215, 174, 81, 0.3) !important;
  border-radius: 10px !important;
  position: relative !important;
  cursor: pointer !important;
  transition: background 0.3s ease !important;
  margin: 0 !important;
  padding: 0 !important;
}

#chart-type-toggle-container .toggle-slider {
  width: 15px !important;
  height: 15px !important;
  background: #d7ae51 !important;
  border-radius: 50% !important;
  position: absolute !important;
  top: 2px !important;
  left: 2px !important;
  transform: translateX(19px);
  /* Default position for line chart - no !important so JS can override */
  transition: transform 0.3s ease !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

/* CSS Variables - shared across all tools */
:root {
  --color-primary: #001347;
  --color-secondary: #d7ae51;
  --color-grey: #bfbfbf;
  --color-green: #22c55e;
  --color-red: #ef4444;
  --color-white: #fff;
  --color-black: #000;
}

/* Remove number input spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}

input[type="number"] {
  -moz-appearance: textfield !important;
}

/* Global box-sizing */
* {
  box-sizing: border-box;
}

/* Global heading styles */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Instrument Sans", sans-serif !important;
}

h3 {
  margin-bottom: 20px !important;
}

.pg-section-title {
  font-family: "Instrument Sans", sans-serif !important;
}

/* Shared container styles */
.performance-comparison-container {
  min-height: 100vh;
  font-family: "Instrument Sans";
  max-width: 100%;
  margin: 0;
  gap: 0 !important;
}

.performance-page {
  margin-top: 32px;
  background: transparent !important;
  margin-bottom: 80px;
}

.performance-page .header-section {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 36px;
}

/* Header layout - Left column: Title and Description */
.header-left {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.header-left h1 {
  margin-bottom: 20px !important;
}

.tool-description {
  margin: 0;
  text-align: left;
  max-width: 600px;
}

.tool-description p {
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Header layout - Right column: Navigation Dropdown */
.header-right {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
}

@media (max-width: 768px) {
  .performance-page .header-section {
    flex-direction: column;
    align-items: stretch;
  }

  /* Mobile: show the calculator dropdown above the page title */
  .performance-page .header-section .header-right {
    order: -1;
    margin-top: 0;
    margin-bottom: 20px;
  }

  .pg-nav-dropdown {
    margin-left: 0;
  }

  .tool-description {
    max-width: 100%;
  }
}

/* Shared button styles */
.btn-primary,
.pg-btn-primary,
button.pg-btn-primary {
  background: #d7ae51;
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
  width: 100%;
  /* margin-top: 20px; */
  font-family: "Instrument Sans";
}

.btn-primary:hover,
.pg-btn-primary:hover,
button.pg-btn-primary:hover {
  background: #c09b45;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(215, 174, 81, 0.3);
}

/* Shared input group styles */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  position: relative;
}

.input-group label,
.input-label {
  font-weight: 600;
  color: #374151;
  font-size: 14px;
}

input.input-field,
.input-field {
  padding: 12px 15px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 18px !important;
  font-style: normal !important;
  font-weight: 500 !important;
  line-height: 100% !important;
  text-transform: capitalize !important;
  color: var(--color-primary) !important;
  font-family: "Instrument Sans" !important;
  background: white;
  transition: all 0.3s ease;
}

input.input-field:focus,
.input-field:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(215, 174, 81, 0.1);
}

.investment-input-group {
  position: relative;
  width: 100%;
}

/* Shared currency symbol styles */
.currency {
  font-size: 16px;
  font-style: normal;
  font-weight: 500;
  line-height: 100%;
  text-transform: capitalize;
  margin-bottom: 0px;
  bottom: 7px;
  color: #001347;
  position: absolute;
  font-family: "Instrument Sans";
}

/* Shared loading states */
.preserve-gold-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid #d7ae51;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.pg-loading-state,
.preserve-gold-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: #d7ae51;
  font-size: 16px;
  padding: 40px 20px;
}

/* Loading state is now handled inside #comparison-results */

/* Specific fix for metals vs ETFs loading state centering */
#comparison-results .preserve-gold-loading {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding: 40px 20px !important;
  min-height: 200px !important;
}

#comparison-results .preserve-gold-spinner {
  margin: 0 auto 20px auto !important;
}

/* Shared asset result card styles */
.asset-result-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0px;
  margin-bottom: 40px;
  color: #fff;
  font-size: 14px;
  white-space: normal;
  transition: all 0.3s ease;
  flex: 0 0 calc(50% - 10px);
  box-sizing: border-box;
}

.asset-result-card.gold {
  background: transparent !important;
}

.asset-card-flex {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-left: 8px;
}

.asset-card-title {
  width: 100%;
  flex: 1;
  display: block;
}

/* .asset-card-title {
  font-size: 28px;
  font-style: normal;
  font-weight: 500;
  line-height: 100%;
  text-transform: capitalize;
  color: #d7ae51;
  margin-bottom: 15px;
} */

.asset-main-result {
  margin-bottom: 15px;
}

.asset-main-result-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0px;
}

.asset-main-result-value {
  font-size: 14px;
  font-weight: bold;
  color: #22c55e;
}

.profit-line {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  /* margin-bottom: 8px; */
  font-family: "Instrument Sans";
  text-align: right;
}

.profit-line.positive {
  color: #22c55e;
}

.profit-line.negative {
  color: #ef4444;
}

/* .percentage-line {
  font-size: 16px;
  font-weight: 600;
  text-align: right;
} */

.percentage-line.red {
  color: #ef4444;
}

.reference-text {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 15px;
}

/* Shared chart container styles */
.portfolio-asset-chart-container,
.asset-chart-container {
  background: rgba(52, 73, 94, 0.7);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px;
  min-height: 400px;
  max-height: none;
  /* Allow full height - no constraints */
  height: auto;
  position: relative;
  width: 100%;
  overflow: visible;
  /* Allow chart to display fully */
}

.asset-chart-container:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(52, 73, 94, 0.1);
  border-radius: 10px;
  pointer-events: none;
}

.asset-chart-container svg {
  width: 100%;
  height: auto;
  max-width: 100%;
  min-height: 400px;
  max-height: none;
  /* Allow full height */
}

.asset-chart-container svg>g {
  pointer-events: all;
}

.asset-chart-container svg path.area {
  fill: #87ceeb;
  fill-opacity: 0.3;
  stroke: none;
}

.asset-chart-container svg path.line {
  stroke: #87ceeb;
  stroke-width: 1.8;
  fill: none;
}

.asset-result-card.gold .asset-chart-container svg path.line {
  stroke: #ffd700;
}

.asset-result-card.gold .asset-chart-container svg path.area {
  fill: #ffd700;
}

.chart-area {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
}

.no-data-message {
  color: rgba(255, 255, 255, 0.6);
  font-style: italic;
  text-align: center;
  padding: 40px 20px;
}

/* Shared D3.js Tooltip Styles */
.d3-tooltip {
  position: absolute;
  text-align: center;
  padding: 8px 12px;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  border-radius: 4px;
  pointer-events: none;
  z-index: 1000;
  max-width: 200px;
  word-wrap: break-word;
}

.d3-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: rgba(0, 0, 0, 0.8) transparent transparent transparent;
}

/* Two-column container mappings */

/* Map page-specific left/right columns without changing HTML */
.control-panel,
.preserve-gold-metals-vs-etfs-controls,
.preserve-gold-diversification-controls {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 25px 20px;
  border-right: 1px solid #dee2e6;
  overflow-y: auto;
  height: 100vh;
  position: sticky;
  top: 0;
}

.results-display,
.results-display-style {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  padding: 25px 20px;
  color: #fff;
  overflow-y: auto;
  min-height: 100vh;
}

/* Individual Asset Cards Area */
.individual-asset-cards-area {
  margin-bottom: 20px;
  padding: 10px 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between !important;
  /* gap: 20px; */
}

/* Individual Asset Result Cards */
.asset-stats-grid {
  flex-wrap: wrap;
  display: flex;
  justify-content: space-between;
}

.profit-line {
  margin-right: 5px;
}

.profit-line,
.percentage-line {
  font-family: "Instrument Sans";
  font-size: 14px;
  font-style: normal;
  font-weight: 600;
  line-height: 100%;
}

.profit-line .profit-line.positive {
  color: #22c55e;
}

.profit-line.negative {
  color: #ef4444;
}

.profit-line svg {
  position: relative;
  top: 0;
  left: 0;
}

.profit-line.negative svg {
  top: -1px;
}

.percentage-line {
  color: #22c55e;
}

.percentage-line.red {
  color: #ef4444 !important;
}

/* Duplicate asset-result-card definition removed - using the one above */

.asset-result-card.gold .asset-card-title,
.asset-result-card.gold .asset-stat-value,
.asset-result-card.gold .asset-main-result-value {
  color: #d7ae51;
}

.asset-result-card.gold .asset-card-title {
  text-transform: uppercase;
}

.asset-result-card.gold {
  background: transparent !important;
}

.asset-card-flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-left: 8px;
}

.asset-card-title {
  font-size: 28px;
  font-style: normal;
  font-weight: 500;
  line-height: 100%;
  color: white;
  margin-bottom: 15px;
  width: 100%;
  display: block;
}

.asset-result-card.gold .asset-card-title {
  color: #d7ae51;
}

/* Additional asset card styling */
.asset-result-card:nth-child(2n) {
  margin-right: 0;
}

/* .asset-result-card.gold {
  border-color: #ffd700;
  background: rgba(255, 215, 0, 0.05);
} */

/* .asset-card-title {
  font-size: 1.1rem;
  font-weight: 900;
  color: #fff;
  margin: 0 0 10px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
} */

.asset-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 15px;
}

.asset-stat-item {
  background: rgba(255, 255, 255, 0.1);
  padding: 8px;
  border-radius: 4px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.asset-stat-label {
  font-size: 0.7rem;
  color: #bdc3c7;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.asset-stat-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
}

.asset-main-result {
  text-align: center;
  margin-bottom: 15px;
  padding: 0px;
  background: transparent;
  border-radius: 0;
  border: none;
}

/* Metrics layout - Initial Investment & Change on row 1, Ending Balance on row 2 */
.asset-metrics-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 0 50px;
  margin-bottom: 10px;
}

.metric-column {
  text-align: left;
  min-width: 0;
}

.metric-label {
  font-size: 14px;
  text-transform: capitalize;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  font-weight: 400;
  white-space: nowrap;
}

/* Ending Balance - full width on its own row */
.metric-column:last-child {
  flex: 0 0 100%;
  margin-top: 10px;
}

.metric-column:last-child .metric-label {
  font-size: 20px;
  font-weight: 500;
}

.metric-column:last-child .asset-main-result-value {
  font-size: 36px !important;
  font-weight: 700 !important;
  line-height: 1.1 !important;
}

.initial-investment-value {
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  color: rgba(255, 255, 255, 0.9);
}

/* Golden color for gold assets in metrics */
.asset-result-card.gold .metric-label,
.asset-result-card.gold .asset-main-result-value,
.asset-result-card.gold .initial-investment-value {
  color: #d7ae51 !important;
}

/* Portfolio summary card - full width, always at the bottom */
.portfolio-summary-card {
  border-top: 2px solid rgba(215, 174, 81, 0.4);
  margin-top: 10px !important;
  padding-top: 30px !important;
  width: 100% !important;
  flex-basis: 100% !important;
  order: 9999 !important;
}

.portfolio-summary-card .asset-card-title {
  color: #d7ae51 !important;
}

/* Warning box - shared across calculators */
.warning-box {
  background: transparent;
  border: 1px solid #ffffff;
  border-radius: 8px;
  padding: 15px;
  font-size: 14px;
  color: #ffffff;
}
.warning-box-content {
  display: flex;
  align-items: center;
  gap: 10px;
}
.warning-box-icon {
  font-size: 20px;
  flex-shrink: 0;
}
.warning-box-text {
  flex: 1;
}
.warning-box-text strong {
  color: #ffffff;
  display: block;
  margin-bottom: 5px;
}
.warning-box-text p {
  margin: 5px 0 0 0;
  color: #ffffff;
  font-size: 14px !important;
}
.warning-box-text ul {
  margin: 10px 0 0 20px;
  color: #ffffff;
  list-style-type: disc;
}
.warning-box-text li {
  margin: 5px 0;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 480px) {
  .asset-metrics-row {
    flex-direction: column;
    gap: 8px;
  }

  .metric-column {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    width: 100%;
  }

  .metric-label {
    margin-bottom: 0;
    margin-right: 10px;
  }
}

/* .asset-main-result-value {
  font-size: 1.4rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 3px;
} */

.asset-main-result-label {
  font-size: 0.75rem;
  color: #bdc3c7;
  text-transform: capitalize;
  letter-spacing: 1px;
  font-weight: 600;
}

.asset-chart-container {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
  padding: 10px;
  min-height: 400px;
  max-height: none;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Eagle Logo Placeholder - shows on page load */
.eagle-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 500px;
  width: 100%;
  position: absolute;
  margin: 0 auto;
  text-align: center;
  height: 100%;
  left: 0;
  top: 0;
}

.eagle-placeholder .eagle-logo {
  width: 900px;
  /* height: 900px; */
  height: 100%;
  background: url(../graph-bg.svg) no-repeat center center;
  background-size: contain;
  opacity: 0.8;
  filter: brightness(1.8);
  margin: 0 auto;
  display: block;
}

/* Hide eagle placeholder when content appears */
.eagle-placeholder.hidden {
  display: none;
}

/* Tool Description Overlay */
.eagle-description-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  text-align: center;
  max-width: 80%;
  padding: 20px;
}

.eagle-description-overlay h3 {
  color: inherit !important;
  font-size: 36px !important;

}

/* Responsive eagle logo sizing */
@media (max-width: 480px) {
  .eagle-description-overlay h3 {
    font-size: 30px !important;
  }
}

@media (max-width: 768px) {
  .eagle-placeholder {
    min-height: 400px;
    margin: 0 auto;
    text-align: center;
  }

  .eagle-placeholder .eagle-logo {
    width: 380px;
    height: 450px;
    margin: 0 auto;
    display: block;
  }

  /* Tighter side padding on the calculator description on mobile —
     content uses full width with 30px L/R padding instead of 80% max-width */
  .eagle-description-overlay {
    max-width: 100%;
    width: 100%;
    padding: 20px 30px;
    box-sizing: border-box;
  }
}

@media (min-width: 769px) and (max-width: 1199px) {
  .eagle-placeholder {
    min-height: 450px;
    margin: 0 auto;
    text-align: center;
  }

  .eagle-placeholder .eagle-logo {
    width: 525px;
    height: 525px;
    margin: 0 auto;
    display: block;
  }
}

@media (min-width: 1200px) {
  .eagle-placeholder {
    min-height: 500px;
    margin: 0 auto;
    text-align: center;
  }

  .eagle-placeholder .eagle-logo {
    width: 600px;
    height: 600px;
    margin: 0 auto;
    display: block;
  }
}


/* SVG responsive styles are handled above */

/* Tablet - responsive chart sizes */
@media (min-width: 769px) and (max-width: 1199px) {
  .asset-chart-container {
    min-height: 450px;
    max-height: none;
    height: auto;
    max-width: 100%;
    margin: 0 auto;
  }

  .asset-chart-container svg {
    min-height: 450px;
    max-height: none;
    max-width: 100%;
  }
}

/* Desktop - larger charts for bigger screens */
@media (min-width: 1200px) {
  .asset-chart-container {
    min-height: 500px;
    max-height: none;
    height: auto;
  }

  .asset-chart-container svg {
    min-height: 500px;
    max-height: none;
  }
}

/* Responsive tweaks */
/* @media (max-width: 1400px) {
  .performance-comparison-container,
  .preserve-gold-metals-vs-etfs { grid-template-columns: 320px 1fr; }
} */

/* @media (max-width: 1200px) {
  .performance-comparison-container,
  .preserve-gold-metals-vs-etfs { grid-template-columns: 280px 1fr; }
} */

@media (max-width: 768px) {

  /* .performance-comparison-container,
  .preserve-gold-metals-vs-etfs { grid-template-columns: 1fr; grid-template-rows: auto 1fr; } */
  .preserve-gold-metals-vs-etfs-controls,
  .control-panel {
    height: auto;
    position: static;
    padding: 20px;
  }

  .results-display,
  .results-display-style {
    height: auto;
    padding: 20px;
  }

  .asset-result-card {
    flex: 0 0 100%;
    max-width: 100%;
  }

  /* Center all content when cards stack vertically */
  .asset-card-flex {
    align-items: center;
    padding-left: 0;
  }

  .asset-card-title {
    text-align: center;
  }

  .asset-metrics-row {
    justify-content: center;
  }

  .metric-column {
    text-align: center;
  }

  .asset-chart-container {
    min-height: 350px;
    max-height: none;
    height: auto;
    max-width: 100%;
    margin: 0 auto;
  }

  .asset-chart-container svg {
    min-height: 350px;
    max-height: none;
    max-width: 100%;
  }
}

.preserve-gold-cape-info {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  /* flex-wrap: wrap; */
}

.preserve-gold-cape-info .left-section {
  max-width: 867px;
  width: 100%;
}

.preserve-gold-cape-info .right-content,
.preserve-gold-buffett-info .right-content {
  max-width: 500px;
  width: 100%;
  padding-left: 56px;
}

p {
  font-size: 20px !important;
  font-style: normal;
  font-weight: 400;
  line-height: 150%;
}

.calculate-section {
  display: flex;
  flex-direction: column;
  /* align-items: center; */
  gap: 15px;
  margin-top: 56px;
}

.calculate-section span {
  font-size: 24px;
  font-style: normal;
  font-weight: 700;
  line-height: 100%;
  color: black;
  margin-right: 20px;
  margin-left: 20px;
}

.calculation-date {
  color: black;
  font-size: 24px;
  font-style: normal;
  font-weight: 700;
  line-height: 100%;
  color: black;
}

.calculate-date-value.red {
  font-size: 52px;
  font-style: normal;
  font-weight: 700;
  line-height: 100%;
  color: #c51000;
}

.value-display {
  font-size: 40px;
  font-style: normal;
  font-weight: 700;
  line-height: 100%;
  /* Color will be set dynamically via JavaScript */
}

.flex {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.preserve-gold-buffett-info.flex-container {
  align-items: flex-start !important;
}

.ipad-block {
  display: none;
}

.ipad-none {
  display: block;
}

.flex.ipad-none {
  display: flex !important;
}

.cape-levels h4 {
  color: #000 !important;

  /* text-align: center; */
  font-family: "Instrument Sans" !important;
  font-size: 24px !important;
  font-style: normal !important;
  font-weight: 600 !important;
  line-height: 100%;
}

.green {
  color: #179900 !important;
}

.preserve-gold-cape-info .toggle-content,
.preserve-gold-buffett-info .toggle-content {
  margin-top: 20px;
}

@media (max-width: 1100px) {
  .header-right {
    margin-top: 30px;
  }

  .info-content.ipad-block {
    margin-top: 46px;
  }

  .cape-levels h4 {
    text-align: center !important;
    margin-top: 0 !important;
  }

  .flex.ipad-none {
    display: none !important;
  }

  .ipad-block {
    display: block;
  }

  .ipad-none {
    display: none;
  }

  .toggle-content {
    display: none;
    /* hidden by default */
    margin-top: 10px;
  }

  .toggle-heading.active:before {
    transform: rotate(180deg);
  }

  .toggle-content.active {
    display: block;
    /* show when active */
  }

  /* Cape Shiller + Warren Buffett: always show the About copy on mobile (no accordion) */
  .preserve-gold-cape-info .toggle-content,
  .preserve-gold-buffett-info .toggle-content {
    display: block !important;
  }
  .preserve-gold-cape-info .toggle-heading,
  .preserve-gold-buffett-info .toggle-heading {
    cursor: default;
    pointer-events: none;
  }
  .preserve-gold-cape-info .toggle-heading:before,
  .preserve-gold-buffett-info .toggle-heading:before {
    display: none;
  }

  /* .preserve-gold-cape-info {
    padding-left: 16px;
    padding-right: 16px;
  } */
  .preserve-gold-cape-info .right-content {
    margin-left: 0;
  }

  .preserve-gold-cape-info .left-section {
    max-width: 100%;
    margin-bottom: 46px;
  }

  /* .preserve-gold-cape .info-content {
    padding-left: 16px;
    padding-right: 16px;
  } */
  .preserve-gold-cape-info .right-content,
  .preserve-gold-buffett-info .right-content {
    padding-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .preserve-gold-cape-metrics {
    margin-bottom: 46px !important;
    margin-top: 0 !important;
  }

  .preserve-gold-cape-info h4 {
    color: #001347 !important;
    margin-bottom: 0 !important;
  }

  .preserve-gold-cape-info h4 {
    padding-right: 24px;
  }

  .toggle-content.active {
    margin-top: 10px;
  }

  .toggle-heading {
    position: relative;
    cursor: pointer;
  }

  .toggle-heading:before {
    background: url(../icon-park-outline_down.svg) no-repeat right / 20px;
    width: 20.764px;
    height: 20.886px;
    position: absolute;
    content: "";
    right: 0;
    top: -4px;
  }

  .calculate-date-value.red {
    font-size: 36px !important;
  }

  .value-display {
    font-size: 36px !important;
  }

  /* Buffet */
  /* .pg-tool-selector-container.flex-container {
    padding: 0 16px;
  } */
  .preserve-gold-buffett-info .left-section {
    max-width: 100% !important;
    margin-bottom: 46px;
    /* padding: 0 16px; */
  }

  /* .preserve-gold-buffett .info-content {
    padding: 0 16px;
  } */
  /* .historical-context {
    padding: 0 16px;
  }
  .preserve-gold-buffett-metrics {
    padding: 0 16px;
  }
  .preserve-gold-buffett-analysis {
    padding: 0 16px;
  } */
  .preserve-gold-buffett-info h4 {
    margin-bottom: 0 !important;
    padding-right: 24px;
    color: #001347 !important;
  }

  .historical-context h5 {
    margin-top: 0 !important;
  }

  .pg-tool-selector-container.flex-container {
    margin-bottom: 0 !important;
  }

  .indicator-levels.ipad-none {
    display: none !important;
  }

  .info-content.right-content .calculate-section {
    margin-top: 0 !important;
  }

  .asset-card-flex {
    align-items: center;
    text-align: center;
  }

  .reference-text {
    text-align: center;
  }
}

@media (max-width: 980px) {
  .event-item {
    flex-direction: column;
  }

  .event-result,
  .event-ratio,
  .event-year {
    margin-bottom: 10px;
  }
}

@media (max-width: 480px) {
  .level-item {
    flex-direction: column;
  }

  .profit-line svg {
    width: 12px;
    height: 12px;
  }


  .level-value {
    margin-top: 16px;
  }

  .preserve-gold-cape-info h4,
  .preserve-gold-buffett-info h4 {
    font-size: 18px !important;
  }

  .toggle-content p {
    font-size: 16px !important;
  }

  .calculate-section .flex {
    flex-direction: column;
    justify-content: center;
  }

  .level-label {
    text-align: center;
  }

  .preserve-gold-buffett-metrics {
    display: flex !important;
    gap: 0 !important;
    flex-direction: column;
  }

  .preserve-gold-buffett-analysis {
    gap: 0 !important;
  }
}

.red {
  color: #c51000 !important;
}

.preserve-gold-btn {
  padding: 22px 24px;
  border-radius: 4px;
  background: #001347 !important;
  color: #d7ae51 !important;
  font-family: "Instrument Sans";
  font-size: 24px;
  font-style: normal;
  font-weight: 700;
  line-height: 100%;
  /* 24px */
  text-transform: capitalize;
}

.preserve-gold-btn-primary:hover {
  background: #d7ae51 !important;
  color: #001347 !important;
}

/* ===================================================================
   Purchasing Power Calculator Specific Styles
   =================================================================== */

/* Make input group full width in purchasing power form */
#purchasing-power-form .input-group {
  max-width: none;
}

/* Stack cards vertically - one per row */
.purchasing-power-results .asset-result-card {
  flex: 0 0 100%;
  max-width: 100%;
  margin-bottom: 40px;
}

/* Shield positioning to match Asset Performance layout */
.purchasing-power-results .asset-chart-container {
  overflow: visible !important;
}

/* PP cards are always full-width — keep shield left at all breakpoints */
.purchasing-power-results .asset-chart-container:before {
  left: 23% !important;
  transform: translate(-50%, -50%) !important;
  background-size: 58% !important;
  max-width: 50% !important;
}

/* Asset main result full width */
.purchasing-power-results .asset-main-result {
  width: 100%;
}

/* Metrics row - inherits flex-wrap from shared styles */
.purchasing-power-results .asset-metrics-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0 50px;
  margin-bottom: 10px;
  padding: 0;
}

.purchasing-power-results .metric-column {
  text-align: left;
}

/* Match font sizes from other calculators */
.purchasing-power-results .metric-label {
  font-size: 14px;
  color: #ffffff;
  margin-bottom: 5px;
  font-weight: 400;
}

.purchasing-power-results .initial-investment-value {
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  color: rgba(255, 255, 255, 0.9);
}

.purchasing-power-results .percentage-line {
  font-size: 14px;
  font-weight: 600;
  line-height: 100%;
}

.purchasing-power-results .asset-main-result-value {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.1;
  color: #ffffff;
}

/* Percentage line colors for different scenarios */
.purchasing-power-results .percentage-line {
  color: #22c55e;
}

.purchasing-power-results .percentage-line.green {
  color: #22c55e;
}

.purchasing-power-results .percentage-line.red {
  color: #ef4444;
}

/* USD card - show loss in red */
.asset-result-card.usd .percentage-line {
  color: var(--color-red);
}

.asset-result-card.usd .asset-chart-container svg path.line {
  stroke: #ffffff !important;
}

.asset-result-card.usd .asset-chart-container svg path.area {
  stroke: #ffffff !important;
}

/* Gold card - chart line/area in gold; percentage inherits default green/red */
.asset-result-card.gold .asset-chart-container svg path.line {
  stroke: var(--color-secondary) !important;
}

.asset-result-card.gold .asset-chart-container svg path.area {
  stroke: var(--color-secondary) !important;
}

/* Silver card - show gain in silver color */
.asset-result-card.silver .percentage-line {
  color: #c0c0c0;
}

.asset-result-card.silver .asset-chart-container svg path.line {
  stroke: #c0c0c0 !important;
}

.asset-result-card.silver .asset-chart-container svg path.area {
  stroke: #c0c0c0 !important;
}