:root {
  --bg: #faf7f1;
  --surface: #ffffff;
  --surface-sunken: #f4efe4;
  --text: #211f1a;
  --text-muted: #6e675b;
  --border: #e8e0d0;
  --border-strong: #d8cbb0;

  --gold: #b8863f;
  --gold-strong: #8f6528;
  --gold-soft: #f6ecd8;

  --green: #2f7a4d;
  --green-soft: #e5f1e9;
  --amber: #a15c00;
  --amber-soft: #faf0d9;
  --red: #a1362a;
  --red-soft: #f7e5e1;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;

  --shadow-card: 0 30px 60px -34px rgba(184, 134, 63, 0.35), 0 3px 10px rgba(33, 31, 26, 0.06);
  --shadow-btn: 0 14px 28px -12px rgba(143, 101, 40, 0.55);

  --ease-out-expo: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --font-heading: "Lora", Georgia, "Times New Roman", serif;
  --font-body: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 28px;
}
@media (min-width: 1400px) {
  .wrap { max-width: 980px; }
}

.hero-band {
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

h1, h2, h3 { font-family: var(--font-heading); letter-spacing: -0.01em; }

/* header */
.site-header {
  padding: 26px 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--text);
}
.brand-mark { display: block; flex-shrink: 0; color: var(--gold); }
.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.brand-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: 0.02em;
}
.brand-tool {
  font-size: 0.86rem;
  color: var(--gold-strong);
  font-weight: 600;
}

/* hero */
.hero {
  padding: 56px 28px 32px;
}
.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3rem);
  line-height: 1.18;
  margin: 0 0 18px;
  text-wrap: balance;
}
.hero-accent { color: var(--gold-strong); }
.hero-sub {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.2rem;
  max-width: 56ch;
  text-wrap: pretty;
}

/* disclaimer */
.disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--amber-soft);
  color: var(--amber);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  margin: 0 auto 36px;
}
.disclaimer svg { flex-shrink: 0; margin-top: 3px; }
.disclaimer p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
}

/* calculator card */
.calc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 40px 32px 44px;
  margin: 0 auto 64px;
}
@media (min-width: 640px) {
  .calc-card { padding: 48px 52px 52px; }
}
.calc-card h2 {
  margin: 0 0 10px;
  font-size: 1.7rem;
}
.calc-intro {
  margin: 0 0 34px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.field {
  border: none;
  margin: 0 0 32px;
  padding: 0;
}
.field legend, .field > label {
  display: block;
  font-weight: 700;
  font-size: 1.02rem;
  margin-bottom: 14px;
  padding: 0;
}

.date-input {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface-sunken);
  color: var(--text);
  font-family: inherit;
  font-size: 1.1rem;
  padding: 15px 18px;
  min-height: 56px;
  border-radius: var(--radius-sm);
  transition: border-color 0.18s var(--ease-out-expo);
}
.date-input:hover { border-color: var(--border-strong); }

.select-input {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface-sunken);
  color: var(--text);
  font-family: inherit;
  font-size: 1.05rem;
  padding: 15px 18px;
  min-height: 56px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.18s var(--ease-out-expo);
}
.select-input:hover { border-color: var(--border-strong); }

.field-hint {
  margin: 8px 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.field-hint-inline {
  margin: -2px 0 6px 32px;
  font-size: 0.84rem;
}

.check-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  min-height: 44px;
  cursor: pointer;
  font-size: 0.98rem;
}
.check-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--gold);
  flex-shrink: 0;
  cursor: pointer;
}

.duration-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.duration-row-single { grid-template-columns: 1fr; }
.duration-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  background: var(--surface-sunken);
  border-radius: var(--radius-sm);
  padding: 6px 8px 6px 18px;
  min-height: 56px;
  transition: border-color 0.18s var(--ease-out-expo);
}
.duration-item:focus-within { border-color: var(--gold); }
.duration-item input {
  width: 100%;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  padding: 10px 0;
  -moz-appearance: textfield;
}
.duration-item input::-webkit-outer-spin-button,
.duration-item input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.duration-item span {
  flex-shrink: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chip {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-sunken);
  color: var(--text);
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 500;
  padding: 14px 20px;
  min-height: 56px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.18s var(--ease-out-expo), border-color 0.18s var(--ease-out-expo), color 0.18s var(--ease-out-expo);
}
.chip:hover { border-color: var(--border-strong); }
.chip.is-selected {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--gold-strong);
}

