/* TimeMathNow — one stylesheet, system fonts, light + dark. */
:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f4f2ec;
  --text: #1d1e22;
  --muted: #5d606a;
  --border: #e2dfd6;
  --border-strong: #c9c5b9;
  --accent: #b93e0c;
  --accent-strong: #9a3209;
  --accent-ink: #ffffff;
  --accent-soft: #fbece4;
  --error: #b42318;
  --ok: #1d6b45;
  --focus: #2457c5;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(30, 25, 15, .05), 0 4px 16px rgba(30, 25, 15, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131417;
    --surface: #1b1d21;
    --surface-2: #23262b;
    --text: #ecebe6;
    --muted: #a5a8b0;
    --border: #2e3137;
    --border-strong: #454951;
    --accent: #ff8f57;
    --accent-strong: #ffa677;
    --accent-ink: #1c0d04;
    --accent-soft: #2e1e15;
    --error: #ff8a80;
    --ok: #6fd3a0;
    --focus: #8fb2ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); padding: .1em .35em; border-radius: 5px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.015em; }
h1 { font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.35rem); margin: .4rem 0 .25rem; }
h2 { font-size: 1.35rem; margin: 2.2rem 0 .7rem; }
h3 { font-size: 1.08rem; margin: 1.4rem 0 .4rem; }
p { margin: 0 0 1rem; }
.wrap { width: 100%; max-width: 780px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.accent { color: var(--accent); }
.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; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--surface); color: var(--text); padding: 8px 14px; border-radius: 8px; z-index: 50; box-shadow: var(--shadow); }
.skip:focus { top: 8px; }
.print-only { display: none; }
[hidden] { display: none !important; }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--border); background: var(--bg); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--text); }
.logo { width: 30px; height: 30px; flex: none; }
.wordmark { font-weight: 750; font-size: 1.12rem; letter-spacing: -.02em; color: var(--text); }
.wordmark span { color: var(--accent); }
.menu { position: relative; }
.menu summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 4px;
  padding: 9px 12px; border-radius: 999px; border: 1px solid var(--border); font-size: .95rem; font-weight: 600;
  min-height: 44px; background: var(--surface);
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .15s; }
.menu[open] summary svg { transform: rotate(180deg); }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; padding: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  width: min(600px, calc(100vw - 32px)); max-height: calc(100vh - 80px); overflow-y: auto;
  display: grid; grid-template-columns: 1fr; gap: 4px 10px;
}
@media (min-width: 640px) { .menu-panel { grid-template-columns: 1fr 1fr; } }
.menu-panel ul { list-style: none; margin: 0; padding: 0; }
.menu-h { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 6px 10px 2px; }
.cards-h { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1.2rem 0 .5rem; }
.footer-grid nav h2 { margin-top: 0; }
.menu li a { display: flex; align-items: center; gap: 10px; padding: 10px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: .97rem; }
.menu li a:hover, .menu li a[aria-current] { background: var(--accent-soft); }
.menu li a[aria-current] { font-weight: 650; }
.ico { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Page ---------- */
main { padding-top: 10px; padding-bottom: 40px; min-height: 60vh; }
.crumbs { font-size: .85rem; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.crumbs a { color: var(--muted); }
.lede { color: var(--muted); font-size: 1.04rem; margin-bottom: 14px; max-width: 62ch; }

/* ---------- Tool card ---------- */
.tool {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px; margin-bottom: 18px;
}
@media (min-width: 600px) { .tool { padding: 20px 22px; } }
.tool-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 10px; }
.hint { font-size: .82rem; color: var(--muted); }
.bar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Segmented control */
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 999px; padding: 3px; margin: 0; background: var(--surface-2); }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: block; padding: 6px 13px; border-radius: 999px; font-size: .88rem; font-weight: 600; color: var(--muted); min-height: 34px; line-height: 22px; }
.seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 1px; }

