:root {
  --bg: #f6f3ee; --card: #fff; --ink: #1c1a17; --muted: #6b655c; --line: #e2dcd2;
  --brass: #9a7b4f; --go: #1f7a4d; --stop: #b3261e; --warn: #9a5b00;
  --ok-bg: #e6f4ec; --err-bg: #fbe9e7; --warn-bg: #fdf3e1;
  --r: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
.topbar { position: sticky; top: 0; z-index: 2; background: var(--ink); color: #f6f3ee;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; display: flex; align-items: center;
  justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .02em; }
.brand img { width: 30px; height: 30px; border-radius: 7px; }
.who { display: flex; align-items: center; gap: 12px; font-size: 14px; flex-wrap: wrap; }
.who #whoName { opacity: .8; }
button.link { background: none; border: 0; color: #e7cf9f; font: inherit; padding: 6px 0; cursor: pointer; text-decoration: underline; }
main { max-width: 520px; margin: 0 auto; padding: 16px 16px calc(env(safe-area-inset-bottom) + 32px); }
main:has(.view.wide:not([hidden])) { max-width: 1100px; }
h1 { font-size: 26px; margin: 8px 0 4px; }
h2 { font-size: 18px; margin: 18px 0 10px; }
h3 { font-size: 17px; margin: 6px 0 10px; }
.muted { color: var(--muted); }
.center { text-align: center; }
label { display: block; font-weight: 600; margin: 14px 0; }
input { display: block; width: 100%; margin-top: 6px; font: inherit; font-size: 18px; padding: 14px;
  border: 2px solid var(--line); border-radius: 10px; background: #fff; }
input:focus { outline: none; border-color: var(--brass); }

.btn { display: block; width: 100%; border: 0; border-radius: var(--r); font: inherit; font-weight: 700;
  font-size: 19px; padding: 18px; margin: 12px 0; cursor: pointer; touch-action: manipulation; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.huge { font-size: 26px; padding: 30px 18px; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.btn.primary { background: var(--go); color: #fff; }
.btn.danger { background: var(--stop); color: #fff; }
.btn.secondary { background: #fff; color: var(--ink); border: 2px solid var(--ink); }
.btn.small { width: auto; padding: 8px 16px; margin: 0; font-size: 20px; }
.btn.link-btn { background: none; color: var(--muted); font-weight: 600; padding: 10px; }
.btn.busy { position: relative; }
.btn.busy::after { content: "Saving…"; position: absolute; inset: 0; display: grid; place-items: center;
  background: inherit; border-radius: inherit; }
.hint { font-size: 14px; color: var(--muted); text-align: center; margin: 4px 8px 8px; }

.jobs { display: grid; gap: 10px; }
.job { display: flex; align-items: center; gap: 14px; background: var(--card); border: 2px solid var(--line);
  border-radius: var(--r); padding: 16px; cursor: pointer; text-align: left; font: inherit; width: 100%; color: var(--ink); }
.job .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--muted); flex: none; }
.job[aria-checked="true"] { border-color: var(--go); background: #f1f8f4; }
.job[aria-checked="true"] .dot { border-color: var(--go); background: radial-gradient(var(--go) 45%, transparent 50%); }
.job .city { font-weight: 700; font-size: 18px; }
.job .pname { color: var(--muted); font-size: 15px; }
.job:disabled { opacity: .45; }

.banner { border-radius: 12px; padding: 14px 16px; margin: 4px 0 12px; font-size: 16px; }
.banner.ok { background: var(--ok-bg); border-left: 5px solid var(--go); }
.banner.error { background: var(--err-bg); border-left: 5px solid var(--stop); }
.banner.warn { background: var(--warn-bg); border-left: 5px solid var(--warn); }
.banner .big { display: block; font-size: 19px; font-weight: 700; }
.banner .loc { display: block; margin-top: 6px; font-size: 15px; }

.active-card { background: var(--ink); color: #f6f3ee; border-radius: 18px; padding: 20px; margin-top: 4px; }
.pill { display: inline-block; background: var(--go); color: #fff; font-size: 13px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; }
.active-project { font-size: 22px; font-weight: 700; margin-top: 10px; }
.active-since { color: #e7cf9f; margin-top: 2px; }
.active-elapsed { font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 8px; }
.switch-panel { background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 16px; margin-top: 8px; }

.today { margin-top: 18px; }
.today-head { display: flex; justify-content: space-between; align-items: baseline; }
.entries { list-style: none; padding: 0; margin: 0; }
.entries li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px;
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; }
.entries .e-proj { font-weight: 700; }
.entries .e-time { color: var(--muted); font-size: 15px; }
.entries .e-dur { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.entries .e-loc { grid-column: 1 / span 2; font-size: 13px; color: var(--muted); }
.entries .e-loc.bad { color: var(--warn); }

/* Timesheets */
.weekbar { display: flex; gap: 8px; align-items: center; margin: 10px 0; }
.weekbar input { margin: 0; max-width: 200px; padding: 10px; font-size: 16px; }
.ws { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 14px 0; overflow-x: auto; }
.ws h2 { margin: 0 0 8px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.ws h2 .tot { margin-left: auto; font-variant-numeric: tabular-nums; }
.flag { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 9px; }
.flag.open { background: var(--warn-bg); color: var(--warn); }
.flag.gps { background: var(--err-bg); color: var(--stop); }
table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
tfoot td { font-weight: 800; border-bottom: 0; }
details { margin-top: 10px; }
summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.grand { font-size: 18px; font-weight: 800; text-align: right; }
