/* style.css */
:root{font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-synthesis:none}
*{box-sizing:border-box}html{scroll-behavior:smooth;scroll-padding-top:24px}body{margin:0;font-size:14px;line-height:1.5}[hidden]{display:none!important}button,input,select,textarea{font:inherit}button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.45}button:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid var(--color-border);outline-offset:4px}input:focus,select:focus,textarea:focus{outline:2px solid var(--color-border);outline-offset:1px}.app-shell{max-width:1192px;margin:auto;padding:0 32px}.topbar{min-height:100px;display:flex;align-items:center;justify-content:space-between;gap:18px;border-bottom:1px solid var(--line)}.brand-logo{display:block;flex:none;width:200px}.brand-logo img{display:block;width:100%;height:auto}.topbar-right{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px}.page-heading{padding:34px 0 28px;display:flex;align-items:center;justify-content:space-between;gap:20px}.page-heading h1{font-size:28px;font-weight:650;letter-spacing:-1px;line-height:1.2;margin:0}.page-heading p{margin:8px 0 0;font-size:13px}.page-heading .app-status{font-size:11px;max-width:260px;text-align:right}.workspace{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(330px,1fr);gap:22px;align-items:start}.main-column{display:grid;gap:20px}.card{padding:26px;border:1px solid var(--line);border-radius:14px}.section-heading{display:flex;justify-content:space-between;gap:12px;align-items:start;margin-bottom:22px}.eyebrow{margin:0 0 8px;font-size:10px;font-weight:600;letter-spacing:1.1px}.section-heading h2{font-size:20px;line-height:1.25;letter-spacing:-.45px;margin:0;font-weight:650}.section-heading p:not(.eyebrow){font-size:12px;margin:8px 0 0}.field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 16px}.full{grid-column:1/-1}label{display:block;font-size:12px;font-weight:550;line-height:1.4}.optional{font-size:10px;font-weight:400;margin-left:3px}input,select,textarea{display:block;width:100%;min-width:0;min-height:44px;border:1px solid var(--color-border);border-radius:7px;margin-top:8px;padding:10px 11px;font-size:13px;font-weight:400}select{padding-right:25px}input::placeholder,textarea::placeholder{opacity:1}textarea{min-height:82px;resize:vertical}input[type=number]{appearance:textfield;-moz-appearance:textfield}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.button{display:inline-flex;align-items:center;justify-content:space-between;gap:10px;min-height:44px;border:1px solid var(--color-border);border-radius:8px;padding:11px 15px;font-size:12px;font-weight:600;text-decoration:none}.button.compact{min-height:36px;font-size:11px;padding:8px 12px}.text-button{display:inline-flex;align-items:center;gap:6px;padding:7px 0;border:0;font-size:11px;text-decoration:underline;text-underline-offset:3px}.status-dot{height:6px;width:6px;flex:none;border-radius:50%}details{border-top:1px solid var(--line);margin-top:20px;padding-top:15px}summary{cursor:pointer;position:relative;list-style:none;padding-right:24px;font-size:12px;font-weight:550}summary::-webkit-details-marker{display:none}summary:after{content:'+';position:absolute;right:1px;top:-2px;font-size:18px;font-weight:400}details[open]>summary:after{content:'−'}.details-grid,.inspection-grid{margin-top:20px}.detail-caption{font-size:10px;float:right;margin-right:4px;font-weight:400}.microcopy{font-size:11px;line-height:1.65;margin:10px 0 0}.search-summary{display:flex;align-items:center;gap:12px;border:1px solid var(--line);border-radius:8px;padding:14px;margin-bottom:14px}.search-summary small{display:block;font-size:9px;letter-spacing:1px;margin-bottom:4px}.search-summary strong{display:block;font-size:13px;font-weight:500;overflow-wrap:anywhere}.search-symbol{font-size:24px}.search-button{width:100%;min-height:46px}.search-button span:last-child{font-size:18px;font-weight:400}.search-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-top:7px}.free-label{font-size:10px}.manual-links{margin-top:7px}.manual-links a{display:inline-block;font-size:11px;text-underline-offset:3px;padding:4px 0}.search-status{display:flex;align-items:start;gap:7px;font-size:11px;margin-top:13px;line-height:1.6}.status-indicator{width:5px;height:5px;flex:none;border-radius:50%;margin-top:6px}.search-status.loading .status-indicator{animation:pulse 1s infinite}.search-results{display:grid;gap:12px;margin-top:18px}.search-results:empty{margin:0}.listing{border:1px solid var(--line);border-radius:9px;padding:17px}.listing-header{display:flex;justify-content:space-between;align-items:center;gap:8px}.listing-rank{font-size:9px;letter-spacing:.5px;font-weight:650}.listing-source{font-size:9px}.listing-title{font-size:13px;font-weight:550;line-height:1.5;margin:12px 0 7px;overflow-wrap:anywhere}.listing-price{font-size:27px;font-weight:650;letter-spacing:-1px;margin:0}.listing-condition{font-size:10px;margin:6px 0 14px}.listing-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}.listing-actions .button{justify-content:center;font-size:11px;min-height:37px;padding:8px}.listing details{margin-top:13px;padding-top:12px}.listing summary{font-size:11px}.listing details p{font-size:11px;overflow-wrap:anywhere}.search-help p,.formula p{font-size:11px;line-height:1.7}.private-badge{border:1px solid var(--line);font-size:8px;letter-spacing:.5px;white-space:nowrap;padding:4px 6px;border-radius:4px}.money-input{position:relative}.money-input>span{position:absolute;left:12px;top:50%;transform:translateY(-50%);font-size:13px;font-weight:400}.money-input input{padding-left:29px}.money-input.large input{font-size:17px;font-weight:600;min-height:48px}.money-input.large input::placeholder{font-size:11px;font-weight:400}.pricing-grid{margin-top:22px}.pricing-grid label{font-size:11px}.quote-card{margin-top:20px;border-radius:14px;padding:26px}.quote-top{display:flex;justify-content:space-between;align-items:center;gap:12px}.quote-top .eyebrow{font-size:9px;letter-spacing:1px;margin:0}.quote-top>span{font-size:8px;border:1px solid var(--color-border);padding:3px 6px;border-radius:4px}.quote-caption{font-size:12px;margin:26px 0 5px}.credit-amount{font-size:42px;line-height:1.25;font-weight:550;letter-spacing:-1.5px;overflow-wrap:anywhere;margin-bottom:20px}.topup-row{display:flex;justify-content:space-between;align-items:center;gap:16px;border-top:1px solid var(--color-border);border-bottom:1px solid var(--color-border);padding:16px 0}.topup-row>span{font-size:12px}.topup-row strong{font-size:23px;font-weight:600;letter-spacing:-.5px;text-align:right;overflow-wrap:anywhere}.quote-message{font-size:11px;margin:13px 0 0;line-height:1.6}.profit-details{display:grid;gap:10px;margin:23px 0}.profit-details>div{display:flex;justify-content:space-between;gap:10px;font-size:11px}.profit-details strong{font-size:11px;font-weight:500;text-align:right}.profit-details .combined{border-top:1px solid var(--color-border);padding-top:12px;margin-top:2px}.profit-details .combined strong{font-weight:650}.quote-button{width:100%;font-size:12px}.print-button{width:100%;justify-content:center;font-size:11px;min-height:37px;margin-top:5px}.quote-footnote{font-size:10px;line-height:1.6;text-align:center;margin:6px 0 0}.save-row{display:flex;justify-content:space-between;align-items:center;gap:12px;font-size:10px;padding:15px 3px}.save-row button{border:0;font-size:10px;text-decoration:underline;text-underline-offset:3px;padding:6px 0}footer{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:32px;padding:22px 0;border-top:1px solid var(--line);font-size:11px}footer span:first-child{font-size:9px;letter-spacing:1.2px;font-weight:600}dialog{border:1px solid var(--line);border-radius:14px;padding:26px;max-width:480px;width:calc(100% - 32px);max-height:calc(100% - 40px);overflow:auto}.dialog-heading{display:flex;justify-content:space-between;align-items:start;gap:14px}.dialog-heading h2,dialog h2{font-size:21px;font-weight:650;letter-spacing:-.4px;margin:0 0 20px}.dialog-heading .eyebrow{font-size:9px;margin-bottom:7px}.close-button{border:0;border-radius:6px;width:30px;height:30px;flex:none;font-size:22px;line-height:1}dialog>p{font-size:12px;line-height:1.7}.connection-note{border:1px solid var(--line);border-radius:8px;padding:15px;margin:18px 0;font-size:12px}.connection-note p{margin:7px 0 0;line-height:1.7}dialog>.primary{width:100%;justify-content:center;margin-top:17px}.helper-steps{font-size:12px;line-height:1.7;padding-left:22px}.helper-steps li{margin:10px 0}.helper-steps code{font-size:11px;overflow-wrap:anywhere}.dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:24px}.dialog-actions .primary{justify-content:center}.install-steps dt{font-size:12px;font-weight:600;margin-top:20px}.install-steps dd{margin:5px 0 0;font-size:12px;line-height:1.7}#installOfflineNote{padding:13px;border-radius:8px;font-size:11px}#copyText{min-height:290px;font-size:12px;line-height:1.7}.toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);max-width:calc(100% - 32px);font-size:12px;border-radius:9px;padding:13px 18px;z-index:100}.print-quote{display:none}
@keyframes pulse{50%{opacity:.25}}
@media(min-width:1000px){.quote-column{align-self:stretch}.quote-sticky{position:sticky;top:24px}}
@media(max-width:900px){.app-shell{padding:0 24px}.workspace{gap:18px;grid-template-columns:minmax(0,1.2fr) minmax(305px,1fr)}.card,.quote-card{padding:22px}.field-grid{gap:17px 12px}.detail-caption{display:none}}
@media(max-width:760px){.app-shell{max-width:650px;padding:0 18px}.topbar{min-height:88px}.brand-logo{width:177px}.page-heading{padding:26px 0;display:block}.page-heading h1{font-size:26px}.page-heading .app-status{max-width:none;text-align:left;font-size:10px;margin-top:12px}.workspace{display:block}.main-column{gap:16px}.quote-column{margin-top:16px}.quote-sticky{position:static}input,select,textarea{font-size:16px}input::placeholder,textarea::placeholder{font-size:12px}.quote-card{padding:26px}.button.compact{font-size:10px;padding:7px 10px}.credit-amount{font-size:44px}.money-input.large input{font-size:19px}.app-shell{padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}}
@media(max-width:430px){.app-shell{padding-left:12px;padding-right:12px}.topbar{min-height:78px}.brand-logo{width:158px}.topbar-right{gap:5px}.button.compact{font-size:10px;padding:6px 8px}.card{padding:22px 18px}.section-heading h2{font-size:19px}.field-grid{gap:17px 10px}.optional{font-size:9px;margin-left:1px}.pricing-grid label{font-size:11px}.search-toolbar{gap:0 10px}.free-label{font-size:10px}.topup-row strong{font-size:22px}.quote-card{padding:24px 20px}footer{font-size:10px}.listing-source{font-size:8px}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}.button,.close-button{transform:none!important}*,*:before,*:after{animation:none!important;transition:none!important}}
@media print{body{font-family:Arial,sans-serif}.app-shell,dialog,.toast{display:none!important}.print-quote{display:block!important;max-width:720px;margin:0 auto;padding:30px}.print-quote h1{font-size:27px;letter-spacing:2px;margin-bottom:3px}.print-quote .brand-logo{width:210px;margin-bottom:20px}.print-quote .print-subtitle{font-size:13px}.print-quote h2{font-size:21px;margin:35px 0 22px}.print-quote dl{margin:0}.print-quote .print-row{display:flex;justify-content:space-between;gap:25px;border-bottom:1px solid var(--color-border);padding:14px 0;font-size:14px}.print-quote dd{margin:0;text-align:right;max-width:60%;font-weight:600}.print-quote .print-note{font-size:12px;margin-top:28px;line-height:1.8}.print-quote .print-total{font-size:18px}}

/* Model-specific factory options */
.spec-note{font-size:12px;line-height:1.55;margin-top:-6px}.spec-note details{margin-top:4px}.spec-note summary{font-size:12px;cursor:pointer;width:fit-content}.spec-note details p{margin:8px 0}.spec-note a{text-underline-offset:3px;margin-right:10px}.search-caption{text-align:center;margin:10px 0 14px}.search-button{text-decoration:none}select:disabled{cursor:not-allowed}
.market-actions{display:flex;align-items:center;flex-wrap:wrap;gap:8px 18px;margin-top:18px}.market-actions .button{justify-content:center}.reference-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:24px}.reference-heading h3{font-size:14px;font-weight:600;margin:0}.empty-results{padding:16px;border:1px dashed var(--line);border-radius:8px;font-size:12px;line-height:1.6;margin:0}.import-error{font-size:12px;line-height:1.6}#marketImportDialog{width:min(600px,calc(100% - 24px))}#marketImportText{min-height:220px;font-size:13px;line-height:1.6}

/* Shared interaction feedback, including dynamically added listing actions. */
:where(button, a, select, summary, input, textarea) {
  transition: background-color 160ms ease, border-color 160ms ease,
    box-shadow 160ms ease, color 160ms ease, opacity 160ms ease,
    transform 160ms ease;
}
select:not(:disabled) { cursor: pointer; }
summary { border-radius: 4px; }
@media (hover: hover) and (pointer: fine) {
  .button:where(:not(:disabled):not([aria-disabled="true"])):hover {
    transform: translateY(-1px);
  }
  .text-button:not(:disabled):hover,
  .save-row button:not(:disabled):hover { text-decoration-thickness: 2px; }
  a:not(.button):hover { text-decoration-thickness: 2px; }
  .brand-logo:hover { opacity: .76; }
}
.button:not(:disabled):not([aria-disabled="true"]):active,
.close-button:not(:disabled):active { transform: translateY(1px); }

.customer-pricing{border-top:1px solid var(--line);padding-top:22px;margin-top:24px}.pricing-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}.pricing-heading h3{font-size:16px;font-weight:600;margin:0}.quote-sticky>.quote-card:first-child{margin-top:0}.listing-checks{margin:8px 0 0;padding-left:18px;font-size:11px;line-height:1.7}.listing-evidence{white-space:pre-wrap}

/* Clear steps, a prominent customer amount, and staff-only detail groups. */
.step-links{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 22px}
.step-links a{font-size:12px;text-decoration:none;border:1px solid var(--line);border-radius:24px;padding:10px 14px;min-height:44px;display:flex;align-items:center}
.pricing-intro{margin:0 0 16px}.quote-caption{margin-top:22px}.credit-amount{font-size:28px;margin-bottom:14px}
.topup-row{display:block;padding:20px 0}.topup-row>span{display:block;font-size:14px}.topup-row strong{display:block;text-align:left;font-size:42px;line-height:1.25;margin-top:6px;letter-spacing:-1px}
.staff-profit{margin:20px 0}.staff-profit summary{min-height:36px}.staff-profit .private-badge{margin-left:8px}.staff-profit .profit-details{margin:14px 0}
.next-field{width:100%;justify-content:center;margin:16px 0 0}.quote-button{margin-top:10px;justify-content:center}
.field-error{display:block;font-size:11px;line-height:1.5;margin-top:6px;font-weight:400}input[aria-invalid=true]{border:2px solid var(--color-border)}
#customerQuoteDialog{max-width:680px}.customer-quote-preview .brand-logo{width:180px}.customer-quote-preview h2{font-size:21px;margin:20px 0}.customer-quote-preview .print-subtitle{font-size:12px}
.customer-quote-preview .print-row{display:flex;justify-content:space-between;gap:20px;border-bottom:1px solid var(--line);padding:14px 0;font-size:13px}.customer-quote-preview dd{margin:0;text-align:right;max-width:60%;font-weight:600}.customer-quote-preview .print-total{font-size:19px;border-bottom:0;padding:16px;border-radius:8px;margin-top:12px}.customer-quote-preview .print-note{font-size:11px;line-height:1.7}
@media(hover:hover) and (pointer:fine){}
@media(max-width:760px){.page-heading h1{font-size:clamp(23px,6vw,28px);letter-spacing:-.7px}.step-links{gap:6px}.step-links a{font-size:11px;padding:8px 10px}.credit-amount{font-size:28px}.topup-row strong{font-size:40px}.topbar{flex-wrap:wrap;padding:14px 0;gap:10px}.topbar-right{margin-left:auto}.button.compact,.text-button,.save-row button{min-height:44px}.detail-caption{display:none}}
@media(max-width:380px){.field-grid{grid-template-columns:1fr}.step-links a{flex:1;justify-content:center;text-align:center}.customer-quote-preview .print-row{display:block}.customer-quote-preview dd{max-width:none;text-align:left;margin-top:5px}.topup-row strong{font-size:36px}}

/* Friendly, comfortably spaced access and Admin history screens. */
[hidden]{display:none!important} body{font-family:"Segoe UI",Inter,system-ui,sans-serif;font-size:16px;line-height:1.55} label{font-size:14px} input,select,textarea,.button{font-size:16px;min-height:48px} .field-grid{gap:20px}.card{border-radius:20px}.access-card{max-width:620px;margin:36px auto;padding:40px;border:1px solid var(--color-border);border-radius:24px}.access-card h2{font-size:30px;line-height:1.2}.access-choices{display:flex;gap:14px;flex-wrap:wrap;margin:28px 0}.access-choices>*{flex:1}.access-card form{display:grid;gap:18px;margin-top:24px}.access-card label{display:grid;gap:8px}.admin-bar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:20px 0}.admin-bar>span{margin-right:auto;font-weight:700}#saveQuoteButton{width:100%;margin:12px 0}#historyDialog{width:min(850px,94vw);max-height:88vh}#saveReviewDialog{width:min(540px,94vw)}.history-card{padding:20px 0;border-bottom:1px solid var(--color-border)}.history-card h3{font-size:17px}.history-card button{margin:6px 10px 0 0}#auditView pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;padding:16px}#saveReasonWrap{display:grid;gap:8px}#saveReasonWrap textarea{width:100%}@media(max-width:480px){.access-card{padding:24px;margin:18px auto}.access-card h2{font-size:26px}.access-choices{flex-direction:column}.card{padding:20px}.admin-bar .button{flex:1}}@media print{#accessGate,#adminBar,#editNotice,#historyDialog,#saveReviewDialog{display:none!important}}

#historyDialog{max-width:850px}#deleteDialog{width:min(540px,94vw)}#deleteDialog label{display:grid;gap:8px}.revision-details{display:grid;grid-template-columns:1fr 1.2fr;gap:8px 18px;padding:18px;border-radius:12px}.revision-details dt{font-weight:600}.revision-details dd{margin:0;overflow-wrap:anywhere}.history-card p{overflow-wrap:anywhere}@media(max-width:480px){.revision-details{grid-template-columns:1fr}.revision-details dd{margin-bottom:8px}}

.access-card h1{font-size:30px;line-height:1.2}@media(max-width:480px){.access-card h1{font-size:26px}}

.history-pages{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:20px 0}.history-pages button:disabled{opacity:.45;cursor:default}

