:root {
  --bg: #0f172a;
  --bg-alt: #134e4a;
  --surface: #1e293b;
  --surface-alt: #27364c;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #34d399;
  --accent-dark: #059669;
  --danger: #f87171;
  --radius: 14px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(160deg, var(--bg) 0%, var(--bg-alt) 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  justify-content: center;
}

.page {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  padding: 20px 16px 12px;
  display: flex;
  flex-direction: column;
}

.brand {
  padding: 8px 4px 20px;
}

.brand-mark {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--accent);
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

h1 {
  margin: 0 0 4px;
  font-size: 26px;
  line-height: 1.2;
}

.subtitle {
  margin: 0 0 24px;
  color: var(--text-muted);
  font-size: 15px;
}

form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 12px;
}

input {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: var(--surface-alt);
  color: var(--text);
}

input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

button {
  cursor: pointer;
  border: none;
  font-family: inherit;
}

#submit-btn {
  margin-top: 22px;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 10px;
  background: var(--accent);
  color: #052e1f;
}

#submit-btn:active {
  background: var(--accent-dark);
}

.error {
  color: var(--danger);
  font-size: 14px;
  margin: 14px 0 0;
}

.link-btn {
  background: none;
  color: var(--text-muted);
  font-size: 14px;
  padding: 0 0 16px;
}

#result-headline {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
}

.result-value {
  margin: 4px 0 0;
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.result-return {
  margin: 4px 0 0;
  font-size: 17px;
  font-weight: 700;
}

.result-return.positive {
  color: var(--accent);
}

.result-return.negative {
  color: var(--danger);
}

.result-note {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.chart-wrap {
  margin-top: 22px;
  height: 260px;
}

.share-btn {
  width: 100%;
  margin-top: 22px;
  padding: 13px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 10px;
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid #334155;
}

.share-feedback {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--accent);
  text-align: center;
}

.site-footer {
  margin-top: auto;
  padding: 28px 4px 8px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.site-footer a {
  color: var(--text-muted);
  font-weight: 700;
  text-decoration: none;
}

@media (min-width: 540px) {
  .page {
    padding-top: 40px;
  }
  h1 {
    font-size: 30px;
  }
  .result-value {
    font-size: 46px;
  }
}
