:root {
  --bg-primary: #0B1120;
  --bg-secondary: #111827;
  --bg-card: #1E293B;
  --bg-card-hover: #26354D;
  --bg-input: #0F172A;
  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;
  --border-color: #334155;
  --border-subtle: rgba(148, 163, 184, 0.16);
  --accent-emerald: #10B981;
  --accent-emerald-hover: #059669;
  --accent-emerald-soft: rgba(16, 185, 129, 0.14);
  --accent-amber: #F59E0B;
  --accent-amber-soft: rgba(245, 158, 11, 0.15);
  --accent-sky: #38BDF8;
  --accent-sky-soft: rgba(56, 189, 248, 0.14);
  --accent-rose: #F43F5E;
  --accent-rose-soft: rgba(244, 63, 94, 0.14);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.45), 0 8px 10px -6px rgba(0, 0, 0, 0.35);
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
}

/* Variant 2: Pure OLED Carbon & Gold */
[data-theme="carbon"] {
  --bg-primary: #060608;
  --bg-secondary: #0D0E12;
  --bg-card: #14161D;
  --bg-card-hover: #1C1F29;
  --bg-input: #090A0D;
  --text-primary: #FAFAFA;
  --text-secondary: #D4D4D8;
  --text-muted: #A1A1AA;
  --border-color: #27272A;
  --border-subtle: rgba(161, 161, 170, 0.14);
  --accent-emerald: #F59E0B;
  --accent-emerald-hover: #D97706;
  --accent-emerald-soft: rgba(245, 158, 11, 0.15);
  --accent-amber: #10B981;
  --accent-amber-soft: rgba(16, 185, 129, 0.15);
  --accent-sky: #38BDF8;
  --accent-sky-soft: rgba(56, 189, 248, 0.14);
}

/* Variant 3: Deep Forest Emerald (Matches Right Half of Logo 4) */
[data-theme="emerald"] {
  --bg-primary: #041914;
  --bg-secondary: #06241D;
  --bg-card: #0B3128;
  --bg-card-hover: #103F34;
  --bg-input: #03130F;
  --text-primary: #ECFDF5;
  --text-secondary: #A7F3D0;
  --text-muted: #6EE7B7;
  --border-color: #115E59;
  --border-subtle: rgba(110, 231, 183, 0.16);
  --accent-emerald: #10B981;
  --accent-emerald-hover: #059669;
  --accent-emerald-soft: rgba(16, 185, 129, 0.22);
  --accent-amber: #FBBF24;
  --accent-amber-soft: rgba(251, 191, 36, 0.18);
  --accent-sky: #38BDF8;
  --accent-sky-soft: rgba(56, 189, 248, 0.18);
}

/* Variant 4: Royal Sapphire Navy (Matches Left Half of Logo 4) */
[data-theme="sapphire"] {
  --bg-primary: #061229;
  --bg-secondary: #0A1B3D;
  --bg-card: #102652;
  --bg-card-hover: #163269;
  --bg-input: #050E21;
  --text-primary: #F0F9FF;
  --text-secondary: #BAE6FD;
  --text-muted: #7DD3FC;
  --border-color: #1E40AF;
  --border-subtle: rgba(125, 211, 252, 0.16);
  --accent-emerald: #10B981;
  --accent-emerald-hover: #059669;
  --accent-emerald-soft: rgba(16, 185, 129, 0.2);
  --accent-amber: #F59E0B;
  --accent-amber-soft: rgba(245, 158, 11, 0.18);
  --accent-sky: #38BDF8;
  --accent-sky-soft: rgba(56, 189, 248, 0.2);
}

