/* Inventur (/inventur) – mobile-first, gemeinsame Tokens aus dl-design.css */
*{box-sizing:border-box}
:root{--field-line:#4c6d5b;--secondary:#4d6557;--view-height:100dvh;--kopf-bg:#1b5e3a}
html[data-theme="dark"]{--field-line:#8fd394;--secondary:#b0bfb5;--kopf-bg:#12261c}
html,body{margin:0;height:100%;color:var(--ink);background:var(--gr-l)}
body{font:16px/1.35 system-ui,"Segoe UI",-apple-system,sans-serif;-webkit-font-smoothing:antialiased}
body.modal-open{position:fixed;width:100%;overflow:hidden}
button,input,select{font:inherit;color:inherit}
button{cursor:pointer}
button,input,select{border:1px solid var(--field-line);border-radius:var(--r-s)}
button{min-height:48px;padding:8px 12px;background:var(--karte);font-weight:600}
button:disabled{cursor:not-allowed}
input,select{width:100%;min-height:48px;background:var(--karte);padding:8px 10px}
input:disabled,button:disabled{color:var(--secondary);background:var(--flaeche)}
input[aria-invalid="true"]{border:2px solid var(--red)}
button:hover:not(:disabled){border-color:var(--gr);background:var(--gr-l)}
:focus-visible{outline:3px solid var(--gr);outline-offset:2px}
h1,h2,p{margin:0}
h1{font-size:19px;font-weight:600}
h2{font-size:18px;font-weight:600}
label{display:block}
[hidden]{display:none!important}
.app{height:var(--view-height);display:flex;flex-direction:column;max-width:1440px;margin:auto}
/* Kopfzeile: solides Tiefgrün, weiße Schrift, Titel zentriert und nie überblendet */
.header{flex:none;min-height:60px;padding:8px 10px;display:flex;align-items:center;gap:6px;background:var(--kopf-bg);color:#fff}
.heading{flex:1;min-width:0;text-align:center}
.heading small{display:block;color:#d9eadf;font-size:12px;overflow-wrap:anywhere}
.heading h1{font-size:20px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.icon-button{min-width:48px;min-height:48px;padding:8px 12px;display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px solid rgba(255,255,255,.45);background:transparent;color:#fff;border-radius:var(--r-s);font-weight:600}
.icon-button:hover{background:rgba(255,255,255,.15)}
.icon-button svg{width:22px;height:22px}
.icon-button i{display:inline-block;width:22px;height:22px}
@media (max-width:420px){
  .icon-button .wort{display:none}
}
.primary{background:var(--gr);border-color:var(--gr);color:#fff}
html[data-theme="dark"] .primary{color:#132a1e}
.primary:hover:not(:disabled){background:var(--gr-d);color:#fff}
html[data-theme="dark"] .primary:hover:not(:disabled){color:#132a1e}
.context{flex:none;display:flex;align-items:center;gap:8px;background:var(--karte);border-bottom:1px solid var(--line);padding:8px 12px;min-height:56px}
.context::before{content:"";width:10px;height:10px;border-radius:50%;background:var(--gr);box-shadow:0 0 0 3px var(--gr-l);flex:none}
.context select{flex:0 1 auto;max-width:48%;min-height:44px;padding-block:6px;font-weight:600}
.context small{color:var(--secondary);font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1}
.work{flex:1;min-height:0;padding:12px;display:flex;flex-direction:column;gap:10px}
.search-area{position:relative;flex:none;min-width:0}
.field-label{margin-bottom:4px;font-size:14px;font-weight:600;color:var(--gr-d);letter-spacing:.02em;text-transform:uppercase}
html[data-theme="dark"] .field-label{color:var(--gr)}
.search-row{display:flex;gap:8px}
.search-row input{min-width:0;min-height:52px;border-width:2px;font-size:17px}
.search-row input:focus{border-color:var(--gr);box-shadow:0 0 0 3px var(--gr-l)}
.search-results{position:absolute;left:0;right:0;top:100%;margin-top:4px;max-height:min(280px,45dvh);overflow:auto;overscroll-behavior:contain;z-index:5;background:var(--karte);border:1px solid var(--field-line);border-radius:var(--r-m);box-shadow:var(--schatten-2)}
.result{display:block;width:100%;border:0;border-radius:0;border-bottom:1px solid var(--line);text-align:left;font-weight:400;min-height:60px}
.result:hover{background:var(--gr-t)}
.result strong{display:block;font-weight:600;overflow-wrap:anywhere}
.result small{display:block;font-size:13px;color:var(--secondary)}
.result[aria-selected="true"]{background:var(--gr-l);box-shadow:inset 4px 0 var(--gr)}
.empty-results{padding:12px}
.more-results{width:100%;border:0;border-radius:0}
.capture{flex:1;min-width:0;min-height:0;border:1px solid var(--line);border-radius:var(--r-l);background:var(--karte);box-shadow:0 2px 10px rgba(19,42,30,.08);padding:12px;display:flex;flex-direction:column;gap:8px}
.article{flex:none}
.article h2{overflow-wrap:anywhere;font-size:21px}
.article small{display:block;font-size:13px;color:var(--secondary);margin-top:4px}
.article small.strichcode{align-self:flex-start;display:inline-block;font-weight:600;letter-spacing:.03em;color:var(--gr-d);background:var(--gr-l);border:1px solid var(--field-line);border-radius:999px;padding:3px 10px}
html[data-theme="dark"] .article small.strichcode{color:var(--gr)}
.prices{display:grid;grid-template-columns:1fr 1fr;gap:8px;flex:none}
.price{padding:6px 10px;background:var(--gr-t);border:1px solid var(--field-line);border-radius:var(--r-s);display:flex;justify-content:space-between;align-items:center;gap:6px;min-height:44px}
.price span{font-size:13px;font-weight:600;color:var(--gr-d);letter-spacing:.05em}
html[data-theme="dark"] .price span{color:var(--gr)}
.price output{font-weight:600;font-size:17px;white-space:nowrap}
.amounts{display:grid;grid-template-columns:1fr 1fr;gap:10px;flex:none}
.amounts label{font-size:15px;font-weight:600}
.amounts input{font-size:22px;font-weight:600;margin-top:4px;height:56px;background:var(--gr-t);border-width:2px}
.amounts input:focus{background:var(--karte);border-color:var(--gr);box-shadow:0 0 0 3px var(--gr-l)}
.unit{font-size:12px;color:var(--secondary);font-weight:400}
.actions{display:grid;grid-template-columns:1fr 1.4fr;gap:10px;flex:none}
.actions button{min-width:0;min-height:56px;font-size:17px;border-width:2px;border-radius:var(--r-m)}
.status{min-height:24px;font-size:15px;display:flex;gap:6px;align-items:center;flex:none;color:var(--secondary)}
.status.error,.status.unclear{color:var(--red);font-weight:600}
.status .check{display:inline-flex;align-items:center;gap:6px;color:var(--gr-d);font-weight:600;background:var(--gr-l);border:1px solid var(--field-line);border-radius:999px;padding:2px 10px}
html[data-theme="dark"] .status .check{color:var(--gr)}
.status .check svg{width:18px;height:18px}
.status .check:has(svg) .icon-fallback{display:none}
.scan-action{display:flex;gap:8px;align-items:center;justify-content:center;min-height:56px;font-size:17px;flex:none;border-width:2px;border-color:var(--gr);background:var(--gr-l);color:var(--gr-d)}
html[data-theme="dark"] .scan-action{color:var(--gr)}
.scan-action:hover:not(:disabled){background:var(--gr-t);border-color:var(--gr)}
.scan-action svg{width:22px;height:22px}
.scan-action i{display:inline-block;width:22px;height:22px}
.scan-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(150px,auto);gap:10px;align-items:stretch;margin-top:auto;flex:none;border-top:1px solid var(--line);padding-top:8px}
.scan-mode{display:flex;gap:10px;align-items:center;min-height:48px;flex:none;min-width:0}
.scan-mode input{appearance:none;width:44px;height:28px;min-height:28px;padding:0;border-radius:20px;background:var(--flaeche);flex:none;position:relative}
.scan-mode input::after{content:"";position:absolute;width:20px;height:20px;border-radius:50%;background:var(--secondary);top:3px;left:3px}
.scan-mode input:checked{background:var(--gr-l);border-color:var(--gr)}
.scan-mode input:checked::after{left:19px;background:var(--gr)}
.scan-mode:has(input:focus-visible){outline:3px solid var(--gr);outline-offset:2px}
.scan-mode>span{min-width:0;font-weight:600}
.scan-mode small{font-size:12px;color:var(--secondary);display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:400}
.settings{flex:1;min-height:0;padding:12px;display:flex;flex-direction:column;gap:10px}
/* Fortschritt */
.progress{flex:1;min-height:0;padding:12px;display:flex;flex-direction:column;gap:10px;overflow:auto;overscroll-behavior:contain}
.progress-note{min-height:20px;font-size:14px;color:var(--secondary);flex:none}
.progress-note.error{color:var(--red);font-weight:600}
.tiles{display:grid;grid-template-columns:1fr 1fr;gap:10px;flex:none}
.tile{border:1px solid var(--line);border-radius:var(--r-l);background:var(--karte);box-shadow:0 2px 10px rgba(19,42,30,.08);padding:10px 12px}
.tile.wide{grid-column:1/-1;background:var(--gr);border-color:var(--gr);color:#fff}
html[data-theme="dark"] .tile.wide{color:#132a1e}
.tile.wide small,.tile.wide .hint{color:inherit;opacity:.85}
.tile small{display:block;font-size:13px;color:var(--secondary)}
.tile strong{font-size:26px;font-weight:600;overflow-wrap:anywhere}
.tile .hint{font-size:12px;color:var(--secondary)}
.gauge,.groups,.recent{border:1px solid var(--line);border-radius:var(--r-l);background:var(--karte);box-shadow:0 2px 10px rgba(19,42,30,.08)}
.gauge{padding:12px;display:flex;gap:14px;align-items:center;flex:none}
.gauge svg{flex:none}
.gauge .legend{display:grid;gap:4px;font-size:14px}
.dot{display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:6px;vertical-align:middle}
.dot.done{background:var(--gr)}
.dot.open{background:var(--gr-t);border:1px solid var(--field-line)}
.groups{padding:12px;display:flex;flex-direction:column;gap:10px;flex:none}
.groups .empty{color:var(--secondary);font-size:14px}
.group{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 8px;align-items:baseline}
.group .qty{font-size:14px;color:var(--secondary);white-space:nowrap}
.bar{grid-column:1/-1;height:10px;border-radius:6px;background:var(--gr-t);border:1px solid var(--field-line);overflow:hidden}
.bar span{display:block;height:100%;background:var(--gr)}
.recent{min-height:120px;display:flex;flex-direction:column;flex:none}
.recent h2{padding:10px 12px 6px}
.recent-list{overflow:auto;overscroll-behavior:contain;min-height:0;max-height:50dvh}
.row{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:2px 10px;align-items:center;padding:8px 12px;border-top:1px solid var(--line)}
.row strong{font-weight:600;font-size:15px;overflow-wrap:anywhere}
.row small{grid-column:1;font-size:13px;color:var(--secondary)}
.row .qty{font-weight:600;white-space:nowrap}
.row time{font-size:13px;color:var(--secondary);white-space:nowrap}
.settings-top{display:flex;align-items:center;justify-content:space-between;gap:8px;flex:none}
.settings-grid{display:grid;grid-template-columns:1fr;flex:1;min-height:0;gap:12px}
.inventory-list{overflow:auto;overscroll-behavior:contain;border:1px solid var(--field-line);border-radius:var(--r-m);background:var(--karte)}
.inventory-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;width:100%;text-align:left;border:0;border-bottom:1px solid var(--line);border-radius:0;min-height:90px;font-weight:400}
.inventory-row strong{display:block;font-weight:600;overflow-wrap:anywhere}
.inventory-row small{display:block;font-size:14px;color:var(--secondary)}
.inventory-row .state{font-size:13px;border:1px solid var(--field-line);padding:2px 6px;border-radius:var(--r-s);display:inline-block;margin-top:4px}
.inventory-row.active{box-shadow:inset 4px 0 var(--gr);background:var(--gr-t)}
.list-note{padding:12px;color:var(--secondary)}
dialog{color:var(--ink);background:var(--karte);border:1px solid var(--field-line);border-radius:var(--r-m);padding:16px;width:min(560px,calc(100% - 24px));max-height:calc(var(--view-height) - 24px);box-shadow:var(--schatten-2)}
dialog::backdrop{background:rgba(16,32,24,.5)}
.dialog-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px}
.dialog-head button{min-width:44px}
.dialog-body{overflow:auto;min-height:0;overscroll-behavior:contain}
dialog[open]{display:flex;flex-direction:column}
.dialog-actions{display:flex;gap:8px;padding-top:12px;flex:none;flex-wrap:wrap}
.dialog-actions button{flex:1;min-width:140px}
.dialog-body p{margin-bottom:12px}
.dialog-body label{margin-bottom:12px}
.dialog-body input,.dialog-body select{margin-top:4px}
.dialog-note{color:var(--secondary);font-size:14px}
.menu{margin:60px auto 0 12px;width:min(320px,calc(100% - 24px))}
.menu button{display:block;width:100%;text-align:left;margin-bottom:8px}
.menu .dialog-head button{width:48px;margin:0}
.menu p{font-size:14px;color:var(--secondary)}
.compare{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:12px}
.compare div{border:1px solid var(--field-line);border-radius:var(--r-s);padding:8px}
.compare small{display:block;color:var(--secondary);font-size:13px}
.compare strong{font-size:18px}
.camera{position:relative;background:#000;border-radius:var(--r-s);overflow:hidden;height:min(60dvh,560px);margin-bottom:12px}
.camera video{width:100%;height:100%;object-fit:cover;display:block}
.camera::after{content:"";position:absolute;left:6%;right:6%;top:28%;bottom:28%;border:3px solid #fff;border-radius:8px;box-shadow:0 0 0 2000px rgba(0,0,0,.2);pointer-events:none}
#scanner{width:min(720px,calc(100% - 16px));padding:12px}
.login{flex:1;display:flex;flex-direction:column;justify-content:center;gap:12px;padding:16px;width:min(420px,100%);margin:auto}
.login label{font-weight:600}
.login input{margin-top:4px}
.login-error{color:var(--red);font-weight:600;min-height:22px}
.keyboard .header,.keyboard .context,.keyboard .scan-row{display:none}
.keyboard .work{padding-top:8px}
.keyboard .capture{flex:none;gap:6px;padding:10px}
.keyboard .amounts input{height:52px;font-size:20px}
.keyboard .actions button{min-height:52px}
.keyboard .article h2{font-size:18px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden}
@media (min-width:850px) and (min-height:600px){
  .context{grid-template-columns:120px minmax(240px,450px) 1fr;align-items:center;gap:12px}
  .work{display:grid;grid-template-columns:minmax(280px,2fr) minmax(420px,3fr);gap:16px}
  .search-area{display:flex;flex-direction:column;min-height:0}
  .search-results{position:static;max-height:none;flex:1;margin-top:12px;box-shadow:none}
  .capture{padding:20px;gap:16px}
  .article h2{font-size:20px}
  .prices{min-height:64px}
  .amounts input{height:64px}
  .settings-grid{grid-template-columns:minmax(280px,2fr) minmax(420px,3fr)}
  .progress{display:grid;grid-template-columns:minmax(300px,2fr) minmax(360px,3fr);gap:16px;align-items:start}
  .progress .tiles,.progress .gauge,.progress .groups{grid-column:1}
  .progress .recent{grid-column:2;grid-row:1 / span 3;max-height:none}
  .inventory-dialog:not(:modal){position:static;margin:0;width:100%;height:100%;max-height:100%;box-shadow:none}
}
@media (min-width:600px) and (max-width:849px) and (min-height:900px){
  .work{display:grid;grid-template-rows:auto auto auto minmax(100px,1fr);gap:8px}
  .search-area{display:contents}
  .search-area .field-label{grid-row:1;margin:0}
  .search-row{grid-row:2}
  .capture{grid-row:3;gap:8px}  .search-results{grid-row:4;position:static;max-height:none;margin:0;box-shadow:none}
  .scan-mode{margin-top:0}
}
@media (min-width:600px) and (pointer:fine){
  body{font-size:15px}
  button{min-height:32px;padding:4px 10px}
  .icon-button{min-width:44px;min-height:44px}
  .actions button,.settings-top button{height:40px}
  .result{min-height:56px}
  .scan-mode{min-height:44px}
}
@media (forced-colors:active){
  button,input,select,.capture,.price,.inventory-list,dialog,.tile,.gauge,.groups,.recent,.bar{border-color:ButtonText}
  .primary,.result[aria-selected="true"],.inventory-row.active,.bar span{background:Highlight;color:HighlightText}
  .scan-mode input::after{background:ButtonText}
  :focus-visible{outline-color:Highlight}
}
@media (prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}
