:root{font-family:Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;color:#192c2c;background:#f5f8f7;font-synthesis:none}
*{box-sizing:border-box}body{margin:0;line-height:1.45}button,input{font:inherit}button{cursor:pointer}a{color:#087774;text-decoration:none}a:hover{text-decoration:underline}.container{max-width:1200px;padding-left:24px;padding-right:24px;margin:0 auto}.topbar{height:82px;background:#fff;border-bottom:1px solid #e5eeeb}.top-inner{height:100%;display:flex;align-items:center;justify-content:space-between}.identity{display:flex;gap:12px;align-items:center}.identity b{display:block;color:#0b5e5c;font-size:21px;font-weight:850;letter-spacing:-.7px}.identity small{display:block;font-size:11px;color:#829392;letter-spacing:.6px;text-transform:uppercase}.brand-mark{display:grid;place-items:center;width:43px;height:43px;border-radius:15px;color:#fff;background:#13736e;font-size:27px;line-height:1}.text-button,.link-button{border:0;background:none;color:#116f6a;font-size:13px;font-weight:700;padding:8px 0}.text-button:hover,.link-button:hover{color:#0b4d4a}.danger{color:#aa514e}.page-intro{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:40px 0 25px}.eyebrow{font-size:10px;letter-spacing:1.65px;font-weight:850;color:#218b82;margin-bottom:8px}h1{font-size:clamp(29px,4vw,38px);margin:0;letter-spacing:-1.5px;line-height:1.12}h2{font-size:19px;letter-spacing:-.65px;line-height:1.2;margin:0 0 8px}h3{font-size:16px;margin:0;letter-spacing:-.3px}.heading-dot{color:#39ab90}.muted{color:#829290}.page-intro p{margin:12px 0 0;font-size:14px}.small{font-size:13px}.card{background:#fff;border:1px solid #e7eeeb;border-radius:19px;box-shadow:0 7px 26px #163a3410}.stats-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-bottom:18px}.stat{padding:21px 23px;position:relative;min-height:172px}.stat-icon{float:right;display:grid;place-items:center;width:33px;height:33px;border-radius:10px;background:#e5f4f1;color:#127c75;font-size:18px}.stat-label{color:#849491;font-size:12px;font-weight:650;margin-bottom:19px}.stat-value{font-size:clamp(25px,3vw,32px);letter-spacing:-1px;font-weight:850;font-variant-numeric:tabular-nums;white-space:nowrap}.stat-value span{font-size:13px;letter-spacing:0;color:#647f7b;font-weight:600}.stat-detail{font-size:11px;color:#92a19e;margin-top:9px}.stat.accent{background:linear-gradient(120deg,#13776f,#0e625f);border-color:#13776f;color:#fff}.stat.accent .stat-icon{background:#ffffff24;color:#fff}.stat.accent .stat-label,.stat.accent .stat-value span,.stat.accent .stat-detail{color:#d0eeeb}.main-grid{display:grid;grid-template-columns:minmax(335px,.95fr) minmax(0,1.3fr);gap:18px}.entry-card,.chart-card,.history-card{padding:25px}.card-title-row{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}.step-pill{background:#eaf5f2;border-radius:9px;padding:6px 11px;color:#257a74;font-weight:800;font-size:12px}.entry-card p{margin:12px 0 20px;line-height:1.6}.form-stack{display:flex;flex-direction:column;gap:15px}.form-stack label:not(.upload-box){font-size:12px;font-weight:750;color:#425653;display:flex;flex-direction:column;gap:7px}.form-stack input:not([type=file]){width:100%;padding:11px 13px;border:1px solid #dce8e4;border-radius:10px;outline:0;background:#fff;font-size:14px;color:#163b37}.form-stack input:focus{border-color:#1f9187;box-shadow:0 0 0 3px #1f918718}.form-stack .optional{display:inline;font-weight:450;color:#93a29e}.upload-box{border:1.5px dashed #acd6ce;background:#f2faf8;border-radius:15px;text-align:center;padding:21px 12px;display:flex;flex-direction:column;align-items:center;gap:5px;color:#245c54;cursor:pointer}.upload-box strong{font-size:13px}.upload-box span:not(.upload-icon){font-size:11px;color:#6d9d96}.upload-icon{display:grid;place-items:center;width:43px;height:43px;border-radius:13px;background:#dcefe9;color:#138477;font-size:28px;margin-bottom:5px}.upload-box input{display:none}.upload-box:focus-within{outline:3px solid #46a99a}.two-fields{display:grid;grid-template-columns:1.2fr 1fr;gap:12px}.helper{font-size:11px;line-height:1.6;color:#82938f}.primary-btn{width:100%;color:#fff;border:0;padding:13px 16px;background:#13766f;border-radius:11px;font-weight:750;font-size:13px;box-shadow:0 4px 10px #115e591d}.primary-btn:hover{background:#0c5954}.secondary-btn{width:100%;background:#e8f6f2;border:1px solid #c1e7de;border-radius:10px;padding:10px 13px;color:#13746c;font-size:13px;font-weight:750}.secondary-btn:disabled{opacity:.5;cursor:wait}.outline-btn{white-space:nowrap;display:inline-flex;align-items:center;gap:8px;padding:10px 14px;color:#2c665f;border:1px solid #cfded9;border-radius:10px;background:white;font-size:12px;font-weight:750}.chart-toolbar{display:flex;justify-content:space-between;align-items:center;gap:6px;margin:19px 0 12px;color:#8a9896;font-size:11px}.segmented{display:flex;border-radius:9px;padding:3px;background:#eff5f3;gap:2px}.segmented button{font-size:11px;color:#667d78;padding:6px 9px;background:none;border:0;border-radius:6px}.segmented button.selected{background:white;color:#11695f;box-shadow:0 2px 6px #173e2c11;font-weight:800}.chart-scroll{width:100%;overflow-x:auto;overflow-y:hidden}.chart-scroll svg{display:block;min-width:100%}.chart-placeholder{min-height:175px;display:grid;place-items:center;text-align:center;color:#859a95;font-size:12px}.divider{border-top:1px solid #edf1ef;margin:22px 0}.compact{margin-bottom:12px}.history-card{margin:18px 0 35px}.count-pill{background:#eef5f3;color:#438277;border-radius:20px;font-size:11px;padding:4px 9px;vertical-align:middle;letter-spacing:0}.table-scroll{overflow-x:auto;margin-top:18px}table{border-collapse:collapse;width:100%;white-space:nowrap;font-size:12px}th{text-align:left;background:#f6f9f8;color:#849792;font-size:11px;font-weight:700;padding:13px 12px}th:first-child{border-radius:7px 0 0 7px}th:last-child{border-radius:0 7px 7px 0}td{padding:14px 12px;border-bottom:1px solid #edf3f0;color:#49615b}td.num{font-variant-numeric:tabular-nums}td.strong{font-weight:800;color:#263c37}.unit{color:#8fa09c;font-weight:400}td.notes{max-width:180px;white-space:normal;word-break:break-word}.actions{display:flex;gap:14px;align-items:center}.actions form{margin:0}.actions .link-button{font-size:11px}.empty-row{text-align:center;padding:30px;color:#92a09c}.footer{font-size:11px;color:#96a5a0;padding-bottom:24px}.alert{margin:18px 0 -8px;padding:13px 15px;border-radius:10px;font-size:13px;border:1px solid}.alert.error{background:#fff1ee;border-color:#f7d6d1;color:#9d453b}.alert.success{background:#e8f7ed;border-color:#b7e9c7;color:#266b45}.access-card{max-width:440px;padding:30px;margin:70px auto 40px}.access-card h1{font-size:29px}.access-card p{font-size:13px;margin:14px 0 25px}.access-card .helper{font-size:11px;margin-bottom:0}.hidden{display:none!important}.photo-tools{display:flex;flex-direction:column;gap:10px}.photo-tools canvas{width:100%;height:auto;touch-action:none;border-radius:12px;border:1px solid #e0e9e6;cursor:crosshair}.crop-head{font-size:11px;display:flex;align-items:center;justify-content:space-between;gap:8px;color:#82918c}.crop-head button{font-size:11px}
@media(max-width:920px){.main-grid{grid-template-columns:1fr}.stats-grid{grid-template-columns:repeat(3,1fr)}.stat{padding:17px;min-height:150px}.stat-value{font-size:26px}.chart-card{min-height:375px}}
@media(max-width:620px){.container{padding-left:15px;padding-right:15px}.topbar{height:66px}.brand-mark{width:36px;height:36px}.identity b{font-size:18px}.identity small{font-size:9px}.page-intro{padding:29px 0 19px;align-items:flex-start}.page-intro p{font-size:12px}.export{font-size:0;padding:10px;max-height:37px}.export::first-letter{font-size:16px}.stats-grid{grid-template-columns:1fr 1fr;gap:10px}.stat{padding:15px;min-height:141px}.stat:last-child{grid-column:span 2;min-height:126px}.stat-label{font-size:11px;margin-bottom:13px}.stat-value{font-size:25px}.stat-detail{font-size:10px}.entry-card,.chart-card,.history-card{padding:18px;border-radius:15px}.two-fields{grid-template-columns:1fr 1fr;gap:8px}.chart-toolbar{flex-wrap:wrap}.stat.accent .stat-label{margin-bottom:9px}.history-card{margin-bottom:20px}.access-card{margin-top:35px}.chart-scroll svg{max-width:none}h2{font-size:17px}}
@media(max-width:385px){.two-fields{grid-template-columns:1fr}.stats-grid{grid-template-columns:1fr}.stat:last-child{grid-column:auto}.stat{min-height:unset}.stat-label{margin-bottom:8px}}
/* v0.2 — meerdere watermeters, aparte tellerherkenning */
select {font:inherit; color:#183d38}
.form-stack select,.meter-edit-row input,.meter-edit-row select,.history-filter select,.filter-toolbar select {
  width:100%;padding:11px 12px;background:#fff;border:1px solid #dce8e4;border-radius:10px;outline:0;
  font-size:13px;color:#163b37;
}
.form-stack select:focus,.meter-edit-row input:focus,.filter-toolbar select:focus{border-color:#1f9187;box-shadow:0 0 0 3px #1f918718}
.coverage-warning {border-left:4px solid #bd873e;background:#fff8ec;color:#785a2f;border-radius:9px;padding:13px 15px;margin:0 0 19px;font-size:12px;line-height:1.6}
.meter-summary {display:grid;grid-template-columns:repeat(auto-fit,minmax(225px,1fr));gap:13px;margin-bottom:18px}
.meter-mini {display:flex;gap:12px;align-items:flex-start;padding:15px 17px}
.meter-mini h3{margin:2px 0 7px;font-size:13px;line-height:1.3}.meter-mini p{margin:2px 0;font-size:11px}
.meter-no,.meter-id {background:#e4f4f0;color:#096d64;font-weight:850;font-size:12px;white-space:nowrap;padding:8px 9px;border-radius:9px;line-height:1}
.meter-no.compact-no {display:inline-block;padding:5px 7px;font-size:10px;margin-right:4px}
.meter-settings{padding:25px;margin:18px 0}.meter-settings .muted{max-width:830px}
.meter-edit-grid{display:flex;flex-direction:column;gap:10px;margin-top:17px}
.meter-edit-row {display:grid;grid-template-columns:70px minmax(175px,1fr) 65px 65px 85px;align-items:end;gap:9px;padding:12px;border:1px solid #edf1ef;border-radius:12px;background:#fcfefd}
.meter-edit-row .meter-id{align-self:center;text-align:center;padding:13px 6px;font-size:11px}
.meter-edit-row label{font-size:11px;font-weight:700;color:#526964;display:flex;flex-direction:column;gap:6px}
.meter-edit-row input{min-width:0}.meter-edit-row .secondary-btn{height:40px;padding:8px}
.add-meter{margin-top:16px;padding:13px 17px;border:1px dashed #b5dcd1;border-radius:12px;max-width:530px}
.add-meter summary{font-size:12px;color:#117267;font-weight:800;cursor:pointer}
.add-meter .form-stack{margin-bottom:0}.history-filter{display:flex;gap:9px;align-items:center;font-size:11px;color:#849491}
.history-filter select{min-width:130px;max-width:260px}
.filter-toolbar{align-items:center!important;justify-content:flex-start!important;gap:15px!important}
.filter-toolbar label{white-space:nowrap;font-weight:700}
.filter-toolbar select{min-width:180px;max-width:320px;padding:9px 11px}
.photo-tools .toolrow{display:flex;flex-wrap:wrap;gap:7px}
.photo-tools .toolrow .secondary-btn{flex:1 1 60px;width:auto;white-space:nowrap;padding:9px 7px;font-size:11px}
.photo-tools .toolrow.choose-crop .secondary-btn{flex:1 1 120px}
.photo-tools .secondary-btn.is-active{background:#127b70;border-color:#127b70;color:#fff}
.photo-tools canvas{max-height:500px;object-fit:contain;object-position:center;background:#eaf0ee;image-rendering:auto}
.photo-tools .crop-head{margin:6px 0 0}.photo-tools .crop-head strong{color:#405f58}
#selection-status{margin:0!important}#ocr-result{border-radius:8px;background:#f3f8f6;padding:10px 12px;min-height:30px}
@media (max-width:720px){
  .meter-edit-row{grid-template-columns:68px 1fr 1fr 80px}
  .meter-edit-row label:nth-of-type(1){grid-column:2 / span 3}
  .meter-edit-row label:nth-of-type(2){grid-column:1 / span 2}
  .meter-edit-row label:nth-of-type(3){grid-column:3}
  .meter-edit-row .secondary-btn{grid-column:4}
  .meter-summary{grid-template-columns:1fr 1fr}
  .history-filter{flex-direction:column;align-items:flex-start}
}
@media (max-width:520px){
  .meter-summary{grid-template-columns:1fr}.meter-settings{padding:18px}
  .filter-toolbar{flex-wrap:wrap}.filter-toolbar select{max-width:100%}
  .stats-grid{grid-template-columns:1fr 1fr}.stat{min-width:0}.stat-value{white-space:normal;font-size:22px}.stats-grid .stat:first-child{grid-column:span 2}
  .stats-grid .stat:last-child{grid-column:span 2}
  .meter-edit-row{grid-template-columns:64px 1fr 1fr;gap:7px;padding:9px}
  .meter-edit-row label:nth-of-type(1){grid-column:2 / span 2}
  .meter-edit-row label:nth-of-type(2){grid-column:1 / span 1}
  .meter-edit-row label:nth-of-type(3){grid-column:2}
  .meter-edit-row .secondary-btn{grid-column:3}
  .page-intro h1{font-size:31px}
}

.photo-tools canvas{max-height:none;object-fit:fill}

/* v0.3 — direct fotograferen, eenmalige uitsnede en totaal melkkoeien */
@media(min-width:921px){.stats-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
.camera-actions{display:flex;gap:9px;align-items:stretch;flex-wrap:wrap}
.camera-actions .camera-main{flex:2 1 180px;font-size:15px;min-height:50px}
.camera-actions .secondary-btn{flex:1 1 125px;width:auto;font-size:13px;min-height:50px}
.camera-panel{display:flex;flex-direction:column;gap:9px;background:#eaf5f2;border:1px solid #bfded6;border-radius:14px;padding:9px}
.camera-stage{position:relative;width:100%;height:min(67vh,520px);min-height:250px;overflow:hidden;border-radius:12px;background:#102923}
.camera-stage video{display:block;width:100%;height:100%;object-fit:cover}
.camera-guide{position:absolute;inset:0;pointer-events:none;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px}
.camera-guide .guide-frame{width:82%;height:24%;border:3px solid #39ecc2;border-radius:14px;box-shadow:0 0 0 200vmax rgba(0,0,0,.14),inset 0 0 0 1px rgba(0,0,0,.15)}
.camera-guide span{color:white;text-align:center;text-shadow:0 1px 5px #000;font-weight:750;font-size:12px;background:#0009;padding:7px 9px;border-radius:7px;max-width:88%}
.camera-buttons{display:flex;gap:9px}
.camera-buttons .primary-btn{flex:2;font-size:16px;min-height:51px}
.camera-buttons .secondary-btn{flex:1;min-height:51px}
#photo-canvas{border:2px solid #bee1d6;background:#dee9e6;width:100%;height:auto;max-height:none;touch-action:none;cursor:crosshair}
.photo-tools .crop-head{align-items:flex-start;line-height:1.4}
.photo-tools .crop-head span{max-width:50%}
#camera-help{margin:0!important}
.herd-hint{margin-top:-10px!important;margin-bottom:1px!important}
#herd-cows{font-weight:700;font-size:17px}
@media(max-width:920px){.stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:620px){.stats-grid .stat{grid-column:auto!important;min-height:135px}.stats-grid .stat:first-child{grid-column:span 2!important}.stats-grid .stat:last-child{grid-column:span 2!important}.camera-stage{height:54vh}.camera-actions .camera-main{flex-basis:100%}}
@media(max-width:385px){.stats-grid{grid-template-columns:1fr}.stats-grid .stat,.stats-grid .stat:first-child,.stats-grid .stat:last-child{grid-column:span 1!important}}

/* v0.4 – Installable PWA and per-meter web push */
.pwa-card{margin-top:22px;margin-bottom:22px}
.pwa-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin:18px 0 12px}
.pwa-actions .primary-btn,.pwa-actions .secondary-btn{width:auto;min-height:44px}
.push-status{font-size:13px;font-weight:650;border-radius:10px;padding:12px 15px;background:#e8f5f0;color:#176c5c;margin:10px 0}
.push-status.is-error{background:#fff2e7;color:#9b4b25}
@media(max-width:520px){.pwa-actions{flex-direction:column;align-items:stretch}.pwa-actions button{width:100%}}

.pwa-callout{margin:0 0 17px;background:#e9f6f0;color:#226a5e;border:1px solid #d2e7df;border-radius:9px;padding:10px 13px;font-size:13px;font-weight:650}
.pwa-callout a{color:#105f56;text-decoration:underline}

/* v0.5: select daily chart between m³ and liters per cow. */
.chart-unit-toolbar{margin-top:15px;align-items:center}.chart-unit-options{max-width:100%;flex-wrap:wrap}.chart-unit-options button{font-size:12px;padding:9px 11px;white-space:normal;text-align:center}.chart-unit-options button:focus-visible{outline:2px solid #11695f;outline-offset:2px}
@media(max-width:620px){.chart-unit-toolbar{align-items:stretch;flex-direction:column;gap:8px}.chart-unit-options{width:100%;display:grid;grid-template-columns:1fr 1fr}.chart-unit-options button{line-height:1.3;min-height:42px}}