/* Variant 5: Crisp Apple Daylight */
[data-theme="light"] {
  --bg-primary: #F1F5F9;
  --bg-secondary: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8FAFC;
  --bg-input: #F8FAFC;
  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --border-color: #CBD5E1;
  --border-subtle: #E2E8F0;
  --accent-emerald: #059669;
  --accent-emerald-hover: #047857;
  --accent-emerald-soft: rgba(5, 150, 105, 0.12);
  --accent-amber: #D97706;
  --accent-amber-soft: rgba(217, 119, 6, 0.12);
  --accent-sky: #0284C7;
  --accent-sky-soft: rgba(2, 132, 199, 0.12);
  --accent-rose: #E11D48;
  --accent-rose-soft: rgba(225, 29, 72, 0.12);
  --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 4px 10px -4px rgba(15, 23, 42, 0.05);
}

.theme-swatches {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 999px;
}

.swatch-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.swatch-btn:hover, .swatch-btn.active {
  transform: scale(1.18);
  border-color: #10B981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header & Navigation */
.site-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.animated-logo-wrap {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.28), 0 0 12px rgba(16, 185, 129, 0.22);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
  cursor: pointer;
}

.brand:hover .animated-logo-wrap {
  transform: scale(1.22);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.45), 0 0 18px rgba(16, 185, 129, 0.4);
}

.hdr-hand-min {
  transform-origin: 234px 248px;
  animation: hdrSpinClock 5s linear infinite;
}

.hdr-hand-hr {
  transform-origin: 234px 248px;
  animation: hdrSweepHr 7s ease-in-out infinite alternate;
}

.hdr-hand-sec {
  transform-origin: 234px 248px;
  animation: hdrSpinClock 2s linear infinite;
}

.hdr-key-1 { animation: hdrKeyPress 1.6s ease-in-out infinite 0.1s; }
.hdr-key-2 { animation: hdrKeyPress 1.6s ease-in-out infinite 0.5s; }
.hdr-key-3 { animation: hdrKeyPress 1.6s ease-in-out infinite 0.9s; }
.hdr-key-eq { animation: hdrEqPress 1.6s ease-in-out infinite 1.3s; }

@keyframes hdrSpinClock {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes hdrSweepHr {
  0% { transform: rotate(-30deg); }
  50% { transform: rotate(28deg); }
  100% { transform: rotate(-50deg); }
}

@keyframes hdrKeyPress {
  0%, 75%, 100% { transform: translateY(0); }
  85% { transform: translateY(5px); filter: brightness(1.4); }
}

@keyframes hdrEqPress {
  0%, 70%, 100% { transform: translateY(0); }
  85% { transform: translateY(6px); filter: drop-shadow(0 0 10px #34D399); }
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #10B981, #059669);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 4px;
}

.brand-tld {
  color: var(--accent-emerald);
  background: var(--accent-emerald-soft);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 0.82rem;
  font-family: var(--font-mono);
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent-emerald);
  color: #FFFFFF;
  border-color: var(--accent-emerald);
}

.btn-primary:hover {
  background: var(--accent-emerald-hover);
}

.btn-amber {
  background: var(--accent-amber);
  color: #0F172A;
  border-color: var(--accent-amber);
}

.btn-rose {
  background: var(--accent-rose);
  color: #FFFFFF;
  border-color: var(--accent-rose);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.76rem;
  border-radius: var(--radius-sm);
}

/* Top Grid: Live Punch Clock + Config Bar */
.top-dashboard {
  display: grid;
  grid-template-columns: 1.1fr 1.9fr;
  gap: 20px;
  margin-top: 22px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-lg);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 10px;
  flex-wrap: wrap;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-emerald {
  background: var(--accent-emerald-soft);
  color: var(--accent-emerald);
}

.badge-amber {
  background: var(--accent-amber-soft);
  color: var(--accent-amber);
}

.badge-sky {
  background: var(--accent-sky-soft);
  color: var(--accent-sky);
}

/* Live Punch Clock Widget */
.punch-display {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.punch-timer {
  font-family: var(--font-mono);
  font-size: 1.95rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.punch-earnings {
  text-align: right;
}

.punch-earnings-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.punch-earnings-val {
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--accent-emerald);
}

.punch-controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

/* Payroll & Overtime Rules Panel */
.rules-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.input, .select {
  width: 100%;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-family: var(--font-sans);
}

.input:focus, .select:focus {
  outline: 2px solid var(--accent-emerald);
  border-color: transparent;
}

.input-mono {
  font-family: var(--font-mono);
  font-weight: 600;
}

/* KPI Summary Cards */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-top: 20px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 15px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-card.highlight {
  border-color: var(--accent-emerald);
  background: linear-gradient(180deg, var(--accent-emerald-soft), var(--bg-card));
}

.kpi-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-primary);
}

.kpi-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Main Timesheet Table */
.timesheet-section {
  margin-top: 20px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
}

.timesheet-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 960px;
}

