/* ==========================================================================
   WorkHours — main stylesheet
   Structure: 1. Tokens  2. Base  3. Layout  4. Header/Nav  5. Buttons & forms
              6. Components  7. Calculators  8. Content  9. Footer
              10. Ad slots  11. Motion  12. Responsive  13. Print
   ========================================================================== */

/* 1. Tokens */
:root {
  --navy-900: #0a1f3d;
  --navy-800: #0f2b52;
  --navy-700: #163a6b;
  --blue-600: #1f5fae;
  --blue-100: #e8f0fb;
  --blue-50: #f4f8fd;
  --green-700: #0b6e4f;
  --green-600: #128160;
  --green-100: #e3f5ee;
  --red-700: #b42318;
  --red-50: #fef3f2;
  --amber-50: #fffaeb;
  --amber-700: #93510b;
  --gray-900: #111827;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-500: #6b7280;
  --gray-300: #d1d5db;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --white: #ffffff;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-num: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(10, 31, 61, .06);
  --shadow: 0 1px 3px rgba(10, 31, 61, .08), 0 8px 24px rgba(10, 31, 61, .06);
  --shadow-lg: 0 12px 40px rgba(10, 31, 61, .12);
  --container: 1160px;
  --gutter: 20px;
}

/* 2. Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--gray-900);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--blue-600); text-underline-offset: 2px; }
a:hover { color: var(--navy-800); }
h1, h2, h3, h4 { color: var(--navy-900); line-height: 1.25; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.75rem); font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); font-weight: 750; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }
ul, ol { padding-inline-start: 1.3em; margin: 0 0 1em; }
li { margin-bottom: .35em; }
table { border-collapse: collapse; width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #4d8fe0; outline-offset: 2px; border-radius: 4px; }
.skip-link {
  position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100;
  background: var(--navy-900); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm);
  font-weight: 600; text-decoration: none; transition: top .15s;
}
.skip-link:focus { top: 12px; color: #fff; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* 3. Layout */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.container-narrow { max-width: 820px; }
.section { padding: 64px 0; }
.section-alt { background: var(--blue-50); border-top: 1px solid var(--gray-200); border-bottom: 1px solid var(--gray-200); }
.section-head { max-width: 720px; margin: 0 auto 36px; text-align: center; }
.section-head p { color: var(--gray-600); font-size: 1.05rem; }
.eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--green-700); margin-bottom: 10px;
}
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* 4. Header / Nav */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--gray-200);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy-900); font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; }
.brand:hover { color: var(--navy-900); }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand span b { color: var(--green-700); font-weight: 800; }
.main-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; align-items: center; }
.main-nav li { margin: 0; }
.main-nav a {
  display: block; padding: 8px 12px; border-radius: var(--radius-sm);
  color: var(--gray-700); text-decoration: none; font-weight: 600; font-size: .95rem;
  transition: background .15s, color .15s;
}
.main-nav a:hover { background: var(--blue-50); color: var(--navy-900); }
.main-nav a[aria-current="page"] { color: var(--blue-600); background: var(--blue-100); }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--gray-300); border-radius: var(--radius-sm);
  width: 44px; height: 44px; cursor: pointer; color: var(--navy-900);
  align-items: center; justify-content: center;
}
.nav-toggle svg { width: 22px; height: 22px; }

.breadcrumbs { font-size: .88rem; color: var(--gray-500); padding-top: 16px; }
.breadcrumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs li { margin: 0; }
.breadcrumbs li + li::before { content: "/"; margin-inline-end: 6px; color: var(--gray-300); }
.breadcrumbs a { color: var(--gray-600); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }

