
:root{font-family:system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;color:#172a31;background:#eef2f5;--ink:#172a31;--muted:#64757c;--line:#dce5e8;--teal:#176b64;--light:#e4f2ef;--paper:#fff}
*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button{cursor:pointer}button:disabled{opacity:.55;cursor:not-allowed}button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #79b9b0;outline-offset:2px}
button{border:1px solid var(--line);background:#fff;color:var(--ink);border-radius:10px;padding:10px 14px;font-weight:650}button:hover{background:#f4f8f8}.primary{background:var(--teal);color:white;border-color:var(--teal)}.primary:hover{background:#105950}.danger{color:#a93e3e}.quiet{color:var(--muted);font-weight:500}.icon{font-size:19px;padding:6px 11px}
.shell{max-width:1200px;margin:auto;padding:28px 24px 50px}.top{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:24px}.brand{display:flex;align-items:center;gap:12px}.logo{width:46px;height:46px;border-radius:13px;background:var(--teal);color:white;display:grid;place-items:center;font-size:25px;font-weight:800;flex:none}.brand h1{font-size:24px;letter-spacing:-.7px;margin:0}.brand p{margin:2px 0 0;color:var(--muted);font-size:13px}.top-actions{display:flex;align-items:center;gap:9px}.status{font-size:12px;color:var(--muted);display:flex;align-items:center;gap:7px}.dot{width:8px;height:8px;background:#98a9ad;border-radius:50%;flex:none}.dot.online{background:#3f9877}.dot.warn{background:#c88230}
.panel{background:var(--paper);border:1px solid var(--line);border-radius:17px;overflow:hidden;box-shadow:0 5px 24px #153d4510}.tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));padding:8px;gap:7px;border-bottom:1px solid var(--line)}.tab{border:0;display:flex;align-items:center;justify-content:center;gap:8px;color:var(--muted);min-height:50px;font-size:14px;line-height:1.2}.tab[aria-selected=true]{background:var(--light);color:var(--teal);font-weight:750}.count{font-size:11px;border-radius:20px;background:#eaf0f1;color:#577078;padding:3px 7px;min-width:23px}.tab[aria-selected=true] .count{background:#c9e6df;color:var(--teal)}
.content{padding:24px}.heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:17px}.heading h2{font-size:23px;letter-spacing:-.5px;margin:0 0 4px}.heading p{margin:0;color:var(--muted);font-size:13px}.actions{display:flex;gap:8px;flex-wrap:wrap}
.entry-form{background:#f7faf9;border:1px solid #dceae6;border-radius:14px;padding:17px;margin:0 0 18px}.entry-title{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:13px}.entry-title h3{font-size:16px;margin:0}.entry-title p{font-size:12px;color:var(--muted);margin:3px 0 0}.entry-grid{display:grid;grid-template-columns:1.1fr 1.3fr .95fr .7fr .9fr auto;gap:10px;align-items:end}.field{display:block;min-width:0}.field span{display:block;font-size:12px;font-weight:700;margin-bottom:6px;color:#40545a}.field input,.field select{width:100%;padding:10px 11px;border:1px solid var(--line);border-radius:9px;background:white;min-height:43px;color:var(--ink);min-width:0}.entry-submit{min-height:43px;white-space:nowrap}.entry-error{margin-top:8px}.order-person{max-width:440px;margin-bottom:13px}.order-lines{display:grid;gap:8px}.order-line{display:grid;grid-template-columns:minmax(150px,1.35fr) minmax(125px,.9fr) minmax(85px,.5fr) auto;gap:9px;align-items:end;padding:10px;background:white;border:1px solid var(--line);border-radius:10px}.reserved-line{grid-template-columns:minmax(135px,1.25fr) minmax(115px,.85fr) minmax(80px,.48fr) minmax(125px,.8fr) auto}.order-line .field{margin:0}.order-line .field input{min-width:0}.order-line .remove-line{height:43px;padding:7px 11px}.entry-controls{display:flex;justify-content:space-between;gap:10px;align-items:center;margin-top:12px;flex-wrap:wrap}.entry-controls>div{display:flex;gap:8px;flex-wrap:wrap}
.search-area{padding:14px 24px 0}.searchbar{display:flex;gap:10px;margin-bottom:0}.search{width:100%;padding:12px 14px;border:1px solid var(--line);border-radius:10px;background:#f8fafb;color:var(--ink);min-width:0}.searchbar button{white-space:nowrap}.list-head,.item{display:grid;grid-template-columns:minmax(125px,1.05fr) minmax(150px,1.35fr) minmax(105px,.75fr) minmax(115px,.85fr) auto;gap:12px;align-items:center}.list-head{padding:10px 12px;color:var(--muted);font-size:12px;border-bottom:1px solid var(--line);font-weight:700}.item{padding:13px 12px;min-height:67px;border-bottom:1px solid var(--line)}.item:last-child{border-bottom:0}.product{font-weight:700;overflow-wrap:anywhere}.quantity-note{font-size:12px;color:var(--muted);font-weight:500;margin-top:4px}.person,.price{overflow-wrap:anywhere;font-size:14px}.inline-price{width:100%;min-width:76px;padding:7px 8px;border:1px solid transparent;border-radius:8px;background:#f6f9f8;color:var(--ink);font:inherit;font-size:14px;font-weight:700}.inline-price:hover{border-color:var(--line)}.inline-price:focus{border-color:var(--teal);background:#fff}.inline-price::placeholder{color:#64757c;opacity:1;font-size:12px;font-weight:700}.price-cell{min-width:0;display:flex;align-items:center;gap:5px}.currency-suffix{font-size:13px;color:var(--muted);flex:none}.group-item .product{font-weight:700}.sub{font-size:12px;color:var(--muted);margin-top:4px;line-height:1.4}.date{font-size:13px;color:var(--muted)}.row-actions{display:flex;gap:5px;justify-content:flex-end;align-items:center;flex-wrap:wrap}.row-actions button{font-size:12px;padding:8px 10px;white-space:nowrap}.move{color:var(--teal);background:var(--light);border-color:#cde5df}
.group-card{border:1px solid var(--line);border-radius:12px;margin:10px 0 13px;overflow:hidden;background:#fff}.group-customer,.queue-heading{display:grid;grid-template-columns:minmax(125px,1.05fr) minmax(150px,1.35fr) minmax(105px,.75fr) minmax(115px,.85fr) auto;gap:12px;align-items:center;background:#f5f9f8;padding:12px;border-bottom:1px solid var(--line)}.group-customer strong,.queue-heading strong{font-size:14px;overflow-wrap:anywhere}.group-meta{font-size:12px;color:var(--muted)}.group-item .blank-cell{min-height:1px}.booking{color:var(--teal);font-size:12px;font-weight:650}.booking.expired{color:#b45533}.queue-heading{background:#f5f9f8}.queue-list .item{grid-template-columns:minmax(125px,1.05fr) minmax(150px,1.35fr) minmax(105px,.75fr) minmax(115px,.85fr) auto}.queue-list .product-placeholder{font-size:12px;color:var(--muted)}.quick-add{display:grid;grid-template-columns:minmax(150px,1.3fr) minmax(110px,.8fr) minmax(75px,.45fr) auto;gap:8px;padding:11px 12px;background:#fbfdfc;border-top:1px dashed var(--line)}.quick-add input{min-width:0;width:100%;padding:9px 11px;border:1px solid var(--line);border-radius:9px}.quick-add button{white-space:nowrap}
.separator{display:flex;align-items:center;gap:10px;margin:16px 0;color:var(--muted);font-size:12px}.separator:before,.separator:after{content:'';flex:1;border-top:2px dashed #b3c5c9}.separator button{font-size:12px;padding:4px 8px}.empty{text-align:center;color:var(--muted);padding:45px 12px}.empty strong{display:block;color:var(--ink);font-size:17px;margin-bottom:7px}.footer{display:flex;justify-content:space-between;gap:10px;padding:15px 2px;color:var(--muted);font-size:12px}.note{font-size:13px;color:var(--muted);line-height:1.5}.notice{background:#fff3df;color:#745020;border:1px solid #eed9b7;padding:11px 14px;border-radius:10px;font-size:13px;margin-bottom:15px}.hidden,[hidden]{display:none!important}
dialog{border:1px solid var(--line);border-radius:18px;padding:0;max-width:min(530px,calc(100% - 24px));width:100%;color:var(--ink);box-shadow:0 15px 65px #102e3c44;max-height:90dvh;overflow:auto}dialog::backdrop{background:#15333b70}dialog.wide{max-width:min(800px,calc(100% - 24px))}.modal-head{padding:20px 22px 14px;display:flex;align-items:center;justify-content:space-between;gap:10px;border-bottom:1px solid var(--line)}.modal-head h2{font-size:20px;margin:0}.modal-body{padding:20px 22px}.modal-field{display:block;margin-bottom:15px}.modal-field span{display:block;font-size:13px;font-weight:650;margin-bottom:6px}.modal-field input,.modal-field select{width:100%;padding:11px 12px;border:1px solid var(--line);border-radius:9px;background:white;min-height:44px;color:var(--ink)}.modal-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:20px;flex-wrap:wrap}.error{color:#a43c36;font-size:13px;white-space:pre-wrap;overflow-wrap:anywhere}.report-section{margin-top:18px}.report-section h3{font-size:15px;background:var(--light);padding:11px 13px;border-radius:9px;color:var(--teal);margin:0 0 6px}.report-row{padding:11px 5px;border-bottom:1px solid var(--line);overflow-wrap:anywhere}.report-row:last-child{border:0}.report-row strong{font-size:14px}.report-row p{margin:4px 0;color:var(--muted);font-size:13px}.toast{position:fixed;bottom:22px;left:50%;transform:translateX(-50%);background:#203e43;color:#fff;border-radius:12px;padding:12px 20px;box-shadow:0 4px 24px #142f3b40;max-width:calc(100% - 30px);z-index:100;font-size:14px;white-space:pre-wrap}.backup-actions{display:flex;gap:10px;margin:12px 0 18px}.backup-actions button{width:100%;min-height:46px}.backup-file input{padding:9px!important;background:#f8fafb!important}.cloud-box{background:#f4f8f8;border:1px solid var(--line);padding:12px;border-radius:10px;margin-bottom:14px}.cloud-box p{margin:3px 0 10px;overflow-wrap:anywhere}.inline-actions{display:flex;flex-wrap:wrap;gap:8px}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
@media(max-width:850px){.entry-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.entry-submit{width:100%}.list-head,.item,.group-customer,.queue-heading,.queue-list .item{grid-template-columns:minmax(110px,1fr) minmax(120px,1.15fr) minmax(90px,.75fr) minmax(100px,.8fr) auto;gap:8px}.row-actions button{padding:7px 8px}}
@media(max-width:650px){.shell{padding:16px 11px 28px}.top{margin-bottom:16px;align-items:flex-start}.brand h1{font-size:20px}.brand p{font-size:11px}.logo{width:39px;height:39px;font-size:21px}.top-actions{flex-direction:column;align-items:flex-end;gap:6px}.top-actions button{font-size:12px;padding:8px 10px}.status{font-size:10px}.tabs{padding:5px;gap:3px}.tab{font-size:11px;padding:8px 3px;min-height:58px;flex-direction:column;gap:4px}.count{font-size:10px;padding:2px 6px}.search-area{padding:12px 11px 0}.content{padding:14px 11px}.heading{align-items:flex-start;flex-direction:column}.heading h2{font-size:21px}.actions{width:100%}.actions button{flex:1;font-size:13px;padding:9px 7px}.entry-form{padding:12px}.entry-title{align-items:flex-start;flex-direction:column}.entry-grid{grid-template-columns:1fr}.order-person{max-width:none}.order-line,.reserved-line{grid-template-columns:1fr 1fr;gap:8px}.order-line .field:first-child{grid-column:1/-1}.order-line .remove-line{grid-column:1/-1;width:100%}.entry-controls{align-items:stretch;flex-direction:column}.entry-controls>div{display:grid;grid-template-columns:1fr 1fr}.entry-controls button{font-size:13px}.searchbar{gap:6px}.searchbar button{font-size:12px;padding:9px}.list-head{display:none}.item,.queue-list .item{display:grid;grid-template-columns:1fr 1fr;gap:8px 10px;padding:12px 10px}.item>div:first-child,.item .product{grid-column:1/-1}.item .person{grid-column:1}.item .price{grid-column:2;text-align:right}.item .price-cell{grid-column:2;text-align:right}.item .inline-price{text-align:right}.item .date{grid-column:1/-1}.row-actions{grid-column:1/-1;justify-content:flex-start}.row-actions button{min-height:35px}.group-customer,.queue-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:11px 10px}.group-customer strong,.queue-heading strong{font-size:14px}.group-meta{font-size:11px;text-align:right}.group-item .blank-cell{display:none}.quick-add{grid-template-columns:1fr 1fr}.quick-add input:first-child{grid-column:1/-1}.quick-add button{grid-column:1/-1}.quick-add button{width:100%}.separator{margin:12px 0}.footer{font-size:11px;flex-wrap:wrap}.modal-body{padding:16px}.modal-head{padding:16px 17px}.empty{padding:35px 6px}}
@media print{body>.shell,.toast,dialog:not(#reportDialog){display:none!important}#reportDialog{position:static;max-width:none;max-height:none;width:100%;border:0;box-shadow:none;margin:0;overflow:visible}#reportDialog::backdrop{display:none}#reportDialog .no-print{display:none!important}#reportDialog .report-section{break-inside:auto}.report-row{break-inside:avoid}body{background:white}}

/* Версия 2.5: более контрастные записи и заметное поле цены */
:root{color:#152a33;--ink:#152a33;--muted:#40535c;--line:#c9d5da}
body{color:var(--ink)}
.list-head{color:#40535c}
.item,.group-item,.queue-list .item{color:#152a33;border-bottom-color:#d0dbe0}
.person,.price{color:#172b34;font-weight:600}
.product{color:#122a34}
.group-item .product{color:#263b44;font-weight:500}
.quantity-note,.sub,.date,.group-meta,.queue-list .product-placeholder,.separator,.footer,.note,.status,.heading p,.entry-title p{color:#40535c}
.quantity-note{font-weight:600}
.date{font-weight:600}
.group-card{border-color:#c8d5da}
.group-customer,.queue-heading{background:#edf3f2;border-bottom-color:#c8d5da}
.group-customer strong,.queue-heading strong{color:#122b35;font-weight:750}
.group-meta{font-weight:600}
.queue-list .product-placeholder{font-weight:650}
.inline-price{border:1px solid #b8c8ce;background:#fff;color:#132b35;font-weight:600;box-shadow:inset 0 1px 2px #1737430a;transition:border-color .15s,box-shadow .15s,background .15s}
.inline-price:hover{border-color:#8199a2;background:#fcfefe}
.inline-price:focus{border-color:#176b64;background:#fff;box-shadow:0 0 0 2px #176b6420}
.inline-price::placeholder{color:#52636b;font-weight:500;opacity:1}
.currency-suffix{color:#40535c;font-weight:650}
.item:hover{background:#fbfdfd}


/* Версия 2.7: акцент на имени клиента */
.person{
  color:#102d38;
  font-size:16px;
  font-weight:750;
  line-height:1.3;
}
.group-customer strong{
  color:#102d38;
  font-size:16px;
  font-weight:800;
  line-height:1.3;
}
.ordered-item .product{
  font-weight:500;
}
@media(max-width:650px){
  .person{font-size:16px}
  .group-customer strong{font-size:16px}
}


/* Версия 2.7: подтверждение удаления рядом с кнопкой */
.delete-confirm{
  display:flex;align-items:center;gap:6px;flex-wrap:wrap;
  padding:5px 7px;border:1px solid #e3b2b2;border-radius:9px;
  background:#fff7f6;
}
.delete-confirm .delete-question{
  color:#8b2e2e;font-size:12px;font-weight:750;
}
.delete-confirm button{font-size:12px;padding:7px 9px;white-space:nowrap}
.delete-confirm .confirm-yes{
  color:#fff;background:#a83c3c;border-color:#a83c3c;
}
.delete-confirm .confirm-yes:hover{background:#8f3030}
.delete-confirm .confirm-no{color:#263940;background:#fff}
.separator-actions{display:flex;align-items:center}
@media(max-width:650px){
  .delete-confirm{justify-content:flex-start}
  .delete-confirm .delete-question{flex-basis:100%}
}


/* Версия 2.11 — вкладка «Товары из США» */
.usa-form-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px;align-items:end}
.usa-form-grid .field{min-width:0}
.usa-form-grid .field input,.usa-form-grid .field select{width:100%;min-width:0;padding:10px 11px;border:1px solid var(--line);border-radius:9px;background:#fff;min-height:43px;color:var(--ink)}
.usa-form-grid .span-2{grid-column:span 2}
.usa-form-actions{display:flex;justify-content:flex-end;margin-top:13px}
.usa-client-card{border:1px solid var(--line);border-radius:13px;margin:12px 0;overflow:hidden;background:#fff}
.usa-client-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:13px 15px;background:#f1f7f5;border-bottom:1px solid var(--line)}
.usa-client-heading strong{font-size:17px;font-weight:800;color:#102d38;overflow-wrap:anywhere}
.usa-client-heading span{font-size:12px;color:#43585e;white-space:nowrap}
.usa-product-card{padding:14px 15px;border-bottom:1px solid var(--line)}
.usa-product-card:last-child{border-bottom:0}
.usa-product-top{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:11px}
.usa-product-top strong{font-size:15px;font-weight:750;color:#17343c;overflow-wrap:anywhere}
.usa-product-top .quantity-note{font-size:12px;color:#40545a}
.usa-details{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px 12px}
.usa-detail{min-width:0;background:#f8faf9;border:1px solid #e2e9e7;border-radius:9px;padding:8px 10px}
.usa-detail span{display:block;font-size:11px;color:#53666c;font-weight:650;margin-bottom:3px}
.usa-detail strong,.usa-detail a{font-size:13px;color:#183740;font-weight:700;overflow-wrap:anywhere}
.usa-detail a{color:#12665e;text-decoration:underline}
.usa-actions{display:flex;justify-content:flex-end;margin-top:10px}
.usa-actions .row-actions{justify-content:flex-end}
.usa-client-empty{padding:25px}
@media(max-width:850px){.usa-form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.usa-details{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:650px){
 .usa-form-grid{grid-template-columns:1fr}
 .usa-form-grid .span-2{grid-column:auto}
 .usa-client-heading{align-items:flex-start}
 .usa-client-heading strong{font-size:16px}
 .usa-product-card{padding:12px 10px}
 .usa-details{grid-template-columns:1fr 1fr;gap:7px}
 .usa-detail{padding:7px 8px}
 .usa-product-top{align-items:flex-start}
 .usa-actions{justify-content:flex-start}
}


/* Версия 2.11: редактируемые поля и расчётные суммы в товарах из США */
.usa-detail-editable{display:flex;flex-direction:column;align-items:stretch;gap:4px}
.usa-detail-editable .usa-inline-input{
  display:block;width:100%;min-width:0;box-sizing:border-box;
  border:1px solid #aebfbd;border-radius:7px;background:#fff;
  color:#142f38;font-family:inherit;font-size:13px;font-weight:600;line-height:1.35;padding:7px 8px;
  outline:none;box-shadow:inset 0 1px 2px rgba(16,45,56,.04);
}
.usa-detail-editable .usa-inline-input:focus{
  border-color:#287b72;box-shadow:0 0 0 2px rgba(40,123,114,.14);
}
.usa-detail-editable .usa-inline-input[readonly]{
  background:#edf2f1;color:#344b50;border-style:dashed;cursor:default;
}
.usa-detail-editable .usa-inline-input:disabled{opacity:.65}
.usa-detail-editable .usa-open-link{font-size:12px;font-weight:700;color:#12665e}
.usa-detail-computed{background:#edf5f3;border-color:#bfd5d0}
.usa-detail-computed strong{font-size:14px;color:#103f39}


/* Версия 2.11: перенос товаров из США в бронь */
.usa-actions .row-actions{display:flex;gap:8px;flex-wrap:wrap}
.usa-actions .row-actions .move{background:#e8f4f1;border-color:#9dc8bd;color:#155b50}


/* Версия 2.11: вкладка архива */
.tabs{grid-template-columns:repeat(5,minmax(0,1fr))}
.archive-client-card{border:1px solid #c8d5da;border-radius:13px;overflow:hidden;margin:0 0 14px;background:#fff}
.archive-client-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 14px;background:#edf3f2;border-bottom:1px solid #c8d5da}
.archive-client-heading strong{font-size:16px;font-weight:800;color:#122b35}
.archive-client-heading span{font-size:12px;color:#40535c;font-weight:650}
.archive-item{padding:14px;border-bottom:1px solid #d8e0e4;display:grid;gap:9px}
.archive-item:last-child{border-bottom:0}
.archive-item-top{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;flex-wrap:wrap}
.archive-item-title{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.archive-item-title strong{font-size:15px;color:#122a34}
.archive-origin{font-size:11px;font-weight:700;border:1px solid #b8c9ce;border-radius:20px;padding:3px 8px;color:#40535c;background:#f5f8f8}
.archive-meta{font-size:12px;color:#40535c;font-weight:600}
.archive-price{font-size:14px;font-weight:700;color:#152a33}
.archive-details{margin-top:2px}
@media(max-width:650px){
 .tabs{display:flex;overflow-x:auto;scrollbar-width:thin;overscroll-behavior-x:contain}
 .tab{flex:0 0 118px;min-width:118px}
 .archive-item{padding:12px 10px}
}


/* Версия 2.12: ссылки в поле имени клиента */
.person-url-cell{display:flex;align-items:center;gap:6px;min-width:0;max-width:100%}
.person-url-link{display:inline-block;flex:0 1 auto;min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#174f91;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px;font:inherit;font-weight:inherit}
.person-url-link:hover{color:#0b3c78;text-decoration-thickness:2px}
.person-url-copy{display:inline-flex;align-items:center;justify-content:center;flex:0 0 27px;width:27px;height:27px;min-height:27px;padding:0;border:1px solid #b9cbd5;border-radius:7px;background:#f4f8fb;color:#244f6a;font-size:15px;line-height:1;cursor:pointer}
.person-url-copy:hover{background:#e8f1f6;border-color:#8eacbd}
.person-heading-value{min-width:0}
.queue-list .person-url-inline{max-width:100%}
.group-customer .person-heading-value,.usa-client-heading .person-heading-value,.archive-client-heading .person-heading-value{flex:1 1 auto}
.report-person-line{display:flex;align-items:center;gap:5px;flex-wrap:wrap}
.report-person-url{display:inline-flex;align-items:center;gap:5px;min-width:0;max-width:100%;font-weight:600}
.report-person-url .person-url-copy{width:24px;height:24px;min-height:24px;flex-basis:24px;font-size:13px}


/* Версия 2.16: точное выравнивание заголовков и значений */
.list-head,.item{
  grid-template-columns:
    minmax(125px,1.05fr)
    minmax(150px,1.35fr)
    minmax(110px,.75fr)
    minmax(120px,.85fr)
    minmax(160px,180px);
}
.group-customer,.queue-heading,.queue-list .item{
  grid-template-columns:
    minmax(125px,1.05fr)
    minmax(150px,1.35fr)
    minmax(110px,.75fr)
    minmax(120px,.85fr)
    minmax(160px,180px);
}
.list-head> :nth-child(3),.list-head> :nth-child(4){justify-self:start;text-align:left}
.item>.price-cell,.item>.date{justify-self:start;width:100%;box-sizing:border-box}
.price-cell{justify-content:flex-start}

/* На телефоне подписи остаются прямо над значениями, а цена не прижимается к правому краю. */
@media(max-width:850px){
 .list-head,.item,.group-customer,.queue-heading,.queue-list .item{
  grid-template-columns:
    minmax(110px,1fr)
    minmax(120px,1.15fr)
    minmax(90px,.75fr)
    minmax(100px,.8fr)
    minmax(150px,170px);
 }
}
@media(max-width:650px){
 .item .price-cell{
  grid-column:1/-1;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:3px 6px;
  text-align:left;
  justify-self:stretch;
 }
 .item .price-cell::before{
  content:attr(data-label);
  display:block;
  grid-column:1/-1;
  color:#40535c;
  font-size:11px;
  font-weight:700;
  text-align:left;
 }
 .item .inline-price{text-align:left;width:100%}
 .item .date{
  grid-column:1/-1;
  justify-self:stretch;
  text-align:left;
  line-height:1.4;
 }
 .item .date::before{
  content:attr(data-label);
  display:block;
  margin-bottom:3px;
  color:#40535c;
  font-size:11px;
  font-weight:700;
 }
}


/* Версия 2.14: копирование заказа клиента для Telegram */
.group-customer .copy-order-button{
 justify-self:end;white-space:nowrap;min-height:34px;padding:7px 10px;
 border:1px solid #a9c8c0;border-radius:8px;background:#edf6f3;
 color:#155b50;font-size:12px;font-weight:750;line-height:1.2;
}
.group-customer .copy-order-button:hover{background:#e0f0eb;border-color:#7eafa2}
@media(max-width:650px){
 .group-customer .copy-order-button{font-size:11px;padding:6px 8px;min-height:32px}
}


/* Версия 2.16: компактный список очереди уведомлений */
.notify-card{margin:8px 0 10px}
.notify-heading{
 display:flex;align-items:flex-start;justify-content:space-between;gap:12px;
 padding:12px 14px;background:#edf3f2;border:0;
}
.notify-heading-main{display:flex;flex:1 1 auto;min-width:0;flex-direction:column;gap:7px}
.notify-title-row{display:flex;align-items:center;gap:9px;min-width:0}
.notify-product{font-size:16px!important;line-height:1.25;color:#122b35}
.notify-queue-summary{display:flex;align-items:center;flex-wrap:wrap;gap:5px 9px;min-width:0}
.notify-summary-label{font-size:11px;color:#52636b;font-weight:700}
.notify-queue-entry{display:inline-flex;align-items:center;gap:3px;max-width:100%;font-size:12px;line-height:1.4}
.notify-queue-index{color:#64757c;font-weight:700}
.notify-queue-name{color:#183a47;font-weight:650;overflow-wrap:anywhere}
.notify-queue-link{color:#185c98;text-decoration:underline;text-underline-offset:2px}
.notify-count{white-space:nowrap;flex:0 0 auto;margin-top:5px}
.notify-toggle{
 position:relative;display:inline-flex;align-items:center;justify-content:center;
 flex:0 0 30px;width:30px;height:30px;min-height:30px;min-width:30px;
 padding:0;border:1px solid #9db5bb;border-radius:50%;
 background:#fff;color:#244b57;cursor:pointer;
 box-shadow:0 1px 2px #17374312;
}
.notify-toggle::before{
 content:'';width:8px;height:8px;display:block;
 border-right:2px solid currentColor;border-bottom:2px solid currentColor;
 transform:translateY(-2px) rotate(45deg);transition:transform .16s ease;
}
.notify-toggle.is-expanded::before{transform:translateY(2px) rotate(225deg)}
.notify-toggle:hover{background:#f4f8f8;border-color:#638994}
.notify-toggle:focus-visible{outline:3px solid #176b6433;outline-offset:2px}
.notify-details{border-top:1px solid #d5e0e3}
.notify-details[hidden]{display:none!important}
.notify-details .queue-list{border:0}
@media(max-width:650px){
 .notify-heading{display:flex;align-items:flex-start;gap:8px;padding:11px 10px}
 .notify-heading-main{flex:1 1 auto;min-width:0}
 .notify-title-row{gap:7px}
 .notify-product{font-size:15px!important}
 .notify-count{margin-top:4px;font-size:11px}
 .notify-toggle{flex-basis:28px;width:28px;height:28px;min-width:28px;min-height:28px}
 .notify-queue-summary{gap:4px 8px}
 .notify-queue-entry{font-size:11px}
}


/* Версия 2.18: предоплата в заказах и бронировании */
.prepayment-line{grid-template-columns:minmax(135px,1.2fr) minmax(110px,.85fr) minmax(75px,.48fr) minmax(115px,.8fr) auto}
.reserved-line.prepayment-line{grid-template-columns:minmax(125px,1.15fr) minmax(105px,.8fr) minmax(70px,.45fr) minmax(110px,.75fr) minmax(125px,.8fr) auto}
.prepayment-inline-wrap{display:flex;align-items:center;gap:5px;flex-wrap:wrap;margin-top:6px}
.prepayment-inline-label{font-size:11px;color:#40535c;font-weight:700;white-space:nowrap}
.prepayment-input-wrap{display:flex;align-items:center;gap:3px;min-width:0}
.inline-prepayment{width:92px;max-width:100%;min-width:55px;box-sizing:border-box;padding:4px 6px;border:1px solid #b8c9ce;border-radius:6px;background:#f7fafb;color:#152a33;font:inherit;font-size:12px;font-weight:650;outline:none}
.inline-prepayment:hover{border-color:#8da8b0}
.inline-prepayment:focus{border-color:#287b72;background:#fff;box-shadow:0 0 0 2px #287b7220}
.inline-prepayment::placeholder{color:#687980;font-size:11px;font-weight:500}
.prepayment-suffix{font-size:11px;color:#40535c;font-weight:650}
#editPrepaymentField[hidden]{display:none!important}
@media(max-width:650px){
 .prepayment-inline-wrap{gap:4px}
 .inline-prepayment{width:105px}
 .prepayment-line,.reserved-line.prepayment-line{grid-template-columns:1fr 1fr}
}


/* 2.22 — статус выкупа */
.purchase-toggle{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:34px;padding:6px 10px;border:1px solid #d99c9c;border-radius:8px;background:#fff0ee;color:#a12626;font:inherit;font-size:12px;font-weight:700;cursor:pointer;white-space:nowrap;max-width:100%}
.purchase-toggle.is-purchased{background:#e7f5ec;border-color:#85bd99;color:#17653a}
.purchase-toggle:focus-visible{outline:3px solid #3789ba;outline-offset:2px}
.purchase-toggle:disabled{opacity:.6;cursor:wait}
.purchase-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 17px;width:17px;height:17px;border-radius:4px;background:currentColor;font-size:0;position:relative;overflow:hidden}
.purchase-icon::after{content:'×';position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#fff;font-size:14px;font-weight:800;line-height:1;text-align:center;transform:translate(-.2px,-.3px)}
.is-purchased .purchase-icon::after{content:'✓';font-size:12px;transform:translate(-.1px,-.2px)}
.ordered-item .purchase-toggle{margin-top:8px}
.purchase-form-field .purchase-toggle{width:100%;min-height:43px}
.purchase-form-field .purchase-toggle span{color:inherit}.purchase-form-field .purchase-toggle .purchase-icon{background:currentColor}
.order-line.prepayment-line:not(.reserved-line){grid-template-columns:minmax(135px,1.2fr) minmax(105px,.8fr) minmax(70px,.45fr) minmax(105px,.75fr) minmax(120px,.8fr) auto}
.purchase-section{margin:12px 0 18px;border:1px solid #c8d5da;border-radius:11px;overflow:hidden;background:#fff}
.purchase-section-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:11px 12px;font-size:15px;background:#edf5ef;color:#205b36;border-bottom:1px solid #c8d5da}
.unpurchased-section{background:#fff3ef;border-color:#e5b9ab}
.unpurchased-section .purchase-section-heading{background:#fbe4dd;color:#932e28;border-color:#e5b9ab}
.unpurchased-section .item{background:#fff3ef;border-bottom-color:#e9cbc1}
.purchase-count{font-size:13px;font-weight:700}
.purchase-empty{padding:12px;color:#40535c;font-size:13px;margin:0}
.archive-purchase{font-size:12px;font-weight:700}.archive-purchased{color:#17653a}.archive-unpurchased{color:#a12626}
@media(max-width:1000px){.order-line.prepayment-line:not(.reserved-line){grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:650px){.order-line.prepayment-line:not(.reserved-line){grid-template-columns:repeat(2,minmax(0,1fr))}.purchase-toggle{min-height:38px}.purchase-section-heading{font-size:14px}.purchase-section .ordered-item{grid-template-columns:repeat(2,minmax(0,1fr))}.purchase-section .ordered-item .inline-price{min-width:0}}


/* Группировка только внутри вкладки «Заказано» */
.ordered-group-card{margin:8px 9px 12px;border-color:#d3e0e4}
.ordered-group-card .ordered-group-customer{background:#f7fafb}
.ordered-group-card .group-item:last-child{border-bottom:0}
.ordered-group-card .group-item .blank-cell{display:block}
@media(max-width:650px){
 .ordered-group-card{margin:7px 6px 10px}
 .ordered-group-card .group-item .blank-cell{display:none}
}


.archive-subtabs{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 16px;padding:5px;background:#f2f6f6;border:1px solid #d7e2e4;border-radius:12px}
.archive-subtab{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:40px;padding:8px 13px;border:1px solid transparent;border-radius:9px;background:transparent;color:#40545a;font-size:13px;font-weight:650}
.archive-subtab[aria-selected=true]{background:#fff;border-color:#b9d0d1;color:#075f58;box-shadow:0 1px 2px rgba(20,45,50,.06)}
.archive-subtab .count{background:#e2ebeb;color:#405b60}
.archive-subtab[aria-selected=true] .count{background:#d3ebe5;color:#075f58}
@media(max-width:650px){.archive-subtabs{display:grid;grid-template-columns:1fr}.archive-subtab{justify-content:space-between;text-align:left}}


.ordered-shipment-separator{margin:18px 0;color:var(--ink);font-weight:700}
.ordered-shipment-separator .shipment-divider-label{white-space:nowrap}
.ordered-separator-actions{gap:6px;flex-wrap:wrap}
.ordered-separator-actions button{white-space:nowrap}
.separator-date-input{width:142px;min-width:0;padding:5px 7px;border:1px solid var(--line);border-radius:7px;background:#fff;color:var(--ink);font:inherit;font-size:12px}


.reserved-note-editor{
 display:block;width:100%;min-height:30px;max-height:96px;resize:vertical;
 margin-top:7px;padding:6px 8px;border:1px solid #d4e0e3;border-radius:7px;
 background:#fbfdfd;color:var(--ink);font:inherit;font-size:12px;line-height:1.4;
 font-weight:450;overflow-wrap:anywhere;
}
.reserved-note-editor::placeholder{color:#687b82;opacity:1;font-weight:450}
.reserved-note-editor:focus{border-color:var(--teal);background:#fff}
.reserved-note-editor:disabled{opacity:.65}





/* Версия 2.31: комментарий расположен в центральной части тонкой шапки заказа */
.group-customer{
 display:grid;
 grid-template-columns:minmax(125px,1.05fr) minmax(70px,.45fr) minmax(220px,2.2fr) minmax(160px,180px);
 gap:12px;align-items:center;padding:8px 12px;min-height:58px;
}
.reserved-order-note{
 display:block;width:100%;min-width:0;height:32px;min-height:32px;max-height:32px;
 margin:0;padding:6px 9px;border:1px solid #d4e0e3;border-radius:7px;
 background:#fbfdfd;color:var(--ink);font:inherit;font-size:12px;line-height:18px;
 font-weight:450;white-space:nowrap;overflow:hidden;text-overflow:clip;
 resize:none;outline-offset:1px;
}
.reserved-order-note::placeholder{color:#687b82;opacity:1;font-weight:450}
.reserved-order-note:focus{border-color:var(--teal);background:#fff}
.reserved-order-note:disabled{opacity:.65}
@media(max-width:850px){
 .group-customer{
  grid-template-columns:minmax(110px,1fr) minmax(65px,.45fr) minmax(150px,1.4fr) minmax(150px,170px);
  gap:8px;padding:8px 10px;
 }
}
@media(max-width:650px){
 .group-customer{
  display:grid;grid-template-columns:minmax(0,1fr) auto;
  gap:6px 8px;padding:8px 10px;align-items:center;
 }
 .group-customer>.person-heading-value{grid-column:1;grid-row:1}
 .group-customer>.group-meta{grid-column:2;grid-row:1}
 .group-customer>.reserved-order-note{grid-column:1;grid-row:2}
 .group-customer>.copy-order-button{grid-column:2;grid-row:2;justify-self:end}
}


/* Версия 2.32: названия товаров в «Забронировано» и «Заказано» —
   такой же заметный жирный акцент, как у имени клиента */
.group-item .product,
.ordered-item .product{
  color:#102d38;
  font-weight:800;
}


/* Версия 2.33: визуально отделяем имя клиента от названий товаров в «Забронировано» */
.group-customer > .person-heading-value{
  color:#15566b;
  font-size:16px;
  font-weight:850;
  line-height:1.3;
  letter-spacing:.12px;
}
.group-item .product{
  color:#263d46;
  font-size:14px;
  font-weight:750;
  line-height:1.35;
}
@media(max-width:650px){
  .group-customer > .person-heading-value{font-size:16px}
  .group-item .product{font-size:14px}
}


/* Версия 2.34: контрастный коричневый цвет имени клиента в «Забронировано» */
.group-customer > .person-heading-value{
  color:#8B4513;
  font-size:16px;
  font-weight:850;
  line-height:1.3;
  letter-spacing:.12px;
}
.group-item .product{
  color:#263d46;
}


/* Версия 2.35: контрастный синий цвет имени клиента в «Забронировано» */
.group-customer > .person-heading-value{
  color:#1D4ED8;
  font-size:16px;
  font-weight:850;
  line-height:1.3;
  letter-spacing:.12px;
}
.group-item .product{
  color:#263d46;
}


/* Версия 2.36: чисто чёрный цвет имени клиента в «Забронировано» */
.group-customer > .person-heading-value{
  color:#000000;
}


/* Версия 2.37: этапы доставки и цветовые состояния товаров из США */
.usa-product-card{transition:background-color .15s ease,border-color .15s ease}
.usa-product-card.usa-stage-none{background:#FDE8E8;border-left:4px solid #D64545}
.usa-product-card.usa-stage-us{background:#FFF4CC;border-left:4px solid #D6A300}
.usa-product-card.usa-stage-warehouse{background:#E0F3E5;border-left:4px solid #3A985B}
.usa-product-card.usa-stage-rf{background:#176B3A;border-left:4px solid #0B4725}
.usa-product-card.usa-stage-rf .usa-product-top strong,
.usa-product-card.usa-stage-rf .usa-product-top .quantity-note,
.usa-product-card.usa-stage-rf .usa-product-top .date{color:#FFFFFF}
.usa-shipping-stages{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin:0 0 11px}
.usa-stage-option{display:inline-flex;align-items:center;gap:6px;min-height:30px;padding:5px 9px;border:1px solid rgba(35,65,55,.18);border-radius:8px;background:rgba(255,255,255,.88);color:#243b35;font-size:12px;font-weight:700;cursor:pointer}
.usa-stage-option input{width:15px;height:15px;margin:0;accent-color:#176B3A;cursor:pointer}
.usa-stage-option input:disabled{cursor:not-allowed;opacity:.55}
.usa-stage-option:has(input:disabled){opacity:.72;cursor:not-allowed}
.usa-product-card.usa-stage-rf .usa-stage-option{border-color:#d5e6d9;background:#F2FAF4}
.usa-product-card.usa-stage-rf .usa-details .usa-detail{background:#F8FAF9}
@media(max-width:650px){.usa-shipping-stages{gap:6px}.usa-stage-option{font-size:11px;padding:5px 7px}}


/* Версия 3.0: приоритет сортировки товаров из США по этапам доставки */
.usa-stage-section{margin:16px 0 22px}
.usa-stage-section-heading{
 display:flex;align-items:center;justify-content:space-between;gap:12px;
 padding:11px 14px;border:1px solid;border-radius:10px;
 font-size:14px;line-height:1.3
}
.usa-stage-section-heading strong{font-size:14px;font-weight:850}
.usa-stage-section-count{font-size:12px;font-weight:700;white-space:nowrap;opacity:.88}
.usa-stage-section-none .usa-stage-section-heading{background:#FDE8E8;border-color:#D64545;color:#842D2D}
.usa-stage-section-us .usa-stage-section-heading{background:#FFF4CC;border-color:#D6A300;color:#765600}
.usa-stage-section-warehouse .usa-stage-section-heading{background:#E0F3E5;border-color:#3A985B;color:#205D36}
.usa-stage-section-rf .usa-stage-section-heading{background:#176B3A;border-color:#0B4725;color:#FFFFFF}
.usa-stage-section .usa-client-card{margin:10px 0 0}
@media(max-width:650px){
 .usa-stage-section{margin:13px 0 18px}
 .usa-stage-section-heading{padding:10px 11px}
}


/* Версия 3.1: необязательная отметка о доставке магазином */
.usa-store-delivered-option{border-color:#D6A300;background:#FFF9E8}
.usa-store-delivered-option input{accent-color:#B47B00}
.usa-store-delivered-date{font-size:11px;font-weight:800;color:#765600;white-space:nowrap}
@media(max-width:650px){.usa-store-delivered-option{flex-wrap:wrap}}


/* Версия 3.2: локальное автоматическое резервное копирование Windows */
.auto-backup-box{margin:14px 0;padding:14px;border:1px solid var(--line,#d9dee7);border-radius:12px;background:var(--surface-soft,#f6f8fb);display:grid;gap:9px}
.auto-backup-box>strong{font-size:14px}
.auto-backup-box .note{margin:0}
.auto-backup-status{font-size:13px;font-weight:750;margin:0;color:var(--muted,#596579)}
.auto-backup-status.ok{color:#187343}
.auto-backup-status.warn{color:#a45b00}
.auto-backup-box button{justify-self:start}


/* Версия 3.3: удаление заказа клиента и статистика архива */
.reserved-customer-delete{min-height:32px;padding:6px 9px;font-size:11px;font-weight:800;white-space:nowrap;background:#fff0ef;border-color:#e5aaa5;color:#9d2923}
.reserved-customer-delete:hover{background:#ffe2df}
.reserved-delete-confirm{display:flex;align-items:center;gap:7px;flex-wrap:wrap;padding:7px 9px;border:1px solid #e5aaa5;border-radius:9px;background:#fff7f6}
.reserved-delete-confirm .delete-question{font-size:11px;font-weight:750;color:#7f2722}
.reserved-delete-confirm .confirm-yes,.reserved-delete-confirm .confirm-no{min-height:30px;padding:5px 8px;font-size:11px}
.stats-year-card{margin:0 0 14px;border:1px solid #c8d5da;border-radius:13px;overflow:hidden;background:#fff}
.stats-year-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;padding:13px 15px;background:#edf3f2;border-bottom:1px solid #c8d5da}
.stats-year-heading strong{font-size:17px;color:#122b35}
.stats-year-total{font-size:12px;font-weight:750;color:#40535c}
.stats-month-row{display:grid;grid-template-columns:minmax(120px,.8fr) minmax(180px,1fr) minmax(180px,1fr);gap:12px;align-items:center;padding:12px 15px;border-bottom:1px solid #e0e7e9}
.stats-month-row:last-child{border-bottom:0}
.stats-month-name{font-weight:800;color:#172e38}
.stats-metric{font-size:12px;color:#40535c;line-height:1.5}
.stats-metric strong{display:block;font-size:13px;color:#122b35}
.stats-explainer{margin:0 0 13px;color:#53636b;font-size:12px}
.stats-empty{padding:24px;text-align:center;color:#596a72;background:#f7faf9;border:1px dashed #c8d5da;border-radius:12px}
.purchased-tools{display:grid;grid-template-columns:minmax(220px,1fr) auto;gap:14px;align-items:end;margin-bottom:16px}
.purchased-search-field{max-width:440px}
.purchased-sort-wrap{display:grid;gap:6px}
.purchased-sort-label{font-size:12px;font-weight:750;color:#40545a}
.purchased-sort{display:flex;gap:6px;flex-wrap:wrap}
.purchased-sort .archive-subtab{min-height:36px;padding:6px 10px}
.purchased-sort .archive-subtab[aria-pressed=true]{background:#fff;border-color:#b9d0d1;color:#075f58;box-shadow:0 1px 2px rgba(20,45,50,.06)}
.purchased-form-grid{display:grid;grid-template-columns:1.1fr 1.3fr .9fr .65fr .9fr;gap:10px;align-items:end}
.purchased-entry .entry-controls{margin-top:12px}
.purchased-person-line{font-size:12px;font-weight:750;color:#40535c}
.purchased-date-card .archive-client-heading{background:#f2f6f6}
.purchased-date-card .archive-client-heading .date{font-size:12px}
@media(max-width:760px){
 .purchased-tools{grid-template-columns:1fr}
 .purchased-search-field{max-width:none}
 .purchased-form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .stats-month-row{grid-template-columns:1fr;gap:5px}
 .stats-year-heading{align-items:flex-start;flex-direction:column}
}
@media(max-width:480px){
 .purchased-form-grid{grid-template-columns:1fr}
 .purchased-sort{display:grid;grid-template-columns:1fr}
 .reserved-delete-confirm{width:100%}
}


/* Версия 3.4: компактная строка заказа, восстановление архива и быстрый ввод покупок */
.top-purchased-button{
 margin-left:clamp(18px,4vw,48px);margin-right:auto;white-space:nowrap;
 min-width:104px;min-height:42px;padding:9px 16px;
 border:1px solid #a9c8c0;border-radius:10px;background:#edf6f3;
 color:#155b50;font-weight:800;
}
.top-purchased-button:hover{background:#e0f0eb;border-color:#7eafa2}
.group-customer{
 display:grid;
 grid-template-columns:minmax(125px,1.05fr) minmax(65px,.45fr) minmax(180px,2fr) auto auto;
 gap:8px;align-items:center;padding:5px 10px;min-height:42px;
}
.group-customer .copy-order-button,
.group-customer .reserved-customer-delete{
 justify-self:end;white-space:nowrap;min-height:28px;height:28px;
 padding:4px 8px;font-size:11px;line-height:1.1;border-radius:7px;
}
.group-customer .copy-order-button{min-width:94px}
.group-customer .reserved-customer-delete{min-width:68px}
.group-customer .reserved-order-note{height:28px;min-height:28px;max-height:28px;padding:4px 8px;line-height:18px}
@media(max-width:850px){
 .group-customer{
  grid-template-columns:minmax(105px,1fr) minmax(55px,.4fr) minmax(135px,1.35fr) auto auto;
  gap:6px;padding:5px 8px;
 }
 .group-customer .copy-order-button,.group-customer .reserved-customer-delete{padding:4px 7px}
}
@media(max-width:650px){
 .top{flex-wrap:wrap}
 .top-purchased-button{margin-left:auto;margin-right:0;min-height:38px;padding:7px 12px}
 .top-actions{width:100%;flex:1 0 100%;flex-direction:row;justify-content:flex-end;align-items:center;flex-wrap:wrap}
 .group-customer{
  display:grid;grid-template-columns:minmax(0,1fr) auto;
  gap:6px 8px;padding:7px 9px;min-height:0;align-items:center;
 }
 .group-customer>.person-heading-value{grid-column:1;grid-row:1}
 .group-customer>.group-meta{grid-column:2;grid-row:1}
 .group-customer>.reserved-order-note{grid-column:1/-1;grid-row:2}
 .group-customer>.copy-order-button{grid-column:1;grid-row:3;justify-self:start}
 .group-customer>.reserved-customer-delete{grid-column:2;grid-row:3;justify-self:end}
}
.purchased-total-summary{
 display:flex;align-items:center;gap:8px 18px;flex-wrap:wrap;
 margin:0 0 14px;padding:12px 14px;border:1px solid #b9d6ce;
 border-radius:11px;background:#eff7f4;color:#183b36;font-size:13px;
}
.purchased-total-summary strong{font-size:16px;color:#125b50}
.purchased-total-summary .summary-note{color:#526761;font-size:12px}
.archive-restore-confirm{display:flex;align-items:center;gap:7px;flex-wrap:wrap;padding:7px 9px;border:1px solid #b9d6ce;border-radius:9px;background:#f1f8f5}
.archive-restore-confirm .delete-question{font-size:11px;font-weight:750;color:#214e43}
.restore-archive{color:#126451;border-color:#a9c8c0;background:#edf6f3;font-weight:750}
.restore-archive:hover{background:#e0f0eb}
.quick-purchased-grid{grid-template-columns:1.05fr 1.25fr .8fr .6fr .95fr}
.quick-purchased-grid .field{min-width:0}
.quick-purchased-grid input{width:100%;min-width:0}
@media(max-width:760px){.quick-purchased-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:480px){.quick-purchased-grid{grid-template-columns:1fr}}
.stats-money{display:block;margin-top:3px;font-size:13px;font-weight:800;color:#126451}
.stats-unpriced{display:block;margin-top:2px;font-size:11px;color:#68777b}


/* AnTix Store 3.5 Cloud: role-aware interface */
body.role-readonly #reservedEntry,
body.role-readonly #orderedEntry,
body.role-readonly #notifyEntry,
body.role-readonly #usaEntry,
body.role-readonly #purchasedForm,
body.role-readonly #purchasedEntry .entry-title,
body.role-readonly #purchasedQuickOpen,
body.role-readonly #separatorBtn,
body.role-readonly .row-actions,
body.role-readonly .reserved-customer-delete,
body.role-readonly .separator-actions,
body.role-readonly .quick-add {display:none!important}
body.role-readonly .inline-price,
body.role-readonly .inline-prepayment,
body.role-readonly .reserved-order-note,
body.role-readonly .usa-inline-input,
body.role-readonly .usa-stage-option input,
body.role-readonly .purchase-toggle {pointer-events:none!important;opacity:.75}
body.role-readonly #importLocal,
body.role-readonly #importBackup,
body.role-readonly #autoBackupTest {display:none!important}
body.role-editor #importBackup {display:none!important}
body:not(.role-admin) #portalOpen{display:none!important}
.role-pill{display:inline-flex;align-items:center;border:1px solid var(--line);border-radius:20px;padding:3px 8px;font-size:11px;font-weight:700;margin-left:6px}

.antix-static-1{white-space:pre-wrap;overflow-wrap:anywhere}
.antix-static-2{position:sticky;bottom:0;z-index:20;margin:12px;padding:12px}

/* 3.6.1: one action strip, with a separate compact synchronization line. */
.top{
 display:grid;
 grid-template-columns:minmax(225px,260px) minmax(0,1fr);
 grid-template-areas:"brand actions" "brand status";
 column-gap:18px;row-gap:7px;
 align-items:center;
 margin-bottom:24px;
}
.top>.brand{grid-area:brand;min-width:0;gap:12px}
.top .brand-copy{min-width:0}
.top .brand h1{font-size:24px;white-space:nowrap;line-height:1.15}
.top .brand p{max-width:225px;font-size:12px;line-height:1.4;overflow-wrap:normal}
.top .brand-logo{
 display:block;width:56px;height:56px;flex:0 0 56px;
 border-radius:14px;background:transparent;padding:0;
 object-fit:contain;
}
.top>.top-actions{
 grid-area:actions;
 display:flex;flex-direction:row;align-items:center;justify-content:flex-end;
 flex-wrap:nowrap;gap:7px;min-width:0;max-width:100%;width:auto;
 overflow-x:auto;overflow-y:hidden;
 scrollbar-width:thin;scrollbar-color:#b5c8cd transparent;
 padding:2px 1px 5px;
}
.top>.top-actions>button{
 flex:0 0 auto;min-height:42px;min-width:0;
 padding:10px 11px;font-size:13px;line-height:1.2;
 white-space:nowrap;overflow-wrap:normal;word-break:normal;
}
.top>.top-actions>.top-purchased-button{margin:0;min-width:0;font-weight:800}
.top>.header-status{
 grid-area:status;
 display:flex;align-items:center;justify-content:flex-end;
 gap:7px;min-width:0;min-height:20px;width:100%;
 padding:6px 1px 0;margin:0;
 border-top:1px solid #d7e2e3;
 font-size:11px;line-height:1.25;color:var(--muted);
}
.top>.header-status .dot{width:6px;height:6px}
.top>.header-status span{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media(max-width:1199px){
 .top{
  grid-template-columns:minmax(0,1fr);
  grid-template-areas:"brand" "actions" "status";
  row-gap:10px;
 }
 .top .brand p{max-width:none}
 .top>.top-actions{justify-content:flex-start;width:100%;max-width:100%}
 .top>.header-status{justify-content:flex-start;padding-top:7px}
}
@media(max-width:650px){
 .top{margin-bottom:16px;row-gap:9px;align-items:center}
 .top .brand h1{font-size:22px}
 .top .brand p{font-size:11px}
 .top .brand-logo{width:48px;height:48px;flex-basis:48px;border-radius:12px}
 .top>.top-actions{gap:6px;padding-bottom:7px;overscroll-behavior-x:contain}
 .top>.top-actions>button{font-size:12px;min-height:40px;padding:9px 11px}
 .top>.header-status{font-size:11px}
}

/* Customer-link administration stays readable with long names and full URLs. */
.portal-admin-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 16px}
.portal-admin-tabs button{white-space:nowrap}
.portal-admin-tabs button[aria-selected=true],.portal-admin-tabs button[aria-pressed=true]{background:var(--light);border-color:#a9c8c0;color:var(--teal)}
.portal-link-list{display:grid;gap:12px;margin-top:12px}
.portal-link-card{border:1px solid var(--line);border-radius:11px;padding:13px;background:#f8fbfa;min-width:0}
.portal-link-card.cloud-box{margin:0}
.portal-link-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;overflow-wrap:anywhere}
.portal-link-meta{display:flex;gap:5px 16px;flex-wrap:wrap;font-size:12px;line-height:1.5;color:var(--muted);margin:8px 0}
.portal-link-url{display:block;width:100%;min-width:0;padding:10px 11px;border:1px solid var(--line);border-radius:8px;background:#fff;font:12px/1.4 ui-monospace,SFMono-Regular,Consolas,monospace;color:var(--ink)}
.portal-link-actions{display:flex;gap:7px;flex-wrap:wrap;margin-top:10px}
.portal-link-actions button,.portal-link-actions a{white-space:nowrap}
.portal-link-open{display:inline-flex;align-items:center;min-height:38px;padding:8px 12px;border:1px solid var(--line);border-radius:9px;background:#fff;color:var(--teal);font-size:13px;font-weight:650;text-decoration:none}
.portal-link-open:hover{background:var(--light)}.portal-link-open:focus-visible{outline:3px solid #79b9b0;outline-offset:2px}
.portal-link-unavailable{padding:10px 12px;border:1px solid #ead6ab;border-radius:8px;background:#fff8e8;color:#765623;font-size:12px;line-height:1.5}
@media(max-width:650px){.portal-link-card{padding:11px}.portal-admin-tabs{gap:6px}.portal-admin-tabs button{font-size:12px}}
