:root {
    --green: #1b5e20;
    --green-2: #2e7d32;
    --amber: #e37400;
    --red: #c62828;
    --ink: #202124;
    --sub: #5f6368;
    --line: #e0e0e0;
    --bg: #f5f6f4;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.4 -apple-system, "Segoe UI", Roboto, sans-serif; }
body { padding-bottom: env(safe-area-inset-bottom); }
.loading { padding: 40px; text-align: center; color: var(--sub); }
header.bar { position: sticky; top: 0; z-index: 5; background: var(--green); color: #fff; padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top)); display: flex; align-items: center; gap: 10px; }
header.bar h1 { font-size: 18px; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
header.bar button, header.bar a.btn-link { background: transparent; border: 0; color: #fff; font-size: 15px; padding: 6px 8px; }
main { padding: 14px 14px 40px; max-width: 720px; margin: 0 auto; }
.card { background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.card h2 { margin: 0 0 6px; font-size: 18px; }
.sub { color: var(--sub); font-size: 14px; }
label { display: block; font-weight: 600; margin: 12px 0 6px; }
input[type=text], input[type=password], input[type=email], input[type=date], textarea, select {
    width: 100%; font-size: 17px; padding: 12px; border: 1px solid #c4c7c5; border-radius: 10px; background: #fff; }
textarea { min-height: 70px; }
.btn { display: block; width: 100%; text-align: center; border: 0; border-radius: 12px; padding: 15px; font-size: 18px; font-weight: 600; margin-top: 12px; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--green); color: #fff; }
.btn.secondary { background: #e8f0e9; color: var(--green); }
.btn.warn { background: #fdecea; color: var(--red); }
.btn.amber { background: #fff3e0; color: var(--amber); }
.btn:disabled { opacity: .5; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.datebar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.datebar button { background: #fff; border: 1px solid var(--line); border-radius: 10px; font-size: 20px; padding: 6px 14px; }
.datebar button:disabled { opacity: .3; }
.datebar .day { flex: 1; text-align: center; font-weight: 600; }
.tabs { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 12px; }
.tabs button { border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 8px 14px; font-size: 15px; white-space: nowrap; }
.tabs button.on { background: var(--green); color: #fff; border-color: var(--green); }
.banner { border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 15px; }
.banner.wait { background: #fff3e0; color: #8a4b00; }
.banner.fail { background: #fdecea; color: var(--red); }
.banner.off { background: #eceff1; color: #37474f; }
.banner.install { background: #e8f5e9; color: #1b5e20; }
.banner.install .installbtns { display: flex; gap: 8px; margin-top: 10px; }
.banner.install .installbtns .btn { flex: 1; margin: 0; padding: 10px; font-size: 15px; }
.stop { display: flex; gap: 12px; align-items: flex-start; background: #fff; border-radius: 12px; padding: 12px; margin-bottom: 10px; box-shadow: 0 1px 2px rgba(0,0,0,.08); cursor: pointer; }
.stop .no { width: 34px; height: 34px; border-radius: 50%; color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.stop .body { flex: 1; min-width: 0; }
.stop .name { font-weight: 600; }
.chip { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 10px; padding: 2px 8px; margin-top: 4px; }
.chip.todo { background: #eceff1; color: #455a64; }
.chip.done { background: #e8f5e9; color: var(--green); }
.chip.wait { background: #fff3e0; color: #8a4b00; }
.chip.fail, .chip.notdel { background: #fdecea; color: var(--red); }
.hay { border-left: 5px solid var(--amber); }
.instructions { background: #fffde7; border-left: 5px solid #f9a825; padding: 10px 12px; border-radius: 8px; margin: 10px 0; }
.items { width: 100%; border-collapse: collapse; margin-top: 6px; }
.items td { padding: 7px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.items td.q { text-align: right; white-space: nowrap; font-weight: 600; }
.sig-wrap { position: relative; border: 2px dashed #9e9e9e; border-radius: 10px; background: #fff; }
.sig-wrap canvas { display: block; width: 100%; height: 190px; touch-action: none; }
.sig-wrap .hint { position: absolute; left: 12px; bottom: 8px; color: #bdbdbd; font-size: 13px; pointer-events: none; }
.photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.photos .ph { position: relative; width: 92px; height: 92px; border-radius: 8px; overflow: hidden; background: #ddd; }
.photos .ph img { width: 100%; height: 100%; object-fit: cover; }
.photos .ph button { position: absolute; top: 2px; right: 2px; border: 0; border-radius: 50%; width: 26px; height: 26px; background: rgba(0,0,0,.6); color: #fff; font-size: 16px; }
.check { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-weight: 600; }
.check input { width: 22px; height: 22px; }
.loc { font-size: 14px; margin-top: 12px; }
.loc.ok { color: var(--green); }
.loc.bad { color: var(--red); }
.err { color: var(--red); margin-top: 10px; font-weight: 600; }
#toast { position: fixed; left: 16px; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); background: #323232; color: #fff; padding: 12px 14px; border-radius: 10px; z-index: 20; font-size: 15px; }
.login { max-width: 420px; margin: 8vh auto 0; }
.login .logo { width: 64px; height: 64px; border-radius: 14px; display: block; margin: 0 auto 10px; }
.center { text-align: center; }
a { color: var(--green-2); }
.saved { color: var(--green); font-size: 14px; margin: -4px 0 12px; }
.receipt { border-top: 5px solid var(--green); }
.receipt h2 { font-size: 17px; }
.ack { margin: 14px 0 0; font-size: 15px; font-weight: 600; }
.problem-box { margin-top: 8px; padding: 2px 10px 10px; border-radius: 10px; }
.problem-box.on { background: #fdecea; border: 2px solid var(--red); }
.problem-box.on .check { color: var(--red); }
.receipt.receipt-not { border-top-color: var(--red); }
