

* {
  box-sizing: border-box;
}

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --text: #1f2937;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #1d4ed8;
  --primary-dark: #1e3a8a;
  --accent: #327096;
  --success-bg: #eff6ff;
  --success-border: #bfdbfe;
  --radius: 18px;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

a:not(.btn) {
  color: var(--accent);
  text-decoration: none;
}

.container {
  width: min(1140px, calc(100% - 32px));
  margin: 0 auto;
}

.hidden {
  display: none !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--primary-dark);
}

.logo small span,
.logo small {
  color: var(--primary-dark);
}

.logo span {
  color: var(--accent);
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.main-nav a {
  color: var(--muted);
  font-weight: 600;
}

.main-nav a:hover {
  color: var(--primary);
}

.site-main {
  min-height: 70vh;
}

.page-section {
  padding: 24px 0;
}

.page-section--narrow {
  padding: 16px 0;
}

.page-section:has(div.ad-slot--hidden) {
  display: none !important;
}

.hero {
  padding: 56px 0 24px;
}

.hero--home {
  padding: 64px 0 32px;
}

.hero__content {
  max-width: 860px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(29, 78, 216, 0.08);
  border-radius: 999px;
  padding: 8px 12px;
}

.hero h1,
.tool-intro h1 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.hero p,
.tool-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.quick-actions__item {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-weight: 700;
}

.quick-actions__item:hover {
  border-color: #c7d2fe;
  color: var(--primary);
}

.section-heading {
  margin-bottom: 20px;
}

.section-heading h2 {
  margin: 0 0 8px;
  font-size: 1.7rem;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.tool-card,
.tool-box,
.text-content,
.ad-slot,
.faq-item,
.related-tools__item,
.featured-links a {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.tool-card {
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.tool-card:hover {
  transform: translateY(-3px);
  border-color: #c7d2fe;
}

.tool-card h2 {
  margin: 0 0 10px;
  font-size: 1.2rem;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
}

.tool-intro {
  margin-bottom: 24px;
}

.tool-box {
  padding: 24px;
  box-shadow: var(--shadow);
}

.tool-box--large {
  padding: 28px;
}

.tool-form {
  display: grid;
  gap: 10px;
}

.field {
  display: grid;
  gap: 8px;
}

label {
  font-weight: 700;
}

.tool-form__grid input:not(.check-option input) {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  font-size: 1rem;
  background: #fff;
}

.tool-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.btn:hover {
  background: #1e40af;
}

.btn--secondary {
  background: #e2e8f0;
  color: #0f172a;
}

.btn--secondary:hover {
  background: #cbd5e1;
}

.result-box {
  margin-top: 24px;
  padding: 24px;
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  border-radius: 16px;
}

.result-box__main {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
}

.result-box__sub {
  margin-top: 8px;
  font-size: 1.05rem;
  color: #1e3a8a;
}

.result-box__meta {
  margin-top: 10px;
  color: #475569;
  font-size: 0.98rem;
}

.tool-form--diff-dates .tool-form__grid--3 {
  display: grid;
  grid-template-columns: 1fr 220px 1fr;
  gap: 16px;
  align-items: end;
}

.field--swap {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.field__ghost-label {
  visibility: hidden;
  margin-bottom: 10px;
  font-size: 14px;
}

.btn--full {
  width: 100%;
}

.tool-form__options {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 18px;
}

.check-option {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 15px;
}

.result-box__eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 10px;
}

@media (max-width: 820px) {
  .tool-form--diff-dates .tool-form__grid--3 {
    grid-template-columns: 1fr;
  }

  .field__ghost-label {
    display: none;
  }
}

.ad-slot {
  padding: 16px;
}

.ad-slot__label {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.ad-slot__box {
  min-height: 140px;
  display: grid;
  place-items: center;
  border: 2px dashed #cbd5e1;
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--muted);
  text-align: center;
}

.text-content {
  padding: 28px;
  box-shadow: var(--shadow);
}

.text-content h2 {
  margin-top: 0;
  margin-bottom: 14px;
  font-size: 1.5rem;
}

.text-content p:last-child {
  margin-bottom: 0;
}

.content-list {
  margin: 0;
  padding-left: 20px;
  margin-block: 1em;
}

.faq-list {
  display: grid;
  gap: 14px;
}

.faq-item {
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
}

.faq-item p {
  margin: 12px 0 0;
  color: var(--muted);
}

.related-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.related-tools__item {
  padding: 18px;
  font-weight: 700;
  box-shadow: var(--shadow);
}

.featured-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.featured-links a {
  display: block;
  padding: 18px;
  font-weight: 700;
  box-shadow: var(--shadow);
}

.site-footer {
  margin-top: 40px;
  padding: 34px 0;
  background: #fff;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-inner p {
  margin: 8px 0 0;
  color: var(--muted);
}

.footer-nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-nav a {
  color: var(--muted);
  font-weight: 600;
}

@media (max-width: 960px) {
  .tools-grid,
  .related-tools,
  .featured-links {
    grid-template-columns: 1fr;
  }

  .header-inner {
    flex-direction: column;
    justify-content: center;
    padding: 16px 0;
  }

  .main-nav {
    justify-content: center;
  }
}

.btn--ghost {
  background: transparent;
  color: var(--primary-dark);
  border: 1px solid #cbd5e1;
}

.btn--ghost:hover {
  background: #eff6ff;
}

.ad-slot--hidden {
  display: none;
}

.main-nav a[aria-current="page"] {
  color: var(--primary);
}

input:focus {
  outline: 2px solid rgba(29, 78, 216, 0.18);
  border-color: var(--primary);
}


.tool-box--compact {
  padding: 32px;
}

.tool-form__grid--dates {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 47px minmax(0, 1fr);
  column-gap: 18px;
  row-gap: 10px;
  align-items: start;
}
.tool-form__grid--sum-dates {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 18px;
  row-gap: 10px;
  align-items: start;
}

.field--date {
  display: grid;
  grid-template-rows: auto 62px auto;
  row-gap: 10px;
}

.field--swap {
  display: grid;
  grid-template-rows: auto 62px auto;
  row-gap: 3px;
}

.field__ghost-label {
  visibility: hidden;
  pointer-events: none;
}

.field--swap .swap-icon-btn {
  align-self: stretch;
  height: 62px;
  margin: 0;
}

.field--swap::after {
  content: "";
  display: block;
  min-height: 48px;
}

.swap-icon-btn {
  height: 62px;
  border: 1px solid #d9dee8;
  border-radius: 16px;
  background: #e9eef6;
  color: #1f2937;
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}

.swap-icon-btn:hover {
  background: #dde6f2;
}

.tool-form--diff-dates .field input[type="date"] {
  height: 62px;
  font-size: 18px;
  border-radius: 16px;
}

.field-help {
  min-height: 20px;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #f3f4f6;
  color: #374151;
  font-size: 14px;
  line-height: 1.4;
}

.field--date:has(.field-help:empty),
.tool-form__grid--dates:has(.field-help:empty) .field--swap {
  grid-template-rows: auto 62px;
}

.field-help:empty,
.tool-form__grid--dates:has(.field-help:empty) .field--swap::after {
  display: none;
}

.tool-form__options--compact {
  margin-top: 6px;
  gap: 24px;
}

.tool-form__actions--compact {
  margin-top: 22px;
  gap: 14px;
}

.result-panel {
  margin-top: 28px;
  border-top: 1px solid #e2e8f0;
  padding-top: 24px;
  display: grid;
  gap: 14px;
}

.result-panel__row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.result-panel__label {
  font-size: 18px;
  font-weight: 500;
  color: #1f2937;
}

.result-panel__value {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 18px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  font-size: 36px;
  font-weight: 800;
  color: #111827;
  text-align: center;
}

.result-panel__value--small {
  font-size: 22px;
  font-weight: 600;
}

.result-panel__value--meta {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.6;
  color: #374151;
}

@media (max-width: 900px) {
  .tool-form__grid--dates {
    grid-template-columns: 1fr;
  }

  .field--swap {
    display: flex;
  }

  .field--swap .swap-icon-btn {
    align-self: stretch;
    height: auto;
    width: 100%;
    min-height: 48px;
    margin: 0;
  }
  
  .field__ghost-label,
  .field--swap::after {
    display: none;
  }

  .result-panel__row {
    grid-template-columns: 1fr;
  }

  .result-panel__label {
    font-size: 16px;
  }

  .result-panel__value--small {
    font-size: 18px;
  }
  .holiday-popover {
    left: 0;
    right: auto;
    width: 100%;
  }
}

.result-panel__value--with-info {
  position: relative;
  justify-content: space-between;
  gap: 14px;
}

.holiday-info-btn {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #1f2937;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.holiday-info-btn:hover {
  background: #111827;
}

.holiday-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(420px, 92vw);
  z-index: 30;
}

.holiday-popover__inner {
  background: #fff;
  border: 1px solid #dbe3ee;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.16);
  overflow: hidden;
}

.holiday-popover__title {
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 800;
  color: #111827;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

.holiday-popover__list {
  max-height: 280px;
  overflow: auto;
}

.holiday-popover__item {
  padding: 14px 16px;
  text-align: left;
}

.holiday-popover__item + .holiday-popover__item {
  border-top: 1px solid #eef2f7;
}

.holiday-popover__date {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 6px;
}

.holiday-popover__name {
  font-size: 16px;
  font-weight: 700;
  color: #1f4b7a;
  margin-bottom: 8px;
}

.holiday-popover__scope {
  font-size: 13px;
  line-height: 1.55;
  color: #374151;
}

.holiday-popover__badge {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #eef2ff;
  color: #3730a3;
}


.tool-form__grid--age {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.date-text-control {
  position: relative;
  display: flex;
  align-items: center;
}

.date-text-input,
#daysToAdd {
  width: 100%;
  height: 62px;
  padding: 0 56px 0 16px;
  border: 1px solid #d9dee8;
  border-radius: 16px;
  background: #fff;
  font-size: 18px;
  color: #111827;
}

.date-text-input:focus {
  outline: none;
  border-color: #94a3b8;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.15);
}

.date-picker-btn {
  position: absolute;
  right: 10px;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.flatpickr-calendar {
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
  border-radius: 14px;
  border: 1px solid #e5e7eb;
}


.programmatic-links-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.programmatic-links-grid__item {
    display: block;
    padding: 14px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.programmatic-links-grid__item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.06);
    border-color: #d1d5db;
}

.programmatic-links-grid__item.is-current {
    border-color: #111827;
    font-weight: 600;
}

@media (max-width: 900px) {
    .programmatic-links-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .programmatic-links-grid {
        grid-template-columns: 1fr;
    }
}