/* Compound Interest Calculator Specific Styles */

/* Container */
main.container {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

/* Back Link */
.back-link {
  align-self: flex-start;
  color: #7a5af8;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 1rem;
}

.back-link:hover {
  text-decoration: underline;
}

/* Main Calculator Layout */
.calc-layout {
  display: grid;
  grid-template-columns: 525px 1fr;
  gap: 2rem;
  width: 103%;
  max-width: 1800px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (max-width: 900px) {
  .calc-layout {
    grid-template-columns: 1fr;
  }
}

/* Calculator Card */
.calculator-card {
  background: linear-gradient(135deg, rgba(248, 245, 255, 0.95), rgba(233, 229, 255, 0.92));
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  padding: 2rem;
  border: 1px solid rgba(122, 90, 248, 0.15);
  transition: transform 0.25s ease;
  width: 100%;
  margin: 0 auto;
}

.calculator-card:hover {
  transform: translateY(-2px);
}

/* Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.5rem;
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
    gap: 0.85rem;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.form-group label {
  font-weight: 600;
  color: #333;
  font-size: 0.9rem;
}

.form-group input,
.form-group select {
  border: 1px solid #ddd;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #7a5af8;
  box-shadow: 0 0 0 2px rgba(122, 90, 248, 0.2);
}

.inline-help {
  font-size: 0.8rem;
  color: #6b7280;
}

/* Advanced Options Toggle */
.advanced-options {
  margin-top: 1.5rem;
  border-top: 1px solid rgba(122, 90, 248, 0.15);
  padding-top: 1rem;
}

.advanced-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(122, 90, 248, 0.05);
  border: 1px solid rgba(122, 90, 248, 0.15);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  color: #7a5af8;
  transition: all 0.2s ease;
}

.advanced-toggle:hover {
  background: rgba(122, 90, 248, 0.1);
}

.advanced-toggle .toggle-icon {
  transition: transform 0.3s ease;
}

.advanced-toggle.expanded .toggle-icon {
  transform: rotate(180deg);
}

.advanced-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.advanced-content.expanded {
  max-height: 200px;
  padding-top: 1rem;
}

/* Calculation Assumptions Card */
.assumptions-card {
  background: linear-gradient(135deg, #f5f5f5 0%, #eeeeee 100%);
  border-radius: 12px;
  border: 1px solid #e0e0e0;
  overflow: hidden;
}

.assumptions-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  color: #424242;
}

.assumptions-header::-webkit-details-marker {
  display: none;
}

.assumptions-header::after {
  content: '+';
  margin-left: auto;
  font-size: 1.25rem;
  font-weight: 700;
  color: #757575;
  transition: transform 0.3s ease;
}

.assumptions-card[open] .assumptions-header::after {
  content: '−';
}

.assumptions-icon {
  font-size: 1.25rem;
}

.assumptions-title {
  font-size: 1rem;
  color: #424242;
}

.assumptions-content {
  padding: 0 1.25rem 1.25rem;
  font-size: 0.875rem;
  color: #616161;
  line-height: 1.6;
}

.assumptions-content h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #424242;
  margin: 1rem 0 0.5rem;
}

.assumptions-content h4:first-child {
  margin-top: 0;
}

.assumptions-content p {
  margin: 0.5rem 0;
}

.assumptions-content ul {
  margin: 0.5rem 0;
  padding-left: 1.25rem;
}

.assumptions-content li {
  margin: 0.25rem 0;
}

.assumptions-note {
  background: #E3F2FD;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  color: #1565C0;
  margin: 0.75rem 0;
}

/* Calculate Button */
#calcBtn {
  margin-top: 1.2rem;
  background: linear-gradient(120deg, #b68eff, #7a7df8);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 1rem;
  font-size: 1.05rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.25s ease;
  width: 100%;
}

#calcBtn:hover {
  transform: scale(1.02);
  background: linear-gradient(120deg, #a471ff, #6d68f6);
  box-shadow: 0 6px 25px rgba(182, 142, 255, 0.4);
}