/* 5. Buttons & forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 20px; border-radius: var(--radius-sm);
  font: inherit; font-weight: 700; font-size: .98rem; line-height: 1.2;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, transform .15s, box-shadow .15s;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy-800); color: #fff; }
.btn-primary:hover { background: var(--navy-700); color: #fff; box-shadow: var(--shadow); }
.btn-green { background: var(--green-600); color: #fff; }
.btn-green:hover { background: var(--green-700); color: #fff; box-shadow: var(--shadow); }
.btn-outline { background: #fff; color: var(--navy-800); border-color: var(--gray-300); }
.btn-outline:hover { border-color: var(--navy-700); color: var(--navy-900); }
.btn-ghost { background: transparent; color: var(--blue-600); padding: 8px 12px; min-height: 40px; }
.btn-ghost:hover { background: var(--blue-50); color: var(--navy-800); }
.btn-danger-ghost { background: transparent; color: var(--red-700); padding: 8px 10px; min-height: 40px; }
.btn-danger-ghost:hover { background: var(--red-50); }
.btn-lg { min-height: 54px; padding: 14px 28px; font-size: 1.05rem; }
.btn-icon { width: 40px; min-height: 40px; padding: 0; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field-label { font-weight: 650; font-size: .92rem; color: var(--gray-700); }
.field .hint { font-size: .82rem; color: var(--gray-500); }
.input, select.input {
  width: 100%; min-height: 46px; padding: 10px 12px;
  font: inherit; font-size: 1rem; color: var(--gray-900);
  background: #fff; border: 1px solid var(--gray-300); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.input:hover { border-color: #9ca3af; }
.input:focus { outline: none; border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(31, 95, 174, .18); }
.input[aria-invalid="true"] { border-color: var(--red-700); background: var(--red-50); }
.input-prefix, .input-suffix { position: relative; display: flex; align-items: center; }
.input-prefix > span, .input-suffix > span {
  position: absolute; color: var(--gray-500); font-weight: 600; pointer-events: none; font-size: .95rem;
}
.input-prefix > span { left: 12px; }
.input-prefix .input { padding-left: 28px; }
.input-suffix > span { right: 12px; }
.input-suffix .input { padding-right: 52px; }
.field-error { color: var(--red-700); font-size: .84rem; font-weight: 600; min-height: 0; }
.field-error:empty { display: none; }

.segmented { display: inline-flex; background: var(--gray-100); border-radius: 10px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.segmented label { position: relative; margin: 0; }
.segmented input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segmented span {
  display: block; padding: 8px 14px; border-radius: 7px; font-weight: 650; font-size: .9rem;
  color: var(--gray-600); cursor: pointer; transition: background .15s, color .15s;
}
.segmented input:checked + span { background: #fff; color: var(--navy-900); box-shadow: var(--shadow-sm); }
.segmented input:focus-visible + span { outline: 3px solid #4d8fe0; outline-offset: 1px; }

.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; color: var(--gray-700); cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--navy-800); flex: none; }

.time-field { display: flex; gap: 6px; min-width: 0; }
.time-field .input { min-width: 0; }
.time-field .ampm { width: 76px; flex: none; padding: 10px 6px; }
.fmt-24 .time-field .ampm { display: none; }

/* 6. Components */
.card {
  background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 28px;
}
.tool-card {
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
  height: 100%;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #c7d7ee; color: inherit; }
.tool-card h3 { margin-bottom: .4em; }
.tool-card p { color: var(--gray-600); font-size: .98rem; flex: 1; }
.tool-card .card-link { color: var(--blue-600); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.tool-card:hover .card-link svg { transform: translateX(3px); }
.card-link svg { width: 16px; height: 16px; transition: transform .2s; }
.icon-badge {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  background: var(--blue-100); color: var(--navy-800); margin-bottom: 18px;
}
.icon-badge svg { width: 26px; height: 26px; }
.icon-badge.green { background: var(--green-100); color: var(--green-700); }

.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--blue-50) 0%, #fff 100%);
  padding: 72px 0 64px; border-bottom: 1px solid var(--gray-200);
}
.hero::after {
  content: ""; position: absolute; inset-inline-end: -120px; top: -120px; width: 420px; height: 420px;
  border-radius: 50%; background: radial-gradient(circle, rgba(18, 129, 96, .10), transparent 70%);
  pointer-events: none;
}
.hero-inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.3rem); margin-bottom: .4em; }
.hero h1 .accent { color: var(--green-700); }
.hero .lead { font-size: 1.2rem; color: var(--gray-600); max-width: 560px; margin-bottom: 28px; }
.hero-points { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--gray-700); font-weight: 600; font-size: .95rem; }
.hero-points li { display: flex; align-items: center; gap: 8px; margin: 0; }
.hero-points svg { width: 18px; height: 18px; color: var(--green-600); }
.hero-preview { padding: 24px; }
.preview-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--gray-200); font-size: .95rem; }
.preview-row span:last-child { font-family: var(--font-num); font-weight: 600; }
.preview-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 16px; }
.preview-total > strong { font-size: 2rem; color: var(--green-700); font-family: var(--font-num); }