.timesheet-table th {
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.timesheet-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  font-size: 0.88rem;
}

.timesheet-table tr:hover td {
  background: var(--bg-card-hover);
}

.day-cell {
  font-weight: 700;
  display: flex;
  flex-direction: column;
}

.day-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.break-pills {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.pill-btn {
  padding: 2px 6px;
  font-size: 0.68rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
}

.pill-btn:hover {
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
}

.overnight-tag {
  display: inline-block;
  font-size: 0.66rem;
  color: var(--accent-amber);
  background: var(--accent-amber-soft);
  padding: 1px 5px;
  border-radius: 4px;
  margin-top: 3px;
}

/* Smart Shift Parser Modal / Drawer */
.parser-box {
  margin-top: 20px;
  background: var(--bg-card);
  border: 1px dashed var(--accent-sky);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.parser-textarea {
  width: 100%;
  min-height: 76px;
  margin: 10px 0;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.84rem;
}

/* SEO & FAQ Guide Section */
.seo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 28px 0 48px;
}

.seo-card h2 {
  font-size: 1.12rem;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.seo-card p, .seo-card li {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.seo-card ul {
  padding-left: 18px;
}

.conversion-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 0.82rem;
  font-family: var(--font-mono);
}

.conversion-table th, .conversion-table td {
  border: 1px solid var(--border-color);
  padding: 6px 10px;
  text-align: center;
}

/* Sub-Navigation Bar (Tools, 50-State Laws, Guides, Methodology, App) */
.sub-nav {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 0;
}

.sub-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.sub-nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.sub-nav-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.sub-nav-link:hover,
.sub-nav-link.active {
  color: var(--text-primary);
  background: var(--bg-card);
  border-color: var(--border-color);
}

/* Editorial & Statutory Payroll Disclaimer Box (Above Footer) */
.editorial-disclaimer-box {
  margin: 28px 0 36px;
  padding: 18px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-emerald);
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  line-height: 1.65;
  color: var(--text-secondary);
  box-shadow: var(--shadow-lg);
}

.editorial-disclaimer-box strong {
  color: var(--text-primary);
}

.editorial-disclaimer-box a {
  color: var(--accent-emerald);
  font-weight: 600;
  text-decoration: none;
}

.editorial-disclaimer-box a:hover {
  text-decoration: underline;
}

/* 4-Card Bento Authority Footer (2x2 Mobile & Tablet Grid + 4-Col Desktop) */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 40px 0 28px;
  margin-top: 40px;
  color: var(--text-secondary);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-color);
}

.footer-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
  min-width: 0;
  max-width: 100%;
}

.footer-col-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  letter-spacing: -0.01em;
  text-decoration: none;
}

.footer-brand-header:hover {
  color: var(--accent-emerald);
}

.footer-mini-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.footer-links li {
  display: flex;
  align-items: baseline;
  min-width: 0;
}

.footer-links a {
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-decoration: none;
  line-height: 1.4;
  transition: color 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

.footer-links a:hover {
  color: var(--accent-emerald);
}

.footer-bullet-links a::before {
  content: "•";
  color: var(--accent-emerald);
  font-weight: 900;
  flex-shrink: 0;
}

.footer-bullet-links a.f-link-accent {
  color: var(--accent-amber);
  font-weight: 700;
}

.footer-bullet-links a.f-link-accent::before {
  color: var(--accent-amber);
}

.f-code {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-muted);
  min-width: 26px;
  flex-shrink: 0;
}

