:root {
  --bg-1: #fff6e9;
  --bg-2: #f0f4ff;
  --surface: #fffdf9;
  --surface-edge: #1e1a14;
  --text-main: #1b1a16;
  --text-muted: #5b5650;
  --line: #ded6ca;
  --accent: #c75512;
  --accent-soft: #ffe4d3;
  --answer-bg: #fcf2ea;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at 10% 20%, rgba(255, 173, 102, 0.24) 0%, transparent 34%),
    radial-gradient(circle at 90% 10%, rgba(127, 168, 255, 0.26) 0%, transparent 40%),
    linear-gradient(145deg, var(--bg-1), var(--bg-2));
}

.page-shell {
  min-height: 100vh;
  padding: 2.5rem 1rem;
  display: grid;
  place-items: center;
}

.calculator {
  width: min(920px, 100%);
  padding: 1.5rem;
  border: 1px solid var(--surface-edge);
  border-radius: 18px;
  background: linear-gradient(180deg, #fff 0%, var(--surface) 100%);
  box-shadow: 8px 8px 0 #c7beb3, 0 22px 36px rgba(32, 28, 22, 0.16);
  animation: rise-in 360ms ease-out both;
}

.calc-header {
  margin-bottom: 1.1rem;
}

.calc-header h1 {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.2rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.eyebrow {
  margin: 0 0 0.35rem;
  font-weight: 700;
  font-size: 0.73rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.intro {
  margin: 0.45rem 0 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.tab-content {
  display: grid;
  gap: 0;
}

.question {
  padding: 0.9rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  font-size: 1rem;
  line-height: 1.45;
}

.question-label {
  color: #2e2a24;
}

input[type="number"] {
  width: 7.25rem;
  min-height: 44px;
  padding: 0.58rem 0.65rem;
  border-radius: 10px;
  border: 1px solid #c5bbaf;
  background: #fffbf6;
  color: var(--text-main);
  font: inherit;
  font-weight: 600;
  transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

input[type="number"]::placeholder {
  color: #9f978c;
}

input[type="number"]:focus-visible {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.answer-placeholder {
  margin-left: auto;
  min-width: 6.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #e0d3c7;
  border-radius: 10px;
  background: var(--answer-bg);
  font-weight: 700;
  text-align: right;
  color: #5f2d10;
}

hr {
  margin: 0;
  border: 0;
  border-top: 1px dashed var(--line);
}

@media (max-width: 760px) {
  .page-shell {
    padding: 1.2rem 0.8rem 1.6rem;
  }

  .calculator {
    padding: 1.1rem 0.95rem;
    border-radius: 14px;
    box-shadow: 4px 4px 0 #cbc1b6, 0 14px 26px rgba(32, 28, 22, 0.14);
  }

  .question {
    padding: 0.85rem 0;
    font-size: 0.95rem;
    gap: 0.5rem;
    align-items: flex-start;
  }

  .question-label {
    width: 100%;
  }

  input[type="number"] {
    width: 100%;
    max-width: 100%;
    margin: 0;
    font-size: 16px;
  }

  .answer-placeholder {
    width: 100%;
    margin-left: 0;
    text-align: left;
    margin-top: 0.1rem;
  }

  .intro {
    font-size: 0.9rem;
  }
}

@media (max-width: 420px) {
  .page-shell {
    padding: 0.8rem 0.55rem 1.2rem;
  }

  .calculator {
    border-radius: 12px;
    padding: 1rem 0.8rem;
  }

  .calc-header h1 {
    font-size: 1.55rem;
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