.page-hero { padding: 28px 0 8px; }
.page-hero .lead { font-size: 1.1rem; color: var(--gray-600); max-width: 760px; }

.steps { counter-reset: step; }
.step { position: relative; padding-top: 8px; }
.step-num {
  width: 40px; height: 40px; border-radius: 50%; background: var(--navy-800); color: #fff;
  display: grid; place-items: center; font-weight: 800; margin-bottom: 14px;
}

.feature { display: flex; gap: 16px; align-items: flex-start; }
.feature .icon-badge { margin: 0; width: 46px; height: 46px; flex: none; }
.feature h3 { font-size: 1.08rem; margin-bottom: .3em; }
.feature p { color: var(--gray-600); font-size: .97rem; margin: 0; }

.faq-list { max-width: 820px; margin: 0 auto; }
.faq-item { border: 1px solid var(--gray-200); border-radius: var(--radius); background: #fff; margin-bottom: 12px; overflow: hidden; }
.faq-item summary {
  list-style: none; cursor: pointer; padding-block: 18px; padding-inline: 20px 52px; font-weight: 700; color: var(--navy-900);
  position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: ""; position: absolute; inset-inline-end: 22px; top: 50%; width: 10px; height: 10px;
  border-right: 2px solid var(--gray-500); border-bottom: 2px solid var(--gray-500);
  transform: translateY(-70%) rotate(45deg); transition: transform .2s;
}
.faq-item[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq-item summary:hover { background: var(--blue-50); }
.faq-item .faq-body { padding: 0 20px 18px; color: var(--gray-700); }
.faq-item .faq-body p:last-child { margin-bottom: 0; }

.notice {
  border-radius: var(--radius); padding: 16px 18px; font-size: .95rem;
  background: var(--blue-50); border: 1px solid #cfdef3; color: var(--gray-700);
}
.notice strong { color: var(--navy-900); }
.notice-warn { background: var(--amber-50); border-color: #fde3a7; }
.notice-warn strong { color: var(--amber-700); }
.notice p:last-child { margin-bottom: 0; }

.resource-card { display: block; text-decoration: none; color: inherit; transition: transform .2s, box-shadow .2s; height: 100%; }
.resource-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); color: inherit; }
.resource-card .tag { font-size: .75rem; font-weight: 700; color: var(--green-700); text-transform: uppercase; letter-spacing: .06em; }
.resource-card h3 { margin: 8px 0 8px; font-size: 1.1rem; }
.resource-card p { color: var(--gray-600); font-size: .95rem; margin: 0; }

.cta-band { background: var(--navy-900); color: #dbe6f5; border-radius: var(--radius-lg); padding: 40px; display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cta-band h2 { color: #fff; margin-bottom: .2em; }
.cta-band p { margin: 0; }

/* 7. Calculators */
.calc-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 24px; }
.calc-panel { padding: 26px; }
.calc-panel h2 { font-size: 1.25rem; }
.calc-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 20px; }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--gray-200); }