.chip-group-stack {
  flex-direction: column;
  align-items: stretch;
}
.chip-group-stack .chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
  height: auto;
}
.chip-label { flex: 1; min-width: 0; }
.chip-rate {
  flex-shrink: 0;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-left: 12px;
  white-space: nowrap;
}
.chip.is-selected .chip-rate { color: var(--gold-strong); }

.calc-button {
  appearance: none;
  width: 100%;
  border: none;
  background: var(--gold);
  color: #fffaf1;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  padding: 19px 24px;
  min-height: 62px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition: transform 0.15s var(--ease-spring), background-color 0.2s var(--ease-out-expo);
}
.calc-button:hover { background: var(--gold-strong); }
.calc-button:active { transform: scale(0.98); }

.calc-error {
  margin: 16px 0 0;
  padding: 14px 18px;
  background: var(--red-soft);
  color: var(--red);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
}

.result {
  margin-top: 36px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  animation: reveal 0.5s var(--ease-out-expo);
}
@keyframes reveal {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-rate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.result-label {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 700;
}

.verdict-badge {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-heading);
  animation: pop 0.4s var(--ease-spring);
}
@keyframes pop {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.verdict-badge.verdict-green { background: var(--green-soft); color: var(--green); }
.verdict-badge.verdict-amber { background: var(--amber-soft); color: var(--amber); }
.verdict-badge.verdict-red { background: var(--red-soft); color: var(--red); }

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 26px;
}
@media (max-width: 520px) {
  .result-grid { grid-template-columns: 1fr; }
}
.result-tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface-sunken);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
}
.result-tile-label {
  font-size: 0.86rem;
  color: var(--text-muted);
  font-weight: 700;
}
.result-tile-value {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
}
.result-tile-wide { grid-column: 1 / -1; }

.result-warning {
  margin: 20px 0 0;
  padding: 14px 18px;
  background: var(--amber-soft);
  color: var(--amber);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.5;
}

.result-dates {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.date-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 2px;
  font-size: 1rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.date-row:last-child { border-bottom: none; }
.date-row strong {
  font-family: var(--font-heading);
  color: var(--text);
  font-weight: 700;
  text-align: right;
}
.date-row-strong { color: var(--text); font-weight: 700; }
.date-row-strong strong { color: var(--gold-strong); font-size: 1.2rem; }

.result-footnote {
  margin: 22px 0 0;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* info section */
.info-section, .faq-section { padding: 8px 28px 56px; }
.info-section h2, .faq-section h2 {
  font-size: 1.7rem;
  margin: 0 0 18px;
}
.info-section p { color: var(--text-muted); font-size: 1.05rem; }
.info-section h3 {
  font-size: 1.25rem;
  margin: 44px 0 14px;
}
.info-section strong { color: var(--text); }

.rate-table {
  margin: 28px 0 20px;
  border-top: 1px solid var(--border);
}
.rate-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.rate-row-head {
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-top: 0;
}
.rate-row span:first-child { font-size: 1rem; }
.rate-pill {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 6px 14px;
  border-radius: var(--radius-xs);
  justify-self: end;
  white-space: nowrap;
  text-align: center;
}
.rate-pill-low { background: var(--green-soft); color: var(--green); }
.rate-pill-mid { background: var(--amber-soft); color: var(--amber); }
.rate-pill-high { background: var(--red-soft); color: var(--red); }

@media (max-width: 560px) {
  .rate-row { grid-template-columns: 1fr; gap: 8px; }
  .rate-pill { justify-self: start; white-space: normal; }
}

.info-note {
  font-size: 0.95rem;
  color: var(--text-muted);
  background: var(--surface-sunken);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
}

/* FAQ */
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}
.faq-item summary {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.12rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.5rem;
  color: var(--gold);
  flex-shrink: 0;
  transition: transform 0.2s var(--ease-out-expo);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p {
  margin: 14px 0 0;
  color: var(--text-muted);
  font-size: 1.02rem;
}

/* footer */
.site-footer {
  background: var(--surface-sunken);
  border-top: 1px solid var(--border);
  padding: 32px 0;
}
.footer-disclaimer {
  color: var(--text-muted);
  font-size: 0.86rem;
  text-align: center;
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
