/* ShiftTally — shared styles. System fonts, single blue accent, neutral grays. */
:root {
  --blue: #1971c2;
  --blue-dark: #1864ab;
  --blue-soft: #e7f0fb;
  --ink: #1a1d21;
  --ink-soft: #495057;
  --muted: #6b757e;
  --line: #e2e6ea;
  --bg: #ffffff;
  --panel: #f7f9fb;
  --panel-2: #eef2f6;
  --ok: #2b8a3e;
  --err: #c92a2a;
  --err-bg: #fff0f0;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 16px rgba(16, 24, 40, 0.06);
  --maxw: 1000px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 17px;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }

/* ---- Header / nav ---- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 19px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand svg { display: block; }
.brand b { color: var(--blue); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.nav a {
  color: var(--ink-soft);
  padding: 8px 11px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
}
.nav a:hover { background: var(--panel-2); text-decoration: none; color: var(--ink); }
.nav a[aria-current="page"] { color: var(--blue); background: var(--blue-soft); }

.nav-toggle { display: none; }

/* ---- Hero ---- */
.hero { padding: 40px 0 8px; }
.hero h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 10px; letter-spacing: -0.02em; }
.hero p.lead { font-size: 1.1rem; color: var(--ink-soft); margin: 0 0 6px; max-width: 66ch; }
.hero .privacy-tag {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 10px; font-size: 14px; color: var(--ok); font-weight: 600;
}

/* ---- Tool card ---- */
.tool-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin: 20px 0;
}

/* ---- Time card UI ---- */
.tc-meta { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.tc-field { display: flex; flex-direction: column; gap: 5px; flex: 1 1 220px; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.tc-field input { font-weight: 400; }

.tc input[type="text"],
.tc input[type="number"],
.tc select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 16px;
  color: var(--ink);
  background: var(--bg);
  font-family: inherit;
}
.tc input:focus, .tc select:focus {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
  border-color: var(--blue);
}

.tc-settings { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 16px; }
.tc-settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.tc-set label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.02em; }
.tc-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tc-inline > select { flex: 1 1 140px; width: auto; }
.tc-switch { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: 14px; color: var(--ink); cursor: pointer; text-transform: none; letter-spacing: 0; margin: 0; }
.tc-switch input { width: 18px; height: 18px; }
.tc-ot-threshold { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--ink-soft); }
.tc-ot-threshold input { width: 64px; }
.tc-help { font-size: 13px; white-space: nowrap; }

/* table */
.tc-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tc-table { width: 100%; border-collapse: collapse; }
.tc-table th, .tc-table td { padding: 8px 8px; text-align: left; vertical-align: middle; }
.tc-table thead th {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--muted); font-weight: 700; border-bottom: 2px solid var(--line);
}
.tc-table tbody tr { border-bottom: 1px solid var(--line); }
.tc-daylabel { white-space: nowrap; font-size: 15px; }
.tc-daylabel strong { font-weight: 600; }
.tc-table td input[type="text"] { min-width: 92px; }
.tc-hours { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; color: var(--ink); font-size: 15px; }
.tc-hours.tc-empty { color: var(--muted); font-weight: 400; }
.tc-hours.tc-err { color: var(--err); font-weight: 600; font-size: 13px; }