.results { position: sticky; top: 88px; padding: 26px; border-top: 4px solid var(--green-600); }
.results h2 { font-size: 1.15rem; }
.result-main { background: var(--green-100); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.result-main .label { font-size: .85rem; font-weight: 700; color: var(--green-700); text-transform: uppercase; letter-spacing: .05em; }
.result-main .value { font-size: clamp(2rem, 4vw, 2.6rem); font-weight: 800; color: var(--green-700); font-family: var(--font-num); line-height: 1.15; word-break: break-word; }
.result-main .sub { color: var(--gray-700); font-size: .92rem; }
.result-list { list-style: none; padding: 0; margin: 0; }
.result-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--gray-100); margin: 0; font-size: .96rem; }
.result-list li span:first-child { color: var(--gray-600); }
.result-list li span:last-child { font-family: var(--font-num); font-weight: 700; color: var(--navy-900); text-align: end; }
.result-list li.highlight span:last-child { color: var(--green-700); }
.result-list li.total { border-bottom: 0; border-top: 2px solid var(--gray-200); margin-top: 4px; }
.result-list li.total span { font-weight: 800; color: var(--navy-900); }
.result-note { font-size: .82rem; color: var(--gray-500); margin-top: 14px; margin-bottom: 0; }
.results-empty { color: var(--gray-500); font-size: .95rem; }
.form-status { margin-top: 14px; }
.form-status:empty { display: none; }
.alert { border-radius: var(--radius-sm); padding: 12px 14px; font-size: .92rem; font-weight: 600; }
.alert-error { background: var(--red-50); color: var(--red-700); border: 1px solid #fecdca; }
.alert-ok { background: var(--green-100); color: var(--green-700); border: 1px solid #b4e3d1; }

.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--blue-100); color: var(--navy-800); margin-inline-start: 6px; vertical-align: middle; }

/* Shared result extras */
.result-h { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-500); margin: 20px 0 4px; }
.result-list small { font-weight: 500; color: var(--gray-500); }
.result-list li.negative span:last-child, .result-list li.negative span:first-child { color: var(--red-700); }
.badge-line { font-size: .9rem; color: var(--gray-600); margin: -4px 0 12px; }
.badge-green { background: var(--green-100); color: var(--green-700); }
.time-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.break-pair { display: flex; gap: 8px; }
.break-pair .input:first-child { flex: 1; min-width: 0; }
.break-pair select { width: 120px; flex: none; }