/* theme.css */
/* Kaya's minimal blue theme. Inter is self-hosted under SIL OFL 1.1. */
@font-face {
  font-family: Inter;
  src: url('/fonts/InterVariable.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
:root {
  font-family: Inter, 'Segoe UI', system-ui, sans-serif;
  font-optical-sizing: auto;
}
body { font-family: inherit; font-size: 16px; line-height: 1.5; }
input, .credit-amount, .topup-row strong, .listing-price, .profit-details,
.print-row dd, .revision-details dd { font-variant-numeric: tabular-nums; }

@media screen {
  .app-shell { max-width: 1220px; padding: 0 32px; }
  .topbar { min-height: 104px; border-bottom: 0; }
  .workspace { grid-template-columns: minmax(0, 1.4fr) minmax(350px, 1fr); gap: 36px; }
  .main-column { gap: 28px; }
  .card { padding: 28px; border: 0; border-radius: 24px; }
  .section-heading { margin-bottom: 24px; }
  .section-heading h2, .dialog-heading h2, dialog h2,
  .customer-quote-preview h2 { font-size: 24px; font-weight: 600; line-height: 1.3; letter-spacing: -.5px; }
  .section-heading p:not(.eyebrow) { font-size: 14px; line-height: 1.5; }
  .field-grid { gap: 24px 20px; }
  label, .pricing-grid label { font-size: 16px; font-weight: 600; }
  .optional, .required { font-size: 14px; }
  input, select, textarea { min-height: 52px; border-radius: 12px; padding: 12px; font-size: 16px; }
  input::placeholder, textarea::placeholder, .money-input.large input::placeholder { font-size: 14px; }
  .money-input > span { font-size: 16px; }
  .money-input.large input { font-size: 18px; min-height: 52px; }
  .button, .button.compact, .listing-actions .button {
    min-height: 48px; padding: 12px 22px; border: 1px solid var(--color-border);
    border-radius: 999px;
    font-size: 16px; font-weight: 600; line-height: 1.4; justify-content: center;
    text-align: center; white-space: normal;
  }
  .button.compact { font-size: 14px; padding: 10px 16px; }
  .text-button, .save-row button { min-height: 44px; font-size: 14px; }
  .close-button { width: 44px; height: 44px; border-radius: 50%; }
  .microcopy, .search-status, .empty-results, .field-error, .import-error,
  .quote-message, .quote-footnote, .listing-condition, .listing-checks,
  .listing details p, .search-help p, .formula p, .manual-links a,
  .connection-note, dialog > p, dialog form > p, .helper-steps,
  .install-steps dt, .install-steps dd, #installOfflineNote,
  .customer-quote-preview .print-subtitle, .customer-quote-preview .print-note {
    font-size: 14px; line-height: 1.6;
  }
  summary, .listing summary { font-size: 16px; font-weight: 600; min-height: 32px; }
  .detail-caption { font-size: 12px; }
  .private-badge { font-size: 11px; letter-spacing: 0; border: 0; padding: 0; }
  .pricing-heading { align-items: baseline; }
  .pricing-heading h3, .reference-heading h3 { font-size: 16px; }
  .customer-pricing { margin-top: 28px; padding-top: 24px; }
  .search-summary { border: 0; padding: 0; margin-bottom: 20px; }
  .search-summary small { font-size: 12px; letter-spacing: 0; }
  .search-summary strong { font-size: 16px; }
  .search-symbol { display: none; }
  .market-actions { gap: 12px 18px; }
  .empty-results { border: 0; padding: 12px 0; }
  .listing, .listing:first-child { border: 0; border-radius: 20px; padding: 20px; }
  .listing-rank { font-size: 12px; letter-spacing: 0; }
  .listing-source { font-size: 12px; }
  .listing-title { font-size: 16px; font-weight: 600; }
  .listing-price { font-size: 28px; font-weight: 600; letter-spacing: -.5px; }
  .listing-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quote-card { border-radius: 24px; padding: 28px; }
  .quote-top .eyebrow { font-size: 16px; font-weight: 600; letter-spacing: 0; }
  .quote-top > span { border: 0; padding: 0; font-size: 12px; }
  .quote-caption { font-size: 16px; margin-top: 28px; }
  .credit-amount { font-size: 28px; font-weight: 600; letter-spacing: -.6px; margin-bottom: 24px; }
  .topup-row { display: block; padding: 24px 0; }
  .topup-row > span { font-size: 16px; }
  .topup-row strong { font-size: clamp(32px, 3.2vw, 44px); line-height: 1.2; letter-spacing: -1px; margin-top: 8px; text-align: left; }
  .staff-profit { margin: 24px 0; }
  .profit-details > div, .profit-details strong, .profit-details .combined,
  .profit-details .combined strong { font-size: 14px; }
  .save-row { font-size: 13px; flex-wrap: wrap; }
  .quote-footnote { margin-top: 16px; text-align: left; }
  .access-card { max-width: 660px; padding: 32px; margin: 48px auto; border: 0; }
  .access-card h1, .access-card h2 { font-size: 32px; font-weight: 600; line-height: 1.25; letter-spacing: -.7px; }
  .access-choices { gap: 16px; margin: 32px 0; }
  .admin-bar { gap: 12px; margin: 16px 0 28px; }
  .admin-bar > span { font-weight: 600; }
  dialog { border: 0; border-radius: 24px; padding: 32px; }
  .dialog-actions { flex-wrap: wrap; }
  .history-card { padding: 24px 0; }
  .history-card h3 { font-size: 18px; font-weight: 600; }
  .revision-details, #auditView pre { border-radius: 16px; }
  .history-pages { flex-wrap: wrap; }
  .customer-quote-preview .print-row { font-size: 16px; }
  .customer-quote-preview .print-total { font-size: 24px; border-radius: 16px; padding: 20px; }
  .toast { font-size: 14px; border-radius: 16px; }
  footer { font-size: 13px; border: 0; padding: 28px 0; }
  footer span:first-child { font-size: 12px; }
  :where(button, a, summary, input, select, textarea):focus-visible { outline: 3px solid var(--color-border); outline-offset: 3px; }
  input:focus, select:focus, textarea:focus { outline: 3px solid var(--color-border); outline-offset: 2px; }
  input[aria-invalid=true] { border: 2px solid var(--color-border); }
  select:disabled, input:disabled { cursor: not-allowed; }
}
@media screen and (hover: hover) and (pointer: fine) {
  .button:where(:not(:disabled):not([aria-disabled=true])):hover,
  .button.quote-button:not(:disabled):hover,
  .button.print-button:not(:disabled):hover,
  .listing-actions button:not(:disabled):hover { transform: none;
  }
}
@media screen and (max-width: 1000px) {
  .workspace { gap: 24px; grid-template-columns: minmax(0, 1.2fr) minmax(320px, 1fr); }
  .card, .quote-card { padding: 24px; }
}
@media screen and (max-width: 800px) {
  .app-shell { max-width: 680px; padding: 0 20px; }
  .workspace { display: block; }
  .quote-column { margin-top: 28px; }
  .quote-sticky { position: static; }
  .topbar { flex-wrap: wrap; min-height: 88px; gap: 12px; padding: 20px 0; }
  .topup-row strong { font-size: 40px; }
  .access-card { margin: 28px auto; padding: 24px 0; }
}
@media screen and (max-width: 480px) {
  .app-shell { padding-left: 16px; padding-right: 16px; }
  .card, .quote-card, dialog { padding: 24px 20px; border-radius: 20px; }
  .field-grid { grid-template-columns: 1fr; gap: 22px; }
  .section-heading h2, .dialog-heading h2, dialog h2 { font-size: 24px; }
  .access-card h1, .access-card h2 { font-size: 28px; }
  .access-choices { flex-direction: column; }
  .topbar-right { gap: 4px; }
  .button.compact { padding: 10px 12px; }
  .listing-actions { grid-template-columns: 1fr; }
  .admin-bar > span { width: 100%; }
  .admin-bar .button { flex: 1 1 auto; padding: 12px 16px; }
  .dialog-actions > .button { flex: 1 1 auto; }
  .customer-quote-preview .print-row { display: block; }
  .customer-quote-preview dd { max-width: none; text-align: left; margin-top: 6px; overflow-wrap: anywhere; }
  .history-pages { gap: 8px; }
  .history-pages .button { font-size: 14px; padding: 12px 16px; }
  footer { flex-wrap: wrap; }
}
@media screen and (forced-colors: active) {
  .button, .card, .quote-card, .listing, dialog { border: 1px solid CanvasText; }
}

@media screen {
  #staffAccountsDialog { width:min(850px,94vw); max-width:850px; }
  #staffCreateForm { display:grid; gap:16px; margin:24px 0; }
  #staffActionSummary { overflow-wrap:anywhere; }
}

.tool-tabs{display:flex;gap:10px;flex-wrap:wrap;margin:0 0 20px}.tool-tabs .button{flex:1;max-width:260px;min-height:44px}

.purchase-row{margin:20px 0;padding:20px;border:1px solid var(--line,var(--color-border));border-radius:16px;min-width:0}.purchase-row legend{font-weight:650;padding:0 8px}.purchase-check{display:flex;align-items:flex-start;gap:10px;margin:16px 0;font-size:14px}.purchase-check input{width:18px;min-width:18px;height:18px}.purchase-history{margin-top:24px}.purchase-history summary{cursor:pointer;font-weight:650;padding:12px 0}#purchasingHistory{display:grid;gap:10px;margin:12px 0}#purchasingHistory button{text-align:left;white-space:normal;overflow-wrap:anywhere}#purchasingMessage{min-height:24px}#purchasingResult h4{overflow-wrap:anywhere}#purchasingResult:empty{display:none}@media(max-width:480px){.purchase-row{padding:12px}}

.compact-listing{padding:12px 14px!important;display:grid!important;grid-template-columns:minmax(0,1fr) auto;gap:5px 12px!important}.compact-listing .listing-title{font-size:14px!important;line-height:1.4;margin:0;overflow-wrap:anywhere}.compact-listing a.listing-title{text-decoration:none}.compact-listing a.listing-title:hover{text-decoration:underline}.compact-listing .listing-price{font-size:17px!important;margin:0}.compact-listing .listing-condition{font-size:13px;grid-column:1/-1;margin:0}.compact-listing button{justify-self:start;padding:4px 0;font-size:13px}.search-results{gap:8px!important}.future-profit{padding:12px 0;font-size:22px;font-weight:650}.offer-grid{margin-top:16px}.topbar-right{margin-left:auto;justify-content:flex-end}#signOutButton{order:99}#workspaceRole,#chooseGuest,#logoutButton,#elevateButton{display:none!important}

#purchasingToolPanel{overflow:hidden}#supplierBook{margin:20px 0}.supplier-toolbar{display:flex;align-items:flex-end;gap:12px;flex-wrap:wrap;margin:14px 0}.supplier-toolbar label{min-width:160px;flex:0 1 220px}.supplier-tabs{display:flex;gap:8px;overflow:auto;padding:10px 0}.supplier-tabs button{white-space:nowrap;flex-shrink:0}.bulk-table-wrap{overflow:auto;max-height:65vh;border:1px solid var(--color-border);border-radius:12px;margin:12px 0}.bulk-table{border-collapse:separate;border-spacing:0;width:100%;font-size:14px}.bulk-table th,.bulk-table td{padding:9px 10px;border-bottom:1px solid var(--color-border);text-align:left;vertical-align:middle}.bulk-table th{font-weight:600;position:sticky;top:0;z-index:1;white-space:nowrap}.bulk-table input{min-width:115px;font-size:14px;padding:8px 9px;height:38px;border-radius:7px}.bulk-table td:first-child input{min-width:180px}.bulk-table td:nth-child(2) input{min-width:90px;width:90px}.comparison-table td{min-width:150px;font-variant-numeric:tabular-nums}.comparison-table th:first-child{min-width:230px;white-space:normal}.comparison-table td small{display:block;font-size:12px;margin-top:4px}.image-import{margin:20px 0}.image-import summary,#supplierBook>details>summary,#landedCostDetails>summary{cursor:pointer;padding:12px 0;font-weight:600}#supplierHistory{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}#supplierMessage{min-height:24px}#landedCostDetails{margin-top:24px;border-top:1px solid var(--color-border)}#bulkProductText{width:100%}#ocrText{font-family:ui-monospace,monospace;font-size:14px}@media(max-width:640px){.supplier-toolbar{align-items:stretch}.supplier-toolbar label{flex:1 1 140px}.supplier-toolbar button{min-height:40px}.topbar{gap:12px;align-items:flex-start}.topbar-right{flex-wrap:wrap}.topbar-right button{font-size:13px;padding:8px 10px}}

/* Purchasing: compact desktop spreadsheet, spacious cards on phones. */
.purchasing-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:18px}.purchasing-heading h2{margin:0}.purchasing-heading>span{font-size:13px}.purchasing-tabs{display:flex;gap:8px;padding:5px;border-radius:12px;margin-bottom:18px}.purchasing-tabs .button{border-radius:9px;flex:1;min-height:44px}.list-toolbar{display:flex;gap:12px;align-items:flex-end;flex-wrap:wrap}.list-toolbar label{flex:1;min-width:200px}.list-toolbar input{margin-top:6px}.supplier-navigation{display:flex;align-items:center;gap:12px;flex-wrap:wrap;border-block:1px solid var(--color-border);margin:20px 0 14px;padding:5px 0}.supplier-navigation .supplier-tabs{flex:1;min-width:180px;margin:0}.supplier-actions{display:flex;gap:6px;flex-wrap:wrap}.supplier-actions .button{font-size:13px;padding:9px 12px;min-height:40px}.active-supplier-name{margin:16px 0;font-size:17px}.currency-toolbar{display:grid;grid-template-columns:repeat(3,minmax(140px,1fr)) auto auto;gap:12px;align-items:end}.currency-toolbar label{font-size:13px}.currency-toolbar input,.currency-toolbar select{margin-top:5px}.currency-toolbar .text-button{padding:12px 0}.expenses-panel{border:1px solid var(--color-border);border-radius:12px;padding:0 16px;margin:18px 0}.expenses-panel summary{padding:14px 0;cursor:pointer;font-weight:600;font-size:14px}.expenses-panel summary span{font-size:12px;font-weight:400;margin-left:10px}.expense-grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:16px;align-items:end}.expense-grid label{font-size:13px}.expense-freight{display:grid;gap:5px;padding-bottom:6px}.expense-freight>span{font-size:13px}.expense-freight strong{font-size:18px}.expense-freight small{font-size:12px}.agent-expenses{display:grid;gap:12px;margin-top:14px}.agent-expense{display:grid;grid-template-columns:minmax(120px,2fr) minmax(90px,1fr) 36px;gap:12px;align-items:end}.agent-expense label{font-size:13px}.expenses-total{display:flex;justify-content:flex-end;gap:28px;border-top:1px solid var(--color-border);padding:14px 0;margin-top:10px;font-size:13px}.expenses-total strong{margin-left:6px}.table-actions{display:flex;gap:8px;flex-wrap:wrap;margin:20px 0 12px}.table-actions .button{font-size:13px;min-height:40px;padding:10px 14px}.bulk-table{width:100%;font-size:13px}.bulk-table th{white-space:normal;font-size:12px;line-height:1.5;padding:10px 7px}.bulk-table td{padding:10px 6px;font-variant-numeric:tabular-nums}.bulk-table input{min-width:88px;width:100%;max-width:118px;padding:9px 7px;font-size:14px;height:40px}.bulk-table td:first-child input{min-width:90px;width:90px;max-width:90px}.bulk-table td:nth-child(2) input{min-width:72px;width:72px}.bulk-table td:nth-child(3) input{min-width:54px;width:54px}.bulk-table td output{display:block;min-width:80px;font-size:13px;line-height:1.5}.bulk-table .profit-cell{font-weight:650}.remove-product{border:0;font-size:22px;padding:6px;min-width:32px;min-height:40px;border-radius:8px}.supplier-summary{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;margin:20px 0}.supplier-summary>div{padding:14px;border-radius:10px;display:grid;gap:8px}.supplier-summary>div>span{font-size:12px}.supplier-summary strong{font-size:18px;overflow-wrap:anywhere}.supplier-summary>p{grid-column:1/-1;margin:0}.saved-lists summary{cursor:pointer;padding:14px 0;font-weight:600}.price-import-dialog{max-width:720px}.price-import-dialog input[type=file]{width:100%;padding:12px}.import-destination{padding:12px 14px;border-radius:8px;font-weight:600}.price-import-dialog img{display:block;max-height:340px;max-width:100%;width:auto;object-fit:contain;margin:16px auto;border:1px solid var(--color-border);border-radius:8px}.price-import-dialog>label{display:block;margin:16px 0}.price-import-dialog select,.price-import-dialog textarea{margin-top:6px}.import-preview{max-height:260px;overflow:auto;border-radius:8px}.import-preview>div{display:flex;justify-content:space-between;gap:12px;padding:10px 14px;border-bottom:1px solid var(--color-border);font-size:14px}.future-profit-bar{display:flex;align-items:center;justify-content:space-between;gap:18px;border:1px solid var(--color-border);border-radius:10px;padding:16px 18px;margin:18px 0}.future-profit-bar>span{font-size:14px;font-weight:600}.future-profit-bar .future-profit{padding:0;font-size:24px;line-height:1.3}.offer-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.quote-customer{display:grid;gap:14px;margin:18px 0 24px}.quote-customer label{font-size:13px}.quote-customer input{margin-top:6px;padding:12px;width:100%;font-size:16px}.staff-profit>summary{font-size:13px;font-weight:600;letter-spacing:.05em}.compact-listing{grid-template-columns:minmax(0,1.3fr) 55px 90px minmax(75px,1fr)!important;align-items:center;padding:9px 10px!important;gap:8px!important;border-radius:8px!important}.compact-listing .listing-title{font-size:13px!important;font-weight:500;line-height:1.35;text-align:left;border:0;padding:0;min-width:0;white-space:normal}.compact-listing .listing-storage{font-size:12px}.compact-listing .listing-price{font-size:14px!important;border:0;font-weight:650;padding:0;text-align:right;justify-self:end}.compact-listing .listing-location{font-size:12px;overflow-wrap:anywhere;text-align:right}.compact-listing button:hover{text-decoration:underline}.search-results{gap:5px!important}.reference-heading{margin-top:18px}.customer-pricing{margin-top:20px}
@media(max-width:1050px){.currency-toolbar{grid-template-columns:repeat(3,minmax(0,1fr))}.supplier-navigation{align-items:flex-start}.supplier-summary{grid-template-columns:repeat(3,minmax(0,1fr))}.supplier-summary strong{font-size:17px}}
@media(max-width:700px){.app-shell{padding:0 16px}.card{padding:20px 16px}.topbar{min-height:88px}.topbar .brand-logo{width:140px}.topbar-right{gap:4px;max-width:190px}.topbar-right .button{font-size:12px;min-height:38px;padding:7px 8px}.tool-tabs{gap:8px}.tool-tabs .button{font-size:14px;min-height:46px}.purchasing-heading{align-items:flex-start;flex-direction:column;gap:6px}.purchasing-tabs .button{font-size:14px;min-height:46px;padding:12px 8px}.list-toolbar{gap:10px}.list-toolbar label{flex-basis:100%}.list-toolbar .button{flex:1}.supplier-navigation{display:block}.supplier-tabs{width:100%;padding:12px 0}.supplier-actions{padding-bottom:10px}.currency-toolbar{grid-template-columns:1fr 1fr;gap:14px}.currency-toolbar label{font-size:14px}.currency-toolbar label:nth-child(3){grid-column:1/-1}.currency-toolbar input,.currency-toolbar select{font-size:16px;min-height:46px}.expenses-panel{padding:0 12px}.expenses-panel summary span{display:block;margin:6px 0 0;line-height:1.4}.expense-grid{grid-template-columns:1fr 1fr;gap:14px}.expense-grid label{font-size:14px}.expense-grid input,.agent-expense input{font-size:16px;min-height:46px}.expense-freight{grid-column:1/-1}.agent-expense{grid-template-columns:minmax(0,1fr) 105px 28px;gap:8px}.expenses-total{flex-direction:column;align-items:flex-start;gap:10px}.table-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}.table-actions .button{font-size:13px;min-height:46px;padding:11px 8px;white-space:normal}.bulk-table-wrap:has(#supplierRows){border:0;overflow:visible;max-height:none}.bulk-table:has(#supplierRows),#supplierRows{display:block;width:100%}.bulk-table:has(#supplierRows) thead{display:none}#supplierRows tr{display:grid;grid-template-columns:1fr 1fr;gap:14px;padding:18px 12px;margin-bottom:16px;border:1px solid var(--color-border);border-radius:12px;position:relative}#supplierRows td{display:block;padding:0;border:0;min-width:0}#supplierRows td::before{content:attr(data-label);display:block;font-size:12px;margin-bottom:7px;line-height:1.4}#supplierRows td:first-child{grid-column:1/-1;padding-right:28px}#supplierRows input,#supplierRows td:first-child input,#supplierRows td:nth-child(2) input,#supplierRows td:nth-child(3) input{width:100%;min-width:0;max-width:none;font-size:16px;height:46px;padding:10px}#supplierRows output{min-width:0;font-size:15px;min-height:30px;padding:5px 0}#supplierRows .profit-cell{border-radius:8px;padding:10px}#supplierRows td:last-child{position:absolute;right:8px;top:10px}#supplierRows td:last-child::before{display:none}.supplier-summary{grid-template-columns:1fr 1fr;gap:10px}.supplier-summary>div{padding:12px}.supplier-summary>div:last-of-type{grid-column:1/-1}.comparison-table td{min-width:125px}.comparison-table th:first-child{min-width:160px}.compact-listing{grid-template-columns:minmax(0,1fr) 54px 86px!important;gap:4px 8px!important;padding:8px 10px!important}.compact-listing .listing-location{grid-column:1/3;text-align:left}.compact-listing .listing-price{grid-column:3;grid-row:1/3;align-self:center}.field-grid{gap:18px 14px}input,select,textarea{font-size:16px}.future-profit-bar{margin:20px 0;padding:16px}.quote-card{padding:24px 20px}.price-import-dialog{padding:20px 16px}.price-import-dialog .dialog-actions{flex-wrap:wrap;gap:10px}.price-import-dialog .dialog-actions .button{flex:1;min-height:46px}.import-preview>div{font-size:13px}}

/* Clear action labels and comfortable touch targets, including account dialogs. */
.close-button{width:auto;min-width:64px;min-height:44px;height:auto;padding:8px 12px;font-size:14px;font-weight:600;line-height:1.4;border:1px solid var(--color-border);border-radius:9px;flex-shrink:0}
.remove-product{font-size:13px;min-width:64px;min-height:44px;padding:8px 10px;border:1px solid var(--color-border)}
.agent-expense{grid-template-columns:minmax(120px,2fr) minmax(90px,1fr) auto}
.supplier-actions .button,.table-actions .button,.currency-toolbar label,.expense-grid label,.agent-expense label{font-size:14px}
#changePasswordDialog{width:min(500px,calc(100vw - 32px))}#changePasswordForm{display:grid;gap:16px}#changePasswordForm label{display:grid;gap:7px}#changePasswordForm input{width:100%}#changePasswordMessage:empty{display:none}
.button,.close-button,.remove-product,summary{touch-action:manipulation}button:not(:disabled),summary{cursor:pointer}.button:focus-visible,.close-button:focus-visible,.remove-product:focus-visible,summary:focus-visible{outline:3px solid var(--color-border);outline-offset:3px}
@media(max-width:700px){
.topbar{display:grid;grid-template-columns:1fr auto;gap:12px}.topbar-right{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px;max-width:240px}.topbar-right .button{font-size:13px;padding:9px 10px;min-height:44px}#signOutButton{order:-1;margin-left:auto}.admin-bar,.tool-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.admin-bar .button,.tool-tabs .button{width:100%;margin:0;white-space:normal;min-height:46px;padding:11px 10px}.supplier-tabs{gap:10px;flex-wrap:wrap}.supplier-tabs .button{min-height:46px;max-width:100%;white-space:normal}.supplier-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}.supplier-actions .button{margin:0;white-space:normal;min-height:46px}.currency-toolbar .button{width:100%;white-space:normal;font-size:14px}.agent-expense{grid-template-columns:minmax(0,1fr) minmax(90px,1fr)}.agent-expense .remove-product{grid-column:1/-1;justify-self:end}#supplierRows td:first-child{padding-right:0}#supplierRows td:last-child{position:static;grid-column:1/-1;display:flex;justify-content:flex-end}#supplierRows td::before{font-size:14px}.dialog-actions{display:flex;flex-wrap:wrap;gap:10px}.dialog-actions .button{flex:1;min-width:120px;min-height:46px;white-space:normal}.dialog-heading{gap:12px;align-items:flex-start}.dialog-heading h2{min-width:0;overflow-wrap:anywhere}.history-card button{margin:6px 6px 0 0;min-height:46px}#staffCreateForm>.button{width:100%;margin-top:10px}#changePasswordDialog{padding:24px 18px}
}
@media(max-width:420px){.topbar{grid-template-columns:1fr}.topbar-right{max-width:none;width:100%;display:grid;grid-template-columns:1fr 1fr}.topbar-right #signOutButton{grid-column:2;grid-row:1;margin:0}.topbar-right #updateAppButton{grid-column:1;grid-row:1}.topbar-right #installAppButton{grid-column:1/-1;grid-row:2}.table-actions .button{font-size:14px}.tool-tabs .button{font-size:14px}}

html,body{min-height:100%}

/* Purchasing sheets retain a stable left-to-right keyboard order at every width. */
.bulk-table-wrap:has(#supplierRows){height:480px;max-height:65vh;overflow:auto;border:1px solid var(--color-border);border-radius:8px;overscroll-behavior:contain}

.quote-card{border:1px solid var(--color-border)}.quote-card .field-error{font-size:14px;line-height:1.5;margin-top:5px}.future-profit-bar>span{font-weight:750}.future-profit-bar .future-profit{font-weight:800}.quote-history-actions{display:flex;gap:10px;flex-wrap:wrap;margin:0 0 18px}

/* Secondary actions use consistent soft tiles; primary actions retain their style. */
button:not(.primary),a.button:not(.primary),summary.button{border:1px solid var(--color-border);border-radius:9px;transition:background .12s,border-color .12s,transform .12s}button:not(.primary):not(:disabled):active,a.button:not(.primary):active,summary.button:active{transform:translateY(1px)}button:disabled{cursor:not-allowed;opacity:.55}.column-sort{border-radius:0!important;border:0!important}.account-menu{position:relative;order:2}.account-menu>summary{list-style:none;width:44px;height:44px;display:grid;place-items:center;padding:0;font-size:22px;cursor:pointer}.account-menu>summary::-webkit-details-marker{display:none}.account-menu-items{position:absolute;right:0;top:calc(100% + 8px);display:grid;gap:7px;width:220px;padding:12px;border:1px solid var(--color-border);border-radius:12px;z-index:30}.account-menu-items .button{text-align:left;width:100%;font-size:14px;white-space:normal}.topbar-right{gap:8px}.topbar-right #updateAppButton{order:1;font-size:24px;width:44px;min-width:44px;min-height:44px;padding:0}.topbar-right #signOutButton{order:3}.topbar-right #installAppButton{order:0}.account-details{display:grid;grid-template-columns:auto 1fr;gap:12px 20px}.account-details dt{font-weight:650}.account-details dd{margin:0;overflow-wrap:anywhere}.compact-listing button.listing-title{padding:5px 7px}.compact-listing button.listing-price{padding:5px 7px}.admin-bar:empty{display:none}.topbar-right{display:flex!important;align-items:center;flex-wrap:wrap;max-width:none;width:auto}@media(max-width:700px){.topbar-right{margin-left:auto}.account-menu-items{width:min(240px,calc(100vw - 40px))}.topbar-right #signOutButton{margin-left:0}.account-details{grid-template-columns:1fr;gap:5px}.account-details dd{margin-bottom:10px}}@media(prefers-reduced-motion:reduce){button,a.button,summary.button{transition:none}}
/* v19: neutral controls, compact fields and an aligned mobile header. */.app-shell{max-width:1480px;padding:0 24px}.card{border:1px solid var(--color-border);border-radius:16px;padding:20px}.workspace{gap:20px;grid-template-columns:minmax(0,1.65fr) minmax(340px,1fr)}.main-column{gap:16px}.section-heading{margin-bottom:16px}.field-grid,.pricing-grid{gap:14px 16px}.field-grid input,.field-grid select,.quote-customer input{margin-top:5px}label{font-size:14px}.topbar{padding:16px 0;min-height:96px;gap:16px}.brand-logo,.brand-logo:hover,.brand-logo img{border:0!important;border-radius:0!important;padding:0!important}.topbar .brand-logo{width:176px}.topbar-right{gap:8px;align-items:center}.topbar-right .button,.account-menu>summary{min-height:44px;height:44px}.account-menu>summary svg{display:block;flex:none}.account-menu>summary{padding:10px}.topbar-right #signOutButton{white-space:nowrap}
button:not(.primary),a.button:not(.primary),summary.button,.text-button{border:1px solid var(--color-border)!important;text-decoration:none!important}button:not(.primary):not(:disabled):hover,a.button:not(.primary):hover,summary.button:hover{text-decoration:none!important}.column-sort{border:0!important}.market-actions{display:flex;flex-wrap:wrap;align-items:stretch;gap:8px}.market-actions .button{font-size:14px;min-height:44px;padding:10px 14px;margin:0}.reference-heading{margin-top:16px}.offer-grid{grid-template-columns:minmax(130px,1fr) minmax(100px,.75fr) minmax(140px,1fr);align-items:end}.offer-grid label{min-width:0}.offer-grid:has(#offerPercentWrap[hidden]){grid-template-columns:1fr 1fr}.customer-pricing{margin-top:16px}.future-profit-bar{margin:14px 0;padding:14px 16px}.quote-customer{gap:12px;margin:14px 0 18px}
.quote-card{border:1px solid var(--color-border);padding:22px;border-radius:16px}.quote-card .topup-row{border-top:0;border-bottom:1px solid var(--color-border);padding:14px 0}.quote-message{border:0!important;padding:10px 0 0!important;min-height:0}.quote-message:empty{display:none}.staff-profit{border:0!important;margin-top:16px}.profit-toggle{display:flex;justify-content:space-between;align-items:center;min-height:46px;padding:12px 14px;width:100%;list-style:none}.profit-toggle::after,.expense-toggle::after{content:'+';font-size:20px}.staff-profit[open]>.profit-toggle::after,.expenses-panel[open]>.expense-toggle::after{content:'−'}.profit-toggle::-webkit-details-marker,.expense-toggle::-webkit-details-marker{display:none}.quote-card .button{margin-top:10px}.quote-footnote{margin-top:14px}.history-toolbar{display:flex;flex-wrap:wrap;gap:10px;align-items:end;margin:14px 0}.history-toolbar label{flex:1 1 260px}.history-card .quote-audit{padding:16px;margin:12px 0;border-radius:10px;border:1px solid var(--color-border)}.quote-audit section+section{border-top:1px solid var(--color-border);margin-top:18px;padding-top:12px}.field-button{width:100%;text-align:left;justify-content:flex-start;min-height:46px;margin-top:5px;white-space:normal}.province-options,.select-options{max-height:50vh;overflow:auto;display:grid;gap:6px;margin-top:14px}.province-options label{display:flex;align-items:center;gap:10px;padding:9px;border-radius:8px;min-height:44px}.province-options input{width:20px;min-height:20px;height:20px;margin:0}.select-options .button{justify-content:flex-start;white-space:normal;text-align:left;min-height:44px}.browse-locations{display:grid;gap:8px}footer{padding:24px 0;font-size:13px;letter-spacing:0;text-transform:none}
.purchasing-tabs{display:flex;gap:8px;flex-wrap:wrap}.purchasing-tabs .button{flex:1 1 180px;min-height:46px;padding:10px}.supplier-navigation{gap:10px;flex-wrap:wrap}.supplier-tabs{padding:10px 0;gap:7px}.supplier-actions{display:flex;flex-wrap:wrap;gap:7px;padding:8px 0}.supplier-actions .button{font-size:13px;min-height:42px;padding:9px 12px}.supplier-actions .add-supplier{width:42px;font-size:24px;padding:0}.currency-toolbar{gap:12px;margin:14px 0}.expenses-panel{margin:14px 0;padding:12px;border:1px solid var(--color-border);border-radius:10px}.expense-toggle{list-style:none;display:flex;align-items:center;justify-content:space-between;padding:10px 12px;border-radius:8px;min-height:44px}.expense-grid{display:grid;grid-template-columns:1.2fr .8fr 1fr;gap:12px;margin-top:14px;align-items:end}.expense-shop{grid-column:1/3}.expense-conversion{grid-column:3}.expense-freight-rate{grid-column:1}.expense-phones{grid-column:2}.expense-weight{grid-column:3;display:grid;gap:5px;padding-bottom:8px}.expenses-total{font-size:15px;gap:20px;margin-top:14px}.expenses-total strong{font-weight:800;font-size:18px}.table-actions{gap:8px;margin:14px 0}.table-actions .button{padding:10px 14px}.saved-lists{padding:16px;border-radius:10px;margin:12px 0}.saved-lists #supplierHistory{display:grid;gap:8px}
.bulk-table:has(#supplierRows){border-collapse:separate!important;border-spacing:4px!important;min-width:1350px;table-layout:fixed}.bulk-table:has(#supplierRows) th:first-child{width:192px}.bulk-table:has(#supplierRows) th{border:0}.bulk-table:has(#supplierRows) th>.column-sort{border-radius:7px!important}#supplierRows td,#supplierRows td:first-child,#supplierRows td:last-child{border:2px solid var(--color-border)!important;border-radius:7px!important;overflow:hidden}#supplierRows input{height:50px!important}#supplierRows td:first-child input{height:54px!important;font-size:16px}.bulk-table-wrap:has(#supplierRows){border:1px solid var(--color-border)}.supplier-summary{gap:10px;margin:16px 0}.supplier-summary>div{padding:12px}.supplier-summary>div>span{font-size:14px}.import-toolbar{display:flex;gap:12px;align-items:end;flex-wrap:wrap}.import-toolbar label{flex:1 1 200px}.image-preview-button{display:block;width:100%;padding:0!important;border:0!important;cursor:zoom-in}.price-import-dialog .image-preview-button img{max-height:280px;max-width:100%;margin:12px auto}.expanded-image-dialog{width:min(1000px,96vw);max-width:1000px}.expanded-image-controls{display:flex;gap:8px;margin-bottom:10px}#expandedImageStage{height:70vh;overflow:auto;touch-action:pan-x pan-y}#expandedPriceImage{display:block;max-width:none;transform-origin:top left;width:100%;height:auto;user-select:none}.export-actions{display:flex;flex-wrap:wrap;gap:10px}.export-actions .button{flex:1;min-height:48px}.toast{z-index:2000;pointer-events:none;max-width:calc(100vw - 32px)}
@media(max-width:900px){.workspace{grid-template-columns:1fr}.quote-sticky{position:static}.offer-grid{grid-template-columns:1fr 1fr}.offer-grid label:last-child{grid-column:1/-1}.app-shell{padding:0 16px}.topbar{display:grid;grid-template-columns:auto 1fr}.topbar .brand-logo{width:150px}.topbar-right{justify-content:end}}@media(max-width:600px){.topbar{grid-template-columns:1fr;padding:14px 0;gap:12px}.topbar .brand-logo{width:150px}.topbar-right{display:grid!important;grid-template-columns:minmax(94px,1fr) 44px 44px minmax(70px,.8fr);gap:8px;width:100%;margin:0}.topbar-right #installAppButton{order:0}.topbar-right #updateAppButton{order:1}.topbar-right .account-menu{order:2}.topbar-right #signOutButton{order:3}.topbar-right .button{font-size:13px;padding:8px;min-height:44px}.account-menu>summary{width:44px}.account-menu-items{right:-78px}.card{padding:16px 14px}.section-heading h2{font-size:21px}.field-grid{gap:13px 12px}.field-grid input,.field-grid select{font-size:16px}.market-actions{display:grid;grid-template-columns:1fr 1fr}.market-actions .button{font-size:13px;padding:10px 8px;white-space:normal}.market-actions #clearListingsButton{grid-column:2}.supplier-actions{width:100%}.supplier-actions .button{flex:1;white-space:normal;padding:9px 8px}.supplier-actions .add-supplier{flex:0 0 42px}.expense-grid{grid-template-columns:1fr 1fr}.expense-shop,.expense-conversion{grid-column:auto}.expense-freight-rate{grid-column:1}.expense-phones{grid-column:2}.expense-weight{grid-column:1/-1;display:flex;justify-content:space-between;padding:0}.expenses-total{display:grid;gap:8px}.table-actions{display:flex;flex-wrap:wrap}.table-actions .button{flex:1 1 44%}.quote-card{padding:20px 16px}.purchasing-tabs .button{font-size:13px;flex-basis:120px}.history-toolbar .button{flex:1}.history-toolbar label{flex-basis:100%}.import-toolbar .button{min-height:46px}.supplier-summary strong{font-size:17px}}


.bulk-table-wrap:has(#supplierRows){overflow:auto!important;max-width:100%;max-height:65vh}.supplier-actions #duplicateSupplier{order:2}.supplier-actions #deleteSupplier{order:3}.supplier-actions #renameSupplier{order:1}#supplierRows td:first-child input{font-size:16px!important}.workspace>*{min-width:0}.topbar-right{max-width:none}.import-edit-table input{font-size:16px}.expanded-image-dialog img{pointer-events:none}

/* v21: compact blue workspaces, warm yellow accents, consistent controls. */

@media screen{
.app-shell{max-width:1440px;padding:0 26px}
.topbar{min-height:92px;gap:20px;align-items:center}
.brand-logo{border:0;padding:0}
.topbar-right{display:flex;align-items:center;gap:8px}
.topbar-right .button,.account-menu>summary{height:42px;min-height:42px;display:inline-flex;align-items:center;justify-content:center;margin:0;padding:9px 13px}
.account-menu{align-self:center;margin:0}
.account-menu>summary{width:44px;padding:9px;list-style:none}
.account-menu>summary::-webkit-details-marker{display:none}
.account-menu-items{z-index:100}

 .workspace{grid-template-columns:minmax(0,1.7fr) minmax(330px,1fr);gap:24px}
.main-column{gap:20px}
.card,.access-card{border:1px solid var(--color-border);border-top:3px solid var(--line);padding:24px;border-radius:18px}
.section-heading{margin-bottom:20px}
.section-heading h2,dialog h2{font-size:21px}
.field-grid{gap:18px 16px}
label{font-size:14px}
input,select,textarea,.picker-button{min-height:46px;border:1px solid var(--color-border);border-radius:9px;padding:10px 12px;font-size:16px}
.button,.button.compact,.button.ghost,.close-button{border-radius:9px;min-height:42px;padding:9px 14px;border:1px solid var(--color-border);font-size:14px;line-height:1.4;font-weight:600}
.button:active{transform:translateY(1px)}
.button:disabled{opacity:.5}
.close-button{width:auto;height:auto}
.button:focus-visible,input:focus-visible,textarea:focus-visible,.picker-button:focus-visible{outline:3px solid var(--line);outline-offset:2px}

 .tool-tabs,.purchasing-tabs{display:flex;gap:8px;flex-wrap:wrap}
.tool-tabs .button,.purchasing-tabs .button{flex:0 1 auto;max-width:none;min-height:42px;padding:9px 18px}
.purchasing-tabs{margin:18px 0}
.list-toolbar{display:flex;align-items:end;flex-wrap:wrap;gap:10px}
.list-toolbar>label{flex:1;min-width:200px}
.supplier-navigation{gap:10px}
.supplier-tabs{gap:8px;flex-wrap:wrap}
.supplier-tabs .button,.supplier-actions .button{min-height:40px;padding:8px 12px;flex:0 1 auto}
.supplier-actions{gap:8px;flex-wrap:wrap}
.active-supplier-name{font-size:18px;margin:20px 0 14px}

 .purchasing-cost-cards{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px;margin:0 0 18px}
.cost-card{padding:18px;border:1px solid var(--color-border);border-radius:14px;min-width:0}
.cost-card h3{font-size:14px;letter-spacing:.045em;margin:0 0 16px}
.currency-toolbar{display:grid;grid-template-columns:1fr 1fr;gap:14px;align-items:end}
.currency-toolbar>.button{width:100%}
.expense-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.expense-grid>*,.expense-shop,.expense-conversion,.expense-freight-rate,.expense-phones{grid-area:auto}
.expense-weight{grid-column:1/-1;display:flex;flex-direction:column;gap:2px;border-radius:10px;padding:12px}
.expense-weight strong{font-size:18px}
.expense-weight span{font-size:14px}
.expenses-total{font-size:14px;display:flex;flex-wrap:wrap;gap:16px;border-top:1px solid var(--color-border);padding-top:12px}
.agent-expense{gap:8px}
.table-actions{gap:8px;margin:16px 0}
.bulk-table th{font-size:13px}
.bulk-table td{padding:6px}
.bulk-table input{padding:8px;min-height:40px}
.bulk-table .row-name{display:flex;align-items:center;gap:6px}
.row-name input{min-width:115px}
.row-name .remove-product{padding:4px 7px;font-size:12px;min-width:0}
.remove-product{border:1px solid var(--color-border);border-radius:7px;min-height:32px;padding:6px 9px}
.column-sort{display:flex;align-items:center;justify-content:space-between;gap:5px;width:100%;padding:5px 0}
.column-sort::after{content:attr(data-direction);white-space:nowrap}
.supplier-summary{padding:16px;border:1px solid var(--color-border);border-radius:12px;margin-top:16px}
.comparison-table th,.comparison-table td{padding:12px 10px}
.comparison-table small{font-size:12px;display:block}
.saved-lists{padding:16px;border-radius:12px}

 .market-results-card{border:1px solid var(--color-border);border-left:3px solid var(--line);border-radius:13px;padding:16px;margin-top:18px}
.reference-heading{display:flex;justify-content:space-between;align-items:center;gap:8px}
.reference-heading h3{margin:0;font-size:16px}
.reference-heading .button{min-height:32px;padding:5px 9px}
.market-results-card .microcopy{margin:8px 0 12px}
.search-results{display:grid;gap:4px}
.listing.compact-listing,.listing.compact-listing:first-child{display:grid!important;grid-template-columns:minmax(0,1fr) 55px 85px 32px!important;gap:3px 8px!important;padding:9px 10px!important;border:1px solid var(--color-border);border-radius:8px}
.compact-listing .listing-title{grid-column:1;font-size:14px!important}
.compact-listing .listing-storage{grid-column:2;font-size:13px}
.compact-listing .listing-price{grid-column:3;grid-row:1;font-size:15px!important;letter-spacing:0;padding:0;border:0}
.compact-listing .listing-location{grid-column:1/4;font-size:12px!important;line-height:1.4}
.listing-copy{grid-column:4;grid-row:1/3;align-self:center;font-size:12px;min-height:32px;border:0;border-radius:6px;padding:4px}
.market-results-card #seeMoreListings{margin-top:10px}
.customer-pricing{border-top:0;margin-top:20px;padding-top:0}
.repair-profit-row{display:grid;grid-template-columns:1fr 1fr;align-items:end;gap:16px;margin-top:18px}
.future-profit-bar{margin:0;min-height:74px;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:4px;padding:12px 16px;border-radius:10px;border:1px solid var(--color-border)}
.future-profit-bar span{font-size:14px}
.future-profit{font-size:21px}
.item-price-field{grid-column:auto}
.quote-card{border:1px solid var(--color-border);border-top:3px solid var(--line);border-radius:18px;padding:24px}
.quote-card .quote-message:empty{display:none}
.quote-card .quote-customer{gap:14px}
.quote-card .button{margin-top:9px;min-height:42px}
.quote-card .profit-toggle{margin:0;display:flex;justify-content:space-between;align-items:center;width:100%;padding:12px}
.quote-card .profit-toggle::after{margin-left:auto;position:static}

 .browse-location-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;align-items:stretch}
.browse-locations{display:contents}
.browse-location-actions .button{margin:0;min-height:48px}
.province-options{max-height:300px}
.province-options label{padding:10px}
.province-options input{min-height:0}

 .picker-native{position:absolute!important;width:1px!important;height:1px!important;min-height:0!important;opacity:0;pointer-events:none;padding:0!important;border:0!important;clip-path:inset(50%)}
.field-picker{position:relative;min-width:0;display:block;width:100%}
.picker-button{display:flex;align-items:center;justify-content:space-between;text-align:left;gap:10px;width:100%;font-weight:400;cursor:pointer}
.picker-button::after{content:'⌄';flex:none}
.picker-button:disabled{cursor:not-allowed}
.picker-panel{position:absolute;top:calc(100% + 5px);left:0;right:0;min-width:0;z-index:110;border:1px solid var(--color-border);border-top:2px solid var(--line);border-radius:10px;padding:8px}
.field-picker.is-open{z-index:111}
.picker-panel input{width:100%;min-height:40px;padding:8px 10px;margin:0 0 5px;font-size:16px}
.picker-options{max-height:210px;overflow-y:auto;overscroll-behavior:contain}
.picker-option{display:block;width:100%;border:0;border-radius:6px;padding:10px 8px;min-height:40px;text-align:left;font-size:14px}
.picker-option[aria-selected=true]{font-weight:600}
.picker-option:disabled{opacity:.5}
.picker-options p{font-size:14px;margin:10px}
.picker-panel[hidden]{display:none!important}

 input[aria-invalid=true],select[aria-invalid=true],textarea[aria-invalid=true],.picker-button[aria-invalid=true],input.invalid-cell,.required-missing{border:3px solid var(--color-border)!important;outline:0!important}
.review-cell{border:1px solid var(--color-border)!important}
.import-edit-table input{min-height:42px}
.activity-row{border:1px solid var(--color-border);border-radius:10px;padding:14px;margin:10px 0}
.activity-row h3{font-size:15px;margin:0 0 6px}
.activity-row p{font-size:14px;margin:4px 0;overflow-wrap:anywhere}
.activity-row .button{min-height:32px;padding:5px 9px;margin:6px 6px 0 0}
#activityLogDialog{width:min(800px,94vw);max-width:800px}

}

@media screen and (hover:hover){
}

@media screen and (max-width:1000px){.workspace{grid-template-columns:minmax(0,1.3fr) minmax(310px,1fr)}
.purchasing-cost-cards{grid-template-columns:1fr}
.card,.quote-card{padding:20px}
}

@media screen and (max-width:800px){.workspace{display:block}
.app-shell{padding:0 16px}
.topbar{display:grid;grid-template-columns:1fr;gap:12px;padding:18px 0}
.brand-logo{width:164px}
.topbar-right{display:flex;justify-content:flex-end;gap:7px;flex-wrap:nowrap}
.topbar-right .button{padding:8px 10px;white-space:nowrap}
.quote-column{margin-top:20px}
.quote-sticky{position:static}
.purchasing-tabs .button{padding:8px 12px}
.supplier-navigation{display:flex;flex-direction:column;align-items:stretch}
.supplier-actions{display:flex}
.supplier-tabs{display:flex}
.bulk-table td .row-name{display:flex}
.bulk-table .row-name input{width:100%}
.row-name .remove-product{flex:none}
.list-toolbar>label{flex-basis:100%}
}

@media screen and (max-width:480px){.field-grid{grid-template-columns:1fr;gap:16px}
.repair-profit-row{grid-template-columns:1fr}
.item-price-field{grid-column:1/-1}
#newSection .field-grid{grid-template-columns:1fr 1fr}
#newSection .field-grid>label{grid-column:1/-1}
#newSection .field-grid>.item-price-field{grid-column:auto;min-width:0}
.card,.quote-card{padding:18px 14px}
.tool-tabs .button{flex:1;min-width:0;padding:9px 10px}
.browse-location-actions{grid-template-columns:1fr}
.currency-toolbar,.expense-grid{gap:12px}
.cost-card{padding:14px}
.button{min-height:42px}
.purchasing-tabs{display:grid;grid-template-columns:1fr 1fr}
.purchasing-tabs .button:last-child{grid-column:1/-1;justify-self:start}
.listing.compact-listing{grid-template-columns:minmax(0,1fr) 45px 76px 28px!important;gap:3px 5px!important;padding:8px!important}
.listing-copy{font-size:12px}
.compact-listing .listing-title{font-size:13px!important}
.compact-listing .listing-price{font-size:14px!important}
.market-results-card{padding:12px}
.picker-options{max-height:190px}
dialog{padding:20px 16px;border-radius:16px}
}

#searchAreaDialog{width:min(440px,94vw);max-height:75dvh}
#searchAreaDialog .province-options{max-height:280px}
#searchAreaDialog .province-options label{display:flex;align-items:center;gap:10px}
#searchAreaDialog input[type=radio]{width:18px;height:18px;min-width:18px}

.unit2-reset{font-size:12px;border:0;border-radius:5px;padding:3px 7px;min-height:26px;margin-top:4px;cursor:pointer}
.bulk-table td:has(.unit2-reset) input{width:100%;min-width:90px}

/* KAYA v22: compact working cards, clear editable fields and floating menus. */
@media screen {
.button,.button.ghost,.close-button{border-radius:10px;min-height:40px;padding:8px 13px;line-height:1.3;flex-grow:0;font-size:14px}
.button[aria-pressed=true]:hover,.button.primary[aria-pressed=true]:hover{transform:none}
input:not([readonly]):not(:disabled),textarea,select,.picker-button{border:1px solid var(--color-border)}
input:focus,textarea:focus,select:focus,.picker-button:focus-visible,.button:focus-visible{outline:2px solid var(--color-border);outline-offset:2px}
input[readonly],input:disabled,output{cursor:default}
.topbar{display:grid;grid-template-columns:minmax(120px,1fr) auto;align-items:start;gap:14px;padding:20px 0 24px;min-height:0}
.topbar .brand-logo{width:180px;align-self:center}
.topbar-right{display:grid!important;grid-template-columns:42px 42px auto;grid-template-rows:42px auto;gap:7px!important;margin:0;align-items:center;justify-content:end}
.topbar-right #updateAppButton{grid-row:1;grid-column:1;margin:0;width:42px;height:42px;padding:0;font-size:25px;order:initial}
.topbar-right #accountMenu{grid-row:1;grid-column:2;margin:0!important;padding:0!important;border:0!important;align-self:center;order:initial}
.topbar-right #accountMenu>summary{width:42px;height:42px;min-height:42px;padding:9px;display:flex;align-items:center;justify-content:center;border:1px solid var(--color-border);margin:0}
#accountMenu>summary::after,#accountMenu>summary::before{display:none!important;content:none!important}
#accountMenu>summary::-webkit-details-marker{display:none}
.topbar-right #signOutButton{grid-row:1;grid-column:3;width:auto;min-width:72px;height:42px;margin:0;order:initial;padding:8px 11px}
.topbar-right #installAppButton{grid-row:2;grid-column:1/-1;justify-self:end;width:auto;min-width:115px;margin:0;order:initial}
.account-menu-items{z-index:130;border-top:2px solid var(--color-border)}
.tool-tabs{margin-top:0}
.quote-history-actions{position:relative;display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:12px 0}
.quote-history-actions>.button{margin:0;flex:0 1 auto}
#historyDialog{position:absolute;top:calc(100% + 6px);left:0;right:auto;bottom:auto;margin:0;width:min(610px,calc(100vw - 32px));max-width:none;max-height:min(600px,75dvh);overflow:auto;z-index:125;padding:14px;border:1px solid var(--color-border);border-top:2px solid var(--color-border)}
#historyDialog .dialog-heading h2{font-size:17px;margin:0}
#historyDialog .history-toolbar{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
#historyDialog .history-toolbar>label{flex-basis:100%;order:-1}
#historyList{display:grid;gap:8px}
#historyDialog .history-card{margin:0;padding:10px;border:1px solid var(--color-border);border-radius:8px}
#historyDialog .history-card h3{font-size:14px;margin:0 0 5px}
#historyDialog .history-card p{font-size:13px;margin:3px 0}
#historyDialog .history-card .button{padding:6px 9px;min-height:34px;margin:5px 5px 0 0}
.history-pages{gap:8px;display:flex;align-items:center;margin-top:12px}
.purchasing-tabs{position:relative;display:flex!important;flex-wrap:wrap;gap:8px;padding:0;margin:16px 0}
.purchasing-tabs>.button,.purchasing-tabs .saved-list-wrap>.button{flex:none;width:auto;min-height:40px;padding:9px 13px}
.saved-list-wrap{position:relative}
.saved-dropdown{position:absolute;top:calc(100% + 6px);left:0;min-width:280px;width:min(420px,calc(100vw - 48px));z-index:120;padding:12px;border:1px solid var(--color-border);border-top:2px solid var(--color-border);border-radius:12px;max-height:420px;overflow:auto}
#purchasingToolPanel{overflow:visible}
#supplierHistory{display:grid;gap:6px;margin:10px 0}
#supplierHistory>.button{justify-content:flex-start;text-align:left;width:100%;font-weight:500;white-space:normal}
.supplier-navigation{gap:10px;margin:12px 0;border:0;padding:0}
.supplier-navigation .supplier-tabs{flex:0 1 auto;gap:7px;padding:0;overflow:visible;flex-wrap:wrap}
.supplier-tabs .button{min-height:40px;padding:8px 12px}
.supplier-tabs #addSupplier{width:40px;height:40px;min-width:40px;padding:0;font-size:23px}
.supplier-actions{margin-left:auto;gap:6px}
.supplier-actions .button{min-height:38px;padding:8px 10px;font-size:14px}
.purchasing-cost-cards{display:grid;grid-template-columns:1fr 1fr;align-items:stretch;gap:16px}
.cost-card{margin:0;padding:18px;border-radius:14px;min-width:0;height:auto}
.cost-card h3{font-size:15px;margin:0 0 14px}
.currency-toolbar{display:grid;grid-template-columns:1fr 1fr;gap:12px;align-items:end}
.currency-toolbar>label{grid-column:auto;font-size:14px}
.currency-toolbar>.button{justify-self:start;width:auto}
.expense-grid{gap:12px}
.agent-expense{grid-template-columns:minmax(100px,1fr) minmax(90px,.8fr) 32px;gap:8px}
#addAgentExpense{margin-top:12px;justify-self:start}
.expenses-total{margin-top:14px;padding-top:12px;gap:12px;flex-wrap:wrap;justify-content:space-between}
.table-actions{display:flex;align-items:center;gap:8px;margin:20px 0 10px}
.table-actions h3{font-size:16px;margin:0 auto 0 0}
.table-actions .button{font-size:14px;padding:8px 12px;min-height:38px}
.bulk-table{border-spacing:3px;width:100%;font-size:14px}
.bulk-table th{padding:8px 7px;font-size:14px;line-height:1.35}
.bulk-table td{padding:5px;vertical-align:middle;height:auto;border:1px solid var(--color-border);border-radius:7px}
.bulk-table td input{min-height:38px;height:38px;padding:7px 8px;font-size:14px;border:1px solid var(--color-border);border-radius:6px;max-width:none}
.bulk-table td:first-child input{min-width:160px;width:180px;max-width:none}
.bulk-table td output{font-size:14px;min-width:85px;padding:6px 4px;pointer-events:none}
.bulk-table .row-total{position:relative;padding-right:38px}
.bulk-table .row-total .remove-product{position:absolute;right:4px;top:50%;transform:translateY(-50%)}
.remove-product,.button.remove-button{border:1px solid var(--color-border)!important;border-radius:7px;min-width:30px;width:30px;height:32px;min-height:32px;padding:2px!important;font-size:21px;display:inline-flex;align-items:center;justify-content:center}
.comparison-table td,.comparison-table th{padding:10px 12px;line-height:1.45}
.comparison-table td strong{display:block;font-size:14px;font-weight:650}
.comparison-table td small{font-size:13px;display:block;margin-top:3px}
.comparison-table th:first-child{min-width:200px}
.image-upload-zone{border:2px dashed var(--color-border);border-radius:10px;padding:16px;font-size:14px;min-height:54px;cursor:pointer;flex:1;min-width:180px}
.import-toolbar{display:flex;gap:10px;align-items:center}
.import-edit-table td{padding:4px}
.import-edit-table input{min-height:38px;padding:7px}
#ownProfileForm{display:grid;gap:12px;margin:16px 0}
#ownProfileForm[hidden]{display:none}
#ownAccountRole+.picker-button{font-weight:650}
.market-results-card{padding:14px;border-left:3px solid var(--color-border)}
.reference-heading{margin:0}
.reference-heading h3{font-size:17px;margin:0}
#resultsScope{font-size:13px;line-height:1.4;margin:7px 0 10px}
#marketResults{gap:5px!important;margin:0}
#marketResults .listing.compact-listing{display:grid!important;grid-template-columns:minmax(105px,1.3fr) 58px 82px minmax(90px,1fr)!important;align-items:center;gap:8px!important;padding:8px 10px!important;min-height:42px;border:1px solid var(--color-border);border-radius:8px}
#marketResults .listing-title,#marketResults .listing-price{border:0!important;padding:0!important;margin:0!important;min-height:26px;font-size:14px!important;line-height:1.35!important;border-radius:0;letter-spacing:0}
#marketResults .listing-title{text-align:left;font-weight:600}
#marketResults .listing-storage{font-size:13px;grid-column:auto;grid-row:auto}
#marketResults .listing-price{text-align:right;justify-self:end;font-weight:700}
#marketResults .listing-location{grid-column:auto!important;grid-row:auto!important;font-size:13px;line-height:1.35;text-align:left;margin:0;overflow-wrap:anywhere}
#seeMoreListings{margin-top:9px;min-height:34px;font-size:13px;padding:6px 10px}
.quote-card #exportQuoteButton{width:100%;margin:10px 0 6px}
}
@media screen and (hover:hover){}
@media screen and (max-width:800px){.purchasing-cost-cards{grid-template-columns:1fr}.topbar .brand-logo{width:150px}.supplier-navigation{align-items:flex-start}.supplier-actions{margin-left:0}.purchasing-tabs{display:flex!important}.quote-history-actions>.button{flex:1;min-width:0;max-width:180px}.saved-list-wrap{position:static}.saved-dropdown{left:0}.table-actions{flex-wrap:wrap}.table-actions h3{flex:1 1 100%}.bulk-table td{padding:4px}}
@media screen and (max-width:480px){.topbar{grid-template-columns:minmax(100px,1fr) auto;gap:8px;padding:14px 0 18px}.topbar .brand-logo{width:126px;max-width:100%}.topbar-right{grid-template-columns:36px 36px 64px;grid-template-rows:38px auto;gap:5px!important}.topbar-right #updateAppButton,.topbar-right #accountMenu>summary{width:36px;height:38px;min-height:38px;padding:6px}.topbar-right #signOutButton{min-width:64px;width:64px;height:38px;min-height:38px;padding:7px 5px;font-size:12px}.topbar-right #installAppButton{min-height:34px;padding:7px 10px;font-size:13px}.topbar-right #accountMenu{width:auto}.purchasing-tabs .button,.purchasing-tabs .saved-list-wrap>.button{font-size:13px;padding:8px 10px;min-height:38px}.market-results-card{padding:10px}#marketResults .listing.compact-listing{grid-template-columns:minmax(80px,1fr) 46px 69px minmax(55px,.8fr)!important;padding:7px!important;gap:4px!important}#marketResults .listing-title,#marketResults .listing-price{font-size:13px!important}#marketResults .listing-storage,#marketResults .listing-location{font-size:12px}.cost-card{padding:14px}.currency-toolbar{grid-template-columns:1fr 1fr}.history-toolbar .button{font-size:13px}.table-actions .button{padding:8px 10px}.import-toolbar{flex-wrap:wrap}}
@media screen{.bulk-table td input[data-manual=true]{border-left:3px solid var(--color-border)}.table-actions h3{line-height:1.4}.saved-dropdown input{margin:5px 0}.quote-history-actions .button{white-space:nowrap}}

/* Navy workspace, sky-blue working cards, and a restrained gold accent. */
@media screen {
  .topbar .brand-logo img { filter:brightness(0) invert(1); }
  .card,.access-card { border:1px solid var(--color-border); border-top:1px solid var(--color-border); }
  .cost-card,.price-list-card,.market-results-card { border:1px solid var(--color-border); border-radius:14px; }
  .cost-card h3,.price-list-card h3 { font-weight:750; letter-spacing:.025em; }
  .price-list-card { padding:18px; margin:0; min-width:0; }
  .purchasing-cost-cards { gap:16px; margin-bottom:18px; }
  .supplier-summary { margin-bottom:0; }
  .supplier-summary>div { border:0; border-radius:9px; }
  .market-results-card { border-left:1px solid var(--color-border); }
  .quote-card { border:1px solid var(--color-border); border-top:4px solid var(--color-border); }
  .quote-card #exportQuoteButton { font-weight:750; }
  dialog,#historyDialog,.saved-dropdown,.account-menu-items { border:1px solid var(--color-border); border-top:1px solid var(--color-border); }
  dialog::backdrop { backdrop-filter:blur(3px); }
  .tool-tabs>.button[aria-pressed=true] { border-bottom:4px solid var(--color-border)!important; padding-bottom:6px; }
  input:focus,select:focus,textarea:focus,.picker-button:focus-visible,.button:focus-visible { outline:2px solid var(--color-border); outline-offset:2px; }
  input[aria-invalid=true],textarea[aria-invalid=true],select[aria-invalid=true],input[aria-invalid=true]:focus { border:2px solid var(--color-border)!important; }
  .supplier-navigation { display:flex; align-items:center; flex-wrap:wrap; }
  .supplier-navigation .supplier-tabs { display:flex; align-items:center; flex-wrap:wrap; gap:7px; }
  .supplier-tabs #deleteSupplier { width:36px; height:40px; min-height:40px; margin:0 0 0 2px; }
  .supplier-actions { display:flex; width:auto; gap:8px; margin-left:auto; }
  .supplier-actions .button { flex:0 0 auto; }
  .table-actions { margin:0 0 14px; display:grid; grid-template-columns:1fr auto 1fr; gap:12px; align-items:center; }
  .table-actions h3 { margin:0; font-size:16px; }
  .price-list-actions { display:flex; align-items:center; justify-content:center; gap:8px; }
  .price-list-actions .button { flex:0 0 auto; white-space:nowrap; }
  .bulk-table-wrap:has(#supplierRows) { height:auto; max-height:65vh; border:1px solid var(--color-border); border-radius:9px; }
  .bulk-table:has(#supplierRows) { border-collapse:collapse!important; border-spacing:0!important; min-width:1280px; }
  .bulk-table:has(#supplierRows) th { border:1px solid var(--color-border); }
  .bulk-table:has(#supplierRows) th:first-child { width:175px; }
  .bulk-table:has(#supplierRows) th:nth-child(2) { width:85px; }
  .bulk-table:has(#supplierRows) th:nth-child(3) { width:65px; }
  .bulk-table:has(#supplierRows) th:last-child { width:46px; }
  .bulk-table:has(#supplierRows) th>.column-sort { border-radius:0!important; min-height:56px; }
  #supplierRows td,#supplierRows td:first-child,#supplierRows td:last-child { border:1px solid var(--color-border)!important; border-radius:0!important; padding:0!important; height:46px; }
  #supplierRows input,#supplierRows td:first-child input { height:46px!important; min-height:46px; padding:10px!important; border-radius:0!important; }
  #supplierRows input:focus { outline:2px solid var(--color-border); outline-offset:-2px; }
  #supplierRows td output { display:block; min-width:0; padding:10px; }
  #supplierRows td.row-action { text-align:center; }
  #supplierRows .remove-product { position:static; transform:none; margin:0; width:32px; min-width:32px; height:34px; font-size:22px; }
  .ocr-progress-card { display:flex; gap:18px; align-items:center; justify-content:space-between; position:sticky; top:0; z-index:4; margin:14px 0; padding:18px; border-radius:12px; }
  .ocr-progress-card[hidden] { display:none; }
  .ocr-progress-card>div { flex:1; min-width:0; }
  #ocrProgressLabel { display:block; font-size:23px; line-height:1.3; margin-bottom:10px; font-variant-numeric:tabular-nums; }
  #ocrProgress { display:block; width:100%; height:10px; border:0; border-radius:8px; overflow:hidden; }
  .export-supplier-label { display:grid; gap:8px; margin:18px 0; }
  .password-field { display:block; position:relative; width:100%; }
  .password-field>input { width:100%; padding-right:50px; }
  button.password-toggle { display:grid; place-items:center; position:absolute; right:5px; top:50%; transform:translateY(-50%); width:40px; height:40px; min-height:40px; padding:0; border:0; border-radius:7px; }
  button.password-toggle:active { transform:translateY(-50%); }
  .password-toggle .eye-slash { display:none; }
  .password-toggle[aria-pressed=true] .eye-slash { display:block; }
  .form-notice { padding:14px 16px; border:1px solid; border-radius:10px; line-height:1.5; }
  #changePasswordMessage.error,#staffAccountsMessage:not(:empty) { font-weight:600; }
  #changePasswordMessage.success { display:flex; align-items:center; gap:14px; }
  #changePasswordMessage.success::after { content:'✓'; font-size:26px; font-weight:800; flex:none; margin-left:auto; }
  .account-settings-actions,.account-mode-tabs { display:flex; align-items:center; gap:10px; margin-top:18px; flex-wrap:wrap; }
  .account-mode-tabs { margin:18px 0; }
  #accountSettingsActions[hidden],#staffCreateForm[hidden],#staffListPanel[hidden] { display:none; }
  .account-settings-actions .button,#ownProfileForm .dialog-actions .button { flex:0 1 auto; min-height:44px; margin:0; }
  #ownProfileForm .dialog-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
  #staffCreateForm { display:grid; gap:12px; }
  #staffCreateForm label,#staffPasswordFields { display:grid; gap:8px; }
  #staffCreateForm>.button { width:auto; justify-self:start; margin:0; }
  #staffAccountsList { display:grid; gap:12px; }
  #staffAccountsList .history-card { margin:0; padding:16px; border:1px solid var(--color-border); border-radius:12px; }
  #staffAccountsList h3 { margin-top:0; }
}
@media screen and (hover:hover) {
  .button[aria-pressed=true]:hover { transform:none; }
}
@media screen and (max-width:800px) {
  .purchasing-cost-cards { grid-template-columns:1fr; }
  .supplier-actions { margin-left:0; }
  .table-actions { grid-template-columns:1fr; justify-items:center; gap:10px; }
  .table-actions h3 { text-align:center; }
  .price-list-card { padding:14px; }
  .account-settings-actions .button { flex:1; }
}
@media screen and (max-width:480px) {
  .price-list-card { padding:12px 10px; }
  .price-list-actions { gap:7px; flex-wrap:wrap; }
  .price-list-actions .button { padding:9px 11px; min-height:42px; font-size:13px; }
  .ocr-progress-card { padding:14px; gap:10px; }
  #ocrProgressLabel { font-size:20px; }
  #cancelOCR { padding:8px 10px; }
  #ownProfileForm .dialog-actions { display:grid; grid-template-columns:1fr 1fr; }
  #ownProfileForm .dialog-actions .button { width:100%; min-width:0; padding:9px; }
}

/* v24: sky workspace, readable quote, compact tables and clear feedback. */
@media screen {
  .card,.access-card,.quote-card { border:1px solid var(--color-border)!important; }
  .future-profit-bar { border:1px solid var(--color-border)!important; }
  .future-profit-bar .future-profit { font-weight:800; }
  .percent-field { position:relative; display:block; }
  .percent-field input { padding-right:40px; width:100%; }
  .percent-field>span { position:absolute; top:50%; right:14px; transform:translateY(-50%); font-weight:700; pointer-events:none; }
  #searchDescription { font-size:23px; line-height:1.35; font-weight:800; }
  #searchButton[aria-disabled=true] { opacity:.55; cursor:not-allowed; }
  .close-button { display:inline-grid; place-items:center; width:36px; height:36px; min-width:36px; min-height:36px; padding:0; flex:none; font-size:24px; line-height:1; }
  .password-field>input { display:block; margin:0!important; padding-right:48px!important; min-height:48px; }
  button.password-toggle,button.password-toggle:hover,button.password-toggle:active { top:0!important; bottom:0!important; right:4px!important; margin:auto 0!important; transform:none!important; height:40px; width:40px; min-height:40px; display:grid; place-items:center; padding:0!important; }
  button.password-toggle svg { display:block; pointer-events:none; }
  #staffAccountsDialog { width:min(520px,calc(100vw - 28px)); padding:20px; max-height:88dvh; }
  #staffAccountsDialog>.dialog-heading { margin-bottom:10px; }
  #staffAccountsDialog>p { font-size:14px; margin:10px 0; }
  #staffCreateForm { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
  #staffCreateForm h3,#staffRoleWrap,#staffPasswordFields,#staffCreateForm .microcopy { grid-column:1/-1; }
  #staffCreateForm label { min-width:0; }
  #staffPasswordFields { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
  #staffPasswordHint { grid-column:1/-1; margin:0; }
  #staffCreateForm input { min-width:0; width:100%; }
  #staffListPanel,#staffCreateForm { min-height:300px; }
  #staffCreateForm[hidden],#staffListPanel[hidden],#staffPasswordHint[hidden] { display:none; }
  .account-mode-tabs { margin:12px 0; gap:8px; }
  .account-mode-tabs .button { flex:1; min-width:0; }
  .account-details { margin-bottom:14px; }
  .table-actions { display:flex; justify-content:flex-start; flex-wrap:wrap; gap:12px; }
  .table-actions h3 { margin:0; flex:0 0 auto; }
  .price-list-actions { justify-content:flex-start; }
  .bulk-table:has(#supplierRows) { min-width:1340px; }
  .bulk-table:has(#supplierRows) th { text-align:center; vertical-align:middle; }
  .bulk-table:has(#supplierRows) th .column-sort { text-align:center; justify-content:center; }
  .bulk-table:has(#supplierRows) th:first-child { width:42px; }
  .bulk-table:has(#supplierRows) th:nth-child(2) { width:175px; }
  .bulk-table:has(#supplierRows) th:nth-child(3) { width:85px; }
  .bulk-table:has(#supplierRows) th:nth-child(4) { width:65px; }
  #supplierRows td,#supplierRows td:first-child,#supplierRows td:last-child { border-top:2px solid var(--color-border)!important; border-bottom:2px solid var(--color-border)!important; }
  #supplierRows .row-number,.import-edit-table .row-number { text-align:center; font-weight:650; user-select:none; }
  .row-action-heading { padding:0!important; }
  .visually-hidden { position:absolute!important; width:1px!important; height:1px!important; padding:0!important; margin:-1px!important; overflow:hidden!important; clip:rect(0,0,0,0)!important; white-space:nowrap!important; border:0!important; }
  .import-edit-table th:first-child { width:40px; }
  .import-edit-table th:nth-child(2) { width:35%; }
  .import-edit-table th { text-align:center; }
  .agent-expense { display:grid; grid-template-columns:minmax(100px,1fr) minmax(90px,.8fr) 34px; align-items:end; gap:8px; }
  .agent-expense .remove-product { grid-column:auto; height:42px; min-height:42px; margin:0 0 1px; align-self:end; }
  .rate-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; grid-column:1/-1; }
  .rate-actions .button { width:auto; min-height:40px; flex:0 1 auto; }
  #ocrProgressLabel { font-size:19px; margin-bottom:8px; }
  .ocr-progress-card { padding:14px 16px; }
  .global-loading { position:fixed; right:20px; bottom:20px; z-index:3000; display:flex; align-items:center; gap:10px; padding:12px 18px; border-radius:12px; border:1px solid var(--color-border); pointer-events:none; font-weight:600; }
  .global-loading[hidden] { display:none; }
  .loading-ring { display:inline-block; width:20px; height:20px; border:3px solid var(--color-border); border-radius:50%; animation:kaya-spin .75s linear infinite; }
  .ocr-progress-card:before { content:''; display:block; width:20px; height:20px; border:3px solid var(--color-border); border-radius:50%; animation:kaya-spin .75s linear infinite; flex:none; }
  @keyframes kaya-spin { to { transform:rotate(360deg); } }
}
@media screen and (hover:hover) {
}
@media screen and (max-width:600px) {
  .topbar { grid-template-columns:minmax(105px,1fr) auto; gap:8px; }
  .topbar-right { width:auto; grid-template-columns:38px 38px 66px!important; grid-template-rows:40px auto; align-items:center!important; gap:5px!important; }
  .topbar-right #updateAppButton,.topbar-right #accountMenu>summary { width:38px; height:40px; min-height:40px; padding:7px; margin:0; }
  .topbar-right #accountMenu { height:40px; min-height:40px; padding:0!important; margin:0!important; align-self:center; }
  .topbar-right #signOutButton { height:40px; min-height:40px; min-width:66px; width:66px; }
  .tool-tabs { display:grid!important; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:8px; }
  .tool-tabs .button { width:100%; min-width:0; margin:0; padding:10px 8px; font-size:14px; min-height:46px; }
  .table-actions { gap:8px; }
  .table-actions h3 { font-size:14px; }
  .price-list-actions { gap:6px; }
  .price-list-actions .button { padding:8px; font-size:13px; }
  #searchDescription { font-size:21px; }
  #staffAccountsDialog { padding:18px 14px; }
  #staffCreateForm,#staffPasswordFields { grid-template-columns:1fr; }
  #staffListPanel,#staffCreateForm { min-height:310px; }
  .global-loading { right:12px; bottom:12px; font-size:14px; }
}
@media (prefers-reduced-motion:reduce) { .loading-ring,.ocr-progress-card:before { animation-duration:2s; } }

@media screen {
  .topbar .brand-logo img { filter:brightness(0); }
  #staffAccountsDialog { height:min(620px,88dvh); overflow:auto; }
}

/* v25: consistent dialogs, button-local progress, scrollable working tables. */
#accountSettingsDialog,#changePasswordDialog,#staffAccountsDialog,#activityLogDialog,#editActivityDialog {
  box-sizing:border-box; width:min(520px,calc(100vw - 24px)); max-width:520px;
  height:min(620px,88dvh); max-height:88dvh; overflow:auto; padding:22px;
}
#ownAccountRole:disabled { opacity:1; cursor:default; }
#quoteStatus:empty { display:none; }
.button.is-loading,button.is-loading,summary.is-loading { position:relative; pointer-events:none; }
.is-loading>* { opacity:0; }
.button.is-loading::after,button.is-loading::after,summary.is-loading::after {
  content:''; position:absolute; width:18px; height:18px; box-sizing:border-box; left:calc(50% - 9px); top:calc(50% - 9px);
  border:3px solid var(--color-border); border-radius:50%; animation:kaya-spin .7s linear infinite;
}
.close-button,.remove-product,.remove-button,button.close-button:not(.primary),button.remove-product:not(.primary),button.remove-button:not(.primary) { border:1px solid var(--color-border)!important; min-width:36px; min-height:36px;
}
.bulk-table-wrap:has(#supplierRows),.import-preview { overscroll-behavior:auto; touch-action:pan-x pan-y; -webkit-overflow-scrolling:touch; }
#supplierRows input,#supplierRows td { touch-action:pan-x pan-y; }
.exchange-result { grid-column:1/-1; display:flex; gap:10px; align-items:flex-end; flex-wrap:wrap; }
.exchange-result>label { flex:1 1 150px; min-width:120px; }
.exchange-result .rate-actions { flex:0 1 auto; margin:0 0 1px; display:flex; gap:8px; align-items:center; }
.exchange-result .button { width:auto; padding:10px 12px; white-space:nowrap; min-height:44px; }
.agent-expense-footer { display:flex; align-items:center; flex-wrap:wrap; gap:10px 16px; margin-top:12px; }
.agent-expense-footer #addAgentExpense { margin:0; flex:0 0 auto; }
.agent-expense-breakdown { display:flex; flex-wrap:wrap; gap:6px 14px; font-size:14px; line-height:1.5; }
.agent-expense-breakdown>span { white-space:normal; }
.supplier-summary>div>span { font-size:16px; line-height:1.25; }
.supplier-summary>div>strong { font-size:clamp(20px,2vw,25px); line-height:1.3; overflow-wrap:anywhere; }
@keyframes kaya-spin { to { transform:rotate(360deg); } }
@media(max-width:600px) {
  #accountSettingsDialog,#changePasswordDialog,#staffAccountsDialog,#activityLogDialog,#editActivityDialog { padding:18px 15px; }
  .exchange-result { gap:8px; }.exchange-result .button { font-size:13px; padding:9px; }
}

/* v26: compact paired actions and stable, high-resolution branding. */
@media screen {
  .topbar { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:12px; align-items:center; padding:12px 0; min-height:96px; }
  .topbar .brand-logo { display:block; width:min(250px,100%); max-width:100%; min-width:0; margin:0; align-self:center; }
  .topbar .brand-logo img { display:block; width:100%; height:auto; object-fit:contain; image-rendering:auto; }
  .topbar-right { display:grid!important; grid-template-columns:40px 40px max-content; grid-template-rows:40px auto; gap:5px 6px!important; width:max-content; max-width:none; margin:0; padding:0; align-items:center; justify-content:end; }
  .topbar-right #updateAppButton { grid-column:1; grid-row:1; }
  .topbar-right #accountMenu { grid-column:2; grid-row:1; margin:0; padding:0; border:0!important; width:40px; min-width:0; }
  .topbar-right #signOutButton { grid-column:3; grid-row:1; width:auto; min-width:62px; padding:8px 10px; margin:0; }
  .topbar-right #updateAppButton,.topbar-right #accountMenu>summary { width:40px; min-width:40px; height:40px; min-height:40px; margin:0; padding:8px; border-width:1px; display:grid; place-items:center; }
  .topbar-right #signOutButton { height:40px; min-height:40px; font-size:14px; }
  .topbar-right #installAppButton { grid-column:1/-1; grid-row:2; justify-self:end; width:auto; min-height:32px; height:32px; margin:0; padding:5px 10px; font-size:13px; }
  .account-menu-items { right:-74px; top:calc(100% + 6px); }
  .access-loading-logo { width:min(320px,100%); margin:0 auto 14px; }
  .access-loading-logo img { display:block; width:100%; height:auto; filter:brightness(0); image-rendering:auto; }
  .button { min-height:40px; padding:9px 12px; font-size:14px; line-height:1.3; }
  .tool-tabs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); width:fit-content; max-width:100%; gap:7px; margin:0 0 12px; }
  .tool-tabs>.button { width:100%; min-width:0; min-height:42px; padding:9px 14px; }
  .tool-tabs>.button[aria-pressed=true],.tool-tabs>.button[aria-pressed=true]:hover { border:1px solid var(--color-border)!important; padding:9px 14px; }
  .card,.cost-card,.market-results-card,.quote-card,.access-card,.picker-panel,.account-menu-items,.saved-dropdown,#historyDialog { border-width:1px!important; }
  button.close-button:not(.primary),.close-button { border:1px solid var(--color-border)!important; }
  button.remove-product:not(.primary),button.remove-button:not(.primary),.remove-product,.remove-button { border:1px solid var(--color-border)!important; }
  .quote-card .quote-caption,.quote-card .topup-row>span { font-size:14px; line-height:1.4; font-weight:500; }
  .quote-card .quote-caption { margin:14px 0 4px; }
  .quote-card .credit-amount { margin-bottom:12px; }
  .quote-card .topup-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:10px; padding:12px 14px; margin:0; border:1px solid var(--color-border); border-radius:12px; }
  .quote-card .topup-row strong { font-size:26px; line-height:1.25; letter-spacing:-.4px; margin:0; text-align:right; max-width:100%; }
  .quote-card .staff-profit { margin:10px 0 0; }
  .quote-card .profit-toggle { padding:9px 12px; min-height:40px; line-height:1.25; font-size:14px; }
  .quote-card .profit-details { margin:10px 0; gap:8px; }
  .quote-card .profit-details .combined { padding-top:8px; }
  .quote-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; margin-top:8px; align-items:stretch; }
  .quote-card .quote-actions .button,.quote-card .quote-actions #exportQuoteButton,.quote-card .quote-actions #saveQuoteButton { width:100%; margin:0; padding:9px 10px; min-height:40px; height:100%; white-space:normal; line-height:1.3; font-size:14px; }
  .quote-card #nextFieldButton { width:100%; margin:8px 0 0; padding:9px 10px; min-height:40px; }
  #saveMessage:empty,#priceImportMessage:empty,#ocrCurrencyNote:empty,#supplierMessage:empty { display:none; margin:0; }
  .quote-card #saveMessage { margin:8px 0 0; }
  .staged-image-upload { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; align-items:end; margin:12px 0; }
  .staged-image-upload label { min-width:0; font-size:14px; }
  #pastePriceImage { display:block; width:100%; min-width:0; margin-top:5px; text-overflow:ellipsis; }
  .image-upload-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; align-self:end; }
  .image-upload-actions .button { height:44px; min-height:44px; width:100%; padding:9px 10px; white-space:nowrap; }
  #priceImportDialog .dialog-heading h2 { margin-bottom:8px; }
  #priceImportDialog>label { margin:12px 0; }
  #priceImportDialog .dialog-actions { margin-top:10px; gap:7px; }
  #priceImportDialog .image-preview-button img { margin:8px auto; max-height:220px; }
  .price-list-actions,.supplier-actions,.quote-history-actions,.export-actions,.import-preview-actions { gap:7px; }
  .supplier-actions { display:grid; grid-auto-flow:column; grid-auto-columns:1fr; width:fit-content; max-width:100%; }
  .supplier-actions .button { margin:0; padding:8px 10px; min-height:40px; width:100%; }
  .purchasing-tabs { display:grid!important; grid-template-columns:repeat(3,minmax(0,1fr)); width:fit-content; max-width:100%; gap:6px; padding:4px; }
  .purchasing-tabs .button,.purchasing-tabs .saved-list-wrap>.button { width:100%; min-width:0; padding:8px 10px; min-height:40px; white-space:normal; height:100%; }
  .purchasing-tabs .saved-list-wrap { min-width:0; }
  .price-list-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); width:fit-content; max-width:100%; }
  .price-list-actions .button { min-width:0; width:100%; padding:8px 10px; white-space:normal; }
}
@media screen and (max-width:700px) {
  .app-shell { padding-left:12px; padding-right:12px; }
  .topbar { min-height:90px; gap:8px; padding:10px 0; }
  .topbar .brand-logo { width:min(218px,100%); }
  .topbar-right { grid-template-columns:38px 38px 62px; gap:4px 5px!important; }
  .topbar-right #accountMenu { width:38px; }
  .topbar-right #updateAppButton,.topbar-right #accountMenu>summary { width:38px; min-width:38px; height:40px; min-height:40px; padding:7px; }
  .topbar-right #signOutButton { min-width:62px; width:62px; padding:8px 6px; font-size:13px; }
  .topbar-right #installAppButton { min-height:32px; padding:5px 9px; }
  .account-menu-items { right:-67px; }
  .tool-tabs,.purchasing-tabs { width:100%; margin-bottom:10px; }
  .tool-tabs>.button,.purchasing-tabs .button { min-height:44px; }
  .card,.quote-card,.cost-card { padding:14px!important; border-radius:14px; }
  .main-column { gap:12px; }
  .section-heading { margin-bottom:12px; }
  .section-heading h2 { font-size:20px; }
  .field-grid,.pricing-grid { gap:12px 10px; }
  .field-grid input,.field-grid select,.picker-button { min-height:44px; }
  .quote-customer { gap:10px; margin:12px 0; }
  .quote-card .topup-row { padding:11px 12px; }
  .quote-card .topup-row strong { font-size:24px; }
  .quote-card .quote-actions .button,.quote-card .quote-actions #exportQuoteButton,.quote-card .quote-actions #saveQuoteButton { min-height:44px; padding:8px; }
  .quote-history-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); width:100%; margin-bottom:10px; }
  .quote-history-actions>.button { min-width:0; max-width:none; min-height:44px; width:100%; padding:8px; }
  .list-toolbar { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; }
  .list-toolbar>label { grid-column:1/-1; min-width:0; }
  .list-toolbar>.button { width:100%; min-width:0; min-height:44px; height:100%; padding:8px; white-space:normal; }
  .supplier-navigation { margin:12px 0 8px; padding:0; display:flex; flex-wrap:wrap; gap:8px; }
  .supplier-navigation .supplier-tabs { padding:0; min-width:0; flex:1 1 100%; }
  .supplier-actions { padding:0; gap:7px; margin:0; }
  .active-supplier-name { margin:10px 0; }
  .purchasing-cost-cards { gap:12px; }
  .expense-grid { gap:10px; }
  .expenses-total { margin-top:10px; padding:10px 0 0; gap:8px; }
  .table-actions { margin:0 0 10px; gap:8px; }
  .table-actions h3 { flex:0 0 auto; }
  .price-list-actions { flex:1 1 210px; }
  .supplier-summary { padding:10px; gap:8px; margin-top:10px; }
  .supplier-summary>div { padding:10px; }
  .staged-image-upload { grid-template-columns:1fr; gap:8px; }
  .image-upload-actions { width:100%; }
  #priceImportDialog textarea { min-height:120px; }
  .dialog-heading h2 { margin-bottom:12px; }
  .dialog-actions { margin-top:14px; gap:7px; }
  .dialog-actions .button { min-height:44px; padding:8px 10px; }
  #accountSettingsDialog,#changePasswordDialog,#staffAccountsDialog,#activityLogDialog,#editActivityDialog { height:auto; max-height:88dvh; }
  #staffListPanel,#staffCreateForm { min-height:0; }
  .access-card { margin:12px auto; padding:22px 18px; }
  .access-choices { margin:16px 0; }
}

/* v27: aligned mobile purchase actions and matching quote value cards. */
@media screen {
  #customerSection .section-heading h2,#marketSection .section-heading h2,#newSection .section-heading h2 { font-weight:800; }
  .quote-card .quote-top .eyebrow { font-size:18px; font-weight:800; letter-spacing:0; margin:0; text-transform:none; }
  .quote-card .phone-value-row { margin-bottom:8px; }
  .quote-card .phone-value-row .credit-amount { margin:0; font-weight:700; }
  #priceSource:empty,#supplierSaveStatus:empty,#unsavedMessage:empty { display:none; }
  #unsavedDialog { width:min(440px,calc(100vw - 24px)); }
  #unsavedDialog .dialog-actions { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; margin-top:16px; }
  #unsavedDialog .dialog-actions .button { min-width:0; width:100%; min-height:44px; height:100%; padding:9px 7px; font-size:14px; line-height:1.3; justify-content:center; white-space:normal; }
}
@media screen and (max-width:700px) {
  #purchasingToolPanel .purchasing-heading { margin-bottom:12px; gap:4px; }
  #purchasingToolPanel .list-toolbar { grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px 6px; align-items:stretch; }
  #purchasingToolPanel .list-toolbar>label { margin:0; }
  #purchasingToolPanel .list-toolbar>.button { min-height:44px; min-width:0; padding:8px 6px; font-size:14px; line-height:1.3; border-radius:9px; justify-content:center; }
  #purchasingToolPanel .purchasing-tabs { width:100%; margin:10px 0; padding:0; gap:6px; grid-template-columns:repeat(3,minmax(0,1fr)); align-items:stretch; }
  #purchasingToolPanel .purchasing-tabs>.button,#purchasingToolPanel .purchasing-tabs>.saved-list-wrap { grid-column:auto; min-width:0; width:100%; justify-self:stretch; }
  #purchasingToolPanel .purchasing-tabs .button { width:100%; min-width:0; min-height:48px; height:100%; padding:6px; font-size:14px; line-height:1.25; border-radius:9px; justify-content:center; }
  #purchasingToolPanel .supplier-navigation { display:grid; grid-template-columns:minmax(0,1fr); gap:8px; margin:8px 0; align-items:stretch; }
  #purchasingToolPanel .supplier-tabs { width:100%; min-width:0; gap:6px; padding:0; margin:0; align-items:center; }
  #purchasingToolPanel .supplier-tabs>.button { min-width:0; max-width:100%; min-height:44px; padding:8px 12px; font-size:14px; line-height:1.3; white-space:normal; overflow-wrap:anywhere; justify-content:center; }
  #purchasingToolPanel .supplier-tabs #addSupplier,#purchasingToolPanel .supplier-tabs #deleteSupplier { flex:0 0 44px; width:44px; height:44px; min-height:44px; padding:0; font-size:23px; }
  #purchasingToolPanel .supplier-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); grid-auto-flow:row; width:100%; margin:0; padding:0; gap:6px; }
  #purchasingToolPanel .supplier-actions>.button { min-width:0; width:100%; min-height:44px; height:100%; margin:0; padding:8px 6px; font-size:14px; line-height:1.3; white-space:normal; justify-content:center; }
  #purchasingToolPanel .active-supplier-name { margin:12px 0 8px; }
}

/* v28: stable controls, blue-white surfaces and progress inside the photo. */
@media screen {
  #adminBar:not(:has(> :not([hidden]))) { display:none; margin:0; }
  .topbar { min-height:0; padding:8px 0; }
  .tool-tabs { margin-top:0; margin-bottom:8px; }
  .topbar-right #updateAppButton { display:grid; place-items:center; padding:0; line-height:1; }
  #updateAppButton svg { display:block; width:22px; height:22px; flex:none; }
  .field-grid>label,.currency-toolbar>label,.exchange-result>label { min-width:0; }
  .field-picker { width:100%; max-width:100%; min-width:0; }
  button.picker-button { display:grid; grid-template-columns:minmax(0,1fr) auto; width:100%; min-width:0; max-width:100%; height:44px; min-height:44px; padding:10px 11px; gap:8px; line-height:1.3; }
  .picker-value { display:block; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .picker-button::after { justify-self:end; }
  .currency-toolbar { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:0; }
  .currency-toolbar .field-picker { margin-top:5px; }
  .exchange-result { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,224px); align-items:end; gap:8px; }
  .exchange-result>label { min-width:0; }
  .exchange-result .rate-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); grid-column:2; width:100%; gap:6px; margin:0; }
  .exchange-result .rate-actions .button { width:100%; min-width:0; height:44px; min-height:44px; padding:8px 6px; font-size:14px; line-height:1.2; justify-content:center; white-space:normal; }
  .exchange-result input { height:44px; min-height:44px; }
  .card { padding:18px; }
  .section-heading { margin-bottom:12px; }
  .cost-card { padding:14px; }
  .cost-card h3 { margin-bottom:10px; }
  .purchasing-cost-cards { margin-bottom:12px; gap:12px; }
  .search-summary { gap:8px; padding:0; margin:0 0 10px; align-items:center; }
  .search-summary>div { min-width:0; }
  .search-summary #searchDescription { line-height:1.3; }
  .quote-history-actions { margin-bottom:10px; }
  .quote-customer { margin:12px 0; gap:10px; }
  .photo-input-wrap { position:relative; display:block; }
  #pastePriceImage { padding-right:44px; }
  button.photo-clear { position:absolute; right:5px; top:50%; transform:translateY(-50%); display:grid; place-items:center; width:32px; min-width:32px; height:32px; min-height:32px; padding:0; font-size:22px; line-height:1; border-radius:7px; }
  button.photo-clear:active { transform:translateY(-50%); }
  #imageZoomPanel { position:relative; height:180px; overflow:hidden; margin:8px 0; border:1px solid var(--color-border); border-radius:10px; }
  #imageZoomPanel .image-preview-button { height:100%; margin:0; border-radius:0; }
  #priceImportDialog #imageZoomPanel img { display:block; width:100%; max-width:100%; height:100%; max-height:100%; margin:0; border:0; border-radius:0; object-fit:contain; }
  #imageZoomPanel .ocr-progress-card { position:absolute; inset:0; z-index:4; display:flex; flex-direction:column; justify-content:center; align-items:center; gap:10px; margin:0; padding:16px; border-radius:0; }
  #imageZoomPanel .ocr-progress-card::before { display:none; }
  #imageZoomPanel .ocr-progress-card>div { flex:none; width:100%; min-width:0; text-align:center; }
  #ocrProgressLabel { font-size:18px; line-height:1.3; margin:0 0 8px; font-variant-numeric:tabular-nums; }
  #ocrProgress { height:7px; }
  #cancelOCR { width:100px; min-width:100px; height:36px; min-height:36px; padding:6px 10px; justify-content:center; font-size:14px; }
  #priceImportDialog #priceImportMessage { display:block; min-height:21px; margin:6px 0; font-size:14px; line-height:1.5; }
  #priceImportDialog #priceImportMessage:empty { display:block; }
  #priceImportDialog .staged-image-upload { margin:8px 0; }
  #priceImportDialog>label { margin:10px 0; }
  #priceImportDialog .dialog-actions { margin-top:8px; }
}
@media screen and (max-width:800px) {
  .exchange-result { grid-template-columns:minmax(0,1fr); }
  .exchange-result .rate-actions { grid-column:1; }
}
@media screen and (max-width:700px) {
  .topbar { min-height:0; padding:6px 0; gap:8px; }
  .tool-tabs { margin-bottom:8px; }
  .card,.quote-card,.cost-card { padding:12px!important; }
  .main-column { gap:10px; }
  .section-heading { margin-bottom:10px; }
  .topbar-right #updateAppButton { padding:0; }
  button.picker-button { font-size:16px; }
  .field-grid,.pricing-grid { gap:10px; }
  #imageZoomPanel { height:160px; }
  #priceImportDialog { padding:16px 12px; }
}

/* v29: direct sign-in, quiet header icons and automatic photo reading. */
@media screen {
  body { min-height:100vh; }
  .topbar-right { grid-template-columns:40px 40px 40px!important; }
  .topbar-right #updateAppButton,.topbar-right #accountMenu>summary,.topbar-right #signOutButton { width:40px!important; min-width:40px!important; height:40px; min-height:40px; padding:0!important; display:grid; place-items:center; border:0!important; }
  #signOutButton svg { display:block; width:22px; height:22px; }
  .topbar-right .account-menu-items { right:-46px; }
  .topbar-right:not(:has(#signOutButton:not([hidden]))) { grid-template-columns:40px auto!important; grid-template-rows:40px; gap:6px!important; align-items:center; }
  .topbar-right:not(:has(#signOutButton:not([hidden]))) #installAppButton { grid-column:2; grid-row:1; justify-self:end; height:36px; min-height:36px; margin:0; }
  .topbar-right:not(:has(#signOutButton:not([hidden]))) #updateAppButton { grid-column:1; grid-row:1; }
  #accessGate { width:min(440px,100%); margin:16px auto; padding:22px; }
  #accessGate h1 { margin:0; font-size:23px; line-height:1.25; }
  #accessIntro { margin:8px 0 0; font-size:14px; }
  #accessGate #adminForm { margin-top:16px; gap:12px; }
  #adminForm label { gap:5px; }
  #adminForm input { margin-top:0; }
  #adminForm .remember-login { display:flex; align-items:center; gap:8px; font-size:14px; font-weight:400; }
  #adminForm #rememberLogin { appearance:auto; width:18px; min-width:18px; height:18px; min-height:18px; padding:0; margin:0; }
  #adminSubmit { width:100%; justify-content:center; min-height:44px; }
  #accessMessage:empty { display:none; margin:0; }
  #accessMessage { margin:12px 0 0; }
  #searchDescription.search-placeholder { font-size:14px!important; font-weight:500!important; letter-spacing:-.1px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .search-summary { margin-bottom:8px; }
  button.remove-product,button.remove-product:not(.primary),button.remove-button,button.remove-button:not(.primary),#supplierRows .remove-product { border:1px solid var(--color-border)!important; }
  #clearPriceImage,#clearPriceImage:hover,#clearPriceImage:active { top:0; bottom:0; right:5px; margin:auto 0; transform:none!important; transition:background .12s,border-color .12s; user-select:none; -webkit-user-select:none; -webkit-touch-callout:none; touch-action:manipulation; }
  .image-upload-actions { grid-template-columns:1fr; }
  #selectPriceImage { min-width:120px; }
}
@media screen and (max-width:700px) {
  #accessGate { margin:12px auto; padding:18px 16px; }
  .topbar .brand-logo { width:min(230px,100%); }
  .topbar-right #accountMenu { width:40px; }
  .staged-image-upload { grid-template-columns:minmax(0,1fr) 110px; gap:8px; }
  #selectPriceImage { min-width:0; width:110px; padding:8px; font-size:14px; }
}

/* v30: clear comparison cards and compact, aligned controls. */
#accessGate.access-card { border:1px solid var(--color-border)!important; }
#accessGate input::placeholder { opacity:1; }
#accessLoadingLogo img { filter:brightness(0) invert(1); width:100%; height:auto; object-fit:contain; }
.topbar-right { grid-template-columns:40px 40px 88px!important; }
.topbar-right #signOutButton { width:88px!important; min-width:88px!important; display:flex; align-items:center; justify-content:center; gap:5px; font-size:14px; white-space:nowrap; }
.topbar-right .account-menu-items { right:-94px; }
.topbar-right #updateAppButton svg { width:22px; height:22px; }
.button,.inline-actions>.button,.dialog-actions>.button,.list-toolbar>.button,.purchasing-tabs>.button,.purchasing-tabs>.saved-list-wrap>.button { min-height:42px; line-height:1.2; }
.inline-actions,.section-action-heading { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.section-action-heading { justify-content:space-between; margin-bottom:12px; }
.section-action-heading h3 { margin:0; font-size:18px; }
.section-action-heading .button { padding:9px 14px; margin:0; }
.purchasing-tabs { display:flex; flex-wrap:wrap; align-items:stretch; gap:8px; }
.purchasing-tabs>.button,.purchasing-tabs>.saved-list-wrap { flex:1 1 130px; width:auto; min-width:0; }
.purchasing-tabs>.saved-list-wrap>.button { width:100%; height:100%; }
.purchasing-tabs>.button { padding:9px 12px; }
.comparison-card { margin-top:12px; padding:16px; border-radius:18px; border:1px solid var(--color-border); }
.comparison-legend { display:flex; flex-wrap:wrap; gap:6px; }
.comparison-legend span { padding:5px 9px; border-radius:8px; font-size:12px; font-weight:600; }
.comparison-table,.competitor-table { border-collapse:separate!important; border-spacing:5px 6px; min-width:740px; table-layout:auto; }
.comparison-table th,.comparison-table td,.competitor-table th,.competitor-table td { border:1px solid var(--color-border)!important; border-radius:10px!important; padding:12px!important; text-align:center; vertical-align:middle; }
.comparison-table thead th,.competitor-table thead th { min-width:155px; font-size:13px; }
.comparison-table thead th:first-child,.competitor-table thead th:nth-child(2) { min-width:175px; }
.comparison-table tbody th,.competitor-table tbody th { text-align:left; font-weight:650; }
.comparison-table td strong,.comparison-table th strong { display:block; font-size:16px; }
.comparison-table small { display:block; margin-top:4px; font-size:12px; white-space:nowrap; }
.comparison-rank { display:inline-block; font-size:11px; margin-top:4px; font-weight:600; }
.comparison-table tbody tr:hover td { filter:brightness(1.015); }
.competitor-table input { width:124px; min-width:100px; text-align:right; border:1px solid var(--color-border); border-radius:8px; padding:9px 10px; }
.competitor-table .row-number,.competitor-table th:first-child { min-width:36px; width:36px; }
.competitor-table output { font-weight:700; }
#supplierRows tr td { transition:background-color .12s ease; }
#supplierRows input:focus { outline:2px solid var(--color-border); }
.quote-card .quote-customer { padding:12px; margin:8px 0 12px; border:1px solid var(--color-border); border-radius:12px; }
.future-profit-bar { display:flex; align-items:center; justify-content:flex-start; gap:12px; }
.future-profit-bar .future-profit { margin:0; flex:0 1 auto; }
#editNotice:empty,#supplierEmpty:empty { display:none; }
button.remove-product,button.remove-button,button.delete-button,#deleteSupplier,#clearPriceImage,.close-button { width:34px!important; height:34px!important; min-width:34px!important; min-height:34px!important; max-width:34px; padding:0!important; display:inline-grid; place-items:center; flex:0 0 34px; aspect-ratio:1; border-radius:7px!important; line-height:1; }
#clearPriceImage { width:30px!important; height:30px!important; min-width:30px!important; min-height:30px!important; }
#accountSettingsDialog,#changePasswordDialog,#staffAccountsDialog,#activityLogDialog,#editActivityDialog { height:auto!important; min-height:0; max-height:88dvh; padding:20px; }
#accountSettingsDialog .account-details { margin:8px 0 14px; gap:8px 12px; }
#accountSettingsDialog .account-details dd { margin:0; }
#accountSettingsDialog p:empty,#staffAccountsDialog p:empty { display:none; }
#accountSettingsDialog .account-settings-actions,#accountSettingsDialog .dialog-actions { margin-top:12px; gap:8px; }
#staffAccountsDialog>p { margin:8px 0; font-size:13px; line-height:1.45; }
#staffAccountsDialog h3 { margin:10px 0 6px; font-size:16px; }
#staffCreateForm { gap:10px; }
#staffCreateForm label,#ownProfileForm label { margin:8px 0; }
#staffPasswordFields { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
#staffPasswordFields>p { grid-column:1/-1; }
@media(max-width:650px){
 .topbar { gap:8px; }
 .topbar-right { grid-template-columns:34px 34px 78px!important; gap:3px!important; }
 .topbar-right #updateAppButton,.topbar-right #accountMenu>summary,.topbar-right #accountMenu { width:34px!important; min-width:34px!important; }
 .topbar-right #signOutButton { width:78px!important; min-width:78px!important; font-size:13px; }
 .topbar-right .account-menu-items { right:-81px; }
 .purchasing-tabs { display:grid; grid-template-columns:1fr 1fr; gap:7px; }
 .purchasing-tabs>.button,.purchasing-tabs>.saved-list-wrap { width:100%; min-width:0; }
 .comparison-card { padding:10px; }
 .section-action-heading { gap:8px; }
 .section-action-heading .inline-actions { flex:1 1 auto; }
 .section-action-heading .inline-actions>.button { flex:1; font-size:13px; padding:9px; }
 .quote-card .quote-customer { padding:10px; gap:8px; }
 .future-profit-bar { justify-content:flex-start; gap:10px; }
 #accountSettingsDialog,#staffAccountsDialog { padding:16px; }
 #staffPasswordFields { grid-template-columns:1fr; gap:0; }
}
.future-profit-bar { flex-direction:row; flex-wrap:wrap; }
#staffListPanel,#staffCreateForm { min-height:0; }
.bulk-table:has(#supplierRows) { border-collapse:separate!important; border-spacing:2px 4px!important; }
.bulk-table:has(#supplierRows) th,#supplierRows td { border-radius:7px!important; }

#supplierRows td:first-child,#supplierRows td:last-child,#supplierRows input,#supplierRows td:first-child input { border-radius:7px!important; }
.list-toolbar>.button,.purchasing-tabs>.button,.purchasing-tabs>.saved-list-wrap>.button,.supplier-actions>.button,.price-list-actions>.button { height:44px; min-height:44px; box-sizing:border-box; }
.dialog-actions,.export-actions,.account-settings-actions,.quote-actions { align-items:stretch; }
.dialog-actions>.button,.export-actions>.button,.account-settings-actions>.button,.quote-actions>.button { align-self:stretch; margin-block:0; }
@media(max-width:650px){ .purchasing-tabs>.button,.purchasing-tabs>.saved-list-wrap>.button { font-size:13px; line-height:1.15; padding:6px; } }

/* v31: centered sign-in and editable competitor columns. */
#accessGate #accessLoadingLogo { display:block; width:min(290px,100%); margin:0 auto 12px; }
#accessGate #accessLoadingLogo img { filter:brightness(0) invert(1); }
#accessGate #accessIntro { text-align:center; margin:0 0 12px; }
#purchasingToolPanel .supplier-tabs #addSupplier,#purchasingToolPanel .supplier-tabs #deleteSupplier { box-sizing:border-box; width:44px!important; height:44px!important; min-width:44px!important; min-height:44px!important; max-width:44px!important; max-height:44px!important; flex:0 0 44px!important; padding:0!important; display:inline-grid; place-items:center; border-radius:7px!important; aspect-ratio:1; }
#supplierRows .remove-product,#competitorRows .remove-product,.agent-expense .remove-product,.import-edit-table .remove-button { box-sizing:border-box; width:40px!important; height:40px!important; min-width:40px!important; min-height:40px!important; max-width:40px!important; max-height:40px!important; flex:0 0 40px; margin:0!important; padding:0!important; display:inline-grid; place-items:center; aspect-ratio:1; }
.competitor-controls { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:10px 0 14px; }
.competitor-controls label { font-size:14px; min-width:0; }
.competitor-controls .field-picker { margin-top:5px; }
.competitor-table { min-width:620px; }
.competitor-table thead th:first-child { min-width:40px; width:40px; }
.competitor-table th:nth-child(2) { min-width:215px; }
.competitor-table tbody td:nth-child(2) input { min-width:205px; width:100%; max-width:none; text-align:left; }
.competitor-table tbody td:nth-child(n+4) input { width:135px; max-width:none; }
.competitor-table th:last-child,.competitor-table td:last-child { width:46px; min-width:46px; padding:5px!important; }
@media(max-width:700px){
 .app-shell:has(#accessGate:not([hidden]))>.topbar { justify-content:flex-end; min-height:48px; }
 .app-shell:has(#accessGate:not([hidden]))>.topbar>.brand-logo { display:none; }
 .app-shell:has(#accessGate:not([hidden]))>main { min-height:calc(100svh - 80px); display:flex; flex-direction:column; justify-content:center; padding:clamp(30px,7svh,65px) 0 24px; box-sizing:border-box; }
 #accessGate.access-card { width:min(420px,100%); margin:0 auto; padding:22px 20px; border-radius:22px; }
 #accessGate #accessLoadingLogo { width:min(285px,100%); margin:0 auto 12px; }
 #accessGate #accessIntro { font-size:14px; }
 .competitor-controls { gap:8px; }
 .competitor-controls label { font-size:13px; }
 #supplierCompetitorPanel .inline-actions { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); width:100%; }
 #supplierCompetitorPanel .inline-actions .button { font-size:13px; min-height:44px; height:44px; padding:5px; }
}
@media(max-height:550px) and (max-width:700px){ .app-shell:has(#accessGate:not([hidden]))>main { justify-content:flex-start; padding-top:8px; } }

/* v32: a shared compact table style, with native two-direction scrolling. */
.supplier-type-row { display:flex; align-items:end; justify-content:space-between; gap:12px; margin:12px 0; }
.supplier-type-row .active-supplier-name { margin:0 0 8px; min-width:0; overflow-wrap:anywhere; }
.supplier-type-row>label { width:min(260px,50%); min-width:180px; flex-shrink:0; font-size:14px; }
#exchangeRateCard .expense-shop,#exchangeRateCard .expense-conversion { grid-column:auto; }
.purchasing-cost-cards:has(#exchangeRateCard[hidden]) { grid-template-columns:1fr; }
.expense-grid { grid-template-areas:none!important; grid-template-columns:repeat(2,minmax(0,1fr)); }
.expense-grid .expense-freight-rate,.expense-grid .expense-phones { grid-area:auto!important; }
.expense-grid .expense-weight { grid-area:auto!important; grid-column:1/-1; }
.bulk-table:has(#supplierRows) { min-width:1090px; }
.local-supplier .bulk-table:has(#supplierRows) { min-width:930px; }
#supplierComparisonPanel,#supplierCompetitorPanel { min-width:0; max-width:100%; }
#supplierComparisonPanel .bulk-table-wrap,#supplierCompetitorPanel .bulk-table-wrap { width:100%; max-width:100%; overflow:auto!important; max-height:65vh; overscroll-behavior:auto; touch-action:pan-x pan-y; -webkit-overflow-scrolling:touch; border:1px solid var(--color-border); border-radius:10px; }
.comparison-table,.competitor-table { display:table!important; width:max-content; min-width:100%; table-layout:auto; border-collapse:separate!important; border-spacing:2px 4px!important; }
.comparison-table thead,.competitor-table thead { display:table-header-group; position:sticky; top:0; z-index:2; }
.comparison-table th,.comparison-table td,.competitor-table th,.competitor-table td { box-sizing:border-box; border:1px solid var(--color-border)!important; border-radius:7px!important; padding:8px 10px!important; height:46px; min-width:140px; touch-action:pan-x pan-y; }
.comparison-table thead th,.competitor-table thead th { height:55px; text-align:center; font-size:13px; }
.comparison-table tbody th:first-child { min-width:185px; }
.comparison-table td strong { font-size:14px; }
.comparison-table small { margin-top:2px; }
.comparison-table .comparison-rank { font-size:12px; margin-top:2px; }
.competitor-table td:has(input) { padding:0!important; }
.competitor-table input { box-sizing:border-box; width:100%; max-width:none; min-height:46px; height:46px; margin:0; border:1px solid var(--color-border); border-radius:7px; padding:10px; font-size:14px; touch-action:pan-x pan-y; }
.competitor-table td:first-child,.competitor-table th:first-child { width:44px; min-width:44px; }
.competitor-table th:last-child,.competitor-table td:last-child { width:46px; min-width:46px; }
@media(max-width:700px){ .supplier-type-row { gap:8px; align-items:center; }.supplier-type-row>label { min-width:155px; }.comparison-table input,.competitor-table input { font-size:16px!important; } }

/* v33: compact mobile controls and supplier-linked comparison rows. */
main>#accessLoadingLogo { display:none; }
main:has(>#accessGate:not([hidden]))>#accessLoadingLogo { display:block; width:min(290px,75%); margin:18px auto; }
main>#accessLoadingLogo img { display:block; width:100%; height:auto; filter:brightness(0); }
#updateAppButton { display:inline-grid!important; place-items:center; padding:0!important; }
#updateAppButton svg { display:block; width:24px!important; height:24px!important; }
button.remove-product:not(.primary),button.remove-button:not(.primary),button.delete-button:not(.primary),#deleteSupplier,#clearPriceImage,#supplierRows .remove-product,#competitorRows .remove-product,.agent-expense .remove-product,.import-edit-table .remove-button { font-weight:800!important; }
.supplier-type-row { margin:8px 0 12px; align-items:center; }
.supplier-type-field .field-picker { margin:0; }
.price-list-card .bulk-table { table-layout:auto; }
#supplierRows td input { width:100%; max-width:none; min-width:0; text-align:center; }
#supplierRows td:nth-child(2) { width:155px; min-width:155px; }
#supplierRows td:nth-child(2) input { width:155px; min-width:155px; text-align:left; }
#supplierRows td:nth-child(3),#supplierRows td:nth-child(3) input { width:86px; min-width:86px; }
#supplierRows td:nth-child(4),#supplierRows td:nth-child(4) input { width:60px; min-width:60px; }
#supplierRows td:nth-child(n+5):not(.row-action) { min-width:115px; }
#supplierRows td.row-action { width:44px; min-width:44px; padding:0 2px!important; }
.agent-expense { grid-template-columns:minmax(0,1fr) minmax(100px,.55fr) 40px; gap:8px; align-items:end; }
.agent-expense label { margin:0; }
.agent-expense .remove-product { align-self:end; margin-bottom:3px!important; }
.agent-expense-footer { gap:8px; margin-top:10px; }
.expenses-panel .expense-grid { align-items:stretch; }
.expenses-panel .expense-weight { display:grid; grid-template-columns:minmax(130px,.5fr) minmax(0,1fr); align-items:center; gap:12px; width:100%; padding:12px; box-sizing:border-box; border:1px solid var(--color-border); border-radius:10px; }
#freightTotal { font-size:16px; }
#freightWeight { font-size:14px; line-height:1.5; }
.comparison-source { width:min(260px,100%); margin:8px 0; }
.comparison-source label { font-size:14px; }
.comparison-source .field-picker { margin-top:4px; }
.comparison-table { width:max-content; min-width:100%; }
.comparison-table th,.comparison-table td { min-width:115px; padding:6px 8px!important; height:46px; }
.comparison-table thead th:first-child,.comparison-table tbody th:first-child { min-width:155px; max-width:210px; }
.comparison-table td strong { line-height:1.25; font-size:15px; }
.comparison-table small { white-space:normal; line-height:1.25; margin-top:3px; }
.comparison-table tbody td { border-top:2px solid var(--color-border)!important; border-bottom:2px solid var(--color-border)!important; }
.competitor-table { min-width:590px; width:100%; }
.competitor-table th,.competitor-table td { padding:5px 7px!important; }
.competitor-table th:nth-child(2) { min-width:185px; width:38%; }
.competitor-table th:nth-child(3),.competitor-table td:nth-child(3) { min-width:85px; width:85px; }
.competitor-table td:nth-child(4) input { width:100%; min-width:125px; max-width:none; }
#supplierCompetitorPanel .inline-actions { display:flex; }
#supplierCompetitorPanel .inline-actions .button { flex:0 1 auto; }
.pricing-heading h3 { font-weight:800; }
.future-profit-bar { padding:10px 12px; flex-wrap:nowrap; gap:8px; }
.future-profit-bar>span { font-size:17px; }
.future-profit-bar .future-profit { font-size:25px!important; font-weight:800; line-height:1.15; }
.customer-pricing .money-input.large input { font-size:24px; font-weight:750; }
#searchButton { width:100%; margin:0 0 10px; text-align:center; justify-content:center; padding:12px!important; white-space:normal; }
#searchDescription,#searchDescription.search-placeholder { font-size:16px!important; line-height:1.4; font-weight:750!important; }
#priceImportDialog .dialog-heading { margin-bottom:10px; }
#priceImportDialog>label { margin:10px 0; }
#staffAccountsDialog .account-mode-tabs { margin:8px 0 10px; }
#staffCreateForm { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
#staffCreateForm>label { margin:0; }
#staffRoleWrap,#staffPasswordFields,#staffCreateForm>p { grid-column:1/-1; }
#staffPasswordFields { gap:8px; }
#staffPasswordFields label { margin:0; }
#staffCreateForm>button { margin:0; }
#staffCreateForm>p { margin:2px 0; }
#staffAccountsDialog .user-search { display:block; margin:0 0 10px; }
#staffSearch { width:100%; min-height:42px; margin:0; }
#staffAccountsList .history-card { padding:10px; margin:8px 0; }
#staffAccountsList .history-card h3 { margin:0 0 4px; }
#staffAccountsList .history-card p { margin:3px 0 8px; }
#staffAccountsList .history-card .button { margin:4px 5px 0 0; }
@media(max-width:700px){
 #mainToolTabs { display:grid; grid-template-columns:1fr 1fr .75fr; gap:6px; margin:4px 0 10px; align-items:stretch; }
 #mainToolTabs>.button,#mainToolTabs>.saved-list-wrap>.button { width:100%; min-width:0; height:44px; min-height:44px; padding:6px!important; font-size:13px; line-height:1.2; box-sizing:border-box; }
 #mainToolTabs>.saved-list-wrap { min-width:0; }
 #mainToolTabs #savedSupplierLists { right:0; left:auto; width:min(360px,calc(100vw - 28px)); }
 .purchasing-tabs { grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
 .purchasing-tabs>.button { padding:7px!important; min-height:44px; font-size:13px; }
 .app-shell:has(#accessGate:not([hidden]))>main { justify-content:center; padding-top:10px; gap:0; }
 main:has(>#accessGate:not([hidden]))>#accessLoadingLogo { width:min(285px,78%); margin:0 auto 18px; }
 #accessGate.access-card { padding:18px 16px; }
 .offer-grid { grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important; gap:10px; }
 .offer-grid>label:last-child { grid-column:1/-1; }
 .offer-grid:has(#offerPercentWrap[hidden])>label:last-child { grid-column:auto; }
 .offer-grid label { font-size:13px; }
 .repair-profit-row .future-profit-bar { min-height:46px; }
 .expenses-panel .expense-weight { grid-template-columns:1fr; gap:5px; padding:10px; }
 .comparison-card { padding:10px; }
 .comparison-card .section-action-heading .inline-actions { flex:0 1 auto; }
 #supplierCompetitorPanel .inline-actions { display:grid; grid-template-columns:1fr 1fr; width:auto; }
 #supplierCompetitorPanel .inline-actions .button { height:42px; min-height:42px; font-size:13px; }
 .price-list-actions .button { white-space:normal; }
 #staffAccountsDialog { padding:14px; }
 #staffPasswordFields { grid-template-columns:1fr; }
 #staffCreateForm .password-field input { min-height:42px; }
}

/* v34: cyan cards, one connected tool workspace, and stable spreadsheet rows. */
@media screen {
 .card,.access-card,.quote-card,.cost-card,.price-list-card,.comparison-card,.market-results-card { border:1px solid var(--color-border)!important; }
 .inspection,.manual-exchange-card,.supplier-summary>div,.quote-client-card,.expenses-total,.rate-source { border:1px solid var(--color-border); border-radius:12px; }
 #tradeToolPanel,#purchasingToolPanel { box-sizing:border-box; padding:14px; margin:0; min-width:0; border:1px solid var(--color-border)!important; border-top:0!important; border-radius:0 0 18px 18px; overflow:visible; }
 #tradeToolPanel .workspace { margin:10px 0 0; }
 #mainToolTabs { display:grid!important; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; padding:8px 8px 0; margin:0; border:1px solid var(--color-border); border-bottom:0; border-radius:18px 18px 0 0; }
 #mainToolTabs>.button { width:100%; margin:0; border-radius:10px 10px 0 0; min-height:44px; height:44px; }
 #purchaseViewTabs { position:relative; display:grid!important; grid-template-columns:repeat(4,minmax(0,1fr)); width:100%; overflow:visible; }
 #purchaseViewTabs>.saved-list-wrap { position:static; }
 #savedSupplierLists { left:auto; right:0; top:100%; min-width:0; width:min(420px,100%); max-height:min(440px,65vh); margin:6px 0 0; box-sizing:border-box; }
 #savedSupplierLists label { display:block; margin:0; }
 #supplierHistory { margin:8px 0 0; }
 #supplierHistory .saved-list-entry { width:100%; display:grid; gap:3px; text-align:left; white-space:normal; height:auto; min-height:48px; padding:9px 12px; }
 .saved-list-entry strong { font-size:14px; overflow-wrap:anywhere; }
 .saved-list-entry span { font-size:12px; font-weight:400; }
 #supplierHistoryStatus { margin:10px 0 0; font-size:14px; }
 #retrySupplierHistory { margin-top:8px; }
 #loginFieldError { margin:4px 0 8px; font-size:14px; font-weight:600; line-height:1.4; }
 #accessGate input[aria-invalid=true] { border:2px solid var(--color-border)!important; }
 .app-shell:has(#accessGate:not([hidden]))>.topbar>.brand-logo { display:none; }
 main>#accessLoadingLogo { position:relative; }
 main>#accessLoadingLogo img { clip-path:inset(0 0 34% 0); }
 main>#accessLoadingLogo::after { content:''; position:absolute; inset:0; mask:url('/brand/kaya-loading-hd.png') center/100% 100% no-repeat; -webkit-mask:url('/brand/kaya-loading-hd.png') center/100% 100% no-repeat; clip-path:inset(66% 0 0); pointer-events:none; }
 #exchangeRateCard .currency-toolbar { margin:10px 0; }
 #supplierRateSource { padding:9px 10px; margin:8px 0 12px; font-size:13px; line-height:1.5; }
 .manual-exchange-card { padding:12px; }
 .manual-exchange-card h4 { margin:0 0 8px; font-size:15px; }
 .manual-exchange-fields { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:10px; }
 .manual-exchange-fields label { margin:0; min-width:0; font-size:14px; }
 .manual-exchange-fields input { min-width:0; width:100%; }
 .expenses-panel .expense-weight { display:flex; flex-wrap:wrap; align-items:center; gap:6px 16px; grid-column:1/-1!important; width:100%; padding:12px; }
 #freightTotal { flex:0 0 auto; white-space:nowrap; }
 #freightWeight { flex:1 1 240px; min-width:0; line-height:1.45; }
 .expenses-panel .expense-grid { width:100%; }
 .expenses-total { padding:10px 12px; }
 /* Override the earlier phone-card layout: headers and inputs stay in one row. */
 .price-list-card .bulk-table { display:table!important; width:100%; min-width:1090px; table-layout:fixed; border-collapse:separate!important; border-spacing:2px 4px!important; }
 .local-supplier .price-list-card .bulk-table { min-width:970px; }
 .price-list-card .bulk-table thead { display:table-header-group!important; }
 .price-list-card #supplierRows { display:table-row-group!important; }
 .price-list-card .bulk-table tr { display:table-row!important; }
 .price-list-card .bulk-table th,.price-list-card #supplierRows td { display:table-cell!important; position:static; vertical-align:middle; text-align:center; box-sizing:border-box; border-radius:7px!important; }
 .price-list-card .bulk-table th { position:sticky; top:0; }
 .price-list-card .bulk-table th[hidden] { display:none!important; }
 .price-list-card #supplierRows td { height:46px; padding:0!important; border:1px solid var(--color-border)!important; border-bottom-width:2px!important; }
 .price-list-card #supplierRows td::before { display:none!important; }
 .price-list-card .bulk-table th:first-child,.price-list-card #supplierRows td:first-child { width:42px; min-width:42px; }
 .price-list-card .bulk-table th:nth-child(2),.price-list-card #supplierRows td:nth-child(2) { width:185px; min-width:185px; }
 .price-list-card .bulk-table th:nth-child(3),.price-list-card #supplierRows td:nth-child(3) { width:86px; min-width:86px; }
 .price-list-card .bulk-table th:nth-child(4),.price-list-card #supplierRows td:nth-child(4) { width:64px; min-width:64px; }
 .price-list-card .bulk-table th:last-child,.price-list-card #supplierRows td.row-action { width:46px; min-width:46px; }
 .price-list-card #supplierRows td input { display:block; box-sizing:border-box; width:100%; min-width:0; max-width:none; margin:0; height:46px!important; min-height:46px; padding:8px!important; text-align:center; font-size:14px; }
 .price-list-card #supplierRows td:nth-child(2) input { text-align:left; width:100%; min-width:0; }
 .price-list-card #supplierRows td output { display:block; padding:8px 5px; font-size:14px; }
 #staffAccountsDialog { padding:18px; }
 #staffAccountsDialog .dialog-heading { margin:0 0 8px; }
 #staffAccountsDialog>p { margin:6px 0; line-height:1.35; }
 #staffAccountsDialog #staffCreateForm { margin:8px 0 0; gap:8px 10px; min-height:0; }
 #staffAccountsDialog #staffCreateForm h3 { margin:0; }
 #staffAccountsDialog #staffCreateForm label { gap:3px; margin:0; line-height:1.25; }
 #staffAccountsDialog #staffCreateForm input,#staffAccountsDialog #staffCreateForm .password-field,#staffAccountsDialog #staffCreateForm .field-picker { margin:0; }
 #staffAccountsDialog #staffPasswordFields { gap:8px; }
 #staffAccountsDialog #staffCreateForm>button { margin:0; }
 #staffAccountsMessage:empty,#staffAccountAudit:empty { display:none; }
}
@media screen and (max-width:700px) {
 #tradeToolPanel,#purchasingToolPanel { padding:10px; }
 #mainToolTabs { grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
 #purchasingToolPanel #purchaseViewTabs { display:grid!important; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
 #purchasingToolPanel #purchaseViewTabs .button { height:44px; min-height:44px; }
 .manual-exchange-fields { gap:8px; }
 .manual-exchange-card { padding:10px; }
 .price-list-card #supplierRows td input { font-size:16px; }
 #staffAccountsDialog { padding:16px; }
}

/* v35: softer blue gradients, a compact freight group and named rival prices. */
@media screen {
 /* A single header strip, without a second rectangular button around each title. */
 #supplierPricesPanel .price-list-card .bulk-table thead th { border:0!important; border-radius:0!important; padding:0!important; }
 #supplierPricesPanel .price-list-card .bulk-table thead th:first-child { border-radius:8px 0 0 8px!important; }
 #supplierPricesPanel .price-list-card .bulk-table thead th:last-child { border-radius:0 8px 8px 0!important; }
 #supplierPricesPanel .price-list-card .bulk-table thead .column-sort { border:0!important; outline-offset:-3px; border-radius:0!important; margin:0; width:100%; min-height:54px; padding:7px 4px; transform:none!important; }
 .freight-card { border:1px solid var(--color-border); border-radius:12px; padding:10px 12px; }
 .expenses-panel .freight-card .expense-grid { margin:0; gap:8px 12px; align-items:end; }
 .freight-card label { margin:0; }
 .expenses-panel .freight-card .expense-weight { display:flex; align-items:baseline; gap:4px 12px; padding:8px 0 0; margin:0; border:0; border-top:1px solid var(--color-border); border-radius:0; }
 .freight-card #freightTotal { font-size:15px; }
 .freight-card #freightWeight { flex:1 1 225px; font-size:14px; line-height:1.35; }
 .user-actions { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-top:8px; }
 #staffAccountsList .user-actions>.button { display:inline-flex; align-items:center; justify-content:center; box-sizing:border-box; height:42px!important; min-height:42px!important; margin:0!important; padding:8px 10px; font-size:14px; line-height:1.2; flex:1 1 auto; }
 #staffAccountsList .user-actions>.remove-button { width:42px!important; min-width:42px!important; max-width:42px!important; padding:0!important; flex:0 0 42px; }
 .comparison-legend span { border:0; padding:0; }
 .competitor-table { width:max-content; min-width:100%; }
 .competitor-table th:nth-child(2),.competitor-table td:nth-child(2) { width:auto; min-width:210px; }
 .competitor-table thead th:nth-child(n+3),.competitor-table tbody td:nth-child(n+3) { min-width:200px; width:200px; padding:0!important; }
 .competitor-table .rival-name { display:block; width:100%; height:52px; min-height:52px; box-sizing:border-box; margin:0; padding:7px 12px; border:0; border-radius:7px; border:0!important; font-size:14px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
 .competitor-table .rival-name::after { content:' ✎'; opacity:.85; }
 .rival-price-entry { display:grid; grid-template-columns:minmax(0,1fr) 40px; align-items:center; gap:4px; padding-right:4px; }
 .competitor-table .rival-price-entry input { width:100%; min-width:0; max-width:none; border:0; border-radius:7px 0 0 7px; }
 #supplierCompetitorPanel .inline-actions { display:flex; flex-wrap:wrap; gap:6px; }
 #supplierCompetitorPanel .inline-actions .button { height:42px; min-height:42px; padding:7px 10px; }
 .import-rival-field { width:min(340px,100%); margin:0 0 10px!important; }
}
@media screen and (max-width:700px) {
 #supplierCompetitorPanel .section-action-heading { display:block; }
 #supplierCompetitorPanel .inline-actions { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); width:100%; }
 #supplierCompetitorPanel .inline-actions .button { min-width:0; font-size:13px; padding:5px; }
 .freight-card { padding:10px; }
 .user-actions { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) 42px; }
 #staffAccountsList .user-actions>.button:last-child { grid-column:1/-1; }
}

/* v36: compact mobile controls and one consistent spreadsheet layout. */
@media screen {
 main>#accessLoadingLogo img { clip-path:none; }
 main>#accessLoadingLogo::after { display:none; }
 #mainToolTabs { border:0!important; padding:0; gap:6px; align-items:end; }
 #mainToolTabs>.button { border:1px solid var(--color-border)!important; border-radius:12px 12px 0 0; }
 #mainToolTabs>.button:not([aria-pressed=true]) { margin-bottom:7px; border-radius:10px; }
 #mainToolTabs>.button[aria-pressed=true] { position:relative; z-index:1; }
 #tradeToolPanel,#purchasingToolPanel { border:1px solid var(--color-border)!important; margin-top:-1px; border-radius:0 0 16px 16px; }
 #mainToolTabs:has(#tradeToolTab[aria-pressed=true])~#tradeToolPanel { border-top-right-radius:12px; }
 #mainToolTabs:has(#purchasingToolTab[aria-pressed=true])+#purchasingToolPanel { border-top-left-radius:12px; }
 #purchasingToolPanel .purchasing-heading { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:4px 10px; margin:0 0 10px; }
 #purchasingToolHeading { font-size:24px; line-height:1.2; }
 #purchaseHeadingActions { min-width:0; position:relative; }
 #purchaseHeadingActions .saved-list-wrap { position:relative; }
 #purchaseHeadingActions .button { margin:0; height:44px; min-height:44px; padding:8px 12px; }
 #purchaseHeadingActions #savedSupplierLists { position:absolute; width:min(420px,calc(100vw - 54px)); right:0; left:auto; top:100%; z-index:30; }
 #supplierSaveStatus { grid-column:1/-1; }
 #supplierSaveStatus:empty { display:none; }
 #supplierBook { margin:0; }
 #purchasingToolPanel .list-toolbar { display:grid; grid-template-columns:minmax(0,1fr) repeat(3,112px); align-items:end; gap:6px; margin-bottom:10px; }
 #purchasingToolPanel .list-toolbar>label { min-width:0; margin:0; }
 #purchasingToolPanel .list-toolbar>.button { width:100%; height:44px; min-height:44px; padding:6px 8px!important; margin:0; }
 #purchasingToolPanel #purchaseViewTabs { display:grid!important; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; padding:0; margin:0 0 10px; }
 #purchasingToolPanel #purchaseViewTabs>.button { font-size:14px; min-width:0; height:44px; min-height:44px; margin:0; padding:5px!important; white-space:normal; }
 #exchangeRateCard .currency-toolbar { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); align-items:end; gap:8px; margin:8px 0 4px; }
 #exchangeRateCard .exchange-result { grid-column:1/-1; display:grid; grid-template-columns:minmax(0,1fr) 112px; gap:8px; align-items:end; width:100%; margin:0; }
 #exchangeRateCard .exchange-result label { min-width:0; width:auto; margin:0; }
 #exchangeRateCard .rate-actions { display:block; margin:0; }
 #exchangeRateCard #supplierRate,#exchangeRateCard #refreshSupplierRate { box-sizing:border-box; width:100%; min-width:0; height:44px; min-height:44px; margin:0; }
 #exchangeRateCard #refreshSupplierRate { padding:6px!important; white-space:nowrap; font-size:14px; }
 #exchangeRateCard #supplierRateSource { border:0; border-radius:0; padding:0; margin:5px 0 8px; font-size:12px; line-height:1.35; }
 #exchangeRateCard .manual-exchange-card { padding:8px; }
 #exchangeRateCard .manual-exchange-fields { gap:8px; }
 #exchangeRateCard .manual-exchange-fields label { font-size:13px; }
 #exchangeRateCard .manual-exchange-fields input { padding:8px; }
 #exchangeRateCard .manual-exchange-fields input::placeholder { text-transform:none; font-size:13px; }
 /* Colgroups own the widths; old nth-child rules must not stretch a rival column. */
 #purchasingToolPanel .bulk-table-wrap { max-width:100%; width:100%; overflow:auto!important; overscroll-behavior:auto; touch-action:pan-x pan-y; margin:8px 0; height:auto; max-height:65vh; border:1px solid var(--color-border); border-radius:9px; }
 #purchasingToolPanel table.bulk-table { display:table!important; width:var(--table-width)!important; min-width:var(--table-width)!important; max-width:none; table-layout:fixed; border-collapse:separate!important; border-spacing:2px 4px!important; margin:0; }
 #purchasingToolPanel table.bulk-table thead { display:table-header-group!important; }
 #purchasingToolPanel table.bulk-table tbody { display:table-row-group!important; }
 #purchasingToolPanel table.bulk-table tr { display:table-row!important; padding:0; margin:0; }
 #purchasingToolPanel table.bulk-table th,#purchasingToolPanel table.bulk-table td { display:table-cell!important; box-sizing:border-box; width:auto!important; min-width:0!important; max-width:none!important; text-align:center; vertical-align:middle; white-space:normal; padding:0!important; position:static!important; border-radius:7px!important; overflow:hidden; }
 #purchasingToolPanel table.bulk-table thead th { position:sticky!important; top:0; height:54px; padding:7px 4px!important; border:0!important; font-size:13px; line-height:1.3; }
 #purchasingToolPanel table.bulk-table thead th[hidden] { display:none!important; }
 #purchasingToolPanel table.bulk-table thead th:first-child { border-radius:8px 0 0 8px!important; }
 #purchasingToolPanel table.bulk-table thead th:last-child { border-radius:0 8px 8px 0!important; }
 #purchasingToolPanel table.bulk-table thead th:not(:first-child):not(:last-child) { border-radius:0!important; }
 #purchasingToolPanel table.bulk-table tbody td,#purchasingToolPanel table.bulk-table tbody th { height:46px; border:1px solid var(--color-border)!important; border-bottom-width:2px!important; }
 #purchasingToolPanel table.bulk-table tbody th { padding:6px 8px!important; font-size:13px; font-weight:650; text-align:left; overflow-wrap:anywhere; }
 #purchasingToolPanel table.bulk-table tbody th strong,#purchasingToolPanel table.bulk-table tbody th small { display:block; }
 #purchasingToolPanel table.bulk-table tbody th small { margin-top:2px; font-weight:500; }
 #purchasingToolPanel table.bulk-table td::before { display:none!important; }
 #purchasingToolPanel table.bulk-table input { box-sizing:border-box; width:100%!important; min-width:0!important; max-width:none!important; height:44px!important; min-height:44px!important; padding:8px!important; margin:0!important; border:1px solid var(--color-border)!important; border-radius:6px!important; text-align:center; font-size:14px; }
 #purchasingToolPanel table.bulk-table input.model-input { text-align:left; }
 #purchasingToolPanel table.bulk-table output { min-width:0; padding:6px 4px; font-size:14px; }
 #purchasingToolPanel table.bulk-table .rival-price-entry { display:block; padding:0; margin:0; }
 #purchasingToolPanel table.bulk-table .rival-name { min-height:40px; height:40px; padding:4px; font-size:13px; border-radius:0!important; }
 #purchasingToolPanel table.bulk-table .column-sort { min-height:40px!important; height:40px; padding:0!important; line-height:1.3; }
 #purchasingToolPanel table.bulk-table small { display:block; margin-top:3px; font-size:12px; }
 #purchasingToolPanel table.bulk-table .amount-positive { font-weight:650; }
 #purchasingToolPanel table.bulk-table .amount-negative { font-weight:650; }
 #supplierCompetitorPanel .inline-actions { display:flex; flex-wrap:wrap; width:auto; align-items:center; gap:6px; }
 .rival-column-actions { display:inline-flex; flex:0 0 auto; align-items:center; gap:6px; }
 #supplierCompetitorPanel .inline-actions .button { height:42px!important; min-height:42px!important; margin:0; font-size:13px; padding:6px 9px; }
 #supplierCompetitorPanel #deleteRival { width:42px!important; min-width:42px!important; max-width:42px!important; padding:0!important; }
 #deleteRivalDialog { width:min(420px,calc(100vw - 32px)); padding:18px; }
 #deleteRivalDialog h2 { font-size:20px; margin:0 0 12px; }
 #deleteRivalDialog p { font-size:14px; margin:10px 0; }
 #deleteRivalDialog .dialog-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
 .button.danger-action { border:1px solid var(--color-border)!important; }
 button:disabled { cursor:not-allowed; }
 input:focus,textarea:focus,select:focus,.field-picker:focus-within>.picker-button { outline:2px solid var(--color-border); outline-offset:1px; }
 #purchasingToolPanel table.bulk-table input:focus { outline:0; border:2px solid var(--color-border)!important; }
 input[aria-invalid=true],#purchasingToolPanel table.bulk-table input[aria-invalid=true] { border:2px solid var(--color-border)!important; }
}
@media screen and (hover:hover) {
 .button:not(:disabled):not([aria-pressed=true]):not(.primary):not(.remove-button):not(.danger-action):hover { transform:none!important; }
 .button.primary:not(:disabled):not([aria-pressed=true]):hover { transform:none!important; }
 .remove-product:not(:disabled):hover,.remove-button:not(:disabled):hover,.button.danger-action:not(:disabled):hover { transform:none!important; }
 #purchasingToolPanel table.bulk-table .column-sort:hover,#purchasingToolPanel table.bulk-table .rival-name:hover { transform:none!important; }
}
@media screen and (max-width:700px) {
 #purchasingToolPanel .list-toolbar { grid-template-columns:repeat(3,minmax(0,1fr)); }
 #purchasingToolPanel .list-toolbar>label { grid-column:1/-1; }
 #purchasingToolPanel .purchasing-heading { gap:4px 8px; }
 #purchasingToolHeading { font-size:22px; }
 #purchaseHeadingActions .button { font-size:13px; }
 #purchasingToolPanel #purchaseViewTabs>.button { font-size:12px; }
 #exchangeRateCard .exchange-result { grid-template-columns:minmax(0,1fr) 108px; }
 #supplierCompetitorPanel .section-action-heading { display:block; }
 #supplierCompetitorPanel .section-action-heading h3 { margin-bottom:8px; }
 #purchasingToolPanel table.bulk-table input { font-size:16px; }
 #purchasingToolPanel .supplier-navigation { margin-top:10px; }
}

/* v37: compact mobile expenses, centered manual entries and clear price signals. */
@media screen {
 #purchasingToolPanel .comparison-table tbody td.second-lowest>strong,
 #purchasingToolPanel .comparison-legend .second-lowest { font-weight:800; }
 #exchangeRateCard #supplierShopName { text-align:center; }
 #exchangeRateCard .manual-exchange-fields .money-input { position:relative; margin-top:8px; }
 #exchangeRateCard .manual-exchange-fields .money-input>span { position:absolute; inset:0 auto 0 10px; display:flex; align-items:center; margin:0; transform:none; line-height:1; pointer-events:none; }
 #exchangeRateCard #conversionExpense { margin:0; text-align:center; padding-left:28px!important; padding-right:28px!important; }
 #exchangeRateCard #supplierShopName::placeholder,#exchangeRateCard #conversionExpense::placeholder { text-align:center; opacity:1; }
 #exchangeRateCard .exchange-result { grid-template-columns:minmax(88px,128px) 112px; justify-content:start; }
 #exchangeRateCard #supplierRate { text-align:center; }
 #purchasingToolPanel .supplier-tabs>.button { height:44px!important; min-height:44px!important; box-sizing:border-box; }
 #purchasingToolPanel .supplier-tabs #deleteSupplier,#purchasingToolPanel .supplier-tabs #addSupplier { width:44px!important; height:44px!important; min-width:44px!important; min-height:44px!important; max-width:44px!important; max-height:44px!important; }
 #supplierCompetitorPanel .rival-column-actions>.button { height:42px!important; min-height:42px!important; max-height:42px!important; }
 #supplierCompetitorPanel .rival-column-actions>#deleteRival { box-sizing:border-box; width:42px!important; min-width:42px!important; max-width:42px!important; flex:0 0 42px!important; }
 #purchasingToolPanel .agent-expense { grid-template-columns:minmax(0,1fr) minmax(88px,.6fr) 44px; gap:6px; }
 #purchasingToolPanel .agent-expense input { height:44px!important; min-height:44px!important; margin:0; }
 #purchasingToolPanel .agent-expense>.remove-product { height:44px!important; min-height:44px!important; max-height:44px!important; width:44px!important; min-width:44px!important; max-width:44px!important; margin:0!important; align-self:end; flex:0 0 44px; }
 #purchasingToolPanel #supplierRows .remove-product { width:44px!important; height:44px!important; min-width:44px!important; min-height:44px!important; max-width:44px!important; max-height:44px!important; box-sizing:border-box; }
 #staffAccountsList .user-actions>.remove-button { width:42px!important; min-width:42px!important; max-width:42px!important; height:42px!important; min-height:42px!important; max-height:42px!important; }
 #priceImportPreview .import-edit-table .remove-button { width:44px!important; min-width:44px!important; max-width:44px!important; height:44px!important; min-height:44px!important; max-height:44px!important; }
}
@media screen and (max-width:700px) {
 #purchasingToolPanel .purchasing-cost-cards { align-items:start; gap:10px; grid-auto-rows:auto; }
 #purchasingToolPanel .expenses-panel { display:block; align-self:start; height:auto; min-height:0; padding:10px!important; margin:0; }
 #purchasingToolPanel .expenses-panel>h3 { margin:0 0 8px; }
 #purchasingToolPanel .expenses-panel .freight-card { padding:8px; }
 #purchasingToolPanel .expenses-panel .expense-grid { gap:6px 8px; }
 #purchasingToolPanel .expenses-panel .expense-weight { padding:6px 0 0; gap:3px; }
 #purchasingToolPanel .expenses-panel #freightWeight { flex-basis:100%; line-height:1.35; }
 #purchasingToolPanel .expenses-panel .agent-expenses { margin-top:8px; gap:6px; }
 #purchasingToolPanel .expenses-panel .agent-expenses:empty { display:none; }
 #purchasingToolPanel .expenses-panel .agent-expense-footer { margin:8px 0 0; gap:6px; }
 #purchasingToolPanel .expenses-panel .agent-expense-breakdown:empty { display:none; }
 #purchasingToolPanel .expenses-panel .expenses-total { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:8px 0 0; padding:8px; align-items:start; font-size:13px; }
 #purchasingToolPanel .expenses-panel .expenses-total>span { min-width:0; line-height:1.35; }
 #purchasingToolPanel .expenses-panel .expenses-total strong { display:block; margin:3px 0 0; font-size:18px; }
 #exchangeRateCard .exchange-result { grid-template-columns:minmax(82px,116px) 108px; gap:8px; }
 #exchangeRateCard .manual-exchange-fields { grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:6px; }
 #exchangeRateCard #conversionExpense { padding-left:22px!important; padding-right:14px!important; }
 #exchangeRateCard .manual-exchange-fields .money-input>span { left:8px; font-size:14px; }
}

@media screen {
 #priceImportPreview .import-edit-table input { height:44px!important; min-height:44px!important; margin:0; }
}
@media screen and (max-width:360px) {
 #exchangeRateCard .manual-exchange-fields { grid-template-columns:1fr; }
}

/* v38: one card palette, compact supplier controls and settings-owned records. */
@media screen {
 #mainToolTabs>.button { text-align:center; justify-content:center; line-height:1.25; }
 .quote-card .topup-row>span { font-weight:700!important; }
 .quote-card .topup-row strong { font-weight:850!important; }
 .inspection>summary { display:grid; grid-template-columns:minmax(0,1fr); gap:3px; align-items:center; padding:10px 26px 10px 0; }
 .inspection>summary>span:first-child { font-size:14px; line-height:1.3; font-weight:700; }
 .inspection>summary .detail-caption { float:none; margin:0; font-size:12px; line-height:1.3; }
 .inspection>summary::after { top:50%; transform:translateY(-50%); }
 #editNotice:empty,#supplierMessage:empty,#supplierEmpty:empty { display:none; margin:0; padding:0; min-height:0; }
 #tradeToolPanel .workspace { margin-top:0; }
 #purchasingToolPanel .list-toolbar { grid-template-columns:minmax(0,1fr) repeat(2,112px); }
 #purchasingToolPanel .purchasing-heading { margin-bottom:8px; }
 #purchaseHeadingActions #exportSupplier { min-width:90px; justify-content:center; }
 #exchangeRateCard .exchange-result { display:grid; grid-template-columns:minmax(90px,1fr) minmax(112px,1fr); align-items:end; gap:6px; width:100%; justify-content:stretch; }
 #exchangeRateCard .rate-actions { width:100%; min-width:0; }
 #exchangeRateCard #refreshSupplierRate { width:100%; text-align:center; justify-content:center; }
 #exchangeRateCard .currency-toolbar { margin:6px 0 4px; gap:6px 8px; }
 #purchasingToolPanel .supplier-navigation { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px 12px; margin:8px 0 10px; padding:0; border:0; align-items:center; }
 #purchasingToolPanel .supplier-control-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:8px; min-width:0; }
 #purchasingToolPanel .supplier-control-row label { min-width:0; width:100%; margin:0; }
 #purchasingToolPanel .supplier-control-row .field-picker { margin:0; width:100%; }
 #purchasingToolPanel .supplier-control-row .picker-button { width:100%; min-width:0; height:44px; min-height:44px; margin:0; font-size:14px; }
 #purchasingToolPanel .supplier-actions { display:grid; grid-template-columns:minmax(76px,1fr) minmax(86px,1fr) 44px 44px; width:auto; max-width:none; margin:0; padding:0; gap:6px; grid-auto-flow:row; }
 #purchasingToolPanel .supplier-actions>.button { box-sizing:border-box; order:initial!important; margin:0; padding:6px 8px!important; height:44px!important; min-height:44px!important; max-height:44px!important; min-width:0; font-size:14px; white-space:nowrap; justify-content:center; }
 #purchasingToolPanel .supplier-actions>#addSupplier,#purchasingToolPanel .supplier-actions>#deleteSupplier { width:44px!important; min-width:44px!important; max-width:44px!important; height:44px!important; min-height:44px!important; max-height:44px!important; padding:0!important; flex:0 0 44px; font-size:23px; }
 .topbar-right { position:relative; }
 #accountMenu .account-menu-items { width:270px; max-width:calc(100vw - 24px); padding:8px; }
 #accountMenu .account-menu-items>.button { width:100%; height:42px; min-height:42px; margin:0; padding:9px 12px; text-align:left; justify-content:flex-start; font-size:14px; }
 #accountMenu .saved-menu-toggle { position:relative; }
 #accountMenu .saved-menu-toggle::after { content:'+'; margin-left:auto; font-size:20px; }
 #accountMenu .saved-menu-toggle[aria-expanded=true]::after { content:'−'; }
 #savedListOptions { display:grid; gap:4px; padding:5px 0 0 10px; border-left:2px solid var(--color-border); margin:4px 0 0 10px; }
 #savedListOptions>.button { width:100%; min-height:42px; padding:8px 10px; margin:0; justify-content:flex-start; text-align:left; font-size:14px; white-space:normal; }
 #settingsRecordsAnchor { position:absolute; right:0; top:100%; width:0; height:0; z-index:150; }
 #settingsRecordsAnchor #historyDialog,#settingsRecordsAnchor #savedSupplierLists { position:absolute; inset:6px 0 auto auto; width:min(440px,calc(100vw - 24px)); min-width:0; max-width:none; max-height:min(580px,calc(100dvh - 140px)); padding:12px; margin:0; box-sizing:border-box; overflow:auto; border:1px solid var(--color-border); border-radius:12px; }
 #settingsRecordsAnchor .records-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; margin:0 0 10px; }
 #settingsRecordsAnchor .records-heading h3 { margin:0; font-size:18px; }
 #settingsRecordsAnchor label { font-size:14px; }
 #settingsRecordsAnchor .history-toolbar { gap:6px; margin:0; }
 #settingsRecordsAnchor #historyList { display:grid; gap:6px; margin-top:8px; }
 #settingsRecordsAnchor .history-card { margin:0; padding:10px; }
 #settingsRecordsAnchor #savedSupplierLists .saved-list-entry { justify-content:stretch; height:auto; min-height:48px; }
}
@media screen and (max-width:700px) {
 #purchasingToolPanel .list-toolbar { grid-template-columns:repeat(2,minmax(0,1fr)); }
 #purchasingToolPanel .supplier-navigation { grid-template-columns:minmax(0,1fr); gap:6px; }
 #purchasingToolPanel .supplier-actions { width:100%; grid-template-columns:minmax(0,1fr) minmax(0,1fr) 44px 44px; }
 #purchasingToolPanel .supplier-actions>.button { font-size:13px; padding:5px!important; }
 #purchasingToolPanel .supplier-control-row { gap:6px; }
 #exchangeRateCard .exchange-result { grid-template-columns:minmax(82px,1fr) minmax(108px,1fr); }
 #accountMenu .account-menu-items { position:fixed; top:96px; right:12px; left:auto; max-height:calc(100dvh - 120px); overflow:auto; z-index:140; }
 #settingsRecordsAnchor { position:fixed; right:12px; top:100px; }
 #settingsRecordsAnchor #historyDialog,#settingsRecordsAnchor #savedSupplierLists { max-height:calc(100dvh - 124px); }
}

/* Open content panels and aligned currency controls. */
@media screen {
 #adminWorkspace #mainToolTabs {
  display:grid!important; grid-template-columns:repeat(2,minmax(0,1fr));
  align-items:center; gap:8px; padding:0 0 10px; margin:0 0 12px;
  border:0!important; border-bottom:2px solid var(--color-border)!important; border-radius:0!important;
 }
 #adminWorkspace #mainToolTabs::before,#adminWorkspace #mainToolTabs::after { content:none; }
 #adminWorkspace #mainToolTabs>.button {
  width:100%; min-width:0; min-height:44px; height:44px; margin:0; padding:7px 12px!important;
  border:1px solid var(--color-border)!important; border-radius:10px!important;
  transform:none!important; font-size:16px; line-height:1.2; white-space:nowrap;
 }
 #adminWorkspace #mainToolTabs>.button[aria-pressed=true],#adminWorkspace #mainToolTabs>.button[aria-pressed=true]:hover { font-weight:800;
 }
 #adminWorkspace>#tradeToolPanel,#adminWorkspace>#purchasingToolPanel {
  width:100%; min-width:0; max-width:none; margin:0; padding:0; border:0!important; border-radius:0!important;
 }
 #exchangeRateCard .currency-toolbar { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px 8px; align-items:end; }
 #exchangeRateCard .currency-one-field { grid-column:1; grid-row:1; }
 #exchangeRateCard .currency-two-field { grid-column:2; grid-row:1; }
 #exchangeRateCard .exchange-rate-field { grid-column:1; grid-row:2; min-width:0; }
 #exchangeRateCard .rate-actions { grid-column:2; grid-row:2; width:100%; min-width:0; align-self:end; display:block; margin:0; padding:0; }
 #exchangeRateCard #refreshSupplierRate { width:100%; height:44px; min-height:44px; margin:0; padding:6px 8px!important; white-space:nowrap; }
 #exchangeRateCard #supplierRate { width:100%; height:44px; min-height:44px; box-sizing:border-box; }
 #exchangeRateCard #phpRateWrap { grid-column:1 / -1; grid-row:3; }
}
@media screen and (max-width:700px) {
 #adminWorkspace #mainToolTabs { gap:6px; margin-bottom:10px; }
 #adminWorkspace #mainToolTabs>.button,#adminWorkspace #mainToolTabs>.button:not([aria-pressed=true]),#adminWorkspace #mainToolTabs>.button[aria-pressed=true] { font-size:14px; padding:7px 8px!important; }
}

/* Compact file imports and separate profit labels from signed amounts. */
@media screen {
 #supplierCompetitorPanel .inline-actions { display:grid; grid-template-columns:auto auto 42px; gap:6px; justify-content:start; }
 #supplierCompetitorPanel .inline-actions>.button { width:100%; min-width:0; }
 .import-file-types { font-size:12px; margin:5px 0 8px; line-height:1.4; }
 #imageZoomPanel:has(#priceImagePreview[hidden]) { min-height:0; height:auto; }
 #expandPriceImage:has(#priceImagePreview[hidden]) { display:none; }
}
@media screen and (max-width:700px) {
 #supplierCompetitorPanel .inline-actions { grid-template-columns:minmax(0,1fr) minmax(0,1.4fr) 42px; width:100%; }
 #supplierCompetitorPanel .inline-actions>.button { padding:5px 6px!important; }
}
#kayaApp .picker-panel:not([hidden]){background:var(--color-surface,#fff)!important;opacity:1!important;z-index:1000!important;box-shadow:0 12px 32px rgba(0,0,0,.28)!important;border:1px solid var(--color-border,#D0D7E2)!important;backdrop-filter:none!important}#kayaApp .picker-panel .picker-options{background:inherit}#kayaApp .field-picker.is-open{z-index:1000!important}#kayaApp :is(label,.field,.ms-co-grid>*,.form-row,.field-group):has(.field-picker.is-open){position:relative;z-index:1000}#kayaApp :is(#ms-co,.ms-co-grid,.card,details):has(.field-picker.is-open){overflow:visible!important}html[data-theme=light]#kayaApp .picker-panel:not([hidden]){background:#fff!important;box-shadow:0 12px 32px rgba(16,24,40,.16)!important}
