:root {
  --bg: #f3f5f8; --card: #ffffff; --ink: #0d1726; --muted: #5b6b80; --line: #dbe2ea;
  --navy: #0b1f3a; --orange: #f28c28; --green: #1f9d55; --red: #d64040; --blue: #1f6fd6;
  --on: #fff3e6;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #08111f; --card: #111d30; --ink: #eef3f9; --muted: #9bb0c8; --line: #24344d; --on: #3a2a17; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { padding-bottom: env(safe-area-inset-bottom); }
button { font: inherit; cursor: pointer; }
.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--navy); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.top-r { display: flex; gap: 8px; align-items: center; }
.net { background: var(--red); color: #fff; border-radius: 99px; padding: 3px 10px; font-size: 13px; }
main { max-width: 560px; margin: 0 auto; padding: 14px 16px 30px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin: 0 0 14px; }
.center { text-align: center; }
h1 { font-size: 22px; margin: 6px 0 12px; }
h2 { font-size: 18px; margin: 0; }
.hello { font-size: 20px; font-weight: 700; margin: 4px 2px 12px; }
.chip { background: transparent; color: inherit; border: 1px solid currentColor; border-radius: 99px; padding: 4px 12px; font-size: 14px; }
.link { background: none; border: 0; color: var(--blue); text-decoration: underline; padding: 8px 0; }
.big { display: block; width: 100%; border: 0; border-radius: 14px; padding: 18px; font-size: 19px; font-weight: 800;
  color: #fff; margin: 12px 0 0; min-height: 64px; letter-spacing: .3px; }
.big:disabled { opacity: .4; }
.green { background: var(--green); } .red { background: var(--red); } .blue { background: var(--blue); }
.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
#btn-photo { margin-bottom: 14px; }
.st-label { color: var(--muted); font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin: 4px 0 8px; }
.st-job { font-size: 22px; font-weight: 800; }
.st-time { color: var(--muted); margin-top: 4px; }
.jobs { display: grid; gap: 8px; max-height: 46vh; overflow: auto; }
.job { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 2px; padding: 12px 14px;
  border: 2px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); }
.job b { font-size: 15px; color: var(--muted); } .job span { font-size: 18px; font-weight: 700; }
.job.on { border-color: var(--orange); background: var(--on); }
.queue { background: var(--on); border: 1px solid var(--orange); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-weight: 600; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.row { display: flex; gap: 10px; } .row > * { flex: 1; }
.wk { margin: 14px 0 6px; font-weight: 800; color: var(--orange); }
.day { border-top: 1px solid var(--line); padding: 8px 0; }
.sh { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 15px; padding-top: 2px; }
.small { color: var(--muted); font-size: 14px; }
.foot { text-align: center; color: var(--muted); font-size: 14px; }
.foot a { color: var(--blue); }
.dots { display: flex; justify-content: center; gap: 16px; margin: 10px 0; }
.dots i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--muted); }
.dots i.on { background: var(--orange); border-color: var(--orange); }
.msg { min-height: 1.4em; color: var(--red); font-weight: 600; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 300px; margin: 0 auto; }
.keypad button { height: 66px; font-size: 26px; font-weight: 700; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
dialog { border: 0; border-radius: 18px; padding: 0; width: min(520px, calc(100vw - 24px)); background: var(--card); color: var(--ink); }
dialog::backdrop { background: rgba(0, 0, 0, .55); }
.dlg { padding: 16px; }
.dlg img { width: 100%; max-height: 38vh; object-fit: contain; border-radius: 10px; background: #000; }
select, textarea { width: 100%; font: inherit; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); margin-bottom: 10px; }
.stages { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.stages button { padding: 12px; border-radius: 10px; border: 2px solid var(--line); background: var(--bg); color: var(--ink); font-weight: 700; }
.stages button.on { border-color: var(--orange); background: var(--on); }
.stages button[data-v="Problema"].on { border-color: var(--red); }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; max-width: calc(100vw - 32px); z-index: 20; }
select.chip { font: inherit; font-size: 14px; font-weight: 700; appearance: auto; }
select.chip option { color: #0d1726; background: #fff; }
