:root {
  --primary:#246b57;
  --deep:#194c3e;
  --soft:#e5f0eb;
  --base:#f5f7f5;
  --line:#dde5e0;
  --text:#202c27;
  --muted:#54635b;
  --white:#fff;
  --error:#a63131;
  --camera:#151a18;
  --radius:12px;
  --safe:env(safe-area-inset-bottom,0px);
  color:var(--text);
  background:var(--base);
  font:400 100%/1.55 Inter,system-ui,sans-serif;
}
* { box-sizing:border-box; }
body { margin:0; }
button,input,textarea,select { font:inherit; }
button { cursor:pointer; }
[hidden] { display:none!important; }
:focus-visible { outline:3px solid #286bcb; outline-offset:3px; }
h1,h2,h3,p { margin:0; }
h1,h2,h3 { line-height:1.2; overflow-wrap:anywhere; }
h1 { font-size:clamp(1.55rem,5vw,2.15rem); letter-spacing:-.04em; }
h2 { font-size:1.15rem; letter-spacing:-.02em; }
h3 { font-size:1rem; }
svg { flex:none; }
.shell { min-height:100dvh; }
.rail { display:flex; align-items:center; justify-content:space-between; min-height:74px; padding:10px 16px; background:var(--white); border-bottom:1px solid var(--line); }
.brand { display:flex; align-items:center; gap:8px; font-size:1.38rem; font-weight:750; letter-spacing:-.07em; line-height:1; }
.brand img { width:43px; height:43px; }
.brand strong { color:var(--primary); }
.nav { position:fixed; z-index:5; inset:auto 0 0; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); background:var(--white); border-top:1px solid var(--line); min-height:64px; padding:4px 4px calc(4px + var(--safe)); }
.nav button { border:0; border-radius:8px; background:transparent; color:var(--muted); min-height:54px; display:grid; place-content:center; justify-items:center; gap:4px; padding:3px 0; font-weight:600; font-size:.72rem; }
.nav button[aria-current] { color:var(--deep); background:var(--soft); }
.rail-footer { display:none; }
.main { width:min(100%,980px); min-width:0; margin:0 auto; padding:20px 16px calc(90px + var(--safe)); }
.page-head { display:flex; align-items:center; gap:10px; margin-bottom:20px; }
.page-head .copy { flex:1; min-width:0; }
.subtitle,.quiet { color:var(--muted); }
.subtitle { margin-top:5px; }
.quiet { font-size:.9rem; }
.stack { display:grid; gap:14px; }
.section { margin-top:28px; }
.section-title { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
.welcome { padding:clamp(18px,4vw,32px); background:#e5eee8; border:1px solid #d5e5da; border-radius:17px; }
.welcome p { max-width:54ch; margin:9px 0 18px; color:#43584d; }
.welcome .actions { margin-top:16px; }
.actions { display:flex; flex-wrap:wrap; align-items:center; gap:9px; }
.button { display:inline-flex; text-decoration:none; align-items:center; justify-content:center; gap:8px; min-height:48px; padding:8px 14px; border:1px solid #abbeb2; border-radius:8px; background:var(--white); color:var(--deep); font-weight:650; text-align:center; }
.button:hover:not(:disabled) { box-shadow:inset 0 0 0 2px #246b5724; }
.button.primary { background:var(--primary); color:var(--white); border-color:var(--primary); }
.button.light { background:transparent; border-color:transparent; }
.button.danger { color:var(--error); }
.button.icon { width:48px; padding:0; flex:none; }
.button:disabled,button:disabled { cursor:default; opacity:.58; }
.panel,.card { background:var(--white); border:1px solid var(--line); border-radius:var(--radius); padding:16px; }
.panel > h2,.panel > h3 { margin-bottom:10px; }
.cards { display:grid; gap:12px; }
.card { display:grid; gap:8px; align-content:start; min-width:0; }
button.card { text-align:left; color:inherit; min-height:80px; }
button.card:hover { border-color:var(--primary); }
.card-title,.icon-text { display:flex; align-items:center; min-width:0; gap:12px; }
.card-title > div,.icon-text > div { flex:1; min-width:0; }
.tile-icon { display:grid; place-items:center; width:46px; height:46px; color:var(--primary); background:var(--soft); border-radius:10px; flex:none; }
.empty { padding:26px 18px; border:1px dashed #aebfb3; border-radius:var(--radius); display:grid; gap:8px; justify-items:start; background:#fafcfb; }
.pill { display:inline-flex; align-items:center; width:max-content; max-width:100%; gap:6px; padding:3px 9px; border-radius:30px; background:var(--soft); color:var(--deep); font-size:.84rem; font-weight:650; }
.pill.pending { background:#faeed9; color:#6b460d; }
.pill.neutral { background:#edf1ee; color:#484f4c; }
.meta { font-size:.86rem; color:var(--muted); }
.progress-label { display:flex; justify-content:space-between; flex-wrap:wrap; gap:4px; align-items:center; }
progress { display:block; width:100%; height:9px; appearance:none; border:0; background:#e4ebe6; border-radius:12px; accent-color:var(--primary); }
progress::-webkit-progress-bar { background:#e4ebe6; border-radius:12px; }
progress::-webkit-progress-value { background:var(--primary); border-radius:12px; }
.step-row { display:grid; grid-template-columns:1fr auto; gap:8px; align-items:center; padding:10px; }
.step-row button:first-child { background:none; border:0; text-align:left; color:inherit; min-height:48px; min-width:0; border-radius:8px; }
.step-row button:first-child:hover { background:var(--base); }
.step-index { align-self:start; margin-top:2px; }
form,.fields { display:grid; gap:12px; }
form label,.fields label { display:grid; gap:5px; font-weight:600; }
input:not([type=checkbox]),textarea,select { width:100%; min-height:48px; color:inherit; border:1px solid #a9b8af; border-radius:8px; background:white; padding:8px 10px; }
input[type=color] { max-width:120px; }
input[type=checkbox] { width:20px; height:20px; accent-color:var(--primary); }
textarea { min-height:90px; resize:vertical; }
.gallery { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(104px,45%),1fr)); gap:8px; }
.photo-thumb { overflow:hidden; aspect-ratio:1; padding:0; border:1px solid var(--line); border-radius:8px; background:var(--soft); }
.photo-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.photo-large { display:block; max-width:100%; max-height:65dvh; object-fit:contain; margin:auto; border-radius:8px; }
.status-float { position:fixed; z-index:20; inset:auto max(12px,env(safe-area-inset-right)) calc(75px + var(--safe)) max(12px,env(safe-area-inset-left)); padding:12px 15px; background:#194c3e; color:#fff; border-radius:9px; box-shadow:0 4px 20px #151a182b; }
.status-float.bad { background:#842e2e; }
.camera-view { --text:#f5f7f5; --muted:#dce6e0; background:var(--camera); color:var(--text); min-height:100dvh; padding:calc(12px + env(safe-area-inset-top)) 16px calc(14px + var(--safe)); display:grid; align-content:start; gap:12px; }
.camera-view .camera-row { width:min(100%,680px); margin:auto; display:flex; justify-content:space-between; align-items:center; gap:8px; }
.camera-view .button { background:#2c3732; border-color:#60736a; color:#fff; }
.camera-view .viewfinder { width:min(100%,680px); max-height:68dvh; min-height:250px; margin:auto; position:relative; display:grid; place-items:center; background:#090d0b; border:1px solid #46544d; border-radius:14px; overflow:hidden; }
.viewfinder video { display:block; max-width:100%; max-height:64dvh; width:auto; height:auto; }
.viewfinder .view-note { text-align:center; padding:24px; }
.camera-overlay { position:absolute; pointer-events:none; left:50%; top:50%; transform:translate(-50%,-50%); max-width:100%; }
.camera-actions { justify-content:center!important; }
.camera-actions > div { width:48px; }
.shutter { appearance:none; width:76px; height:76px; border-radius:50%; border:4px solid #fff; background:#f6f8f6; box-shadow:inset 0 0 0 5px var(--camera); margin:2px 9px; }
.shutter:hover:not(:disabled) { background:#d5e9df; }
.report-pages { display:grid; width:min(100%,650px); gap:14px; }
.report-page { width:100%; aspect-ratio:595.28/841.89; position:relative; container-type:inline-size; background:white; border:1px solid var(--line); overflow:hidden; }
.report-page span,.report-page img { position:absolute; display:block; line-height:1; }
.report-page span { transform:translateY(-80%); white-space:nowrap; }
.report-page img { object-fit:contain; }
.notice { border-left:4px solid var(--primary); padding:10px 12px; border-radius:5px; background:var(--soft); }
.notice.warning { border-color:#b7791f; background:#fbf0db; }
.pair { display:grid; gap:12px; }
@media (min-width:660px) {
  .pair,.cards { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .cards.single { grid-template-columns:1fr; }
  .main { padding-inline:24px; }
}
@media (min-width:900px) {
  .shell:not(.camera-shell) { display:grid; grid-template-columns:225px minmax(0,1fr); }
  .rail { position:sticky; inset:0 auto auto; min-height:100dvh; height:100dvh; justify-content:start; align-items:stretch; flex-direction:column; padding:20px 14px; gap:22px; border-right:1px solid var(--line); border-bottom:0; }
  .rail > .settings-mobile { display:none; }
  .nav { position:static; display:grid; grid-template-columns:1fr; border:0; padding:0; gap:5px; }
  .nav button { min-height:48px; display:flex; justify-content:start; padding:8px 12px; gap:12px; font-size:.9rem; }
  .rail-footer { display:grid; align-content:end; margin-top:auto; gap:10px; }
  .main { padding:34px 34px 48px; }
  .status-float { inset:auto 24px 24px auto; max-width:530px; }
}
