/* Site Tracker — phone first. One column, big touch targets, colour means the same thing everywhere:
   green = fine / done, yellow = watch, orange = hurry, red = late / problem, blue = needs checking. */
:root {
  --bg: #eef0f3;
  --card: #ffffff;
  --ink: #111827;
  --ink-2: #374151;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-2: #f1f2f4;
  --brand: #b4421f;
  --brand-soft: #fbeee8;

  --green: #16a34a; --green-soft: #dcfce7; --green-ink: #166534;
  --yellow: #eab308; --yellow-soft: #fef9c3; --yellow-ink: #854d0e;
  --orange: #ea580c; --orange-soft: #ffedd5; --orange-ink: #9a3412;
  --red: #dc2626; --red-soft: #fee2e2; --red-ink: #991b1b;
  --overdue: #7f1d1d;
  --blue: #2563eb; --blue-soft: #dbeafe; --blue-ink: #1e40af;
  --purple: #7c3aed; --purple-soft: #ede9fe;

  --r: 16px;
  --tabbar: 68px;
  --w: 600px;
  font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
svg { flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; display: block; }
.hidden { display: none !important; }
.red-t { color: var(--red) !important; }
.amber-t { color: var(--orange-ink); }

/* ---------- frame */
.app { max-width: var(--w); margin: 0 auto; min-height: 100vh; background: var(--bg); position: relative; }
@media (min-width: 640px) {
  body { background: #dfe2e7; }
  .app { box-shadow: 0 0 0 1px #d4d7dd, 0 10px 40px rgb(0 0 0 / 0.08); }
}
.top { position: sticky; top: 0; z-index: 20; background: rgb(255 255 255 / 0.96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.top-in { display: flex; align-items: center; gap: 8px; min-height: 60px; padding: 6px 12px; }
.top-title { flex: 1; min-width: 0; }
.top-title h1 { font-size: 20px; font-weight: 800; letter-spacing: -0.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title-btn { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 0; max-width: 100%; }
.title-btn svg { width: 20px; height: 20px; color: var(--muted); }
.title-btn[disabled] { cursor: default; }
.ib { width: 44px; height: 44px; border-radius: 12px; border: 0; background: none; display: grid; place-items: center; color: var(--ink); }
.ib:active { background: var(--line-2); }
.ib svg { width: 24px; height: 24px; }
.avatar { width: 40px; height: 40px; border-radius: 99px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.avatar.sm { width: 38px; height: 38px; font-size: 15px; }
.avatar.big { width: 56px; height: 56px; font-size: 22px; }

.main { padding: 14px 14px calc(var(--tabbar) + 28px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.main.has-foot { padding-bottom: calc(var(--tabbar) + 100px + env(safe-area-inset-bottom)); }
.main.no-tabs { padding-bottom: 40px; }
.main.no-tabs.has-foot { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }

.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(var(--w), 100%); z-index: 30; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tab { height: var(--tabbar); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 12.5px; font-weight: 700; position: relative; }
.tab svg { width: 26px; height: 26px; }
.tab.on { color: var(--brand); }
.tab.on::before { content: ''; position: absolute; top: 0; left: 25%; right: 25%; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--red); color: #fff; font-size: 11.5px; font-weight: 800; font-style: normal; }
.tab .badge { position: absolute; top: 7px; left: calc(50% + 6px); }

.savebar { position: fixed; left: 50%; transform: translateX(-50%); width: min(var(--w), 100%); bottom: 0; z-index: 25; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: rgb(255 255 255 / 0.97); border-top: 1px solid var(--line); }
.savebar.above-tabs { bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: 10px; }

/* ---------- basics */
.card { background: var(--card); border-radius: var(--r); padding: 14px; box-shadow: 0 1px 2px rgb(0 0 0 / 0.04); }
.sec { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.sec-h { display: flex; align-items: center; gap: 8px; padding: 6px 2px 0; }
.sec-h h2 { font-size: 17px; font-weight: 800; flex: 1; }
.count { min-width: 28px; height: 26px; padding: 0 9px; border-radius: 99px; background: #e5e7eb; display: inline-grid; place-items: center; font-weight: 800; font-size: 13px; }
.count.green { background: var(--green-soft); color: var(--green-ink); }
.link { color: var(--brand); font-weight: 700; background: none; border: 0; padding: 6px 0; font-size: 15px; }
.lead { font-size: 17px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 18px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; font-weight: 700; font-size: 16px; white-space: nowrap; }
.btn.big { height: 54px; width: 100%; font-size: 17px; }
.btn svg { width: 22px; height: 22px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.red { background: var(--red); border-color: var(--red); color: #fff; }
.btn.light { background: #fff; }
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.55; pointer-events: none; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 12.5px; font-weight: 700; background: #e5e7eb; color: var(--ink-2); white-space: nowrap; }
.pill.green { background: var(--green-soft); color: var(--green-ink); }
.pill.red { background: var(--red-soft); color: var(--red-ink); }
.pill.orange { background: var(--orange-soft); color: var(--orange-ink); }
.pill.amber { background: var(--yellow-soft); color: var(--yellow-ink); }
.pill.blue { background: var(--blue-soft); color: var(--blue-ink); }
.pill.gray { background: #e5e7eb; color: var(--muted); }
.pill.z-green { background: var(--green-soft); color: var(--green-ink); }
.pill.z-yellow { background: var(--yellow-soft); color: var(--yellow-ink); }
.pill.z-orange { background: var(--orange-soft); color: var(--orange-ink); }
.pill.z-red { background: var(--red-soft); color: var(--red-ink); }
.pill.z-overdue { background: var(--overdue); color: #fff; }
.pill.z-upcoming { background: var(--purple-soft); color: var(--purple); }

.dot { width: 12px; height: 12px; border-radius: 99px; display: inline-block; flex: none; background: #cbd5e1; }
.dot.green { background: var(--green); } .dot.yellow { background: var(--yellow); } .dot.orange { background: var(--orange); }
.dot.red { background: var(--red); } .dot.blue { background: var(--blue); }

.empty { text-align: center; padding: 22px 14px; color: var(--ink-2); font-size: 28px; background: var(--card); border-radius: var(--r); }
.empty p { font-size: 16px; font-weight: 700; margin-top: 6px; }
.empty p.muted { font-weight: 500; font-size: 14px; margin-top: 2px; }
.big-empty { margin: 60px 14px; font-size: 44px; }

.banner { padding: 12px 14px; border-radius: 14px; background: #fff; border: 1.5px solid var(--line); font-size: 15px; }
.banner.orange { background: var(--orange-soft); border-color: #fdba74; color: var(--orange-ink); }

.hint { padding: 12px 14px; border-radius: 12px; font-size: 15px; font-weight: 600; }
.hint.info { background: var(--line-2); color: var(--ink-2); font-weight: 500; }
.hint.ok { background: var(--green-soft); color: var(--green-ink); }
.hint.warn { background: var(--orange-soft); color: var(--orange-ink); }

.bar { height: 8px; background: #e9ebef; border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.bar > i.red { background: var(--red); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 40px; padding: 0 16px; border-radius: 99px; border: 1.5px solid var(--line); background: #fff; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; gap: 6px; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: #e3e6ea; border-radius: 14px; padding: 4px; gap: 4px; }
.seg a { height: 44px; display: flex; align-items: center; justify-content: center; gap: 6px; border-radius: 11px; font-weight: 700; color: var(--ink-2); font-size: 15px; }
.seg a.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / 0.1); }

/* ---------- lists */
.list { background: var(--card); border-radius: var(--r); overflow: hidden; }
.list.flat { border-radius: 0; background: none; }
.list.soft .li { color: var(--ink-2); }
.li { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 14px; border: 0; border-top: 1px solid var(--line-2); background: none; text-align: left; font-size: 16px; }
.list > .li:first-child { border-top: 0; }
.li:active { background: var(--line-2); }
.big-li { min-height: 68px; }
.li-emoji { font-size: 24px; width: 32px; text-align: center; flex: none; }
.li-main { flex: 1; min-width: 0; display: block; font-weight: 650; }
.li-sub { display: block; margin-top: 3px; font-size: 13.5px; color: var(--muted); font-weight: 500; }
.li-main .bar { margin-top: 6px; }
.li-right { display: grid; justify-items: end; gap: 3px; font-size: 13px; color: var(--muted); text-align: right; flex: none; }
.li-right b { font-size: 16px; color: var(--ink); }
.li-right.red-t b { color: var(--red); }
.chev { color: #9ca3af; display: grid; place-items: center; }
.chev svg { width: 20px; height: 20px; }

/* ---------- site summary */
.ring { position: relative; flex: none; --c: var(--green); font-size: 15px; }
.ring svg { width: 100%; height: 100%; display: block; }
.ring-bg { fill: none; stroke: #edeff2; stroke-width: 10; }
.ring-fg { fill: none; stroke: var(--c); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 0.4s; }
.ring-in { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1; }
.ring-in b { font-size: 1.9em; font-weight: 900; color: var(--c); letter-spacing: -1px; }
.ring-in span { font-size: 0.72em; color: var(--muted); font-weight: 700; margin-top: 2px; }
.scard .ring { font-size: 11px; }
.ring.z-green { --c: var(--green); } .ring.z-yellow { --c: #ca8a04; } .ring.z-orange { --c: var(--orange); }
.ring.z-red, .ring.z-overdue { --c: var(--red); } .ring.z-upcoming { --c: var(--purple); } .ring.z-done { --c: #64748b; }
.ring.z-overdue .ring-fg { animation: pulse 1.3s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.4; } }

.zword { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 99px; font-size: 13px; font-weight: 800; }
.zword.z-green { background: var(--green-soft); color: var(--green-ink); }
.zword.z-yellow { background: var(--yellow-soft); color: var(--yellow-ink); }
.zword.z-orange { background: var(--orange-soft); color: var(--orange-ink); }
.zword.z-red { background: var(--red-soft); color: var(--red-ink); }
.zword.z-overdue { background: var(--overdue); color: #fff; }
.zword.z-upcoming { background: var(--purple-soft); color: var(--purple); }
.zword.z-done { background: #e5e7eb; color: var(--ink-2); }

.sum { display: grid; gap: 14px; }
.sum-top { display: flex; gap: 16px; align-items: center; }
.sum-txt { display: grid; gap: 4px; justify-items: start; }
.sum-big { font-size: 24px; font-weight: 900; letter-spacing: -0.5px; }
.sum-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border-top: 1px solid var(--line-2); padding-top: 12px; text-align: center; }
.sum-stats b { display: block; font-size: 19px; font-weight: 850; }
.sum-stats span { font-size: 12.5px; color: var(--muted); font-weight: 600; }

.strip { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; }
.strip i { height: 12px; border-radius: 3px; opacity: 0.2; position: relative; }
.strip i.green { background: var(--green); } .strip i.yellow { background: var(--yellow); } .strip i.orange { background: var(--orange); }
.strip i.red { background: var(--red); } .strip i.overdue { background: var(--overdue); }
.strip i.fill { opacity: 1; }
.strip i.now { outline: 2.5px solid var(--ink); outline-offset: 1px; }
.strip i.target::after { content: ''; position: absolute; right: -3px; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.strip-cap { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); font-weight: 700; margin-top: -8px; }

.scard { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; }
.scard:active { transform: scale(0.99); }
.scard-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.scard-name { font-size: 17px; font-weight: 800; }
.scard-sub { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 650; color: var(--ink-2); flex-wrap: wrap; }
.scard-stats { display: flex; gap: 12px; font-size: 13px; color: var(--muted); font-weight: 600; flex-wrap: wrap; }

/* ---------- jobs */
.task { display: flex; align-items: stretch; border-top: 1px solid var(--line-2); }
.list > .task:first-child { border-top: 0; }
.task.late { background: #fff6f6; }
.tick { width: 64px; flex: none; border: 0; background: none; display: grid; place-items: center; padding: 0; }
.tick svg { width: 38px; height: 38px; padding: 7px; border-radius: 12px; border: 2.5px solid #c7ccd3; color: transparent; background: #fff; stroke-width: 3; }
.task.in_progress .tick svg { border-color: var(--blue); background: var(--blue-soft); }
.task.done .tick svg { border-color: var(--green); background: var(--green); color: #fff; }
.task.late .tick svg { border-color: #f5a3a3; }
.tick:active svg { transform: scale(0.9); }
.task-main { flex: 1; min-width: 0; border: 0; background: none; text-align: left; padding: 12px 14px 12px 0; display: grid; gap: 4px; }
.task-name { font-size: 16px; font-weight: 700; line-height: 1.3; }
.task.done .task-name { color: var(--muted); }
.task-sub { font-size: 13.5px; color: var(--muted); }
.task-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.remark { font-size: 13px; color: var(--ink-2); font-style: italic; }

.cats { display: grid; gap: 8px; }
.cat { background: var(--card); border-radius: var(--r); overflow: hidden; }
.cat-h { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 14px; border: 0; background: none; text-align: left; }
.cat-emoji { font-size: 26px; width: 34px; text-align: center; }
.cat-name { flex: 1; display: grid; gap: 2px; font-weight: 750; font-size: 16px; }
.cat-sub { font-size: 13px; color: var(--muted); font-weight: 600; }
.cat-count { font-weight: 800; color: var(--muted); }
.cat-done { width: 28px; height: 28px; border-radius: 99px; background: var(--green); color: #fff; display: grid; place-items: center; font-weight: 900; }
.cat .chev { transition: transform 0.15s; }
.cat.open .chev { transform: rotate(180deg); }
.cat.open .cat-h { border-bottom: 1px solid var(--line-2); }

/* ---------- people (attendance, team pickers) */
.people { display: grid; gap: 8px; }
.person { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 66px; padding: 10px 14px; border-radius: 14px; border: 2px solid transparent; background: var(--card); text-align: left; cursor: pointer; }
.person input { position: absolute; opacity: 0; pointer-events: none; }
.av { width: 44px; height: 44px; border-radius: 99px; background: var(--line-2); display: grid; place-items: center; font-size: 22px; flex: none; }
.person-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.person-main b { font-size: 16px; }
.person-main span { font-size: 13.5px; color: var(--muted); }
.att-state { flex: none; font-weight: 800; font-size: 14px; color: var(--muted); padding: 8px 12px; border-radius: 99px; background: var(--line-2); }
.person.on, .person:has(input:checked) { border-color: var(--green); background: #f3fdf6; }
.person.on .att-state { background: var(--green); color: #fff; }
.person.on .av, .person:has(input:checked) .av { background: var(--green-soft); }
/* checkbox look for pickers (empty .att-state) */
.att-state:empty { width: 30px; height: 30px; padding: 0; border-radius: 99px; border: 2.5px solid #c7ccd3; background: #fff; display: grid; place-items: center; }
.person:has(input:checked) .att-state:empty { background: var(--green); border-color: var(--green); }
.person:has(input:checked) .att-state:empty::after { content: '✓'; color: #fff; font-weight: 900; }
.att-count { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: 17px; font-weight: 650; padding: 0 2px; }
.att-count b { font-size: 26px; font-weight: 900; color: var(--green); }
.att-count .muted { margin-left: auto; }
.pick-group { font-size: 14px; font-weight: 800; color: var(--muted); padding: 10px 2px 0; }

/* ---------- options (radio buttons that look like big buttons) */
.opts { display: grid; gap: 8px; }
.opts.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.opts.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.opts.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 50px; padding: 6px; border-radius: 12px; border: 2px solid var(--line); background: #fff; font-weight: 750; font-size: 15px; cursor: pointer; line-height: 1.2; }
.opt input:checked + span { border-color: var(--ink); background: var(--ink); color: #fff; }
.opt.green input:checked + span { border-color: var(--green); background: var(--green); }
.opt.blue input:checked + span { border-color: var(--blue); background: var(--blue); }
.opt.red input:checked + span { border-color: var(--red); background: var(--red); }
.opt.gray input:checked + span { border-color: #9ca3af; background: #e5e7eb; color: var(--ink); }
.opt input:focus-visible + span { outline: 3px solid #f3b9a3; }

/* ---------- forms */
.form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; font-size: 14px; font-weight: 750; color: var(--ink-2); }
.field.big-label { font-size: 17px; color: var(--ink); }
.input { width: 100%; min-width: 0; min-height: 52px; border: 1.5px solid #cfd4db; border-radius: 12px; padding: 0 14px; background: #fff; font-size: 17px; font-weight: 500; }
textarea.input { padding: 12px 14px; resize: vertical; line-height: 1.45; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 20px; padding-right: 40px; }
.input:focus { outline: 3px solid #f6cdbd; border-color: var(--brand); }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.switch { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px; border-radius: 12px; background: var(--line-2); font-weight: 650; cursor: pointer; }
.switch input { width: 24px; height: 24px; accent-color: var(--green); flex: none; }
.amount { display: flex; align-items: center; gap: 8px; background: #fff; border: 2px solid #cfd4db; border-radius: 14px; padding: 0 16px; }
.amount:focus-within { border-color: var(--brand); outline: 3px solid #f6cdbd; }
.amount span { font-size: 30px; font-weight: 800; color: var(--muted); }
.amount input { flex: 1; min-width: 0; border: 0; outline: 0; height: 68px; font-size: 34px; font-weight: 850; background: none; }
.speak-box { position: relative; }
.speak-box textarea { padding-right: 70px; }
.mic { position: absolute; right: 10px; bottom: 10px; width: 52px; height: 52px; border-radius: 99px; border: 0; background: var(--brand); color: #fff; display: grid; place-items: center; box-shadow: 0 4px 12px rgb(180 66 31 / 0.35); }
.mic svg { width: 26px; height: 26px; }
.mic.on { background: var(--red); animation: pulse 1s ease-in-out infinite; }

/* ---------- money */
.money-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.money-sum > div:not(.bar):not(.hint) { display: grid; gap: 2px; }
.money-sum b { font-size: 22px; font-weight: 850; }
.money-sum .bar, .money-sum .hint { grid-column: 1 / -1; }
.money-li .li-main .bar { height: 6px; }
.appr { display: grid; gap: 8px; border: 2px solid #fdba74; }
.appr-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.appr-amt { font-size: 28px; font-weight: 900; letter-spacing: -0.5px; }
.appr-what { font-size: 16px; }
.appr-note { font-style: italic; color: var(--ink-2); }
.appr .two { margin-top: 4px; }
.bcard { display: grid; gap: 8px; }
.bc-top { display: flex; justify-content: space-between; gap: 8px; font-size: 16px; }

.itiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.itile { position: relative; display: grid; gap: 2px; align-content: start; padding: 12px; min-height: 92px; border-radius: 14px; background: #fff; border: 2px solid transparent; cursor: pointer; }
.itile input { position: absolute; opacity: 0; pointer-events: none; }
.it-emoji { font-size: 24px; }
.it-name { font-weight: 750; font-size: 15px; line-height: 1.2; overflow-wrap: anywhere; }
.it-left { font-size: 13px; color: var(--muted); font-weight: 600; }
.itile:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }

/* ---------- calls */
.callrow { display: grid; gap: 10px; }
.cr-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 17px; }
.cr-head .muted { margin-left: auto; }
.cr-note { font-size: 14px; color: var(--ink-2); background: var(--line-2); border-radius: 10px; padding: 8px 10px; }
.cpill { display: grid; gap: 2px; padding: 10px 12px; min-height: 62px; border-radius: 14px; border: 2px solid var(--line); background: #fff; }
.cpill b { font-size: 15px; }
.cpill small { font-size: 13.5px; font-weight: 700; color: var(--muted); }
.cpill.done { border-color: #86efac; background: var(--green-soft); }
.cpill.done small { color: var(--green-ink); }
.cpill.late { border-color: #fde047; background: var(--yellow-soft); }
.cpill.late small { color: var(--yellow-ink); }
.cpill.missed { border-color: #fca5a5; background: var(--red-soft); }
.cpill.missed small { color: var(--red-ink); }
.cpill.now { border-color: var(--orange); background: var(--orange); color: #fff; animation: glow 1.6s ease-in-out infinite; }
.cpill.now small { color: #fff; }
@keyframes glow { 50% { box-shadow: 0 0 0 5px rgb(234 88 12 / 0.25); } }
.checkjob { display: grid; gap: 8px; }
.cj-name { font-weight: 750; font-size: 16px; }
.cj-sub { font-size: 13.5px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ---------- boss home */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { background: var(--card); border-radius: var(--r); padding: 14px; display: grid; gap: 2px; min-height: 96px; align-content: center; }
.tile b { font-size: 34px; font-weight: 900; letter-spacing: -1px; line-height: 1; }
.tile b small { font-size: 18px; color: var(--muted); }
.tile span { font-size: 14px; font-weight: 700; color: var(--muted); }
.tile.red { background: var(--red-soft); } .tile.red b { color: var(--red); }
.tile.amber { background: var(--orange-soft); } .tile.amber b { color: var(--orange); }

/* ---------- labour */
.short { display: grid; gap: 4px; border-left: 5px solid var(--red); }
.short-top { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.short-top b { color: var(--red-ink); }
.ok-card { background: var(--green-soft); color: var(--green-ink); font-weight: 650; }
.stars { color: #f59e0b; letter-spacing: 1px; font-size: 15px; white-space: nowrap; }
.stars .off { color: #e5e7eb; }
.wstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; text-align: center; }
.wstats b { display: block; font-size: 20px; }
.wstats span { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; }

/* ---------- report */
.rsite { display: grid; gap: 8px; }
.rs-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rs-head .link { margin-left: auto; font-size: 14px; }
.bubble { background: #dcf8c6; border-radius: 12px; padding: 12px 14px; white-space: pre-wrap; font-size: 15px; line-height: 1.5; box-shadow: 0 1px 1px rgb(0 0 0 / 0.08); word-wrap: break-word; }

/* ---------- account / logins */
.me { display: flex; align-items: center; gap: 14px; }
.me b { display: block; font-size: 19px; }
.me span { color: var(--muted); font-size: 14px; }
.rolecards { display: grid; gap: 8px; }
.rolecard { position: relative; display: grid; gap: 2px; padding: 14px; border-radius: 14px; background: #fff; border: 2px solid transparent; cursor: pointer; }
.rolecard input { position: absolute; opacity: 0; pointer-events: none; }
.rolecard b { font-size: 16px; }
.rolecard span { font-size: 14px; color: var(--muted); }
.rolecard:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }

/* ---------- sheet & toast */
.sheet-back { position: fixed; inset: 0; z-index: 100; background: rgb(17 24 39 / 0.5); display: flex; align-items: flex-end; justify-content: center; animation: fade 0.15s; }
.sheet { width: min(var(--w), 100%); max-height: 92vh; background: var(--bg); border-radius: 22px 22px 0 0; display: flex; flex-direction: column; animation: up 0.2s ease-out; padding-bottom: env(safe-area-inset-bottom); }
.sheet-grip { width: 44px; height: 5px; border-radius: 9px; background: #cfd4db; margin: 8px auto 0; }
.sheet-h { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 18px; }
.sheet-h h3 { flex: 1; font-size: 19px; font-weight: 800; }
.sheet-b { padding: 4px 16px 16px; overflow: auto; }
.sheet-f { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; padding: 12px 16px 16px; border-top: 1px solid var(--line); background: #fff; }
@keyframes up { from { transform: translateY(40px); opacity: 0.6; } }
@keyframes fade { from { opacity: 0; } }
/* One small message at a time, just above the tabs. Taps go through it; only Undo takes a tap. */
#toast-root { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar) + 18px + env(safe-area-inset-bottom)); z-index: 200; display: grid; width: min(calc(var(--w) - 28px), calc(100% - 28px)); pointer-events: none; }
.toast { pointer-events: none; display: flex; align-items: center; gap: 10px; background: rgb(17 24 39 / 0.92); color: #fff; padding: 8px 8px 8px 14px; min-height: 44px; border-radius: 12px; font-weight: 650; font-size: 14px; line-height: 1.3; box-shadow: 0 6px 18px rgb(0 0 0 / 0.2); animation: up 0.18s ease-out; }
.toast span { flex: 1; min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.toast button { pointer-events: auto; flex: none; border: 0; background: #fff; color: #111827; font-weight: 800; border-radius: 9px; height: 34px; padding: 0 14px; }
.toast.error { background: var(--red); }

/* ---------- login */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth { width: min(400px, 100%); display: grid; gap: 14px; background: #fff; border-radius: 22px; padding: 28px 22px; box-shadow: 0 10px 40px rgb(0 0 0 / 0.08); }
.auth-logo { font-size: 48px; text-align: center; }
.auth h1 { font-size: 26px; font-weight: 900; text-align: center; }
.auth > p.muted { text-align: center; }

/* ---------- approvals, history */
.banner.red { background: var(--red-soft); border-color: #fca5a5; color: var(--red-ink); }
.banner.blue { background: var(--blue-soft); border-color: #93c5fd; color: var(--blue-ink); }
.banner.green { background: var(--green-soft); border-color: #86efac; color: var(--green-ink); }
.btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; white-space: normal; text-align: center; line-height: 1.2; }
.tile.blue { background: var(--blue-soft); } .tile.blue b { color: var(--blue); }
.green-t { color: var(--green-ink); }
.blue-t { color: var(--blue-ink); }
.checkcard { display: grid; gap: 8px; border: 2px solid #93c5fd; }
.cc-name { font-size: 17px; font-weight: 800; }
.att-mini, .att-count { display: flex; gap: 6px; flex-wrap: wrap; }
.proof { display: grid; gap: 6px; padding: 12px 14px; border-radius: 12px; background: #fff; font-size: 15px; }
.history { display: grid; gap: 8px; }
.hist { background: #fff; border-radius: 12px; padding: 10px 12px; color: var(--ink-2); display: grid; gap: 4px; }
.hist b { color: var(--ink); }
.task-tags .pill { white-space: normal; height: auto; min-height: 24px; padding: 3px 9px; line-height: 1.3; }
.stack-gap { display: grid; gap: 10px; }

/* ---------- attendance: one row per worker, three big choices */
.arows { display: grid; gap: 8px; }
.arow { background: var(--card); border-radius: 14px; padding: 6px 8px 10px; border-left: 5px solid #d1d5db; }
.arow.a-full { border-left-color: var(--green); }
.arow.a-half { border-left-color: var(--yellow); }
.arow.a-absent { border-left-color: var(--red); }
.arow-who { display: flex; align-items: center; gap: 12px; width: 100%; padding: 6px 4px; border: 0; background: none; text-align: left; }
.arow-who[disabled] { cursor: default; }
.aopts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.aopt { min-height: 46px; border-radius: 12px; border: 2px solid var(--line); background: #fff; font-weight: 800; font-size: 15px; color: var(--ink-2); }
.aopt.g.on { background: var(--green); border-color: var(--green); color: #fff; }
.aopt.y.on { background: var(--yellow); border-color: var(--yellow); color: #422006; }
.aopt.r.on { background: var(--red); border-color: var(--red); color: #fff; }
.aopt[disabled] { opacity: 0.6; }
.aopt[disabled].on { opacity: 1; }

/* ---------- boss: today at each site */
.today-row { display: grid; gap: 8px; }
.tr-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 17px; }
.tr-head .muted { margin-left: auto; }
.tr-chips { display: flex; gap: 6px; flex-wrap: wrap; }
a.money-sum { color: inherit; }

/* ---------- HR: morning / evening roll-call, day-wise plan */
.seg button { height: 44px; display: flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: none; border-radius: 11px; font-weight: 700; color: var(--ink-2); font-size: 15px; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / 0.1); }
.aopts.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.a-note { padding: 4px 6px 2px; }
.person-main span.faint { font-style: italic; opacity: 0.75; }
.chip { position: relative; }
.cdot { position: absolute; top: 5px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); border: 2px solid #fff; }
.chip.on .cdot { border-color: var(--ink); }
.plan-card { display: grid; gap: 8px; width: 100%; text-align: left; border: 0; font-size: 15px; }
.pc-head { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.pc-head .chev { margin-left: auto; color: var(--muted); }
.trline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15.5px; }
.trline > span:first-child { flex: 1; min-width: 0; }
.mini { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; font-weight: 800; font-size: 14px; }
.mini.green { background: var(--green); border-color: var(--green); color: #fff; }
.mini svg { width: 16px; height: 16px; }
.needgrid { display: grid; gap: 6px; }
.needrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 4px 4px 12px; border-radius: 12px; background: #fff; border: 2px solid var(--line); font-weight: 750; }
.needrow.set { border-color: var(--blue); background: #f4f8ff; }
.needrow .input { width: 84px; text-align: center; font-size: 18px; font-weight: 800; }
.card.short { color: inherit; }

/* ---------- overview of all sites, missed work */
.stage, .ov-site { display: grid; gap: 8px; width: 100%; text-align: left; border: 0; font-size: 15px; color: inherit; }
.pc-head .st-n { margin-left: auto; }
.pc-head .st-n + .chev { margin-left: 0; }
.miss { display: grid; gap: 10px; border-left: 5px solid var(--orange); }
.miss-list { display: grid; gap: 6px; }
.miss-item { display: flex; align-items: flex-start; gap: 8px; font-size: 15.5px; }
.miss-item .dot { margin-top: 7px; flex: none; }
.prog-row { display: grid; gap: 6px; padding-top: 6px; }
.prog-h { font-weight: 800; font-size: 15.5px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.btn.green { color: #fff; }
.btn.green[href] { text-decoration: none; }

/* ---------- site page: the whole plan day by day */
.daygrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.dg { height: 46px; border-radius: 12px; border: 2px solid var(--line); background: #fff; font-weight: 900; font-size: 17px; color: var(--muted); }
.dg.done { background: var(--green); border-color: var(--green); color: #fff; }
.dg.late { background: var(--red); border-color: var(--red); color: #fff; }
.dg.today { background: var(--blue); border-color: var(--blue); color: #fff; }
.dg.later { background: #fff; color: var(--ink-2); }
.dg.empty { background: #f4f5f7; color: #b6bcc6; border-style: dashed; }
.dg.now { outline: 3px solid var(--ink); outline-offset: 2px; }
.daycard { padding: 0; overflow: hidden; border-left: 5px solid #d1d5db; scroll-margin-top: 70px; }
.daycard.done { border-left-color: var(--green); }
.daycard.late { border-left-color: var(--red); }
.daycard.today { border-left-color: var(--blue); }
.daycard.empty { opacity: 0.7; }
.day-h { display: flex; align-items: center; gap: 8px; width: 100%; padding: 14px; border: 0; background: none; text-align: left; min-height: 60px; }
.dnum { font-weight: 900; font-size: 18px; }
.dsub { color: var(--muted); font-size: 14px; flex: 1; min-width: 0; }
.daycard .list { border-radius: 0; box-shadow: none; }
.daycard > .btn { margin: 10px 14px 14px; width: calc(100% - 28px); }
.tick[disabled], .task-main[disabled] { cursor: default; color: inherit; opacity: 1; }

/* ---------- passwords: eye button, new password */
.pw-wrap { position: relative; display: block; }
.pw-wrap .input { width: 100%; padding-right: 52px; }
.pw-eye { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border: 0; background: none; font-size: 20px; line-height: 1; }
.newpw { text-align: center; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 32px; font-weight: 800; letter-spacing: 3px; padding: 18px 8px; border-radius: 14px; background: #fff; border: 2px dashed var(--line); user-select: all; }
.li.req { flex-wrap: wrap; }
.req-btns { flex-basis: 100%; display: flex; gap: 8px; padding-left: 44px; }

/* ---------- supervisors: call and WhatsApp buttons */
.cbtns { display: flex; gap: 8px; flex: none; }
.cbtn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--line-2); color: var(--ink); border: 1.5px solid var(--line); }
.cbtn svg { width: 20px; height: 20px; }
.cbtn.wa { background: var(--green); border-color: var(--green); color: #fff; }
.li.wli { padding: 0 14px 0 0; }
.wli-link { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; min-height: 60px; padding: 10px 0 10px 14px; }
.sups { display: grid; gap: 8px; }
.sup-row { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.sup-name { flex: 1; min-width: 0; }
.callrow .sups { margin: 8px 0; }
.sup-card { padding: 10px 14px; }
.sup-login { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- labour by count */
.hc-card { display: grid; gap: 10px; }
.hc-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.hc-chips .pill { font-size: 15px; height: 32px; padding: 0 12px; }
.nw { white-space: nowrap; }

/* ---------- a site's own finish date */
.opt-btn { min-height: 50px; padding: 6px; border-radius: 12px; border: 2px solid var(--line); background: #fff; font-weight: 750; font-size: 15px; line-height: 1.2; }
.opt-btn:active { border-color: var(--ink); background: var(--ink); color: #fff; }
.sum-txt .link.small { font-size: 13px; padding: 0 0 0 4px; }

/* Supervisors' duty: start / end work with the phone's location */
.dutybar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; font-size: 15px; border: 1.5px solid var(--line); background: #fff; }
.dutybar .db-txt { flex: 1; min-width: 0; }
.dutybar.on { background: var(--green-soft); border-color: #86efac; color: var(--green-ink); }
.dutybar.off { background: var(--orange-soft); border-color: #fdba74; color: var(--orange-ink); }
.mini.red { background: var(--red); border-color: var(--red); color: #fff; }
.tile.green { background: var(--green-soft); } .tile.green b { color: var(--green); }
.gate { display: grid; gap: 14px; justify-items: center; text-align: center; padding: 26px 18px; }
.gate h2 { font-size: 24px; }
.gate-emoji { font-size: 56px; line-height: 1; }
.btn.huge { width: 100%; height: 76px; font-size: 22px; border-radius: 18px; }
.duty-sum { display: grid; gap: 8px; }
.duty-card { display: grid; gap: 10px; }
.dc-head { display: flex; align-items: center; gap: 10px; }
.dc-name { flex: 1; min-width: 0; display: grid; }
.duty-row { border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; }
.duty-row.open { border-color: #86efac; background: #f3fdf6; }
.dr-main { display: grid; gap: 3px; width: 100%; padding: 10px 12px; border: 0; background: none; text-align: left; font-size: 15.5px; }
.dr-sub { font-size: 13.5px; color: var(--muted); }
.dr-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.dr-btns { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 12px 10px; }
.duty-detail .dr-btns { padding: 4px 0 0; }
.duty-detail { display: grid; gap: 6px; background: var(--line-2); box-shadow: none; }
.day-add { margin: 0 14px 12px; display: inline-flex; align-items: center; gap: 4px; }
.day-add svg { width: 16px; height: 16px; }

/* Count box on the right of each work type; tapping it opens a small popup with 1–6 and "Other number" */
.needrow .nr-label { flex: 1; min-width: 0; }
.pickbox { width: 84px; height: 46px; flex: none; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); font-size: 20px; font-weight: 900; color: var(--ink); }
.needrow.set .pickbox { border-color: var(--blue); background: #fff; color: var(--blue-ink); }
.pick-back { position: fixed; inset: 0; z-index: 120; background: rgb(17 24 39 / 0.45); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade 0.12s; }
.pick { width: min(340px, 100%); background: var(--bg); border-radius: 20px; padding: 14px; display: grid; gap: 12px; animation: pop 0.15s ease-out; }
.pick-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 18px; }
.pick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cnt { height: 58px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; font-weight: 800; font-size: 22px; padding: 0; }
.cnt.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.cnt:active { transform: scale(0.96); }
.pick-other { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.pick-other .input { text-align: center; font-size: 18px; font-weight: 800; }
.cnt-del { width: 30px; height: 30px; border-radius: 99px; border: 0; background: var(--line-2); color: var(--muted); font-weight: 800; }
.addtype { display: grid; gap: 8px; }
.addtype-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }

/* Centered "Allow …?" box, like a phone's own permission question */
.sheet-back.center { align-items: center; padding: 16px; }
.sheet.dialog { width: min(380px, 100%); border-radius: 22px; padding-bottom: 0; animation: pop 0.18s ease-out; overflow: hidden; }
.sheet.dialog .sheet-grip { display: none; }
.sheet.dialog .sheet-h { padding: 6px 8px 0; justify-content: flex-end; }
.sheet.dialog .sheet-h h3:empty { display: none; }
.sheet.dialog .sheet-f { grid-auto-flow: row; }
.locask { display: grid; gap: 10px; justify-items: center; text-align: center; padding: 0 6px 6px; }
.locask-icon { width: 72px; height: 72px; border-radius: 99px; background: var(--blue-soft); display: grid; place-items: center; font-size: 38px; }
.locask h3 { font-size: 19px; font-weight: 800; }
@keyframes pop { from { transform: scale(0.94); opacity: 0; } to { transform: none; opacity: 1; } }
