:root {
  color-scheme: light;
  --ink: #183126;
  --muted: #66736b;
  --line: #dfe6df;
  --paper: #ffffff;
  --canvas: #eef2ee;
  --green-950: #123324;
  --green-900: #173e2d;
  --green-700: #23683f;
  --green-600: #318052;
  --green-100: #eaf6ee;
  --amber-800: #8a5200;
  --amber-600: #c47a0a;
  --amber-100: #fff3de;
  --shadow: 0 18px 50px rgba(23, 62, 45, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(49, 128, 82, 0.12), transparent 28rem),
    var(--canvas);
}

button, input { font: inherit; }

.app-shell {
  width: min(100% - 24px, 720px);
  margin: 24px auto 40px;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 28px;
  color: #fff;
  border-radius: 26px;
  background: linear-gradient(135deg, var(--green-950), #2e704f);
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  width: 210px;
  height: 210px;
  right: -95px;
  top: -110px;
  border-radius: 50%;
  border: 36px solid rgba(255, 255, 255, 0.08);
}

.eyebrow, .section-kicker, .card-tag {
  margin: 0;
  font-size: 0.69rem;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero .eyebrow { color: #bde2ca; }
.hero h1 { margin: 8px 0 4px; font-size: clamp(1.65rem, 5vw, 2.35rem); line-height: 1.08; }
.hero > p:last-child { max-width: 500px; margin: 0; color: #d8eadf; }

.input-panel, .result-card, .receive-card {
  margin-top: 14px;
  border-radius: 22px;
  box-shadow: 0 10px 28px rgba(23, 62, 45, 0.07);
}

.input-panel {
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-kicker { color: var(--green-600); }
.section-heading h2, .choice-heading h2 { margin: 4px 0 0; font-size: 1.2rem; }

.reset-button {
  flex: 0 0 auto;
  padding: 9px 12px;
  color: var(--green-700);
  font-size: 0.78rem;
  font-weight: 800;
  border: 1px solid #bcd4c4;
  border-radius: 10px;
  background: #f5faf7;
  cursor: pointer;
}

.reset-button:hover { background: var(--green-100); }
.reset-button:focus-visible, input:focus-visible { outline: 3px solid rgba(49, 128, 82, 0.3); outline-offset: 2px; }

.input-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { min-width: 0; }
.field > span:first-child { display: block; min-height: 2.25em; margin: 0 0 6px; color: #526158; font-size: 0.76rem; line-height: 1.15; font-weight: 800; text-transform: uppercase; letter-spacing: 0.025em; }
.field small { display: block; margin-top: 4px; color: #5f6d64; font-size: 0.69rem; }
.input-control {
  display: flex;
  align-items: center;
  min-height: 48px;
  overflow: hidden;
  border: 1px solid #cfd8d1;
  border-radius: 12px;
  background: #f9fbf9;
}
.input-control:focus-within { border-color: var(--green-600); box-shadow: 0 0 0 3px rgba(49, 128, 82, 0.1); }
.input-control b { padding: 0 11px; color: var(--green-700); font-size: 0.82rem; }
.input-control input { width: 100%; min-width: 0; padding: 12px 10px; color: var(--ink); font-weight: 800; border: 0; outline: 0; background: transparent; }
.input-control input + b { padding-left: 4px; }

.result-card {
  padding: 22px;
  border: 2px solid #4d9a69;
  background: linear-gradient(135deg, #e8f6ed, #f8fcf9);
}
.card-tag { display: inline-block; padding: 6px 10px; color: #fff; border-radius: 999px; background: var(--green-700); }
.result-card h2, .receive-card h2 { margin: 10px 0 12px; font-size: 1.35rem; }

.line-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; color: #536159; font-size: 0.84rem; }
.line-item strong { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; color: var(--ink); text-align: right; }
.line-item strong small { color: var(--muted); font-size: 0.72rem; }

.grand-total {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 7px;
  padding-top: 14px;
  border-top: 1px solid rgba(24, 49, 38, 0.18);
}
.grand-total > span { font-size: 0.76rem; font-weight: 900; letter-spacing: 0.035em; }
.grand-total strong { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-end; gap: 6px; color: var(--green-700); font-size: clamp(1.45rem, 5vw, 1.9rem); text-align: right; }
.grand-total small { font-size: 0.72rem; }

.choice-heading { padding: 26px 8px 3px; text-align: center; }
.choice-heading p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 0.85rem; }

.receive-card { padding: 22px; }
.receive-card .card-description { margin: -4px 0 16px; font-size: 0.83rem; }
.card-values { padding: 4px 14px 14px; border-radius: 15px; background: rgba(255, 255, 255, 0.72); }
.money-card { border: 2px solid #4d9a69; background: var(--green-100); }
.money-card h2 { color: #195032; }
.bonus-card { border: 2px solid #dea13a; background: var(--amber-100); }
.bonus-card .card-tag { background: var(--amber-800); }
.bonus-card h2, .bonus-card .grand-total strong { color: var(--amber-800); }
.bonus-card .grand-total { border-color: rgba(138, 82, 0, 0.22); }

footer { padding: 18px 8px 0; color: #5d6861; font-size: 0.75rem; text-align: center; }

@media (max-width: 560px) {
  .app-shell { width: min(100% - 16px, 720px); margin-top: 8px; }
  .hero { padding: 23px 20px; border-radius: 20px; }
  .input-panel, .result-card, .receive-card { padding: 18px; border-radius: 18px; }
  .input-grid { grid-template-columns: 1fr; gap: 12px; }
  .field > span:first-child { min-height: 0; }
  .section-heading { align-items: flex-start; }
  .reset-button { padding: 8px 9px; }
  .line-item { align-items: flex-start; }
  .line-item > span { max-width: 58%; }
  .grand-total { align-items: flex-start; }
  .grand-total > span { max-width: 42%; }
  .card-values { padding-inline: 12px; }
}

@media (max-width: 360px) {
  .section-heading { display: block; }
  .reset-button { width: 100%; margin-top: 12px; }
  .grand-total { display: block; }
  .grand-total > span { display: block; max-width: none; margin-bottom: 5px; }
  .grand-total strong { justify-content: flex-start; }
}

@media (prefers-reduced-motion: no-preference) {
  .reset-button { transition: background 160ms ease, transform 160ms ease; }
  .reset-button:active { transform: translateY(1px); }
}
