:root {
  --bg: #f9f7f2;
  --card: #ffffff;
  --ink: #1f2328;
  --muted: #5f6b6d;
  --accent: #e07a2f;
  --accent-2: #2f6f75;
  --border: #e7e1d6;
  --shadow: 0 18px 50px rgba(32, 24, 10, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Source Sans 3", "Helvetica Neue", "Noto Sans", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #fff6e6, transparent 40%),
              radial-gradient(circle at bottom right, #e7f4f1, transparent 35%),
              var(--bg);
  line-height: 1.5;
}

h1,
h2,
h3 {
  font-family: "DM Serif Display", "Georgia", serif;
  margin: 0 0 0.6rem;
}

a {
  color: inherit;
  text-decoration: none;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 1rem;
  background: #000;
  color: #fff;
  padding: 0.4rem 0.8rem;
  z-index: 10;
}

.skip-link:focus {
  left: 1rem;
}

.hero {
  position: relative;
  padding: 3.5rem 1.2rem 2.5rem;
  overflow: hidden;
}

.hero__content {
  max-width: 980px;
  margin: 0 auto;
}

.hero__content h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0 0 0.8rem;
}

.subhead {
  font-size: 1.1rem;
  max-width: 640px;
  color: var(--muted);
}

.hero__meta {
  display: flex;
  gap: 1rem;
  margin-top: 1.4rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-weight: 600;
}

.hero__shape {
  position: absolute;
  right: -120px;
  top: -60px;
  width: 300px;
  height: 300px;
  background: linear-gradient(130deg, rgba(224, 122, 47, 0.18), rgba(47, 111, 117, 0.18));
  border-radius: 42% 58% 51% 49%;
  transform: rotate(12deg);
}

.layout {
  display: grid;
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto 3rem;
  padding: 0 1.2rem;
}

.tool-page-heading {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: clamp(1.4rem, 3vw, 2rem);
}

.tool-page-heading h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  margin: 0 0 0.5rem;
}

.tool-page-heading p {
  max-width: 70ch;
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.6rem;
  box-shadow: var(--shadow);
}

.input-card,
.result-card {
  position: relative;
}

.field {
  margin-bottom: 1.2rem;
}

.field label,
legend {
  font-weight: 600;
  display: block;
  margin-bottom: 0.4rem;
}

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

.error {
  color: #b42318;
  margin: 0.3rem 0 0;
  font-size: 0.85rem;
  min-height: 1.1rem;
}

input,
select,
button,
textarea {
  font-family: inherit;
  font-size: 1rem;
}

input[type="text"],
select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 0.65rem 0.75rem;
  background: #fff;
  color: var(--ink);
}

input:focus,
select:focus,
button:focus,
summary:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.grid-2 {
  display: grid;
  gap: 1rem;
}

@media (min-width: 720px) {
  .layout {
    grid-template-columns: repeat(2, 1fr);
  }

  .info-card,
  .faq-card,
  .related-card {
    grid-column: span 2;
  }

  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.input-inline {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 0.5rem;
  background: #fff;
}

.input-inline input {
  border: none;
  outline: none;
  flex: 1;
  padding: 0.6rem 0.4rem;
}

.prefix {
  color: var(--muted);
  font-weight: 700;
}

.select-inline {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

.segmented {
  display: grid;
  gap: 0.6rem;
}

.segmented__option {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  background: #f4f1ea;
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  border: 1px solid transparent;
}

.segmented__option input {
  accent-color: var(--accent);
}

.switch {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch__slider {
  width: 48px;
  height: 28px;
  background: #d9d2c6;
  border-radius: 999px;
  position: relative;
  transition: 0.2s ease;
}

.switch__slider::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 999px;
  top: 3px;
  left: 3px;
  transition: 0.2s ease;
}

.switch input:checked + .switch__slider {
  background: var(--accent);
}

.switch input:checked + .switch__slider::after {
  transform: translateX(20px);
}

.checkbox {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.checkbox input {
  accent-color: var(--accent-2);
}

.is-hidden {
  display: none;
}

.result-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 0.65rem 1rem;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s ease;
}

button:hover {
  background: #d1681f;
}

button:disabled {
  background: #c7bfb0;
  cursor: not-allowed;
}

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

.result-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 0.6rem;
}

.result-row.total {
  border-bottom: none;
  padding-top: 0.6rem;
  font-size: 1.1rem;
}

.disclaimer {
  margin-top: 1.4rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.info-grid {
  display: grid;
  gap: 1rem;
}

.info-grid .example {
  background: #f4f1ea;
  padding: 0.6rem;
  border-radius: 12px;
}

.accordion details {
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 0;
}

.accordion summary {
  cursor: pointer;
  font-weight: 600;
}

.related-links {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.related-links a {
  background: #f4f1ea;
  padding: 0.8rem;
  border-radius: 12px;
  text-align: center;
  font-weight: 600;
}

.footer {
  padding: 1.5rem 1.2rem 3rem;
  text-align: center;
  color: var(--muted);
}

@media print {
  body {
    background: #fff;
  }

  .hero,
  .input-card,
  .info-card,
  .faq-card,
  .related-card,
  .footer,
  .result-actions {
    display: none !important;
  }

  .result-card {
    box-shadow: none;
    border: none;
    padding: 0;
  }
}
