:root {
  --bg: #f3f5f8; --card: #fff; --ink: #14202e; --muted: #5d6b7a; --line: #d9dee5;
  --brand: #1f3a5f; --accent: #e8590c; --ok: #2b8a3e; --bad: #c92a2a;
  --tap: 52px; --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1620; --card: #182231; --ink: #e8eef5; --muted: #9aa8b8; --line: #2a3747; --brand: #9cc1ea; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { padding-bottom: env(safe-area-inset-bottom); }
main { max-width: 640px; margin: 0 auto; padding: 12px 14px 40px; }
.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; min-height: 56px;
  padding: calc(6px + env(safe-area-inset-top)) 10px 6px; background: #1f3a5f; color: #fff; }
.bar-title { flex: 1; min-width: 0; }
#title { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#subtitle { color: #c9d6e6; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: #fff; font-size: 24px; }
.icon-btn:active { background: rgba(255,255,255,.15); }
.muted { color: var(--muted); }
.center { text-align: center; }
.card { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.stack > * + * { margin-top: 12px; }
h1, h2 { margin: 0; font-size: 22px; }
label { display: block; font-weight: 600; font-size: 15px; }
input, textarea { display: block; width: 100%; margin-top: 6px; min-height: var(--tap); padding: 12px 14px; font: inherit;
  color: var(--ink); background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; }
textarea { min-height: 120px; resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--brand); }
.btn { min-height: var(--tap); padding: 0 18px; font: inherit; font-weight: 600; border: 1.5px solid var(--line);
  border-radius: 12px; background: var(--card); color: var(--ink); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.primary { color: #0f1620; } }
.btn.big { width: 100%; font-size: 18px; }
.btn:disabled { opacity: .5; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.error { color: var(--bad); min-height: 1em; margin: 0; }
.search { position: sticky; top: 62px; z-index: 2; margin: 0 0 10px; font-size: 17px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { background: var(--card); border-radius: 12px; margin-bottom: 8px; padding: 14px 16px; min-height: var(--tap);
  box-shadow: 0 1px 2px rgba(0,0,0,.06); cursor: pointer; }
.list li:active { transform: scale(.99); }
.job-no { font-weight: 700; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: #e7f5ff; color: #1864ab; margin-left: 6px; vertical-align: 2px; }
.badge.ok { background: #ebfbee; color: var(--ok); }
.badge.wait { background: #fff4e6; color: #d9480f; }
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.action { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 104px;
  border: 0; border-radius: var(--radius); font: inherit; font-weight: 700; font-size: 17px; color: #fff; cursor: pointer; }
.action:active { filter: brightness(.9); }
.action-icon { font-size: 34px; line-height: 1; }
.action.photo { background: #1971c2; } .action.voice { background: #e8590c; } .action.note { background: #2b8a3e; }
.more-photos { margin: 10px 0 16px; text-align: center; font-weight: 400; color: var(--muted); font-size: 15px; }
.link { color: var(--brand); text-decoration: underline; }
.notes { list-style: none; margin: 0; padding: 0; }
.notes li { background: var(--card); border-radius: 12px; margin-bottom: 10px; padding: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.note-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.note-photo { width: 100%; max-height: 60vh; object-fit: cover; border-radius: 10px; background: var(--line); }
.note-body { white-space: pre-wrap; word-break: break-word; }
.note-transcript { margin-top: 6px; padding: 8px 10px; border-left: 3px solid var(--accent); background: var(--bg); border-radius: 6px; font-size: 15px; }
audio { width: 100%; margin-top: 4px; }
.outbox { position: sticky; top: 56px; z-index: 4; background: #fff4e6; color: #d9480f; text-align: center; font-weight: 600; font-size: 14px; padding: 8px; }
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet-body { width: 100%; max-width: 640px; background: var(--card); border-radius: 18px 18px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
.sheet-photo { width: 100%; max-height: 35vh; object-fit: contain; border-radius: 10px; }
.rec-time { font-size: 40px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.rec { display: block; margin: 0 auto; width: 92px; height: 92px; border-radius: 50%; border: 4px solid var(--line); background: var(--card); }
.rec span { display: block; margin: auto; width: 56px; height: 56px; border-radius: 50%; background: var(--bad); transition: all .15s; }
.rec.on span { width: 34px; height: 34px; border-radius: 6px; }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30;
  background: #14202e; color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; max-width: 92vw; }
[hidden] { display: none !important; }
