:root {
  --bg: #f5f6f8; --card: #fff; --text: #1d2330; --muted: #5f6b7a; --line: #dde1e7;
  --brand: #1f5fa8; --brand-dark: #174a84; --good: #1b7f3b; --warn: #a15c00; --bad: #b42318;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); padding-bottom: 76px; }
a { color: var(--brand); }
h1 { font-size: 1.45rem; margin: .2rem 0 .6rem; }
h2 { font-size: 1.15rem; margin: 1.4rem 0 .5rem; }
.wrap { max-width: 860px; margin: 0 auto; padding: 12px 16px; }
.topbar { background: var(--brand); color: #fff; }
.topbar .wrap { display: flex; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.topbar a { color: #fff; text-decoration: none; font-weight: 600; }
.topbar form { margin-left: auto; display: flex; flex: 1; max-width: 360px; }
.topbar input { width: 100%; border: 0; border-radius: 8px; padding: 8px 10px; font-size: 16px; }
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line);
  display: flex; justify-content: space-around; padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); z-index: 10; }
.bottomnav a { flex: 1; text-align: center; color: var(--muted); text-decoration: none; font-size: .78rem; padding: 4px 0; }
.bottomnav a .ico { display: block; font-size: 1.35rem; line-height: 1.2; }
.bottomnav a.on { color: var(--brand); font-weight: 600; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 10px 0; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 10px 16px;
  border-radius: 10px; border: 1px solid var(--brand); background: var(--brand); color: #fff; font-size: 1rem;
  font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:active { background: var(--brand-dark); }
.btn.secondary { background: #fff; color: var(--brand); }
.btn.danger { background: #fff; color: var(--bad); border-color: var(--bad); }
.btn.good { background: var(--good); border-color: var(--good); }
.btn.big { width: 100%; min-height: 64px; font-size: 1.15rem; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 420px) { .grid2.stack { grid-template-columns: 1fr; } }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list a.rowlink { display: flex; gap: 12px; align-items: center; padding: 10px 2px; text-decoration: none; color: inherit; }
.thumb { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: #e9ecf1; flex: none;
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .7rem; }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9rem; color: var(--muted); }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: #e9ecf1; color: var(--text); }
.badge.good { background: #dcf3e3; color: var(--good); }
.badge.fair { background: #fff0d6; color: var(--warn); }
.badge.damaged, .badge.bad { background: #fde3e1; color: var(--bad); }
.badge.out { background: #e3e9ff; color: #2a3f9d; }
.messages { list-style: none; padding: 0; margin: 8px 0; }
.messages li { padding: 10px 12px; border-radius: 8px; background: #dcf3e3; margin-bottom: 6px; }
.messages li.error { background: #fde3e1; }
.messages li.info { background: #e3e9ff; }
form .field, form > div { margin-bottom: 14px; }
label { display: block; font-weight: 600; margin-bottom: 4px; }
input[type=text], input[type=number], input[type=date], input[type=email], input[type=password], input[type=search], select, textarea {
  width: 100%; font-size: 16px; padding: 11px 12px; border: 1px solid #c6ccd5; border-radius: 8px; background: #fff; color: var(--text); }
input[type=checkbox] { width: 22px; height: 22px; vertical-align: middle; }
.checkrow label { display: inline; font-weight: 500; margin-left: 6px; }
.helptext { display: block; color: var(--muted); font-size: .85rem; margin-top: 3px; }
.errorlist { color: var(--bad); margin: 4px 0; padding-left: 18px; }
.radios { display: flex; gap: 8px; flex-wrap: wrap; }
.radios label { font-weight: 500; border: 1px solid #c6ccd5; border-radius: 8px; padding: 10px 14px; background: #fff; margin: 0; }
.radios input { margin-right: 6px; }
.radios label:has(input:checked) { border-color: var(--brand); background: #e8f0fb; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; }
.photo-wrap { position: relative; }
.photo-wrap form { position: absolute; top: 4px; right: 4px; margin: 0; }
.photo-wrap button { background: rgba(0,0,0,.6); color: #fff; border: 0; border-radius: 99px; width: 30px; height: 30px; font-size: 1rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stats .stat { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; min-width: 90px; }
.stats .stat b { display: block; font-size: 1.3rem; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.tabs a { padding: 6px 12px; border-radius: 99px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--text); font-size: .9rem; }
.tabs a.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.timeline { list-style: none; padding: 0; margin: 0; font-size: .92rem; }
.timeline li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
details summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
