@font-face { font-family: "Oswald"; src: url("fonts/Oswald.ttf") format("truetype"); font-weight: 200 700; font-display: swap; }
:root {
  --navy: #0e3a63; --teal: #008080; --gold: #e8a317;
  --bg: #f2f6f9; --card: #fff; --ink: #14202b; --muted: #5b6b79; --line: #d5dfe7;
  --danger: #b3261e; --ok: #1b7f4b;
  --head: "Oswald", "Arial Narrow", "Helvetica Neue Condensed", Impact, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--body); color: var(--ink); background: var(--bg); font-size: 16px; line-height: 1.4;
  padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
h1, h2, h3 { font-family: var(--head); letter-spacing: .02em; margin: 0; font-weight: 600; }
a { color: var(--teal); }
.app-header { display: flex; align-items: center; gap: 12px; background: var(--navy); color: #fff;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px; border-bottom: 4px solid var(--gold); position: sticky; top: 0; z-index: 20; }
.app-logo { border-radius: 8px; background: #fff; width: 48px; height: 48px; object-fit: contain; }
.app-titles h1 { font-size: 20px; text-transform: uppercase; line-height: 1.1; }
.app-titles p { margin: 0; font-family: var(--head); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); font-size: 13px; }
#offlineBadge { margin-left: auto; }
main { max-width: 760px; margin: 0 auto; padding: 14px; outline: none; }
.view-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 12px; }
.view-title h2 { font-size: 24px; color: var(--navy); text-transform: uppercase; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.card h3 { font-size: 18px; color: var(--navy); text-transform: uppercase; margin-bottom: 8px; }
.card.example { border-left: 5px solid var(--gold); }
.sub { color: var(--muted); font-size: 14px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; }
.grid2 > *, .filters > * { min-width: 0; }
[hidden] { display: none !important; }
@media (max-width: 340px) { .grid2 { grid-template-columns: minmax(0,1fr); } .row { flex-direction: column; } }
label.f { display: block; font-size: 13px; font-weight: 600; color: var(--navy); margin: 10px 0 0; text-transform: uppercase; letter-spacing: .04em; }
label.f .opt { color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0; }
input, select, textarea { width: 100%; font: inherit; font-size: 16px; min-height: 46px; padding: 10px 12px; margin-top: 4px;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); -webkit-appearance: none; appearance: none; }
select { background-image: linear-gradient(45deg, transparent 50%, var(--navy) 50%), linear-gradient(135deg, var(--navy) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 34px; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(0,128,128,.3); border-color: var(--teal); }
input[readonly] { background: #eef3f6; color: var(--muted); }
.chk { display: flex; align-items: center; gap: 10px; min-height: 46px; font-size: 16px; margin-top: 8px; }
.chk input { width: 26px; height: 26px; min-height: 26px; margin: 0; flex: none; -webkit-appearance: auto; appearance: auto; accent-color: var(--teal); }
.robox { background: #eef3f6; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
.robox b { display: block; font-size: 16px; }
.robox .meta { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.chips { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.chip { display: flex; align-items: flex-start; gap: 10px; min-height: 46px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.chip.on { border-color: var(--teal); background: #eaf5f5; }
.chip input { width: 22px; height: 22px; min-height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--teal); -webkit-appearance: auto; appearance: auto; }
.chip span { flex: 1; min-width: 0; }
.chip b { display: block; font-size: 16px; font-weight: 650; }
.chip .meta { display: block; font-size: 13px; color: var(--muted); font-weight: 400; }
.chip .btn { flex: none; min-height: 36px; padding: 4px 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 10px 16px; border-radius: 10px; border: 1.5px solid var(--navy);
  background: #fff; color: var(--navy); font: 600 15px var(--body); cursor: pointer; text-decoration: none; text-align: center; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.navy { background: var(--navy); color: #fff; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #1b1300; }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.danger.solid { background: var(--danger); color: #fff; }
.btn.sm { min-height: 40px; padding: 6px 12px; font-size: 14px; }
.btn.block { display: flex; width: 100%; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; vertical-align: middle; }
.pill-gold { background: var(--gold); color: #1b1300; }
.pill-teal { background: var(--teal); color: #fff; }
.pill-red { background: #fbe3e1; color: var(--danger); border: 1px solid #f1b8b4; }
.pill-amber { background: #fff1d0; color: #7a5400; border: 1px solid #f0d58e; }
.pill-green { background: #dff3e7; color: var(--ok); border: 1px solid #b4dec3; }
.pill-grey { background: #e6edf2; color: var(--muted); }
.banner { margin: 0 auto; max-width: 760px; padding: 10px 14px; }
.banner > div { border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-top: 10px; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.banner .b-warn { background: #fff1d0; border: 1px solid #f0d58e; color: #5c4000; }
.banner .b-alert { background: #fbe3e1; border: 1px solid #f1b8b4; color: #7a1913; }
.banner a.btn { min-height: 38px; padding: 4px 12px; font-size: 14px; }
.rec-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.rec-title { font-weight: 700; font-size: 17px; }
.rec-date { font-family: var(--head); font-size: 15px; color: var(--teal); letter-spacing: .04em; }
.kv { font-size: 14px; color: var(--muted); margin-top: 2px; }
.filters { display: grid; grid-template-columns: minmax(0,1fr); gap: 8px; }
.empty { text-align: center; padding: 28px 10px; color: var(--muted); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -2px 10px rgba(0,0,0,.06); }
.tabbar a { flex: 1; text-align: center; padding: 7px 2px 8px; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 600; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.tabbar a .ico { font-size: 20px; line-height: 1.1; }
.tabbar a.active { color: var(--teal); }
.tabbar a.tab-new .ico { background: var(--gold); color: #1b1300; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28px; margin-top: -16px; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.tabbar a.tab-new { color: var(--navy); }
.wb { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-top: 10px; background: #fafcfd; }
.line { border: 1px dashed var(--teal); border-radius: 10px; padding: 10px; margin-top: 10px; background: #f6fbfb; }
.helper { margin-top: 8px; font-size: 14px; background: #eaf5f5; border-left: 4px solid var(--teal); border-radius: 6px; padding: 8px 10px; }
.helper.warn { background: #fff1d0; border-color: var(--gold); color: #5c4000; }
.helper:empty { display: none; }
.photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.photos .ph { position: relative; width: 92px; height: 92px; }
.photos img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.photos button { position: absolute; top: -8px; right: -8px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--danger); color: #fff; font-size: 18px; }
.sticky-actions { position: sticky; bottom: calc(66px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 22%); padding: 14px 0 6px; display: flex; gap: 8px; z-index: 5; }
.sticky-actions .btn { flex: 1; }
dialog { border: 0; border-radius: 14px; padding: 18px; width: min(92vw, 420px); box-shadow: 0 10px 40px rgba(0,0,0,.4); color: var(--ink); }
dialog::backdrop { background: rgba(10,25,40,.55); }
dialog h3 { color: var(--navy); font-size: 20px; text-transform: uppercase; margin-bottom: 8px; }
dialog .btns { justify-content: flex-end; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(80px + env(safe-area-inset-bottom)); background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 50; max-width: 90vw; }
.disclaimer { font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; margin-top: 8px; }
.stat { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 6px 0; font-size: 15px; }
.stat:last-child { border: 0; }

/* ---------- Customer copy (report) ---------- */
.report { background: #fff; color: #000; border: 1px solid var(--line); border-radius: 6px; padding: 18px; }
.rpt-head { display: flex; align-items: center; gap: 14px; border-bottom: 4px solid var(--gold); padding-bottom: 10px; margin-bottom: 12px; }
.rpt-head img { width: 76px; height: 76px; object-fit: contain; }
.rpt-head h1 { font-size: 24px; color: var(--navy); text-transform: uppercase; line-height: 1.05; }
.rpt-head .sub { color: #333; font-size: 13px; }
.rpt-title { font-family: var(--head); text-transform: uppercase; letter-spacing: .06em; color: var(--teal); font-size: 20px; margin: 4px 0 8px; }
.rpt-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; font-size: 14px; margin-bottom: 12px; }
.rpt-app { border: 1px solid #9fb3c2; border-radius: 6px; padding: 10px; margin-bottom: 12px; break-inside: avoid; page-break-inside: avoid; }
.rpt-app h3 { font-size: 16px; color: var(--navy); border-bottom: 1px solid #c8d5df; padding-bottom: 4px; margin-bottom: 6px; text-transform: uppercase; }
.rpt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 14px; font-size: 13.5px; }
.rpt-grid b { color: var(--navy); }
.rpt-grid .full { grid-column: 1 / -1; }
table.rpt-t { width: 100%; border-collapse: collapse; margin: 8px 0 4px; font-size: 13px; }
table.rpt-t th, table.rpt-t td { border: 1px solid #9fb3c2; padding: 4px 6px; text-align: left; vertical-align: top; }
table.rpt-t th { background: #e8f0f5; color: var(--navy); }
.rpt-foot { font-size: 11.5px; color: #333; border-top: 2px solid var(--navy); padding-top: 8px; margin-top: 10px; }
.rpt-photos img { height: 110px; margin: 4px 4px 0 0; border: 1px solid #999; border-radius: 4px; }
.draft-tag { color: #7a5400; font-weight: 700; }

@media print {
  @page { margin: 14mm 12mm; }
  html, body { background: #fff !important; padding: 0 !important; }
  .no-print, .app-header, .tabbar, .toast, #banners { display: none !important; }
  main { max-width: none; padding: 0; }
  .report { border: 0; padding: 0; border-radius: 0; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* online extras */
.syncbar { background: var(--navy); color: #fff; font-size: 13px; padding: 6px 14px; text-align: center; }
.syncbar.pending { background: #7a5400; }
.syncbar.error { background: var(--danger); }
.auth-wrap { max-width: 420px; margin: 24px auto; padding: 0 14px 40px; }
.auth-wrap .app-logo { width: 88px; height: 88px; display: block; margin: 0 auto 12px; border-radius: 12px; background: #fff; }
.auth-wrap h1 { text-align: center; color: var(--navy); text-transform: uppercase; font-size: 22px; }
.auth-wrap .sub { text-align: center; }
body.auth-page { padding-bottom: 20px; background: #e8eef3; }
.who { font-size: 13px; color: #c9d7e4; }
