/* Buying desk uses the shared Polished Sterling / Pewter Blue palette. */
.buying-primary-nav{display:grid;gap:5px;margin-bottom:22px}
.buying-nav-link{display:block;padding:12px 15px;border-radius:7px;text-decoration:none;color:inherit;font-weight:500}
.buying-nav-link[aria-current=page]{background:var(--theme-accent-pale);color:var(--theme-ink);box-shadow:inset 3px 0 var(--theme-accent)}
.buying-advanced-nav>summary{padding:10px 15px;color:var(--theme-muted);font-size:12px;cursor:pointer}
.buying-shell .main-nav{display:block}.buying-shell .dashboard-nav-group>p{font-size:12px}
.buying-shell .sidebar-label{display:none}.buying-shell .heading:has(+ #notice){display:none}
.buying-panel{min-width:0}.buying-workspace{color:var(--theme-ink);min-width:0;max-width:1600px;margin:0 auto}
.buying-heading{display:flex;align-items:start;justify-content:space-between;gap:20px;margin:8px 0 24px}
.buying-heading h1{font:500 clamp(25px,2.5vw,34px)/1.15 Georgia,serif;margin:0 0 8px}
.buying-heading p{margin:0;max-width:70ch}.buying-route-tools,.buying-actions{display:flex;gap:8px;flex-wrap:wrap}
.buying-toolbar{display:flex;align-items:end;gap:12px;flex-wrap:wrap;padding:0;margin:0 0 16px;background:none;border:0}
.buying-field{display:grid;gap:6px;min-width:0;font-size:12px;color:var(--theme-muted);font-weight:500}
.buying-field input,.buying-field select{box-sizing:border-box;min-width:0;width:100%;padding:10px 12px;background:var(--theme-input);border:1px solid var(--theme-line);border-radius:6px;color:var(--theme-ink);font:inherit;font-size:14px}
.buying-toolbar .buying-field:first-child{flex:1 1 240px}.buying-toolbar .buying-field{flex:0 1 180px}
.buying-choices{display:flex;gap:7px;flex-wrap:wrap;margin:0 0 12px}.buying-layouts{margin-left:auto;display:flex;gap:7px}
.buying-choices button[aria-pressed=true],.buying-detail-tabs button[aria-pressed=true]{background:var(--theme-accent);color:var(--theme-accent-ink)}
.buying-filter-notice{display:flex;align-items:center;flex-wrap:wrap;gap:10px;font-size:12px;color:var(--theme-muted)}
.buying-state{font-size:12px;color:var(--theme-muted);margin:12px 0;min-height:20px;overflow-wrap:anywhere}
.buying-update{display:flex;gap:12px;align-items:center;padding:12px;margin:12px 0;border-left:3px solid var(--theme-focus);background:var(--theme-accent-pale);font-size:13px}
.buying-update[hidden]{display:none}.buying-surface{display:grid;grid-template-columns:minmax(270px,.8fr) minmax(0,1.4fr);gap:20px;align-items:start}
.buying-list{min-width:0;overflow-wrap:anywhere}.buying-detail{min-width:0}.buying-row{appearance:none;display:block;width:100%;text-align:left;color:var(--theme-ink);background:var(--theme-surface);border:1px solid var(--theme-line);border-radius:0;padding:16px;cursor:pointer;box-sizing:border-box;font:inherit;line-height:1.5}
.buying-row+.buying-row{border-top:0}.buying-row:first-child{border-radius:8px 8px 0 0}.buying-row:last-child{border-radius:0 0 8px 8px}.buying-row:only-child{border-radius:8px}
.buying-row[aria-pressed=true]{background:var(--theme-accent-pale);box-shadow:inset 3px 0 var(--theme-accent)}
.buying-row>strong{display:block;font-size:15px;font-weight:600;margin:6px 0}.buying-row-meta{display:block;font-size:11px;color:var(--theme-muted)}
.buying-row-numbers{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:12px 0}.buying-row-numbers dt{font-size:11px;color:var(--theme-muted)}
.buying-row-numbers dd{margin:2px 0 0;font-size:15px;font-variant-numeric:tabular-nums;color:var(--theme-ink)}
.buying-row-status{display:block;font-size:12px;color:var(--theme-muted)}.buying-row-reason{display:block;font-size:12px;margin:5px 0;color:var(--theme-muted);font-weight:400}
.buying-pagination{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:18px 0;font-size:12px;color:var(--theme-muted)}
.buying-empty{padding:22px;color:var(--theme-muted);font-size:14px}
.buying-record{border:1px solid var(--theme-line);border-radius:8px;background:var(--theme-surface);padding:18px;min-width:0}
.buying-detail-tabs{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 16px}
.buying-record .workspace-lot-card{border:0;box-shadow:none;padding:0;background:none}
.buying-record .workspace-lot-card>h2{font:500 26px/1.25 Georgia,serif;margin:8px 0 18px}
.buying-record .lot-hero{grid-template-columns:minmax(0,1fr);gap:14px}
.buying-record[data-section=decision] .lot-gallery{display:none}
.buying-record[data-section=decision] .lot-cost-check{display:none}
.buying-record[data-section=costs] .lot-gallery{display:none}
.buying-record[data-section=evidence] .workspace-approval-review,.buying-record[data-section=evidence] .lot-cost-check{display:none}
.buying-record[data-section=evidence] .lot-figures{display:none}
.buying-record .workspace-quick-facts{grid-template-columns:repeat(2,minmax(0,1fr))}
.buying-record .workspace-metric{min-width:0;padding:12px;background:var(--theme-surface-raised)}
.buying-record .lot-decision{margin-top:14px}.buying-record .lot-review-notes{margin-top:8px}
.buying-record .lot-gallery .workspace-gallery-main{aspect-ratio:4/3;min-height:0}
.buying-surface[data-layout=ledger],.buying-surface[data-layout=pipeline]{grid-template-columns:minmax(0,1fr)}
.buying-surface[data-layout=ledger] .buying-detail,.buying-surface[data-layout=pipeline] .buying-detail{max-width:1100px;width:100%}
.buying-ledger{width:100%;border-collapse:collapse;background:var(--theme-surface);font-size:13px;table-layout:fixed}
.buying-ledger th,.buying-ledger td{padding:12px 10px;text-align:left;border-bottom:1px solid var(--theme-line);vertical-align:top;overflow-wrap:anywhere}
.buying-ledger th{color:var(--theme-muted);font-size:11px;font-weight:500}.buying-ledger td:not(:first-child){font-variant-numeric:tabular-nums}
.buying-ledger th:first-child{width:28%}.buying-ledger th:last-child{width:22%}.buying-ledger button{padding:0;border:0;background:none;color:var(--theme-ink);text-align:left;text-decoration:underline;font:inherit;cursor:pointer}
.buying-ledger button[aria-pressed=true]{color:var(--theme-accent);font-weight:600}
.buying-board{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.buying-stage{min-width:0}
.buying-stage h2{font-size:14px;margin:0 0 12px}.buying-stage>p{font-size:12px}.buying-stage .buying-row{border-radius:7px;margin-bottom:10px;border:1px solid var(--theme-line)}
.buying-stage .buying-row-numbers{grid-template-columns:repeat(2,minmax(0,1fr))}.buying-stage .buying-row>strong{font-size:13px}
.buying-content{display:grid;gap:20px}.buying-content[hidden],.buying-surface[hidden],.buying-toolbar[hidden],.buying-choices[hidden],.buying-pagination[hidden],.buying-filter-notice[hidden]{display:none}
.buying-settings-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}
.buying-final-prices{margin-top:20px}.buying-final-prices h3{font-size:15px;margin:4px 0 0}.buying-final-prices ul{margin:0;padding-left:18px;font-size:13px;display:grid;gap:4px;max-width:80ch}
.buying-settings-group,.buying-command-review{padding:22px;border:1px solid var(--theme-line);background:var(--theme-surface);border-radius:8px;min-width:0;display:grid;gap:14px;align-content:start}
.buying-settings-group h2,.buying-command-review h2{font-size:18px;margin:0}.buying-settings-group p,.buying-command-review p{font-size:13px;margin:0;max-width:80ch;overflow-wrap:anywhere}
.buying-source-form,.buying-model-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;align-items:end;border-bottom:1px solid var(--theme-line);padding:14px 0}
.buying-source-form>span{font-size:12px}.buying-settings-group>.buying-field{max-width:480px}
.buying-workspace[data-offline=true] .buying-state{color:var(--theme-warning)}
@media(min-width:1600px){.buying-row-numbers{grid-template-columns:repeat(4,minmax(0,1fr))}.buying-board{grid-template-columns:repeat(6,minmax(0,1fr))}}
@media(max-width:1100px){.buying-surface{grid-template-columns:minmax(230px,.85fr) minmax(0,1.15fr)}.buying-heading{flex-wrap:wrap}.buying-board{grid-template-columns:repeat(2,minmax(0,1fr))}.buying-settings-grid{grid-template-columns:1fr}}
@media(max-width:760px){.buying-surface{grid-template-columns:minmax(0,1fr)}.buying-list{max-width:none}.buying-toolbar .buying-field:first-child{flex-basis:100%}.buying-layouts{margin-left:0}.buying-primary-nav{grid-template-columns:repeat(4,minmax(0,1fr));gap:3px}.buying-nav-link{text-align:center;padding:10px 3px;font-size:12px}.buying-advanced-nav>summary{font-size:12px}.buying-heading{margin-top:10px}.buying-row-numbers{grid-template-columns:repeat(4,minmax(0,1fr))}.buying-record{padding:14px}}
@media(max-width:540px){.buying-board,.buying-source-form,.buying-model-row{grid-template-columns:1fr}.buying-row-numbers{grid-template-columns:repeat(2,minmax(0,1fr))}.buying-ledger thead{display:none}.buying-ledger,.buying-ledger tbody,.buying-ledger tr,.buying-ledger td{display:block;width:auto}.buying-ledger tr{border:1px solid var(--theme-line);margin-bottom:12px;padding:10px}.buying-ledger td{display:flex;justify-content:space-between;gap:10px;border:0;padding:6px 0}.buying-ledger td:first-child{display:block}.buying-ledger td[data-label]:before{content:attr(data-label);color:var(--theme-muted);font-size:12px}.buying-ledger td:last-child{display:block}.buying-pagination{flex-wrap:wrap}.buying-settings-group{padding:16px}.buying-primary-nav{grid-template-columns:repeat(3,minmax(0,1fr))}.buying-toolbar .buying-field{flex:1 1 120px}.buying-heading h1{font-size:26px}}
@media(pointer:coarse){.buying-workspace button,.buying-workspace input,.buying-workspace select,.buying-nav-link{min-height:44px}.buying-field input,.buying-field select{font-size:16px}}

