:root {
  color-scheme: light;
  --ink: #17211b;
  --muted: #66736b;
  --paper: #f5f3ed;
  --card: #fffdf8;
  --accent: #1f7a5a;
  --accent-dark: #15563f;
  --line: #dfe5dc;
  --shadow: 0 24px 70px rgba(32, 53, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top right, #d8eee1 0, transparent 34rem),
    var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(100% - 2rem, 34rem);
  margin: 0 auto;
  padding: 8vh 0 2rem;
}

h1 {
  margin: 0;
  font-size: clamp(2.5rem, 10vw, 4rem);
  letter-spacing: -0.08em;
  line-height: 0.9;
}

.rate-card {
  padding: clamp(1.5rem, 5vw, 3rem);
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  background: var(--card);
  box-shadow: var(--shadow);
}

.card-header {
  margin-bottom: 2rem;
}

.rate-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.rate-meta,
footer {
  color: var(--muted);
}

.rate-value {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.rate-meta {
  font-size: 0.85rem;
}

.amount-label {
  display: block;
  margin-top: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.amount-field {
  display: flex;
  align-items: center;
  margin-top: 0.5rem;
  min-height: 3.25rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: white;
  overflow: hidden;
}

.amount-field input {
  width: 100%;
  min-width: 0;
  padding: 0.8rem 0.9rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1.1rem;
}

.amount-field input:focus {
  outline: 3px solid #9bd4b8;
  outline-offset: -3px;
}

.amount-field span {
  padding: 0 0.9rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.preset-button {
  width: auto;
  margin: 0;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: transparent;
  color: var(--accent-dark);
  font-size: 0.85rem;
}

.preset-button:hover {
  border-color: var(--accent);
  background: #f3f7f1;
  color: var(--accent-dark);
}

.conversion-result {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 1rem;
  min-height: 0;
  margin-top: 0.5rem;
}

.conversion-result strong {
  color: var(--ink);
  font-size: 1.1rem;
}

.conversion-result span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

button {
  width: 100%;
  margin-top: 1.75rem;
  padding: 0.75rem 1rem;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

button:hover {
  background: var(--accent-dark);
}

button:focus-visible {
  outline: 3px solid #9bd4b8;
  outline-offset: 3px;
}

.error {
  margin: 1rem 0 0;
  color: #a43f35;
}

footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: space-between;
  padding: 1rem 0.25rem;
  font-size: 0.8rem;
}

footer a {
  color: var(--accent-dark);
}

.footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.footer-separator {
  color: var(--line);
}

.rate-bridge {
  position: absolute;
  width: 1px;
  height: 1px;
  border: 0;
  clip: rect(0 0 0 0);
}

@media (max-width: 30rem) {
  .shell {
    width: min(100% - 1rem, 48rem);
    padding-top: 1rem;
  }

  .rate-card {
    padding: 1.25rem;
    border-radius: 1.1rem;
  }

  h1 {
    font-size: clamp(2.5rem, 14vw, 4rem);
  }

  footer {
    align-items: center;
    flex-direction: row;
  }
}
