:root{--bg:#f5f7fb;--paper:#fff;--ink:#152033;--muted:#65758b;--line:#dde5ee;--accent:#2563eb;--radius:16px}*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--ink);font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;font-size:15px;line-height:1.52}h1,h2,h3,p{margin-top:0}h1{font-size:clamp(32px,5vw,58px);line-height:1.11;letter-spacing:-.035em}h2{font-size:23px;line-height:1.25;letter-spacing:-.02em}h3{font-size:18px}a{color:var(--accent);text-decoration:none}a:hover{text-decoration:underline}.container{max-width:1150px;padding:0 22px;margin:0 auto}.topbar{min-height:71px;background:#101b2e;color:white;padding:12px max(22px,calc((100vw - 1106px)/2));display:flex;align-items:center;justify-content:space-between;gap:18px}.brand{display:flex;gap:10px;align-items:center;font-size:18px;color:white;font-weight:800;letter-spacing:-.02em}.brand:hover,.link-light:hover{text-decoration:none}.brand-icon{background:#3b82f6;color:white;border-radius:12px;display:grid;place-items:center;font-weight:900;width:38px;height:38px;flex-shrink:0}.brand-muted{color:#9bc5ff}.micro-label{font-size:9px;letter-spacing:.1em;color:#b4c5dd;border:1px solid #55647a;border-radius:5px;padding:3px 5px;margin-left:7px}.top-actions{display:flex;align-items:center;gap:15px}.top-actions form{margin:0}.link-light{color:#e5ecf8;font-weight:600}.logout,.small-button{font:inherit;color:white;background:transparent;border:1px solid #61708a;padding:7px 12px;border-radius:9px;cursor:pointer}.small-button{background:#2563eb;border-color:#2563eb}.admin-nav{display:flex;gap:7px;padding:9px max(22px,calc((100vw - 1106px)/2));overflow:auto;background:white;border-bottom:1px solid var(--line)}.admin-nav a{white-space:nowrap;color:#64748b;font-weight:700;font-size:14px;padding:9px 15px;border-radius:10px}.admin-nav a.current{background:#eaf1ff;color:#1d4ed8}.footer{max-width:1150px;margin:65px auto 0;display:flex;justify-content:space-between;gap:20px;padding:25px 22px 35px;color:#90a0b4;border-top:1px solid var(--line);font-size:12px}.eyebrow{color:#4579d7;font-size:12px;font-weight:900;letter-spacing:.16em;margin-bottom:15px}.muted{color:var(--muted)}.blue-text{color:#3b82f6}.hero{padding-top:96px;padding-bottom:70px}.hero h1{max-width:900px}.hero-copy{font-size:19px;color:#53657e;max-width:720px;line-height:1.7}.hero-actions,.hero-strip{display:flex;align-items:center;flex-wrap:wrap;gap:12px}.hero-actions{margin:30px 0}.hero-strip{color:#65758b;font-size:13px;font-weight:700;gap:24px}.button{display:inline-flex;justify-content:center;align-items:center;gap:10px;border:1px solid var(--line);font:inherit;font-weight:800;border-radius:11px;padding:12px 19px;cursor:pointer;min-height:45px;text-decoration:none!important;transition:filter .15s}.button:hover{filter:brightness(.94)}.button.primary{background:var(--accent);border-color:var(--accent);color:white}.button.secondary{background:white;color:#243653}.button.small{font-size:13px;padding:8px 12px;min-height:37px}.button.full{width:100%}.three-blocks{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}.feature,.panel,.auth-card,.tracking-card{background:white;border:1px solid var(--line);border-radius:var(--radius);box-shadow:0 5px 22px rgba(23,37,59,.035)}.feature{padding:28px}.feature-no{font-size:12px;color:#4579d7;letter-spacing:.08em;font-weight:900;margin-bottom:15px}.feature p{color:#65758b;margin-bottom:0}.auth-wrap{display:grid;grid-template-columns:1fr 1fr;gap:60px;padding-top:74px;align-items:start}.auth-side h1{font-size:45px}.auth-side p{color:var(--muted);font-size:17px;line-height:1.7}.auth-benefits{margin-top:35px;display:grid;gap:18px;color:#53657e;font-weight:700}.auth-card{padding:30px}.auth-card h2{margin-bottom:8px}.auth-card .muted{font-size:13px}.form-grid{display:grid;gap:16px;margin-top:19px}.form-grid.two-cols{grid-template-columns:repeat(2,minmax(0,1fr))}.span-two{grid-column:1/-1}label{display:flex;flex-direction:column;gap:7px;color:#45556d;font-weight:750;font-size:13px}input,select,textarea{width:100%;font:inherit;min-width:0;color:#192943;background:#fff;border:1px solid #cfd9e5;border-radius:9px;padding:11px 12px;outline:none}input:focus,textarea:focus,select:focus{border-color:#3b82f6;box-shadow:0 0 0 3px rgba(59,130,246,.1)}textarea{resize:vertical}.field-prefix{display:flex;border:1px solid #cfd9e5;align-items:center;border-radius:9px}.field-prefix span{padding-left:12px;color:#8392a7}.field-prefix input{border:0;box-shadow:none}.small-center{text-align:center;color:var(--muted);font-size:13px;margin:20px 0 0}.alert,.success{margin:18px 0;background:#fef2f2;border:1px solid #fecaca;border-radius:10px;padding:13px;color:#9f1239}.success{background:#effdf5;border-color:#aee9ca;color:#167346}.narrow-page{max-width:590px;padding-top:70px;min-height:65vh}.dashboard{padding-top:42px}.page-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:28px}.page-heading h1{font-size:36px;margin:0 0 7px}.page-heading p{margin-bottom:0}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin:24px 0}.stat{padding:23px;border:1px solid var(--line);border-radius:14px;background:white}.stat span{display:block;color:var(--muted);font-size:13px}.stat strong{font-size:35px}.panel{padding:25px;margin-bottom:23px}.panel-title{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:14px}.panel-title h2{margin:0}.panel-title a{font-weight:700;font-size:13px}.table-wrap{width:100%;overflow-x:auto}table{border-collapse:collapse;text-align:left;min-width:680px;width:100%}th{font-size:12px;color:#64748b;background:#f8fafc;padding:13px 10px}td{padding:14px 10px;border-top:1px solid #edf1f5;vertical-align:middle;font-size:13px}td small{color:#8b9aab}.status{display:inline-flex;white-space:nowrap;background:#ecf4ff;border-radius:9px;padding:6px 9px;color:#255aa8;font-weight:750;font-size:12px}.st-done{background:#e6f9ec;color:#177f48}.st-cancelled{background:#ffe9eb;color:#a83f48}.st-new{background:#fff5d7;color:#966800}.empty{text-align:center;color:#76859b;padding:27px}.actions-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:15px}.action-card{background:white;border-radius:14px;border:1px solid var(--line);padding:23px;display:flex;flex-direction:column;gap:8px;color:#183251}.action-card:hover{text-decoration:none;border-color:#b2c6f4}.action-card>span{font-size:28px;color:#3b82f6}.action-card small{color:var(--muted)}.info-note{margin-top:18px;color:#60728b;font-size:13px}.color-group{display:flex;align-items:center;gap:10px}.color-group input{width:72px;height:43px;padding:5px}.upload-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.upload-row input{width:auto;max-width:100%}.table-actions{display:flex;gap:13px}.table-actions button{background:none;border:0;color:#cf3341;cursor:pointer;font:inherit;font-size:13px}.table-actions form{margin:0}.order-list{display:grid;gap:18px}.order-card{background:white;border:1px solid var(--line);border-radius:14px;padding:23px}.order-top,.order-bottom{display:flex;justify-content:space-between;align-items:start;gap:14px}.order-top strong{font-size:18px}.order-top p{font-size:12px;margin:3px 0 0}.order-code{margin-left:10px;font-family:monospace;font-size:12px;color:#4c6ea4}.order-details{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:18px 0;padding:14px;background:#f8faff;border-radius:10px}.order-details div{display:flex;flex-direction:column;gap:3px;word-break:break-word}.order-details span{font-size:12px;color:#8b9aab}.order-details strong{font-size:13px}.order-description{white-space:pre-wrap}.order-bottom{align-items:center;border-top:1px solid var(--line);padding-top:15px}.status-form{display:flex;gap:9px}.status-form select{width:auto}.order-bottom>a{font-size:13px}.store-hero{background:linear-gradient(135deg,#122344,#0d182e);color:white}.store-head{padding-top:77px;padding-bottom:75px}.store-head .eyebrow{color:#92baff}.store-identity{display:flex;align-items:center;gap:20px}.store-identity h1{margin-bottom:18px}.store-logo{width:82px;height:82px;object-fit:contain;background:white;padding:9px;border-radius:12px}.store-head>p{max-width:720px;line-height:1.7;font-size:18px;color:#cbd8ef}.store-contact{display:flex;gap:10px;flex-wrap:wrap;margin-top:28px}.store-contact a{border:1px solid #6b83ae;border-radius:10px;padding:9px 15px;color:#edf4ff;font-weight:750}.store-head .hero-strip{color:#b4c6df}.store-content{padding-top:70px;padding-bottom:70px}.section-heading{margin-bottom:23px}.section-heading h2{font-size:32px}.product-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.product-card{background:white;border:1px solid var(--line);border-radius:15px;overflow:hidden}.product-thumb{height:190px;background:#e9eff7;display:grid;place-items:center}.product-thumb img{width:100%;height:100%;object-fit:contain}.placeholder-part{color:#91a4bd;letter-spacing:.2em;font-weight:900;font-size:23px;line-height:1.1;text-align:center}.product-body{padding:20px}.product-body h3{min-height:48px;margin-top:9px}.item-meta{font-size:11px;letter-spacing:.035em;color:#7f8da3}.product-bottom{display:flex;justify-content:space-between;gap:12px;align-items:center;margin:20px 0}.product-bottom strong{font-size:19px}.product-bottom small{font-size:11px;color:#64748b}.quote-section{background:#edf3fb;padding:64px 0}.quote-wrap{display:grid;grid-template-columns:1fr 1.1fr;gap:50px;align-items:start}.quote-wrap>div>h2{font-size:36px}.quote-wrap>div>p{line-height:1.7;color:#6e7d92}.quote-feature{border-top:1px solid #d1dbea;padding:15px 0;color:#4e6785;font-weight:650}.quote-form{margin-top:0;background:white;border-radius:16px;border:1px solid #d6e0ed;padding:25px}.form-notice{font-size:11px;color:#8a9aab;margin:8px 0 0}.tracking-card{padding:30px;margin:25px 0}.track-code{font-size:30px;font-family:monospace;font-weight:900;letter-spacing:.04em;word-break:break-all;margin:7px 0 20px}.tracking-status{display:flex;justify-content:space-between;align-items:center;gap:16px;background:#e9f2ff;border-radius:11px;padding:17px;margin-bottom:17px}.tracking-status strong{font-size:17px;color:var(--accent)}.tracking-card .button{margin-top:20px}@media(max-width:780px){.auth-wrap,.quote-wrap{grid-template-columns:1fr;gap:25px;padding-top:40px}.quote-wrap{padding-top:0}.product-grid{grid-template-columns:repeat(2,1fr)}.three-blocks,.actions-grid{grid-template-columns:1fr}.topbar{padding-left:18px;padding-right:18px}.admin-nav{padding-left:10px;padding-right:10px}.micro-label{display:none}}@media(max-width:560px){.topbar{min-height:60px}.brand{font-size:15px}.link-light{font-size:13px}.page-heading{align-items:start;flex-direction:column}.page-heading h1{font-size:30px}.stats{grid-template-columns:1fr 1fr}.stat:last-child{grid-column:1/-1}.form-grid.two-cols,.product-grid{grid-template-columns:1fr}.span-two{grid-column:auto}.hero{padding-top:65px}.hero-copy{font-size:17px}.auth-card{padding:20px}.panel{padding:18px}.footer{flex-direction:column}.order-top,.order-bottom{flex-direction:column}.order-details{grid-template-columns:1fr 1fr}.status-form{flex-wrap:wrap}.store-head{padding-top:48px;padding-bottom:48px}.store-identity h1{font-size:32px}.store-identity{align-items:start;flex-direction:column}.quote-section{padding:40px 0}.quote-form{padding:18px}}
.brand-categories{display:flex;flex-wrap:wrap;gap:9px;margin-bottom:42px}.brand-categories span{padding:8px 12px;border-radius:50px;background:#eaf0f8;color:#45617f;font-size:12px;font-weight:800}.selected-product{background:#eaf2ff;color:#285999;padding:12px;border-radius:10px;font-size:13px}

/* SaaS v2 owner console */
.owner-stats{grid-template-columns:repeat(4,minmax(0,1fr))}.owner-stats .stat strong{font-size:clamp(18px,2.3vw,30px)}
.owner-email{font-size:12px;color:#bbcae3}.owner-store-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(260px,1.15fr);gap:20px;border-top:1px solid var(--line);padding:19px 0;align-items:center}
.owner-store-details h3{margin:0 0 6px}.owner-store-details h3 small{font-weight:500;color:#94a3b8}.owner-store-details p{margin:6px 0}.owner-store-controls{display:flex;gap:10px;align-items:flex-start;flex-direction:column}.quick-renew{display:flex;gap:6px;flex-wrap:wrap;align-items:center}.quick-renew select{width:120px}.quick-renew input[type=number]{width:110px}.quick-renew input[name=periods]{width:62px}.quick-renew input[name=reference]{width:210px}.quick-renew .button{white-space:nowrap}.license-form{display:flex;gap:14px;align-items:end;flex-wrap:wrap}.license-form label{min-width:180px}.license-new{font-size:20px;display:inline-block;background:white;border:1px dashed #74c39b;padding:12px 15px;margin-top:8px;user-select:all}.text-danger{font:inherit;border:none;background:none;color:#b91c1c;cursor:pointer}.plans-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px}.plan-card{border:1px solid var(--line);border-radius:14px;padding:22px;background:#fff}.plan-price{font-weight:850;font-size:25px;margin-bottom:10px}.fineprint{font-size:12px}.danger{color:#b91c1c}
@media(max-width:900px){.owner-stats,.plans-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.owner-store-row{grid-template-columns:1fr}.owner-email{display:none}}
@media(max-width:560px){.owner-stats,.plans-grid{grid-template-columns:1fr}.owner-store-controls,.quick-renew{width:100%}.quick-renew input[name=reference]{max-width:100%}.license-new{font-size:15px}}

/* AutoParts Cloud v3: manual onboarding and responsive owner controls */
.owner-stats {grid-template-columns:repeat(5,minmax(0,1fr))}
.owner-store-row {overflow-wrap:anywhere}
.steps-v3 {line-height:1.85; padding-left:22px}
.payment-note {white-space:pre-wrap; overflow-wrap:anywhere}
.check-line {display:flex;flex-direction:row;align-items:flex-start;gap:12px;font-weight:500;line-height:1.5}
.check-line input {width:19px;height:19px;flex-shrink:0;margin:1px 0 0}
.honeypot {position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}
.license-new {overflow-wrap:anywhere;max-width:100%}
@media(max-width:980px){.owner-stats{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:680px){.owner-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .owner-store-controls form.form-grid{width:100%}
  .quick-renew{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%}
  .quick-renew input,.quick-renew select,.quick-renew input[type=number],.quick-renew input[name=periods],.quick-renew input[name=reference]{width:100%;max-width:100%}
  .admin-nav a{font-size:13px;padding:9px 11px}
  .topbar .top-actions{gap:7px}
  .topbar .top-actions .link-light{font-size:12px}
}
/* v3 photo requests and seller offers */
.photo-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(100px,1fr));gap:10px;margin:12px 0}
.photo-gallery img{width:100%;height:116px;display:block;object-fit:cover;border:1px solid var(--line);border-radius:10px;background:#f4f6fa}
.conversation{margin:18px 0}.conversation h3{font-size:17px}
.conversation-message{padding:14px;margin:10px 0;background:#f4f7fd;border:1px solid #dfe7f2;border-radius:12px}
.conversation-message.from-seller{background:#eef8f5;border-color:#d1e9e0}
.conversation-title{font-size:12px;font-weight:750;color:#536d88;margin-bottom:7px}
.reply-form{padding:18px;border-radius:12px;border:1px solid #dce5ed;margin:16px 0;background:#f9fbfe}
.reply-form h3{margin:0 0 5px;font-size:18px}
.photo-preview{display:block;font-size:12px;color:#5a718a;margin-top:8px;white-space:pre-wrap}
@media(max-width:560px){.reply-form{padding:13px}.photo-gallery{grid-template-columns:repeat(3,minmax(0,1fr))}.photo-gallery img{height:95px}}
/* v4: inventory and product feedback on mobile */
.feedback-list{display:grid;gap:12px}.feedback-entry{border:1px solid var(--line);border-radius:13px;padding:18px;background:#fff}.feedback-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;flex-wrap:wrap}.feedback-head h2{font-size:19px;margin-bottom:7px}.feedback-text{white-space:pre-wrap;overflow-wrap:anywhere}.feedback-reply{padding:13px 16px;background:#eff7ff;border-radius:10px;margin-top:14px}.feedback-reply p{margin:8px 0 0}.filter-pills{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0 20px}.warehouse-forms{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.warehouse-forms .panel{margin:0}.inline-field{display:flex;align-items:center;gap:8px;min-width:250px}.inline-field input{flex:1}.fineprint{font-size:12px}.owner-stats{grid-template-columns:repeat(3,minmax(0,1fr))}
@media(max-width:700px){.warehouse-forms{grid-template-columns:1fr}.feedback-entry{padding:13px}.stats{grid-template-columns:1fr}.owner-stats{grid-template-columns:1fr 1fr}.admin-nav{gap:2px;padding:8px 9px}.admin-nav a{padding:9px 10px}.actions-grid{grid-template-columns:1fr 1fr}.page-heading{align-items:start;flex-direction:column}}
@media(max-width:420px){.owner-stats,.actions-grid{grid-template-columns:1fr}.feedback-head{flex-direction:column}.inline-field{flex-wrap:wrap}}


/* v4.2: desktop + mobile responsive workspace. No database changes. */
:root{--desktop-rail:248px}
html,body{max-width:100%}
.is-admin .dashboard{min-height:calc(100vh - 260px)}
.is-admin .page-heading{align-items:flex-end}
.is-admin .panel-title{flex-wrap:wrap}
.is-admin .panel-title h2{overflow-wrap:anywhere}
.is-admin .topbar .brand{min-width:0}
.is-admin .topbar .brand>span:nth-child(2){overflow-wrap:anywhere}
.is-admin input,.is-admin select,.is-admin textarea{font-size:16px}
.is-admin button:focus-visible,.is-admin a:focus-visible,.is-admin summary:focus-visible,.is-admin input:focus-visible{outline:3px solid #89baff;outline-offset:2px}
.is-admin button:disabled{opacity:.6;cursor:not-allowed}
.is-admin .stat strong{overflow-wrap:anywhere}
.is-admin .table-wrap{border-radius:12px;scrollbar-width:thin;}
.is-admin .table-wrap table{table-layout:auto}
.is-admin .table-wrap td,.is-admin .table-wrap th{overflow-wrap:anywhere}
.correction-priority{border:2px solid #bbd5fe;background:#f5f9ff}
.correction-priority .eyebrow{margin-bottom:6px}
.correction-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:14px;margin-top:18px}
.correction-item{background:#fff;border:1px solid #cfe0fa;border-radius:13px;padding:18px}
.correction-item h3{margin-bottom:5px}
.correction-item .form-grid{margin-top:12px}
.inventory-table summary{cursor:pointer;color:#1d4ed8;font-weight:750;padding:6px 0}
.inventory-table details[open]{padding:5px 0}
.inventory-table .inline-field{min-width:0;flex-wrap:wrap}
.inventory-table .inline-field input{min-width:90px}
@media(min-width:1280px){
  .is-admin .topbar{position:sticky;top:0;z-index:50;min-height:72px;padding-left:28px;padding-right:28px}
  .is-admin .admin-nav{position:fixed;top:72px;bottom:0;left:0;width:var(--desktop-rail);z-index:20;display:flex;flex-direction:column;align-items:stretch;gap:6px;padding:24px 14px;background:#fff;box-shadow:5px 0 25px rgba(10,30,60,.045);border-right:1px solid var(--line);border-bottom:0;overflow-y:auto;overflow-x:hidden}
  .is-admin .admin-nav:before{content:attr(data-section-label);color:#8494aa;font-size:11px;font-weight:900;letter-spacing:.08em;padding:0 12px 10px}
  .is-admin .admin-nav a{font-size:14px;white-space:normal;padding:11px 13px}
  .is-admin main.container{max-width:1500px;width:calc(100% - var(--desktop-rail));margin-left:var(--desktop-rail);margin-right:0;padding:40px clamp(24px,4vw,70px)}
  .is-admin .footer{max-width:none;margin:28px 0 0 var(--desktop-rail);padding:25px clamp(24px,4vw,70px)}
  .is-admin .stats:not(.owner-stats){grid-template-columns:repeat(3,minmax(0,1fr))}
  .is-admin .owner-stats{grid-template-columns:repeat(3,minmax(0,1fr))}
  .is-admin .warehouse-forms{grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}
  .is-admin .owner-store-row{grid-template-columns:minmax(220px,0.7fr) minmax(400px,1.3fr)}
  .is-admin .quick-renew{display:flex;gap:7px;align-items:center;flex-wrap:wrap}
  .is-admin .panel{padding:30px}
  .is-admin .container.dashboard .page-heading h1{font-size:40px}
}
@media(min-width:761px) and (max-width:1279px){
  .is-admin .admin-nav{position:sticky;top:0;z-index:15;}
  .is-admin .container{max-width:1240px}
}
@media(max-width:760px){
  .is-admin .admin-nav{position:sticky;top:0;z-index:18;overflow-x:auto;scrollbar-width:thin}
  .is-admin .page-heading{align-items:flex-start;flex-direction:column}
  .is-admin .page-heading>.button{width:100%}
  .is-admin .panel{padding:18px}
  .is-admin .inventory-table{overflow:visible}
  .inventory-table table{min-width:0;width:100%;display:block}
  .inventory-table thead{display:none}
  .inventory-table tbody{display:grid;gap:12px}
  .inventory-table tbody tr{display:block;border:1px solid var(--line);background:#fff;border-radius:12px;padding:12px}
  .inventory-table tbody td{display:block;min-width:0;border-top:0;border-bottom:1px solid #e9edf4;padding:10px 4px;font-size:14px;overflow-wrap:anywhere}
  .inventory-table tbody td:last-child{border-bottom:0}
  .inventory-table tbody td::before{content:attr(data-label);display:block;font-weight:800;font-size:11px;color:#667992;letter-spacing:.02em;margin-bottom:4px}
  .inventory-table td[data-label="Изменить"] .inline-field{display:grid;grid-template-columns:minmax(0,1fr) auto;min-width:0;width:100%;gap:8px}
  .inventory-table td[data-label="Изменить"] input{max-width:none!important}
  .inventory-table .inline-field{display:flex;flex-wrap:wrap;gap:7px;width:100%}
  .inventory-table .inline-field input{max-width:100%!important;flex:1 1 90px}
  .inventory-table .inline-field button{flex-shrink:0}
  .inventory-table details summary{padding:11px 12px;background:#edf4ff;border-radius:9px}
  .inventory-table details form{min-width:0!important;width:100%}
  .inventory-table details .button{width:100%}
  .correction-list{grid-template-columns:1fr}
  .correction-item{padding:14px}
  .correction-item .button{width:100%}
}
@media(max-width:480px){
  .is-admin .topbar{gap:8px;padding:10px 12px}
  .is-admin .topbar .brand{gap:6px;font-size:14px}
  .is-admin .topbar .brand-icon{width:33px;height:33px}
  .is-admin .top-actions{flex-shrink:0;gap:6px}
  .is-admin .top-actions .link-light{max-width:94px;line-height:1.2}
  .is-admin .top-actions .logout{padding:7px 8px}
  .is-admin main.container{padding-left:14px;padding-right:14px}
  .is-admin .stats{grid-template-columns:1fr}
  .is-admin .stats .stat{grid-column:auto}
  .is-admin .owner-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .is-admin .owner-stats .stat strong{font-size:23px}
}
/* v5 public marketplace, desktop/tablet/mobile */
.marketplace .market-section{margin:28px 0 45px}
.marketplace .market-section .section-heading{margin-bottom:18px}
.marketplace .market-shops{border:1px solid var(--line,#374151);border-radius:12px;padding:16px;display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px}
.marketplace .market-shops legend{font-weight:700;padding:0 8px}
.marketplace .market-shop,.marketplace .market-consent{display:flex;align-items:flex-start;gap:10px;line-height:1.45;cursor:pointer}
.marketplace .market-shop input,.marketplace .market-consent input{width:18px;height:18px;flex:0 0 auto;margin-top:3px}
.marketplace .market-replies{display:grid;gap:16px}
.marketplace .market-reply .page-heading{margin:0 0 10px}
.marketplace .market-seller-reply{padding:12px 0;border-top:1px solid var(--line,#374151)}
.marketplace .market-reply-photos{display:flex;gap:12px;flex-wrap:wrap;margin-top:10px}
.marketplace .market-reply-photos img{width:100px;height:100px;object-fit:cover;border-radius:9px}
.market-opt-in{margin-top:20px}
.market-opt-in form label{display:flex;align-items:flex-start;gap:12px}
.market-opt-in form label input{width:18px;height:18px;flex:0 0 auto}
@media (max-width:650px){.marketplace .market-shops{grid-template-columns:1fr}.marketplace .market-reply .page-heading{display:block}.marketplace .market-reply .page-heading a{margin-top:12px}}

/* v5.1: multilingual storefront/marketplace language control */
.language-toolbar {display:flex;align-items:center;justify-content:flex-end;padding:8px max(16px,calc((100% - 1180px)/2));background:#17233a;color:#fff;gap:8px}
.language-toolbar form{display:flex;align-items:center;gap:12px}
.language-toolbar label{font-size:13px;color:#e4eaff}
.language-toolbar select{max-width:160px;background:#253450;color:#fff;border:1px solid #53617e;padding:7px 11px;border-radius:9px;font-size:14px}
.market-currency-note {margin:14px 0}
@media (max-width:480px){.language-toolbar{padding:8px 16px}.language-toolbar form{width:100%;justify-content:space-between}}

/* v5.2 - tap-friendly admin navigation and responsive order workbench */
.admin-nav-toggle{display:none;background:#fff;border:1px solid #dbe4f0;border-radius:10px;
  color:#21334d;font:inherit;font-weight:800;cursor:pointer;margin:10px 14px;padding:10px 14px;
  min-height:44px;width:calc(100% - 28px);text-align:left}
.share-actions{display:flex;gap:10px;flex-wrap:wrap;margin:12px 0}
.share-actions .button{min-height:44px}
.price-note{background:#f2f7ff;color:#254568;border:1px solid #cfdff8;border-radius:12px;
 padding:12px 15px;font-size:13px;margin:12px 0}
.action-attention{border:1px solid #c9d9f1;background:#f2f7ff;border-radius:13px;
 padding:16px 20px;display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:18px 0}
.action-attention a{font-weight:800}
.error-panel{max-width:720px;margin:8vh auto; padding:28px}
@media(max-width:760px){
  body.is-admin.has-mobile-nav .admin-nav-toggle{display:block}
  body.is-admin.has-mobile-nav .admin-nav:not([data-expanded="true"]){display:none}
  body.is-admin.has-mobile-nav .admin-nav[data-expanded="true"]{
    display:grid;position:static;grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    gap:5px;max-height:none;overflow:visible;white-space:normal;padding:8px 12px 16px;
    width:100%;box-shadow:none}
  body.is-admin .admin-nav a{white-space:normal;overflow-wrap:anywhere;display:flex;align-items:center;min-height:48px;padding:9px 11px}
  .status-form{display:grid;grid-template-columns:minmax(0,1fr);width:100%}
  .status-form select,.status-form button{width:100%}
  .order-bottom>a,.order-bottom>.share-actions{width:100%}
  .order-card{padding:15px}
  .order-top{flex-wrap:wrap}
  .order-code{display:block;margin:6px 0 0;word-break:break-all}
  .order-details{grid-template-columns:1fr 1fr}
  .share-actions .button{flex:1 1 135px}
  .error-panel{margin:20px 14px}
}

.fx-details {display:block;font-size:.73rem;font-weight:400;line-height:1.4;max-width:100%;overflow-wrap:anywhere;color:var(--muted, #64748b)}
.fx-picker {margin:.5rem 0 1rem}.fx-picker select{max-width:100%;padding:.5rem;border:1px solid #cbd5e1;border-radius:8px}

/* v5.4: catalog table becomes cards only on mobile, desktop table stays intact. */
@media (max-width:760px) {
 .products-table {overflow:visible;max-width:100%;}
 .products-table table{display:block;width:100%;min-width:0!important}
 .products-table thead{display:none}
 .products-table tbody{display:grid;gap:12px}
 .products-table tr{display:block;padding:12px 14px;border:1px solid var(--line,#495263);border-radius:14px;background:var(--card,#222);min-width:0}
 .products-table td{display:block;width:100%;border:0!important;padding:8px 2px;white-space:normal;overflow-wrap:anywhere}
 .products-table td:before{content:attr(data-label);display:block;font-size:12px;font-weight:750;color:var(--muted,#8896ad);margin-bottom:4px}
 .products-table .table-actions{display:flex;flex-wrap:wrap;gap:14px;align-items:center}
 .products-table .table-actions a,.products-table .table-actions button{min-height:44px;display:inline-flex;align-items:center;padding:6px 10px}
 .product-card{max-width:100%;min-width:0}
 .product-bottom{flex-wrap:wrap;gap:10px}
 .marketplace .product-grid,.store-content .product-grid{grid-template-columns:1fr}
}


/* v5.4.1: public navigation fits narrow Android screens without horizontal scroll. */
.public-topbar .public-mobile-menu {display:none}
@media (max-width:760px) {
  .public-topbar {min-width:0; width:100%; padding:10px 16px; gap:10px; justify-content:space-between}
  .public-topbar .brand {min-width:0; gap:10px; font-size:16px; line-height:1.25}
  .public-topbar .brand>span:last-child {overflow-wrap:anywhere}
  .public-topbar .top-actions {display:none}
  .public-topbar .public-mobile-menu {display:block; position:relative; flex:0 0 auto; margin-left:auto; z-index:35}
  .public-topbar .public-mobile-menu>summary {display:flex; align-items:center; justify-content:center;
     min-height:44px; min-width:92px; padding:9px 12px; color:#eef5ff; cursor:pointer;
     border:1px solid #61708a; border-radius:10px; font-size:15px; font-weight:750; list-style:none}
  .public-topbar .public-mobile-menu>summary::-webkit-details-marker {display:none}
  .public-topbar .public-mobile-menu[open]>summary {background:#263b5b}
  .public-topbar .public-mobile-menu nav {position:absolute; top:calc(100% + 9px); right:0;
     display:grid; gap:4px; width:min(290px, calc(100vw - 24px)); padding:8px;
     background:#17233a; border:1px solid #526887; border-radius:13px;
     box-shadow:0 12px 28px rgba(0,0,0,.35)}
  .public-topbar .public-mobile-menu nav a {display:block; padding:12px 14px; min-height:44px;
     border-radius:8px; font-size:15px; font-weight:700; line-height:1.4; color:#f2f6ff}
  .public-topbar .public-mobile-menu nav a:hover,
  .public-topbar .public-mobile-menu nav a:focus-visible {background:#30476b; text-decoration:none}
}
/* v5.4.1: the global form label is column-based; checkbox rows must override it. */
.marketplace .market-shops {min-width:0; max-width:100%;}
.marketplace .market-shops legend {max-width:100%; padding:0 7px; font-size:16px; line-height:1.35;}
.marketplace .market-shop {display:flex; flex-direction:row; align-items:center; gap:12px;
  min-width:0; padding:13px; border:1px solid var(--line,#45556b);
  border-radius:11px; background:rgba(127,148,175,.065); font-size:16px; line-height:1.4;}
.marketplace .market-shop span {min-width:0; overflow-wrap:anywhere; flex:1 1 auto;}
.marketplace .market-shop input[type="checkbox"] {appearance:auto; width:22px; height:22px;
  flex:0 0 22px; margin:0; accent-color:var(--accent,#2563eb); cursor:pointer;}
.marketplace .market-shop:has(input:checked) {background:rgba(44,106,225,.14); border-color:#3b82f6;}
.marketplace .market-consent {flex-direction:row; align-items:flex-start; gap:12px;}
.marketplace .market-consent input[type="checkbox"] {width:22px; height:22px; flex:0 0 22px;
  margin:1px 0 0; accent-color:var(--accent,#2563eb);}
@media (max-width:440px) {
  .marketplace .market-shops {padding:12px; gap:8px;}
  .marketplace .market-shop {padding:12px;}
}

/* AutoParts v5.4.3: accessible four-language quick selector */
.language-toolbar .language-quick-form {
  display:flex; flex-direction:row; align-items:center; justify-content:flex-end;
  width:100%; min-width:0; gap:15px;
}
.language-toolbar .lang-caption {
  display:inline-flex; flex-direction:row; align-items:center; gap:7px;
  color:#e4eaff; font-size:13px; font-weight:750; white-space:nowrap;
}
.language-toolbar .lang-switch {
  display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px;
  width: min(100%,340px); min-width:0;
}
.language-toolbar .lang-switch button {
  appearance:none; background:#253450; border:1px solid #53617e;
  color:#e8f0ff; border-radius:9px; min-width:0; min-height:43px;
  padding:8px 4px; font-size:13px; font-weight:850; font-family:inherit;
  cursor:pointer; white-space:nowrap; transition:background .15s,border-color .15s;
}
.language-toolbar .lang-switch button.is-active {
  color:#fff; border-color:#78a8ff; background:#1555bc;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.12);
}
.language-toolbar .lang-switch button:focus-visible {
  outline:3px solid #93c5fd; outline-offset:2px;
}
@media(max-width:520px) {
  .language-toolbar {padding:10px 14px;}
  .language-toolbar .language-quick-form {flex-direction:column;align-items:stretch;gap:8px;}
  .language-toolbar .lang-switch {width:100%;}
}

/* AutoParts v5.4.4: readable marketplace consent and mobile footer */
/* A label containing text nodes and <b> must not be flex/grid: otherwise
   each text node becomes its own narrow column. Keep normal inline flow. */
.marketplace .form-grid label.market-consent {
  display: block !important;
  position: relative;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0 0 0 38px;
  line-height: 1.55;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  text-align: left;
  cursor: pointer;
}
.marketplace .form-grid label.market-consent > input[type="checkbox"] {
  appearance: auto;
  position: absolute;
  inset: 3px auto auto 0;
  width: 24px;
  height: 24px;
  margin: 0;
  padding: 0;
  accent-color: var(--accent, #2563eb);
  cursor: pointer;
}
.marketplace .form-grid label.market-consent > .market-consent-copy {
  display: inline !important;
  min-width: 0;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
}
.marketplace .form-grid label.market-consent b {display: inline;}
@media (max-width: 650px) {
  .marketplace .market-section:last-child { margin-bottom: 20px; }
  body:not(.is-admin) .footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    max-width: 100%;
    margin: 16px auto 0;
    padding: 20px 16px 28px;
    text-align: center;
    font-size: 12px;
    line-height: 1.55;
  }
  body:not(.is-admin) .footer > span {max-width: 360px;}
}

/* AutoParts v5.4.5: store picker heading on one line */
/* A semantic group instead of the browser-dependent fieldset/legend+grid layout. */
.marketplace .market-shops {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  border-radius: 0;
}
.marketplace .market-shops-title {
  display: block;
  margin: 0 0 12px;
  padding: 0;
  font-weight: 800;
  font-size: 16px;
  line-height: 1.4;
  white-space: nowrap;
  letter-spacing: -0.02em;
}
.marketplace .market-shop-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  min-width: 0;
}
.marketplace .market-shop-list .market-shop {
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 100%;
  min-width: 0;
  margin: 0;
  gap: 12px;
}
.marketplace .market-shop-list .market-shop input[type="checkbox"] {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  margin: 0;
}
.marketplace .market-shop-list .market-shop span {
  min-width: 0;
  flex: 1 1 auto;
}
@media (max-width: 560px) {
  .marketplace .market-shop-list { grid-template-columns: minmax(0, 1fr); }
  .marketplace .market-shops-title { font-size: clamp(12px, 3.8vw, 15px); }
}

/* AutoParts Cloud v5.4.6 helpdesk */
.support-page {max-width:900px;}
.support-page .support-panel {max-width:900px;}
.support-page .support-form {display:grid;grid-template-columns:minmax(0,1fr);gap:16px;}
.support-page .support-form label {min-width:0;max-width:100%;}
.support-page .support-form input:not([type=checkbox]),
.support-page .support-form textarea,.support-page .support-form select {width:100%;min-width:0;max-width:100%;}
.support-page .support-consent {display:flex!important;align-items:flex-start;gap:12px;min-width:0!important;white-space:normal!important;}
.support-page .support-consent input {width:22px;height:22px;flex:0 0 22px;margin-top:3px;}
.support-page .support-consent span {flex:1 1 auto;display:block;min-width:0;white-space:normal;overflow-wrap:break-word;}
.support-page .support-trap {position:absolute!important;left:-10000px!important;top:auto!important;width:1px!important;height:1px!important;overflow:hidden!important;}
.support-list {display:grid;gap:12px;margin-top:16px;}
.support-ticket {display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:16px;border:1px solid #4b5563;border-radius:14px;text-decoration:none;color:inherit;min-width:0;}
.support-ticket span:first-child {flex:1 1 auto;min-width:0;overflow-wrap:anywhere;}
.support-ticket small {display:block;color:#aebbd0;margin-top:8px;line-height:1.4;}
.support-ticket .status {flex:0 0 auto;}
.support-messages {display:grid;gap:12px;margin-top:18px;}
.support-message {min-width:0;white-space:normal;background:rgba(125,149,177,.09);padding:16px;border:1px solid #4a5566;border-radius:14px;}
.support-message.from-support {background:rgba(20,117,79,.17);border-color:#326c5b;}
.support-message-heading {font-size:.85rem;color:#b8c8dc;font-weight:700;}
.support-message p {white-space:pre-wrap;overflow-wrap:anywhere;margin:10px 0 0;line-height:1.55;}
@media(max-width:540px) {
 .support-page .support-ticket {flex-direction:column;align-items:flex-start;}
 .support-page .support-form button {max-width:100%;width:100%;white-space:normal;}
 .support-page .support-panel {padding:16px;}
}


/* AP_MARKET_OFFERS_FIRST_V1 */
.marketplace .market-shops {
    display: block;
}

.marketplace .ap-shop-chooser {
    width: 100%;
}

.marketplace .ap-shop-chooser summary {
    cursor: pointer;
    padding: 14px 16px;
    border-radius: 10px;
    background: #eff5ff;
    color: #1d4ed8;
    font-weight: 800;
    list-style-position: inside;
}

.marketplace .ap-shop-chooser[open] summary {
    margin-bottom: 12px;
}

.marketplace .ap-shop-chooser .market-shop-list {
    max-height: 330px;
    overflow-y: auto;
    overscroll-behavior: contain;
}


/* AP_COMPACT_LIST_V2 */

.marketplace .product-grid {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.marketplace .product-card {
    width: 100%;
    border-radius: 10px;
}

.marketplace .product-card .product-thumb {
    display: none;
}

.marketplace .product-card .product-body {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    grid-template-areas:
        "title price"
        "meta price"
        "store action";
    gap: 3px 12px;
    align-items: center;
    padding: 12px 14px;
}

.marketplace .product-card h3 {
    grid-area: title;
    font-size: 15px;
    min-height: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.marketplace .product-card .item-meta {
    grid-area: meta;
    font-size: 11px;
    letter-spacing: 0;
}

.marketplace .product-card p.muted {
    grid-area: store;
    font-size: 12px;
    margin: 0;
}

.marketplace .product-card .product-bottom {
    grid-area: price;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    margin: 0;
    text-align: right;
}

.marketplace .product-card .product-bottom strong {
    font-size: 17px;
    line-height: 1.3;
}

.marketplace .product-card .product-bottom small {
    display: block;
    font-size: 10px;
}

.marketplace .product-card .fx-details {
    display: none !important;
}

.marketplace .product-card a.button {
    grid-area: action;
    width: auto;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #3b82f6;
    font-size: 12px;
    justify-self: end;
    box-shadow: none;
}

@media(max-width:560px) {
    .marketplace .product-card .product-body {
        padding: 11px 12px;
        gap: 3px 8px;
    }
}

/* AP_PLATFORM_BRAND_V1 */
.ap-brand-emblem {
  display: block;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  object-fit: contain;
  border-radius: 9px;
}

/* AP_MARKET_COMPACT_FIX_V1 */
.marketplace .product-card {
    min-height: 0;
}
.marketplace .product-card .product-body {
    grid-template-columns: minmax(0,1fr) auto;
    grid-template-areas:
        "meta price"
        "title price"
        "description description"
        "store store"
        "compare action";
    align-content: start;
    align-items: start;
    gap: 7px 14px;
}
.marketplace .product-card .ap-product-description {
    grid-area: description;
    min-width: 0;
    margin: 0;
}
.marketplace .product-card .ap-compare-select {
    grid-area: compare;
    justify-self: start;
    align-self: center;
    width: auto;
    margin: 0;
}
.marketplace .product-card .product-body > a.button {
    grid-area: action;
    justify-self: end;
}