/* Other free tools (cards shown on each tool page) */
.tone-blue { --tone: var(--blue-600); --tone-bg: var(--blue-100); --tone-soft: #f5f9fe; }
.tone-green { --tone: var(--green-700); --tone-bg: var(--green-100); --tone-soft: #f4fbf8; }
.tone-amber { --tone: #9a5b00; --tone-bg: #fff1d6; --tone-soft: #fffbf3; }
.tool-icon { display: grid; place-items: center; flex: none; width: 56px; height: 56px; border-radius: 16px; background: var(--tone-bg); color: var(--tone); }
.tool-icon svg { width: 28px; height: 28px; }
.more-tools { margin-top: 48px; }
.more-tools-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 16px; }
.more-tools-head h2 { margin: 0; font-size: 1.45rem; }
.more-tools-head p { margin: 0; color: var(--gray-600); }
.other-tools-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.other-tool {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px 18px; padding: 22px; text-decoration: none; color: inherit;
  background: linear-gradient(135deg, var(--tone-soft), #fff 70%);
  border: 1px solid var(--gray-200); border-inline-start: 5px solid var(--tone); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
}
.other-tool:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); color: inherit; }
.other-tool .ot-body { display: flex; flex-direction: column; gap: 2px; flex: 1 1 calc(100% - 74px); min-width: 0; }
.ot-tag { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--tone); }
.other-tool strong { font-size: 1.15rem; color: var(--navy-900); line-height: 1.3; }
.ot-desc { font-size: .93rem; color: var(--gray-600); line-height: 1.45; }
.ot-cta {
  display: inline-flex; align-items: center; gap: 6px; flex: none; white-space: nowrap; margin-inline-start: 74px;
  padding: 10px 18px; border-radius: 999px; background: var(--tone); color: #fff; font-weight: 700; font-size: .92rem;
}
.ot-cta svg { width: 16px; height: 16px; transition: transform .2s; }
.other-tool:hover .ot-cta svg { transform: translateX(3px); }
.side-tools { display: grid; gap: 10px; }
.side-tools h2 { margin-bottom: 4px; }
.mini-tool {
  display: flex; align-items: center; gap: 12px; padding: 12px; text-decoration: none; color: inherit;
  border: 1px solid var(--gray-200); border-radius: var(--radius); background: var(--tone-soft);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.mini-tool:hover { border-color: var(--tone); box-shadow: var(--shadow); transform: translateY(-2px); color: inherit; }
.mini-tool .tool-icon { width: 44px; height: 44px; border-radius: 12px; }
.mini-tool .tool-icon svg { width: 22px; height: 22px; }
.mini-tool > span:not(.tool-icon) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mini-tool strong { color: var(--navy-900); font-size: .98rem; line-height: 1.3; }
.mini-tool small { color: var(--gray-600); font-size: .82rem; line-height: 1.4; }
.mini-tool > svg { width: 18px; height: 18px; color: var(--tone); flex: none; }
@media (max-width: 1024px) { .sidebar .side-tools { display: none; } }
@media (max-width: 860px) { .other-tools-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) {
  .other-tool { padding: 18px; }
  .ot-cta { width: 100%; margin-inline-start: 0; justify-content: center; padding: 12px 16px; }
}
@media print { .more-tools { display: none !important; } }

/* Pay Calculator modes + pay-rate converter */
.mode-switch { margin-top: 18px; }
.mode-switch span { padding: 10px 18px; font-size: .95rem; }
.mode-switch input:checked + span { background: var(--navy-800); color: #fff; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rc-settings { margin: 22px 0 0; padding: 16px 18px 6px; border: 1px solid var(--gray-200); border-radius: var(--radius); background: var(--blue-50); min-width: 0; }
.rc-settings legend { padding: 0 6px; font-weight: 700; font-size: .92rem; color: var(--navy-900); }
.rc-settings .input { background: #fff; }
.rc-hint { font-size: .84rem; color: var(--gray-500); margin: 12px 0 10px; }
@media (max-width: 640px) {
  .form-grid.cols-3 { grid-template-columns: 1fr; }
  .mode-switch { display: flex; width: 100%; }
  .mode-switch label { flex: 1; }
  .mode-switch span { text-align: center; padding: 10px 8px; font-size: .88rem; }
}

/* Currency picker (searchable combobox) */
.cur-field { margin-bottom: 18px; }
.combo { position: relative; }
.combo-input { padding-inline-end: 40px; cursor: pointer; text-overflow: ellipsis; }
.cur-field.open .combo-input { cursor: text; }
.combo-chevron { position: absolute; inset-inline-end: 12px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--gray-500); pointer-events: none; transition: transform .2s; }
.cur-field.open .combo-chevron { transform: translateY(-50%) rotate(180deg); }
.combo-list {
  position: absolute; z-index: 30; inset-inline: 0; top: calc(100% + 6px); max-height: 290px; overflow-y: auto;
  margin: 0; padding: 6px; list-style: none; background: #fff; border: 1px solid var(--gray-200);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.combo-opt { margin: 0; padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: .95rem; color: var(--gray-700); line-height: 1.4; }
.combo-opt.active { background: var(--blue-50); color: var(--navy-900); }
.combo-opt.selected { font-weight: 700; color: var(--navy-900); }
.combo-opt.selected::after { content: "\2713"; float: inline-end; color: var(--green-700); }
.combo-empty { margin: 0; padding: 12px; color: var(--gray-500); font-size: .92rem; }
@media print { .cur-field .hint, .combo-list, .combo-chevron { display: none !important; } }

/* Salary Breakdown */
.bd-head, .bd-row { display: grid; grid-template-columns: 14px minmax(0, 1.3fr) minmax(0, 1fr) 70px 40px; gap: 10px; align-items: center; }
.bd-head { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--gray-500); font-weight: 700; padding: 0 0 6px; border-bottom: 2px solid var(--gray-200); }
.bd-head span:nth-child(4) { text-align: end; }
.bd-row { padding: 10px 0; border-bottom: 1px solid var(--gray-100); }
.bd-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.bd-name .badge { margin: 0; flex: none; }
.bd-share { font-family: var(--font-num); font-weight: 700; font-size: .9rem; color: var(--gray-600); text-align: end; }
.bd-err { grid-column: 2 / -1; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: none; }
.bd-rate { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 4px; }
.bd-rate > div { background: var(--blue-50); border-radius: var(--radius); padding: 12px 14px; }
.bd-rate .label { display: block; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--gray-500); }
.bd-rate strong { font-family: var(--font-num); font-size: 1.5rem; color: var(--navy-900); }
.bd-over { margin-bottom: 14px; }
.donut-wrap { margin: 18px 0 0; }
.donut-title { font-weight: 700; color: var(--navy-900); margin-bottom: 10px; }
.donut-title small { font-weight: 500; color: var(--gray-500); }
.donut { position: relative; width: 100%; max-width: 240px; margin: 0 auto 14px; }
.donut svg { display: block; width: 100%; height: auto; }
.slice { stroke: #fff; stroke-width: 2; stroke-linejoin: round; transition: opacity .15s; cursor: pointer; outline: none; }
.slice.dim { opacity: .35; }
.slice:focus-visible { stroke: var(--navy-900); stroke-width: 3; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; padding: 0 70px; }
.dc-label { font-size: .75rem; color: var(--gray-500); font-weight: 600; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
.dc-value { font-family: var(--font-num); font-size: 1.05rem; color: var(--navy-900); line-height: 1.3; }
.dc-share { font-size: .78rem; color: var(--gray-600); font-weight: 600; }
.donut-table { font-size: .9rem; }
.donut-table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--gray-500); text-align: end; padding: 6px 4px; border-bottom: 1px solid var(--gray-200); }
.donut-table th:first-child, .donut-table td:first-child { text-align: start; }
.donut-table td { padding: 7px 4px; border-bottom: 1px solid var(--gray-100); text-align: end; font-family: var(--font-num); color: var(--navy-900); }
.donut-table td:first-child { font-family: var(--font); font-weight: 600; }
.donut-table td .swatch { margin-inline-end: 8px; vertical-align: -1px; }
.donut-table tr.active td { background: var(--blue-50); }

/* 8. Content */
.content { padding: 8px 0 24px; }
.prose { max-width: 760px; }
.prose h2 { margin-top: 1.8em; }
/* Keep section titles visible below the sticky header when jumping to #anchors. */
.prose h2[id], .prose h3[id], .toc { scroll-margin-top: 88px; }
.prose h3 { margin-top: 1.4em; }
.prose table { margin: 0 0 1.4em; font-size: .95rem; }
.prose th, .prose td { border: 1px solid var(--gray-200); padding: 9px 12px; text-align: start; }
.prose th { background: var(--blue-50); color: var(--navy-900); }
.prose .formula { background: var(--gray-100); border-inline-start: 4px solid var(--navy-700); padding: 12px 16px; border-start-end-radius: var(--radius-sm); border-end-end-radius: var(--radius-sm); font-family: var(--font-num); font-size: .95rem; margin: 0 0 1.2em; overflow-x: auto; }
.prose .example { background: var(--green-100); border-radius: var(--radius); padding: 16px 20px; margin: 0 0 1.4em; }
.prose .example p:last-child { margin: 0; }
.article-meta { color: var(--gray-500); font-size: .9rem; margin-bottom: 24px; }
.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: start; }
.sidebar { position: sticky; top: 92px; display: grid; gap: 18px; }
.sidebar .card { padding: 20px; }
.sidebar h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-500); }
.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { margin: 0; border-bottom: 1px solid var(--gray-100); }
.link-list li:last-child { border-bottom: 0; }
.link-list a { display: block; padding: 9px 0; text-decoration: none; font-weight: 600; font-size: .95rem; }
.related { margin-top: 48px; }
.toc { background: var(--blue-50); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 28px; }
.toc strong { display: block; margin-bottom: 6px; color: var(--navy-900); }
.toc ol { margin: 0; }