/* Fields */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.field-top > label { font-size: .86rem; font-weight: 600; color: var(--muted); }
.now-btn { font: inherit; font-size: .78rem; font-weight: 700; color: var(--accent); background: none; border: 0; padding: 2px 4px; min-height: 24px; margin: -3px -4px -3px 0; cursor: pointer; border-radius: 6px; }
.now-btn:hover { background: var(--accent-soft); }
.field > label, .field-label { font-size: .86rem; font-weight: 600; color: var(--muted); }
.unit { font-weight: 400; }
input[type=text], input[type=date], input[type=number], select {
  font: inherit; font-size: 1.08rem; color: var(--text); background: var(--bg);
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 9px 11px; min-height: 48px; width: 100%; min-width: 0;
  font-variant-numeric: tabular-nums;
}
select { padding-right: 32px; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
input[type=date] { min-height: 48px; }
input::placeholder { color: var(--muted); opacity: .55; }
input:focus, select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
input[aria-invalid=true], .tf.bad input, input.bad { border-color: var(--error); }
.tf { display: flex; }
.tf input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.tf-mer {
  font: inherit; font-size: .88rem; font-weight: 700; flex: none; width: 52px; min-height: 48px; cursor: pointer;
  border: 1.5px solid var(--border-strong); border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--surface-2); color: var(--text);
}
.tf-mer[data-mer=pm] { background: var(--accent-soft); color: var(--accent); }
.clock24 .tf-mer { display: none; }
.clock24 .tf input { border-radius: var(--radius-sm); }
.affix { display: flex; align-items: center; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg); padding-left: 11px; }
.affix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.affix span { color: var(--muted); }
.affix input { border: 0; background: transparent; box-shadow: none !important; padding-left: 6px; }
.check { display: flex; align-items: center; gap: 9px; font-size: .95rem; cursor: pointer; min-height: 40px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; flex: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.grid4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.contents { display: contents; }
@media (max-width: 420px) { .grid3.stack-sm { grid-template-columns: 1fr 1fr; } }

/* Buttons */
.btn {
  font: inherit; font-size: .93rem; font-weight: 650; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 8px 14px; border-radius: 999px; cursor: pointer; border: 1.5px solid transparent;
  text-decoration: none;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-strong); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-add { background: transparent; color: var(--accent); border: 1.5px dashed var(--border-strong); width: 100%; margin: 4px 0 10px; border-radius: var(--radius-sm); }
.btn-add:hover { border-color: var(--accent); }
.btn-sm { min-height: 36px; padding: 5px 11px; font-size: .86rem; }
.icon-btn { background: none; border: 0; color: var(--muted); width: 40px; height: 40px; display: grid; place-items: center; border-radius: 999px; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--error); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.actions .btn { flex: 1 1 auto; }
@media (max-width: 420px) { .actions .btn { flex: 1 1 calc(50% - 8px); padding: 8px 6px; gap: 5px; font-size: .9rem; white-space: nowrap; } }

/* Hours rows */
/* Hours rows: stacked on phones, one line per shift on wider screens */
.shift { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 72px; gap: 6px 10px; align-items: end; border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 10px; }
.sh-name { grid-row: 1; grid-column: 1; align-self: center; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); white-space: nowrap; }
.sh-copy { grid-row: 1; grid-column: 2; min-width: 0; display: flex; justify-content: flex-end; align-self: center; }
.sh-copy .copy-prev { margin: 0; }
.sh-del { grid-row: 1; grid-column: 3; display: flex; justify-content: flex-end; align-self: center; }
.shift:only-child .sh-name, .shift:only-child .sh-copy, .shift:only-child .sh-del { display: none; }
.shift .field-break input { padding-left: 8px; padding-right: 8px; }
.shift .tf-mer { width: 44px; }
.shift .tf input, .shift .field-break input { font-size: 1rem; }
.shift .tf input { padding: 8px; }
.shift-out { grid-column: 1 / -1; min-height: 1.5em; margin: 0; font-size: .95rem; font-variant-numeric: tabular-nums; }
.shift-out .sub { color: var(--muted); }
.shift-out .sub::before { content: " · "; }
.shift-cols { display: none; }
@media (min-width: 640px) {
  .shift, .shift-cols { grid-template-columns: 58px 70px minmax(0, 1fr) minmax(0, 1fr) 64px 92px 34px; gap: 8px; }
  .shift { align-items: center; }
  .shift > * { grid-row: auto !important; grid-column: auto !important; }
  .shift:only-child .sh-name { display: block; }
  .shift:only-child .sh-copy, .shift:only-child .sh-del { display: flex; }
  .shift .field-top { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .shift .field-top .now-btn { display: none; }
  .sh-copy { justify-content: flex-start; }
  .sh-copy .copy-prev { flex-direction: column; justify-content: center; align-items: center; gap: 0; padding: 3px 6px; min-height: 40px; width: 66px; border-radius: 10px; font-size: .7rem; line-height: 1.15; white-space: normal; text-align: center; }
  .sh-copy .copy-prev svg { display: none; }
  .sh-copy .cp-txt { display: flex; flex-direction: column; align-items: center; }
  .shift .field > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .shift-out { text-align: right; font-weight: 700; line-height: 1.25; }
  .shift-out .sub { display: block; font-size: .78rem; font-weight: 500; }
  .shift-out .sub::before { content: none; }
  .shift-out .tag { font-size: .6rem; padding: 0 5px; }
  .shift-out.err { font-size: .75rem; font-weight: 600; text-align: left; }
  .shift-cols { display: grid; white-space: nowrap; font-size: .76rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding-bottom: 6px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
  .shift-cols .h-total { text-align: right; }
}
.shift-out.err, .err { color: var(--error); }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); vertical-align: 1px; }
.field-rate { max-width: 220px; margin: 8px 0 4px; }

