:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #18211b;
  background: #f3f5f3;
  letter-spacing: 0;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; }
button, input { font: inherit; }
button { min-height: 48px; border: 0; border-radius: 6px; padding: 0 20px; background: #146b43; color: #fff; font-weight: 700; }
input { width: 100%; min-height: 48px; margin: 8px 0 16px; border: 1px solid #aeb8b1; border-radius: 6px; padding: 10px 12px; background: #fff; }
.login-page { background: #edf2ee; }
.login-main { display: grid; min-height: 100dvh; place-items: center; padding: 24px; }
.login-panel { width: min(100%, 380px); border-top: 4px solid #146b43; background: #fff; padding: 28px 24px; box-shadow: 0 8px 28px rgb(25 45 32 / 10%); }
.product-mark { color: #146b43; font-size: 12px; font-weight: 800; }
h1 { margin: 8px 0 24px; font-size: 24px; }
.form-error { border-left: 3px solid #b42318; padding: 10px 12px; color: #8f1d15; background: #fff1f0; }
.topbar { position: sticky; top: 0; height: 52px; display: flex; align-items: center; padding: 0 16px; background: #fff; border-bottom: 1px solid #d9dedb; }
.app-main { padding: 20px 16px calc(92px + env(safe-area-inset-bottom)); }
.empty-state { color: #5f6e64; }
.secondary-button { background: #fff; color: #274b37; border: 1px solid #9eb1a5; }
.bottom-nav { position: fixed; z-index: 10; right: 0; bottom: 0; left: 0; height: calc(64px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: #fff; border-top: 1px solid #d9dedb; }
.nav-item { display: flex; min-width: 0; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #637168; text-decoration: none; font-size: 12px; }
.nav-item b { height: 20px; font-size: 11px; line-height: 20px; }
.nav-item.active { color: #146b43; font-weight: 700; }

@media (min-width: 720px) {
  .app-main, .topbar { padding-right: max(16px, calc((100% - 680px) / 2)); padding-left: max(16px, calc((100% - 680px) / 2)); }
  .bottom-nav { right: calc((100% - 680px) / 2); left: calc((100% - 680px) / 2); border-right: 1px solid #d9dedb; border-left: 1px solid #d9dedb; }
}

.panel { padding: 16px; }
.panel h2, .panel h3 { margin: 0 0 14px; font-size: 18px; }
form { display: grid; gap: 12px; }
label { display: grid; gap: 6px; color: #37413d; font-size: 13px; }
input, textarea, select, button { min-height: 44px; box-sizing: border-box; width: 100%; border: 1px solid #c8d0cc; border-radius: 6px; background: #fff; padding: 10px 12px; color: #17201c; font: inherit; }
textarea { min-height: 76px; resize: vertical; }
button { width: auto; cursor: pointer; font-weight: 700; }
button.submitting { pointer-events: none; opacity: .65; }
button.primary { border-color: #146b43; background: #146b43; color: #fff; }
button.danger { border-color: #b42318; color: #b42318; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.check { display: flex; grid-template-columns: auto 1fr; align-items: center; }
.check input { min-height: 20px; width: 20px; }
.scanner { margin-bottom: 14px; overflow: hidden; border: 1px solid #d9dedb; border-radius: 6px; background: #111; color: #fff; }
.scanner video { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.scanner .actions { display: flex; gap: 8px; padding: 10px; }
.scanner small { display: block; padding: 0 10px 10px; }
.result, article { margin-top: 14px; border-top: 1px solid #e1e5e3; padding-top: 14px; }
pre { max-width: 100%; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.record-actions { display: flex; align-items: center; gap: 8px; }
.record-actions form { margin-left: auto; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
#confirm-dialog { width: min(88vw, 360px); border: 0; border-radius: 8px; padding: 20px; }
#confirm-dialog::backdrop { background: rgba(0, 0, 0, .45); }
.history-filters { margin: 16px 0; border-bottom: 1px solid #e1e5e3; padding-bottom: 16px; }
article small { display: block; color: #69736e; }
.notice { border-left: 3px solid #146b43; padding: 8px 10px; background: #edf7f1; }
.confirmation-summary { border-left: 3px solid #b42318; padding: 10px 12px; background: #fff1f0; overflow-wrap: anywhere; font-size: 13px; }
