/* Free tools (SPE-234). Standalone stylesheet; visual language follows the public invoice tool. */
:root {
    --ink: #193653;
    --muted: #5c7189;
    --line: #d8e5f2;
    --line-strong: #b5cce4;
    --paper: #fff;
    --wash: #f3f8fe;
    --accent: #2563eb;
    --accent-dark: #1d4ed8;
    --accent-soft: #eaf2ff;
    --error: #b42318;
    --warn-bg: #fff8e6;
    --warn-line: #f5d58a;
    --shadow: 0 12px 32px rgba(30, 64, 110, .08);
    --radius: 18px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-width: 320px;
    background: radial-gradient(circle at 88% -8%, #d7eaff 0, transparent 28rem), #f3f7fc;
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-dark); }
h1, h2, h3, h4 { letter-spacing: -.02em; line-height: 1.2; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -48px; background: var(--paper); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip-link:focus { top: 8px; }

/* ---------- Header ---------- */
.tool-header { background: rgba(255, 255, 255, .86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.tool-header-inner { max-width: 1200px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 760; text-decoration: none; }
.brand img { border-radius: 9px; }
.tool-nav { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.tool-nav-link { font-weight: 650; font-size: 14px; text-decoration: none; white-space: nowrap; }
.tool-language select { padding: 7px 10px; }

main { max-width: 1200px; margin: 0 auto; padding: 20px 16px 48px; display: flex; flex-direction: column; gap: 20px; }
main > *, .tool-form > * { min-width: 0; }
/* Positioned so visually hidden labels inside scrolling tables stay inside the scroll container. */
.tool-table-wrap, .es-grid-wrap, .wh-table { position: relative; }
.breadcrumbs { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs a { color: var(--muted); }

/* ---------- Intro ---------- */
.tool-intro {
    display: flex; gap: 20px; align-items: center;
    background: linear-gradient(118deg, #173b69 0%, #1d5db2 59%, #2789dc 145%);
    color: #fff; border-radius: 22px; padding: 28px; box-shadow: 0 16px 40px rgba(25, 67, 123, .18);
}
.tool-intro-icon { flex: 0 0 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 24px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); }
.tool-intro h1 { margin: 0; font-size: clamp(26px, 4vw, 38px); }
.tool-intro .lead { margin: 10px 0 0; color: rgba(255, 255, 255, .86); max-width: 760px; }
.eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-dark); }
.tool-intro .eyebrow { color: #bfdbfe; }

/* ---------- Form ---------- */
.tool-form { display: flex; flex-direction: column; gap: 20px; }
.tool-card, .tool-result, .tool-content > article { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; min-width: 0; }
.tool-card h2, .tool-result h2 { margin: 0 0 16px; font-size: 20px; }
.tool-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); align-items: start; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: #304f70; min-width: 0; }
input, select, textarea { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover { border-color: #8fb0d3; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(37, 99, 235, .15); outline: none; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; padding: 0; accent-color: var(--accent); }
.tool-field-hint, .tool-hint { font-size: 13px; font-weight: 400; color: var(--muted); margin: 0; }
.tool-card > .tool-hint { margin: -6px 0 16px; }
.tool-fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 16px 0 0; min-width: 0; }
.tool-fieldset legend { font-weight: 700; font-size: 14px; padding: 0 6px; }
.tool-segmented { border: 0; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.tool-segmented legend { font-size: 13px; font-weight: 700; color: #304f70; margin-bottom: 8px; padding: 0; width: 100%; }
.tool-segmented label, .tool-check, .tool-day { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; }
.tool-segmented label { padding: 9px 14px; border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; }
.tool-segmented label:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); }
.tool-check { align-self: end; min-height: 44px; }
.tool-weekdays { border: 0; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.tool-weekdays legend { width: 100%; padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 700; color: #304f70; }
.tool-day { padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer; }
.tool-day:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }
.tool-inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.tool-inline label { flex: 1 1 180px; }
.tool-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.tool-secondary, .tool-cta-button {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 9px 16px;
    border-radius: 10px; border: 1px solid #c5dafa; background: #edf4ff; color: var(--accent-dark); font-weight: 700; cursor: pointer; text-decoration: none;
}
.tool-secondary:hover { background: #dceaff; }
.tool-icon-button { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer; }
.tool-icon-button:hover { color: var(--error); border-color: #f3c2bd; }
.tool-error { margin: 0; padding: 12px 16px; border-radius: 12px; background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; font-weight: 600; }
.tool-note { margin: 12px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--wash); border: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.tool-warnings { margin: 16px 0 0; padding: 12px 16px 12px 32px; border-radius: 12px; background: var(--warn-bg); border: 1px solid var(--warn-line); color: #7a4b00; font-size: 14px; }
p.tool-warnings { padding-left: 16px; }
.tool-chips { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tool-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border-radius: 999px; background: var(--accent-soft); font-size: 14px; }
.tool-chip-remove { border: 0; background: transparent; font-size: 18px; line-height: 1; cursor: pointer; color: var(--muted); width: 28px; height: 28px; }
.tool-badge { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: #1f2f5c; color: #fff; font-size: 11px; font-weight: 700; }

/* ---------- Result ---------- */
.tool-result { border-color: #bcd4f5; }
.tool-result-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.tool-result-head h2 { margin: 0; }
.tool-result-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tool-metrics { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.tool-metric { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--wash); min-width: 0; }
.tool-metric.is-highlight { background: linear-gradient(135deg, #1d4ed8, #2563eb); border-color: transparent; color: #fff; }
.tool-metric-label { font-size: 13px; font-weight: 700; opacity: .85; }
.tool-metric-value { font-size: clamp(22px, 3vw, 30px); font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
.tool-metric-detail { font-size: 13px; opacity: .8; }
.tool-estimate { margin: 18px 0 0; font-size: 13px; color: var(--muted); }
.tool-table-wrap { overflow-x: auto; margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; }
.tool-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tool-table th, .tool-table td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tool-table th:first-child, .tool-table td:first-child { text-align: left; }
.tool-table thead th { background: var(--wash); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.tool-table tbody th { font-weight: 600; }
.tool-table tfoot th, .tool-table tfoot td { font-weight: 800; border-bottom: 0; background: var(--accent-soft); }
.tool-steps { margin: 16px 0 0; padding-left: 20px; display: grid; gap: 6px; }

/* Work hours rows */
.wh-row { display: grid; grid-template-columns: minmax(120px, 1.4fr) repeat(2, minmax(100px, 1fr)) minmax(80px, .8fr) minmax(110px, 1fr) 40px; gap: 10px; align-items: center; padding: 6px 0; }
.wh-head { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--line); }
.wh-row output { font-variant-numeric: tabular-nums; }
.wh-row.has-error input { border-color: #f3a39b; }

/* Shift schedule */
.ss-chip-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.ss-sequence { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 12px; margin: 12px 0 0; min-height: 52px; border: 1px dashed var(--line-strong); border-radius: 12px; }
.ss-times { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
.ss-time { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 0; display: grid; grid-template-columns: minmax(110px, 1fr) minmax(110px, 1fr) minmax(80px, .8fr); gap: 8px; min-width: 0; }
.ss-time legend { font-weight: 800; padding: 0 6px; }
.ss-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 8px; font-weight: 800; font-size: 13px; }
button.ss-chip { height: auto; min-height: 38px; }
.ss-E { background: #fef3c7; color: #7c4a03; border-color: #f7d77d; }
.ss-L { background: #dbeafe; color: #1e3a8a; border-color: #a8c8f8; }
.ss-N { background: #312e81; color: #fff; border-color: #312e81; }
.ss-D { background: #dcfce7; color: #14532d; border-color: #9ee3b5; }
.ss-M { background: #1e293b; color: #fff; border-color: #1e293b; }
.ss-X { background: #fde2e1; color: #7f1d1d; border-color: #f6b4b0; }
.ss-O { background: #f1f5f9; color: #64748b; border-color: #dbe3ec; }
.ss-legend { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; }
.ss-title { margin: 0 0 12px; }
.ss-calendars { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.ss-month { border: 1px solid var(--line); border-radius: 14px; padding: 12px; break-inside: avoid; }
.ss-month h4 { margin: 0 0 8px; text-transform: capitalize; }
.ss-weekdays, .ss-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.ss-weekdays span { text-align: center; font-size: 11px; font-weight: 800; color: var(--muted); }
.ss-days { list-style: none; padding: 0; margin: 4px 0 0; }
.ss-day { position: relative; aspect-ratio: 1; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; min-width: 0; }
.ss-day.is-weekend .ss-date { text-decoration: underline; }
.ss-date { font-size: 10px; opacity: .8; }
.ss-code { font-size: 13px; font-weight: 800; }
.ss-moon { position: absolute; top: 1px; right: 4px; font-size: 10px; }
.ss-month-total { margin: 8px 0 0; font-size: 13px; color: var(--muted); }

/* Working days */
.wd-holidays { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.wd-holidays li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 8px 12px; border-radius: 10px; background: var(--wash); border: 1px solid var(--line); }
.wd-holidays li.is-off { opacity: .7; }
.wd-holidays time { font-weight: 800; min-width: 92px; font-variant-numeric: tabular-nums; }
.wd-holidays em { font-size: 12px; color: var(--muted); }

/* Employee schedule */
.es-types { display: grid; gap: 10px; margin-bottom: 12px; }
.es-type { display: grid; grid-template-columns: 14px minmax(140px, 2fr) repeat(3, minmax(90px, 1fr)) 40px; gap: 10px; align-items: end; }
.es-swatch { width: 14px; height: 42px; border-radius: 6px; }
.es-grid-wrap { overflow-x: auto; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 12px; }
.es-grid { border-collapse: collapse; width: 100%; min-width: 860px; font-size: 14px; }
.es-grid th, .es-grid td { padding: 6px; border-bottom: 1px solid var(--line); text-align: left; }
.es-grid thead th { background: var(--wash); font-size: 12px; color: var(--muted); white-space: nowrap; }
.es-grid select { padding: 7px 6px; font-size: 13px; background: transparent; }
.es-grid input { min-width: 130px; }
.es-total, .es-grid tfoot td { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.es-color-0 { background: #fef3c7; } .es-color-1 { background: #dbeafe; } .es-color-2 { background: #e0e7ff; } .es-color-3 { background: #dcfce7; }
.es-color-4 { background: #fce7f3; } .es-color-5 { background: #ffedd5; } .es-color-6 { background: #ccfbf1; } .es-color-7 { background: #ede9fe; }
.es-status-vacation { background: #ecfeff; } .es-status-sick { background: #fef2f2; } .es-status-off { background: #f8fafc; }
.es-roster th, .es-roster td { text-align: left; }

/* ---------- CTA ---------- */
.tool-cta { display: grid; gap: 16px; }
.tool-cta-split { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.tool-cta-card { border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.tool-cta-card h2 { margin: 0 0 8px; font-size: 22px; }
.tool-cta-card p { margin: 0 0 16px; }
.tool-cta-wt { background: linear-gradient(135deg, #eaf3ff, #f8fbff); border: 1px solid var(--line); }
.tool-cta-wp { background: linear-gradient(128deg, #142d4e, #1b4d80 62%, #1c6aab); color: #fff; }
.tool-cta-wp .eyebrow { color: #bfdbfe; }
.tool-cta-wp p { color: #eaf3ff; }
.tool-cta-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tool-store img { display: block; height: 40px; width: auto; }
.tool-cta-link { font-weight: 700; }
.tool-cta-wp .tool-cta-link { color: #fff; }
.tool-cta-wp .tool-cta-button { background: #fff; color: #173b69; border-color: #fff; }

/* ---------- Content ---------- */
.tool-content { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.tool-content h2 { margin: 0 0 12px; font-size: 20px; }
.tool-content h3 { margin: 18px 0 8px; font-size: 16px; }
.tool-content p { margin: 0; color: var(--muted); }
.tool-faq { border-top: 1px solid var(--line); padding: 12px 0; }
.tool-faq summary { cursor: pointer; font-weight: 700; }
.tool-faq p { margin-top: 8px; }
.tool-related h2, .tool-hub-group h2 { margin: 0 0 12px; font-size: 20px; }
.tool-related-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.tool-related-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.tool-related-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.tool-related-card i { color: var(--accent); font-size: 20px; }
.tool-related-card span { color: var(--muted); font-size: 14px; }
.tool-related-card em { color: var(--accent-dark); font-style: normal; font-weight: 700; font-size: 14px; margin-top: auto; }
.tool-footer { max-width: 1200px; margin: 0 auto; padding: 0 16px 40px; color: var(--muted); font-size: 13px; }
.tool-footer a { color: var(--muted); }

@media (max-width: 760px) {
    .tool-intro { flex-direction: column; align-items: flex-start; padding: 22px; }
    .tool-card, .tool-result, .tool-content > article, .tool-cta-card { padding: 18px; }
    .wh-head { display: none; }
    .wh-row { grid-template-columns: 1fr 1fr 40px; border-bottom: 1px solid var(--line); padding: 12px 0; }
    .wh-row > label:first-child { grid-column: 1 / -1; }
    .wh-row > label:nth-child(4) { grid-column: 1; }
    .wh-row output { grid-column: 2; }
    .wh-row > span:last-child { grid-column: 3; grid-row: 2; }
    .wh-row > label:nth-child(2), .wh-row > label:nth-child(3) { grid-row: 2; }
    .wh-row > label:nth-child(2) { grid-column: 1; }
    .wh-row > label:nth-child(3) { grid-column: 2; }
    .wh-row .sr-only { position: static; width: auto; height: auto; margin: 0; clip: auto; overflow: visible; font-size: 12px; color: var(--muted); }
    .es-type { grid-template-columns: 14px 1fr 1fr 40px; }
    .es-type > label:nth-child(2) { grid-column: 2 / 4; }
    .ss-time { grid-template-columns: 1fr 1fr; }
    .tool-nav-link span { display: none; }
}

@media print {
    body { background: #fff; }
    .tool-header, .breadcrumbs, .tool-intro, .tool-form, .tool-cta, .tool-content, .tool-related, .tool-footer, .tool-result-actions, .skip-link { display: none !important; }
    main { padding: 0; max-width: none; }
    .tool-result { box-shadow: none; border: 0; padding: 0; }
    .tool-metric.is-highlight { background: #fff; color: var(--ink); border: 1px solid #999; }
    .tool-table-wrap { overflow: visible; }
    .ss-calendars { grid-template-columns: repeat(3, 1fr); }
    .ss-day, .es-roster td, [class*="es-color-"], .ss-chip { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    @page { margin: 12mm; }
}
