/* Shared semantic surfaces: every control changes together with the theme. */
:root{--bg:var(--canvas);--white:var(--surface);--button:var(--input);--button-text:var(--ink);--danger-bg:#fae9e6;--danger-text:#922f29;--positive-bg:#e4efdb;--positive-text:#315423;--warning-bg:#fff0cd;--warning-text:#75550b;--info-bg:#e5eef7;--info-text:#345d82;--action:#203e32;--action-text:#fff;--quantity-plus:#d9f17c;--quantity-text:#173b32;--focus:#739447}
:root[data-theme=dark]{--danger-bg:#402623;--danger-text:#ffc0b8;--positive-bg:#263d2b;--positive-text:#c1e5ac;--warning-bg:#3b321e;--warning-text:#f4d68c;--info-bg:#243342;--info-text:#c1daf4;--action:#305d49;--action-text:#f6fff8;--quantity-plus:#3d5931;--quantity-text:#edffd8;--focus:#b6d271;--green:#305d49;--lime:#3d5931}
html,body{background:var(--canvas);color:var(--ink)}
button{color:var(--ink)}
.icon-btn,.dialog-close,.edit-dot,.language,.search,.table-wrap,.order-row,.warehouse-card,.stats>div,.business-tile,.document-line,.art-label,.product-card{background:var(--surface);color:var(--ink);border-color:var(--line)}
.icon-btn svg,.menu-item svg,.warehouse-card>svg,.order-row-icon svg{color:inherit;stroke:currentColor}
.primary,.accent,.chips button.selected,.inventory-tabs button.selected,.community-tabs .primary{background:var(--action)!important;color:var(--action-text)!important;border-color:var(--action)}
.menu-list .danger,.danger,.receipt-actions .danger{background:var(--danger-bg);color:var(--danger-text)}
.outline{border-color:var(--line);color:var(--ink)}
.text-btn,.menu-item,.client-row{color:var(--ink)}
th,.order-row-icon,.upload-preview,.role-tag,.filter-label,.bar,.scan-btn{background:var(--input);color:var(--ink)}
input,select,textarea{color:var(--ink);background:var(--input);border-color:var(--line)}
input::placeholder,textarea::placeholder{color:var(--muted);opacity:1}
input:focus,select:focus,textarea:focus,button:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
.search input{background:transparent}.search svg,.available,.buyer-fields small,.line-comment,#video-progress,.product-body>small{color:var(--muted)}
.avatar{background:var(--input);color:var(--ink);border-color:var(--line)}
.status,.status.ready,.status.delivered,.toggle.on{background:var(--positive-bg);color:var(--positive-text)}
.status.new,.stock-tag{background:var(--warning-bg);color:var(--warning-text)}
.status.preparing,.status.accepted{background:var(--info-bg);color:var(--info-text)}
.status.cancelled,.stock-tag.zero,.toggle{background:var(--danger-bg);color:var(--danger-text)}
.stats>div:first-child,.business-tile:first-child,.date-form button{background:var(--action);color:var(--action-text)}
.stats>div:first-child small{color:var(--action-text)}
.stepper,.feed-buy .stepper{background:var(--input);border-color:var(--line);color:var(--ink)}
.stepper input,.feed-buy .stepper input,.stepper button{color:var(--ink);background:transparent}
.stepper button:last-child,.feed-buy .stepper button:last-child{background:var(--quantity-plus);color:var(--quantity-text)}
.feed .price small,.feed .wholesale-info,.feed .unit-comment{color:#fff}
.bottom-nav button{color:var(--muted)}.bottom-nav button.selected:before{background:var(--focus)}
.pinned-menu header{height:auto;min-height:48px;padding:4px 8px}.brand{font-size:20px;letter-spacing:-.8px;min-width:0}.header-tools{gap:4px;flex-shrink:0}.header-tools .icon-btn,.category-toggle{width:36px;height:36px;border-radius:11px;padding:7px;justify-content:center}
.inventory-top{display:grid;grid-template-columns:36px minmax(0,1fr) 36px;align-items:center}.inventory-tabs{min-width:0}.inventory-tabs button{white-space:normal;min-height:38px;font-size:11px;line-height:1.15}
.inventory-list .product-body{display:grid;grid-template-columns:minmax(0,1fr) auto 34px;gap:8px;align-items:center;padding:10px}.inventory-list .product-body h3{height:auto;overflow-wrap:anywhere;font-size:14px}.inventory-list .icon-btn{width:32px;height:32px;padding:0;border-radius:9px;font-size:20px}.inventory-list .product-body b{font-size:12px}
.product-card.muted{opacity:1}.product-card.muted h3,.product-card.muted b{color:var(--muted)}
.warehouse-card{flex-wrap:wrap;padding:16px;gap:10px}.warehouse-card .grow{flex-basis:120px}.warehouse-card .outline,.warehouse-card .text-btn{min-height:36px;padding:8px}
.feed-shell{height:100dvh;min-height:0;display:flex;flex-direction:column;overflow:hidden}.feed-shell .pinned-menu{flex:none}.feed-shell .feed-main{flex:1;min-height:0;padding:0;display:flex;flex-direction:column}.feed-shell .feed{height:auto;min-height:0;flex:1}.feed-shell .bottom-nav{position:static;transform:none;width:100%;flex:none}.feed-description{max-height:47%;overflow-y:auto;scrollbar-width:none}.feed-copy{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.feed-controls{bottom:18px}
.shell:not(.feed-shell) main{padding-bottom:calc(80px + env(safe-area-inset-bottom))}.scrim{padding:12px}.dialog{padding:18px 16px 22px;max-height:calc(100dvh - 32px);scroll-padding-top:45px}.dialog-close{margin:0 0 8px 8px;top:0;width:34px;height:34px;border-radius:11px;box-shadow:0 0 0 3px var(--surface)}.dialog>h2{padding-right:42px;min-height:34px;overflow-wrap:anywhere}.detail-media{clear:both;max-height:52dvh;margin:0 0 12px;aspect-ratio:3/4}.detail-media video,.detail-media img{max-height:52dvh}.dialog .stepper{margin-top:14px}
.video-frame{position:relative;flex:0 0 100%;width:100%;height:100%;min-width:0;background:#000;scroll-snap-align:start;overflow:hidden}.video-frame video{width:100%;height:100%;object-fit:contain}.video-frame[data-state=loading] video{opacity:0}.media-state{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;color:#fff;background:#0008;pointer-events:none;font-size:12px}.media-spinner{width:38px;height:38px;border:3px solid #ffffff40;border-top-color:#d9f17c;border-radius:50%;animation:media-spin .8s linear infinite}.media-state button{pointer-events:auto;background:#263d31;color:#fff;border:1px solid #8caa91;border-radius:12px;padding:10px 16px}.video-frame[data-state=playing] .media-state{display:none}.video-frame[data-state=error] .media-spinner,.video-frame[data-state=paused] .media-spinner{display:none}.video-frame:not([data-state=error]):not([data-state=paused]) .media-state button{display:none}@keyframes media-spin{to{transform:rotate(360deg)}}
.network-progress{padding:12px;border:1px solid var(--line);border-radius:10px;white-space:pre-wrap}.route-form{min-width:0;margin:14px 0;border:1px solid var(--line);border-radius:12px;padding:12px}.route-actions{display:flex;flex-wrap:wrap;gap:6px}.route-actions button{flex:1;font-size:12px;min-height:38px;padding:8px}.route-form legend{max-width:100%;overflow-wrap:anywhere}
@media(max-width:360px){.brand{font-size:18px}.brand img{width:24px;height:24px}.header-tools{gap:2px}.header-tools .icon-btn,.category-toggle{width:32px;height:32px;padding:6px}.inventory-tabs button{font-size:10px}}
@media print{html,body,.dialog,#print-area{background:white!important;color:black!important}.dialog-close,.media-state{display:none!important}}