.buying-source-queries{grid-column:1/-1;display:grid;gap:10px}.buying-query{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr) auto;gap:10px;align-items:end}.buying-row-numbers>div{min-width:0}.buying-row-numbers dd{overflow-wrap:anywhere}@media(max-width:760px){.buying-query{grid-template-columns:1fr}.buying-ledger th:first-child{width:24%}.buying-ledger th:last-child{width:20%}}

@media(max-width:540px){.buying-ledger td:last-child:before{display:block;margin-bottom:5px}.buying-ledger td:last-child{padding-top:10px}}

.buying-checkout-options{display:grid;gap:12px}.buying-checkout-options>label{margin-top:12px;max-width:480px}

.buying-ledger button{min-height:28px;max-width:100%;white-space:normal;overflow-wrap:anywhere;line-height:1.5}

/* The text navigation needs a full-width mobile header, not the legacy icon rail. */
@media(max-width:850px){
 .buying-shell .sidebar{position:static;inset:auto;width:auto;padding:16px;overflow:visible}
 .buying-shell .main-shell{margin-left:0}
 .buying-shell .sidebar .brand{margin:0 0 16px;padding:0}
 .buying-shell .sidebar .brand>span:not(.brand-mark){display:block}
 .buying-shell .sidebar-bottom{display:none}
 .buying-shell .skip-link{left:16px}
 .buying-shell .buying-primary-nav{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin-bottom:12px}
 .buying-shell .buying-nav-link{overflow-wrap:anywhere}
}

