/* Static HTML adaptation of shadcn/ui primitives; AK Storage visual tokens. */
:root{--font-body:16px;--font-secondary:14px;--font-caption:12px;--background:#f5f5f7;--foreground:#1d1d1f;--card:#fff;--primary:#18181b;--primary-foreground:#fff;--secondary:#f3f3f5;--muted-foreground:#71717a;--border:#e6e6e9;--ring:#a1a1aa;--radius:20px;--green:#28724c;--green-bg:#edf7f0;--red:#b4423e;--red-bg:#fff0ef;--amber:#986416;--shadow:0 5px 24px #00000004}
*{box-sizing:border-box}body{margin:0;color:var(--foreground);background:var(--background);font:var(--font-body)/1.5 -apple-system,BlinkMacSystemFont,"Inter","Segoe UI",sans-serif;-webkit-font-smoothing:antialiased}button,input,textarea,select{font:inherit}button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}button,a{touch-action:manipulation}button{cursor:pointer}a{color:inherit;text-decoration:none}button:disabled{opacity:.45;cursor:not-allowed}button:focus-visible,a:focus-visible{outline:3px solid #a1a1aa88;outline-offset:3px}input:focus,textarea:focus,select:focus{outline:3px solid #a1a1aa33;border-color:#a1a1aa}h1,h2,h3,p{margin:0}h1{font-size:32px;line-height:1.2;letter-spacing:-1.1px;font-weight:650}h2{font-size:17px;font-weight:650;letter-spacing:-.3px}h3{font-size:15px}svg{width:18px;height:18px;flex-shrink:0}button svg{pointer-events:none}.shell{width:min(1380px,calc(100% - 80px));margin:auto}.header{border-bottom:1px solid var(--border);background:#f5f5f7eb;backdrop-filter:blur(20px);position:sticky;top:0;z-index:20}.header-inner{height:76px;display:flex;align-items:center;gap:42px}.brand{display:flex;gap:11px;align-items:center;font-size:16px;font-weight:650;white-space:nowrap}.brand-mark{height:36px;width:36px;border-radius:11px;background:#18181b;color:#fff;display:grid;place-items:center;font-size:13px;letter-spacing:-.4px}.nav{display:flex;gap:5px}.nav a{padding:9px 15px;color:var(--muted-foreground);border-radius:10px;display:flex;align-items:center;gap:8px;font-size:var(--font-body);font-weight:550}.nav a.active{background:#fff;box-shadow:0 1px 6px #00000008;color:var(--foreground)}.header-user{margin-left:auto;display:flex;align-items:center;gap:10px;border:0;background:none;text-align:left;padding:5px}.avatar{width:34px;height:34px;border:1px solid var(--border);border-radius:50%;background:#eaeaec;display:grid;place-items:center;font-size:11px;font-weight:650}.header-user strong{display:block;font-size:var(--font-secondary);font-weight:600}.header-user small{display:block;font-size:var(--font-caption);color:var(--muted-foreground)}main{padding-top:40px;padding-bottom:40px}.heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:27px}.eyebrow{text-transform:uppercase;letter-spacing:1.6px;font-size:var(--font-caption);font-weight:650;color:var(--muted-foreground);margin-bottom:10px}.subtitle{color:var(--muted-foreground);margin-top:9px;font-size:var(--font-body)}.actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.btn{height:44px;display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:0 15px;border:1px solid var(--border);background:#fff;color:var(--foreground);border-radius:11px;font-size:var(--font-body);font-weight:600;white-space:nowrap;transition:background .15s}.btn:hover{background:#f0f0f3}.btn.primary{background:var(--primary);color:var(--primary-foreground);border-color:var(--primary)}.btn.primary:hover{background:#353538}.btn.ghost{background:transparent;border-color:transparent;color:var(--muted-foreground)}.btn.ghost:hover{background:#ececef}.btn.danger{background:var(--red);border-color:var(--red);color:white}.btn.small{height:36px;padding:0 10px;font-size:var(--font-secondary)}.btn.icon{width:32px;height:32px;padding:0;border-color:transparent;background:transparent;color:#81818a}.btn.icon:hover{background:#eaeaec;color:#27272a}.btn.icon svg{width:16px;height:16px}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-bottom:28px}.stat{background:var(--card);border:1px solid var(--border);border-radius:var(--radius);padding:22px 25px;box-shadow:var(--shadow)}.stat-top{display:flex;justify-content:space-between;align-items:center;color:var(--muted-foreground);font-size:var(--font-secondary)}.stat-top svg{color:#a1a1aa}.stat strong{display:block;font-size:29px;letter-spacing:-.9px;line-height:1.35;margin-top:10px;font-weight:620;font-variant-numeric:tabular-nums}.money{white-space:nowrap}.ruble{font-size:.75em;font-weight:400;color:#8a8a93;letter-spacing:normal}.stat strong .ruble{font-size:.65em}.stat p{font-size:var(--font-secondary);color:var(--muted-foreground);margin-top:7px}.stat.balance{background:#eff6f1;border-color:#dce9df}.stat.balance strong{color:#286345}.stat.balance.negative{background:var(--red-bg);border-color:#f5dbd9}.stat.balance.negative strong{color:var(--red)}.panel{background:#fff;border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden}.panel-toolbar{padding:21px 24px;display:flex;justify-content:space-between;align-items:center;gap:20px}.panel-title{display:flex;align-items:center;gap:10px}.count{font-size:var(--font-caption);font-weight:500;border-radius:6px;background:#f3f3f5;color:#71717a;padding:2px 7px}.search{position:relative;width:270px}.search svg{position:absolute;left:12px;top:14px;width:16px;height:16px;color:#92929b;pointer-events:none}.search input{width:100%;height:44px;padding:0 13px 0 36px;border:1px solid var(--border);border-radius:10px;background:#fafafa;font-size:var(--font-body)}.table-wrap{width:100%;overflow-x:auto}table{width:100%;border-collapse:collapse;text-align:left;font-size:var(--font-body)}th{font-size:var(--font-caption);font-weight:600;letter-spacing:.4px;color:var(--muted-foreground);background:#fafafb;padding:13px 24px;border-top:1px solid var(--border);border-bottom:1px solid var(--border);white-space:nowrap}td{padding:18px 24px;border-bottom:1px solid #eeeef1;vertical-align:middle}tbody tr:last-child td{border-bottom:0}tbody tr{transition:background .12s}.clickable{cursor:pointer}.clickable:hover{background:#fafafb}.num{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}.bold{font-weight:650}.muted{color:var(--muted-foreground)}.positive{color:var(--green)}.negative{color:var(--red)}.partner-cell{display:flex;align-items:center;gap:12px}.partner-icon{height:37px;width:37px;flex-shrink:0;display:grid;place-items:center;border:1px solid #e7e7ec;background:#f6f6f8;border-radius:12px;color:#6f6f79;font-size:11px;font-weight:650}.partner-name{font-size:var(--font-body);font-weight:600;display:inline-block}.partner-name:hover{text-decoration:underline;text-underline-offset:3px}.comment{font-size:var(--font-secondary);color:var(--muted-foreground);margin-top:3px;max-width:300px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.row-actions{display:flex;align-items:center;gap:6px;justify-content:flex-end}.row-actions .btn.icon{width:44px;height:44px;flex:0 0 44px;color:#5f5f69}.row-actions .btn.small{height:44px}.row-actions .btn svg{width:22px;height:22px;stroke-width:1.8}.remaining{display:flex;align-items:center;justify-content:flex-end;gap:7px}.dot{width:6px;height:6px;background:#42895c;border-radius:50%;display:inline-block}.dot.red{background:#c25c51}.dot.neutral{background:#a1a1aa}tfoot td{border-top:1px solid var(--border);background:#fafafb;font-weight:650;font-size:var(--font-body);padding-top:18px;padding-bottom:18px}.panel-footer{padding:13px 24px;border-top:1px solid var(--border);font-size:var(--font-caption);color:var(--muted-foreground);display:flex;align-items:center;gap:7px}.panel-footer svg{width:14px;height:14px}.page-footer{margin-top:22px;display:flex;justify-content:space-between;gap:12px;color:#888892;font-size:var(--font-caption)}.text-button{background:none;border:0;padding:0;color:#777780;font-size:var(--font-caption);text-decoration:underline;text-underline-offset:3px}.back{display:inline-flex;align-items:center;gap:7px;font-size:var(--font-secondary);color:var(--muted-foreground);margin-bottom:22px}.back:hover{color:#111}.back svg{width:15px;height:15px}.heading-title-row{display:flex;align-items:center;gap:12px}.heading-title-row .partner-icon{width:46px;height:46px;font-size:14px;border-radius:14px;background:#fff}.tabs{display:flex;gap:3px;background:#f3f3f5;border-radius:9px;padding:3px}.tabs button{height:36px;padding:0 11px;border:0;border-radius:7px;background:transparent;color:#71717a;font-size:var(--font-secondary);font-weight:550}.tabs button[aria-selected=true]{background:#fff;color:#27272a;box-shadow:0 1px 4px #0000000a}.event-main{display:flex;align-items:flex-start;gap:11px}.event-icon{width:29px;height:29px;display:grid;place-items:center;border-radius:9px;background:#f3f3f5;color:#71717a;flex-shrink:0}.event-icon.credit{color:var(--green);background:var(--green-bg)}.event-icon.expense{color:var(--red);background:var(--red-bg)}.event-icon svg{width:15px;height:15px}.entry-author{min-width:120px;max-width:180px;overflow-wrap:anywhere}.event-name{font-size:var(--font-body);font-weight:550}.event-note{font-size:var(--font-secondary);color:var(--muted-foreground);margin-top:3px;max-width:280px;overflow-wrap:anywhere}.journal{min-width:1360px}.journal td{padding:18px 18px;font-size:var(--font-body)}.journal th{padding:13px 18px}.journal th:first-child,.journal td:first-child{padding-left:24px}.journal tfoot td{font-size:var(--font-body)}.badge{display:inline-flex;align-items:center;gap:5px;border-radius:6px;padding:3px 8px;font-size:var(--font-caption);font-weight:550;white-space:nowrap;background:#f3f3f5;color:#666670}.badge.green{background:var(--green-bg);color:var(--green)}.badge.amber{background:#fff5e5;color:var(--amber)}.user-name{font-weight:600}.user-email{font-size:var(--font-secondary);color:var(--muted-foreground);margin-top:2px}.notice{display:flex;gap:10px;align-items:flex-start;margin-bottom:20px;border:1px solid #ecd9b6;background:#fffbf3;color:#8a621d;border-radius:12px;padding:13px 16px;font-size:var(--font-secondary)}.notice svg{margin-top:1px}.empty{text-align:center;padding:64px 20px;color:var(--muted-foreground)}.empty .empty-icon{width:48px;height:48px;display:grid;place-items:center;background:#f3f3f5;border-radius:15px;margin:0 auto 14px}.empty h3{color:#333338;margin-bottom:5px}.empty p{font-size:var(--font-body);margin-bottom:17px}.progress{height:4px;background:#e6e9e6;border-radius:4px;overflow:hidden;width:94px;display:inline-block;margin-right:7px;vertical-align:middle}.progress span{display:block;height:100%;background:#85a48b;border-radius:4px}.login{min-height:100vh;display:grid;place-items:center;padding:20px}.login-card{width:420px;max-width:100%;background:#fff;border:1px solid var(--border);padding:35px;border-radius:24px;box-shadow:0 15px 70px #00000005}.login-card h1{font-size:25px;margin-top:30px}.login-card .subtitle{margin-bottom:24px}.login-card .btn{width:100%;margin-top:14px}.login-card .field{margin-top:16px}dialog{padding:0;border:1px solid var(--border);border-radius:21px;width:min(490px,calc(100% - 28px));max-height:calc(100dvh - 32px);background:#fff;color:var(--foreground);box-shadow:0 25px 100px #00000026}dialog::backdrop{background:#17171b52;backdrop-filter:blur(3px)}.dialog-head{padding:26px 27px 20px;position:relative}.dialog-head h2{font-size:21px;margin-right:25px;letter-spacing:-.6px}.dialog-head p{font-size:var(--font-body);line-height:1.6;color:var(--muted-foreground);margin-top:6px}.dialog-close{position:absolute;right:16px;top:18px}.dialog-body{padding:0 27px 25px}.field{display:flex;flex-direction:column;gap:7px;margin-bottom:17px}.field label{font-size:var(--font-secondary);font-weight:550}.optional{font-weight:400;color:#92929b}.field input,.field textarea,.field select,.login-card select{width:100%;height:46px;padding:9px 11px;border:1px solid #dedee4;background:white;border-radius:10px;color:var(--foreground);font-size:var(--font-body)}.field textarea{min-height:83px;resize:vertical;line-height:1.5}.field small{font-size:var(--font-secondary);color:var(--muted-foreground)}.field-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.input-money{position:relative}.input-money input{padding-right:32px;font-variant-numeric:tabular-nums}.input-money .ruble{position:absolute;right:12px;top:50%;transform:translateY(-50%);pointer-events:none}.calculation{padding:17px;background:#f5f6f5;border:1px solid #e7e9e7;border-radius:13px;margin-bottom:15px}.calculation .calc-row{display:flex;justify-content:space-between;gap:10px;align-items:baseline;font-size:var(--font-body)}.calculation strong{font-size:22px;font-weight:620;letter-spacing:-.5px}.calculation p{font-size:var(--font-caption);color:var(--muted-foreground);margin-top:6px}.calculation .after{border-top:1px solid #e1e4e1;padding-top:10px;margin-top:12px;color:var(--muted-foreground);font-size:var(--font-secondary)}.calculation .after b{color:var(--foreground)}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;padding:18px 27px;border-top:1px solid var(--border);background:#fcfcfd;border-radius:0 0 21px 21px}.error{color:var(--red);font-size:var(--font-secondary);line-height:1.5;background:var(--red-bg);border-radius:9px;padding:10px 12px;margin-bottom:14px}.error:empty{display:none}.confirm-note{font-size:var(--font-body);color:#666670;line-height:1.7;overflow-wrap:anywhere}.toast{position:fixed;bottom:28px;left:50%;transform:translateX(-50%);z-index:100;display:flex;align-items:center;gap:9px;padding:13px 19px;border-radius:12px;background:#202023;color:#fff;box-shadow:0 6px 25px #00000020;font-size:var(--font-secondary);max-width:90vw}.toast[hidden]{display:none}.toast svg{width:16px;height:16px}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}.break-word{overflow-wrap:anywhere}.login-note{font-size:var(--font-secondary);color:var(--muted-foreground);margin-top:20px;line-height:1.6}.storage-warning{padding:12px;background:#fff5e5;color:#986416}.sort-button{background:none;border:0;font:inherit;color:inherit;display:inline-flex;gap:5px;align-items:center;padding:0}.sort-button svg{width:12px;height:12px}
@media(min-width:1500px){main{padding-top:48px}.shell{width:min(1380px,calc(100% - 120px))}}
@media(max-width:1050px){.shell{width:calc(100% - 40px)}.header-inner{gap:25px}td,th{padding-left:18px;padding-right:18px}.journal{min-width:1360px}.heading{align-items:flex-start}.stat strong{font-size:26px}.comment{max-width:200px}.header-user small{display:none}}
@media(max-width:700px){.shell{width:calc(100% - 28px)}.header-inner{height:64px;gap:16px}.brand{font-size:14px;gap:8px}.brand-mark{width:32px;height:32px}.nav{position:fixed;bottom:0;left:0;right:0;background:#f9f9fbf5;backdrop-filter:blur(20px);border-top:1px solid var(--border);justify-content:center;gap:16px;padding:8px 12px calc(8px + env(safe-area-inset-bottom))}.nav a{min-width:135px;justify-content:center;padding:11px}.header-user strong{font-size:var(--font-secondary)}.header-user .avatar{display:none}main{padding-top:25px;padding-bottom:90px}.heading{display:block;margin-bottom:22px}h1{font-size:27px}.heading>.actions{margin-top:18px}.eyebrow{font-size:var(--font-caption);margin-bottom:7px}.stats{gap:8px;margin-bottom:20px}.stat{padding:14px 12px;border-radius:14px}.stat-top{font-size:var(--font-secondary);line-height:1.4}.stat-top svg{display:none}.stat strong{font-size:19px;letter-spacing:-.65px;margin-top:9px}.stat strong .ruble{font-size:.65em}.stat p{font-size:var(--font-secondary);line-height:1.5}.stat p .progress{display:none}.panel{border-radius:16px}.panel-toolbar{padding:17px 16px;gap:13px;align-items:flex-start;flex-direction:column}.search{width:100%}.panel-title h2{font-size:16px}.partners-table{min-width:700px}.users-table{min-width:720px}td,th{padding-left:16px;padding-right:16px}.comment{max-width:170px}.panel-footer{padding:12px 16px;font-size:var(--font-caption)}.page-footer{font-size:var(--font-caption);align-items:flex-start}.page-footer span{max-width:70%}.back{margin-bottom:17px}.tabs{width:100%;justify-content:space-between}.tabs button{flex:1}.dialog-head{padding:23px 21px 18px}.dialog-body{padding:0 21px 20px}.dialog-actions{padding:15px 21px}.toast{bottom:85px}.field-grid{gap:10px}.header-user{gap:5px}.subtitle{font-size:var(--font-body)}.heading-title-row{gap:10px}.heading-title-row .partner-icon{width:40px;height:40px}.heading-title-row h1{font-size:25px}.heading .btn{height:44px;font-size:var(--font-body);padding:0 12px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}
.journal-sort{min-height:32px;gap:7px}.journal-sort svg{width:14px;height:14px;opacity:.5}.journal-sort:hover,.journal-sort.is-active{color:var(--foreground)}.journal-sort.is-active svg{opacity:1}.journal-pagination{padding:14px 20px 18px;text-align:center;background:#fff}.pagination-controls{display:flex;align-items:center;justify-content:center;gap:14px}.page-numbers{display:flex;align-items:center;gap:5px}.page-number,.page-step{display:inline-flex;align-items:center;justify-content:center;min-height:32px;border:0;background:transparent;color:#37373f;font-size:13px;font-weight:600;border-radius:999px}.page-number{min-width:34px;padding:0 9px}.page-step{gap:5px;padding:0 8px}.page-step svg{width:16px;height:16px}.page-number:hover,.page-step:hover:not(:disabled){background:#ececef}.page-number.is-current{background:#111;color:#fff}.page-step:disabled{color:#9c9ca4;opacity:1}.pagination-ellipsis{color:var(--muted-foreground);min-width:18px}.pagination-range{font-size:13px;font-weight:600;margin-top:11px;font-variant-numeric:tabular-nums}.pagination-meta{font-size:12px;color:var(--muted-foreground);margin-top:4px}
@media(max-width:700px){.journal-pagination{padding:12px 10px 16px}.pagination-controls{gap:6px;flex-wrap:wrap;row-gap:8px}.page-numbers{gap:2px}.page-number{min-width:32px;padding:0 7px}.page-step{padding:0 8px;font-size:13px;gap:4px}.page-step svg{width:15px;height:15px}.pagination-ellipsis{min-width:14px}.pagination-meta{font-size:12px}}

/* Keep native select behavior while positioning the chevron inside the field. */
.field select,.login-card select{-webkit-appearance:none;appearance:none;padding-right:42px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 14px center;background-size:16px 16px}
@media(forced-colors:active){.field select,.login-card select{-webkit-appearance:auto;appearance:auto;background-image:none;padding-right:11px}}


/* Collection-specific surfaces; tokens and controls match ak-tanya_julya. */
.collection-grid,.product-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px}.collection-card,.product-card{background:#fff;border:1px solid var(--border);border-radius:20px;overflow:hidden}.cover{height:235px;background:#eeedf0;display:flex;align-items:center;justify-content:center;position:relative;overflow:hidden}.cover img{width:100%;height:100%;object-fit:contain}.cover svg{width:42px;height:42px;color:#a1a1aa}.collection-card .cover{height:245px}.card-content{padding:22px}.card-content h2{font-size:20px;margin-bottom:7px;overflow-wrap:anywhere}.card-meta{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:20px}.card-meta strong{font-size:22px;font-weight:600}.card-meta small{display:block;color:var(--muted-foreground);font-size:12px}.card-link{display:block}.list-thumb{width:48px;height:65px;object-fit:cover;border-radius:9px;background:#eee;flex:none}.material-thumb{width:45px;height:45px;display:grid;place-items:center;border-radius:10px;background:#f3f3f5;overflow:hidden}.material-thumb img{width:100%;height:100%;object-fit:cover}.material-table{min-width:820px}.product-table{min-width:950px}.plain-link{border:0;background:none;padding:0;text-align:left;color:inherit;text-decoration:underline;text-decoration-color:#d4d4d8;text-underline-offset:4px;overflow-wrap:anywhere}.collection-tools{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:24px;flex-wrap:wrap}.editor-layout{display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:24px;align-items:start}.editor-main{display:grid;gap:22px;min-width:0}.padded{padding:24px}.editor-summary{position:sticky;top:100px;display:grid;gap:16px}.summary-row{display:flex;justify-content:space-between;gap:12px;font-size:14px;margin-top:13px}.summary-row span:first-child{color:var(--muted-foreground)}.summary-row strong{font-weight:550;font-variant-numeric:tabular-nums;white-space:nowrap}.summary-total{border-top:1px solid var(--border);margin-top:20px;padding-top:20px}.summary-total small{display:block;color:var(--muted-foreground);font-size:13px}.summary-total strong{font-size:30px;letter-spacing:-1px;font-weight:650}.price-box{padding:20px 24px;background:#eff6f1;border:1px solid #dce9df;border-radius:20px}.price-box .summary-row{align-items:baseline}.price-box strong{font-size:24px;color:#286345}.price-box p{font-size:12px;color:#68796c;margin-top:14px}.gallery{display:flex;gap:12px;flex-wrap:wrap}.media-tile{position:relative;width:105px}.media-preview{width:105px;height:120px;border:1px solid var(--border);background:#f7f7f8;border-radius:12px;display:grid;place-items:center;padding:0;overflow:hidden}.media-preview img{width:100%;height:100%;object-fit:cover}.media-preview svg{width:32px;height:32px}.media-remove{position:absolute;right:5px;top:5px;border:0;border-radius:50%;background:#fff;box-shadow:0 2px 8px #0002;width:26px;height:26px;display:grid;place-items:center}.media-remove svg{width:14px;height:14px}.media-main{display:block;border:0;background:none;padding:6px 0;font-size:11px;color:#71717a;text-align:center;width:100%}.media-main.active{font-weight:650;color:var(--green)}.dropzone{position:relative;margin-top:16px;border:1.5px dashed #d4d4da;background:#fafafb;border-radius:13px;padding:22px 14px;text-align:center;color:#71717a;font-size:14px;display:block;cursor:pointer}.dropzone.drag{border-color:#18181b;background:#eeeef2}.dropzone svg{margin-bottom:6px}.dropzone strong{color:#27272a;font-weight:550}.dropzone small{display:block;font-size:12px;margin-top:4px}.dropzone input{position:absolute;width:1px;height:1px;opacity:0}.dropzone:focus-within{outline:3px solid #a1a1aa88}.upload-progress{padding-top:12px;font-size:12px}.upload-progress progress{width:100%;height:6px;accent-color:#28724c;display:block;margin-top:6px}.composition{min-width:550px}.composition td,.composition th{padding:14px 16px}.quantity{width:84px;padding:8px;border:1px solid var(--border);border-radius:9px;text-align:right;font-size:16px}.inline-add{display:flex;gap:10px;padding:16px;align-items:center;border-top:1px solid var(--border);flex-wrap:wrap}.inline-add select{flex:1;min-width:150px;height:40px;padding:8px 36px 8px 12px;border:1px solid var(--border);border-radius:9px;background:#fff}.labor-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-top:20px}.labor-grid .field{margin:0}.audit{margin-top:28px}.audit summary{display:flex;align-items:center;gap:10px;padding:20px 24px;cursor:pointer;list-style:none;font-size:14px;font-weight:600}.audit summary::-webkit-details-marker{display:none}.audit summary .audit-chevron{margin-left:auto}.audit[open] .audit-chevron{transform:rotate(180deg)}.audit-table{min-width:760px;font-size:14px}.audit-table td{font-size:14px;vertical-align:top;padding:15px 20px}.audit-changes{font-size:12px;color:var(--muted-foreground);max-width:480px;white-space:pre-wrap;overflow-wrap:anywhere;margin-top:4px}.audit-date{white-space:nowrap}.audit-footer{padding:14px 24px;border-top:1px solid var(--border);display:flex;justify-content:space-between;align-items:center;font-size:12px}.media-detail{max-width:640px}.usage-list{margin-top:20px}.usage-row{display:flex;align-items:center;gap:12px;border-top:1px solid var(--border);padding:14px 0}.usage-row>div{flex:1}.usage-row small{font-size:12px;color:var(--muted-foreground)}.account-options{display:grid;gap:10px}.account-option{width:100%;display:flex;gap:12px;align-items:center;border:1px solid var(--border);border-radius:12px;background:#fff;padding:14px;text-align:left}.account-option.selected{border-color:#27272a;background:#f8f8fa}.account-option small{display:block;color:var(--muted-foreground);font-size:12px}.saved-state{font-size:12px;color:var(--muted-foreground);display:flex;gap:6px;align-items:center}.saved-state.dirty{color:#986416}.saved-state svg{width:14px;height:14px}.error-page{padding:20px}.form-hint{font-size:12px;color:var(--muted-foreground);margin-top:8px}.media-dialog{width:min(660px,calc(100% - 28px))}#lightbox{width:min(1100px,calc(100% - 32px));background:#18181b;border:0;padding:42px 12px 12px}#lightbox::backdrop{background:#000c}#lightbox .lightbox-close{position:absolute;right:12px;top:8px;background:#fff;color:#18181b}#lightbox img,#lightbox video{display:block;max-width:100%;max-height:80dvh;object-fit:contain;margin:auto}#lightbox p{color:#ddd;font-size:12px;text-align:center;padding:8px}.materials-add-list{display:grid;gap:8px;max-height:330px;overflow-y:auto}.material-option{display:flex;gap:10px;text-align:left;padding:12px;border:1px solid var(--border);border-radius:10px;background:#fff}.material-option span{flex:1}.material-option small{color:var(--muted-foreground)}.material-option:hover{background:#f5f5f7}.media-count{font-size:12px;color:var(--muted-foreground);margin-top:10px}.form-error{margin-top:16px}.journal-pagination{border-top:1px solid var(--border)}
@media(max-width:1100px){.editor-layout{grid-template-columns:minmax(0,1fr) 270px}.collection-grid,.product-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.header-inner{gap:22px}.brand{font-size:15px}.nav a{padding:9px 11px}.labor-grid{grid-template-columns:1fr}.editor-summary{top:95px}}
@media(max-width:850px){.editor-layout{grid-template-columns:1fr}.editor-summary{position:static;grid-template-columns:1fr 1fr}.header-inner{gap:15px}.brand{gap:8px}.nav a{font-size:14px}.padded{padding:20px}}
@media(max-width:700px){.collection-grid,.product-grid{grid-template-columns:1fr 1fr;gap:12px}.cover,.collection-card .cover{height:190px}.card-content{padding:15px}.card-content h2{font-size:17px}.card-meta{display:block;margin-top:13px}.card-meta>.btn{margin-top:10px}.card-meta strong{font-size:19px}.editor-summary{grid-template-columns:1fr}.heading .actions{margin-top:16px}.heading .actions .saved-state{width:100%}.gallery{gap:10px}.collection-tools .search{width:100%}.page-footer{flex-wrap:wrap}.audit summary{padding:18px 16px}.audit{margin-bottom:15px}.header-user strong{white-space:nowrap}.brand{font-size:14px}.summary-total strong{font-size:30px}.field-grid{grid-template-columns:1fr}.nav{z-index:30}.audit-footer{padding:14px 16px}.material-table td{padding-top:14px;padding-bottom:14px}}
@media(max-width:380px){.collection-grid,.product-grid{grid-template-columns:1fr}.header-user{font-size:12px}.header-inner{gap:8px}}
.material-thumb.btn.icon{width:45px;height:45px;border:1px solid var(--border);background:#f3f3f5}.tabs button{display:inline-flex;align-items:center;justify-content:center;gap:6px}.tabs button svg{width:16px;height:16px}
/* Product operations, collection material ranking, touch-first small screens. */
.product-heading{align-items:flex-start}.product-heading>div:first-child{min-width:0;flex:1}.product-heading h1{overflow-wrap:anywhere}.product-heading>.actions{max-width:590px;justify-content:flex-end}.report-table{min-width:800px}.report-caption{font-size:13px}.report-usage{font-size:12px;margin-top:7px;color:var(--muted-foreground)}.report-usage summary{cursor:pointer;padding:4px 0}.report-usage a{display:block;padding:7px 0;color:var(--foreground);text-decoration:underline;text-underline-offset:3px}.rank{color:var(--muted-foreground);font-variant-numeric:tabular-nums}.report-stats .stat strong{font-size:27px}.mobile-save-bar{display:none}.report-table tfoot td{font-size:14px}.heading-title-row{min-width:0}.heading-title-row h1{overflow-wrap:anywhere}.panel-footer{overflow-wrap:anywhere}.product-heading .saved-state{width:100%;justify-content:flex-end}
@media(max-width:700px){
  .product-heading>.actions{justify-content:flex-start;max-width:none}.product-heading .saved-state{justify-content:flex-start}.product-heading>.actions>[data-action="save-product"]{display:none}
  .mobile-save-bar{display:flex;position:fixed;bottom:calc(73px + env(safe-area-inset-bottom));left:0;right:0;background:#fff;border-top:1px solid var(--border);padding:12px 16px;gap:16px;justify-content:space-between;align-items:center;z-index:25;box-shadow:0 -5px 20px #00000006}.mobile-save-bar small{display:block;font-size:11px;color:var(--muted-foreground)}.mobile-save-bar strong{display:block;font-size:20px;white-space:nowrap;font-variant-numeric:tabular-nums}.mobile-save-bar .btn{height:46px}.product-page{padding-bottom:190px}.product-page input,.product-page textarea{scroll-margin-bottom:190px}
  .table-wrap{overflow:visible}.table-wrap table{min-width:0;width:100%;display:block}.table-wrap thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.table-wrap tbody{display:block}.table-wrap tbody tr{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);padding:16px;gap:12px;border-bottom:1px solid var(--border)}.table-wrap tbody tr:last-child{border-bottom:0}.table-wrap td{display:flex;flex-direction:column;gap:4px;align-items:flex-start;min-width:0;padding:0!important;border:0;font-size:14px;text-align:left;white-space:normal;overflow-wrap:anywhere}.table-wrap td::before{content:attr(data-label);font-size:10px;letter-spacing:.3px;color:var(--muted-foreground);font-weight:500}.table-wrap td:first-child{grid-column:1/-1}.table-wrap td:first-child::before{display:none}.table-wrap td:last-child:has(.btn){grid-column:1/-1;align-items:flex-end}.table-wrap td:last-child:has(.btn)::before{display:none}.table-wrap td .row-actions{width:100%;justify-content:flex-end}.table-wrap .num{font-variant-numeric:tabular-nums}.table-wrap .partner-cell{width:100%;min-width:0}.table-wrap .partner-cell>div{min-width:0}.table-wrap .comment{max-width:none;white-space:normal}.table-wrap .partner-name{overflow-wrap:anywhere}.table-wrap tfoot{display:block;border-top:1px solid var(--border)}.table-wrap tfoot tr{display:flex;padding:16px;background:#fafafb;justify-content:space-between;gap:12px}.table-wrap tfoot td{display:block;font-weight:600;grid-column:auto}.table-wrap tfoot td::before{display:none}
  .composition tbody tr{grid-template-columns:minmax(0,1fr) minmax(0,1fr) max-content;align-items:center}.composition td:first-child{grid-column:1/-1}.composition td:nth-child(2){grid-column:1}.composition td:nth-child(3){grid-column:2}.composition td:nth-child(4){grid-column:1/3;flex-direction:row;justify-content:space-between;align-items:center;font-weight:650}.table-wrap .composition td:last-child{grid-column:3;grid-row:2/4;align-self:center}.composition .quantity{width:100%;max-width:120px;height:44px}.inline-add select{width:100%;flex:auto}.inline-add .quantity{height:44px;flex:1}.inline-add .btn{height:44px;flex:1}
  .report-table tbody tr{position:relative}.table-wrap .report-table tbody td:first-child{position:absolute;right:16px;top:16px;width:26px;height:26px;border-radius:7px;background:#f3f3f5;align-items:center;justify-content:center;font-size:12px}.table-wrap .report-table td:nth-child(2){grid-column:1/-1;padding-right:35px!important}.report-table td:nth-child(2)::before{display:none}.report-usage summary{padding:10px 0}.report-usage a{padding:10px 0;font-size:13px}.report-stats{grid-template-columns:1fr 1fr;gap:10px}.report-stats .stat:last-child{grid-column:1/-1}.report-stats .stat strong{font-size:25px}.report-stats .stat{padding:16px}.report-caption{font-size:12px}
  .table-wrap .audit-table td:first-child{grid-column:1}.table-wrap .audit-table td:first-child::before{display:block}.table-wrap .audit-table td:last-child{grid-column:1/-1}.audit-changes{max-width:100%;word-break:break-word}.audit-date{white-space:normal}.panel-footer{align-items:flex-start}
  .btn.icon{width:44px;height:44px}.media-remove{width:44px;height:44px;right:3px;top:3px}.media-main{min-height:44px;font-size:12px}.media-tile,.media-preview{width:120px}.media-preview{height:136px}.dialog-close{right:10px;top:10px}.dialog-head h2{padding-right:18px}.dialog-actions{position:sticky;bottom:0;background:#fcfcfd;z-index:2;flex-wrap:wrap}.dialog-actions .btn{flex:1}.field input,.field select,.field textarea{font-size:16px}.header-user{min-height:44px}.text-button{min-height:44px}.dropzone{padding:24px 14px}.dialog-body{overflow-wrap:anywhere}.header-inner{justify-content:space-between}.header-user{margin-left:0}.nav a{min-width:120px}.summary-row{gap:8px}.labor-grid{grid-template-columns:1fr}
}
@media(max-width:480px){.collection-grid,.product-grid{grid-template-columns:1fr}.collection-card,.product-card{display:grid;grid-template-columns:110px minmax(0,1fr)}.collection-card .cover,.product-card .cover{height:100%;min-height:190px}.card-content{min-width:0}.card-content h2{font-size:17px}.card-meta .actions{gap:2px}.collection-card .card-meta .actions>.btn.small{margin-top:4px}.card-meta{margin-top:12px}.collection-tools{gap:14px}.tabs{width:100%}.tabs button{min-height:42px}.heading>.actions>.btn{font-size:14px}.brand{font-size:13px}.header-user strong{font-size:13px}.header-user svg{width:14px}.notice{font-size:13px}.mobile-save-bar strong{font-size:18px}}
/* Inline tables, portrait cards and transactional edit notice. */
.center{text-align:center!important}.center>.inline-input{text-align:center}.usage-counter{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-width:56px;min-height:38px;border:1px solid var(--border);border-radius:9px;background:#f6f6f8;color:#54545e;font-size:14px}.usage-counter svg{width:18px;height:18px}.inline-input{width:100%;min-width:65px;max-width:150px;border:1px solid transparent;background:transparent;border-radius:7px;padding:8px;font-size:15px;color:inherit;transition:background .15s,border-color .15s}.inline-input:hover{border-color:#e1e1e6;background:#fafafa}.inline-input:focus{background:#fff;border-color:#a1a1aa}.inline-input[type=number]{text-align:right;font-variant-numeric:tabular-nums;max-width:112px;min-width:85px}.inline-input[data-field=unit]{max-width:115px}.inline-input[data-field=name]{max-width:300px;min-width:180px}.inline-comment{display:block;max-width:300px;font-size:13px;color:var(--muted-foreground);padding-left:0}.material-inline-name{min-width:200px}.inline-name{display:flex;align-items:center;gap:6px}.inline-name .btn.icon{width:30px;height:30px;flex:none;opacity:.5}.inline-name:hover .btn.icon,.inline-name:focus-within .btn.icon{opacity:1}.inline-products{min-width:1150px}.inline-products th,.inline-products td{padding-left:12px;padding-right:12px}.inline-products th:first-child,.inline-products td:first-child{padding-left:24px}.inline-products .partner-cell>div{min-width:150px}.inline-products .partner-name{font-size:15px}.inline-products th{font-size:10px}.inline-products td{font-size:14px}.inline-products input{font-size:14px}.inline-products input[type=number]{width:98px;min-width:85px}.unsaved-bar{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);width:min(740px,calc(100% - 32px));z-index:40;display:flex;justify-content:space-between;gap:20px;align-items:center;padding:16px 20px;border:1px solid #d8d8e1;border-radius:17px;background:#ffffffdb;backdrop-filter:blur(18px);box-shadow:0 12px 44px #20203020}.unsaved-bar>div:first-child{display:flex;align-items:center;gap:12px}.unsaved-bar strong{display:block;font-size:14px;font-weight:600}.unsaved-bar small{display:block;font-size:12px;color:var(--muted-foreground);margin-top:2px}body:has(.unsaved-bar) main{padding-bottom:140px}body:has(.unsaved-bar) .toast{bottom:115px}.product-danger-zone{display:flex;justify-content:flex-end;margin-top:28px}.btn.danger-soft{background:#fff0ef;color:#b4423e;border-color:#f0d4d2}.btn.danger-soft:hover{background:#ffe2df}.demo-photo{display:block;width:100%;height:100%;min-height:1px;background-size:400% 200%;background-repeat:no-repeat}.material-thumb .demo-photo{border-radius:8px}.media-preview .demo-photo{height:100%;width:100%}#lightbox>.demo-photo{width:min(70vw,70dvh);height:auto;aspect-ratio:1/1;margin:auto;border-radius:6px}.audit-ip{font-size:12px!important;color:var(--muted-foreground);white-space:nowrap!important}.collection-grid,.product-grid{grid-template-columns:repeat(auto-fill,minmax(240px,1fr));align-items:start;gap:22px}.collection-card,.product-card{aspect-ratio:9/16;display:flex;flex-direction:column;min-width:0;height:auto}.collection-card .cover,.product-card .cover{flex:1 1 0;height:auto;min-height:0;width:100%;background:#eeedf0}.collection-card .cover img,.product-card .cover img{object-fit:cover;height:100%;width:100%}.collection-card .card-content,.product-card .card-content{flex:0 0 auto;padding:18px;min-width:0}.collection-card .card-content h2,.product-card .card-content h2{font-size:18px;line-height:1.3;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.collection-card .card-meta{display:flex;flex-wrap:wrap;gap:10px;margin-top:16px}.collection-card .card-meta .actions{gap:3px;flex-wrap:wrap}.card-prices{display:flex;gap:16px;justify-content:space-between;margin-top:15px;margin-bottom:15px}.card-prices small{display:block;color:var(--muted-foreground);font-size:12px}.card-prices strong{display:block;font-size:18px;font-weight:600;white-space:nowrap}.card-open{width:100%;margin-top:0}.product-card .badge{margin-top:3px}.collection-card .comment{max-width:100%}
@media(min-width:1500px){.collection-grid,.product-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:700px){.table-wrap td.center{align-items:center!important;text-align:center!important}.inline-products input,.inline-input{font-size:16px;min-height:44px}.inline-products input[type=number]{max-width:100%;width:100%}.inline-products tbody tr{gap:12px}.inline-input[data-field=name]{min-width:0;max-width:100%}.material-inline-name{min-width:0;flex:1}.inline-name{min-width:0}.inline-name .plain-link,.inline-name a{min-width:0;overflow-wrap:anywhere}.inline-name .btn.icon{height:44px;width:36px;opacity:1}.inline-comment{font-size:14px}.usage-counter{min-height:44px}.unsaved-bar{bottom:calc(78px + env(safe-area-inset-bottom));padding:13px 15px;gap:12px;flex-wrap:wrap}.unsaved-bar>div:first-child{gap:8px}.unsaved-bar .actions{width:100%}.unsaved-bar .actions .btn{flex:1}.unsaved-bar strong{font-size:13px}.unsaved-bar small{font-size:11px}body:has(.unsaved-bar) main{padding-bottom:245px}body:has(.unsaved-bar) .toast{bottom:220px}.product-danger-zone{margin-top:26px;padding-bottom:20px}.audit-table td.audit-ip{grid-column:1/-1}.collection-grid,.product-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}.collection-card .card-content,.product-card .card-content{padding:14px}.card-prices{gap:10px}.card-prices strong{font-size:17px}.collection-card .card-meta{display:block}.collection-card .card-meta .actions{margin-top:8px}.collection-card .card-content h2,.product-card .card-content h2{font-size:16px}.inline-products td:first-child{width:100%}.inline-products .partner-cell>div{min-width:0}}
@media(max-width:520px){.collection-grid,.product-grid{grid-template-columns:minmax(0,300px);justify-content:center}.collection-card,.product-card{display:flex;aspect-ratio:9/16}.collection-card .cover,.product-card .cover{height:auto;min-height:0}.card-prices strong{font-size:20px}.collection-card .card-content,.product-card .card-content{padding:18px}.collection-card .card-content h2,.product-card .card-content h2{font-size:19px}.collection-card .card-meta .actions{display:flex;flex-wrap:nowrap;justify-content:space-between}.collection-card .card-meta .actions>.btn.small{margin-top:0}}

/* Keep demo photo dimensions independent of grid intrinsic sizing. */
.material-thumb.btn.icon{position:relative;display:block;flex:0 0 45px;padding:0}
.material-thumb>.demo-photo,.media-preview>.demo-photo{position:absolute;inset:0;width:100%;height:100%}
.media-preview{position:relative}
.material-comment{font-size:13px;line-height:1.5;color:var(--muted-foreground);margin-top:5px;white-space:pre-wrap;overflow-wrap:anywhere;max-width:420px}
.inline-unit{appearance:auto;text-align:center;text-align-last:center;padding-right:8px;cursor:pointer;border-color:var(--border);background:#fff}
.inline-input:disabled{opacity:.65;cursor:default;background:#f5f5f7;border-color:transparent}
input:disabled,textarea:disabled{color:#71717a;background:#f5f5f7;cursor:default;opacity:1}
.inline-edit-cell{cursor:default}
.btn.icon.lock-toggle.is-locked{background:#f2eadb;color:#8b642b;border-color:#e5d7bb}
.lock-notice{background:#f9f4e9;color:#725529}
.card-bottom-actions{display:flex;gap:8px;align-items:center}.card-bottom-actions .card-open{flex:1}
.line-add-form{padding:20px;border-top:1px solid var(--border);background:#fafafb;border-radius:0 0 14px 14px}
.line-add-form h3{display:flex;gap:8px;align-items:center;font-size:15px;margin-bottom:16px}
.line-add-fields{display:grid;grid-template-columns:minmax(160px,2fr) 95px 70px 110px 110px;gap:12px;align-items:end}
.line-add-fields label,.line-add-fields small{display:block;font-size:12px;color:var(--muted-foreground)}
.line-add-fields input,.line-add-fields select{display:block;width:100%;min-height:42px;margin-top:6px;border:1px solid var(--border);border-radius:8px;background:white;padding:8px;font-size:15px}
.line-add-fields span,.line-add-fields strong{display:block;min-height:42px;padding-top:12px;font-size:14px}
.line-add-footer{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-top:14px}.line-add-footer .error{margin:0}
@media(max-width:1100px){.line-add-fields{grid-template-columns:1fr 1fr 1fr}.line-add-fields .line-material{grid-column:1/-1}}
@media(max-width:520px){.line-add-form{padding:16px}.line-add-fields{grid-template-columns:1fr 1fr}.line-add-footer{align-items:stretch;flex-direction:column}.line-add-fields input,.line-add-fields select{font-size:16px}.material-inline-name{min-width:0}.inline-unit{min-height:44px}}

/* Compact cost tables and clear editing controls. */
select.inline-unit,select.inline-unit:hover,select.inline-unit:focus,select.inline-unit:disabled{-webkit-appearance:none;appearance:none;padding-left:28px;padding-right:28px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center;background-size:14px 14px}
.inline-products th:nth-child(n+2):nth-child(-n+8),.inline-products td:nth-child(n+2):nth-child(-n+8),.inline-products .inline-input[type=number]{text-align:center}
.unsaved-bar{background:#f9e7b7f5;border-color:#d9b66a;box-shadow:0 12px 44px #8a632430;color:#5e4619}.unsaved-bar small{color:#7c6235}.unsaved-bar .btn:not(.primary){background:#fffaf0;border-color:#d9bf86}
.product-heading .btn.icon.lock-toggle{width:44px;height:44px;flex:0 0 44px;border-color:var(--border);background:#fff}.product-heading .btn.icon.lock-toggle svg{width:24px;height:24px}.product-heading .btn.icon.lock-toggle.is-locked{background:#f2eadb;border-color:#e5d7bb}
.product-thumb{position:relative;display:block;width:44px;height:56px;flex:0 0 44px;border:1px solid var(--border);border-radius:8px;background:#f4f4f6;overflow:hidden;padding:0;cursor:zoom-in}.product-thumb img{display:block;width:100%;height:100%;object-fit:cover}.product-thumb .demo-photo{position:absolute;inset:0}
.composition-panel{overflow:visible}.composition td,.composition th{padding-top:10px;padding-bottom:10px}.composition .unit-price{font-size:14px;white-space:normal;min-width:115px}
.line-add-form{padding:16px}.line-add-fields{display:grid;grid-template-columns:minmax(150px,1fr) 78px minmax(100px,.5fr) minmax(90px,.4fr) max-content;gap:12px;align-items:end}.line-add-fields .line-material{grid-column:auto;min-width:0}.line-add-fields .line-price,.line-add-fields .line-sum{min-width:0}.line-add-fields span,.line-add-fields strong{display:flex;align-items:center;min-height:44px;padding-top:0;line-height:1.3;overflow-wrap:anywhere}.line-add-fields input{height:44px;min-height:44px;margin-top:6px}.line-add-fields .quantity{padding:8px;text-align:center}.line-add-fields .line-price span{font-size:13px}.line-add-fields .line-sum strong{font-size:14px}.line-add-form .error:empty{display:none}.line-add-form .error{margin-top:10px}
.line-add-fields .btn.line-add-check{background:#268455;border-color:#207348;color:white;height:44px;width:44px;margin:0;padding:0;align-self:end;border-radius:10px;box-shadow:0 2px 5px #226e3520}.line-add-fields .btn.line-add-check:hover{background:#1d7046}.line-add-check svg{width:23px;height:23px}
.material-combobox{position:relative}.combobox-input{position:relative}.combobox-input>svg{position:absolute;left:11px;top:50%;transform:translateY(-50%);width:16px;height:16px;color:#8a8a94;pointer-events:none}.line-add-fields .combobox-input input[type=hidden]{display:none}.line-add-fields .combobox-input input[role=combobox]{padding-left:34px;padding-right:9px;width:100%;min-width:0}.combobox-options{position:absolute;z-index:25;left:0;top:calc(100% + 6px);width:max(100%,280px);max-width:min(480px,calc(100vw - 64px));max-height:250px;overflow:auto;padding:5px;border:1px solid #d9d9df;border-radius:11px;background:white;box-shadow:0 12px 30px #18181b24}.combobox-options[hidden]{display:none}.combobox-options [role=option]{display:block;width:100%;text-align:left;padding:10px 12px;border:0;border-radius:7px;background:white;color:var(--foreground);cursor:pointer}.combobox-options [role=option] span{display:block;min-height:0;padding:0;font-size:14px;line-height:1.4}.combobox-options [role=option] small{margin-top:4px;font-size:12px}.combobox-options [role=option][aria-selected=true],.combobox-options [role=option]:hover{background:#f0f3f1}.combobox-empty{padding:12px;font-size:13px;color:var(--muted-foreground)}
@media(max-width:1100px){.line-add-fields{grid-template-columns:78px minmax(95px,1fr) minmax(85px,1fr) 44px}.line-add-fields .line-material{grid-column:1/-1}}
@media(max-width:700px){.inline-products td:nth-child(n+2):nth-child(-n+8){align-items:center!important}.composition .unit-price{min-width:0}.line-add-fields{grid-template-columns:64px minmax(0,1fr) minmax(0,1fr) max-content;gap:8px}.line-add-fields input{font-size:16px}.line-add-fields .line-price span{font-size:12px}.line-add-fields .line-sum strong{font-size:13px}.product-heading .btn.icon.lock-toggle{height:44px;width:44px;flex:0 0 44px}}

.materials-toolbar .panel-title{margin-left:auto}
#dialog .dialog-actions .btn.icon.lock-toggle{height:44px;width:44px;flex:0 0 44px;border-color:var(--border);background:#fff}
#dialog .dialog-actions .btn.icon.lock-toggle svg{width:24px;height:24px}
#dialog .dialog-actions .btn.icon.lock-toggle.is-locked{background:#f2eadb;border-color:#e5d7bb}

.inline-unit-control{position:relative;display:inline-block;vertical-align:middle;font-size:15px;line-height:normal}
.unit-width-label{display:block;visibility:hidden;white-space:pre;padding:8px 52px 8px 16px;min-height:38px}
select.inline-input.inline-unit[data-field=unit]{position:absolute;inset:0;width:100%;height:100%;min-width:0;max-width:none;padding-left:16px;padding-right:44px;background-position:right 12px center;font:inherit}
.product-table .composition-badge,.product-card .composition-badge{margin-top:8px}
.line-add-fields .btn.line-add-check:disabled,.line-add-fields .btn.line-add-check:disabled:hover{background:#e3e8e4;color:#9ba99f;border-color:#d7dfd9;box-shadow:none;opacity:1;cursor:not-allowed}
.composition tfoot{background:#eef4ef}.composition tfoot th,.composition tfoot td{padding:16px;font-size:15px;font-weight:650;border-top:2px solid #d8e4da}.composition tfoot th{text-align:left;color:#435b49}.composition tfoot #composition-total{font-size:19px;white-space:nowrap;color:#24432d}
.composition .composition-empty td{padding:24px;text-align:center;color:var(--muted-foreground)}
@media(max-width:700px){.inline-unit-control{font-size:16px}.unit-width-label{min-height:44px}.composition tfoot{display:block}.composition tfoot tr{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;gap:12px}.composition tfoot th,.composition tfoot td{display:block!important;padding:0;border:0;flex:none}.composition tfoot th{font-size:14px}.composition tfoot td:last-child{display:none!important}.composition tfoot td::before{display:none!important}.composition .composition-empty{display:block}.composition .composition-empty td{display:block!important}}

.line-add-fields .btn.line-add-check{width:auto;padding:0 12px;font-size:14px;gap:6px}.line-add-check svg{width:18px;height:18px;flex:none}

.product-unsaved-bar small{max-width:420px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.product-page:has(.product-unsaved-bar) .mobile-save-bar{display:none}@media(max-width:700px){.product-unsaved-bar small{max-width:240px}}

.heading .btn.icon[data-action="toggle-collection-lock"]{width:44px;height:44px;flex:0 0 44px;border-color:var(--border)}
.heading .btn.icon[data-action="toggle-collection-lock"] svg{width:24px;height:24px}

/* Shared search across collections and materials. */
.header-inner{gap:24px}.global-search{position:relative;flex:1;min-width:180px;max-width:380px}.global-search-field{position:relative}.global-search-field>svg{position:absolute;left:12px;top:50%;transform:translateY(-50%);width:18px;height:18px;color:#85858d;pointer-events:none}.global-search input{width:100%;height:42px;min-height:42px;padding:9px 12px 9px 38px;border:1px solid #e2e2e7;border-radius:12px;background:#f5f5f7;font-size:14px}.global-search input:focus{background:white;border-color:#a1a1aa;outline:2px solid #18181b10}.global-search-results{position:absolute;top:calc(100% + 8px);left:0;width:max(100%,360px);max-width:calc(100vw - 32px);max-height:min(65vh,480px);overflow:auto;overscroll-behavior:contain;padding:6px;background:white;border:1px solid #e2e2e7;border-radius:14px;box-shadow:0 14px 40px #18181b24;z-index:50}.global-search-results[hidden]{display:none}.global-search-group{padding:12px 10px 7px;color:#777780;font-size:12px;font-weight:650;display:flex;justify-content:space-between}.global-search-option{display:flex;align-items:center;gap:10px;width:100%;padding:11px 10px;border:0;border-radius:9px;background:white;text-align:left;color:#252529;text-decoration:none;cursor:pointer}.global-search-option>svg{width:19px;height:19px;flex:none;color:#85858d}.global-search-option>svg:last-child{margin-left:auto;width:15px}.global-search-option>span{min-width:0}.global-search-option strong{display:block;font-size:14px;font-weight:600;overflow-wrap:anywhere}.global-search-option small{display:block;margin-top:3px;color:#777780;font-size:12px}.global-search-option:hover,.global-search-option[aria-selected=true]{background:#f0f3f1}.global-search-empty{padding:18px 12px;color:#777780;font-size:14px}.search-sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
@media(max-width:1100px){.header-inner{gap:14px}.global-search{min-width:155px}.global-search input{font-size:13px}.header-user{flex-shrink:0}}
@media(max-width:900px){.header-inner{flex-wrap:wrap;height:auto;min-height:76px;padding-top:12px;padding-bottom:12px;gap:10px 16px}.global-search{order:4;max-width:none;flex-basis:100%}.global-search input{font-size:16px;height:44px}.global-search-results{width:100%;max-width:100%;max-height:55vh}.header-user{margin-left:auto}}

/* Native camera capture is a device hint; the gallery input never requests capture. */
.touch-photo-actions{display:none}.photo-source{position:relative;overflow:hidden;cursor:pointer}.photo-source input[type=file]{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}.photo-source:focus-within{outline:3px solid #a1a1aa88;outline-offset:2px}
@media screen and (max-width:1100px),screen and (any-pointer:coarse){.touch-photo-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:16px}.touch-photo-actions .photo-source{min-width:0;min-height:48px;height:auto;padding:12px 8px;font-size:15px;white-space:normal;text-align:center}.touch-photo-actions small{grid-column:1/-1;font-size:12px;line-height:1.5;color:var(--muted-foreground)}.desktop-photo-dropzone{display:none}}
.nav-top,.mobile-collection-count{display:none}.picker-material-name{font-size:18px;font-weight:650;overflow-wrap:anywhere}

.mobile-material-count{display:none}

/* Desktop heading counters match the compact mobile pills. */
@media screen and (min-width:701px){
 .materials-heading h1,.heading h1:has(>.count){display:flex;align-items:center;gap:10px}
 .materials-heading .mobile-material-count,.heading h1>.count{display:inline-flex;align-items:center;justify-content:center;flex:none;min-width:40px;margin:0;padding:5px 12px;border-radius:999px;background:#e6e7eb;color:#555660;font-size:17px;font-weight:650;line-height:1.3;letter-spacing:0;vertical-align:middle}
 .materials-toolbar .panel-title{display:none}
}

/* Mobile screens: explicit content order, readable fields, no clipped data. */
@media screen and (max-width:700px){
 :root{--radius:16px;--font-body:16px;--font-secondary:14px;--font-caption:12px}
 .shell{width:calc(100% - 28px)}main{padding-top:22px;padding-bottom:100px}h1{font-size:27px;line-height:1.2;letter-spacing:-.6px}h2{font-size:18px}.eyebrow{margin-bottom:7px;font-size:11px}.subtitle{font-size:14px;line-height:1.5}.back{margin-bottom:18px;min-height:36px;white-space:normal}.heading{display:block;margin-bottom:20px}.heading>div{min-width:0}.heading>.btn{margin-top:16px;width:100%}.heading-title-row{align-items:flex-start}.heading-title-row h1{flex:1}
 .header{position:relative;backdrop-filter:none;background:#f5f5f7}.header-inner{height:auto;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) auto;padding:10px 0 12px;gap:10px}.brand{font-size:13px;white-space:normal;line-height:1.25;gap:8px}.brand-mark{flex:none}.header-user{margin:0;min-width:0;padding:0;gap:4px}.header-user strong{font-size:13px}.header-user small{display:block;font-size:10px}.header-user .avatar{display:none}.global-search{grid-column:1/-1;order:initial;min-width:0;max-width:none;width:100%}.global-search input{font-size:16px;height:46px}.global-search-results{width:100%;max-width:100%;max-height:55dvh}.global-search-option{min-height:58px}.global-search-option strong{font-size:15px}.global-search-option small{font-size:13px}
 .nav{position:fixed;inset:auto 0 0;z-index:30;display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:8px 14px calc(8px + env(safe-area-inset-bottom));background:#fafafcf5;border-top:1px solid var(--border);backdrop-filter:blur(16px)}.nav a{min-width:0;min-height:48px;justify-content:center;font-size:15px;padding:10px}.nav a.active{background:#eaeaec;box-shadow:none}
 .heading>.actions,.product-heading>.actions{display:flex;gap:8px;max-width:none;justify-content:flex-start;margin-top:16px}.heading .actions>.btn,.heading .actions>a.btn{flex:1 1 calc(50% - 8px);height:auto;min-height:46px;font-size:14px;white-space:normal;text-align:center;padding:10px}.heading .actions>.btn.icon{flex:0 0 46px;width:46px}.heading .actions>.primary{flex-basis:100%;order:5}.product-heading>.actions>[data-action="save-product"]{display:inline-flex}.product-heading .saved-state{width:100%;order:6;justify-content:flex-start}.mobile-save-bar{display:none}.product-page{padding-bottom:110px}.product-page input,.product-page textarea{scroll-margin-top:16px;scroll-margin-bottom:220px}
 .collection-tools{display:grid;grid-template-columns:1fr;gap:12px;margin-bottom:16px}.search,.collection-tools .search{width:100%;min-width:0}.tabs{width:100%;display:grid;grid-template-columns:1fr 1fr}.tabs button{min-height:44px}.panel-toolbar{padding:16px;display:flex;flex-wrap:wrap;gap:12px}.materials-toolbar .search{order:0;width:100%}.materials-toolbar .panel-title{order:1;margin-left:0}.panel-title{min-width:0}.panel-title h2{font-size:17px}.panel-footer{padding:14px 16px;font-size:12px;line-height:1.5}
 .stats,.report-stats{grid-template-columns:1fr;gap:8px;margin-bottom:18px}.stat,.report-stats .stat{padding:14px 16px;display:grid;grid-template-columns:1fr auto;align-items:center;gap:5px 12px}.stat strong,.report-stats .stat strong{font-size:23px;margin:0;letter-spacing:-.5px}.stat p{grid-column:1/-1;margin:0}.report-stats .stat:last-child{grid-column:auto}.stat-top{font-size:14px}
 .collection-grid,.product-grid{grid-template-columns:minmax(0,1fr);gap:16px;justify-content:stretch}.collection-card,.product-card{aspect-ratio:auto;display:flex;width:100%;height:auto}.collection-card .cover,.product-card .cover{flex:none;aspect-ratio:4/3;width:100%;height:auto;min-height:0;max-height:none}.collection-card .cover img,.product-card .cover img{object-fit:contain}.collection-card .card-content,.product-card .card-content{padding:16px}.collection-card .card-content h2,.product-card .card-content h2{display:block;overflow:visible;-webkit-line-clamp:unset;font-size:19px;line-height:1.4}.collection-card .comment{overflow:visible;white-space:pre-wrap;max-width:none}.collection-card .card-meta{display:flex;flex-direction:column;align-items:stretch;gap:12px}.collection-card .card-meta .actions{display:flex;flex-wrap:wrap;margin:0;gap:8px}.card-meta .actions>a{flex:1}.card-prices{gap:16px;margin:16px 0}.card-prices>div{flex:1;min-width:0;padding:10px;background:#eff6f1;border-radius:10px}.card-prices strong{font-size:20px;white-space:normal;overflow-wrap:anywhere}
 /* Each former table row is a complete record with its original labels. */
 .table-wrap table{min-width:0;width:100%}.table-wrap tbody tr{padding:18px 16px;gap:12px 16px}.table-wrap td{font-size:16px;line-height:1.45}.table-wrap td::before{font-size:12px;letter-spacing:0;line-height:1.4;text-transform:none;color:#71717a}.table-wrap td.center,.inline-products td:nth-child(n+2):nth-child(-n+8){align-items:flex-start!important;text-align:left!important}.table-wrap .partner-cell{align-items:flex-start;gap:12px}.table-wrap .partner-name{font-size:17px;line-height:1.4}.table-wrap .material-thumb.btn.icon{width:60px;height:60px;flex-basis:60px}.product-thumb{width:60px;height:80px;flex-basis:60px}.material-comment{font-size:14px;max-width:none;line-height:1.5}.material-inline-name{min-width:0}.inline-input[type=number],.inline-products input[type=number]{min-width:0;max-width:none;width:100%;height:46px;border:1px solid #dfdfe5;background:#fafafb;text-align:left;font-size:16px;padding:10px}.inline-input:disabled{background:#f3f3f5}.inline-unit-control{max-width:100%}.unit-width-label{padding-right:54px}.usage-counter{height:46px}.material-table td:nth-child(4){grid-column:1/-1;flex-direction:row;align-items:center!important;justify-content:space-between}.material-table td:nth-child(4)::before{content:'Используется в изделиях'}
 .table-wrap td:last-child:has(.row-actions){border-top:1px solid #eeeef1;padding-top:12px!important}.table-wrap td .row-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-start}.row-actions .btn.icon{width:auto;min-width:44px;padding:0 10px;border:1px solid var(--border);border-radius:10px;flex:0 1 auto;font-size:12px;gap:6px}.row-actions .btn.icon:after{font-size:12px}.row-actions [data-action="edit-material"]:after{content:'Изменить'}.row-actions [data-action="duplicate-material"]:after{content:'Копия'}.row-actions [data-action="delete-material"]:after{content:'Удалить'}.row-actions .lock-toggle:after{content:'Открыт'}.row-actions .lock-toggle.is-locked:after{content:'Закрыт'}.row-actions a.btn.icon:after{content:'Открыть'}
 .inline-products tbody tr{grid-template-columns:1fr 1fr}.inline-products td:nth-child(2),.inline-products td:nth-child(5),.inline-products td:nth-child(6){grid-column:1/-1;display:flex;flex-direction:row;align-items:center!important;justify-content:space-between;gap:12px}.inline-products td:nth-child(5) input{max-width:130px}.inline-products td:nth-child(6){padding:12px!important;background:#f3f3f6;border-radius:10px;font-size:20px}.inline-products td:nth-child(7),.inline-products td:nth-child(8){padding:12px!important;background:#eff6f1;border-radius:10px;color:#286345;font-weight:650;font-size:20px}.inline-products td:nth-child(6)::before{max-width:55%;font-size:13px}.inline-products td:nth-child(7)::before,.inline-products td:nth-child(8)::before{color:#546e5b}.inline-products td:last-child{grid-column:1/-1}
 .editor-layout,.editor-main,.editor-summary{display:grid;grid-template-columns:minmax(0,1fr);gap:18px}.editor-summary{position:static}.padded{padding:18px 16px}.field-grid,.labor-grid{grid-template-columns:minmax(0,1fr);gap:14px}.field input,.field select,.field textarea{font-size:16px;max-width:100%;min-width:0}.field input,.field select{min-height:46px}.field textarea{min-height:100px}.summary-row{font-size:15px;gap:12px}.summary-row strong{white-space:normal;text-align:right}.summary-total strong{font-size:30px}.price-box{padding:18px 16px}.price-box strong{font-size:25px}.notice{font-size:14px;line-height:1.5}.notice svg{flex:none}.product-danger-zone{margin-top:22px;padding-bottom:0}.product-danger-zone .btn{min-height:46px}
 .composition tbody tr{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px}.composition td:nth-child(2){grid-column:1;grid-row:auto}.composition td:nth-child(3){grid-column:2;grid-row:auto}.composition td:nth-child(4){grid-column:1;grid-row:3;display:flex;flex-direction:column;align-items:flex-start;font-size:18px}.table-wrap .composition td:last-child{grid-column:2;grid-row:3;align-self:end;align-items:flex-end}.composition .quantity{width:100%;max-width:none;height:46px;text-align:left}.composition .unit-price{font-size:15px}.composition [data-action="remove-line"]{width:auto;padding:0 10px;background:#fff0ef;color:#b4423e;border:1px solid #f0d4d2;font-size:13px;gap:6px}.composition [data-action="remove-line"]:after{content:'Убрать'}.composition tfoot tr{gap:16px;flex-wrap:wrap}.composition tfoot th{max-width:60%;font-size:14px}.composition tfoot #composition-total{font-size:22px}
 .line-add-form{padding:16px}.line-add-fields{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px}.line-add-fields .line-material{grid-column:1/-1}.line-add-fields>label{grid-column:1;grid-row:2}.line-add-fields .line-price{grid-column:2;grid-row:2}.line-add-fields .line-sum{grid-column:1;grid-row:3}.line-add-fields .btn.line-add-check{grid-column:2;grid-row:3;width:100%;min-height:46px;align-self:end;font-size:15px}.line-add-fields label,.line-add-fields small{font-size:13px}.line-add-fields .line-price span,.line-add-fields .line-sum strong{font-size:16px;min-height:46px}.combobox-options{width:100%;max-width:100%;max-height:240px}.combobox-options [role=option]{min-height:48px}.combobox-options [role=option] span{font-size:15px}
 .gallery{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.media-tile,.media-preview{width:100%;min-width:0}.media-preview{height:auto;aspect-ratio:4/5}.media-main{min-height:44px;font-size:13px}.media-remove{width:36px;height:36px;right:5px;top:5px}.media-main,.media-count{white-space:normal;overflow-wrap:anywhere}.dropzone{padding:20px 12px}
 .report-table td:nth-child(2){padding-right:32px!important}.report-table td:nth-child(2) .plain-link{font-size:17px}.report-table td:last-child{grid-column:1/-1;display:flex;flex-direction:row;justify-content:space-between;background:#eff6f1;padding:12px!important;border-radius:10px;font-size:19px}.report-usage{font-size:14px;width:100%}.report-usage a{font-size:14px}.report-caption{font-size:13px}.audit-changes{font-size:13px}.audit-ip{white-space:normal!important}.audit-footer{gap:12px;flex-wrap:wrap}.audit-table td{font-size:14px}.audit summary{min-height:56px;white-space:normal}.page-footer{font-size:12px;display:grid;gap:6px}
 dialog:not(#lightbox):not(#print-preview){width:calc(100% - 16px);max-width:540px;max-height:calc(100dvh - 24px);margin:auto;border-radius:18px;overflow:auto}dialog[open]:not(#lightbox):not(#print-preview){display:flex;flex-direction:column}.dialog-head{flex:none;padding:18px 16px;border-bottom:1px solid var(--border)}.dialog-head h2{font-size:20px;line-height:1.4;padding:0;margin-right:42px;overflow-wrap:anywhere}.dialog-close{top:12px;right:10px}.dialog-body{padding:18px 16px;overflow-y:auto;min-height:0;overscroll-behavior:contain}.dialog-actions{position:static;flex:none;border-radius:0;padding:12px 16px;gap:8px;flex-wrap:wrap}.dialog-actions .btn{min-height:46px;height:auto;white-space:normal;padding:10px 12px;flex:1 1 auto}.usage-row{align-items:flex-start}.usage-row>div{min-width:0}.usage-row>span{flex:none}.materials-add-list{max-height:none}.material-option{min-width:0;overflow-wrap:anywhere;flex-wrap:wrap}.material-option small{white-space:normal}.account-option{min-height:60px}#lightbox{width:calc(100% - 16px);max-height:calc(100dvh - 16px);padding-top:52px}#lightbox img,#lightbox video{max-height:75dvh}
 .unsaved-bar{bottom:calc(72px + env(safe-area-inset-bottom));width:calc(100% - 20px);padding:12px;border-radius:14px;gap:10px;z-index:35}.unsaved-bar>div:first-child{min-width:0}.unsaved-bar strong{font-size:14px}.unsaved-bar small,.product-unsaved-bar small{white-space:normal;max-width:none;overflow:visible;font-size:12px}.unsaved-bar .actions{width:100%;display:grid;grid-template-columns:1fr 1fr;gap:8px}.unsaved-bar .btn{height:46px;font-size:15px}.product-page:has(.product-unsaved-bar) .mobile-save-bar{display:none}body:has(.unsaved-bar) main{padding-bottom:280px}body:has(.unsaved-bar) .toast{bottom:240px}.toast{max-width:calc(100% - 28px);white-space:normal;bottom:90px}
}

@media screen and (max-width:700px){
 .eyebrow,.heading .subtitle{display:none}.header-user{gap:7px}.header-user .avatar{display:grid;width:36px;height:36px;font-size:13px}.header-user>span:not(.avatar){display:none}.header-user>svg{width:16px;height:16px}.header-inner{grid-template-columns:minmax(0,1fr) auto}
 .nav{grid-template-columns:44px 1fr 1fr;gap:6px}.nav-top{display:flex;align-items:center;justify-content:center;min-height:48px;width:44px;border:0;border-radius:10px;background:transparent;color:#71717a}.nav-top svg{width:22px;height:22px}.nav a{padding:10px 5px;font-size:14px}
 .heading [data-action="print-form"] .print-button-label{display:none}.heading .actions>[data-action="print-form"]{flex:0 0 46px;width:46px;padding:0;min-height:46px}.materials-heading .actions{flex-wrap:nowrap}.materials-heading .actions>[data-action="new-material"]{order:0;flex:1;min-width:0}.materials-heading .actions>[data-action="print-form"]{order:1}
 .table-wrap .material-table tbody tr{grid-template-columns:minmax(0,1fr) minmax(0,1.15fr) minmax(0,.8fr);gap:12px 10px;padding:0 14px 14px}.table-wrap .material-table td:first-child{grid-column:1/-1;background:#f0f1f4;margin:0 -14px;padding:14px!important;border-bottom:1px solid #e6e6ea}.material-table .partner-cell{align-items:center}.material-table .plain-link.bold{font-size:18px;line-height:1.35}.material-table .material-comment{font-size:13px}.table-wrap .material-table td:nth-child(2),.table-wrap .material-table td:nth-child(3),.table-wrap .material-table td:nth-child(4){grid-column:auto;grid-row:2;display:flex;flex-direction:column;align-items:stretch!important;text-align:left!important;justify-content:flex-start}.table-wrap .material-table td:nth-child(4)::before{content:'Изделий'}.material-table .usage-counter{width:100%;min-width:0}.material-table .inline-unit-control{width:100%;min-width:0}.material-table .unit-width-label{padding:8px 35px 8px 10px;min-width:0}.material-table select.inline-unit[data-field=unit]{padding-left:10px;padding-right:28px;background-position:right 8px center}.material-table td:last-child{grid-column:1/-1}.material-table .row-actions{flex-wrap:nowrap!important;justify-content:flex-end!important}.material-table .row-actions .btn.icon{width:44px;flex:0 0 44px;padding:0}.material-table .row-actions .btn.icon:after{display:none}
 .collection-card .card-link{display:flex;align-items:center;gap:12px}.collection-card .card-link h2{flex:1;min-width:0;margin:0}.mobile-collection-count{display:inline-flex;align-items:center;gap:6px;flex:none;color:#71717a;font-size:15px}.mobile-collection-count svg{width:18px}.collection-card .card-meta>span{display:none}.collection-card .card-meta{margin-top:12px}
 .collection-heading .actions{display:grid;grid-template-columns:46px 46px minmax(0,1fr);gap:8px}.collection-heading .actions>.btn,.collection-heading .actions>a.btn{width:100%;min-width:0;flex:none;font-size:13px;padding:8px}.collection-heading .actions>.primary{grid-column:1/-1;order:5;font-size:15px}
 .table-wrap .inline-products td:nth-child(2),.table-wrap .inline-products td:nth-child(3),.table-wrap .inline-products td:nth-child(4),.table-wrap .inline-products td:nth-child(5){display:flex;flex-direction:column;align-items:stretch!important;justify-content:flex-start;gap:5px;background:#f7f7f9;border-radius:10px;padding:10px!important;font-size:17px}.table-wrap .inline-products td:nth-child(2){grid-row:2;grid-column:1}.table-wrap .inline-products td:nth-child(5){grid-row:2;grid-column:2}.table-wrap .inline-products td:nth-child(3){grid-row:3;grid-column:1}.table-wrap .inline-products td:nth-child(4){grid-row:3;grid-column:2}.inline-products td:nth-child(5) input{max-width:none}.inline-products td:nth-child(2)::before{content:'Материалы'}.inline-products td:nth-child(5)::before{content:'Обязательные расходы'}.inline-products td:nth-child(3)::before{content:'Пошив'}.inline-products td:nth-child(4)::before{content:'Декор'}.inline-products td:nth-child(2),.inline-products td:nth-child(5){min-height:92px}.inline-products td:nth-child(6){align-items:center!important;min-height:60px}.inline-products td:nth-child(6)::before{content:attr(data-label);align-self:center}
 .product-heading>.actions{display:grid;grid-template-columns:44px 44px minmax(0,1fr) minmax(0,1.2fr);gap:6px}.product-heading>.actions>.btn{min-width:0;width:100%;padding:8px 4px;font-size:12px;min-height:44px}.product-heading>.actions>.btn.icon,.product-heading>.actions>[data-action="print-form"]{width:44px;height:44px;min-height:44px;padding:0}.product-heading>.actions>.primary,.product-heading>.actions>.saved-state{grid-column:1/-1}.product-heading>.actions>.primary{font-size:15px}.product-heading>.actions>.saved-state{order:6}
}

@media screen and (max-width:700px){
 .header-inner>.brand{grid-column:1;grid-row:1;align-self:center}.header-inner>.header-user{grid-column:2;grid-row:1;justify-self:end;align-self:center}.header-inner>.global-search{grid-column:1/-1;grid-row:2}.nav{grid-template-columns:40px 40px minmax(0,1fr) minmax(0,1fr);gap:4px;padding-left:10px;padding-right:10px}.nav-top{width:40px}.nav a{font-size:13px;gap:5px}.nav a svg{width:17px}
 .materials-heading h1{display:flex;align-items:center;gap:10px}.mobile-material-count,.mobile-collection-count{display:inline-flex;align-items:center;justify-content:center;min-width:40px;padding:5px 12px;border-radius:999px;background:#e6e7eb;color:#555660;font-size:17px;font-weight:650;line-height:1.3;letter-spacing:0}.materials-toolbar .panel-title{display:none}.table-wrap .material-table td:nth-child(4)::before{content:'ИЗДЕЛИЙ'}
 .table-wrap .inline-products .partner-cell{align-items:center}.product-card .card-prices>div{text-align:center}
 .table-wrap .inline-products td:nth-child(n+2):nth-child(-n+5){text-align:center!important;align-items:stretch!important}.table-wrap .inline-products td:nth-child(n+2):nth-child(-n+5)::before{min-height:34px;display:flex;align-items:center;justify-content:center;text-align:center;line-height:1.3}.inline-products .material-cost-value{display:flex;align-items:center;justify-content:center;min-height:46px;font-size:16px;font-variant-numeric:tabular-nums}.inline-products td:nth-child(n+3):nth-child(-n+5) input{text-align:center}.table-wrap .inline-products td:nth-child(7),.table-wrap .inline-products td:nth-child(8){text-align:center!important;align-items:center!important;justify-content:center}.inline-products td:nth-child(7)::before,.inline-products td:nth-child(8)::before{width:100%;text-align:center}
 .table-wrap .composition tbody tr{grid-template-columns:repeat(3,minmax(0,1fr)) 40px;gap:12px 8px;padding:0 12px 14px}.table-wrap .composition td:first-child{grid-column:1/-1;grid-row:1;margin:0 -12px;padding:13px 12px!important;background:#e6e7eb;border-bottom:1px solid #d9dbe1}.composition td:first-child .plain-link{font-size:16px;line-height:1.4;font-weight:550}.table-wrap .composition td:nth-child(2){grid-column:1;grid-row:2}.table-wrap .composition td:nth-child(3){grid-column:2;grid-row:2}.table-wrap .composition td:nth-child(4){grid-column:3;grid-row:2;display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;font-size:15px;gap:4px}.table-wrap .composition td:last-child{grid-column:4;grid-row:2;align-self:end;align-items:center}.table-wrap .composition td:nth-child(n+2):nth-child(-n+4){align-items:center;text-align:center}.composition .unit-price{font-size:13px;line-height:1.5;text-align:center}.composition .quantity{font-size:16px;padding:8px 4px;text-align:center;min-width:0;height:44px}.composition [data-action="remove-line"]{width:40px;height:44px;min-width:0;padding:0;flex:none}.composition [data-action="remove-line"]:after{display:none}.table-wrap .composition td::before{font-size:11px}.table-wrap .composition .composition-empty td{margin:0;background:transparent;border:0}
}

#print-preview{width:min(1180px,calc(100% - 32px));max-width:none;max-height:94dvh;padding:0;border:0;border-radius:16px;background:#e9e9ed;overflow:auto}
#print-preview::backdrop{background:#18181b99}
.print-toolbar{position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:16px 24px;background:#fff;border-bottom:1px solid #d8d8de}
.print-toolbar h2{font-size:18px;margin:0}.print-toolbar small{font-size:12px;color:#71717a}.print-preview-hint{font-size:13px;color:#65656e;padding:16px 24px 0}
.print-sheet{box-sizing:border-box;width:calc(100% - 40px);max-width:none;margin:20px auto;padding:40px;background:#fff;color:#171717;box-shadow:0 4px 20px #0001;font-family:Arial,sans-serif;font-size:13px;line-height:1.4}
.print-header{position:relative;margin-bottom:20px}.print-brand{font-size:10px;letter-spacing:.1em;text-transform:uppercase;color:#555;padding-right:110px}.print-date{position:absolute;right:0;top:0;font-size:10px;color:#555}.print-header h1{font-size:25px;line-height:1.2;font-weight:650;margin:14px 0 6px;overflow-wrap:anywhere}.print-header p{font-size:12px;color:#555;margin:0}
.print-sheet h2{font-size:16px;margin:20px 0 10px;break-after:avoid}.print-description{font-size:12px;margin:0 0 18px;white-space:pre-wrap;overflow-wrap:anywhere}
.print-table{width:100%;border-collapse:collapse;table-layout:auto;font-size:12px}.print-table th,.print-table td{padding:9px 8px;border-bottom:1px solid #d6d6d6;vertical-align:top;text-align:left;overflow-wrap:anywhere}.print-table thead th{font-size:10px;letter-spacing:.03em;text-transform:uppercase;background:#eee;color:#333;border-top:1px solid #aaa;border-bottom:1px solid #aaa}.print-table .num{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}.print-table .center{text-align:center}.print-table .print-index{width:32px;color:#777}
.print-table tfoot th,.print-table tfoot td,.print-table .print-total th,.print-table .print-total td{font-weight:bold;border-top:2px solid #666;background:#f1f1f1}.print-table th{font-weight:bold}.print-strong{font-weight:bold}.print-empty{text-align:center!important;color:#666;padding:24px!important}.print-note{font-size:10px;color:#555;margin-top:14px}.print-incomplete{display:block;font-size:10px;color:#666;margin-top:4px}.print-warning{font-size:12px;padding:10px;border:1px solid #999;margin-bottom:18px}
.print-product-intro{display:flex;justify-content:space-between;gap:24px;align-items:flex-start}.print-product-intro>div:first-child{flex:1;min-width:0}.print-product-photo{position:relative;width:140px;height:180px;flex:0 0 140px}.print-product-photo img{display:block;width:100%;height:100%;object-fit:contain}.print-product-photo .demo-photo{position:absolute;inset:0}.print-costs{width:100%;max-width:none;margin:22px 0 0;break-inside:avoid}.print-costs h2{margin-top:0}
@media screen and (max-width:700px){.print-toolbar{padding:14px;flex-wrap:wrap;gap:10px}.print-toolbar .actions{width:100%}.print-toolbar .btn{flex:1}.print-sheet{margin:14px;min-width:660px;padding:28px}.print-sheet-collection{min-width:990px}.print-preview-hint{padding:14px 14px 0}}
@page{size:A4 portrait;margin:14mm}
@page collection{size:A4 landscape;margin:12mm}
@media print{
  html,body{margin:0!important;padding:0!important;background:#fff!important;height:auto!important;overflow:visible!important}
  body:has(#print-preview[open])>*:not(#print-preview){display:none!important}
  #print-preview[open]{display:block!important;position:static!important;inset:auto!important;width:100%!important;max-width:none!important;min-width:0!important;height:auto!important;max-height:none!important;overflow:visible!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;background:#fff!important;box-shadow:none!important}
  #print-preview::backdrop{display:none!important;background:transparent!important}
  .print-toolbar,.print-preview-hint{display:none!important}
  .print-sheet{display:block;min-width:0!important;max-width:none!important;width:100%!important;margin:0!important;padding:0!important;box-shadow:none!important;font-size:10pt;print-color-adjust:exact;-webkit-print-color-adjust:exact}
  body:has(#print-preview[open][data-kind="collection"]),#print-preview[open][data-kind="collection"]{page:collection}
  .print-sheet-collection{page:collection}.print-sheet h1{font-size:21pt}.print-sheet h2{font-size:12pt}.print-table{font-size:9pt}.print-collection-table{font-size:8.5pt}.print-table thead{display:table-header-group}.print-table tfoot{display:table-row-group}.print-table tr,.print-header,.print-product-intro{break-inside:avoid}.print-table th,.print-table td{padding:2.2mm 1.8mm}.print-note{font-size:8pt}.print-product-photo{width:38mm;height:49mm;flex-basis:38mm}.print-sheet a{color:inherit;text-decoration:none}
}
/* Phone preview is readable as records; actual print keeps the A4 tables. */
@media screen and (max-width:700px){
 #print-preview{width:calc(100% - 16px);max-height:calc(100dvh - 16px)}.print-toolbar{position:static;padding:16px;display:block}.print-toolbar small{display:block;overflow-wrap:anywhere}.print-toolbar .actions{display:grid;grid-template-columns:1fr 1fr;margin-top:12px}.print-toolbar .btn{font-size:14px;white-space:normal;min-height:46px;height:auto;padding:10px}.print-preview-hint{padding:16px;font-size:13px}.print-sheet{width:100%;margin:0;padding:18px 16px;font-size:15px}.print-header{display:block}.print-date{margin-top:8px}.print-sheet h1{font-size:24px;overflow-wrap:anywhere}.print-product-intro{display:flex;flex-direction:column}.print-product-photo{width:100%;height:240px;flex:auto}.print-table{display:block;width:100%;min-width:0}.print-table thead{position:absolute;clip-path:inset(50%);width:1px;height:1px;overflow:hidden}.print-table tbody{display:block}.print-table tbody tr{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;padding:16px 0;border-bottom:1px solid #ddd}.print-table tbody td,.print-table tbody th{display:block;min-width:0;padding:0;border:0;white-space:normal;text-align:left!important;overflow-wrap:anywhere;font-size:15px}.print-table tbody td:first-child{grid-column:1/-1;font-weight:600;font-size:16px}.print-table tbody td[data-label]:not(:first-child)::before{content:attr(data-label);display:block;font-size:12px;color:#777;margin-bottom:5px}.print-table tfoot,.print-table tfoot tr{display:block}.print-table tfoot th,.print-table tfoot td{display:block;padding:8px 0;text-align:left;white-space:normal}.print-costs .print-table tbody tr{display:flex;justify-content:space-between;gap:16px}.print-costs .print-table tbody td:first-child{font-weight:400}.print-costs .print-table tbody td:last-child{flex:none}.print-costs{width:100%}
}

/* Rails forms and links retain the prototype's component geometry. */
[hidden]{display:none!important}.inline-action,.button_to{display:inline-flex;margin:0}.tabs>a{font-weight:550;display:flex;align-items:center;justify-content:center;gap:7px;padding:10px 15px;border-radius:9px;font-size:14px}.tabs>a.active{background:#fff;box-shadow:0 1px 5px #0001}.field-grid .field{min-width:0}.upload-files-status{font-size:13px;margin-top:10px}.photo-source{position:relative}.line-add-form input{max-width:100%}.line-add-fields .field{margin:0}dialog>form{min-height:0;overflow:auto}.global-search-results a{color:inherit}
@media screen and (max-width:700px){.heading .actions>.inline-action{width:44px}.heading .actions>.inline-action>.btn{width:44px;padding:0}.collection-heading .actions>.inline-action{width:46px}.collection-heading .actions>.inline-action>.btn{width:46px}.product-heading>.actions>.inline-action{grid-column:1}.product-heading>.actions>.btn.primary{grid-column:1/-1;order:5}.heading .actions>a[data-action=print-form]{flex:0 0 46px;width:46px;padding:0}.tabs>a{min-height:44px}.line-add-form .line-add-fields{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.line-add-form .line-material{grid-column:1/-1}.composition td:first-child{background:#e6e7eb!important}.collection-heading .actions>a[data-action=print-form]{width:46px}}




.collection-heading .inline-action .lock-toggle{width:44px;height:44px;min-width:44px;min-height:44px;border:1px solid var(--border);border-radius:11px;background:#fff}.collection-heading .inline-action .lock-toggle svg{width:22px;height:22px}.collection-heading .inline-action .lock-toggle.is-locked{background:#f2eadb;border-color:#e5d7bb}
@media screen and (max-width:700px){.collection-heading .inline-action .lock-toggle{width:46px;height:46px}.heading h1>.count{display:inline-flex;align-items:center;justify-content:center;min-width:40px;padding:5px 12px;border-radius:999px;background:#e6e7eb;color:#555660;font-size:17px;font-weight:650;line-height:1.3;letter-spacing:0;margin:0 0 0 10px;vertical-align:middle}}

.media-main{cursor:pointer}.media-main svg{width:13px;height:13px;vertical-align:middle;margin-right:3px}.media-main .selected-label{display:none}.media-main:has(input:checked){font-weight:650;color:var(--green)}.media-main:has(input:checked) .selected-label{display:inline}.media-main:has(input:checked) .unselected-label{display:none}.media-tile:has(input[name="remove_media[]"]:checked){opacity:.35}.media-tile:has(input[name="remove_media[]"]:checked) .media-remove{background:#f5c2c0}.media-remove{cursor:pointer}.media-main:focus-within,.media-remove:focus-within{outline:2px solid #a1a1aa;outline-offset:2px}

/* Material dialogs use the same wide frame and content groups as the prototype. */
.material-view-media{margin-top:20px}
#dialog.material-dialog>form{display:flex;flex-direction:column;min-height:0}
#dialog.material-dialog .dialog-body{min-height:0;overflow-y:auto}
#dialog.material-dialog .dialog-actions{flex-shrink:0}
#dialog.material-dialog .dialog-actions>.inline-action{flex:none}
#dialog.material-dialog .upload-files-status{margin-top:0}
@media screen and (max-width:700px){#dialog.material-dialog>.dialog-body{padding-top:18px}}

/* Keep Rails forms aligned with the prototype on touch screens. */
.product-media-heading{margin-bottom:16px}
.upload-files-status{margin-top:0}
.picker-search{width:100%;margin-bottom:16px}
.picker-quantity-field{margin-top:18px}
#dialog.collection-dialog>form{display:flex;flex-direction:column;min-height:0}
#dialog.collection-dialog .dialog-body{min-height:0;overflow-y:auto}
#dialog.collection-dialog .dialog-actions{flex-shrink:0}
.media-tile:has(.media-remove input:checked){display:none}
.media-remove{padding:0;line-height:1;color:inherit;appearance:none}.media-remove svg{display:block}

.print-page{background:#e9e9ed}
@media print{body.print-page{background:white!important}.print-page .print-preview-toolbar{display:none!important}.print-page .print-document{margin:0!important;max-width:none!important;width:100%!important}.print-page.landscape{page:collection}}

@media screen and (max-width:700px){.print-sheet,.print-sheet-collection{min-width:0}.print-date{position:static}.print-brand{padding-right:0}}

@media screen and (max-width:700px){.report-table tfoot,.report-table tfoot tr{display:block}.report-table tfoot tr{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;background:#eff6f1}.report-table tfoot td{position:static;display:block;padding:0!important;white-space:normal}.report-table tfoot td:last-child{flex:none;font-weight:650}.report-table tfoot td::before{display:none}}

/* Account disclosure keeps the compact header button in its existing grid cell. */
.header-inner{position:relative}.account-menu{position:absolute;right:0;top:calc(100% - 6px);width:260px;max-width:calc(100vw - 28px);padding:8px;background:#fff;border:1px solid var(--border);border-radius:14px;box-shadow:0 12px 36px #18181b20;z-index:60}.account-menu-user{padding:10px 12px 14px;border-bottom:1px solid var(--border);margin-bottom:6px;overflow-wrap:anywhere}.account-menu-user strong,.account-menu-user small{display:block}.account-menu-user small{font-size:12px;color:var(--muted-foreground);margin-top:3px}.account-menu .button_to{display:block}.account-logout{display:flex;align-items:center;gap:10px;width:100%;padding:12px;border:0;border-radius:9px;background:#fff;text-align:left;font-size:14px;min-height:44px}.account-logout:hover{background:#f3f3f5}.account-logout svg{width:18px}.sort-button{min-height:24px}th[aria-sort]:not([aria-sort=none]) .sort-button{color:var(--foreground)}.upload-progress progress{min-height:8px}
@media(max-width:900px){.account-menu{top:60px}}@media(max-width:700px){.account-menu{top:52px}}

/* Compact audit entries use the available width without truncating changes. */
.audit-table td{padding:9px 14px;line-height:1.4}.audit-table th{padding:10px 14px}.audit-table td:last-child{width:100%}.audit-author{min-width:125px;max-width:180px}.audit-event-heading{display:flex;align-items:baseline;gap:6px 10px;flex-wrap:wrap;overflow-wrap:anywhere}.audit-action{color:var(--muted-foreground);font-size:12px}.audit-changes{max-width:none;white-space:normal;margin-top:3px;display:flex;flex-wrap:wrap;gap:3px 20px;line-height:1.4}.audit-change{display:flex;align-items:baseline;gap:4px;max-width:100%;min-width:0}.audit-change-label{font-weight:550;flex-shrink:0;max-width:100%;overflow-wrap:anywhere}.audit-change-value{min-width:0;white-space:pre-wrap;overflow-wrap:anywhere}.audit-footer{padding:10px 14px}.report-sort-mobile{display:none}
@media(max-width:700px){.table-wrap .audit-table tbody tr{gap:7px 12px;padding:12px 14px;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.table-wrap .audit-table td{gap:2px}.table-wrap .audit-table td.audit-author{min-width:0;max-width:none}.table-wrap .audit-table td.audit-ip{grid-column:1/-1;display:flex;flex-direction:row;align-items:baseline!important;gap:6px;justify-content:flex-start}.table-wrap .audit-table td:last-child{width:100%}.table-wrap .audit-table td:last-child::before{display:none}.audit-changes{gap:4px 12px;font-size:12px}.audit-change{flex-wrap:wrap;gap:0 4px}.audit-change-label{flex-shrink:1}.audit-event-heading{gap:3px 8px}.report-sort-mobile{display:flex;align-items:center;gap:8px;padding:0 16px 16px}.report-sort-mobile label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.report-sort-mobile select{flex:1;min-width:0;height:44px;padding:8px 12px;background:#fff;border:1px solid var(--border);border-radius:9px;font-size:16px}.report-sort-mobile .btn{flex:none}}

@media(max-width:700px){.collection-sort-mobile{padding:0;margin:0 0 18px}}