/* Collapsible options */
.opt { margin: 4px 0 10px; }
.opt > summary { cursor: pointer; font-weight: 600; font-size: .95rem; padding: 8px 0; min-height: 40px; list-style-position: inside; }
.opt > summary::marker { color: var(--accent); }

/* Results */
.result { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 14px 16px; margin-top: 6px; }
.result-label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 2px; }
.result-main { font-size: clamp(1.35rem, 1.1rem + 1.4vw, 1.8rem); font-weight: 750; line-height: 1.25; margin: 0 0 4px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.result-main .eq { color: var(--muted); font-weight: 400; }
.result-sub { color: var(--muted); font-size: .92rem; margin: 0; font-variant-numeric: tabular-nums; min-height: 1.4em; }
.yr-bar { height: 6px; border-radius: 3px; background: var(--border); margin: 8px 0 0; overflow: hidden; }
.yr-bar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.notes { margin: 6px 0 0; padding: 0; list-style: none; font-size: .9rem; }
.notes li { padding-left: 20px; position: relative; margin-top: 2px; }
.notes li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.pay-line { margin: 10px 0 2px; font-size: 1.05rem; }
.disclaimer { font-size: .82rem; color: var(--muted); margin: 4px 0 0; }
.result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px 16px; margin: 10px 0 0; }
.result-grid div { min-width: 0; }
.result-grid dt { font-size: .8rem; color: var(--muted); font-weight: 600; }
.result-grid dd { margin: 0; font-weight: 700; font-size: 1.1rem; font-variant-numeric: tabular-nums; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: -4px 0 14px; }
.tabs button { font: inherit; font-weight: 650; font-size: .95rem; background: none; border: 0; padding: 10px 12px 7px; cursor: pointer; white-space: nowrap; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; min-height: 44px; }
.tabs button[aria-selected=true] { color: var(--text); border-bottom-color: var(--accent); }

/* ---------- Cards ---------- */
.cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 600px) { .cards { grid-template-columns: 1fr 1fr; } }
.card-link { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--text); height: 100%; transition: border-color .15s; }
.card-link:hover { border-color: var(--accent); color: var(--text); }
.card-link strong { display: block; font-size: 1rem; }
.card-link span span { display: block; color: var(--muted); font-size: .9rem; line-height: 1.45; margin-top: 2px; }
.card-link .ico { margin-top: 2px; }
.all-tools h2 { margin-top: 1.4rem; }

/* ---------- Content ---------- */
.content { max-width: 70ch; }
.content ul, .content ol { padding-left: 1.3em; margin: 0 0 1rem; }
.content li { margin-bottom: .35rem; }
.steps { counter-reset: s; list-style: none; padding-left: 0 !important; }
.steps li { counter-increment: s; position: relative; padding-left: 40px; margin-bottom: .7rem; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 750; font-size: .9rem; display: grid; place-items: center; }
.formula { font-family: var(--mono); font-size: .95rem; background: var(--surface-2); border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: 0 8px 8px 0; overflow-x: auto; }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary { cursor: pointer; font-weight: 650; padding: 14px 28px 14px 0; position: relative; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 10px; font-size: 1.4rem; color: var(--accent); font-weight: 400; }
.faq details[open] summary::after { content: "−"; }
.faq details > div { padding: 0 0 14px; color: var(--text); }
.callout { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; font-size: .95rem; }
.prose h2 { font-size: 1.2rem; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 1rem; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: .95rem; }
th, td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
thead th { background: var(--surface-2); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); position: sticky; top: 0; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tbody th { font-weight: 650; }
tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
caption { text-align: left; padding: 10px 10px 6px; font-weight: 650; }
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.chart-cols { columns: 2; column-gap: 16px; }