.buying-query-options{grid-column:1/-1}.buying-query-options label{margin-top:10px}

.buying-cost-accuracy{padding:1rem;border:1px solid var(--border,#4c5861);border-radius:.6rem;margin:.5rem 0 1rem}.buying-cost-accuracy h2{font-size:1rem;margin:0 0 .4rem}.buying-cost-accuracy p{margin:.3rem 0}

/* Daily sweep times use the existing settings form and appearance tokens. */
.buying-schedule-times{display:grid;gap:12px;margin:12px 0}.buying-schedule-row{display:flex;align-items:end;gap:12px;flex-wrap:wrap}.buying-schedule-row .buying-field{flex:1;min-width:160px}.buying-schedule-row button{margin-bottom:0}.buying-schedule-status{margin-top:16px;overflow-wrap:anywhere}.buying-schedule-status p{margin-top:8px}.buying-legacy-discovery{margin-bottom:12px}

.buying-hibid-session{padding:16px 20px;margin:0 0 18px;border:1px solid var(--theme-line);border-radius:12px;background:var(--theme-surface);color:var(--theme-ink)}.buying-hibid-session p{margin:6px 0}.buying-hibid-session[data-phase=needs_signin],.buying-hibid-session[data-phase=mismatch]{border-inline-start:4px solid var(--theme-warning)}.buying-hibid-session .buying-route-tools{margin-top:10px;flex-wrap:wrap}

/* A button whose dialog is still being read: it stays where it is and keeps focus, and shows that it is working. */
.buying-workspace button[aria-busy=true]{opacity:.6;cursor:progress}
/* Disclosure lines and tick-box labels are at least 24px tall, so they are not a fiddly target. */
/* :where keeps this below every rule that already gives a disclosure line more room. */
:where(.buying-workspace,.purchase-record-editor) summary{min-height:24px}
.lot-column-choices label,.purchase-record-editor .purchase-record-check{min-height:24px}
/* Beside "New approvals place": what a real-bid approval does while a switch holds it, in the colour the held state has elsewhere. */
.personal-shell .buying-field>span>small.settings-held{color:var(--desk-brass);font-weight:600}
/* On Today a lot with unsaved figures stays open after it leaves the lists; the notice about that sits above it. */
.buying-detail .buying-gone[data-kept]{margin-bottom:12px}
