:root {
  --bg: #f3f7f5;
  --surface: #ffffff;
  --text: #172123;
  --muted: #4f6468;
  --line: #d8e5e3;
  --primary: #0f9d8a;
  --invested: #0f9d8a;
  --interest: #f59e0b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 15%, #dbf4ef 0, transparent 30%),
    radial-gradient(circle at 85% 5%, #d9eaff 0, transparent 27%),
    var(--bg);
}

.wrap {
  width: min(1100px, 92%);
  margin: 0 auto;
}

.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(8px);
}

.topbar .wrap {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.home-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
  padding: 2rem 0 3rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 10px 28px rgba(10, 18, 25, 0.08);
}

h2 {
  margin: 0 0 0.4rem;
  font-size: 1.35rem;
}

.muted {
  color: var(--muted);
  margin-top: 0;
}

.mode-switch {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.mode-btn {
  border: 1px solid #bfe4de;
  background: #f3fbf8;
  color: #0f6a5f;
  border-radius: 10px;
  padding: 0.55rem 0.6rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.mode-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.field {
  margin-top: 1rem;
  padding: 0.95rem;
  background: #f8fbfa;
  border: 1px solid #e2ecea;
  border-radius: 12px;
}

.field-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  font-weight: 700;
  font-size: 0.95rem;
}

input[type="range"] {
  width: 100%;
  margin-top: 0.9rem;
  accent-color: var(--primary);
}

.hidden {
  display: none;
}

.summary {
  display: grid;
  gap: 0.8rem;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
}

.metric p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.metric strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.2rem;
}

.metric.total {
  background: #ecfdf8;
  border-color: #b8efe2;
}

.chart-card {
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
}

.chart {
  width: 200px;
  height: 200px;
  margin: 0 auto;
  border-radius: 50%;
  background: conic-gradient(var(--interest) 0deg, var(--interest) 180deg, var(--invested) 180deg 360deg);
  position: relative;
}

.chart::after {
  content: "";
  position: absolute;
  inset: 25%;
  border-radius: 50%;
  background: var(--surface);
}

.legend {
  margin-top: 0.9rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.legend p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.35rem;
}

.dot.invested {
  background: var(--invested);
}

.dot.interest {
  background: var(--interest);
}

.disclaimer {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

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

  .topbar .wrap {
    flex-direction: column;
    justify-content: center;
    padding: 0.8rem 0;
  }

  .mode-switch {
    grid-template-columns: 1fr;
  }
}