.footer-live-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--accent-emerald);
  text-decoration: none;
  padding-top: 8px;
  border-top: 1px dashed var(--border-subtle);
}

.footer-live-link:hover {
  text-decoration: underline;
}

.footer-desc {
  font-size: 0.82rem;
  line-height: 1.62;
  color: var(--text-secondary);
  margin: 0;
  overflow-wrap: break-word;
}

.footer-trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-emerald-soft);
  border: 1px solid rgba(16, 185, 129, 0.28);
  color: var(--accent-emerald);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.3;
}

.us-badge {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.7rem;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.2);
}

.footer-app-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #EF4444, #DC2626);
  color: #FFFFFF !important;
  font-size: 0.85rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
  transition: transform 0.15s ease, opacity 0.15s ease;
  text-align: center;
}

.footer-app-btn:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding-top: 22px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-copy-line {
  color: var(--text-secondary);
  font-weight: 500;
}

.footer-bottom-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-bottom-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.78rem;
}

.footer-bottom-links a:hover {
  color: var(--accent-emerald);
  text-decoration: underline;
}

.footer-bottom-links span {
  color: var(--border-color);
}

.footer-made-with {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Inner Authority / Legal / Methodology / Guide Page Styles */
.doc-hero {
  margin: 28px 0 22px;
  padding: 28px 30px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.doc-hero .badge {
  margin-bottom: 10px;
  display: inline-block;
}

.doc-hero h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.doc-hero p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 860px;
}

.doc-meta-bar {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.doc-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-lg);
}

.doc-content h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 26px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.doc-content h2:first-child {
  margin-top: 0;
}

.doc-content h3 {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 18px 0 8px;
}

.doc-content p,
.doc-content li {
  font-size: 0.92rem;
  line-height: 1.72;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.doc-content ul,
.doc-content ol {
  padding-left: 22px;
  margin-bottom: 14px;
}

.doc-content a {
  color: var(--accent-emerald);
  font-weight: 600;
  text-decoration: none;
}

.doc-content a:hover {
  text-decoration: underline;
}

.formula-box {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-sky);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: var(--text-primary);
  margin: 14px 0;
  overflow-x: auto;
}

/* Print-Only Elements */
.print-only {
  display: none;
}

