.hfst {
  --hfst-ink: #1f2b2a;
  --hfst-teal: #2f6d67;
  --hfst-deep: #1f4945;
  --hfst-soft: #eaf3f1;
  --hfst-line: #cddcd9;
  --hfst-warn: #a14a0b;
  --hfst-warn-soft: #fdf1e3;
  --hfst-ok: #2e7d4f;
  margin: 0 0 36px;
  padding: 24px;
  border: 1px solid var(--hfst-line);
  border-top: 5px solid var(--hfst-teal);
  border-radius: 4px;
  background: #fff;
  color: var(--hfst-ink);
  line-height: 1.5;
  scroll-margin-top: 90px;
}
.hfst *, .hfst *::before, .hfst *::after { box-sizing: border-box; }
.hfst .hfst-lead { margin: 0 0 22px; }

.hfst .hfst-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 767px) {
  .hfst { padding: 18px 16px; }
  .hfst .hfst-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}

.hfst .hfst-periods { list-style: none; margin: 0 0 14px; padding: 0; }
.hfst .hfst-period { margin: 0 0 12px; padding: 14px; border: 1px solid var(--hfst-line); border-radius: 4px; background: #fbfdfc; }
.hfst .hfst-period::marker { content: none; }
.hfst .hfst-period-head { display: flex; justify-content: space-between; align-items: center; margin: 0 0 10px; }
.hfst .hfst-period-num { font-weight: 700; font-size: 15px; color: var(--hfst-deep); }
.hfst .hfst-del {
  min-height: 44px; margin: -8px -8px -8px 0; padding: 0 10px;
  border: 0; background: none; color: #6a4b3a; font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer;
}
.hfst .hfst-del[hidden] { display: none; }
.hfst .hfst-dates { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
@media (max-width: 380px) { .hfst .hfst-dates { grid-template-columns: minmax(0, 1fr); } }

.hfst .hfst-field { margin: 0; min-width: 0; }
.hfst .hfst-label { display: block; margin: 0 0 6px; font-size: 14px; font-weight: 700; color: var(--hfst-ink); }
.hfst .hfst-label span { font-weight: 400; color: #55625f; }
.hfst .hfst-input {
  display: block; width: 100%; min-width: 0; height: 44px; margin: 0; padding: 8px 10px;
  border: 1px solid #a9bfbb; border-radius: 3px; background: #fff; color: var(--hfst-ink);
  font: inherit; font-size: 16px;
}
.hfst .hfst-input:disabled { background: #eef2f1; color: #7b8987; }
.hfst .hfst-check { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 6px 0 0; font-size: 15px; cursor: pointer; }
.hfst .hfst-check input { width: 20px; height: 20px; margin: 0; accent-color: var(--hfst-teal); }
.hfst .hfst-row-error { margin: 6px 0 0; color: #b42318; font-size: 14px; }
.hfst .hfst-row-error[hidden] { display: none; }

.hfst .hfst-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 22px; }
.hfst .hfst-btn {
  min-height: 44px; margin: 0; padding: 10px 16px;
  border: 1px solid var(--hfst-teal); border-radius: 3px; background: #fff; color: var(--hfst-teal);
  font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
}
.hfst .hfst-btn-main { background: var(--hfst-teal); color: #fff; }
.hfst .hfst-btn:hover { background: var(--hfst-deep); border-color: var(--hfst-deep); color: #fff; }
.hfst .hfst-dob { padding-top: 18px; border-top: 1px solid var(--hfst-line); }

.hfst .hfst-btn:focus-visible, .hfst .hfst-del:focus-visible, .hfst .hfst-input:focus-visible,
.hfst .hfst-check input:focus-visible, .hfst .hfst-sticky:focus-visible {
  outline: 3px solid #f3c969; outline-offset: 2px;
}

.hfst .hfst-result { padding: 20px; border-radius: 4px; background: var(--hfst-soft); scroll-margin-top: 90px; }
.hfst .hfst-result-label { margin: 0 0 4px; font-size: 14px; color: #3d5b57; }
.hfst .hfst-big { margin: 0 0 6px; font-size: 26px; line-height: 1.25; color: var(--hfst-deep); }
.hfst .hfst-big b { font-weight: 700; }
.hfst .hfst-meta { margin: 8px 0 0; font-size: 13px; color: #4b5d5a; }
.hfst .hfst-hint, .hfst .hfst-empty { margin: 12px 0 0; font-size: 15px; }
.hfst .hfst-sub { margin: 18px 0 10px; font-weight: 700; font-size: 16px; color: var(--hfst-deep); }

.hfst .hfst-ages { display: grid; gap: 8px; }
.hfst .hfst-age { padding: 12px 14px; border-radius: 4px; background: #fff; border-left: 4px solid var(--hfst-ok); }
.hfst .hfst-age.is-lack { border-left-color: var(--hfst-warn); }
.hfst .hfst-age p { margin: 0; }
.hfst .hfst-age-h { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.hfst .hfst-age-h b { font-size: 16px; }
.hfst .hfst-age-h span { font-size: 13px; color: #55625f; }
.hfst .hfst-age-have { font-size: 14px; margin-top: 2px !important; }
.hfst .hfst-age-v { font-weight: 700; color: var(--hfst-ok); margin-top: 2px !important; }
.hfst .hfst-age.is-lack .hfst-age-v { color: var(--hfst-warn); }

.hfst .hfst-buy { margin-top: 18px; padding: 14px; border-radius: 4px; background: var(--hfst-warn-soft); }
.hfst .hfst-buy .hfst-sub { margin-top: 0; color: #6b3409; }
.hfst .hfst-rows { margin: 0; }
.hfst .hfst-rows > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid #f0d9bf; }
.hfst .hfst-rows dt { margin: 0; font-size: 14px; }
.hfst .hfst-rows dd { margin: 0; font-weight: 700; white-space: nowrap; }

.hfst .hfst-h { margin: 32px 0 12px; font-size: 22px; line-height: 1.3; }
.hfst .hfst-table-wrap { overflow-x: auto; }
.hfst .hfst-table { width: 100%; margin: 0; border-collapse: collapse; font-size: 15px; }
.hfst .hfst-table caption { caption-side: top; text-align: left; padding: 0 0 8px; font-size: 14px; color: #4b5d5a; }
.hfst .hfst-table th, .hfst .hfst-table td { padding: 10px 12px; border: 1px solid var(--hfst-line); text-align: left; }
.hfst .hfst-table thead th { background: var(--hfst-teal); color: #fff; border-color: var(--hfst-teal); }
.hfst .hfst-table tr.is-now th, .hfst .hfst-table tr.is-now td { background: var(--hfst-soft); font-weight: 700; }
.hfst .hfst-note { margin: 18px 0 0; font-size: 14px; color: #4b5d5a; }
.hfst .hfst-note a { color: var(--hfst-teal); }

.hfst .hfst-sticky {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9999;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  min-height: 52px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--hfst-deep); color: #fff !important; text-decoration: none !important;
  font-size: 15px; font-weight: 700; box-shadow: 0 -4px 14px rgba(0, 0, 0, .18);
}
.hfst .hfst-sticky[hidden] { display: none; }
.hfst .hfst-sticky-more { flex: 0 0 auto; padding: 6px 12px; border-radius: 3px; background: #fff; color: var(--hfst-deep); font-size: 13px; }
@media (min-width: 768px) { .hfst .hfst-sticky { display: none !important; } }

@media (prefers-reduced-motion: reduce) {
  .hfst *, .hfst *::before, .hfst *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* FAQ під калькулятором: H3 → details (фільтр the_content лише на сторінці калькулятора) */
.hfst-faq { margin: 0 0 10px; border: 1px solid #cddcd9; border-radius: 4px; background: #fff; }
.hfst-faq > summary {
  position: relative; display: block; min-height: 44px; padding: 14px 48px 14px 16px;
  font-weight: 700; font-size: 17px; line-height: 1.4; color: #1f4945; cursor: pointer; list-style: none;
}
.hfst-faq > summary::-webkit-details-marker { display: none; }
.hfst-faq > summary::after {
  content: "+"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  font-size: 24px; font-weight: 400; line-height: 1; color: #2f6d67;
}
.hfst-faq[open] > summary::after { content: "\2212"; }
.hfst-faq[open] > summary { border-bottom: 1px solid #e3ecea; background: #eaf3f1; }
.hfst-faq > summary:hover { background: #eaf3f1; }
.hfst-faq > summary:focus-visible { outline: 3px solid #f3c969; outline-offset: 2px; }
.hfst-faq .hfst-faq-a { padding: 12px 16px 4px; }
.hfst-faq .hfst-faq-a p { margin: 0 0 12px; }
