/* PTO Calculator — mobile-first, system fonts only */

:root {
  --teal: #0F766E;
  --teal-dark: #0B5852;
  --teal-light: #CCFBF1;
  --teal-tint: #F0FDFA;
  --ink: #0F172A;
  --ink-soft: #334155;
  --muted: #64748B;
  --bg: #F8FAFC;
  --card: #FFFFFF;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --good: #15803D;
  --good-bg: #DCFCE7;
  --warn: #B45309;
  --warn-bg: #FEF3C7;
  --bar-used: #94A3B8;
  --bar-available: #0F766E;
  --bar-pending: #CBD5E1;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.10);
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}
.container.narrow {
  max-width: 760px;
}

/* HEADER */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(8px);
  background: rgba(255, 255, 255, 0.92);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--teal);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.unit-toggle {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
}
.unit-btn {
  border: 0;
  background: transparent;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
  min-height: 32px;
}
.unit-btn.active {
  background: var(--teal);
  color: white;
}

/* HERO */
.hero {
  padding: 36px 0 8px;
}
.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
  font-weight: 800;
}
.lede {
  font-size: 1.0625rem;
  color: var(--ink-soft);
  margin: 0 0 20px;
  max-width: 720px;
}
.definition-card {
  background: var(--teal-tint);
  border: 1px solid var(--teal-light);
  border-left: 4px solid var(--teal);
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  color: var(--ink-soft);
  max-width: 720px;
}
.definition-card code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  background: white;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--teal-light);
  font-size: 0.875rem;
}

.meta-updated {
  font-size: 0.82rem;
  color: var(--muted);
}

/* LAYOUT GRID — main content + sidebar */
.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 1024px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 32px;
    align-items: flex-start;
  }
}
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
@media (min-width: 1024px) {
  .sidebar { position: sticky; top: 80px; }
}

/* AD SLOTS */
.ad-slot {
  border: 1px dashed var(--border-strong);
  background: var(--bg);
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
  padding: 16px;
  min-height: 250px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-slot.ad-inline {
  min-height: 90px;
  margin: 28px 0 0;
}

/* TABLE OF CONTENTS (sidebar) */
.toc-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}
.toc-title {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}
.toc-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.92rem;
  line-height: 1.85;
}
.toc-card a {
  color: var(--ink-soft);
  text-decoration: none;
}
.toc-card a:hover { color: var(--teal); text-decoration: underline; }

/* COOKIE BANNER */
.cookie {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  background: var(--ink);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: none;
  align-items: center;
  gap: 12px;
  z-index: 80;
  font-size: 0.9rem;
  max-width: 560px;
  margin: 0 auto;
}
.cookie.show { display: flex; }
.cookie a { color: var(--teal-light); }
.cookie button {
  background: var(--teal);
  color: #fff;
  border: 0;
  padding: 7px 16px;
  border-radius: 6px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  min-height: 36px;
  flex-shrink: 0;
}
.cookie button:hover { background: var(--teal-dark); }

/* LEGAL PAGES (privacy/imprint) */
.legal-main {
  max-width: 760px;
  margin: 32px auto;
  padding: 0 20px;
}
.legal-main .content h1 {
  font-size: 1.75rem;
  margin-bottom: 16px;
}
.legal-main .content h2 {
  font-size: 1.2rem;
  margin: 28px 0 8px;
}
.legal-main .content h3 {
  font-size: 1rem;
  margin: 20px 0 6px;
}
.legal-main .content p,
.legal-main .content ul {
  color: var(--ink-soft);
}
.legal-main .content code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  background: var(--bg);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.875em;
  border: 1px solid var(--border);
}

/* FOOTER LINKS */
.footer-links {
  margin: 8px 0;
  font-size: 0.875rem;
}
.footer-links a {
  color: rgba(255,255,255,0.85);
  margin: 0 6px;
  text-decoration: none;
}
.footer-links a:hover { color: white; text-decoration: underline; }
/* on legal pages the footer is white-on-light, override */
.legal-main + .site-footer .footer-links a,
.site-footer .container > div a {
  color: rgba(255,255,255,0.85);
}

/* CALCULATOR CARD */
.calculator-section {
  padding: 24px 0 56px;
}
.calculator-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

/* TABS */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1 0 auto;
  border: 0;
  background: transparent;
  padding: 16px 20px;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  min-height: 48px;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--ink-soft); }
.tab.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
  background: white;
}

/* PANELS */
.tab-panel {
  padding: 24px;
}
.panel-title {
  font-size: 1.125rem;
  margin: 0 0 18px;
  color: var(--ink);
  font-weight: 700;
}
.panel-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 860px) {
  .panel-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  .tab-panel { padding: 32px; }
}

/* FORM FIELDS */
.field {
  margin-bottom: 16px;
}
.field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink-soft);
}
.field small.muted {
  display: block;
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: 4px;
}

input[type="number"],
input[type="date"],
select {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--ink);
  min-height: 44px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="number"]:focus,
input[type="date"]:focus,
select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748B' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.slider-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.slider-row input[type="range"] {
  flex: 1;
  min-width: 0;
}
.slider-row input[type="number"] {
  width: 88px;
  flex: 0 0 auto;
}
.slider-row .unit-suffix {
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 500;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  background: var(--teal);
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 1px 4px rgba(15, 118, 110, 0.4);
}
input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  background: var(--teal);
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 1px 4px rgba(15, 118, 110, 0.4);
}