/* 9. Footer */
.site-footer { background: var(--navy-900); color: #b8c6da; margin-top: 64px; padding: 56px 0 28px; font-size: .95rem; }
.site-footer a { color: #dbe6f5; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer-grid h2 { color: #fff; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 8px; }
.site-footer .brand { color: #fff; margin-bottom: 12px; }
.site-footer .brand span b { color: #5fd3a8; }
.footer-grid h2.footer-contact-title { margin: 18px 0 6px; }
.footer-contact { margin: 0; word-break: break-all; }
.footer-contact a { color: #5fd3a8; font-weight: 600; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 40px; padding-top: 20px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; font-size: .85rem; }

/* 10. Ad slots — collapsed until real ad code is pasted inside.
   Kept away from calculator buttons (min 32px separation) to avoid accidental clicks. */
.ad-slot { margin: 40px auto; text-align: center; max-width: var(--container); padding: 0 var(--gutter); }
.ad-slot:empty { display: none; }
.ad-slot::before { content: "Advertisement"; display: block; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gray-500); margin-bottom: 6px; }

/* 11. Motion */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
.flash { animation: flash .6s ease; }
@keyframes flash { 0% { background: #c9efdf; } 100% { background: var(--green-100); } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* 12. Responsive */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .content-layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; }
}
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-preview { max-width: 520px; }
  .calc-layout { grid-template-columns: 1fr; }
  .results { position: static; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
/* Menu collapses below 1024px: between ~860 and 1020px the full menu + language switcher wraps onto two lines. */
@media (max-width: 1023px) {
  .nav-toggle { display: inline-flex; }
  .main-nav {
    position: absolute; left: 0; right: 0; top: 68px; background: #fff; border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow); display: none;
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; padding: 10px var(--gutter) 16px; gap: 2px; }
  .main-nav a { padding: 12px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  :root { --gutter: 16px; }
  .section { padding: 48px 0; }
  .hero { padding: 48px 0; }
  .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .card, .calc-panel, .results { padding: 20px; }
  .time-pair { grid-template-columns: 1fr; }
  .bd-head { display: none; }
  .bd-row { grid-template-columns: 14px minmax(0, 1fr) 40px; row-gap: 8px; }
  .bd-row .bd-name { grid-column: 2 / 3; }
  .bd-row .bd-del { grid-column: 3 / 4; grid-row: 1; }
  .bd-row .bd-amount { grid-column: 2 / 3; }
  .bd-row .bd-share { grid-column: 3 / 4; }
  .footer-grid { grid-template-columns: 1fr; }
  .cta-band { padding: 28px; }
  .prose table { display: block; overflow-x: auto; }
}

/* 12b. Languages: switcher, Arabic typography, right-to-left layout */
.lang-item { margin-inline-start: 8px; }
.lang-switch { display: flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--gray-200); border-radius: 999px; background: var(--gray-100); }
.lang-switch > svg { width: 18px; height: 18px; color: var(--gray-500); margin: 0 4px 0 6px; flex: none; }
.main-nav .lang-switch a { padding: 5px 10px; border-radius: 999px; font-size: .82rem; font-weight: 700; color: var(--gray-600); line-height: 1.3; }
.main-nav .lang-switch a:hover { background: #fff; color: var(--navy-900); }
.main-nav .lang-switch a[aria-current="true"] { background: var(--navy-800); color: #fff; }
@media (max-width: 1023px) {
  .lang-item { margin: 10px 0 0; padding-top: 12px; border-top: 1px solid var(--gray-200); }
  .lang-switch { justify-content: center; }
  .main-nav .lang-switch a { flex: 1; text-align: center; padding: 9px 10px; font-size: .9rem; }
}

:lang(fr) .ad-slot::before { content: "Publicité"; }
:lang(ar) .ad-slot::before { content: "إعلان"; }

html[lang="ar"] body {
  font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", "Geeza Pro", "Arabic Typesetting", Arial, sans-serif;
  line-height: 1.85;
}
/* Letter-spacing breaks the joining of Arabic letters. */
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3, html[lang="ar"] .eyebrow, html[lang="ar"] .ot-tag,
html[lang="ar"] .label, html[lang="ar"] .result-h, html[lang="ar"] .bd-head, html[lang="ar"] .sidebar h2,
html[lang="ar"] .footer-grid h2, html[lang="ar"] .donut-table th, html[lang="ar"] .ad-slot::before { letter-spacing: 0; }
html[lang="ar"] h1 { line-height: 1.4; }
html[lang="ar"] h2, html[lang="ar"] h3 { line-height: 1.5; }

/* Numbers, money, times and inputs stay left-to-right inside Arabic text. */
[dir="rtl"] .input-prefix, [dir="rtl"] .input-suffix { direction: ltr; }
[dir="rtl"] .input-prefix .input, [dir="rtl"] .input-suffix .input { text-align: left; }
[dir="rtl"] .input-suffix > span { font-size: .85rem; }
[dir="rtl"] .time-input, [dir="rtl"] #wh-break { direction: ltr; text-align: right; }
[dir="rtl"] .result-main .value, [dir="rtl"] .preview-total > strong { direction: ltr; text-align: right; }
[dir="rtl"] .bd-share, [dir="rtl"] .bd-rate strong { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .brand { direction: ltr; }
[dir="rtl"] .formula { font-family: var(--font); }
/* Monospace fonts can't join Arabic letters: use the Arabic UI font with fixed-width digits instead. */
html[lang="ar"] .result-list li span:last-child, html[lang="ar"] .donut-table td, html[lang="ar"] .bd-share,
html[lang="ar"] .preview-row span:last-child, html[lang="ar"] .bd-rate strong, html[lang="ar"] .dc-value {
  font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif; font-variant-numeric: tabular-nums;
}

/* Arrows point the other way in right-to-left pages. */
[dir="rtl"] svg.arrow, [dir="rtl"] .card-link svg, [dir="rtl"] .ot-cta svg, [dir="rtl"] .mini-tool > svg { transform: scaleX(-1); }
[dir="rtl"] .tool-card:hover .card-link svg, [dir="rtl"] .other-tool:hover .ot-cta svg { transform: scaleX(-1) translateX(3px); }
[dir="rtl"] .hero::after { background: radial-gradient(circle, rgba(18, 129, 96, .10), transparent 70%); }
[dir="rtl"] .other-tool { background: linear-gradient(225deg, var(--tone-soft), #fff 70%); }
[dir="rtl"] .lang-switch > svg { margin: 0 6px 0 4px; }

/* 13. Print — timesheets and results print cleanly / save as PDF */
@media print {
  @page { margin: 14mm; }
  body { font-size: 11pt; color: #000; }
  .site-header, .site-footer, .breadcrumbs, .ad-slot, .no-print, .form-actions, .nav-toggle,
  .calc-toolbar .btn, .tool-content, .related, .skip-link, .sidebar { display: none !important; }
  .calc-layout { display: block; margin: 0; }
  .card { box-shadow: none; border: 1px solid #999; break-inside: avoid; }
  .results { position: static; border-top: 2px solid #000; margin-top: 12px; }
  .input { border: 0; border-bottom: 1px solid #999; border-radius: 0; min-height: auto; padding: 2px 4px; background: none; }
  .result-main { background: none; border: 1px solid #999; }
  a { color: #000; text-decoration: none; }
  .reveal { opacity: 1 !important; transform: none !important; }
  select.ampm { appearance: none; -webkit-appearance: none; border: 0; }
  .bd-del, .bd-add-row { display: none !important; }
  .swatch, .slice, .bd-rate > div { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .page-hero .lead { display: none; }
}
