:root {
  --bg: #f4f6f7; --card: #fff; --text: #14201f; --muted: #5b6b69; --line: #dbe3e2;
  --brand: #0f766e; --brand-d: #0b5a54; --in: #15803d; --out: #b91c1c; --warn: #b45309; --warn-bg: #fef3c7;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0e1514; --card: #172120; --text: #e6efee; --muted: #93a6a3; --line: #2a3836; --brand: #2dd4bf; --brand-d: #5eead4; --in: #4ade80; --out: #f87171; --warn: #fbbf24; --warn-bg: #3b2e0a; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; padding-bottom: env(safe-area-inset-bottom); }
#app { max-width: 920px; margin: 0 auto; padding: 0 16px 32px; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h2 { font-size: 1.1rem; margin-bottom: 10px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 0; padding-top: max(14px, env(safe-area-inset-top)); }
.top .who { font-weight: 600; }
.top small { display: block; color: var(--muted); font-weight: 400; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.btn { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 10px 14px; min-height: 44px; font-weight: 600; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.primary { color: #04201c; } }
.btn.small { min-height: 34px; padding: 4px 10px; font-size: .88rem; }
.btn.danger { color: var(--out); }
.btn:disabled { opacity: .5; cursor: default; }
.login { max-width: 380px; margin: 12vh auto 0; }
.login h1 { text-align: center; margin-bottom: 18px; }
label { display: block; font-size: .88rem; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea { width: 100%; padding: 11px 12px; min-height: 46px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
textarea { min-height: 80px; }
.err { color: var(--out); min-height: 1.3em; margin: 8px 0 0; font-size: .92rem; }
.clock { text-align: center; padding: 8px 0 4px; }
.clock .time { font-size: clamp(2.6rem, 14vw, 4.2rem); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -1px; }
.clock .date { color: var(--muted); text-transform: capitalize; }
.pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-weight: 600; font-size: .92rem; margin: 10px 0; background: var(--bg); border: 1px solid var(--line); }
.pill.working { color: var(--in); border-color: var(--in); } .pill.break { color: var(--warn); border-color: var(--warn); }
.seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 6px 0 14px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 10px; min-height: 44px; }
.seg button.on { background: var(--brand); color: #fff; font-weight: 600; }
@media (prefers-color-scheme: dark) { .seg button.on { color: #04201c; } }
.big { width: 100%; min-height: 96px; font-size: 1.6rem; font-weight: 700; border: 0; border-radius: 18px; color: #fff; touch-action: manipulation; }
.big.in { background: var(--in); } .big.out { background: var(--out); } .big.break { background: var(--warn); }
@media (prefers-color-scheme: dark) { .big { color: #04130f; } }
.big:disabled { opacity: .55; }
.second { width: 100%; margin-top: 10px; }
.center { text-align: center; }
.w100 { width: 100%; } .row > .full { flex-basis: 100%; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 14px; padding-bottom: 2px; }
.tabs button { flex: 0 0 auto; border: 1px solid var(--line); background: var(--card); padding: 9px 14px; border-radius: 999px; min-height: 42px; }
.tabs button.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
@media (prefers-color-scheme: dark) { .tabs button.on { color: #04201c; } }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 140px; }
.row > .btn { flex: 0 0 auto; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.muted { color: var(--muted); font-size: .9rem; }
.tag { font-size: .78rem; padding: 2px 8px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); margin-left: 4px; white-space: nowrap; }
.tag.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn); }
.tag.void { text-decoration: line-through; }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th, .tbl td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; }
.scroll { overflow-x: auto; }
.day { border-bottom: 1px solid var(--line); padding: 10px 0; }
.day:last-child { border-bottom: 0; }
.day-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; cursor: pointer; }
.day-d { margin-top: 8px; padding-left: 8px; border-left: 3px solid var(--line); }
.ev { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 4px 0; flex-wrap: wrap; }
.totals { font-weight: 700; }
.ok { color: var(--in); font-weight: 600; } .bad { color: var(--out); font-weight: 600; }
.sum { display: flex; gap: 18px; flex-wrap: wrap; margin: 6px 0 12px; }
.sum b { font-size: 1.3rem; display: block; }
#toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translate(-50%, 100px); background: #14201f; color: #fff; padding: 12px 18px; border-radius: 12px; transition: transform .25s; max-width: 90vw; z-index: 9; }
#toast.show { transform: translate(-50%, 0); }
@media (prefers-color-scheme: dark) { #toast { background: #e6efee; color: #0e1514; } }
.chk { display: flex; gap: 10px; align-items: flex-start; color: var(--text); font-size: 1rem; margin: 12px 0; }
.chk input { width: 22px; min-height: 22px; margin-top: 2px; flex: 0 0 auto; }
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-end; justify-content: center; z-index: 20; }
.sheet { max-width: 520px; width: 100%; max-height: 92vh; overflow-y: auto; margin: 0; border-radius: 18px 18px 0 0; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.sheet ul { padding-left: 20px; } .sheet li { margin: 6px 0; }
.qrbox { text-align: center; padding: 24px 16px; } .qrbox svg { width: min(78vw, 420px); height: auto; background: #fff; padding: 8px; border-radius: 12px; }
@media (min-width: 700px) { .big { min-height: 110px; } }
