:root{font-family:-apple-system,BlinkMacSystemFont,"PingFang SC",sans-serif;color:#243c35;background:#f5f4ee}*{box-sizing:border-box}body{margin:0}aside{padding:12px 22px;background:#f0e2c5;font-size:12px}nav{position:sticky;top:0;background:#f5f4eef5;padding:12px;display:flex;gap:8px;z-index:2;border-bottom:1px solid #dce1d8}main{max-width:1040px;margin:auto;padding:22px 18px 90px}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:14px}.card{background:white;border:1px solid #e1e5de;border-radius:16px;padding:20px;margin-bottom:14px;overflow-wrap:anywhere}h2{font-size:22px}h3{font-size:16px;line-height:1.6}p,pre{font-size:13px;line-height:1.8}pre{white-space:pre-wrap;font-family:inherit}.muted{color:#6d7b73;font-size:12px}.tag{display:inline-block;background:#f3ead5;color:#80672a;padding:4px 8px;border-radius:20px;font-size:11px}button{border:0;border-radius:10px;background:#244e40;color:white;padding:11px 16px;cursor:pointer;font-size:13px}button.secondary,nav button{background:#e5ebe2;color:#284b3d}input,select,textarea{font:inherit;border:1px solid #cbd4c8;border-radius:8px;padding:11px;max-width:100%;width:100%;margin:5px 0 12px;background:white}label{display:block;font-size:12px;color:#627267}button:disabled{opacity:.4}strong.price{display:block;margin:14px 0;font-size:20px}.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.row>*{flex:1}.row button{flex:initial}dialog{border:0;border-radius:20px;width:min(680px,94vw);max-height:90vh;overflow:auto}dialog::backdrop{background:#16302788}#toast{position:fixed;bottom:20px;left:5%;right:5%;padding:12px;background:#244e40;color:white;border-radius:10px;display:none;z-index:5}.empty{padding:30px;text-align:center}img{max-width:100%;border-radius:12px}.hero-icon{font-size:32px;background:#edf1e8;padding:20px;border-radius:12px;color:#58705c}a{color:#245740}code{font-size:11px} @media(max-width:500px){.grid{grid-template-columns:1fr}main{padding:16px}.card{padding:18px}}
img.zoomed{max-width:none;width:150%;cursor:zoom-out}img{cursor:zoom-in}
/* Customer catalog: two readable cards per row on phones. */
@media(max-width:600px){
 .grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;align-items:stretch}
 .grid>.card{min-width:0;margin:0;padding:12px 10px;border-radius:12px;display:flex;flex-direction:column}
 .grid h3{font-size:14px;line-height:1.45;margin:10px 0 6px;overflow-wrap:anywhere}
 .grid .muted{font-size:11px;line-height:1.5;margin:0 0 6px;overflow-wrap:anywhere}
 .grid .price{font-size:17px;margin:8px 0 12px}
 .grid .hero-icon{padding:0;height:52px;min-height:52px;border-radius:8px}
 .grid img{width:100%;height:120px;object-fit:contain;border-radius:8px}
 .grid .row{margin-top:auto;display:grid;grid-template-columns:minmax(0,1fr);gap:7px}
 .grid .row button{width:100%;min-width:0;min-height:44px;padding:9px 5px;font-size:12px;line-height:1.4;white-space:normal}
}
/* Persistent SKU selection, including touch and keyboard users. */
#detail button[aria-pressed]{border:2px solid transparent;margin:3px 4px 3px 0;max-width:100%;white-space:normal;overflow-wrap:anywhere;min-height:44px}
#detail button[aria-pressed="true"]{background:#244e40;color:#fff;border-color:#133d2e;font-weight:700;box-shadow:0 0 0 2px #d9e8dd}
#detail button[aria-pressed="true"]::before{content:"✓ ";font-weight:700}
#detail button[aria-pressed="false"]{border-color:#cbd4c8}
#detail button[aria-pressed]:focus-visible{outline:3px solid #b16b18;outline-offset:3px}
#detail button[data-unavailable="true"]{border-style:dashed}
.quantity-control{width:100%;max-width:240px;margin:10px 0}
.quantity-label{display:block;font-size:13px;font-weight:600;margin-bottom:6px}
.quantity-stepper{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;gap:4px;align-items:center;width:100%}
.quantity-stepper button{min-width:0;min-height:44px;padding:6px;font-size:20px}
.quantity-stepper input{min-width:0;width:100%;height:44px;margin:0;padding:4px;text-align:center;font-size:16px;-moz-appearance:textfield}
.quantity-stepper input::-webkit-inner-spin-button,.quantity-stepper input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
.quantity-error{color:#a33428;font-size:11px;margin:4px 0;line-height:1.4}
.quantity-error:empty{display:none}
.quantity-total{font-weight:600;margin:6px 0 10px}
.purchase-controls>button{min-height:44px;max-width:100%;white-space:normal}
.grid .purchase-controls{margin-top:8px;width:100%}
.grid .purchase-controls>button{width:100%;padding:9px 5px;font-size:12px}
/* Customer-only ivory and rose palette; local management keeps its existing theme. */
body[data-role="customer"]{background:#fdfbf9;color:#40383b;min-height:100vh;--rose:#914f64;--rose-dark:#733b4e;--rose-light:#f8edf0;--line:#ecE3e5}
body[data-role="customer"] nav{background:#ffffffed;border-bottom:1px solid var(--line);gap:8px;backdrop-filter:blur(12px)}
body[data-role="customer"] nav button{background:#f7f2f3;color:#684b55;border:1px solid #eee4e7;min-height:44px}
body[data-role="customer"] aside{background:#faf1ed;color:#78584c;border-bottom:1px solid #f1e5e0}
body[data-role="customer"] .card{background:#fff;border-color:var(--line);border-radius:18px;box-shadow:0 3px 14px #70425208}
body[data-role="customer"] h2,body[data-role="customer"] h3{color:#46393e}
body[data-role="customer"] .muted,body[data-role="customer"] label{color:#786970}
body[data-role="customer"] button{background:var(--rose);color:#fff;border-radius:12px;transition:background-color .12s,border-color .12s}
body[data-role="customer"] button.secondary{background:var(--rose-light);color:#754657}
body[data-role="customer"] button:disabled{opacity:1;background:#f1edef;color:#8c7c82;cursor:not-allowed}
body[data-role="customer"] input,body[data-role="customer"] select,body[data-role="customer"] textarea{border-color:#e3d7dc;border-radius:11px;background:#fff;color:#40383b}
body[data-role="customer"] input:focus-visible,body[data-role="customer"] select:focus-visible,body[data-role="customer"] textarea:focus-visible,body[data-role="customer"] button:focus-visible{outline:2px solid var(--rose);outline-offset:3px}
body[data-role="customer"] .price,body[data-role="customer"] .quantity-total{color:#85465b}
body[data-role="customer"] .hero-icon{background:linear-gradient(135deg,#fcf8f6,#f6edef);color:#8b6875}
body[data-role="customer"] .tag{background:#f8edf0;color:#754657}
body[data-role="customer"] dialog{background:#fffdfc;color:#40383b;border:1px solid var(--line);box-shadow:0 18px 60px #51313b26;border-radius:22px}
body[data-role="customer"] dialog::backdrop{background:#382b3459;backdrop-filter:blur(3px)}
body[data-role="customer"] #detail button[aria-pressed="true"]{background:var(--rose);color:#fff;border-color:var(--rose-dark);box-shadow:0 0 0 2px #f2dde5}
body[data-role="customer"] #detail button[aria-pressed="false"]{border-color:#e8d8df;background:#fbf5f7;color:#754657}
body[data-role="customer"] #detail button[aria-pressed]:focus-visible{outline:3px solid var(--rose-dark)}
body[data-role="customer"] .quantity-stepper button{background:#f8edf0;color:#754657;border:1px solid #eddee4}
body[data-role="customer"] .quantity-stepper button:disabled{background:#f7f4f5;color:#a7999e;border-color:#eee8ea}
body[data-role="customer"] #toast{background:var(--rose-dark);box-shadow:0 6px 24px #733b4e20}
body[data-role="customer"] a{color:var(--rose-dark)}
@media(max-width:600px){body[data-role="customer"] .grid>.card{border-radius:15px}body[data-role="customer"] .grid .hero-icon{border-radius:10px}}
@media(prefers-reduced-motion:reduce){body[data-role="customer"] button{transition:none}}
.instruction-copy{border-top:1px solid #eee4e7;margin-top:18px;padding-top:12px}
.instruction-copy button{min-height:44px;max-width:100%;white-space:normal}
.instruction-copy textarea{font-size:16px;line-height:1.6;resize:vertical}

.quick-picks{margin:10px 0 18px}.quick-picks h3{font-size:14px;margin:0 0 8px}.quick-pick-buttons{display:flex;flex-wrap:wrap;gap:8px}.quick-pick-buttons button{min-height:44px;margin:0;padding:9px 14px}.quick-pick-buttons button[aria-pressed="true"]{background:#914f64;color:white;border-color:#914f64}

.grid img{width:100%;height:160px;object-fit:contain}#detailbody img{display:block;width:100%;height:auto;object-fit:contain}#detailbody img.zoomed{width:150%;max-width:none}@media(max-width:600px){.grid img{height:120px}}
/* Portrait product originals: use their full card width without cropping labels. */
body[data-role="customer"] .grid img{display:block;width:100%;height:auto;aspect-ratio:3/4;object-fit:contain;object-position:center;margin:0;background:#fff}

.brand-bar{display:none}body[data-role="customer"] .brand-bar{display:flex;align-items:center;gap:9px;padding:8px 16px;color:#754354;font-size:15px}.brand-avatar{position:relative;width:36px;height:36px;overflow:hidden;border-radius:50%;flex:none}.brand-avatar img{position:absolute;width:111.8644%;max-width:none;height:auto;left:-5.9322%;top:-7.7966%;border-radius:0;cursor:default}

body[data-role="customer"] #close{display:block;width:100%;min-height:48px;margin:0 0 14px;box-sizing:border-box}

#detailbody .spec-gallery{display:flex;gap:10px;max-width:100%;min-width:0;overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;align-items:flex-start;padding:4px 0 10px;margin:8px 0 12px}
#detailbody .spec-gallery img{display:block;flex:0 0 144px;width:144px;height:180px;max-width:none;object-fit:contain;border:1px solid #eee4e7;border-radius:10px;cursor:zoom-in;background:white}
#detailbody .spec-gallery img.zoomed{flex-basis:260px;width:260px;height:auto;max-height:360px;object-fit:contain;cursor:zoom-out}
#detailbody .spec-gallery img:focus-visible{outline:2px solid #914f64;outline-offset:-2px}

body[data-role="customer"] .top-row{position:sticky;top:0;z-index:2;display:flex;align-items:center;gap:8px;padding:6px 12px;background:#fdfbf9;border-bottom:1px solid #eee4e7;max-width:100%}
body[data-role="customer"] .top-row .brand-bar{padding:0;flex:none;white-space:nowrap;gap:6px;font-size:14px}
body[data-role="customer"] .top-row nav{position:static;min-width:0;flex:1;display:flex;flex-wrap:nowrap;overflow-x:auto;padding:0;gap:6px;border:0;background:transparent}
body[data-role="customer"] .top-row nav button{flex:none;white-space:nowrap;min-height:44px;padding:8px 10px}
@media(max-width:600px){body[data-role="customer"] .top-row{padding:5px 8px;gap:6px}body[data-role="customer"] .top-row .brand-avatar{width:26px;height:26px}body[data-role="customer"] .top-row .brand-bar{font-size:12px;gap:4px}body[data-role="customer"] .top-row nav{gap:4px}body[data-role="customer"] .top-row nav button{font-size:12px;padding:8px 6px}}
.quick-pick-buttons{flex-wrap:nowrap;overflow-x:auto;max-width:100%;min-width:0;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;padding-bottom:7px;scrollbar-width:thin;scrollbar-color:#c99aaa #f7eef1}.quick-pick-buttons button{flex:0 0 auto;white-space:nowrap}.quick-picks{min-width:0;max-width:100%}
body[data-role="customer"] .top-row .brand-bar{font-size:18px}body[data-role="customer"] .brand-bar strong{font-weight:600}@media(max-width:600px){body[data-role="customer"] .top-row .brand-bar{font-size:15px}}

/* Compact, keyboard-focusable full specification text. */
.card{min-width:0}.card .spec-summary{white-space:nowrap;overflow-x:auto;max-width:100%;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;padding-bottom:4px}
.catalog-toolbar{display:flex;align-items:center;gap:8px;min-width:0;width:100%;margin-bottom:12px}.catalog-toolbar>label{flex:0 0 112px;min-width:0;margin:0;font-size:12px}.catalog-toolbar input{width:100%;min-width:0;box-sizing:border-box}.catalog-toolbar .quick-picks{flex:1;min-width:0;margin:0;overflow-x:auto}.catalog-toolbar .quick-pick-buttons{display:flex;flex-wrap:nowrap;gap:2px;min-width:max-content}.catalog-toolbar .quick-pick-buttons button{flex:none;background:transparent;border:0;border-radius:0;box-shadow:none;color:#28684f;padding:10px 8px;min-height:44px;white-space:nowrap}.catalog-toolbar .quick-pick-buttons button[aria-pressed=true]{text-decoration:underline;font-weight:700}textarea{display:block;width:100%;box-sizing:border-box;padding:10px;font:inherit}pre{white-space:pre-wrap;overflow-wrap:anywhere}@media(min-width:700px){.catalog-toolbar>label{flex-basis:220px}}
body[data-role="customer"] .catalog-toolbar .quick-pick-buttons button.secondary{background:transparent;color:#754354;border:0;box-shadow:none}body[data-role="customer"] .catalog-toolbar .quick-pick-buttons button.secondary[aria-pressed="true"]{background:transparent;color:#914f64;text-decoration:underline}
.wish-line-summary{display:flex;align-items:flex-start;gap:12px;min-width:0}.wish-line-text{flex:1;min-width:0;overflow-wrap:anywhere}.wish-line-text h3{margin-top:0}.wish-line .wish-line-image{flex:0 0 88px;width:88px;height:112px;object-fit:contain;border-radius:8px;background:#fff}.wish-line .qty-control{max-width:100%}@media(max-width:350px){.wish-line .wish-line-image{flex-basis:68px;width:68px;height:92px}.wish-line-summary{gap:8px}}
#toast{inset:max(12px,env(safe-area-inset-top)) 16px auto 16px;margin:0 auto;width:fit-content;max-width:calc(100vw - 32px);height:auto;border:0;pointer-events:none;text-align:center;overflow-wrap:anywhere;font-size:14px;line-height:1.5}#toast::backdrop{background:transparent;pointer-events:none}
.pet-inline{display:flex;align-items:flex-end;gap:4px;min-width:0;margin-top:12px;flex-wrap:wrap}.pet-inline>label:first-child{flex:1 1 60px;min-width:55px;max-width:180px}.pet-inline>label{flex:0 0 62px;margin:0;font-size:11px}.pet-inline input{margin:3px 0 0;padding:6px;min-width:0;min-height:40px}.pet-species{display:flex;gap:2px}.pet-inline button{padding:8px 6px;min-height:40px;white-space:nowrap}.pet-species button{min-width:30px}body[data-role="customer"] .pet-species button[aria-pressed="true"]{background:#914f64;color:white}.pet-inline>button:last-child:not(:first-child){flex:none}
.instruction-row{display:flex;align-items:center;gap:10px;min-width:0;margin:8px 0}.instruction-row h3{flex:1;min-width:0;overflow-wrap:anywhere;margin:0}.instruction-row button{flex:none;min-height:44px;white-space:nowrap}
.wish-line-actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:8px}.wish-line-actions button{min-height:44px}.wish-line-actions button:first-child{background:#f1eeeb;color:#695850}

.record-item-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:6px;align-items:center;font-size:12px;margin:10px 0}.record-item-row>span:not(.record-item-name){white-space:nowrap}.record-item-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}.wish-line-summary .record-item-row{font-size:11px;gap:4px}

.communication-confirm{max-width:100%;white-space:normal;overflow-wrap:anywhere;line-height:1.5;min-height:44px;height:auto}

.instruction-layout{display:flow-root;min-width:0}.instruction-product-image{float:right;width:104px;max-width:32%;height:130px;object-fit:contain;margin:0 0 12px 14px;background:#fff}.instruction-content{overflow-wrap:anywhere}.instruction-content pre{white-space:pre-wrap;overflow-wrap:anywhere}@media(max-width:380px){.instruction-product-image{width:76px;height:104px;margin-left:10px}}

.record-instruction-divider{border:0;border-top:1px solid #e8e3e5;margin:18px 0;width:100%}
.publication-variant{display:flex;align-items:center;justify-content:space-between;gap:12px;border-top:1px solid #eee;padding:12px 0;margin-top:12px}.publication-variant>div{min-width:0;overflow-wrap:anywhere}.publication-variant button{flex-shrink:0;min-height:44px}.publication-card>.tag{display:block;width:fit-content}body[data-role="owner"] nav{flex-wrap:wrap}

.price-search-results{max-height:320px;overflow:auto}.price-search-results button{display:block;width:100%;text-align:left;margin:6px 0;white-space:normal;overflow-wrap:anywhere}

.order-spec-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:8px 0 16px}.refund-dialog{max-width:520px;width:calc(100% - 48px);box-sizing:border-box}.refund-dialog button{margin:8px 8px 0 0}

/* Keep the shared detail/usage return row visible within the dialog scroller. */
#detail{padding:0;max-height:90vh;max-height:90dvh;scroll-padding-top:calc(82px + env(safe-area-inset-top,0px));overscroll-behavior:contain}
#detail .detail-returnbar{position:sticky;top:0;z-index:3;padding:max(16px,env(safe-area-inset-top,0px)) max(16px,env(safe-area-inset-right,0px)) 12px max(16px,env(safe-area-inset-left,0px));background:inherit;border-bottom:1px solid #e8e3e5}
#detail #close{display:block;width:100%;min-height:48px;margin:0}
#detailbody{padding:0 max(16px,env(safe-area-inset-right,0px)) max(16px,env(safe-area-inset-bottom,0px)) max(16px,env(safe-area-inset-left,0px))}
body:has(#detail[open]) #toast{inset:auto 16px max(16px,env(safe-area-inset-bottom,0px)) 16px}
.admin-checkbox{display:flex;align-items:center;gap:10px;margin:12px 0}.admin-checkbox input{width:20px;height:20px;margin:0}.admin-variant{border:1px solid #dce1d8;border-radius:12px;margin:16px 0;padding:16px}.admin-gallery{display:flex;gap:10px;overflow:auto}.admin-gallery img{width:100px;height:120px;object-fit:contain}.admin-preview pre{overflow-wrap:anywhere}#app details{margin:12px 0}#app summary{cursor:pointer;padding:10px;background:#e5ebe2;border-radius:8px}

.order-undo{display:flex;gap:12px;align-items:center;flex-wrap:wrap;padding:14px;margin:12px 0;background:#e5ebe2;border-radius:10px}