#calcBtn:active {
  transform: scale(0.98);
}

/* Results Section */
#result {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  padding: 0;
  overflow: hidden;
}

.result-header {
  background: linear-gradient(135deg, #9b6bff, #7a5af8);
  color: #fff;
  padding: 1.5rem 2rem;
  font-size: 1.15rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.result-header-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}

.result-header-title span:first-child {
  font-size: 2rem;
}

/* Share Button */
.share-container {
  position: relative;
}

.share-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.share-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

/* Summary Container */
#summary {
  padding: 2rem;
}

/* Metrics Overview */
.metrics-overview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 700px) {
  .metrics-overview {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
}

.metric-large {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, #f8f5ff 0%, #f0ebff 100%);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  border: 1px solid #d4c4fc;
  transition: all 0.3s ease;
}

.metric-large.highlight {
  background: linear-gradient(135deg, #f0ebff 0%, #e8dfff 100%);
  border: 2px solid #b89eff;
  box-shadow: 0 4px 15px rgba(155, 107, 255, 0.2);
}

.metric-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(155, 107, 255, 0.15);
  border-color: #b89eff;
}

.metric-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.metric-content {
  flex: 1;
  min-width: 0;
}

.metric-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: #7a5af8;
  margin-bottom: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: #6b4ce6;
  line-height: 1;
  margin-bottom: 0.2rem;
}

.metric-sublabel {
  font-size: 0.65rem;
  color: #9b6bff;
  font-weight: 500;
}

/* Rule of 72 Card */
.rule-72-card {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 1px solid #fbbf24;
}

.rule-72-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.rule-72-icon {
  font-size: 1.5rem;
}

.rule-72-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #92400e;
}

.rule-72-content p {
  color: #78350f;
  line-height: 1.6;
  margin: 0 0 0.5rem;
}

.rule-72-content p:last-child {
  margin: 0;
}

.rule-72-formula {
  font-size: 0.9rem;
  color: #a16207;
  font-style: italic;
}

/* Growth Breakdown */
.growth-breakdown {
  background: #f9fafb;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.growth-breakdown h3 {
  font-size: 1.1rem;
  color: #1f2937;
  margin: 0 0 1.25rem;
}

.breakdown-bars {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.breakdown-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.breakdown-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: #374151;
}

.breakdown-label span:last-child {
  font-weight: 700;
  color: #1f2937;
}

.breakdown-bar-container {
  height: 24px;
  background: #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}

.breakdown-bar {
  height: 100%;
  border-radius: 12px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.breakdown-bar.initial {
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
}

.breakdown-bar.contributions {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.breakdown-bar.interest {
  background: linear-gradient(90deg, #9b6bff, #b89eff);
}

/* Inflation Section */
.inflation-section {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 1px solid #fecaca;
}

.inflation-section h3 {
  font-size: 1.1rem;
  color: #991b1b;
  margin: 0 0 1rem;
}

.inflation-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.inflation-card {
  background: white;
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
}

.inflation-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #b91c1c;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.inflation-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #991b1b;
}

.inflation-note {
  font-size: 0.75rem;
  color: #dc2626;
  margin-top: 0.25rem;
}

/* Chart Section */
.chart-section {
  width: 100%;
  max-width: 990px;
  margin: 0.6rem auto;
  padding: 0 1.5rem;
}

.chart-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 2rem;
  border: 1px solid #e5e7eb;
}

.chart-card h3 {
  margin: 0 0 1.5rem;
  color: #1f2937;
  font-size: 1.4rem;
}

.chart-container {
  position: relative;
  height: 350px;
}

/* Timeline Section */
.timeline-section {
  width: 100%;
  max-width: 990px;
  margin: 0.6rem auto;
  padding: 0 1.5rem;
}

.timeline-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 2rem;
  border: 1px solid #e5e7eb;
}

.timeline-card h3 {
  margin: 0 0 1.5rem;
  color: #1f2937;
  font-size: 1.4rem;
}

.timeline-table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.timeline-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 400px;
}

