:root {
  --bg: #F7F8FA;
  --surface: #FFFFFF;
  --text: #1C2331;
  --muted: #4A5568;
  --blue: #1B4F8A;
  --blue-hover: #163F6E;
  --blue-soft: #D6E6F7;
  --green-soft: #C8E6C9;
  --green: #1B7A4E;
  --amber-bg: #FFF6E5;
  --amber: #8A5B12;
  --border: #E2E6ED;
  --ring: #1B4F8A;
  --danger: #B42318;
  --header-h: 64px;
  --font-serif: "Source Serif 4", Georgia, serif;
  --font-sans: "Source Sans 3", "Segoe UI", sans-serif;
  --shadow: 0 1px 2px rgba(28, 35, 49, 0.06);
  --radius: 8px;
}

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

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
}

img { max-width: 100%; }

a {
  color: var(--blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover { color: var(--blue-hover); }

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

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--blue);
  color: #fff;
  padding: 8px 12px;
  z-index: 1000;
}
.skip:focus { top: 12px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  height: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.logo:hover { color: var(--blue); }

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text);
}
.menu-toggle svg { width: 22px; height: 22px; }

.nav {
  display: none;
  position: absolute;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 8px 12px 16px;
  flex-direction: column;
  gap: 4px;
}
.nav.is-open { display: flex; }

.nav a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 8px 12px;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius);
  cursor: pointer;
}
.nav a:hover { background: var(--blue-soft); }
.nav a.is-active {
  color: var(--blue);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--blue);
}

main {
  min-height: calc(100dvh - var(--header-h) - 88px);
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.wrap-wide {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.wrap-home {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.45rem; margin-top: 2rem; }
h3 { font-size: 1.15rem; font-family: var(--font-sans); }

.lead {
  font-size: 1.15rem;
  color: var(--muted);
  margin: 0 0 28px;
}

.hero {
  padding: 12px 0 8px;
}

.kicker {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 8px;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.95rem;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

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

.card-link {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  min-height: 140px;
  cursor: pointer;
  transition: border-color 180ms ease, transform 180ms ease;
}
.card-link:hover {
  border-color: var(--blue);
  transform: translateY(-1px);
}
.card-link:active { transform: scale(0.99); }

.card-icon {
  width: 40px;
  height: 40px;
  color: var(--blue);
}
.card-icon svg { width: 28px; height: 28px; }

.card-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.15rem;
  margin: 0;
}
.card-desc {
  color: var(--muted);
  margin: 0;
  font-size: 1rem;
}

.grid-3, .grid-2, .grid-calcs {
  display: grid;
  gap: 16px;
}

.notice {
  background: var(--amber-bg);
  color: var(--amber);
  border: 1px solid #F0D9A8;
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 0.95rem;
  margin: 16px 0;
}

.notice strong { color: var(--amber); }

.calendarios {
  display: grid;
  gap: 16px;
  margin: 24px 0 8px;
}

.cal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.cal-head h3 {
  margin: 0;
  font-size: 1.2rem;
  font-family: var(--font-serif);
}
.cal-count {
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 0.95rem;
}

.cal-weekdays,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}
.cal-weekdays span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  padding: 4px 0;
}

.cal-day {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  color: var(--text);
}
.cal-day.is-work { background: var(--blue-soft); }
.cal-day.is-off { background: var(--green-soft); }
.cal-day.is-active {
  outline: 3px solid var(--blue);
  outline-offset: 0;
}
.cal-empty { min-height: 44px; }

.cal-caption {
  min-height: 1.6em;
  color: var(--muted);
  margin: 8px 0 24px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0 0 8px;
}
.swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: -2px;
}
.swatch-work { background: var(--blue-soft); border: 1px solid #b7cde6; }
.swatch-off { background: var(--green-soft); border: 1px solid #9ccc9e; }

.compare {
  overflow-x: auto;
  margin: 16px 0 28px;
}
.compare table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 1rem;
}
.compare th, .compare td {
  border: 1px solid var(--border);
  padding: 12px;
  text-align: left;
}
.compare th { background: #EEF3F8; font-weight: 600; }
.compare td { font-variant-numeric: tabular-nums; }

.section-block {
  margin-bottom: 28px;
}
.section-block p { margin: 0 0 12px; }

details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
  margin: 12px 0 24px;
}
details summary {
  cursor: pointer;
  font-weight: 600;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.form-grid {
  display: grid;
  gap: 24px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.field label {
  font-weight: 600;
  font-size: 1rem;
}
.field .hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}
.field input,
.field select {
  height: 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 12px;
  font: inherit;
  background: var(--surface);
  color: var(--text);
  width: 100%;
}
.field input.is-invalid,
.field select.is-invalid {
  border-color: var(--danger);
}
.erro {
  color: var(--danger);
  font-size: 0.9rem;
  min-height: 1.2em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: var(--radius);
  border: 0;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: background 180ms ease;
}
.btn:hover { background: var(--blue-hover); }
.btn:active { transform: scale(0.99); }

.result {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  min-height: 180px;
}
.result.has-result { border-color: #c5ddd0; }
.result-empty { color: var(--muted); margin: 0; }
.result-total {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--green);
  font-variant-numeric: tabular-nums;
  margin: 0 0 4px;
}
.result-label {
  color: var(--muted);
  margin: 0 0 16px;
  font-size: 0.95rem;
}
.result dl {
  margin: 0;
}
.result dt {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 10px;
}
.result dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.formula {
  background: var(--surface);
  border-left: 4px solid var(--blue);
  padding: 12px 16px;
  margin: 16px 0;
  font-size: 1rem;
}

.fgts-box {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

.prose p { margin: 0 0 14px; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 8px; }

.rights-grid {
  display: grid;
  gap: 16px;
}

.right-card h3 { margin-bottom: 8px; }
.right-card h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--blue);
  margin: 12px 0 4px;
}

@media (min-width: 800px) {
  .menu-toggle { display: none; }
  .nav {
    display: flex;
    position: static;
    flex-direction: row;
    border: 0;
    padding: 0;
    gap: 4px;
  }
  .nav a { padding: 8px 12px; }
  h1 { font-size: 2.25rem; }
  .calendarios {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-2, .form-grid, .grid-calcs { grid-template-columns: 1fr 1fr; }
  .grid-calcs { grid-template-columns: repeat(2, 1fr); }
  .btn { width: auto; min-width: 180px; }
  .rights-grid { grid-template-columns: 1fr 1fr; }
}
