:root {
  --bg: #0b0f14;
  --panel: #151d27;
  --panel2: #1e2a37;
  --line: #34465a;
  --text: #f4f7fa;
  --muted: #9fb0c2;
  --accent: #ffd60a;    /* high-visibility yellow */
  --accent-ink: #111;
  --blue: #3ea6ff;
  --ok: #2fd46b;
  --danger: #ff4d4f;
  --r: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 18px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
  overscroll-behavior-y: contain;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--blue); }
h3 { margin: 22px 0 8px; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.offscreen { position: fixed; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.pad { padding: 12px 16px 120px; max-width: 760px; margin: 0 auto; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.warn { color: var(--accent); }
.dim { color: var(--muted); font-weight: 600; }
.row { display: flex; gap: 10px; align-items: center; margin: 8px 0; flex-wrap: wrap; }
.grow { flex: 1; }

/* top bar */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 6px;
  background: #070a0e; border-bottom: 1px solid var(--line);
  padding: calc(env(safe-area-inset-top) + 6px) 8px 6px; min-height: 56px;
}
.tb-title { flex: 1; font-weight: 700; font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
.tb-logo { font-size: 26px; padding: 0 8px; }
.tb-btn {
  min-width: 52px; min-height: 48px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--text); text-decoration: none; background: var(--panel2); border: 1px solid var(--line);
  border-radius: 12px; font-size: 30px; font-weight: 700; padding: 0 10px;
}
.tb-btn.txt { font-size: 16px; }
.tb-btn.on { background: var(--accent); color: var(--accent-ink); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center;
  min-height: 56px; padding: 10px 16px; border-radius: var(--r); cursor: pointer;
  background: var(--panel2); border: 2px solid var(--line); font-weight: 650; text-decoration: none; color: var(--text);
}
.btn:active { transform: scale(.98); filter: brightness(1.25); }
.btn:disabled { opacity: .4; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #001022; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { background: #3a1214; border-color: var(--danger); color: #ffd7d7; }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 44px; padding: 6px 14px; font-size: 16px; }
.btn.xl { width: 100%; min-height: 68px; font-size: 21px; margin: 8px 0; }
.btn.big { flex-direction: column; gap: 2px; min-height: 84px; font-size: 30px; }
.btn.big span { font-size: 16px; }
.pad > .btn:not(.xl):not(.sm) { width: 100%; margin: 6px 0; }

/* capture */
.banner {
  position: sticky; top: calc(env(safe-area-inset-top) + 57px); z-index: 15; width: 100%; display: block; text-align: left;
  background: var(--accent); color: var(--accent-ink); border: 0; padding: 10px 14px 12px; cursor: pointer;
}
.bn-lbl { display: flex; justify-content: space-between; font-size: 13px; font-weight: 800; letter-spacing: .1em; }
.bn-chg { letter-spacing: 0; font-weight: 700; text-decoration: underline; }
.bn-path { display: block; font-size: 22px; font-weight: 600; line-height: 1.2; margin-top: 2px; }
.bn-path b { font-weight: 900; white-space: nowrap; }
.bn-path em { font-style: normal; font-size: 15px; margin-left: 8px; background: #111; color: var(--accent); padding: 1px 8px; border-radius: 8px; white-space: nowrap; }
.bn-path.warn { color: #7a0000; }
.strip-wrap { padding: 8px 12px 0; }
.strip-info { font-size: 15px; color: var(--muted); }
.strip-info b { color: var(--text); font-size: 20px; }
.strip { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0; min-height: 96px; }
.strip .th { flex: 0 0 84px; height: 84px; }
.strip-empty { color: var(--muted); align-self: center; font-size: 15px; }
.cap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 6px 12px 130px; max-width: 760px; margin: 0 auto; }
.cap-grid .wide2 { grid-column: span 2; flex-direction: row; font-size: 24px; min-height: 64px; }
.photo-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: flex; gap: 10px;
  padding: 10px 12px calc(env(safe-area-inset-bottom) + 10px); background: linear-gradient(transparent, #070a0e 30%);
}
.btn-photo {
  flex: 1; min-height: 92px; border-radius: 20px; border: 3px solid #fff; background: var(--ok); color: #00210c;
  font-size: 30px; font-weight: 900; letter-spacing: .04em; cursor: pointer; box-shadow: 0 4px 20px #000a;
}
.btn-photo:active { filter: brightness(1.2); transform: scale(.98); }
.btn-gal {
  flex: 0 0 88px; border-radius: 20px; border: 2px solid var(--line); background: var(--panel2); font-size: 30px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer;
}
.btn-gal span { font-size: 13px; }

/* thumbs */
.th {
  position: relative; border-radius: 10px; background: #26313d center / cover no-repeat; border: 2px solid transparent; cursor: pointer;
}
.th.gone::after { content: "deleted"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; color: var(--muted); }
.th .lab { position: absolute; left: 3px; bottom: 3px; background: var(--accent); color: #000; font-size: 11px; font-weight: 800; padding: 1px 5px; border-radius: 5px; }
.th .num { position: absolute; right: 3px; top: 3px; background: #000b; font-size: 11px; padding: 1px 5px; border-radius: 5px; }
.th.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent); }
.th.sel::before { content: "✓"; position: absolute; left: 4px; top: 2px; font-weight: 900; color: var(--accent); text-shadow: 0 0 4px #000; font-size: 22px; }

/* jobs */
.job-row {
  width: 100%; display: block; text-align: left; background: var(--panel); border: 2px solid var(--line); border-radius: var(--r);
  padding: 14px; margin: 8px 0; cursor: pointer;
}
.jr-main b { display: block; font-size: 21px; }
.jr-main span, .jr-meta { color: var(--muted); font-size: 15px; }
.jr-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; align-items: center; }
.badge { padding: 2px 8px; border-radius: 8px; font-size: 13px; font-weight: 700; text-transform: uppercase; background: var(--panel2); }
.badge.open { background: var(--ok); color: #00210c; }
.badge.exported { background: var(--blue); color: #001022; }
details summary { padding: 14px 0; color: var(--muted); cursor: pointer; }

/* forms */
.fld { display: block; margin: 12px 0; }
.fld span { display: block; font-size: 15px; color: var(--muted); margin-bottom: 4px; }
.inp {
  width: 100%; min-height: 56px; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line);
  background: #0f151c; font-size: 20px;
}
.inp:focus { outline: none; border-color: var(--accent); }
textarea.inp { resize: vertical; }
.inp.hold-no { width: 96px; text-align: center; }
input[type="datetime-local"].inp { color-scheme: dark; }

/* locations */
.loc-row { background: var(--panel); border: 2px solid var(--line); border-radius: var(--r); margin: 8px 0; display: flex; flex-wrap: wrap; }
.loc-row.sub { margin-left: 22px; }
.loc-row.cur { border-color: var(--accent); }
.loc-btn { flex: 1; text-align: left; background: none; border: 0; padding: 14px; min-height: 64px; cursor: pointer; }
.loc-btn b { display: block; font-size: 20px; }
.loc-btn span { color: var(--muted); font-size: 14px; }
.loc-exp { background: none; border: 0; border-left: 1px solid var(--line); color: var(--blue); padding: 0 14px; min-width: 88px; cursor: pointer; }
.loc-items { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; padding: 0 12px 12px; }
.it-btn { min-height: 48px; padding: 6px 12px; border-radius: 10px; background: var(--panel2); border: 2px solid var(--line); cursor: pointer; }
.it-btn.cur { border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 48px; padding: 8px 16px; border-radius: 24px; border: 2px solid var(--line); background: var(--panel2); cursor: pointer; font-weight: 600; }
.chip.on { background: var(--accent); color: #000; border-color: var(--accent); }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick .btn { min-height: 64px; }

/* attendance */
.att-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.att-grid .btn.big { font-size: 20px; }
.att-row { background: var(--panel); border: 2px solid var(--line); border-radius: var(--r); padding: 10px; margin: 8px 0; display: grid; gap: 8px; }
.att-h { display: flex; justify-content: space-between; align-items: center; font-size: 19px; }

/* review */
.rv-job, .rv-att, .card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; margin: 8px 0; }
.card.ok { border-color: var(--ok); }
.rv-loc { margin: 18px 0; }
.rv-loc.sub { margin-left: 10px; padding-left: 10px; border-left: 3px solid var(--line); }
.rv-loc-h { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 20px; color: var(--accent); gap: 8px; }
.rv-item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; margin: 8px 0; }
.rv-item.cur { border-color: var(--accent); }
.rv-item-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rv-item-h small { color: var(--muted); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; margin-top: 8px; }
.thumbs .th { aspect-ratio: 1; }
.rv-note { padding: 10px; margin-top: 6px; background: var(--panel2); border-radius: 10px; border: 2px solid transparent; cursor: pointer; }
.rv-note.sel { border-color: var(--accent); }
.hint { background: var(--accent); color: #000; padding: 8px 12px; border-radius: 10px; font-weight: 600; }
.selbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: flex; gap: 10px; align-items: center;
  padding: 10px 12px calc(env(safe-area-inset-bottom) + 10px); background: #070a0e; border-top: 2px solid var(--accent);
}
.selbar span { flex: 1; font-weight: 700; }

/* export */
.prog { height: 14px; background: var(--panel2); border-radius: 8px; overflow: hidden; margin: 10px 0 4px; }
#pbar { height: 100%; width: 0; background: var(--ok); transition: width .2s; }
.part { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); padding: 10px 0; word-break: break-all; }

/* dialogs */
.overlay { position: fixed; inset: 0; z-index: 50; background: #000c; display: flex; align-items: flex-end; justify-content: center; }
.dlg {
  width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: var(--panel); border: 2px solid var(--line);
  border-radius: 20px 20px 0 0; padding: 16px 16px calc(env(safe-area-inset-bottom) + 16px);
}
.dlg.wide { max-width: 900px; }
.dlg h2 { margin: 0 0 10px; font-size: 21px; }
.dlg-body p { margin: 6px 0 12px; }
.dlg-btns { display: grid; gap: 10px; margin-top: 12px; }
.dlg-btns .btn { width: 100%; min-height: 60px; font-size: 19px; }
.note { min-height: 140px; }
.btn.dictate { width: 100%; min-height: 72px; font-size: 22px; margin-bottom: 8px; background: #3a2a00; border-color: var(--accent); color: var(--accent); }
.btn.dictate.on { background: var(--danger); border-color: #fff; color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { filter: brightness(1.35); } }
.dict-status { min-height: 20px; margin-bottom: 8px; color: var(--muted); }
.dict-status i { color: var(--text); }
.viewer { width: 100%; max-height: 62vh; object-fit: contain; border-radius: 10px; background: #000; }
.pick { max-height: 56vh; overflow-y: auto; }
.pick-loc { font-weight: 800; color: var(--accent); margin: 14px 0 6px; }
.pick-it, .pick-new { display: block; width: 100%; text-align: left; min-height: 54px; margin: 6px 0; padding: 8px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--panel2); cursor: pointer; font-size: 18px; }
.pick-new { background: transparent; border-style: dashed; color: var(--blue); }

/* help */
.cap-grid .help-link { grid-column: span 2; min-height: 56px; font-size: 18px; background: transparent; }
.help p, .help li, .help dd { font-size: 17px; }
.hl-check { list-style: none; padding: 0; margin: 0; }
.hl-check li { position: relative; padding: 8px 0 8px 34px; border-bottom: 1px solid var(--line); }
.hl-check li::before { content: ""; position: absolute; left: 2px; top: 10px; width: 20px; height: 20px; border: 2px solid var(--accent); border-radius: 4px; }
.hl-banner { background: var(--accent); color: var(--accent-ink); border-radius: 10px; padding: 8px 12px 10px; }
.hl-btns { margin: 0; }
.hl-btns dt { font-weight: 800; font-size: 19px; color: var(--accent); margin-top: 12px; }
.hl-btns dd { margin: 2px 0 0; }
.hl-steps { padding-left: 24px; }
.hl-steps li { margin: 6px 0; }
.hl-warn { border: 2px solid var(--danger); border-radius: 10px; padding: 10px; }

/* toast */
.toast {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 70px); transform: translate(-50%, -20px); z-index: 60;
  background: #000; border: 2px solid var(--line); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 700;
  opacity: 0; pointer-events: none; transition: .2s; max-width: 92vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { border-color: var(--ok); }
.toast.err { border-color: var(--danger); }