/* ---------- Ad slots: reserved space so ads never shift the layout ---------- */
.ad-slot { margin: 22px auto; width: 100%; max-width: 728px; }
.ad-below-tool { min-height: 100px; }
.ad-mid-content { min-height: 280px; }
.ad-end { min-height: 280px; }
@media (min-width: 768px) { .ad-below-tool { min-height: 90px; } .ad-mid-content, .ad-end { min-height: 250px; } }
.no-ads .ad-slot { display: none; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0 22px; background: var(--surface-2); font-size: .93rem; }
.footer-grid { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; }
.footer-grid > div:first-child { grid-column: 1 / -1; }
@media (min-width: 700px) { .footer-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .footer-grid { grid-template-columns: repeat(6, 1fr); } }
.footer-brand { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.footer-brand .logo { width: 24px; height: 24px; }
.site-footer h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0 0 6px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li a { display: inline-block; padding: 5px 0; color: var(--text); text-decoration: none; }
.site-footer li a:hover { color: var(--accent); text-decoration: underline; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: .92rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Time card */
.tc-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
@media (min-width: 640px) { .tc-settings { grid-template-columns: repeat(4, 1fr); } }
.tc-week h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 6px; }
.copy-prev { font: inherit; font-size: .8rem; font-weight: 650; display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 3px 10px; margin: 0 8px 0 auto; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--accent); cursor: pointer; white-space: nowrap; }
.copy-prev:hover { border-color: var(--accent); background: var(--accent-soft); }
.copy-prev svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.copy-prev.done { background: var(--accent-soft); border-color: var(--accent); }
/* Day rows: stacked on phones, one table-like row on wide screens */
.tc-day { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 72px; gap: 6px 8px; padding: 10px 0; border-top: 1px solid var(--border); align-items: end; }
.tc-name { grid-row: 1; grid-column: 1; align-self: center; font-size: .95rem; white-space: nowrap; }
.tc-copy { grid-row: 1; grid-column: 2; min-width: 0; display: flex; justify-content: flex-end; align-self: center; }
.tc-copy .copy-prev { margin: 0; }
.tc-sum { display: flex; justify-content: flex-end; align-items: baseline; gap: 14px; padding: 10px 0 4px; border-top: 2px solid var(--border-strong); font-variant-numeric: tabular-nums; }
.tc-sum-label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tc-sum-val { font-weight: 750; text-align: right; }
.tc-sum-val .sub { display: block; font-size: .78rem; font-weight: 500; color: var(--muted); }
.tc-total { grid-row: 1; grid-column: 3; justify-self: end; align-self: center; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--muted); font-size: .95rem; white-space: nowrap; }
.tc-total.has { color: var(--text); }
.tc-total.err { font-size: .78rem; font-weight: 600; white-space: normal; }
.tc-total .sub { display: none; }
.tc-day .field > label { font-size: .76rem; }
.tc-split { grid-column: 1 / span 2; order: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; }
.tc-break input { padding-left: 8px; padding-right: 8px; font-size: 1rem; }
.tc-day .tf-mer { width: 44px; }
.tc-day .tf input { font-size: 1rem; padding: 8px 8px; }
.tc-head { display: none; }
.tc-nosplit .tc-split, .tc-nosplit .tc-head .h-split { display: none; }
.tc-nobreak .tc-break, .tc-nobreak .tc-head .h-break { display: none; }
.h-break { position: relative; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.info { width: 18px; height: 18px; padding: 0; margin: 0; border: 0; background: none; color: var(--accent); cursor: help; display: inline-grid; place-items: center; position: relative; flex: none; border-radius: 50%; }
.info svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.info svg .dot { fill: currentColor; }
.info::after { content: attr(data-tip); display: none; position: absolute; right: -6px; top: calc(100% + 8px); width: 230px; padding: 9px 11px; border-radius: 8px; background: var(--text); color: var(--bg); font: 500 .8rem/1.4 var(--font); text-transform: none; letter-spacing: 0; text-align: left; white-space: normal; z-index: 30; box-shadow: var(--shadow); }
.info:hover::after, .info:focus::after { display: block; }
.tc-nosplit .info { display: none; }
.check-sub { font-size: .88rem; min-height: 32px; color: var(--muted); }
.check-sub input { width: 18px; height: 18px; }

@media (min-width: 720px) {
  .tc-nosplit .tc-day, .tc-nosplit .tc-head { grid-template-columns: 54px 68px minmax(0, 1fr) minmax(0, 1fr) 64px 66px; }
}
@media (min-width: 1040px) {
  #tc-tool.tc-wide { width: 900px; margin-left: calc(50% - 450px); }
  .tc-wide .tc-day, .tc-wide .tc-head { grid-template-columns: 54px 68px repeat(4, minmax(0, 1fr)) 64px 66px; }
  .tc-wide .tc-nobreak .tc-day, .tc-wide .tc-nobreak .tc-head { grid-template-columns: 54px 68px repeat(4, minmax(0, 1fr)) 66px; }
}
@media (min-width: 720px) {
  .tc-nosplit .tc-head, .tc-nosplit .tc-day { gap: 8px; }
  .tc-nosplit .tc-head { display: grid; }
  .tc-nosplit .tc-day > * { grid-row: auto; grid-column: auto; order: 0; }
  .tc-nosplit .tc-copy { justify-content: flex-start; }
  .tc-nosplit .copy-prev { flex-direction: column; justify-content: center; align-items: center; gap: 0; padding: 3px 6px; min-height: 40px; width: 64px; border-radius: 10px; font-size: .7rem; line-height: 1.15; white-space: normal; text-align: center; }
  .tc-nosplit .copy-prev svg { display: none; }
  .tc-nosplit .cp-txt { display: flex; flex-direction: column; align-items: center; }
  .tc-nosplit .cp-txt > span { display: block; }
  .tc-nosplit .tc-total { order: 2; }
  .tc-nosplit .tc-total .sub, .tc-wide .tc-total .sub { display: block; font-size: .78rem; font-weight: 500; color: var(--muted); }
  .tc-nosplit .tc-name { white-space: normal; line-height: 1.2; }
  .tc-nosplit .tc-name [data-date] { display: block; font-size: .74rem; }
  .tc-nosplit .tc-day .field > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tc-nosplit .tc-day { align-items: center; }
}
@media (min-width: 1040px) {
  .tc-wide .tc-head { display: grid; gap: 8px; }
  .tc-wide .tc-day { gap: 8px; align-items: center; }
  .tc-wide .tc-day > * { grid-row: auto; grid-column: auto; order: 0; }
  .tc-wide .tc-copy { justify-content: flex-start; }
  .tc-wide .copy-prev { flex-direction: column; justify-content: center; align-items: center; gap: 0; padding: 3px 6px; min-height: 40px; width: 64px; border-radius: 10px; font-size: .7rem; line-height: 1.15; white-space: normal; text-align: center; }
  .tc-wide .copy-prev svg { display: none; }
  .tc-wide .cp-txt { display: flex; flex-direction: column; align-items: center; }
  .tc-wide .cp-txt > span { display: block; }
  .tc-wide .tc-split { grid-column: span 2; gap: 8px; }
  .tc-wide .tc-total { order: 2; }
  .tc-wide .tc-name { white-space: normal; line-height: 1.2; }
  .tc-wide .tc-name [data-date] { display: block; font-size: .74rem; }
  .tc-wide .tc-day .field > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
.tc-head { white-space: nowrap; font-size: .76rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding-bottom: 4px; }
.tc-head .h-total { text-align: right; }
.tc-extra { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 10px; }
@media (min-width: 640px) { .tc-extra { grid-template-columns: 1fr 1fr 1fr; } }
.tc-summary table td:not(:first-child), .tc-summary table th:not(:first-child) { text-align: right; }

/* Business days custom dates */
.chips { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { display: inline-flex; align-items: center; gap: 2px; background: var(--surface-2); border-radius: 999px; padding: 2px 2px 2px 12px; font-size: .88rem; }
.chips .icon-btn { width: 32px; height: 32px; }
.inline-add { display: flex; gap: 8px; align-items: flex-end; }
.inline-add .field { flex: 1; }
.hol-list { margin: 8px 0 0; padding: 0; list-style: none; font-size: .92rem; }
.hol-list li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-top: 1px solid color-mix(in srgb, var(--accent) 18%, transparent); }
.hol-list .muted { white-space: nowrap; }

/* Time calculator rows */
.dur-row { display: grid; grid-template-columns: 52px repeat(4, 1fr) 36px; gap: 6px; align-items: end; margin-bottom: 8px; }
.dur-row input { padding: 8px 6px; text-align: center; font-size: 1rem; }
.sign { font: inherit; font-size: 1.3rem; font-weight: 700; min-height: 48px; border-radius: var(--radius-sm); border: 1.5px solid var(--border-strong); background: var(--surface-2); color: var(--text); cursor: pointer; }
.sign[data-sign="-"] { color: var(--accent); background: var(--accent-soft); }
.dur-head { display: grid; grid-template-columns: 52px repeat(4, 1fr) 36px; gap: 6px; font-size: .76rem; font-weight: 700; color: var(--muted); text-align: center; text-transform: uppercase; letter-spacing: .04em; }

/* Converters side by side */
.pair { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 700px) { .pair { grid-template-columns: 1fr 1fr; } }
.pane { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; }
.pane h2 { font-size: 1rem; margin: 0 0 10px; }
.pane .result { margin-top: 10px; }

/* ---------- Print ---------- */
@media print {
  @page { margin: 14mm; }
  :root { --bg: #fff; --surface: #fff; --surface-2: #f3f3f3; --text: #000; --muted: #444; --border: #bbb; --border-strong: #888; --accent: #000; --accent-soft: #f3f3f3; }
  body { font-size: 11pt; background: #fff; }
  .site-header, .site-footer, .ad-slot, .no-print, .actions, .crumbs, .lede, .skip, .toast, .all-tools, .related, .tool-bar, .btn-add, .icon-btn { display: none !important; }
  .tool { box-shadow: none; border: 0; padding: 0; }
  body[data-print=tool] .content { display: none; }
  body[data-print=card] main > :not(.print-card-host), body[data-print=card] .tool > :not(.print-card) { display: none !important; }
  body[data-print=card] .print-card, body[data-print=card] .print-card-host { display: block !important; }
  body[data-print=chart] main > :not(.content), body[data-print=chart] .content > :not(.chart-print) { display: none !important; }
  body[data-print=chart] .chart-print { display: block !important; }
  body[data-print=chart] .chart-print .btn { display: none; }
  .print-only { display: block; }
  .chart-cols { columns: 2; }
  .table-wrap { overflow: visible; border: 0; }
  thead th { position: static; }
  table { font-size: 9.5pt; }
  th, td { padding: 3px 6px; }
  details { display: block; }
  input { border-width: 1px !important; }
  a { color: #000; text-decoration: none; }
}
.print-card h2 { margin-top: 0; }
.sig { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 40px; }
.sig div { border-top: 1px solid #000; padding-top: 4px; font-size: 10pt; }
.clock24 .tf-keep .tf-mer { display: block; }
.clock24 .tf-keep input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.quick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.quick-label { font-size: .86rem; font-weight: 600; color: var(--muted); margin-right: 2px; }
.chip-btn { font: inherit; font-size: .86rem; font-weight: 650; min-height: 36px; padding: 4px 12px; white-space: nowrap; flex: none; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--accent); cursor: pointer; }
.chip-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.hol-ref { list-style: none; padding: 0 !important; margin: 0 0 1rem; font-size: .93rem; }
.hol-ref li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border); margin: 0; }
.hol-ref .muted { white-space: nowrap; }
.content h4 { margin: .4rem 0 .2rem; font-size: 1rem; }

.chart-dl { margin: 6px 0 1.4rem; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.chart-dl img { width: 220px; height: auto; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.chart-dl figcaption { flex: 1 1 200px; font-size: .93rem; }
.live-now { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; padding: 0 2px 12px; margin-bottom: 12px; border-bottom: 1px solid var(--border); min-height: 46px; }
.live-label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.live-time { font-variant-numeric: tabular-nums; white-space: nowrap; }
.live-time.pending { visibility: hidden; }
.live-time strong { font-size: 1.5rem; color: var(--accent); letter-spacing: .04em; }
table.compact th, table.compact td { padding: 6px 8px; }
tr.sel th, tr.sel td { color: var(--accent); font-weight: 700; }
.pay-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.pay-row select { width: auto; font-size: .95rem; }
.tax-box { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); font-size: .93rem; }
.tax-box p { margin: 0 0 4px; }
@media (max-width: 560px) { .field-pay { grid-column: 1 / -1; } #ot-mult { font-size: .95rem; } }
table.doy th, table.doy td { padding: 3px 5px; text-align: center; font-size: .85rem; }
.punch-out .rt { color: var(--muted); font-size: .88rem; }
@media (min-width: 640px) {
  .punch, .punch-cols { grid-template-columns: 58px 70px minmax(0, 1fr) minmax(0, 1fr) minmax(120px, 1.1fr) 34px !important; }
  .punch-out .rt { display: block; font-weight: 500; }
}
.emp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 10px; align-items: end; border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 10px; position: relative; }
.emp .emp-name { grid-column: 1 / -1; }
.emp:has([data-del]:not([hidden])) .emp-name { padding-right: 40px; }
.emp [data-del] { position: absolute; top: -4px; right: -6px; }
.emp-out { grid-column: 1 / -1; margin: 0; min-height: 1.4em; font-variant-numeric: tabular-nums; }
@media (min-width: 640px) {
  .emp { grid-template-columns: 1.6fr 1fr 1fr 1fr 1.3fr 34px; align-items: end; }
  .emp:has([data-w2][hidden]) { grid-template-columns: 1.6fr 1fr 1fr 1.3fr 34px; }
  .emp .emp-name { grid-column: auto; padding-right: 0; }
  .emp [data-del] { position: static; }
  .emp-out { grid-column: auto; align-self: center; text-align: right; }
}
#pr-print table { margin-top: 8px; }
.inline-field { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.inline-field label { font-size: .86rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.inline-field select { width: auto; min-width: 0; max-width: 100%; }

/* Countdown tiles */
.cd { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 6px 0 10px; }
.cd-tile { background: var(--surface, #fff); border: 1px solid var(--border); border-radius: 10px; padding: 10px 4px 8px; text-align: center; min-width: 0; }
.cd-n { display: block; font-size: clamp(1.5rem, 1rem + 3vw, 2.4rem); font-weight: 750; line-height: 1.1; color: var(--accent); font-variant-numeric: tabular-nums; }
.cd-l { display: block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 2px; }
.cd-wrap { position: relative; }
.cd-close { display: none; position: absolute; top: 12px; right: 12px; }
.cd-wrap.is-full { position: fixed; inset: 0; z-index: 100; margin: 0 !important; border-radius: 0; display: flex; flex-direction: column; justify-content: center; padding: 24px max(16px, 6vw); overflow: auto; background: var(--bg); }
.cd-wrap.is-full .cd-close { display: inline-flex; }
.cd-wrap.is-full .result-label { font-size: clamp(1rem, .8rem + 1.5vw, 1.6rem); text-align: center; }
.cd-wrap.is-full .cd-target { text-align: center; font-size: clamp(1rem, .8rem + 1vw, 1.3rem); }
.cd-wrap.is-full .cd { gap: clamp(8px, 2vw, 20px); margin: 16px 0; }
.cd-wrap.is-full .cd-n { font-size: clamp(2.4rem, 1rem + 9vw, 8rem); }
.cd-wrap.is-full .cd-l { font-size: clamp(.8rem, .6rem + 1vw, 1.2rem); }
.cd-wrap.is-full .result-grid { display: none; }
.cd-lock, .cd-lock body { overflow: hidden; }
tr.done th, tr.done td { color: var(--muted); }

/* Quick-pick chips: one swipeable row on phones instead of several wrapped lines */
@media (max-width: 600px) {
  .quick { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .quick.scrolls { -webkit-mask-image: linear-gradient(to right, #000 82%, transparent); mask-image: linear-gradient(to right, #000 82%, transparent); }
  .quick::-webkit-scrollbar { display: none; }
  .quick-label { flex: none; }
}
.cap-sub { display: block; font-weight: 400; font-size: .85rem; margin-top: 2px; }
@media (max-width: 420px) {
  /* Clock out, today's shift: clock-in on its own row, hours and break side by side */
  #co-panel:not(:has([data-cmode=week]:not([hidden]))) > .field:first-child { grid-column: 1 / -1; }
}
.money td { text-align: right; font-variant-numeric: tabular-nums; }
@media (min-width: 900px) { .cards-h + .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { thead th, tbody th { white-space: normal; } }
@media (max-width: 600px) { table.wrap td { white-space: normal; } table.compact th, table.compact td { padding: 6px 6px; } }

/* Small modal dialog */
.dlg { border: 0; border-radius: 14px; padding: 20px; width: min(92vw, 380px); background: var(--surface); color: var(--text); box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.dlg::backdrop { background: rgba(0,0,0,.45); }
.dlg h2 { margin: 0 0 12px; font-size: 1.15rem; }
.dlg .small { font-size: .85rem; margin: 8px 0 0; }
.dlg-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.dlg-actions .btn { min-width: 96px; }
.cd-link { margin-top: 12px; }

/* Time picker */
.tp { position: absolute; z-index: 50; display: none; width: 268px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 10px; }
.tp.show { display: block; }
.tp-h { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 2px 2px 4px; }
.tp-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-bottom: 8px; }
.tp button { font: inherit; font-size: .9rem; font-weight: 600; min-height: 34px; border: 1px solid transparent; border-radius: 8px; background: var(--surface-2); color: var(--text); cursor: pointer; font-variant-numeric: tabular-nums; }
.tp button:hover { border-color: var(--accent); }
.tp button.on { background: var(--accent); color: var(--accent-ink); }
.tp-foot { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--border); padding-top: 8px; }
.tp-mer { display: flex; gap: 4px; }
.tp-mer button { min-width: 46px; }
.tp-now { margin-left: auto; background: transparent !important; color: var(--accent) !important; }
.tp-done { min-width: 64px; }

/* Date picker */
.dp { position: absolute; z-index: 50; display: none; width: 288px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 10px; }
.dp.show { display: block; }
.dp-head { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.dp-head select { min-height: 34px; padding: 4px 26px 4px 8px; font-size: .9rem; font-weight: 600; flex: 1 1 auto; min-width: 0; width: auto; }
.dp-head select[data-year] { flex: 0 0 84px; }
.dp-nav { font: inherit; font-size: 1.3rem; line-height: 1; width: 34px; height: 34px; flex: none; border: 0; border-radius: 8px; background: var(--surface-2); color: var(--text); cursor: pointer; }
.dp-nav:hover { color: var(--accent); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.dp-dow span { text-align: center; font-size: .72rem; font-weight: 700; color: var(--muted); padding: 2px 0 4px; }
.dp-grid button { font: inherit; font-size: .88rem; min-height: 34px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; font-variant-numeric: tabular-nums; }
.dp-grid button:hover { background: var(--surface-2); border-color: var(--accent); }
.dp-grid button.today { border-color: var(--border-strong); font-weight: 700; }
.dp-grid button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.dp-foot { display: flex; justify-content: space-between; border-top: 1px solid var(--border); margin-top: 8px; padding-top: 8px; }
.dp-foot button { font: inherit; font-size: .88rem; font-weight: 650; border: 0; background: none; color: var(--accent); cursor: pointer; min-height: 32px; padding: 0 8px; border-radius: 8px; }
.dp-foot button:hover { background: var(--accent-soft); }
@media (pointer: fine) { .has-dp input[type=date]::-webkit-calendar-picker-indicator { display: none; } .has-dp input[type=date] { cursor: pointer; } }

.hc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 12px; margin: 6px 0 4px; }
.hc-presets { margin-top: 6px; }
.hc .small { margin: 4px 0 8px; }

/* Desktop countdown setup */
.dk .grid2 { margin-top: 8px; }
.dk-prev { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); margin: 10px 0 0; background: #222; }
.dk-prev iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; }
.dk-how { margin-top: 14px; }
.dk-how h3 { font-size: 1rem; margin: 0 0 4px; }
.dk-how ol { margin: 0; padding-left: 1.2em; font-size: .92rem; }
.dk-how li { margin-bottom: 4px; }
.more-line { margin: 12px 2px 0; font-size: .95rem; color: var(--muted); }
.all-tools { margin-top: 2rem; }