.tc-breaks { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tc-break-row { display: inline-flex; align-items: center; gap: 2px; }
.tc-break-input { width: 66px !important; }
.tc-break-x {
  border: none; background: var(--panel-2); color: var(--ink-soft);
  width: 24px; height: 24px; border-radius: 6px; cursor: pointer; font-size: 16px; line-height: 1; padding: 0;
}
.tc-break-x:hover { background: var(--err-bg); color: var(--err); }
.tc-break-add {
  border: 1px dashed var(--line); background: transparent; color: var(--blue);
  border-radius: 6px; padding: 4px 8px; font-size: 12px; cursor: pointer; margin-top: 4px;
}
.tc-break-add:hover { background: var(--blue-soft); }

/* results */
.tc-results { margin-top: 18px; }
.tc-result-grid { display: flex; flex-wrap: wrap; gap: 14px; align-items: stretch; }
.tc-result-main {
  background: var(--blue); color: #fff; border-radius: 10px; padding: 14px 18px; flex: 1 1 180px; min-width: 150px;
}
.tc-result-num { font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tc-result-lbl { font-size: 13px; opacity: 0.9; margin-top: 3px; }
.tc-result-sub {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; flex: 1 1 150px; min-width: 130px;
}
.tc-result-num2 { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.tc-result-sub .tc-result-lbl { color: var(--muted); opacity: 1; }
.tc-result-pay {
  flex: 1 1 220px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; min-width: 200px;
}
.tc-pay-row { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; padding: 3px 0; font-variant-numeric: tabular-nums; }
.tc-pay-total { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 7px; font-weight: 700; }
.tc-result-warn { flex: 1 1 100%; background: var(--err-bg); color: var(--err); border-radius: 8px; padding: 8px 12px; font-size: 14px; font-weight: 500; }

/* actions */
.tc-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.tc-btn {
  appearance: none; border: 1px solid var(--blue); background: var(--blue); color: #fff;
  padding: 10px 16px; border-radius: 9px; font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit;
  min-height: 44px;
}
.tc-btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.tc-btn-ghost { background: transparent; color: var(--blue); }
.tc-btn-ghost:hover { background: var(--blue-soft); }
.tc-note { font-size: 13px; color: var(--muted); margin: 12px 0 0; }

/* ---- Generic buttons for standalone tools ---- */
.btn {
  appearance: none; border: 1px solid var(--blue); background: var(--blue); color: #fff;
  padding: 10px 16px; border-radius: 9px; font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit; min-height: 44px;
}
.btn:hover { background: var(--blue-dark); }
.btn-ghost { background: transparent; color: var(--blue); }
.btn-ghost:hover { background: var(--blue-soft); }
label.lbl { display: block; font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.02em; }
input.fld, select.fld {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 16px; font-family: inherit; color: var(--ink); background: var(--bg);
}
input.fld:focus, select.fld:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }

/* ---- Prose / content sections ---- */
.section { margin: 34px 0; }
.section h2 { font-size: 1.5rem; margin: 0 0 12px; letter-spacing: -0.01em; }
.section h3 { font-size: 1.15rem; margin: 22px 0 8px; }
.prose p, .prose li { color: var(--ink-soft); }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 5px 0; }
.steps { list-style: none; counter-reset: s; padding: 0; }
.steps li { counter-increment: s; position: relative; padding: 4px 0 4px 40px; margin: 8px 0; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 2px;
  width: 27px; height: 27px; background: var(--blue-soft); color: var(--blue);
  border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
}

/* FAQ */
.faq details {
  border: 1px solid var(--line); border-radius: 10px; padding: 2px 16px; margin: 10px 0; background: var(--panel);
}
.faq summary { cursor: pointer; font-weight: 600; padding: 12px 0; list-style: none; color: var(--ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--blue); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 14px; }

/* tables in content (conversion chart etc.) */
.data-table-wrap { overflow-x: auto; }
table.data { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
table.data th, table.data td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; font-size: 15px; }
table.data thead th { background: var(--panel-2); font-weight: 700; }
table.data tbody tr:nth-child(even) { background: var(--panel); }

/* related tools */
.related { margin: 36px 0; }
.related h2 { font-size: 1.25rem; margin-bottom: 14px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tool-link {
  display: block; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: var(--bg); transition: border-color .15s, box-shadow .15s;
}
.tool-link:hover { border-color: var(--blue); box-shadow: var(--shadow); text-decoration: none; }
.tool-link b { display: block; color: var(--ink); margin-bottom: 3px; }
.tool-link span { font-size: 14px; color: var(--muted); }

/* callout */
.callout { background: var(--blue-soft); border-left: 4px solid var(--blue); border-radius: 8px; padding: 12px 16px; margin: 18px 0; font-size: 15px; }
.disclaimer { font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; margin-top: 30px; }

/* ad slots: zero height, no visual box */
.ad-slot { height: 0; overflow: hidden; margin: 0; }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--line); margin-top: 50px; background: var(--panel); }
.site-footer .wrap { padding-top: 28px; padding-bottom: 28px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 12px; }
.footer-links a { color: var(--ink-soft); font-size: 15px; }
.footer-cols { display: flex; flex-wrap: wrap; gap: 40px; margin-bottom: 20px; }
.footer-col h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 0 0 8px; }
.footer-col a { display: block; color: var(--ink-soft); font-size: 15px; padding: 3px 0; }
.copyright { font-size: 14px; color: var(--muted); }

