.compound-interest-page,
.compound-interest-page *,
.compound-interest-page *::before,
.compound-interest-page *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.compound-interest-page * {
  margin: 0;
  padding: 0;
}

/* Hide portal floating icon */
.gh-portal-triggerbtn-iframe {
  display: none;
}

:root {
  --bg: #0d0f0e;
  --surface: #161918;
  --surface2: #1e2221;
  --border: rgba(255, 255, 255, 0.07);
  --border2: rgba(255, 255, 255, 0.12);
  --text: #e8ede9;
  --muted: #7a8a7d;
  --accent: #5dca8a;
  --accent2: #3a9e64;
  --accent-dim: rgba(93, 202, 138, 0.12);
  --track: #2a2f2b;
  --thumb: #5dca8a;
  --font:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif,
    'Apple Color Emoji', 'Segoe UI Emoji';
  --radius: 12px;
}

.compound-interest-page {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  padding: 3rem 1.5rem;
}

.compound-interest-page .container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

.compound-interest-page .header {
  margin-bottom: 3rem;
}

.compound-interest-page .header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.compound-interest-page .header-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0;
}

.compound-interest-page h1 {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 800;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.compound-interest-page h1 span {
  color: var(--accent);
}

.compound-interest-page .subtitle {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
}

.compound-interest-page .currency-toggle {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 3px;
}

.compound-interest-page .currency-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 5px 12px;
  border-radius: 5px;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}

.compound-interest-page .currency-btn:hover {
  color: var(--text);
}

.compound-interest-page .currency-btn.active {
  background: var(--accent);
  color: #0d0f0e;
}

/* --- Metric cards --- */

.compound-interest-page .metrics {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 2rem;
}

.compound-interest-page .metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  overflow: hidden;
}

.compound-interest-page .metric.accent-card {
  background: var(--accent-dim);
  border-color: rgba(93, 202, 138, 0.2);
}

.compound-interest-page .metric-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 400;
}

.compound-interest-page .metric-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.compound-interest-page .metric.accent-card .metric-value {
  color: var(--accent);
}

.compound-interest-page .metric-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

/* --- Chart --- */

.compound-interest-page .chart-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.compound-interest-page .chart-title {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

.compound-interest-page .chart-canvas-wrap {
  position: relative;
  width: 100%;
  height: 220px;
}

.compound-interest-page .legend {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
}

.compound-interest-page .legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}

.compound-interest-page .legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

/* --- Controls --- */

.compound-interest-page .controls {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.compound-interest-page .controls-title {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.compound-interest-page .slider-group {
  margin-bottom: 1.5rem;
}

.compound-interest-page .slider-group:last-child {
  margin-bottom: 0;
}

.compound-interest-page .slider-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.compound-interest-page .slider-label {
  font-size: 13px;
  color: var(--muted);
}

.compound-interest-page .slider-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

.compound-interest-page input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--track);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.compound-interest-page input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--thumb);
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(93, 202, 138, 0.2);
  transition: box-shadow 0.15s;
}

.compound-interest-page input[type='range']::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 5px rgba(93, 202, 138, 0.3);
}

.compound-interest-page input[type='range']::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--thumb);
  cursor: pointer;
  border: none;
}

/* --- Table --- */

.compound-interest-page .table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2rem;
}

.compound-interest-page .table-title {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.compound-interest-page table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.compound-interest-page thead th {
  text-align: right;
  padding: 8px 1.5rem;
  color: var(--muted);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.08em;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}

.compound-interest-page thead th:first-child {
  text-align: left;
}

.compound-interest-page tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

.compound-interest-page tbody tr:last-child {
  border-bottom: none;
}

.compound-interest-page tbody tr:hover {
  background: var(--surface2);
}

.compound-interest-page tbody td {
  padding: 10px 1.5rem;
  text-align: right;
  color: var(--text);
}

.compound-interest-page tbody td:first-child {
  text-align: left;
  color: var(--muted);
}

.compound-interest-page tbody td.highlight {
  color: var(--accent);
  font-weight: 600;
}

/* --- Footer --- */

.compound-interest-page .footer {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  letter-spacing: 0.05em;
}

/* --- Responsive --- */

@media (max-width: 480px) {
  .compound-interest-page .metrics {
    grid-template-columns: 1fr 1fr;
  }

  .compound-interest-page .metrics .metric:nth-child(3) {
    grid-column: 1 / -1;
  }
}