/* Global Overflow & Grid Span Helpers */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.card,
.seo-card,
.kpi-card,
.field-group,
.footer-card,
.doc-hero,
.doc-content {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.span-2-col {
  grid-column: span 2;
}

/* ==========================================================================
   TABLET & COMPACT LAPTOP VIEWPORT (768px – 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
  .container {
    padding: 0 16px;
  }

  .header-inner {
    height: auto;
    min-height: 64px;
    padding: 10px 0;
    flex-wrap: wrap;
    gap: 10px;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
  }

  .theme-swatches {
    margin-left: auto;
  }

  .sub-nav-inner {
    flex-wrap: nowrap;
    overflow: hidden;
  }

  .sub-nav-links {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: 100%;
    padding-bottom: 2px;
  }

  .sub-nav-links::-webkit-scrollbar {
    display: none;
  }

  .sub-nav-link {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .sub-nav-cite {
    display: none;
  }

  .top-dashboard {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .rules-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .kpi-card.highlight {
    grid-column: 1 / -1;
    order: -1;
  }

  #timesheetTable {
    min-width: 710px;
  }

  #timesheetTable th,
  #timesheetTable td {
    padding: 8px 6px;
    font-size: 0.82rem;
  }

  .seo-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  /* 2x2 Bento Card Footer on Tablet */
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

/* ==========================================================================
   MOBILE VIEWPORT (320px – 767px) — NATIVE MOBILE APP EXPERIENCE
   ========================================================================== */
@media (max-width: 767px) {
  .container {
    padding: 0 12px;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }

  .header-inner {
    padding: 8px 0;
    gap: 8px;
  }

  .brand {
    width: 100%;
    gap: 10px;
  }

  .brand-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
  }

  .brand-title {
    font-size: 1rem;
  }

  .brand-sub {
    font-size: 0.68rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100vw - 80px);
  }

  .header-actions {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    padding-bottom: 2px;
  }

  .header-actions::-webkit-scrollbar {
    display: none;
  }

  .header-actions .btn,
  .header-actions .theme-swatches {
    flex-shrink: 0;
  }

  .header-actions .btn {
    padding: 6px 10px;
    font-size: 0.76rem;
  }

  .card {
    padding: 14px;
    border-radius: var(--radius-md);
  }

  .card-header {
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
  }

  .card-title {
    font-size: 0.94rem;
  }

  /* Live Shift Punch Clock Mobile Optimization */
  .punch-display {
    padding: 12px;
    gap: 10px;
    flex-wrap: wrap;
  }

  .punch-timer {
    font-size: 1.55rem;
  }

  .punch-earnings-val {
    font-size: 1.3rem;
  }

  .punch-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .punch-controls .btn {
    padding: 9px 6px;
    font-size: 0.75rem;
    justify-content: center;
  }

  /* US Payroll Rules Form Grid — Single Column on Mobile */
  .rules-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .span-2-col {
    grid-column: 1 / -1 !important;
  }

  /* 16px prevents iOS Safari auto-zoom on input focus */
  .input,
  .select {
    font-size: 16px;
    padding: 9px 10px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* KPI Summary Cards on Mobile */
  .kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
  }

  .kpi-card {
    padding: 12px;
  }

  .kpi-value {
    font-size: 1.25rem;
  }

  .kpi-card.highlight .kpi-value {
    font-size: 1.55rem;
  }

  /* Wage-Protection Audit Bar */
  #wageAuditBar {
    padding: 12px 14px !important;
    flex-direction: column;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  #wageAuditBar .badge {
    white-space: normal;
    text-align: left;
    line-height: 1.35;
  }

  /* Timesheet Toolbar Buttons — 2x2 Grid on Mobile */
  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .toolbar-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }

  .toolbar-group .btn {
    width: 100%;
    justify-content: center;
    font-size: 0.73rem;
    padding: 8px 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Transform Interactive Timesheet Table into Native Mobile Shift Cards */
  #timesheetSection .table-wrap {
    border: none;
    background: transparent;
    overflow-x: visible;
  }

  #timesheetTable {
    min-width: 100% !important;
    width: 100% !important;
    display: block;
  }

  #timesheetTable thead {
    display: none;
  }

  #timesheetTable tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }

  #timesheetTable tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    padding: 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
    width: 100%;
    box-sizing: border-box;
  }

  #timesheetTable tbody td {
    padding: 0;
    border: none;
    font-size: 0.86rem;
    min-width: 0;
  }

  #timesheetTable tbody tr:hover td {
    background: transparent;
  }

  #timesheetTable .td-day {
    grid-column: 1 / -1;
    padding-right: 36px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
  }

  #timesheetTable .day-cell {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.96rem;
  }

  #timesheetTable .td-clear {
    position: absolute;
    top: 10px;
    right: 10px;
  }

  #timesheetTable .td-clear .pill-btn {
    padding: 4px 9px;
    font-size: 0.78rem;
  }

  #timesheetTable .td-start,
  #timesheetTable .td-end {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
  }

  #timesheetTable .td-start::before,
  #timesheetTable .td-end::before,
  #timesheetTable .td-break::before {
    content: attr(data-label);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
  }

  #timesheetTable .td-break {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 2px;
  }

  #timesheetTable .td-break .input {
    width: 100% !important;
  }

  #timesheetTable .break-pills {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-top: 2px;
  }

  #timesheetTable .break-pills .pill-btn {
    padding: 7px 0;
    font-size: 0.76rem;
    text-align: center;
    font-weight: 600;
  }

  #timesheetTable .td-hhmm,
  #timesheetTable .td-dec,
  #timesheetTable .td-split,
  #timesheetTable .td-pay {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }

  #timesheetTable .td-hhmm::before,
  #timesheetTable .td-dec::before,
  #timesheetTable .td-split::before,
  #timesheetTable .td-pay::before {
    content: attr(data-label);
    font-family: var(--font-sans);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
  }

  /* Fix SEO Cards & 6-Column Conversion Table so zero right-side clipping occurs */
  .seo-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    margin: 20px 0 32px;
    width: 100%;
  }

  .seo-card {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .seo-card h2 {
    font-size: 1.02rem;
    line-height: 1.32;
  }

  .seo-card p,
  .seo-card li {
    font-size: 0.84rem;
    line-height: 1.58;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .conversion-table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    font-size: 0.71rem;
  }

  .conversion-table th,
  .conversion-table td {
    padding: 6px 2px;
    word-break: break-word;
  }

  /* Inner Authority Pages (About, Methodology, 50-State Laws, Guides) */
  .doc-hero {
    margin: 16px 0;
    padding: 18px 16px;
  }

  .doc-hero h1 {
    font-size: 1.35rem;
    line-height: 1.28;
  }

  .doc-hero p {
    font-size: 0.88rem;
  }

  .doc-meta-bar {
    flex-direction: column;
    gap: 6px;
  }

  .doc-content {
    padding: 18px 16px;
  }

  .doc-content h2 {
    font-size: 1.1rem;
  }

  .editorial-disclaimer-box {
    padding: 14px 16px;
    margin: 20px 0 28px;
    font-size: 0.8rem;
  }

  /* 2x2 Bento Card Footer on Mobile (Matching Image 2 Pattern) */
  .site-footer {
    padding: 28px 0 22px;
    margin-top: 24px;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding-bottom: 22px;
  }

  .footer-card {
    padding: 14px 11px;
    border-radius: 14px;
    gap: 10px;
  }

  .footer-col-title {
    font-size: 0.82rem;
    padding-bottom: 8px;
    margin-bottom: 9px;
    gap: 5px;
  }

  .footer-mini-logo {
    width: 22px;
    height: 22px;
  }

  .footer-links {
    gap: 7px;
  }

  .footer-links a {
    font-size: 0.74rem;
    line-height: 1.35;
    gap: 4px;
  }

  .f-code {
    font-size: 0.63rem;
    min-width: 22px;
  }

  .footer-live-link {
    font-size: 0.73rem;
    padding-top: 6px;
    gap: 5px;
  }

  .footer-desc {
    font-size: 0.74rem;
    line-height: 1.5;
  }

  .footer-trust-pill {
    font-size: 0.66rem;
    padding: 5px 8px;
    gap: 4px;
  }

  .us-badge {
    font-size: 0.62rem;
    padding: 1px 4px;
  }

  .footer-app-btn {
    padding: 9px 8px;
    font-size: 0.76rem;
  }

  .footer-bottom {
    gap: 8px;
    padding-top: 18px;
    font-size: 0.74rem;
  }

  .footer-bottom-links {
    gap: 6px;
  }

  .footer-bottom-links a {
    font-size: 0.73rem;
  }

  .footer-made-with {
    font-size: 0.72rem;
  }
}

/* Extra-Compact Phones (320px – 380px) */
@media (max-width: 380px) {
  .punch-controls {
    grid-template-columns: 1fr;
  }

  .toolbar-group {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #FFFFFF !important;
    color: #000000 !important;
  }
  .no-print, .site-header, .sub-nav, .punch-card, .parser-box, .seo-grid, .editorial-disclaimer-box, .site-footer, .break-pills, .toolbar {
    display: none !important;
  }
  .print-only {
    display: block !important;
  }
  .card, .kpi-card, .table-wrap {
    box-shadow: none !important;
    border: 1px solid #94A3B8 !important;
    background: #FFFFFF !important;
    color: #000000 !important;
  }
  .input, .select {
    border: none !important;
    background: transparent !important;
    color: #000000 !important;
    padding: 0 !important;
  }
  .kpi-strip {
    grid-template-columns: repeat(5, 1fr) !important;
  }
}
