:root {
    --ink: #15323a;
    --ink-strong: #08262e;
    --muted: #587078;
    --teal: #08777b;
    --teal-dark: #075e62;
    --teal-soft: #e3f5f3;
    --lime: #cfe869;
    --cream: #f7f5ed;
    --white: #fff;
    --line: #d7e1df;
    --line-strong: #b9cbc8;
    --error: #a63c32;
    --error-soft: #fff0ed;
    --shadow: 0 18px 55px rgba(14, 48, 55, .09);
    --shadow-small: 0 7px 22px rgba(14, 48, 55, .08);
    --radius: 18px;
    --radius-small: 10px;
    --container: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--white);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
body::selection { background: var(--lime); color: var(--ink-strong); }
a { color: inherit; }
button, input, select { font: inherit; }
button { color: inherit; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { color: var(--ink-strong); line-height: 1.15; letter-spacing: -.025em; }
h1 { font-size: clamp(2.25rem, 5vw, 4.5rem); margin-bottom: 1.25rem; }
h2 { font-size: clamp(1.65rem, 3vw, 2.6rem); margin-bottom: 1rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }

.container { width: min(calc(100% - 40px), var(--container)); margin-inline: auto; }
.is-hidden { display: none !important; }
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
.clipboard-fallback { position: fixed; left: -9999px; top: 0; opacity: 0; }
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 1000; padding: .7rem 1rem; border-radius: 8px; background: var(--ink-strong); color: #fff; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 3px solid #d0a900; outline-offset: 3px; }

.site-header { position: relative; z-index: 20; border-bottom: 1px solid rgba(215, 225, 223, .8); background: rgba(255, 255, 255, .95); }
.header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--ink-strong); font-size: 1.2rem; font-weight: 800; text-decoration: none; letter-spacing: -.03em; }
.brand-mark { width: 36px; height: 36px; }
.brand-mark rect { fill: var(--teal); }
.brand-mark circle, .brand-mark path { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.primary-nav { display: flex; align-items: center; gap: 1.8rem; }
.primary-nav a { color: var(--muted); font-size: .92rem; font-weight: 680; text-decoration: none; }
.primary-nav a:hover, .primary-nav a[aria-current="page"] { color: var(--teal-dark); }
.primary-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--lime); text-decoration-thickness: 3px; text-underline-offset: 7px; }
.nav-toggle { display: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 9px; background: #fff; align-items: center; justify-content: center; flex-direction: column; gap: 4px; cursor: pointer; }
.nav-toggle > span:not(.sr-only) { width: 19px; height: 2px; background: var(--ink); }

.eyebrow { margin-bottom: .75rem; color: var(--teal-dark); font-size: .76rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.lead, .hero-lead { color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.25rem); line-height: 1.7; }
.muted, .field-help { color: var(--muted); }
.field-help { margin: .4rem 0 0; font-size: .82rem; line-height: 1.45; }
.button-row { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.75rem 0; }
.button {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .7rem 1.15rem;
    border: 1px solid transparent;
    border-radius: 9px;
    font-weight: 760;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
}
.button-primary { background: var(--teal); color: #fff; box-shadow: 0 7px 18px rgba(8, 119, 123, .2); }
.button-primary:hover { background: var(--teal-dark); }
.button-secondary { border-color: var(--line-strong); background: #fff; color: var(--ink-strong); }
.button-secondary:hover { border-color: var(--teal); color: var(--teal-dark); background: #f8ffff; }
.text-link, .prose a:not(.button):not(.tool-card) { color: var(--teal-dark); font-weight: 680; text-underline-offset: 3px; }
.text-button { padding: .15rem; border: 0; background: transparent; color: var(--teal-dark); font-size: .79rem; font-weight: 750; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; cursor: pointer; }
.text-button:hover { text-decoration-color: currentColor; }
.danger-text { color: var(--error); }

.hero { position: relative; overflow: hidden; padding: clamp(4.5rem, 9vw, 8rem) 0; background: var(--cream); }
.hero::before { content: ""; position: absolute; width: 440px; height: 440px; right: -150px; top: -210px; border-radius: 50%; background: rgba(207, 232, 105, .65); filter: blur(2px); }
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, .9fr); gap: clamp(3rem, 8vw, 7rem); align-items: center; }
.hero-copy h1 { max-width: 780px; }
.hero-lead { max-width: 680px; }
.trust-list { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; margin: 1.5rem 0 0; padding: 0; list-style: none; color: var(--muted); font-size: .9rem; font-weight: 650; }
.trust-list li::before { content: "✓"; margin-right: .42rem; color: var(--teal); font-weight: 900; }
.hero-demo { padding: 1.25rem; border: 1px solid rgba(185, 203, 200, .75); border-radius: 22px; background: rgba(255, 255, 255, .92); box-shadow: var(--shadow); transform: rotate(1.2deg); }
.demo-topline, .demo-row, .demo-total { display: grid; align-items: center; gap: .75rem; }
.demo-topline { grid-template-columns: 1fr auto; padding: .2rem .2rem 1rem; font-weight: 800; }
.status-dot { padding: .2rem .55rem; border-radius: 99px; background: var(--teal-soft); color: var(--teal-dark); font-size: .7rem; }
.demo-row { grid-template-columns: 42px 1fr auto; padding: .85rem .2rem; border-top: 1px solid var(--line); font-size: .86rem; }
.demo-row > span:nth-child(2) { color: var(--muted); }
.demo-total { margin-top: .75rem; padding: 1rem; border-radius: 12px; background: var(--ink-strong); color: #fff; grid-template-columns: 1fr auto; }
.demo-total > strong { font-size: 1.2rem; }
.demo-total small { grid-column: 1 / -1; color: #cfe0e2; }

.section-block { padding-top: clamp(4rem, 8vw, 7rem); padding-bottom: clamp(4rem, 8vw, 7rem); }
.section-heading { margin-bottom: 2rem; }
.split-heading { display: grid; grid-template-columns: 1fr minmax(280px, .52fr); gap: 3rem; align-items: end; }
.split-heading > p { margin-bottom: 1rem; color: var(--muted); }
.tool-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.tool-card { display: flex; gap: 1rem; min-height: 135px; padding: 1.35rem; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; background: #fff; box-shadow: var(--shadow-small); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.tool-card:hover { transform: translateY(-3px); border-color: var(--teal); box-shadow: var(--shadow); }
.tool-card.featured { background: var(--teal); color: #fff; border-color: var(--teal); }
.tool-card.featured strong, .tool-card.featured small { color: #fff; }
.tool-card-icon { flex: 0 0 42px; width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--teal-soft); color: var(--teal-dark); font-size: .75rem; font-weight: 850; }
.featured .tool-card-icon { background: var(--lime); color: var(--ink-strong); }
.tool-card strong { display: block; margin: .15rem 0 .4rem; color: var(--ink-strong); font-size: 1.05rem; }
.tool-card small { display: block; color: var(--muted); font-size: .88rem; line-height: 1.55; }
.tool-card-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tool-card-grid.compact .tool-card { min-height: 145px; }
.soft-section { padding: clamp(4rem, 8vw, 7rem) 0; background: var(--ink-strong); color: #c9dadd; }
.soft-section h2, .soft-section strong { color: #fff; }
.soft-section .eyebrow { color: var(--lime); }
.feature-grid { display: grid; grid-template-columns: .7fr 1.3fr; gap: clamp(3rem, 8vw, 7rem); }
.feature-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.feature-list article { padding: 1.25rem; border: 1px solid rgba(255, 255, 255, .12); border-radius: 14px; background: rgba(255, 255, 255, .04); }
.feature-list p { margin: .35rem 0 0; color: #a9c0c4; font-size: .9rem; }

.breadcrumbs { padding-top: 1.15rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; color: var(--muted); font-size: .78rem; list-style: none; }
.breadcrumbs li + li::before { content: "/"; margin-right: .4rem; color: var(--line-strong); }
.breadcrumbs a { text-underline-offset: 2px; }
.content-page, .not-found { max-width: 820px; padding-top: clamp(3rem, 6vw, 5rem); padding-bottom: clamp(5rem, 9vw, 8rem); }
.not-found { text-align: center; }
.not-found .button-row { justify-content: center; }
.prose { color: var(--ink); }
.prose.narrow { max-width: 820px; }
.prose h2 { margin-top: 2.7rem; }
.prose h3 { margin-top: 2rem; }
.prose p, .prose li { max-width: 78ch; }
.prose li + li { margin-top: .55rem; }
.prose details { padding: 1rem 0; border-top: 1px solid var(--line); }
.prose details:last-of-type { border-bottom: 1px solid var(--line); }
.prose summary { color: var(--ink-strong); font-weight: 750; cursor: pointer; }
.prose details p { margin: .75rem 0 0; color: var(--muted); }
.contact-card { margin: 2rem 0; padding: 1.5rem; border-radius: var(--radius); background: var(--cream); }

.calculator-intro { max-width: 900px; padding-top: clamp(3.5rem, 7vw, 6rem); padding-bottom: 2.5rem; text-align: center; }
.calculator-intro h1 { font-size: clamp(2.35rem, 5.5vw, 4rem); }
.calculator-intro .lead { max-width: 780px; margin-inline: auto; }
.calculator-shell { display: grid; grid-template-columns: minmax(0, 1fr) 355px; align-items: start; gap: 1.25rem; padding-bottom: 2rem; }
.calculator-main, .settings-card, .results-card, .simple-calculator-card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-small); }
.calculator-main { padding: clamp(1rem, 2.5vw, 1.5rem); }
.calculator-toolbar, .week-heading, .day-heading, .day-footer, .card-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.calculator-toolbar { margin-bottom: 1rem; }
.calculator-toolbar h2, .card-heading h2 { margin: 0; font-size: 1.25rem; }
.calculator-sidebar { position: sticky; top: 1rem; display: grid; gap: 1rem; }
.settings-card, .results-card { padding: 1.25rem; }
.settings-card h2, .results-card h2 { font-size: 1.2rem; }
.results-card .eyebrow { margin-bottom: .3rem; }

.segmented-control { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: #f3f7f6; }
.segmented-control label { cursor: pointer; }
.segmented-control input { position: absolute; opacity: 0; pointer-events: none; }
.segmented-control span { display: block; padding: .48rem .75rem; border-radius: 7px; color: var(--muted); font-size: .79rem; font-weight: 750; line-height: 1.2; }
.segmented-control input:checked + span { background: #fff; color: var(--teal-dark); box-shadow: 0 2px 8px rgba(14, 48, 55, .1); }
.segmented-control input:focus-visible + span { outline: 3px solid #d0a900; outline-offset: 2px; }
.segmented-control.wide { display: grid; grid-template-columns: 1fr 1fr; margin: 1.4rem 0; }
.segmented-control.wide span { height: 100%; display: flex; align-items: center; justify-content: center; text-align: center; }

.week-card { border-top: 1px solid var(--line); }
.week-heading { padding: 1.15rem .25rem .8rem; }
.week-heading h3 { margin: 0; font-size: 1rem; }
.day-row { padding: .9rem 0; border-top: 1px solid #e8eeee; }
.day-heading { margin-bottom: .55rem; }
.day-heading h4 { margin: 0; }
.day-actions { display: flex; gap: .7rem; }
.shift-list { display: grid; gap: .55rem; }
.shift-row { position: relative; display: grid; grid-template-columns: 1fr 1fr 1.1fr 90px; gap: .55rem; align-items: end; }
.shift-row.has-error input { border-color: var(--error); background: var(--error-soft); }
.shift-row label, .form-grid label, .tool-fields > label, .compact-select { display: grid; gap: .3rem; color: var(--ink); font-size: .77rem; font-weight: 730; }
input, select { width: 100%; min-height: 42px; padding: .55rem .65rem; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--ink-strong); line-height: 1.2; }
input:hover, select:hover { border-color: #8ba9a5; }
input:focus, select:focus { border-color: var(--teal); outline: 3px solid rgba(8, 119, 123, .13); }
input::placeholder { color: #8fa2a6; }
.input-suffix, .input-prefix { display: flex; align-items: stretch; border: 1px solid var(--line-strong); border-radius: 8px; background: #f5f8f7; overflow: hidden; }
.input-suffix:focus-within, .input-prefix:focus-within { border-color: var(--teal); outline: 3px solid rgba(8, 119, 123, .13); }
.input-suffix input, .input-prefix input { min-width: 0; border: 0; border-radius: 0; outline: 0; }
.input-suffix > span, .input-prefix > span { display: flex; align-items: center; padding: 0 .55rem; color: var(--muted); font-size: .72rem; white-space: nowrap; }
.shift-total { align-self: end; min-height: 42px; display: flex; align-items: center; justify-content: flex-end; color: var(--ink-strong); font-size: .78rem; font-weight: 780; text-align: right; }
.icon-button { position: absolute; right: -8px; top: -8px; width: 25px; height: 25px; display: flex; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--error); font-size: 1.15rem; line-height: 1; cursor: pointer; }
.day-footer { margin-top: .55rem; }
.day-total { font-size: .85rem; }
.week-total { display: flex; align-items: center; justify-content: flex-end; gap: 1rem; padding: 1rem .2rem 0; border-top: 1px solid var(--line); color: var(--muted); }
.week-total strong { min-width: 100px; color: var(--ink-strong); text-align: right; }
.form-message { min-height: 1.35rem; margin: .4rem 0; color: var(--teal-dark); font-size: .8rem; font-weight: 650; }
.form-message.is-error { color: var(--error); }
.form-grid { display: grid; gap: .8rem; }
.form-grid.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full-width { grid-column: 1 / -1; }
.result-primary { margin: 1rem 0; padding: 1rem; border-radius: 12px; background: var(--teal-soft); }
.result-primary strong { display: block; color: var(--teal-dark); font-size: 2rem; line-height: 1.2; letter-spacing: -.035em; }
.result-primary span { color: var(--muted); font-size: .8rem; }
.result-list { margin: 0; }
.result-list > div { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid #edf1f0; font-size: .83rem; }
.result-list dt { color: var(--muted); }
.result-list dd { margin: 0; color: var(--ink-strong); font-weight: 750; text-align: right; }
.result-list .result-total { margin-top: .25rem; padding-top: .8rem; border-bottom: 0; font-size: .9rem; }
.result-list .result-total dd { color: var(--teal-dark); font-size: 1.1rem; }
.result-note { margin: .85rem 0; color: var(--muted); font-size: .72rem; line-height: 1.45; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.action-grid .button { min-height: 40px; padding: .5rem; font-size: .76rem; }
.results-card > .danger-text { display: block; margin: .8rem auto 0; }

.small-calculator-shell { max-width: 720px; padding-bottom: 1rem; }
.simple-calculator-card { padding: clamp(1.25rem, 4vw, 2rem); }
.simple-calculator-card h2 { margin: 0; font-size: 1.35rem; }
.tool-fields { margin: 1.25rem 0 .5rem; }
.compact-select { grid-template-columns: auto 100px; align-items: center; }
.compact-select select { min-height: 38px; padding: .4rem .5rem; }
.simple-result { margin: 1.25rem 0; padding: 1.4rem; border-radius: 14px; background: var(--ink-strong); color: #fff; text-align: center; }
.simple-result > span { display: block; color: #bcd0d3; font-size: .75rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.simple-result strong { display: block; margin: .35rem 0; color: #fff; font-size: clamp(2rem, 8vw, 3.25rem); line-height: 1.15; letter-spacing: -.04em; }
.simple-result small { color: var(--lime); }
.simple-calculator-card > .button { width: 100%; }
.content-after-calculator { max-width: 900px; padding-top: 3rem; padding-bottom: 6rem; }
.formula { max-width: 720px; margin: 1.5rem 0; padding: 1rem 1.2rem; border-left: 4px solid var(--lime); border-radius: 0 10px 10px 0; background: var(--cream); color: var(--ink-strong); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88rem; font-weight: 700; }
.related-tools { padding-bottom: 0; }

.site-footer { padding: 4rem 0 1.5rem; background: #061f26; color: #a9c0c4; }
.footer-grid { display: grid; grid-template-columns: 1.3fr .7fr .7fr; gap: 3rem; }
.footer-brand { color: #fff; }
.footer-grid > div:first-child p { max-width: 390px; }
.footer-grid h2 { margin-bottom: 1rem; color: #fff; font-size: .84rem; letter-spacing: .08em; text-transform: uppercase; }
.footer-grid ul { margin: 0; padding: 0; list-style: none; }
.footer-grid li + li { margin-top: .5rem; }
.footer-grid a:not(.brand) { color: #b8cccf; font-size: .87rem; text-underline-offset: 3px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .75rem; }
.footer-bottom p { margin: 0; }

@media (max-width: 980px) {
    .primary-nav { gap: 1rem; }
    .primary-nav a { font-size: .82rem; }
    .hero-grid { grid-template-columns: 1fr .8fr; gap: 3rem; }
    .calculator-shell { grid-template-columns: 1fr; }
    .calculator-sidebar { position: static; grid-template-columns: .85fr 1.15fr; }
    .tool-card-grid.compact { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
    .container { width: min(calc(100% - 28px), var(--container)); }
    .header-inner { min-height: 66px; }
    .nav-toggle { display: flex; }
    .primary-nav { position: absolute; top: calc(100% + 1px); left: 0; right: 0; display: none; padding: .7rem 14px 1rem; border-bottom: 1px solid var(--line); background: #fff; box-shadow: var(--shadow-small); }
    .primary-nav.is-open { display: grid; }
    .primary-nav a { padding: .7rem; border-radius: 7px; font-size: .95rem; }
    .primary-nav a:hover { background: var(--teal-soft); }
    .hero-grid, .split-heading, .feature-grid { grid-template-columns: 1fr; }
    .hero-demo { transform: none; }
    .tool-card-grid, .tool-card-grid.compact, .feature-list { grid-template-columns: 1fr; }
    .tool-card { min-height: 120px; }
    .calculator-toolbar { align-items: flex-start; flex-direction: column; }
    .shift-row { grid-template-columns: 1fr 1fr; padding: .55rem; border: 1px solid var(--line); border-radius: 10px; }
    .shift-row label:nth-child(3) { grid-column: 1 / -1; }
    .shift-total { grid-column: 1 / -1; justify-content: flex-start; min-height: auto; padding-top: .2rem; }
    .calculator-sidebar { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-grid > div:first-child { grid-column: 1 / -1; }
    .footer-bottom { flex-direction: column; }
}

@media (max-width: 480px) {
    h1 { font-size: 2.25rem; }
    .hero { padding: 4rem 0; }
    .demo-row { grid-template-columns: 36px 1fr; }
    .demo-row strong { grid-column: 2; }
    .button-row .button { width: 100%; }
    .form-grid.two-columns { grid-template-columns: 1fr; }
    .form-grid .full-width { grid-column: auto; }
    .segmented-control.wide { grid-template-columns: 1fr; }
    .calculator-main { padding: .8rem; border-left: 0; border-right: 0; border-radius: 0; box-shadow: none; }
    .calculator-shell { width: 100%; }
    .calculator-sidebar { width: min(calc(100% - 28px), var(--container)); margin-inline: auto; }
    .day-heading { align-items: flex-start; }
    .day-actions { gap: .35rem; }
    .action-grid { grid-template-columns: 1fr; }
    .compact-select { grid-template-columns: 1fr; }
}

@media print {
    @page { margin: 12mm; }
    .site-header, .site-footer, .breadcrumbs, .calculator-intro, .settings-card, .content-after-calculator, .calculator-toolbar .segmented-control, .day-actions, .add-shift, .copy-week, .action-grid, .danger-text, .form-message { display: none !important; }
    body { color: #000; background: #fff; font-size: 10pt; }
    .calculator-shell { display: block; width: 100%; }
    .calculator-main, .results-card { border: 0; box-shadow: none; padding: 0; }
    .calculator-sidebar { display: block; position: static; }
    .results-card { margin-top: 8mm; break-inside: avoid; }
    .week-card.is-hidden { display: none !important; }
    .shift-row { grid-template-columns: 1fr 1fr 1fr 90px; }
    input, select { min-height: auto; padding: 2px; border: 0; }
    .input-suffix, .input-prefix { border: 0; }
    .result-primary { background: #eee; }
}