.tip {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  font-size: 0.6875rem;
  color: var(--muted);
  font-weight: 700;
  cursor: help;
  vertical-align: middle;
  margin-left: 4px;
}

.seg-toggle {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  width: 100%;
}
.seg {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
  min-height: 38px;
}
.seg.active {
  background: white;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* RESULTS */
.results {
  background: var(--teal-tint);
  border: 1px solid var(--teal-light);
  border-radius: var(--radius);
  padding: 20px;
  min-height: 380px;
  display: flex;
  flex-direction: column;
}
.result-headline {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px dashed var(--teal-light);
}
.result-label {
  font-size: 0.8125rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-bottom: 4px;
}
.result-value {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
  color: var(--teal-dark);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.result-sub {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 0;
  font-size: 0.9375rem;
}
.result-row + .result-row {
  border-top: 1px solid var(--teal-light);
}
.result-row-label {
  color: var(--ink-soft);
}
.result-row-value {
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.result-row-value.muted {
  color: var(--muted);
  font-weight: 500;
}

.bar-wrap {
  margin-top: 18px;
}
.bar {
  display: flex;
  height: 14px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.bar-segment { height: 100%; transition: width 0.3s ease; }
.bar-segment.used { background: var(--bar-used); }
.bar-segment.available { background: var(--bar-available); }
.bar-segment.pending { background: var(--bar-pending); }

.bar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
  font-size: 0.8125rem;
  color: var(--muted);
}
.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: middle;
}
.dot.used { background: var(--bar-used); }
.dot.available { background: var(--bar-available); }
.dot.pending { background: var(--bar-pending); }

.summary {
  margin-top: auto;
  padding-top: 16px;
  font-size: 0.9375rem;
  color: var(--ink-soft);
  font-style: italic;
}

.state-badge {
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
}
.state-badge.required {
  background: var(--good-bg);
  color: var(--good);
  border-color: #BBF7D0;
}
.state-badge.not-required {
  background: var(--warn-bg);
  color: var(--warn);
  border-color: #FDE68A;
}

.disclaimer {
  margin-top: auto;
  padding-top: 14px;
  font-size: 0.8125rem;
  color: var(--muted);
  font-style: italic;
}

/* CARD FOOTER */
.card-footer {
  border-top: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  background: var(--bg);
}
.btn-link {
  border: 0;
  background: transparent;
  color: var(--teal);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  padding: 6px 4px;
  min-height: 36px;
}
.btn-link:hover { color: var(--teal-dark); text-decoration: underline; }
.btn-link.copied { color: var(--good); }

/* CONTENT SECTION */
.content-section {
  padding: 32px 0 56px;
  background: var(--card);
  border-top: 1px solid var(--border);
}
.content-section h2 {
  font-size: 1.5rem;
  margin: 32px 0 12px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.content-section h2:first-child { margin-top: 0; }
.content-section h3 {
  font-size: 1.0625rem;
  margin: 20px 0 6px;
  color: var(--ink);
}
.content-section p,
.content-section ol,
.content-section ul {
  color: var(--ink-soft);
  margin: 0 0 12px;
}
.content-section ol,
.content-section ul {
  padding-left: 22px;
}
.content-section li { margin-bottom: 6px; }

.benchmark-list {
  list-style: none;
  padding: 0 !important;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.benchmark-list li {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.9375rem;
}

/* STATE TABLE */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin: 16px 0 24px;
}
.state-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  background: white;
}
.state-table caption {
  caption-side: top;
  text-align: left;
  padding: 10px 14px;
  font-weight: 700;
  color: var(--ink-soft);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.state-table th,
.state-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.state-table th {
  background: var(--bg);
  font-weight: 700;
  font-size: 0.8125rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.state-table td:first-child {
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}
.state-table tbody tr:last-child td { border-bottom: 0; }
.state-table tbody tr:hover { background: var(--teal-tint); }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge.yes { background: var(--good-bg); color: var(--good); }
.badge.no { background: var(--warn-bg); color: var(--warn); }

.noscript-fallback {
  background: var(--warn-bg);
  border: 1px solid #FDE68A;
  padding: 16px;
  border-radius: var(--radius-sm);
  margin-top: 20px;
}

/* FOOTER */
.site-footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.85);
  padding: 24px 0;
  margin-top: 40px;
  font-size: 0.875rem;
  text-align: center;
}
.site-footer p { margin: 4px 0; }
.site-footer .muted { color: rgba(255, 255, 255, 0.55); }

/* PRINT */
@media print {
  .site-header, .tabs, .card-footer, .content-section, .site-footer { display: none !important; }
  body { background: white; }
  .calculator-card { box-shadow: none; border: 1px solid #ccc; }
  .tab-panel[hidden] { display: none !important; }
  .results { background: white; border-color: #ccc; }
}

/* MOBILE */
@media (max-width: 600px) {
  .hero { padding: 24px 0 8px; }
  .tab { padding: 14px 14px; font-size: 0.875rem; }
  .tab-panel { padding: 18px; }
  .results { padding: 16px; min-height: 0; }
  .card-footer { flex-direction: column; align-items: stretch; gap: 4px; }
  .btn-link { text-align: left; }
  .container { padding: 0 16px; }
}
