:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #16202b;
  --muted: #5f6b78;
  --line: #dde3ea;
  --accent: #1f4e79;
  --accent-text: #ffffff;
  --go: #1f8a4c;
  --stop: #c0392b;
  --warn: #b5650d;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141a;
    --card: #1a222c;
    --text: #e8edf2;
    --muted: #9aa6b2;
    --line: #2b3542;
    --accent: #5b9bd5;
    --accent-text: #0f141a;
    --go: #3bb36f;
    --stop: #e0604f;
    --warn: #f0a04b;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
}
.top { padding: calc(12px + env(safe-area-inset-top)) 16px 4px; }
h1 { margin: 0; font-size: 28px; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 24px 0 8px; }
main { padding: 8px 16px; max-width: 560px; margin: 0 auto; }

.tab { display: none; }
.tab.active { display: block; }

button {
  font: inherit; font-weight: 600;
  border: 0; border-radius: 12px;
  padding: 12px 16px; width: 100%;
  background: var(--accent); color: var(--accent-text);
  margin: 6px 0;
}
button.secondary { background: var(--card); color: var(--accent); border: 1px solid var(--line); }
button.ghost { background: none; color: var(--accent); width: auto; font-size: 26px; padding: 4px 14px; margin: 0; }
button.danger { background: none; color: var(--stop); }
button.big { font-size: 22px; padding: 22px; border-radius: 18px; margin: 16px 0; }
button.big.in { background: var(--go); color: #fff; }
button.big.out { background: var(--stop); color: #fff; }
button:disabled { opacity: .5; }

.now { text-align: center; color: var(--muted); margin-top: 16px; }
.status { text-align: center; font-weight: 600; margin-top: 4px; }
.timer { text-align: center; font-size: 56px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 8px 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 4px 14px; margin: 12px 0; }
.row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row.total strong { font-size: 20px; color: var(--accent); }

.month-bar { display: flex; align-items: center; justify-content: space-between; margin: 8px 0; }
.month-label { font-size: 18px; }
.actions { display: flex; gap: 8px; }

.list { list-style: none; padding: 0; margin: 8px 0; }
.list li {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin: 6px 0;
}
.list li .when { font-weight: 600; }
.list li .times { color: var(--muted); font-size: 14px; }
.list li .hrs { font-weight: 700; font-variant-numeric: tabular-nums; }
.list .empty { justify-content: center; color: var(--muted); }

label { display: block; font-size: 14px; color: var(--muted); margin: 10px 0; }
input, textarea {
  display: block; width: 100%; margin-top: 4px;
  font: inherit; font-size: 16px; color: var(--text);
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
label.file { background: var(--card); border: 1px dashed var(--line); border-radius: 12px; padding: 12px; color: var(--accent); font-weight: 600; }
label.file input { border: 0; padding: 6px 0 0; background: none; color: var(--muted); font-size: 14px; }
.two { display: flex; gap: 10px; }
.two label { flex: 1; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days label { margin: 0; }
.days input { display: none; }
.days span { display: inline-block; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-weight: 600; }
.days input:checked + span { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

.hint { color: var(--muted); font-size: 14px; }

.owed { display: flex; flex-direction: column; align-items: center; padding: 18px 14px; }
.owed strong { font-size: 40px; font-variant-numeric: tabular-nums; color: var(--accent); }
.list li .right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.list li button.small { width: auto; margin: 0; padding: 6px 12px; font-size: 14px; border-radius: 999px; }
.st-made { color: var(--muted); }
.st-sent { color: var(--warn); font-weight: 600; }
.st-paid { color: var(--go); font-weight: 600; }
.list li.bar-row { display: block; }
.bar-top { display: flex; justify-content: space-between; margin-bottom: 6px; }
.bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin-bottom: 6px; }
.bar span { display: block; height: 100%; border-radius: 4px; }
.bar .paid { background: var(--go); }
.bar .sent { background: var(--warn); }
.bar .made { background: var(--muted); }
.check { align-items: flex-end; }
.check .tick { flex: 0 0 90px; display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 16px; padding-bottom: 10px; }
.check .tick input { width: 22px; height: 22px; margin: 0; }
.out { margin: 8px 0; }
.hidden { display: none !important; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: flex; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs button { flex: 1; min-width: 0; background: none; color: var(--muted); border-radius: 0; margin: 0; padding: 16px 2px; font-size: 13px; }
.tabs button.active { color: var(--accent); }

dialog { border: 0; border-radius: 16px; padding: 16px; width: min(92vw, 420px); background: var(--card); color: var(--text); }
dialog::backdrop { background: rgba(0, 0, 0, .45); }
dialog h2 { margin-top: 0; }

.toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px;
  max-width: calc(100vw - 32px); text-align: center;
}

/* Off-screen spot where the Word file is drawn before turning it into a PDF */
#render { position: absolute; left: -10000px; top: 0; width: 8.5in; background: #fff; }
#render section.docx { box-shadow: none; margin: 0; min-height: 0 !important; }