/* breadcrumb */
.crumb { font-size: 14px; color: var(--muted); padding-top: 18px; }
.crumb a { color: var(--muted); }

/* skip link */
.skip { position: absolute; left: -9999px; top: 0; background: var(--blue); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 100; }
.skip:focus { left: 0; }

/* print-only helper */
.tc-print-only { display: none; }

/* ---- Responsive: stack the time table into cards ---- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero h1 { font-size: 1.6rem; }
  .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; }
  .nav.open { display: flex; }
  .nav a { padding: 10px 8px; }
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
    width: 44px; height: 44px; cursor: pointer; color: var(--ink);
  }

  .tc-table thead { display: none; }
  .tc-table, .tc-table tbody, .tc-table tr, .tc-table td { display: block; width: 100%; }
  .tc-table tr { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; padding: 6px 12px 10px; background: var(--panel); }
  .tc-table td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 0; border: none; }
  .tc-table td::before {
    content: attr(data-label); font-size: 13px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.02em; flex: 0 0 auto;
  }
  .tc-table td.tc-daylabel { border-bottom: 1px solid var(--line); padding-bottom: 9px; margin-bottom: 3px; }
  .tc-table td.tc-daylabel::before { content: ""; }
  .tc-table td.tc-daylabel strong { font-size: 16px; }
  .tc-table td input[type="text"] { min-width: 0; max-width: 60%; }
  .tc-breaks { justify-content: flex-end; flex: 1; }
  .tc-hours { text-align: right; }
}

/* ---- Dark mode ---- */
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e9edf1;
    --ink-soft: #b7c0c9;
    --muted: #8a949e;
    --line: #2b3138;
    --bg: #14171b;
    --panel: #1b1f24;
    --panel-2: #232830;
    --blue: #4dabf7;
    --blue-dark: #74c0fc;
    --blue-soft: #1c2b3a;
    --err: #ff8787;
    --err-bg: #2a1a1a;
    --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 4px 16px rgba(0,0,0,0.4);
  }
  .site-header { background: rgba(20, 23, 27, 0.9); }
  .tc-result-main { background: var(--blue-dark); color: #0b1116; }
  .tc-result-main .tc-result-lbl { opacity: 0.85; }
  .tc-btn { color: #0b1116; }
  .tc-btn-ghost { color: var(--blue); }
  .btn { color: #0b1116; }
  .btn-ghost { color: var(--blue); }
}

/* ---- Print ---- */
@media print {
  .site-header, .site-footer, .tc-settings, .tc-actions, .tc-note, .ad-slot,
  .section, .related, .crumb, .hero p, .privacy-tag, .nav-toggle, .faq { display: none !important; }
  .tc-print-only { display: block !important; margin-bottom: 14px; }
  #tc-print-header h2 { margin: 0 0 8px; }
  .tc-print-meta { font-size: 14px; }
  .tc-print-meta div { margin: 3px 0; }
  body { font-size: 12px; color: #000; background: #fff; }
  .tool-card { border: none; box-shadow: none; padding: 0; margin: 0; }
  .tc-table { border: 1px solid #000; }
  .tc-table th, .tc-table td { border: 1px solid #999; }
  .tc-table thead th { display: table-cell; }
  .tc-breaks, .tc-break-add, .tc-break-x { display: inline; }
  .tc-break-input { border: none !important; width: auto !important; }
  .tc input { border: none; padding: 2px; }
  .tc-results { margin-top: 10px; }
  .tc-result-main { background: #fff !important; color: #000 !important; border: 1px solid #000; }
  a[href]::after { content: ""; }
}
