:root {font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",sans-serif; color:#172d31; background:#f4f7f5; --ink:#172d31; --sub:#68807d; --accent:#0c735c; --mint:#e7f2ec; --border:#dce6e1; --surface:#fff; --danger:#b5353a; --warn:#ab6817; --safe:#278165; --shadow:0 8px 26px rgba(35,65,55,.045)}
*{box-sizing:border-box}body{margin:0;min-height:100vh;-webkit-font-smoothing:antialiased}button,input,textarea,select{font:inherit}button{cursor:pointer}button:disabled{opacity:.45;cursor:not-allowed}a{color:var(--accent)}.boot{min-height:100vh;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:8px}.boot-mark{background:var(--accent);color:white;font-size:30px;width:76px;height:76px;display:grid;place-items:center;border-radius:24px}.boot p{font-weight:750;font-size:22px;margin:8px 0 0}.boot small{color:var(--sub)}.shell{max-width:650px;margin:auto;min-height:100vh;padding-bottom:calc(104px + env(safe-area-inset-bottom))}.top{padding:calc(24px + env(safe-area-inset-top)) 20px 15px;display:flex;align-items:center;justify-content:space-between;gap:10px}.eyebrow{font-size:12px;font-weight:700;letter-spacing:.04em;color:var(--accent);text-transform:uppercase}.top h1{font-size:27px;letter-spacing:-.8px;line-height:1.1;margin:5px 0 3px}.sub{color:var(--sub);font-size:13px;line-height:1.45}.top-icon{flex:none;width:48px;height:48px;border-radius:15px;background:#e5f0e9;display:grid;place-items:center;font-size:26px}.content{padding:0 16px}.card{background:var(--surface);border:1px solid var(--border);border-radius:20px;padding:17px;margin-bottom:12px;box-shadow:var(--shadow)}.card h2,.section-title{font-size:18px;margin:0 0 10px;letter-spacing:-.25px}.section-header{display:flex;align-items:center;justify-content:space-between;margin:20px 4px 12px}.section-header h2{margin:0;font-size:17px}.section-header small{color:var(--sub)}.statusline{display:flex;gap:9px;align-items:center;font-size:13px;color:var(--sub);margin-bottom:16px}.dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:#2d9f77}.hero{background:linear-gradient(130deg,#114c45,#0c6954);color:white;padding:22px;border:0;position:relative;overflow:hidden}.hero:after{content:'✚';position:absolute;right:-5px;bottom:-64px;font-size:210px;color:rgba(255,255,255,.055);font-weight:900}.hero .sub{color:#bfded1}.hero .bigtitle{font-size:14px;font-weight:600;color:#bce0d1}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:18px;position:relative;z-index:1}.stat{background:rgba(255,255,255,.11);border-radius:14px;padding:14px 7px;text-align:center}.stat strong{font-size:27px;display:block;font-weight:800;line-height:1.3}.stat span{font-size:10px;color:#e2ede8;line-height:1.3}.tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.tile{background:#fff;text-align:left;border:1px solid var(--border);border-radius:18px;padding:18px;min-height:133px;display:flex;flex-direction:column;align-items:flex-start;gap:8px;color:var(--ink);box-shadow:var(--shadow)}.tile .emoji{font-size:27px;line-height:1}.tile strong{font-size:15px}.tile small{font-size:11px;color:var(--sub);line-height:1.4}.quick{padding:13px 15px;display:flex;gap:12px;align-items:center;text-align:left;background:#fff;border:1px solid var(--border);border-radius:14px;width:100%;margin-bottom:8px;color:inherit}.quick span:first-child{font-size:22px}.quick .grow{flex:1}.quick strong{display:block;font-size:14px}.quick small{display:block;color:var(--sub);font-size:12px;margin-top:2px}.nav{position:fixed;bottom:0;left:0;right:0;background:rgba(255,255,255,.95);border-top:1px solid var(--border);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);z-index:15;padding-bottom:env(safe-area-inset-bottom)}.nav-inner{max-width:650px;margin:auto;display:grid;grid-template-columns:repeat(5,1fr);gap:1px}.nav button{border:0;background:none;padding:11px 2px 9px;min-width:0;color:#75857f;display:flex;flex-direction:column;gap:3px;align-items:center}.nav button.active{color:var(--accent);font-weight:750}.nav button b{font-size:20px;font-weight:500}.nav button span{font-size:10px}.btn{border:0;background:var(--accent);border-radius:12px;padding:12px 15px;font-weight:700;color:white;white-space:nowrap}.btn.secondary{background:#e8f3ed;color:var(--accent)}.btn.outline{background:#fff;color:var(--accent);border:1px solid #a8c8ba}.btn.danger{background:#f8eded;color:var(--danger)}.btn.mini{padding:8px 10px;font-size:12px;border-radius:10px}.btn.icon{padding:8px;border-radius:10px;min-width:37px}.actions{display:flex;gap:7px;flex-wrap:wrap}.between{display:flex;align-items:center;justify-content:space-between;gap:9px}.grow{flex:1;min-width:0}.search{width:100%;padding:12px 14px;border:1px solid var(--border);border-radius:12px;outline:0;background:white;color:var(--ink);font-size:15px}.search:focus,input:focus,textarea:focus,select:focus{outline:2px solid #a6d7c2;outline-offset:1px}.chips{display:flex;gap:7px;overflow:auto;margin:12px 0 14px;scrollbar-width:none}.chip{background:#fff;color:var(--sub);border:1px solid var(--border);padding:9px 11px;border-radius:99px;white-space:nowrap;font-size:12px;font-weight:650}.chip.active{color:#fff;background:var(--accent);border-color:var(--accent)}.record{display:flex;gap:12px;align-items:flex-start;padding:15px 0;border-bottom:1px solid #edf1ee}.record:last-child{border-bottom:0;padding-bottom:0}.record:first-child{padding-top:0}.record h3{font-size:15px;line-height:1.35;margin:0 0 6px;letter-spacing:-.15px;overflow-wrap:anywhere}.record p{font-size:12px;color:var(--sub);margin:4px 0;line-height:1.5}.record .end{margin-left:auto;flex:none}.badge{display:inline-flex;align-items:center;border-radius:99px;font-size:11px;font-weight:750;padding:4px 8px;background:#e7f3ee;color:var(--safe);white-space:nowrap}.badge.red{background:#fcebed;color:var(--danger)}.badge.amber{background:#fff4df;color:#a36712}.badge.grey{background:#edf1f0;color:#627471}.empty{text-align:center;padding:28px 20px;color:var(--sub)}.empty-emoji{font-size:37px;display:block;margin-bottom:9px}.empty h3{color:var(--ink);font-size:17px;margin:0 0 7px}.empty p{font-size:13px;line-height:1.6;margin:0}.muted{color:var(--sub)}.label{display:block;font-weight:650;font-size:12px;margin-bottom:6px}.field{margin:0 0 14px}.field input,.field select,.field textarea{width:100%;background:#f9fbfa;border:1px solid #d7e4dc;border-radius:11px;padding:12px;color:var(--ink);font-size:15px;max-width:100%}.field textarea{resize:vertical;min-height:70px}.two{display:grid;grid-template-columns:1fr 1fr;gap:10px}.hint{font-size:11px;color:var(--sub);line-height:1.55;margin-top:5px}.modal-back{position:fixed;inset:0;background:rgba(10,29,24,.55);z-index:30;display:flex;align-items:flex-end;justify-content:center}.modal{width:100%;max-width:650px;max-height:min(94dvh,980px);background:#fff;border-radius:23px 23px 0 0;display:flex;flex-direction:column;padding-bottom:env(safe-area-inset-bottom);box-shadow:0 -12px 60px rgba(0,0,0,.15)}.modal-head{padding:19px 18px 12px;border-bottom:1px solid #ecf1ed;display:flex;align-items:center;justify-content:space-between}.modal-head h2{margin:0;font-size:19px}.close{border:0;background:#edf3ef;width:34px;height:34px;border-radius:11px;font-size:20px;color:#47685c}.modal-body{padding:18px;overflow:auto}.modal-foot{padding:12px 18px 15px;border-top:1px solid #e8efea;display:flex;gap:9px}.modal-foot .btn{flex:1}.section-note{border-radius:14px;background:#eef4f0;padding:13px;font-size:12px;color:#476b5d;line-height:1.55;margin-bottom:13px}.warning{background:#fff4e5;color:#89550c}.danger-note{background:#ffeff0;color:#96333c}.location-pill{display:inline-block;padding:6px 10px;background:#eef5f1;border-radius:9px;font-size:11px;color:#346b57;margin:3px 5px 0 0}.setting-row{display:flex;justify-content:space-between;align-items:center;gap:12px;border-top:1px solid #e8efea;padding:15px 0}.setting-row:first-of-type{border-top:0}.switch{appearance:none;-webkit-appearance:none;width:43px;height:27px;background:#b4c2bb;border-radius:99px;position:relative;flex:none}.switch:after{content:'';position:absolute;width:21px;height:21px;background:white;border-radius:50%;top:3px;left:3px;transition:transform .15s}.switch:checked{background:var(--accent)}.switch:checked:after{transform:translateX(16px)}.inline-input{width:80px!important;text-align:center}.tiny{font-size:11px;color:var(--sub)}.shelf{padding:14px 0;border-top:1px solid #e8efea}.shelf:first-child{border-top:0}.shelf h3{margin:0 0 5px;font-size:14px}.shelf p{font-size:12px;color:var(--sub);margin:5px 0}.print-paper{border:1px solid var(--border);border-radius:12px;padding:16px;background:#fff;color:#171f1b;margin:12px 0;box-shadow:var(--shadow)}.print-paper h3{text-align:center;font-size:17px;margin:2px 0 13px}.print-paper table{width:100%;border-collapse:collapse;font-size:11px}.print-paper td,.print-paper th{border:1px solid #aab5ae;padding:7px 6px;text-align:left;vertical-align:top;overflow-wrap:anywhere}.print-paper th{background:#f2f4f3}.print-paper small{font-size:10px}.print-page{page-break-after:always;break-after:page}.print-page:last-child{break-after:auto}.toast-show{position:fixed;bottom:calc(89px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);z-index:100;background:#193c33;color:white;padding:11px 16px;border-radius:13px;box-shadow:0 9px 25px #0002;max-width:90vw;text-align:center;font-size:13px}.warn-icon{display:inline-grid;place-items:center;width:34px;height:34px;border-radius:11px;background:#fef2e2;color:#bd802b}.codearea{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px!important}.kv{display:grid;grid-template-columns:1fr 1fr;gap:6px;font-size:12px;padding:6px 0}.kv span:first-child{color:var(--sub)}@media(min-width:650px){.shell{border-left:1px solid var(--border);border-right:1px solid var(--border)}.modal{border-radius:20px;max-height:90vh}.modal-back{align-items:center}.nav{max-width:650px;left:50%;transform:translateX(-50%);border-radius:18px 18px 0 0}}#print-root{display:none}@page{size:A4;margin:12mm}@media print{body{background:white!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.shell,.modal-back,#toast,.nav{display:none!important}#print-root{display:block!important}#print-root .print-paper{box-shadow:none;border:0;border-radius:0;padding:0;margin:0}#print-root .print-paper h3{font-size:19pt}#print-root .print-paper table{font-size:10pt}#print-root .print-paper td,#print-root .print-paper th{padding:9px}#print-root.size-a5 .print-paper h3{font-size:16pt}#print-root.size-a5 .print-paper table{font-size:9pt}@page{margin:12mm}}

/* v1.1 shelves and inventory */
.extra{background:#f5faf7;border-radius:12px;border:1px solid var(--border);padding:12px;margin:16px 0}.extra summary{cursor:pointer;font-weight:700;font-size:13px;color:var(--accent)}.extra .field{margin-top:12px}.extra .hint{margin:8px 0 10px}.print-location{background:#f3f7f4;border:1px solid #bac9bd;padding:12px;margin:10px 0 18px;font-size:15px;display:flex;justify-content:space-between;gap:12px}.print-footnote{margin-top:14px;font-size:10px;color:#53635a}.shelf-paper table th:nth-child(1){width:55%}.shelf-paper table th:nth-child(2){width:22%}.shelf-paper table th:nth-child(3){width:23%}.shelf-paper{overflow:hidden}.shelf-paper td{overflow-wrap:anywhere}.print-paper tr{break-inside:avoid;page-break-inside:avoid}@media print{.print-paper{break-inside:avoid-page}.print-page{break-after:page;page-break-after:always}.print-page:last-child{break-after:auto;page-break-after:auto}.print-location{background:white!important}.print-footnote{font-size:9pt}}

/* PDF share dialog for iOS standalone web app */
.pdf-modal{max-width:480px;gap:0}.pdf-modal p{line-height:1.6}.pdf-modal-actions{padding:12px 18px calc(18px + env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:10px}.pdf-modal-actions .btn{width:100%;white-space:normal;min-height:46px}.pdf-modal .section-note p{margin-bottom:0}

/* v1.4: выбор нескольких полок для одного листа */
.shelf-choice-list{border:1px solid #d7e4dc;border-radius:13px;padding:4px 12px;margin:8px 0 17px;max-height:265px;overflow-y:auto;background:#fcfefc}
.shelf-choice{display:flex;align-items:center;gap:12px;padding:12px 2px;border-bottom:1px solid #ebf1ed;cursor:pointer}
.shelf-choice:last-child{border-bottom:none}.shelf-choice input{width:21px;height:21px;accent-color:#0c6954;flex:none;margin:0}
.shelf-choice span{display:flex;flex-direction:column;gap:4px}.shelf-choice b{font-size:13px;color:#203c30}.shelf-choice small{font-size:11px;color:#6b8176}
.combined-preview{box-shadow:none}.compact-shelf{margin:17px 0 11px}.compact-shelf h4{font-size:13px;background:#e5f0e8;margin:0;padding:9px 10px;color:#164a38}.compact-shelf table{margin-top:0}.combined-preview table th:nth-child(1){width:56%}.combined-preview table th:nth-child(2){width:20%}.combined-preview table th:nth-child(3){width:24%}


/* v1.5 scanner */
.scan-box{margin:6px 0 12px;border:1px solid #d7e4dc;border-radius:16px;padding:10px;background:#f8fbf9;overflow:hidden}.scan-video{display:none;width:100%;aspect-ratio:4/3;background:#0e1714;border-radius:12px;object-fit:cover}.scan-panel{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:8px}.scan-panel .tiny{flex:1}

/* v1.6 print preview matches monochrome PDF. */
.combined-preview .compact-shelf h4,.print-paper th,.print-location{background:#fff!important;color:#111!important}

/* v1.8 photo OCR */
.ocr-card{background:#f7faf8;border:1px solid #c6dbce;border-radius:15px;padding:14px;margin:14px 0}.ocr-card b{font-size:15px}.ocr-card .actions{margin:10px 0}.ocr-card .field{margin-top:10px}.ocr-card p{line-height:1.5}.ocr-card textarea{min-height:105px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:13px}.ocr-card .actions .btn{white-space:normal}.ocr-card #ocr-status{border-left:3px solid #6a9f84;padding:7px 10px;background:#fff;margin:12px 0}

/* v1.8.1: four-column shelf cards, black and white */
.shelf-paper table th:nth-child(1),.combined-preview table th:nth-child(1){width:39.5%}
.shelf-paper table th:nth-child(2),.combined-preview table th:nth-child(2){width:15%}
.shelf-paper table th:nth-child(3),.combined-preview table th:nth-child(3){width:25.5%}
.shelf-paper table th:nth-child(4),.combined-preview table th:nth-child(4){width:20%}
.shelf-paper table th,.combined-preview table th{background:#fff!important;color:#111!important}
.shelf-paper table td,.combined-preview table td{overflow-wrap:anywhere}

/* v1.9 equipment controls */
.device-buttons{display:flex;flex-direction:column;gap:6px;align-items:stretch;margin-top:9px}.device-buttons button{max-width:145px;white-space:normal;line-height:1.2;text-align:center}.device-buttons .btn.secondary{background:#e8f3ed;color:#145c46}@media(max-width:390px){.record .end{max-width:145px}.device-buttons button{font-size:11px}}

.arshin-link{display:block;text-align:center;color:#1c6c50;font-size:11px;margin-top:4px;text-decoration:underline}

/* v1.9.2 — safe record removal and dense four-column shelf preview */
.danger-button{color:#a52b35!important;border-color:#e8bec4!important;background:#fff8f9!important;margin-top:5px}
.record .end .btn{margin-bottom:4px}
.ocr-crop-area{width:100%;position:relative;border:1px solid #bfd2c6;border-radius:9px;background:#e6ece8;line-height:0;touch-action:none;user-select:none;-webkit-user-select:none;overflow:hidden}
.ocr-crop-area img{display:block;width:100%;height:auto;max-height:55vh;object-fit:contain;pointer-events:none}
.ocr-crop-rect{position:absolute;border:2px solid #118866;background:rgba(18,143,107,.17);pointer-events:none}
.ocr-image-controls[hidden],.ocr-crop-rect[hidden]{display:none!important}
.ocr-image-controls{margin:11px 0;background:#fff;border:1px solid var(--border);border-radius:12px;padding:10px}
.combined-preview{padding:10px}
.combined-preview h3{font-size:14px;margin:2px 0 5px}
.combined-preview .compact-shelf{margin:5px 0 7px}
.combined-preview .compact-shelf h4{font-size:11px;padding:4px 3px}
.combined-preview table{font-size:9.5px}
.combined-preview table th,.combined-preview table td{padding:3px 4px}
.combined-preview .print-footnote{display:none}

/* v1.9.3: бумажный образец — плотная непрерывная таблица с пятью колонками */
.reference-preview{max-width:100%;overflow-x:auto;background:#fff;padding:12px 9px}
.reference-preview table{border-collapse:collapse;table-layout:fixed;width:100%;font-family:Georgia,'Times New Roman',serif;font-size:8px;color:#111}
.reference-preview td,.reference-preview th{border:1px solid #1d1d1d;padding:2px 2.5px;line-height:1.2;overflow-wrap:anywhere;vertical-align:middle}
.reference-preview th{text-align:center;font-weight:700;font-size:8px}
.reference-preview .reference-title td{padding:5px 3px 4px;text-align:center;line-height:1.22}
.reference-preview .reference-title b,.reference-preview .reference-title strong{display:block;font-weight:700;font-size:9px}
.reference-preview tr:not(.reference-title) td:nth-child(1),.reference-preview tr:not(.reference-title) td:nth-child(3),.reference-preview tr:not(.reference-title) td:nth-child(5){text-align:center}
.reference-preview .print-footnote{display:none}

/* v1.9.5: manual entry assistance */
.manufacturer-autocomplete{z-index:5;position:relative;border:1px solid #bfdbca;border-radius:10px;background:white;max-height:215px;overflow-y:auto;box-shadow:0 7px 17px #193c331c;margin:-9px 0 15px}
.manufacturer-autocomplete[hidden]{display:none!important}
.suggestion-option{display:block;width:100%;border:0;border-bottom:1px solid #e6eee8;background:white;color:var(--ink);text-align:left;padding:11px 13px;white-space:normal;overflow-wrap:anywhere;font-size:14px}
.suggestion-option:active,.suggestion-option:focus-visible{background:#eff7f2}
.ocr-optional{border:1px solid #d6e1da;border-radius:12px;padding:12px;margin:15px 0}
.ocr-optional>summary{cursor:pointer;color:#4b6b5e;font-size:13px;font-weight:700}

/* v1.9.7 — photo batch import; separate from backup restore */
.batch-entry-list{display:flex;flex-direction:column;gap:8px;margin:12px 0}
.batch-entry{padding:13px 14px}
.batch-entry-head{display:flex;gap:10px;align-items:flex-start;cursor:pointer}
.batch-entry-head input{width:22px;height:22px;flex:none;accent-color:#16725a;margin:1px 0 0}
.batch-entry-head span{display:flex;flex-direction:column;gap:5px;min-width:0}
.batch-entry-head b{font-size:14px;overflow-wrap:anywhere}
.batch-entry-head small{font-size:12px;color:var(--sub)}
.batch-entry details{margin-top:12px;border-top:1px solid #d8e5dd;padding-top:10px}
.batch-entry details>summary{cursor:pointer;font-weight:600;color:#1b5c45;font-size:13px}
.batch-entry .field{margin:10px 0}
.batch-global{border-top:1px solid #e0ece4;margin-top:14px;padding-top:10px}
.batch-global h3{margin:0;font-size:14px}
.batch-warning{font-size:12px;color:#815d26;background:#fff7e9;border-left:3px solid #d59a43;padding:8px 10px;line-height:1.4;margin:9px 0}
.batch-final .btn{display:block;width:100%;white-space:normal;min-height:50px}
.pending-note{color:#865b22!important;font-weight:600}

.batch-verified{display:flex;align-items:center;gap:9px;margin:12px 0;font-size:13px;font-weight:600;color:#305c4a}.batch-verified input{width:22px;height:22px;flex:none;accent-color:#16725a}
