:root {
  --bg: #EDF0F3; --surface: #FFFFFF; --ink: #16212C; --muted: #5B6976; --line: #D3D9DF;
  --signal: #F2B705; --late: #B3261E; --ok: #1F6F4A; --warn: #8A5A00;
  --sans: "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #10171E; --surface: #18222C; --ink: #E7ECF0; --muted: #93A1AD; --line: #2A3743;
          --late: #F07167; --ok: #5CC08E; --warn: #F2B705; color-scheme: dark; }
}
* { box-sizing: border-box; }
html { height: 100%; }
body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font: 400 17px/1.5 var(--sans);
       padding-bottom: env(safe-area-inset-bottom, 0px); }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px;
       padding: calc(14px + env(safe-area-inset-top, 0px)) 18px 14px; background: #16212C; color: #F2F5F7;
       border-bottom: 4px solid var(--signal); }
.brand { font-weight: 700; letter-spacing: .02em; }
.out { color: #F2F5F7; font-size: 15px; }
main { max-width: 520px; margin: 0 auto; padding: 20px 18px 32px; }
h1 { margin: 0 0 6px; font-size: 26px; line-height: 1.2; }
h2 { margin: 0 0 10px; font-size: 18px; }
a { color: inherit; }
.card { display: flex; flex-direction: column; gap: 10px; padding: 22px 20px; background: var(--surface);
        border: 1px solid var(--line); border-radius: 14px; }
.card p { margin: 0 0 6px; color: var(--muted); }
label { font-weight: 600; font-size: 15px; }
input { width: 100%; padding: 14px; font: inherit; border: 1px solid var(--line); border-radius: 10px;
        background: var(--surface); color: var(--ink); }
input.code { font-size: 28px; letter-spacing: .4em; text-align: center; }
input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
button { font: inherit; cursor: pointer; }
.big { margin-top: 6px; padding: 15px; border: 0; border-radius: 10px; background: var(--ink); color: var(--surface); font-weight: 700; }
.small { font-size: 14px; }
.muted { color: var(--muted); }
.msg { margin: 0 0 14px; padding: 12px 14px; border-radius: 10px; background: var(--surface); border-left: 4px solid var(--ok); }
.msg.error { border-left-color: var(--late); }

.hello { margin-bottom: 18px; }
.hello .day { margin: 0; color: var(--muted); font-size: 15px; }
.hello .state { margin: 4px 0 0; color: var(--muted); }
.punch { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pbtn { min-height: 120px; border-radius: 16px; border: 2px solid var(--ink); background: var(--surface);
        color: var(--ink); font-size: 22px; font-weight: 700; }
.pbtn.primary { background: var(--ink); color: var(--surface); }
.pbtn.in.primary { box-shadow: inset 0 -6px 0 var(--ok); }
.pbtn.out.primary { box-shadow: inset 0 -6px 0 var(--signal); }
.pbtn:disabled { opacity: .5; cursor: wait; }
.status { min-height: 1.5em; margin: 14px 0 20px; font-weight: 600; }
.status.ok { color: var(--ok); } .status.error { color: var(--late); } .status.warn { color: var(--warn); }
.today { padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 14px; }
.today ol { list-style: none; margin: 0; padding: 0; }
.today li { display: grid; grid-template-columns: 4.5ch 3.5ch 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.today li:first-child { border-top: 0; }
.today time { font-weight: 700; font-variant-numeric: tabular-nums; }
.today .where { color: var(--muted); font-size: 15px; }

/* ---- duty flow and POD ---- */
.topbtn { padding: 9px 14px; border: 2px solid var(--signal); border-radius: 10px; background: transparent;
          color: #F2F5F7; font-weight: 700; font-size: 15px; }
.topbtn:disabled { opacity: .5; }
.center { text-align: center; }
.pbtn.in.primary { width: 100%; min-height: 150px; font-size: 28px; margin-bottom: 8px; }
.bigaction { display: flex; flex-direction: column; justify-content: center; gap: 6px; min-height: 150px;
             margin-bottom: 18px; padding: 22px; border-radius: 16px; background: var(--ink); color: var(--surface);
             text-decoration: none; box-shadow: inset 0 -6px 0 var(--signal); }
.bigaction-title { font-size: 28px; font-weight: 700; }
.bigaction-sub { font-size: 15px; opacity: .85; }
.count-badge { display: inline-block; min-width: 1.8em; padding: 0 8px; border-radius: 999px; background: var(--bg);
               font-size: 15px; text-align: center; }
.today li .wb { font-weight: 700; font-variant-numeric: tabular-nums; }
.today li { grid-template-columns: 4.5ch auto 1fr; }
.queue { margin: 0 0 16px; padding: 12px 14px; border-radius: 10px; background: var(--surface);
         border-left: 4px solid var(--signal); font-size: 15px; }
.queue.bad { border-left-color: var(--late); }
.wb-input { letter-spacing: .25em; }
.photo-block { margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.photo-block .label { margin: 0 0 8px; font-weight: 600; color: var(--ink); }
.req { color: var(--late); font-weight: 600; font-size: 13px; margin-left: 6px; }
.opt { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 6px; }
.photobtn { width: 100%; padding: 14px; border-radius: 10px; border: 2px solid var(--ink); background: var(--ink);
            color: var(--surface); font-weight: 700; }
.photobtn.secondary { background: var(--surface); color: var(--ink); }
.previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 10px; }
.previews:empty { display: none; }
.previews figure { position: relative; margin: 0; }
.previews img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.previews .rm { position: absolute; left: 4px; bottom: 4px; padding: 3px 8px; border: 0; border-radius: 6px;
                background: rgba(0, 0, 0, .65); color: #fff; font-size: 12px; }
.hub { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.hub .bigaction { margin-bottom: 0; }
.bigaction.pod { box-shadow: inset 0 -6px 0 var(--ok); }
.pbtn.wide { width: 100%; min-height: 150px; font-size: 28px; margin-bottom: 8px; }
.pbtn.out.primary.wide { box-shadow: inset 0 -6px 0 var(--signal); }
.center-link { display: block; text-align: center; text-decoration: none; }
.bigaction.office { background: var(--surface); color: var(--ink); border: 2px solid var(--ink); box-shadow: inset 0 -6px 0 var(--ink); }
.bigaction.office.ops { box-shadow: inset 0 -6px 0 var(--ok); }
.hub-head { margin: 4px 0 0; font-size: 15px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