.timeline-table th {
  background: linear-gradient(135deg, #9b6bff 0%, #7a5af8 100%);
  color: white;
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.timeline-table th:first-child {
  border-top-left-radius: 10px;
}

.timeline-table th:last-child {
  border-top-right-radius: 10px;
}

.timeline-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
}

.timeline-table tr:hover {
  background: #f9fafb;
}

.timeline-table tr:last-child td:first-child {
  border-bottom-left-radius: 10px;
}

.timeline-table tr:last-child td:last-child {
  border-bottom-right-radius: 10px;
}

.timeline-table tr.milestone {
  background: linear-gradient(135deg, #f8f5ff 0%, #f0ebff 100%);
}

.timeline-table tr.milestone td {
  font-weight: 600;
  color: #7a5af8;
}

/* Comparison Section */
.comparison-section {
  width: 100%;
  max-width: 990px;
  margin: 0.6rem auto;
  padding: 0 1.5rem;
}

.comparison-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 2rem;
  border: 1px solid #e5e7eb;
}

.comparison-card h3 {
  margin: 0 0 0.5rem;
  color: #1f2937;
  font-size: 1.4rem;
}

.comparison-subtitle {
  color: #6b7280;
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .comparison-grid {
    grid-template-columns: 1fr;
  }
}

.comparison-item {
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.comparison-item:hover {
  border-color: #9b6bff;
  transform: translateY(-2px);
}

.comparison-item.current {
  background: linear-gradient(135deg, #f8f5ff 0%, #f0ebff 100%);
  border-color: #9b6bff;
}

.comparison-years {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #b68eff 0%, #7a7df8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.comparison-label {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 1rem;
}

.comparison-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
}

.comparison-item.current .comparison-label::after {
  content: " (Your Plan)";
  color: #9b6bff;
  font-weight: 600;
}

/* Next Steps CTA */
.next-steps-cta.compound {
  margin: 1.5rem 0 0;
  padding: 1.25rem;
  background: linear-gradient(135deg, #f8f5ff 0%, #f0ebff 100%);
  border-radius: 12px;
  border-left: 4px solid #9b6bff;
  text-align: center;
}

.next-steps-cta strong {
  font-weight: 700;
  color: #7a5af8;
}

.next-steps-cta a {
  color: #7a5af8;
  font-weight: 600;
  text-decoration: underline;
  transition: color 0.3s ease;
}

.next-steps-cta a:hover {
  color: #9b6bff;
}

/* Methodology Section */
.methodology-wrapper {
  max-width: 1100px;
  margin: 0.03rem auto 2rem;
  padding: 0 1.5rem;
}

.methodology-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.methodology-banner {
  background: linear-gradient(135deg, #7a5af8, #9b6bff);
  color: #fff;
  padding: 1rem 2rem;
  text-align: center;
  font-weight: 600;
  font-size: 1.05rem;
  border-radius: 14px 14px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.methodology-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  background: white;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1f2937;
  transition: background 0.3s ease;
}

.methodology-toggle:hover {
  background: #f9fafb;
}

.methodology-toggle .icon {
  font-size: 1.25rem;
  transition: transform 0.3s ease;
}

.methodology-toggle.expanded .icon {
  transform: rotate(180deg);
}

.methodology-content {
  padding: 0 2rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease, padding 0.5s ease;
}

.methodology-content.expanded {
  max-height: 5000px;
  padding: 1.5rem 2rem 2rem;
}

.methodology-content h3 {
  color: #1f2937;
  margin: 1.5rem 0 0.75rem;
  font-size: 1.25rem;
}

.methodology-content h3:first-child {
  margin-top: 0;
}

.methodology-content p {
  line-height: 1.7;
  color: #6b7280;
  margin-bottom: 1rem;
}

.methodology-content ul {
  margin: 1rem 0;
  padding-left: 2rem;
}

.methodology-content li {
  line-height: 1.7;
  color: #6b7280;
  margin-bottom: 0.5rem;
}

.formula-box {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  padding: 1.25rem;
  border-radius: 10px;
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  color: #1f2937;
  text-align: center;
  margin: 1rem 0;
  border: 1px solid #d1d5db;
}

/* Scroll Indicators */
.scroll-indicator {
  display: none;
  text-align: center;
  padding: 1.5rem 0 0;
  animation: fadeIn 0.5s ease-in;
}

.scroll-indicator.visible {
  display: block;
}

.scroll-arrow {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
  border-top: 20px solid #9b6bff;
  animation: bounce 2s infinite, pulse 2s infinite;
  filter: drop-shadow(0 0 8px rgba(155, 107, 255, 0.6));
}

.scroll-text {
  margin-top: 0.5rem;
  color: #9b6bff;
  font-weight: 600;
  font-size: 0.9rem;
}

.methodology-scroll-indicator {
  display: none;
  text-align: center;
  padding: 0;
  margin-top: -1.5rem;
  margin-bottom: -1.5rem;
  animation: fadeIn 0.5s ease-in;
}

.methodology-scroll-indicator.visible {
  display: block;
}

.methodology-scroll-arrow {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
  border-top: 20px solid #9b6bff;
  animation: bounce 2s infinite, pulse 2s infinite;
  filter: drop-shadow(0 0 8px rgba(155, 107, 255, 0.6));
}

.methodology-scroll-text {
  margin-top: 0.5rem;
  color: #9b6bff;
  font-weight: 600;
  font-size: 0.9rem;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@media (min-width: 900px) {
  .scroll-indicator,
  .methodology-scroll-indicator {
    display: none;
  }
}

/* SEO Content */
.seo-content {
  line-height: 1.8;
}

.seo-content h2 {
  font-size: 2rem;
  color: #1f2937;
  margin: 2.5rem 0 1rem;
}

.seo-content h3 {
  font-size: 1.5rem;
  color: #1f2937;
  margin: 2rem 0 1rem;
}

.seo-content h4 {
  font-size: 1.25rem;
  color: #374151;
  margin: 1.5rem 0 0.75rem;
}

.seo-content p {
  margin-bottom: 1.25rem;
  color: #4b5563;
}

.seo-content ul,
.seo-content ol {
  margin: 1rem 0 1.5rem 2rem;
  color: #4b5563;
}

.seo-content li {
  margin-bottom: 0.75rem;
  line-height: 1.7;
}

/* FAQ Section */
.faq-grid {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0;
}

.faq-item {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.faq-item:hover {
  border-color: #9b6bff;
  box-shadow: 0 4px 15px rgba(155, 107, 255, 0.1);
}

.faq-item summary {
  font-weight: 700;
  color: #1f2937;
  font-size: 1.05rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  font-size: 1.5rem;
  font-weight: 700;
  color: #9b6bff;
  transition: transform 0.3s ease;
}

.faq-item[open] summary::after {
  content: '−';
}

.faq-item p {
  margin: 1rem 0 0;
  line-height: 1.7;
  color: #6b7280;
}

/* Related Block */
.related-block {
  max-width: 1100px;
  margin: 3rem auto;
  padding: 2rem 1.5rem;
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  border-radius: 16px;
}

.related-block h2 {
  text-align: center;
  font-size: 1.75rem;
  color: #1f2937;
  margin-bottom: 2rem;
}

.related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 700px) {
  .related-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.related-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.related-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.card-title {
  font-size: 1.1rem;
  color: #1f2937;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-icon {
  width: 24px;
  height: 24px;
  color: #9b6bff;
}

.related-card p {
  font-size: 0.95rem;
  color: #6b7280;
  line-height: 1.6;
  margin: 0;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1f2937;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s ease;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast svg {
  flex-shrink: 0;
  color: #9b6bff;
}

/* ===================================
   COMPREHENSIVE MOBILE OPTIMIZATION
   ==================================== */

@media (max-width: 900px) {
  main.container {
    padding: 1rem 0.75rem;
    margin: 1rem auto;
  }

  .calc-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    padding: 0 0.75rem;
  }

  .calculator-card,
  #result {
    padding: 1.5rem;
    border-radius: 18px;
  }

  #summary {
    padding: 1.5rem;
  }

  .chart-section,
  .timeline-section,
  .comparison-section {
    padding: 0 0.75rem;
  }

  .chart-card,
  .timeline-card,
  .comparison-card {
    padding: 1.5rem;
  }

  .chart-container {
    height: 280px;
  }

  .methodology-wrapper {
    padding: 0 0.75rem;
  }

  .methodology-toggle {
    padding: 1.25rem 1.5rem;
  }

  .methodology-content {
    padding: 1.25rem 1.5rem 1.5rem 1.5rem;
  }
}

@media (max-width: 640px) {
  main.container {
    padding: 0.75rem 0.5rem;
    gap: 1.5rem;
  }

  .calc-layout {
    padding: 0 0.5rem;
    gap: 1.25rem;
  }

  .calculator-card {
    position: static;
    padding: 1.25rem;
  }

  #result {
    padding: 0;
  }

  .result-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
  }

  .result-header-title {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.15rem;
  }

  #summary {
    padding: 1.25rem;
  }

  .metrics-overview {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
  }

  .metric-large {
    padding: 0.65rem 0.75rem;
    gap: 0.5rem;
  }

  .metric-icon {
    font-size: 1.25rem;
  }

  .metric-label {
    font-size: 0.6rem;
  }

  .metric-value {
    font-size: 1.1rem;
  }

  .metric-sublabel {
    font-size: 0.55rem;
  }

  .rule-72-card {
    padding: 1.25rem;
  }

  .rule-72-title {
    font-size: 1rem;
  }

  .growth-breakdown {
    padding: 1.25rem;
  }

  .growth-breakdown h3 {
    font-size: 1rem;
  }

  .breakdown-label {
    font-size: 0.8rem;
  }

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

  .result-header .share-container {
    width: auto;
  }

  .share-btn {
    padding: 0.45rem 0.85rem;
    font-size: 0.85rem;
  }

  .share-menu {
    right: 0;
    left: auto;
    min-width: 200px;
  }

  .next-steps-cta.compound {
    padding: 1.25rem;
    font-size: 0.9rem;
  }

  .chart-section,
  .timeline-section,
  .comparison-section {
    padding: 0 0.5rem;
    margin: 1.5rem auto;
  }

  .chart-card,
  .timeline-card,
  .comparison-card {
    padding: 1.25rem;
  }

  .chart-card h3,
  .timeline-card h3,
  .comparison-card h3 {
    font-size: 1.2rem !important;
    margin-bottom: 1.25rem !important;
  }

  .chart-container {
    height: 250px;
  }

  .timeline-table th,
  .timeline-table td {
    padding: 0.65rem 0.5rem;
    font-size: 0.8rem;
  }

  .comparison-grid {
    gap: 1rem;
  }

  .comparison-item {
    padding: 1.25rem;
  }

  .comparison-years {
    font-size: 2rem;
  }

  .comparison-value {
    font-size: 1.25rem;
  }

  .methodology-wrapper {
    padding: 0 0.5rem;
  }

  .methodology-banner {
    padding: 0.85rem 1.5rem;
    font-size: 0.95rem;
  }

  .methodology-toggle {
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
  }

  .methodology-content {
    padding: 1rem 1.25rem 1.25rem 1.25rem;
  }

  .methodology-content h3 {
    font-size: 1rem;
  }

  .methodology-content p,
  .methodology-content li {
    font-size: 0.9rem;
  }

  .formula-box {
    font-size: 0.85rem;
    padding: 1rem;
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
    gap: 0.85rem;
  }

  .form-group label {
    font-size: 0.85rem;
  }

  .form-group input,
  .form-group select {
    padding: 0.65rem 0.85rem;
    font-size: 0.95rem;
  }

  .inline-help {
    font-size: 0.75rem;
  }

  #calcBtn {
    padding: 0.9rem;
    font-size: 1rem;
    margin-top: 1rem;
  }

  .advanced-toggle {
    font-size: 0.9rem;
    padding: 0.65rem 0.85rem;
  }
}
