/* FieldCapture - portrait first, gloves first. Big targets, hard contrast. */

:root {
  --bg: #101418;
  --panel: #1b2128;
  --panel-2: #232b34;
  --line: #38424e;
  --ink: #f2f5f8;
  --ink-dim: #9dabb9;
  --accent: #ff7a1a;
  --record: #e02020;
  --ok: #2fbf5f;
  --warn: #ffc400;
  --tap: 60px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior-y: contain;
}

body {
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}

h1 { font-size: 19px; margin: 0; font-weight: 700; letter-spacing: .2px; }
h2 { font-size: 16px; margin: 18px 0 6px; color: var(--ink); }
hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0 6px; }
code { background: var(--panel-2); padding: 1px 5px; border-radius: 4px; }

.screen[hidden] { display: none; }

.bar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.bar h1 { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.body { padding: 14px 14px 40px; }

.icon {
  min-width: 44px; min-height: 44px;
  font-size: 22px; line-height: 1;
  background: var(--panel-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--tap); padding: 0 18px;
  background: var(--panel-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px;
  font-size: 18px; font-weight: 700; letter-spacing: .3px;
  cursor: pointer; user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; }
.btn-primary { background: var(--accent); color: #17110a; border-color: #ff9a4d; }
.btn-huge { min-height: 84px; font-size: 24px; width: 100%; }
.btn-slim { min-height: 44px; font-size: 15px; padding: 0 14px; }
.btn-ghost { background: transparent; color: var(--ink-dim); }

.hidden-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.capture-actions { display: grid; gap: 12px; }

.row-cta { display: flex; gap: 10px; margin-top: 14px; }
.row-cta.small .btn { flex: 1; min-height: 52px; font-size: 16px; }
.row-cta input {
  flex: 1; min-height: var(--tap); padding: 0 14px; font-size: 18px;
  background: var(--panel-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px;
}

.hint { color: var(--ink-dim); font-size: 14px; margin: 8px 0 0; }

.list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.list li {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; min-height: 62px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
}
.list li .grow { flex: 1; min-width: 0; }
.list li .t1 { font-weight: 700; }
.list li .t2 { color: var(--ink-dim); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list li.tap:active { background: var(--panel-2); }
.thumb { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: var(--panel-2); }

.pill {
  padding: 6px 12px; border-radius: 999px; font-size: 14px; font-weight: 700;
  background: var(--panel-2); border: 1px solid var(--line); white-space: nowrap;
}
.pill.ok { background: #10331e; border-color: var(--ok); color: #b6f2cd; }
.pill.pending { background: #3a2d05; border-color: var(--warn); color: #ffe79a; }
.pill.err { background: #3a1111; border-color: var(--record); color: #ffc4c4; }

.tag { padding: 4px 9px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13px; }

.banner {
  padding: 12px 14px; font-size: 15px; font-weight: 600;
  background: var(--warn); color: #241c00; text-align: center;
}
.banner.bad { background: var(--record); color: #fff; }

/* --------------------------------------------------------------- review */

.review { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.shot { position: relative; flex: 1; min-height: 34vh; background: #000; }
.shot img { width: 100%; height: 100%; object-fit: contain; display: block; }
.noimg {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--ink-dim); font-size: 22px; font-weight: 800; letter-spacing: 2px;
}
.shot-id {
  position: absolute; top: 10px; left: 10px;
  padding: 6px 12px; border-radius: 8px;
  background: rgba(0, 0, 0, .65); font-size: 20px; font-weight: 800;
}

.record-zone { padding: 12px 14px 4px; text-align: center; }
.timer { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; margin-bottom: 8px; }
.btn-record {
  width: 100%; min-height: 96px; font-size: 26px;
  background: var(--record); color: #fff; border-color: #ff5a5a;
}
.btn-record.recording { background: #7a0f0f; border-color: var(--record); animation: pulse 1s infinite; }
.btn-record.done { background: var(--ok); border-color: #7ce6a4; color: #062b13; }
@keyframes pulse { 50% { opacity: .72; } }
.rec-sub { display: flex; gap: 10px; justify-content: center; margin-top: 10px; min-height: 44px; }

.chips {
  display: flex; gap: 8px; overflow-x: auto; padding: 12px 14px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; min-height: 52px; padding: 0 18px;
  display: inline-flex; align-items: center;
  background: var(--panel-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px;
  font-size: 17px; font-weight: 700; white-space: nowrap;
}
.chip.on { background: var(--accent); color: #17110a; border-color: #ff9a4d; }

.note {
  margin: 0 14px; min-height: 54px; padding: 0 14px; font-size: 17px;
  background: var(--panel-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px;
}

.review-actions { display: flex; gap: 10px; align-items: stretch; padding: 14px; }
.review-actions .btn-ghost { flex: 0 0 34%; min-height: 84px; }

/* --------------------------------------------------------------- settings */

.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 14px; color: var(--ink-dim); margin-bottom: 5px; }
.field input {
  width: 100%; min-height: var(--tap); padding: 0 14px; font-size: 17px;
  background: var(--panel-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px;
}
textarea {
  width: 100%; padding: 12px 14px; font-size: 16px;
  background: var(--panel-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px; resize: vertical;
}
#btn-free-space { width: 100%; }

/* ---------------------------------------------------------------- delete
 * The delete button sits quiet until it is wanted: same size as everything
 * else so it can be hit with a glove, but grey, and never destructive on the
 * first tap. Confirming turns it red -- the only red in the list. */
.del {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
  flex-shrink: 0;
}
.del .btn-del {
  opacity: 0.55;
}
.del-q {
  font-size: 14px;
  color: #f2b3b3;
  white-space: nowrap;
}
.del .btn-del-yes {
  background: #7a2222;
  border-color: #a53535;
  color: #ffecec;
}
#remove-job-confirm .del-q {
  white-space: normal;
}
.btn-remove-yes {
  background: #7a2222;
  border-color: #a53535;
  color: #ffecec;
}
#deleted-list li {
  opacity: 0.85;
}
#deleted-list .t1 {
  text-decoration: line-through;
}

/* Sweep mode: the toggle reads as engaged, not decorative. */
#btn-rapid.on {
  background: #1f4d2b;
  border-color: #2f7a42;
  color: #e8ffef;
}

/* The talk button is held, not tapped, so it must not fight the browser for
   the gesture: no scrolling, no text selection, no iOS callout. */
.btn-record {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* The `hidden` attribute only removes an element if nothing else sets `display`,
   and `.btn` does. Without this, every hidden button in the app was visible:
   Play and Re-record before a recording existed, and both save buttons at once
   in sweep mode. Global and deliberate. */
[hidden] {
  display: none !important;
}
