/* SB Stack admin.
   Its own look: warm paper background, flat white panels with hairline rules, square corners,
   Archivo for headings and numbers, monospace for system details, ink for the active state.
   Colour appears only as small squares beside a label; never as coloured lines or rounded pills. */
@font-face{font-family:"Archivo";src:url(/fonts/archivo-700.woff2) format("woff2");font-weight:700;font-display:swap}
@font-face{font-family:"Archivo";src:url(/fonts/archivo-800.woff2) format("woff2");font-weight:800;font-display:swap}
:root{
  --paper:#F5F4F0; --panel:#FFFFFF; --panel-2:#FAF9F6; --ink:#121317; --ink-2:#3B3E46; --muted:#757884;
  --rule:#E3E1DA; --rule-2:#D3D0C7; --brand:#2563EB; --brand-soft:#EAF0FD;
  --up:#1F9D55; --warn:#C27A0E; --down:#D33A2C; --idle:#9A9CA5;
  --display:"Archivo",system-ui,sans-serif; --mono:ui-monospace,SFMono-Regular,Menlo,monospace;
  --r:5px;
}
:root[data-theme="dark"]{
  --paper:#0E0F12; --panel:#16181D; --panel-2:#1B1D23; --ink:#EDEBE6; --ink-2:#C2C0BA; --muted:#8C8E96;
  --rule:#272A31; --rule-2:#343841; --brand:#6E9BFF; --brand-soft:#1A2440; --idle:#6B6E77;
}
*{box-sizing:border-box}
html,body{margin:0}
body{background:var(--paper);color:var(--ink);font:14px/1.5 system-ui,-apple-system,"Segoe UI",sans-serif;-webkit-font-smoothing:antialiased}
button,select,input,textarea{font:inherit;color:inherit}
a{color:var(--brand);text-decoration:none}
a:hover{text-decoration:underline}
h1{font:800 26px/1.15 var(--display);letter-spacing:-.025em;margin:0}
h2{font:700 15px/1.3 var(--display);margin:0;letter-spacing:-.005em}
h3,.label-mono{font:600 12.5px/1.4 system-ui,-apple-system,"Segoe UI",sans-serif;color:var(--muted);margin:0 0 10px}
code{font:12px/1.4 var(--mono);background:var(--panel-2);border:1px solid var(--rule);border-radius:3px;padding:1px 5px;word-break:break-all}
p{margin:0 0 8px}
.sub,.muted{color:var(--muted);font-size:13px}
.small{font-size:12px}
.mono{font-family:var(--mono);font-size:12px}
.hidden{display:none!important}
.boot{padding:80px 20px;text-align:center;color:var(--muted);font:600 12.5px system-ui,-apple-system,"Segoe UI",sans-serif}
.mt{margin-top:16px}
.right{text-align:right}
.row-gap{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.grow{flex:1;min-width:0}

/* ── sign-in ─────────────────────────────────────────────── */
.gate-page{min-height:100vh;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.1fr)}
.gate-side{background:var(--gate-panel,#121317);color:var(--gate-panel-ink,#F5F4F0);display:flex;flex-direction:column;justify-content:space-between;padding:36px 40px;background-image:linear-gradient(90deg,transparent 0,transparent calc(100% - 1px),rgba(255,255,255,.05) 0),linear-gradient(0deg,transparent 0,transparent calc(100% - 1px),rgba(255,255,255,.05) 0);background-size:48px 48px}
.gate-brand{display:flex;align-items:center;gap:12px;font:800 18px var(--display);letter-spacing:-.02em}
.logo-mark.inv{background:var(--gate-panel-ink,#F5F4F0);color:var(--gate-panel,#121317)}
.gate-logo{max-height:34px;max-width:170px;width:auto;display:block}
.gate-tag p{font:800 34px/1.12 var(--display);letter-spacing:-.03em;max-width:15ch;margin:10px 0 0}
.gate-side .label-mono{color:var(--gate-panel-muted,rgba(245,244,240,.55))}
.gate-foot{margin:0}
.gate-note{display:block;margin-top:14px;font-size:13px;color:rgba(245,244,240,.6)}
.gate{align-self:center;justify-self:center;width:min(400px,100% - 32px);padding:32px 0}

.gate h1{font-size:30px}
.gate .sub{margin-top:8px}
.gate-form{display:grid;gap:14px;margin:26px 0 8px}
.gate-field{display:grid;gap:6px}
.gate-field label{font:600 12.5px system-ui,-apple-system,"Segoe UI",sans-serif;color:var(--muted)}
.gate-field input{width:100%;padding:11px 12px;font-size:15px}
.gate-submit{width:100%;justify-content:center;padding:11px;font-size:15px}
.gate-links{display:flex;justify-content:space-between;gap:8px;font-size:13px;margin-top:12px}
.gate-msg{padding:8px 12px;font-size:13px;margin-top:14px;background:var(--panel);border:1px solid var(--rule)}
.gate-msg::before,.form-error::before{content:"";display:inline-block;width:8px;height:8px;border-radius:1px;background:var(--down);margin-right:8px;vertical-align:1px}
.gate-msg.ok{border-left-color:var(--up)}
.gate .btn[data-role]{display:grid;justify-items:start;text-align:left;gap:2px;padding:12px 14px;white-space:normal}
.qr{margin:16px 0}
.qr img{width:176px;height:176px;image-rendering:pixelated;border:1px solid var(--rule);background:#fff;padding:6px}
.secret{font:13px/1.5 var(--mono);background:var(--panel);border:1px dashed var(--rule-2);padding:10px;word-break:break-all;user-select:all}
@media (max-width:860px){.gate-page{grid-template-columns:1fr}.gate-side{display:none}}

/* ── top bar ─────────────────────────────────────────────── */
.top{position:sticky;top:0;z-index:30;background:var(--panel);border-bottom:1px solid var(--rule)}
.top-in{max-width:1360px;margin:0 auto;display:flex;align-items:center;gap:22px;padding:0 24px;height:58px}
.logo{display:flex;align-items:center;gap:11px;color:var(--ink);white-space:nowrap}
.logo:hover{text-decoration:none}
.logo .word{font:800 16px var(--display);letter-spacing:-.02em}
/* A client's own wordmark in place of the initials square. Height-bound rather than
   width-bound, so a long mark and a square one both sit on the bar's baseline. */
.logo-img{height:26px;max-width:230px;width:auto;display:block}
.logo-mark{width:30px;height:30px;border-radius:4px;background:var(--ink);color:var(--paper);display:grid;place-items:center;font:800 12px var(--display);letter-spacing:.02em;flex:none}
.nav{display:flex;gap:2px;overflow-x:auto;scrollbar-width:none;flex:1}
.nav::-webkit-scrollbar{display:none}
.nav a{color:var(--ink-2);padding:7px 12px;border-radius:4px;white-space:nowrap;font:700 13.5px var(--display);letter-spacing:-.005em}
.nav a:hover{color:var(--ink);background:var(--panel-2);text-decoration:none}
.nav a.on{background:var(--ink);color:var(--paper)}
.nav-dd{display:flex}
.nav-dd .caret{font-size:9px;margin-left:3px;opacity:.6}
.nav-menu{display:none;position:fixed;z-index:40;min-width:210px;background:var(--panel);border:1px solid var(--rule-2);border-radius:var(--r);padding:6px;box-shadow:0 10px 30px rgba(18,19,23,.12)}
.nav-dd.open .nav-menu{display:block}
.nav-menu a{display:block;padding:8px 10px;border-radius:3px;color:var(--ink-2);font:500 13.5px system-ui,sans-serif;letter-spacing:0;background:none}
.nav-menu a:hover{background:var(--panel-2);color:var(--ink);text-decoration:none}
.env-pill{font:600 12.5px system-ui,-apple-system,"Segoe UI",sans-serif;padding:4px 8px;background:var(--warn);color:#fff;border-radius:3px}
.userbtn{background:none;border:1px solid var(--rule);color:var(--ink);border-radius:4px;padding:4px 10px 4px 4px;display:flex;align-items:center;gap:8px;cursor:pointer;white-space:nowrap}
.userbtn:hover{border-color:var(--rule-2)}
.avatar{width:24px;height:24px;border-radius:3px;background:var(--brand);display:grid;place-items:center;font:800 10.5px var(--display);color:#fff}
.menu{position:absolute;right:24px;top:58px;background:var(--panel);border:1px solid var(--rule-2);border-radius:var(--r);box-shadow:0 10px 30px rgba(18,19,23,.14);min-width:250px;padding:6px;z-index:40}
.menu .who{padding:8px 10px 10px;border-bottom:1px solid var(--rule);margin-bottom:4px}
.menu a,.menu button{display:block;width:100%;text-align:left;padding:8px 10px;border-radius:3px;background:none;border:0;cursor:pointer;color:var(--ink)}
.menu a:hover,.menu button:hover{background:var(--panel-2);text-decoration:none}

main{max-width:1360px;margin:0 auto;padding:30px 24px 90px}
.head{display:flex;align-items:flex-end;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-bottom:22px;padding-bottom:18px;border-bottom:1px solid var(--rule)}
.head .actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.head .sub{margin:6px 0 0}
.crumbs{font:600 12.5px system-ui,-apple-system,"Segoe UI",sans-serif;color:var(--muted);margin-bottom:8px}

/* ── controls ────────────────────────────────────────────── */
.btn{border:1px solid var(--rule-2);background:var(--panel);padding:7px 13px;border-radius:4px;cursor:pointer;font-weight:600;font-size:13px;display:inline-flex;align-items:center;gap:6px;white-space:nowrap;color:var(--ink)}
.btn:hover{border-color:var(--ink);text-decoration:none}
.btn.primary{background:var(--ink);border-color:var(--ink);color:var(--paper)}
.btn.primary:hover{background:var(--brand);border-color:var(--brand);color:#fff}
/* On the sign-in page the one button is the client's, in the client's colour. Scoped to the
   gate so a brand colour never restyles the whole admin. */
.is-gate .btn.primary{background:var(--brand);border-color:var(--brand);color:#fff}
.btn.danger{color:var(--down)}
.btn.danger:hover{border-color:var(--down)}
.btn.ghost{border-color:transparent;background:none}
.btn.sm{padding:4px 9px;font-size:12px}
.btn[disabled]{opacity:.45;cursor:not-allowed}
select,input[type=text],input[type=email],input[type=password],input[type=search],input[type=tel],input[type=url],textarea{border:1px solid var(--rule-2);background:var(--panel);border-radius:4px;padding:8px 10px;max-width:100%;color:var(--ink)}
textarea{width:100%;min-height:96px;resize:vertical;line-height:1.5}
input:focus,select:focus,textarea:focus{outline:2px solid var(--brand);outline-offset:-1px;border-color:var(--brand)}

/* ── panels ──────────────────────────────────────────────── */
.card{background:var(--panel);border:1px solid var(--rule);border-radius:var(--r);min-width:0}
.card-h{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 18px;border-bottom:1px solid var(--rule);flex-wrap:wrap}
.card-b{padding:18px}
.card + .card{margin-top:16px}
.grid{display:grid;gap:16px}
.g2{grid-template-columns:repeat(2,minmax(0,1fr))}
.g3{grid-template-columns:repeat(3,minmax(0,1fr))}
.grid > .card + .card,.conn > .card + .card{margin-top:0}
.empty{padding:34px 18px;text-align:center;color:var(--muted)}
.empty b{display:block;color:var(--ink);font:700 16px var(--display);margin-bottom:6px}
.banner{display:flex;gap:12px;align-items:baseline;padding:12px 16px;background:var(--panel);border:1px solid var(--rule);border-radius:var(--r);margin-bottom:18px;flex-wrap:wrap}
.banner.warn{background:var(--panel)}
.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));border:1px solid var(--rule);border-radius:var(--r);background:var(--panel);margin-bottom:18px}
.kpis .kpi{border:0;border-radius:0;border-right:1px solid var(--rule)}
.kpis .kpi:last-child{border-right:0}
.kpi{padding:16px 18px}
.kpi .l{font:600 12.5px system-ui,-apple-system,"Segoe UI",sans-serif;color:var(--muted)}
.kpi .v{font:800 30px/1.1 var(--display);letter-spacing:-.03em;margin-top:8px;font-variant-numeric:tabular-nums}
.kpi .d{font-size:12px;color:var(--muted);margin-top:4px}
.link-card{display:block;padding:18px;color:var(--ink);position:relative}
.link-card::after{content:"→";position:absolute;right:18px;top:16px;font:700 16px var(--display);color:var(--muted)}
.link-card:hover{text-decoration:none;border-color:var(--ink)}
.link-card:hover::after{color:var(--ink)}
.link-card b{font:700 16px var(--display);display:block;margin-bottom:6px}

/* segmented filter */
.chips{display:inline-flex;border:1px solid var(--rule-2);border-radius:4px;overflow:hidden}
.chip{border:0;border-right:1px solid var(--rule-2);background:var(--panel);padding:6px 11px;font-size:12px;cursor:pointer;font-weight:600;color:var(--ink-2)}
.chip:last-child{border-right:0}
.chip.on{background:var(--ink);color:var(--paper)}

/* tables */
.tbl-wrap{overflow-x:auto}
table.t{width:100%;border-collapse:collapse}
.t th{text-align:left;font:600 12.5px system-ui,-apple-system,"Segoe UI",sans-serif;color:var(--muted);padding:10px 18px;border-bottom:1px solid var(--rule);white-space:nowrap;background:var(--panel-2)}
.t td{padding:12px 18px;border-bottom:1px solid var(--rule);vertical-align:middle}
.t tr:last-child td{border-bottom:0}
.t tr:hover td{background:var(--panel-2)}
.primary-cell{font-weight:600}
.second{color:var(--muted);font-size:12px}
td.second,.t .second.mono{font-family:var(--mono);font-size:11.5px}

/* status: a coloured square and a word */
.pill{display:inline-flex;align-items:center;gap:7px;font-size:12.5px;font-weight:500;white-space:nowrap;color:var(--ink-2)}
.pill i{width:8px;height:8px;border-radius:1px;background:var(--idle);flex:none}
.p-up i{background:var(--up)} .p-warn i{background:var(--warn)} .p-down i{background:var(--down)} .p-brand i{background:var(--brand)} .p-ink i{background:var(--ink)}
.sq{display:inline-block;width:9px;height:9px;border-radius:1px;margin-right:7px;vertical-align:baseline;background:var(--idle);flex:none}
.sq.up{background:var(--up)} .sq.warn{background:var(--warn)} .sq.down{background:var(--down)}

/* left sub-menu inside an area */
.set-wrap{display:grid;grid-template-columns:200px minmax(0,1fr);gap:28px;align-items:start}
.subnav{display:grid;gap:1px;position:sticky;top:84px}
.subnav a{padding:8px 12px;border-radius:3px;color:var(--ink-2);font-weight:500}
.subnav a.on{background:var(--ink);color:var(--paper)}
.subnav a:hover{text-decoration:none;background:var(--panel)}
.subnav a.on:hover{background:var(--ink)}
.subnav .label{font:600 12.5px system-ui,-apple-system,"Segoe UI",sans-serif;color:var(--muted);padding:0 12px 8px}

/* forms */
.form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 18px}
.field{display:grid;gap:6px;min-width:0;align-content:start}
.field.full{grid-column:1/-1}
.field > label{font:600 12.5px system-ui,-apple-system,"Segoe UI",sans-serif;color:var(--muted)}
.field input,.field select,.field textarea{width:100%}
.field .help{font-size:12px;color:var(--muted)}
.form-error{color:var(--ink);font-size:13px;margin-bottom:10px}
.kv{display:grid;grid-template-columns:170px 1fr;gap:9px 14px;font-size:13.5px;margin:0}
.kv dt{font:600 12.5px/1.9 system-ui,-apple-system,"Segoe UI",sans-serif;color:var(--muted)}
.kv dd{margin:0;min-width:0;word-wrap:break-word}
.switch{position:relative;width:34px;height:18px;flex:none;display:inline-block}
.switch input{opacity:0;width:0;height:0}
.switch span{position:absolute;inset:0;background:var(--rule-2);border-radius:3px;cursor:pointer;transition:.15s}
.switch span:before{content:"";position:absolute;width:14px;height:14px;left:2px;top:2px;background:#fff;border-radius:2px;transition:.15s}
.switch input:checked + span{background:var(--ink)}
.switch input:checked + span:before{transform:translateX(16px)}
.conn{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.conn .c{border:1px solid var(--rule);border-radius:var(--r);padding:18px;display:grid;gap:12px;align-content:start;background:var(--panel)}
.conn .c > .row-gap b{font:700 15px var(--display)}
.conn .c p{margin:0}
.conn .c .btn,.keybox .btn{justify-self:start}
.keybox{border-top:1px solid var(--rule);padding-top:12px;display:grid;gap:8px}

/* modal */
.modal-wrap{position:fixed;inset:0;z-index:70;display:grid;place-items:center;padding:16px;background:rgba(18,19,23,.45)}
.modal{background:var(--panel);border-radius:var(--r);width:min(540px,100%);max-height:calc(100vh - 32px);display:flex;flex-direction:column;border:1px solid var(--rule-2);box-shadow:0 24px 60px rgba(0,0,0,.25)}
/* The form, not the header/body/footer, is the modal's own child, so it has to be the flex
   column. Without this the body never shrinks, the box runs past max-height and the save
   button sits off the bottom of the window with nothing to scroll. */
.modal > form{display:flex;flex-direction:column;min-height:0;flex:1 1 auto;max-height:100%}
.modal-h{padding:16px 20px;border-bottom:1px solid var(--rule);display:flex;justify-content:space-between;align-items:center;gap:10px;flex:0 0 auto}
/* min-height:0 or the body refuses to shrink inside the flex column, the box runs past
   max-height, and the footer with the save button sits off the bottom of the window with
   nothing to scroll. Only shows on a dialog taller than the screen. */
.modal-b{padding:18px 20px;overflow:auto;min-height:0;flex:1 1 auto}
.modal-f{padding:12px 20px;border-top:1px solid var(--rule);display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap;background:var(--panel-2);flex:0 0 auto}
.x{background:none;border:0;cursor:pointer;color:var(--muted);font-size:22px;line-height:1;padding:0 4px}

.toast{position:fixed;left:50%;bottom:24px;transform:translate(-50%,16px);background:var(--ink);color:var(--paper);padding:10px 16px;border-radius:4px;opacity:0;transition:.2s;z-index:90;font-size:13px;max-width:calc(100% - 32px);pointer-events:none}
.toast.on{opacity:1;transform:translate(-50%,0)}
.toast.err{background:var(--down);color:#fff}

@media (max-width:1100px){.g3{grid-template-columns:1fr 1fr}.conn{grid-template-columns:1fr}}
@media (max-width:760px){
  .top-in{padding:0 14px;gap:12px}
  .logo .word,.userbtn .uname{display:none}
  main{padding:20px 16px 80px}
  .g2,.g3,.form,.set-wrap{grid-template-columns:1fr}
  .subnav{position:static;display:flex;overflow-x:auto}
  .subnav .label{display:none}
  .t th,.t td{padding:10px 12px}
  .hide-sm{display:none}
  .kv{grid-template-columns:1fr;gap:2px 0}
  .kv dd{margin-bottom:8px}
  .kpis .kpi{border-right:0;border-bottom:1px solid var(--rule)}
}
/* Busy bars: a square bar sliding under anything that's waiting on AWS, so nothing ever looks frozen. */
.boot.busy::after,.gate-form:has(.gate-submit:disabled)::after{content:"";display:block;height:4px;margin:14px auto 0;max-width:220px;border-radius:1px;
  background:linear-gradient(90deg,transparent 0,var(--ink) 0) no-repeat,var(--rule);background-size:35% 100%,100% 100%;animation:busy 1.1s ease-in-out infinite}
.gate-form:has(.gate-submit:disabled)::after{max-width:none;margin-top:12px}
@keyframes busy{0%{background-position:-40% 0,0 0}100%{background-position:140% 0,0 0}}
@media (prefers-reduced-motion:reduce){.boot.busy::after,.gate-form:has(.gate-submit:disabled)::after{animation:none;background-size:100% 100%,100% 100%;opacity:.5}}

/*
 * The change log's notes, as a document (SB Ops → Change log).
 *
 * A <pre> because it IS preformatted — the server renders it as plain text so the screen,
 * the connector tool and anything pasted out of either are the same words. It wraps rather
 * than scrolling sideways: this is read, not inspected.
 */
.doc {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 12.5px/1.6 var(--mono);
  color: var(--ink2);
  max-height: 60vh;
  overflow-y: auto;
}

/* module: dealer/dealer.css */
/* Mylenbusch Auto Source, in the Oktoberfest hub layout.
 *
 * That layout is the SB Operations design system, the same one ORF and Correll wear: white,
 * a sticky top bar with dropdown groups, flat panels with a hairline border, tables that
 * breathe, and plain sentence-case labels.
 *
 * Mylenbusch red is the logo oval, the focus ring and the active tint. It is never a button
 * fill and never a line: a screen of red buttons reads as a warning, and a coloured rounded
 * underline on the active tab is the thing that makes a client say it looks like a template.
 * A status here is a small square and a plain word, and the page you are on is simply the
 * dark one.
 */
:root {
  --paper: #FFFFFF;
  --panel: #FFFFFF;
  --panel-2: #F4F4F3;
  --ink: #0A0A0A;
  --ink-2: #3B3E46;
  --muted: #6B7280;
  --rule: #E5E4E0;
  --rule-2: #D7D5CF;
  --brand: #8E1017;
  --brand-soft: #FBEDEE;
  --accent: #A2121A;
  --r: 8px;
}
:root[data-theme="dark"] {
  --paper: #0C0C0D;
  --panel: #151517;
  --panel-2: #1B1B1E;
  --ink: #F4F4F3;
  --ink-2: #C7C5BF;
  --muted: #8C8E96;
  --rule: #262629;
  --rule-2: #333338;
  --brand: #E8636C;
  --brand-soft: #2B1113;
}

body { font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; }

/* ── the top bar ───────────────────────────────────────────────── */
.top { background: var(--panel); border-bottom: 1px solid var(--rule); box-shadow: none; }
.top-in { max-width: 1400px; height: 56px; gap: 18px; }
.logo-mark { background: var(--accent); color: #FFFFFF; border-radius: 8px; }
.nav a { border-radius: 8px; padding: 8px 10px; font-weight: 500; color: var(--ink-2); }
.nav a:hover { background: var(--panel-2); color: var(--ink); }
.nav a.on { background: var(--brand-soft); color: var(--brand); }
.nav-menu { border-radius: 12px; box-shadow: 0 12px 32px rgba(10, 10, 10, .14); }
.userbtn { border-radius: 99px; background: var(--panel-2); }

/* ── page head ─────────────────────────────────────────────────── */
.dl-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 26px 0 18px; }
.dl-head h1 { font-size: 26px; letter-spacing: -.025em; }
.dl-head .sub { margin: 6px 0 0; max-width: 70ch; }
.dl-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── the rest of the section, as plain words ───────────────────── */
.dl-secnav { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 18px; }
.dl-secnav a { padding: 6px 10px; border-radius: 6px; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.dl-secnav a:hover { background: var(--panel-2); color: var(--ink); text-decoration: none; }
.dl-secnav a.on { background: var(--ink); color: var(--paper); }

/* ── stat tiles ────────────────────────────────────────────────── */
.dl-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.dl-tile { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r); padding: 14px 16px; }
.dl-tile-l { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.dl-tile-n { font: 800 28px/1.1 var(--display, Archivo), system-ui, sans-serif; margin: 6px 0 4px; letter-spacing: -.02em; }
.dl-tile-n.on { color: var(--brand); }
.dl-tile-s { font-size: 12.5px; color: var(--muted); }

/* ── panels and the two column split ───────────────────────────── */
.panel { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r); padding: 18px 20px; margin-bottom: 18px; }
.panel h2 { margin-bottom: 4px; }
.panel h3 { margin: 14px 0 8px; }
.panel > .sub { margin-bottom: 14px; max-width: 80ch; }
.dl-two { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .dl-two { grid-template-columns: minmax(0, 1fr); } }

/* ── status: a small square and a word, never a pill ───────────── */
.dl-mark { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.dl-mark i { width: 9px; height: 9px; display: inline-block; flex: none; }
.dl-sq-intake { background: #9A9CA5; }
.dl-sq-recon { background: #C27A0E; }
.dl-sq-live { background: #1F9D55; }
.dl-sq-sold { background: var(--accent); }
.dl-sq-off { background: var(--rule-2); }
/* Stuck. Amber rather than the brand red, which is the mark and never a warning. */
.dl-sq-warn { background: #B4531B; }

/* ── tables ────────────────────────────────────────────────────── */
.dl-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.dl-table th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.dl-table td { padding: 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.dl-table tbody tr:last-child td { border-bottom: none; }
.dl-table tbody tr:hover { background: var(--panel-2); }
.dl-table .right { text-align: right; }
.dl-table .sub { display: inline; }
.dl-total td { font-weight: 700; border-top: 1px solid var(--rule-2); }
.dl-warn { color: var(--brand); font-weight: 600; }
/* A retired row: still there to be read, no longer something to act on. */
.dl-dim td { opacity: 0.55; }
table.panel { padding: 8px 10px; }

/* ── the pipeline rail ─────────────────────────────────────────── */
.dl-board { list-style: none; margin: 0; padding: 0; }
.dl-board li { border-bottom: 1px solid var(--rule); }
.dl-board li:last-child { border-bottom: none; }
.dl-board a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 2px; color: var(--ink); }
.dl-board a:hover { text-decoration: none; color: var(--brand); }
.dl-board-n { font: 700 15px/1 var(--display, Archivo), system-ui, sans-serif; color: var(--ink-2); }

/* ── lists that read like a feed ───────────────────────────────── */
.dl-feed { list-style: none; margin: 0; padding: 0; }
.dl-feed li { padding: 9px 0; border-bottom: 1px solid var(--rule); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.dl-feed li:last-child { border-bottom: none; }
.dl-feed strong { font-weight: 600; }

/* ── the facts list on a car or a person ───────────────────────── */
.dl-facts { display: grid; grid-template-columns: minmax(130px, auto) minmax(0, 1fr); gap: 6px 18px; margin: 0 0 14px; font-size: 13.5px; }
.dl-facts dt { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.dl-facts dd { margin: 0; }

/* ── photographs ───────────────────────────────────────────────── */
.dl-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.dl-shots figure { margin: 0; border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; background: var(--panel-2); }
.dl-shots img { width: 100%; height: 124px; object-fit: cover; display: block; }
.dl-shots figcaption { padding: 7px 9px; font-size: 12px; color: var(--muted); }
.dl-shots figure.ok figcaption { color: var(--ink-2); }

/* ── checklists, cards, forms, empties ─────────────────────────── */
.dl-checks { list-style: none; margin: 0; padding: 0; }
.dl-checks li { padding: 7px 0; border-bottom: 1px solid var(--rule); }
.dl-checks li:last-child { border-bottom: none; }
.dl-checks label { display: flex; align-items: center; gap: 10px; cursor: pointer; }

.dl-card { border: 1px solid var(--rule); border-radius: var(--r); padding: 14px 16px; margin-bottom: 12px; }
.dl-card h3 { margin: 0 0 4px; color: var(--ink); font-size: 15px; font-weight: 700; }

.dl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; margin-bottom: 14px; }
.dl-search { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.dl-search input[type=search], .dl-search input[name=search] { flex: 1; min-width: 0; }
.dl-check { display: flex; align-items: center; gap: 8px; }

/*
 * A LABEL WRAPS ITS BOX, AND THE TWO STACK.
 *
 * The admin shell styles `.field > label` with the control as a sibling. These screens write
 * `<label>Mileage in<input></label>` instead, because a label that owns its box cannot come
 * apart from it. Without these rules the browser lays the pair out as running text: the words
 * sit to the left of the box, the next label starts wherever the last box ended, and a form
 * reads as a paragraph with holes in it.
 *
 * The control needs its font set back as well. The shell says `font: inherit` on inputs so
 * they match the page, but inherit here means the label's small bold gray, which would make
 * every box look like a caption.
 */
.dl-grid > label,
.dl-search > label,
.modal-b > label,
.modal-b .dl-grid > label,
.modal-b [data-part] > label:not(.dl-check),
.panel form label:not(.dl-check) {
  display: grid;
  gap: 5px;
  min-width: 0;
  align-content: start;
  font: 600 12.5px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--muted);
}
.dl-grid > label > input, .dl-grid > label > select, .dl-grid > label > textarea,
.dl-search > label > input, .dl-search > label > select,
.modal-b > label > input, .modal-b > label > select, .modal-b > label > textarea,
.modal-b .dl-grid > label > input, .modal-b .dl-grid > label > select, .modal-b .dl-grid > label > textarea,
.modal-b [data-part] > label > input, .modal-b [data-part] > label > select, .modal-b [data-part] > label > textarea,
.panel form label > input, .panel form label > select, .panel form label > textarea {
  width: 100%;
  font: 400 14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
}
/* A number box, a date box and a plain <input> with no type at all are not in the shell's
   list of styled inputs, so they arrive with the browser's own border and sit a pixel off
   every text box beside them. A bare input is the common one: half the dialogs in this module
   write `<input name="first_name">` with no type, which is a text box in every browser there
   is and was the one box on the screen with no border of ours. */
.modal-b input:not([type]), .panel input:not([type]),
.modal-b input[type=number], .modal-b input[type=date], .modal-b input[type=month],
.panel input[type=number], .panel input[type=date], .panel input[type=month] {
  border: 1px solid var(--rule-2);
  background: var(--panel);
  border-radius: 4px;
  padding: 8px 10px;
  max-width: 100%;
  color: var(--ink);
}
/* Room between a dialog's rows, and the explaining sentence tucked under the box it explains. */
.modal-b > label, .modal-b > .dl-grid, .modal-b > .dl-check, .modal-b > p,
.modal-b [data-part] > label, .modal-b [data-part] > .dl-grid,
.modal-b [data-part] > .dl-check, .modal-b [data-part] > p { margin-bottom: 14px; }
.modal-b > p.sub, .modal-b [data-part] > p.sub { margin-top: -8px; }
.modal-b > *:last-child, .modal-b [data-part] > *:last-child { margin-bottom: 0; }
/* A part of the dialog that does not belong to the kind of thing being added is not there at
   all. `hidden` alone loses to any display rule, so it is said again here. */
.modal-b [data-part][hidden] { display: none; }
.dl-check { font-size: 14px; color: var(--ink); }
/* A tick box is a tick box. The rules above stretch a control to the width of its label,
   which is right for a text box and absurd for a checkbox, so it is said back here. */
.dl-check > input, .modal-b label.dl-check > input, .panel form label.dl-check > input {
  width: auto;
  min-width: 0;
  flex: none;
  margin: 0;
}

.dl-empty { padding: 22px 2px; color: var(--muted); }
.dl-empty p { margin: 0 0 4px; }

/* ------------------------------------------------------------------ the photograph board

   Drop a whole set in at once, drag them into the order a shopper should see them, and mark
   the one that leads. The lead one is marked with a word and a heavier frame rather than a
   coloured ring: the rest of this screen does not use color to say things and neither does
   this. The frame while dragging is the one place a tint appears, and it is gone the moment
   the photograph lands. */
.dl-drop {
  border: 1px dashed var(--rule-2);
  border-radius: var(--r);
  background: var(--panel-2);
  padding: 18px;
  text-align: center;
  margin-bottom: 14px;
}
.dl-drop p { margin: 0 0 4px; }
.dl-drop p:last-child { margin-bottom: 0; }
.dl-drop.over { border-color: var(--ink); background: var(--panel); }

.dl-board figure { position: relative; cursor: grab; }
.dl-board figure.dragging { opacity: 0.4; cursor: grabbing; }
.dl-board figure.over { outline: 2px solid var(--ink); outline-offset: -2px; }
.dl-board figure.lead { border-color: var(--ink); }
.dl-board figcaption { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.dl-shot-n {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: var(--panel);
  border: 1px solid var(--rule-2);
  font-size: 11px;
  color: var(--ink);
}
.dl-shot-move { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 9px 9px; }
/* Wider than the plain gallery, because each one carries its own row of buttons and a
   two-inch tile turns four short words into four lines. */
.dl-board { grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); align-items: start; }
.dl-board figcaption { padding-bottom: 5px; }
.dl-board figcaption strong { color: var(--ink); font-size: 12px; }
/* Earlier and later are arrows rather than words: four words on a tile this size wrap to two
   rows, and nobody has ever had to be told what an arrow on a row of photographs does. The
   words are still there for a screen reader and on hover. */
/* The row has to fit across a tile, so the buttons on it are a size down from the page's. */
.dl-shot-move .btn { padding: 4px 8px; font-size: 11.5px; }
/* Dragging is done with pointer events so a finger works as well as a mouse, which means the
   browser must stop treating a drag across a tile as a scroll. */
.dl-board figure { touch-action: none; user-select: none; }
.dl-board figure img { pointer-events: none; }

/* ------------------------------------------------------------------ the car, in depth

   A spec sheet rather than a stacked list. A used car is sold on its detail, and a column of
   eleven rows with half the page empty beside it reads as a form somebody half filled in.
   Six small groups across the panel, each one a heading and its own facts, so the eye can go
   straight to the transmission or the title without reading the lot. */
.dl-spec-lead { margin: 0 0 14px; font-size: 17px; font-weight: 650; color: var(--ink); }
/* Six headings in a row read as one wall of words, so the groups are wider, further apart
   and fenced off from each other: a rule down the left of each, and a dotted line under
   every fact so the eye can run from the word to the answer. */
.dl-spec { display: grid; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); gap: 20px 0; margin-bottom: 16px; }
.dl-spec > div { border-left: 1px solid var(--rule); padding: 2px 22px 2px 18px; min-width: 0; }
.dl-spec > div:first-child { border-left: 0; padding-left: 0; }
.dl-spec h3 {
  margin: 0 0 7px;
  font: 600 11px/1.2 system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.dl-spec dl { display: grid; grid-template-columns: minmax(78px, auto) minmax(0, 1fr); gap: 0 14px; margin: 0; font-size: 13.5px; }
.dl-spec dt { color: var(--muted); font-size: 12.5px; padding: 5px 0; border-bottom: 1px dotted var(--rule); }
.dl-spec dd { margin: 0; padding: 5px 0; color: var(--ink); font-weight: 550; text-align: right; overflow-wrap: anywhere; border-bottom: 1px dotted var(--rule); }
.dl-spec dl > dt:last-of-type, .dl-spec dl > dd:last-of-type { border-bottom: 0; }
.dl-vin { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.dl-spec-note { margin: 0 0 14px; font-size: 13.5px; }
.dl-spec-note strong { color: var(--muted); font-weight: 600; margin-right: 6px; }

/* ------------------------------------------------------------------ the gallery

   The car itself, at the top of its own page, the way anybody looking at a car expects. One
   large photograph and a strip of the rest; the strip scrolls sideways rather than wrapping,
   so a car with thirty photographs does not push the figures off the screen. */
.dl-gallery { margin-bottom: 18px; }
.dl-gal-big { margin: 0 0 8px; border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; background: var(--panel-2); }
.dl-gal-big img { display: block; width: 100%; height: 380px; object-fit: cover; }
.dl-gal-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.dl-gal-t {
  flex: none;
  width: 104px;
  height: 70px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  background: var(--panel-2);
  cursor: pointer;
}
.dl-gal-t img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dl-gal-t.on { border-color: var(--ink); border-width: 2px; }

/* ------------------------------------------------------------------ what to ask for it

   The same shape as the roofing estimate: the four numbers that matter across the top, a bar
   that draws what the car owes against what it would make, and one slider under it. Moving
   the slider moves all four, so pricing a car is a conversation with a picture rather than
   arithmetic done on the back of the buyer's order. */
.dl-price-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 20px; margin: 14px 0 16px; }
.dl-pl { font-size: 12px; color: var(--muted); }
.dl-pn { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); line-height: 1.15; }
.dl-pn.muted { color: var(--ink-2); font-weight: 600; }
.dl-ps { font-size: 12px; color: var(--muted); margin-top: 2px; }
.dl-bar { display: flex; height: 26px; border: 1px solid var(--rule-2); border-radius: 3px; overflow: hidden; background: var(--panel-2); }
.dl-bar span { display: flex; align-items: center; min-width: 0; overflow: hidden; transition: flex-basis 0.08s linear; }
.dl-bar b { font: 600 11px/1 system-ui, -apple-system, sans-serif; padding: 0 8px; white-space: nowrap; }
.dl-bar-cost { background: var(--rule-2); }
.dl-bar-cost b { color: var(--ink-2); }
.dl-bar-gross { background: var(--ink); }
.dl-bar-gross b { color: var(--panel); }
.dl-slider { width: 100%; margin: 14px 0 2px; accent-color: var(--ink); }
.dl-scale { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-bottom: 12px; }
.dl-chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dl-pricehist { margin-top: 16px; }

/* ------------------------------------------------------------------ the pipeline board

   Columns across, cars down, dragged with a pointer so a finger on the forecourt works the
   same as a mouse in the office. The whole row scrolls sideways rather than squeezing eleven
   stages into the width of a laptop, because a column narrower than a car's name is no use.
   Stuck is said in words beside the usual small square: no red card, no coloured border. */
.dl-board-cols {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 18px;
  align-items: flex-start;
  scrollbar-width: thin;
  scrollbar-color: var(--rule-2) transparent;
}
.dl-board-cols::-webkit-scrollbar, .dl-col-cars::-webkit-scrollbar { height: 8px; width: 8px; }
.dl-board-cols::-webkit-scrollbar-track, .dl-col-cars::-webkit-scrollbar-track { background: transparent; }
.dl-board-cols::-webkit-scrollbar-thumb, .dl-col-cars::-webkit-scrollbar-thumb { background: var(--rule-2); border-radius: 4px; }
.dl-col {
  flex: none;
  width: 236px;
  background: var(--panel-2);
  border: 1px solid var(--rule);
  border-radius: var(--r);
}
.dl-col > header { padding: 8px 10px; border-bottom: 1px solid var(--rule); }
.dl-col h2 { margin: 0; font-size: 13.5px; }
.dl-col-fold {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.dl-col-n { margin-left: auto; font-weight: 400; font-size: 11.5px; color: var(--muted); }
.dl-caret { flex: none; opacity: 0.55; }
.dl-col.shut .dl-caret { transform: rotate(-90deg); }
.dl-col > header .sub { margin: 2px 0 0; font-size: 11.5px; }
.dl-col-late { margin: 5px 0 0; }
.dl-col-cars {
  padding: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  align-content: start;
  min-height: 54px;
  max-height: calc(100vh - 300px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--rule-2) transparent;
}
.dl-col-empty { margin: 0; padding: 8px 2px; color: var(--muted); font-size: 12.5px; }
.dl-col.over { background: var(--panel); }
.dl-col.over > header { border-bottom-color: var(--ink-2); }

/* Folded away: a narrow spine with the name on its side and the count under it. Which ones
   are folded is remembered in this browser, because a lot that never buys at auction wants
   that column out of the way for good. */
.dl-col.shut { width: 38px; }
.dl-col.shut > header { border-bottom: 0; padding: 8px 0 10px; }
.dl-col.shut .sub, .dl-col.shut .dl-col-late, .dl-col.shut .dl-col-add, .dl-col.shut .dl-col-cars { display: none; }
.dl-col.shut .dl-col-fold { flex-direction: column; gap: 10px; justify-content: flex-start; min-height: 140px; }
.dl-col.shut .dl-col-name { writing-mode: vertical-rl; }
.dl-col.shut .dl-col-n { margin: 0; }

/* The card. Small on purpose: a lot with sixty cars should still fit on one screen, so it is
   a thumbnail, three lines and the price, not a poster. */
.dl-card2 {
  display: flex;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  cursor: grab;
  touch-action: none;
  user-select: none;
}
/* A stuck car is said with the badge and nothing else: no coloured edge on the card. */
.dl-card2.stuck { border-color: var(--rule-2); }
.dl-card2.dragging { opacity: 0.4; border-style: dashed; background: var(--panel-2); }
.dl-card2-shot {
  flex: none;
  width: 58px;
  height: 44px;
  position: relative;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 3px;
  overflow: hidden;
  background: var(--panel-2);
  cursor: pointer;
}
.dl-card2-shot img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.dl-noshot {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 2px;
  font-size: 9.5px;
  line-height: 1.15;
  color: var(--muted);
  text-align: center;
}
.dl-shotn {
  position: absolute;
  right: 2px;
  bottom: 2px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 3px;
  border-radius: 3px;
  background: rgba(22, 20, 18, 0.76);
  color: #fff;
  font: 600 9.5px/1 system-ui, -apple-system, sans-serif;
}
.dl-card2-b { flex: 1; min-width: 0; }
.dl-card2-b h3 { margin: 0; font-size: 12.5px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-card2-b .sub { margin: 1px 0 0; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-card2-f { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-top: 2px; }
.dl-card2-f > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dl-card2-p { font-weight: 700; font-size: 12.5px; color: var(--ink); white-space: nowrap; }

/* STUCK. The one thing on this board that is allowed to shout: a red box with an exclamation
   mark and how long the car has been standing there, the same badge the roofing board uses. */
.dl-late {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 5px 1px 3px;
  border-radius: 2px;
  background: #B4531B;
  color: #fff;
  font: 600 10.5px/1.5 system-ui, -apple-system, sans-serif;
  white-space: nowrap;
}
.dl-late b { font-size: 11.5px; font-weight: 800; }
.dl-shotbtn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border: 1px solid var(--rule-2);
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink);
  font: 600 11px/1 system-ui, -apple-system, sans-serif;
  cursor: pointer;
}

/* The card you are holding, lifted off the board and carried by the pointer. The real card
   stays where it will land, greyed and dashed, so the drop is never a guess. */
.dl-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 70;
  pointer-events: none;
  box-shadow: 0 14px 28px rgba(24, 20, 16, 0.3);
  background: var(--panel);
}
body.dl-dragging { cursor: grabbing; user-select: none; }

/* ------------------------------------------------------------------ the photograph pop-up

   A panel in the middle of the window, not a full-bleed overlay: one photograph at a time,
   driven by the buttons or the arrow keys. The rail scrolls but shows no bar, and the page
   behind is held still while it is open, so there is only ever one thing to scroll. */
.dl-lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(16, 16, 18, 0.72);
  display: grid;
  place-items: center;
  padding: 22px;
}
.dl-lb-box {
  width: min(980px, 100%);
  max-height: min(86vh, 780px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--r);
}
.dl-lb-head, .dl-lb-foot { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); }
.dl-lb-head { justify-content: space-between; }
.dl-lb-head strong { color: var(--ink); font-size: 13.5px; }
.dl-lb-foot { justify-content: center; }
.dl-lb-foot .dl-lb-of { min-width: 72px; text-align: center; }
.dl-lb-rail {
  flex: 1;
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  min-height: 0;
  background: var(--panel-2);
  border-radius: var(--r);
  scrollbar-width: none;
}
.dl-lb-rail::-webkit-scrollbar { display: none; }
.dl-lb-rail figure {
  margin: 0;
  flex: none;
  width: 100%;
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  min-height: 0;
}
.dl-lb-rail img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 3px; }
.dl-lb-rail figcaption { color: var(--muted); font-size: 11.5px; text-align: center; max-width: 70ch; }
body.dl-noscroll { overflow: hidden; }

/* ------------------------------------------------------------------- the lot's filters

   Every detail the lot records about a car is a filter, because "what have we got in a gray
   SUV under twenty thousand with four wheel drive" is the question a salesperson is asked on
   the forecourt, and the answer has to come back before the shopper walks. */
.dl-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(146px, 1fr)); gap: 9px 12px; align-items: end; }
.dl-filters > label { display: grid; gap: 3px; font-size: 11.5px; color: var(--muted); min-width: 0; }
.dl-filters > label > input, .dl-filters > label > select { width: 100%; }
.dl-filters .dl-f-wide { grid-column: span 2; }
.dl-pair { display: flex; gap: 6px; align-items: center; }
.dl-pair input { width: 100%; min-width: 0; }
.dl-filter-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.dl-filter-foot .sub { margin: 0; }
.dl-chipline { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 0; }
.dl-chipline button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border: 1px solid var(--rule-2);
  border-radius: 3px;
  background: var(--panel-2);
  color: var(--ink);
  font: 500 11.5px/1.6 system-ui, -apple-system, sans-serif;
  cursor: pointer;
}

/* ------------------------------------------------------------------ the pricing panel

   The toggle is a pair of plain square buttons, one of them ink: the office prices in
   margin and the owner prices in dollars, and both want the same slider underneath. */
.dl-pricer-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.dl-pricer-head h2 { margin: 0 0 4px; }
.dl-pricer-head .sub { margin: 0; max-width: 68ch; }
.dl-toggle { display: inline-flex; flex: none; border: 1px solid var(--rule-2); border-radius: var(--r); overflow: hidden; }
.dl-toggle button {
  padding: 6px 12px;
  border: 0;
  border-right: 1px solid var(--rule-2);
  background: var(--panel);
  color: var(--ink-2);
  font: 600 12.5px/1.2 system-ui, -apple-system, sans-serif;
  cursor: pointer;
}
.dl-toggle button:last-child { border-right: 0; }
.dl-toggle button.on { background: var(--ink); color: var(--panel); }
.dl-chips[hidden] { display: none; }
.dl-costsplit { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--rule); }
.dl-costsplit h3 { margin: 0 0 8px; font-size: 13px; }
.dl-costsplit .sub { margin: 8px 0 0; max-width: 90ch; }
.dl-col-add { margin: 8px 0 0; }

/* A panel that runs the width of the page, and the history list laid out across it rather
   than down a narrow rail. */
.dl-wide { width: 100%; }
.dl-feed-wide { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 18px; }
.dl-feed-wide li .sub { display: block; }

/* ------------------------------------------------------------------ the window tag

   One sheet of letter paper, laid out the way a window tag is always laid out: the lot
   at the top, the car in big letters, the price and a code to scan beside each other, then
   what is on the car, what has been done to it and what the lot says about a warranty.
   On screen it is shown at the size it will print. */
.dl-tag {
  width: 7.6in;
  max-width: 100%;
  margin: 0 auto 20px;
  padding: 0.42in 0.46in;
  background: #fff;
  color: #141210;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  font-family: Archivo, system-ui, -apple-system, sans-serif;
}
.dl-tag-top { display: flex; gap: 18px; align-items: flex-start; justify-content: space-between; border-bottom: 3px solid #141210; padding-bottom: 10px; }
.dl-tag-logo { height: 42px; width: auto; }
.dl-tag-word { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; }
.dl-tag-who { text-align: right; font-size: 11px; line-height: 1.45; color: #3B3E46; }
.dl-tag-name { font-weight: 700; color: #141210; font-size: 12.5px; }
.dl-tag-car { padding: 14px 0 10px; }
.dl-tag-car h1 { margin: 0; font-size: 40px; line-height: 1.05; letter-spacing: -0.02em; }
.dl-tag-trim { margin: 4px 0 0; font-size: 17px; color: #3B3E46; }
.dl-tag-price {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 2px solid #141210;
}
.dl-tag-plabel { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: #3B3E46; }
.dl-tag-pnum { font-size: 52px; font-weight: 800; line-height: 1; letter-spacing: -0.025em; }
.dl-tag-pnote { margin-top: 6px; font-size: 10px; color: #3B3E46; max-width: 44ch; }
.dl-tag-qr { margin: 0; flex: none; text-align: center; }
.dl-tag-qr img { display: block; width: 1.25in; height: 1.25in; }
.dl-tag-qr figcaption { margin-top: 4px; font-size: 9px; line-height: 1.3; color: #3B3E46; }
.dl-tag h2 {
  margin: 16px 0 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #3B3E46;
  border-bottom: 1px solid #C9C7C1;
  padding-bottom: 3px;
}
.dl-tag-spec dl { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 26px; margin: 0; }
.dl-tag-spec dl > div { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px dotted #DAD8D2; font-size: 12px; }
.dl-tag-spec dt { color: #3B3E46; }
.dl-tag-spec dd { margin: 0; font-weight: 600; text-align: right; }
.dl-tag-work ul { margin: 0; padding: 0 0 0 16px; columns: 2; column-gap: 26px; font-size: 12px; }
.dl-tag-work li { margin: 0 0 2px; break-inside: avoid; }
.dl-tag-warranty p { margin: 0; padding: 8px 10px; border: 1px solid #141210; font-size: 11.5px; line-height: 1.45; }
.dl-tag-foot { margin-top: 14px; padding-top: 8px; border-top: 1px solid #C9C7C1; font-size: 10px; color: #3B3E46; text-align: center; }

/* A stack of tags on screen: each one its own sheet, with air between them. */
.dl-tag + .dl-tag { margin-top: 26px; }

@media print {
  @page { size: letter portrait; margin: 0.35in; }
  /* One car a page, whatever the pile. The last one takes no break of its own, or every
     batch prints a blank sheet at the end. */
  .dl-tag { break-after: page; page-break-after: always; }
  .dl-tag:last-of-type { break-after: auto; page-break-after: auto; }
  header.top, .menu, .dl-noprint, .toast, .toasts { display: none !important; }
  body, main, #view { background: #fff !important; padding: 0 !important; margin: 0 !important; }
  .dl-tag { width: auto; margin: 0; padding: 0; border: 0; border-radius: 0; }
  .dl-tag-pnum { font-size: 50px; }
}

/* The second line in a table cell (a car's color, body and drive) sits under the name. */
.dl-table td > .sub { display: block; margin-top: 1px; }

/* ------------------------------------------------------------------ boxes that filter

   The numbers along the top of the leads screen are the filters. A box that is doing the
   filtering is ink on paper rather than paper on paper: no coloured border, no pill, just
   the panel turned over, which is the one thing on these screens that already means "this
   one is the live one". */
.dl-boxlink { display: block; text-decoration: none; color: inherit; }
.dl-boxlink .dl-tile { height: 100%; }
.dl-boxlink:hover .dl-tile { border-color: var(--rule-2); }
.dl-boxlink:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.dl-boxlink.on .dl-tile { background: var(--ink); border-color: var(--ink); }
.dl-boxlink.on .dl-tile-l, .dl-boxlink.on .dl-tile-s { color: #cfcdc7; }
.dl-boxlink.on .dl-tile-n { color: var(--panel); }
/* The source row runs to more boxes than the summary row, so they are smaller. */
.dl-tiles-tight { grid-template-columns: repeat(auto-fit, minmax(146px, 1fr)); gap: 10px; }
.dl-tiles-tight .dl-tile { padding: 10px 12px; }
.dl-tiles-tight .dl-tile-n { font-size: 22px; margin: 4px 0 2px; }

/* A heading over a row of boxes or a table, smaller than a panel's own. */
.dl-rowtitle { margin: 4px 0 10px; font-size: 13px; letter-spacing: 0.02em; color: var(--ink-2); }

/* The from-and-to row that sits over a report. */
.dl-daterow { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 18px; }
.dl-daterow label { margin: 0; }

/* ------------------------------------------------------------------ looking as somebody else

   An owner checking what his floor can see. The bar says so plainly across the top of every
   screen, because the one thing worse than not having the preview is forgetting you are in
   it and telling somebody a screen is broken. */
.dl-asbar {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  padding: 9px 16px;
  background: var(--ink);
  color: var(--panel);
  font-size: 13px;
}
.dl-asbar strong { font-weight: 700; }
.dl-asbar select { padding: 4px 8px; font-size: 13px; }
.dl-asbar button {
  padding: 5px 12px;
  border: 1px solid var(--panel);
  background: transparent;
  color: var(--panel);
  font: 600 12.5px/1.2 system-ui, -apple-system, sans-serif;
  cursor: pointer;
}
.dl-asbar button:hover { background: var(--panel); color: var(--ink); }

/* ---------------------------------------------------------------- Market Watch

   The band bar is an SVG because the content policy refuses an inline style, and a bar whose
   position is a number cannot be a fixed class. Geometry on an SVG element is an attribute,
   so it draws without one. */
.dl-band { margin: 4px 0 14px; }
.dl-band-svg { display: block; width: 100%; height: 22px; }
.dl-band-track { fill: var(--panel-2); }
.dl-band-mid { fill: var(--rule-2); }
.dl-band-us { fill: var(--ink); }
.dl-band-ends { display: flex; justify-content: space-between; gap: 12px; margin-top: 2px; font-size: 13px; }
.dl-band-ends > span { display: flex; flex-direction: column; }
.dl-band-ends .mid { align-items: center; text-align: center; }
.dl-band-ends .right { align-items: flex-end; text-align: right; }
.dl-band-ends .sub { font-size: 12px; }

/* The one sentence a person is meant to read before the paragraph under it. */
.dl-lead { font-size: 16px; font-weight: 600; margin: 2px 0 8px; }

/* A panel that is telling you something rather than showing you something. */
.dl-quiet { background: var(--panel-2); }
.dl-quiet p { margin: 0; }

.dl-runline { margin-top: 14px; }

/* ---------------------------------------------------------------- the support desk

   A conversation, not a table. Ours is indented and theirs is not, which is enough to tell
   them apart without a color or a bubble. */
.dl-thread { list-style: none; margin: 0; padding: 0; }
.dl-thread li { padding: 12px 0; border-top: 1px solid var(--rule); }
.dl-thread li:first-child { border-top: 0; }
.dl-thread li.us { padding-left: 24px; }
.dl-thread .who { font-weight: 600; font-size: 13px; display: flex; gap: 8px; align-items: baseline; }
.dl-thread .who .sub { font-weight: 400; }
.dl-thread .what { margin-top: 4px; white-space: pre-wrap; max-width: 80ch; }

/* A tick where a stage has cars in it, and a space the same width where it has none, so the
   stage names stay in a straight line. Ink, never a color: the tick is the information. */
.dl-tick { display: inline-block; width: 14px; flex: none; color: var(--ink); font-size: 13px; line-height: 1; }
.dl-tick:not(.on) { color: transparent; }
.dl-board-name { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }

/* ------------------------------------------------------------------------ Who did what */

/* Back and Older under the log. Plain links in a row, because a page of them is a page of
   them: nothing here is worth a numbered pager. */
.dl-paging { display: flex; gap: 16px; margin: 12px 0 0; font-size: 12.5px; }

/* The short version on somebody's record. A list rather than a table: five columns of
   nothing is what a table looks like when there are twelve rows in it. */
.dl-didlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.dl-didlist li { display: grid; grid-template-columns: 94px 1fr; gap: 10px; align-items: baseline; font-size: 12.5px; }
.dl-didlist .dl-did-when { color: var(--muted); font-size: 11.5px; }
.dl-didlist .dl-did-to { color: var(--muted); }

/*
 * SMART PLANS. A plan is read down the page as a sentence and edited as a list, so the only
 * layout it needs is a row of buttons, a stack of labelled boxes, and a small label for the
 * settings that sit inside a table cell. Flat and square like everything else: no coloured
 * borders, no rounded pill, and a status is the shared square-and-word or a tick.
 */
.dl-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 10px 0 0; }
.dl-row > p { margin: 0; }
.dl-form { display: grid; gap: 12px 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-bottom: 4px; }
.dl-form > label { display: grid; gap: 5px; min-width: 0; align-content: start;
  font: 600 12.5px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--muted); }
.dl-form > label > input, .dl-form > label > select, .dl-form > label > textarea {
  font: 400 13.5px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); width: 100%; }
.dl-right { text-align: right; white-space: nowrap; }

/* A step's own settings, inside the cell. Narrower than a form field because several of
   them share one table row and the row should still read as one step. */
.dl-table label.dl-sub { display: grid; gap: 3px; margin: 0 0 6px;
  font: 600 11px/1.3 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--muted); }
.dl-table label.dl-sub > input, .dl-table label.dl-sub > select, .dl-table label.dl-sub > textarea {
  font: 400 12.5px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink);
  width: 100%; max-width: 320px; }
.dl-table label.dl-sub:last-child { margin-bottom: 0; }

/* The file input every camera and upload button hides behind. It has to be in the page to be
   clickable, so it is taken out of the layout rather than display:none, which some browsers
   treat as not clickable. */
.dl-hidden-file { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* An invoice's lines, read in and waiting to be checked. Narrow boxes on the money columns
   so eight lines fit on a screen without scrolling sideways. */
.dl-billtable input { width: 100%; }
.dl-billtable th:nth-child(1), .dl-billtable td:nth-child(1) { width: 3rem; text-align: center; }
.dl-billtable th:nth-child(3), .dl-billtable td:nth-child(3) { width: 8rem; }
.dl-billtable th:nth-child(4), .dl-billtable td:nth-child(4),
.dl-billtable th:nth-child(5), .dl-billtable td:nth-child(5),
.dl-billtable th:nth-child(6), .dl-billtable td:nth-child(6),
.dl-billtable th:nth-child(7), .dl-billtable td:nth-child(7) { width: 6rem; }

/*
 * THE GAP A CARRIED CAR LEAVES ON THE BOARD.
 *
 * An empty box exactly the size of the card in hand. It exists so the column keeps its shape
 * while a car is being moved: the card itself comes out of the flow the moment it is lifted,
 * and without something standing in its place every column would close up and reopen as the
 * hand crossed it, which is what the board used to do.
 */
.dl-slot {
  border: 1px dashed var(--line);
  background: var(--panel-2);
  margin: 0 0 8px;
}

/* ------------------------------------------------------------------ the service sheet

   The schedule on headed paper, handed to a buyer at delivery. It is a printed document
   that happens to be shown on a screen first, so it is sized in inches and laid out for a
   letter page rather than for a browser window. */
.dl-sheet {
  background: #fff;
  border: 1px solid var(--line);
  padding: 34px 38px;
  max-width: 8.5in;
  margin: 0 auto;
}
.dl-sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 14px;
}
.dl-sheet-logo { max-height: 42px; max-width: 230px; display: block; }
.dl-sheet-name { font-size: 20px; font-weight: 700; }
.dl-sheet-where { margin: 6px 0 0; font-size: 12px; color: var(--ink-2); }
.dl-sheet-when { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.dl-sheet-title { font-size: 23px; margin: 22px 0 10px; }
.dl-sheet-car { margin: 0 0 16px; font-size: 15px; line-height: 1.5; }
.dl-sheet-say { font-size: 13px; color: var(--ink-2); margin: 0 0 18px; max-width: 6.2in; }
.dl-sheet-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dl-sheet-table th {
  text-align: left;
  border-bottom: 1px solid var(--ink);
  padding: 7px 10px 7px 0;
  font-size: 12px;
}
.dl-sheet-table td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.dl-sheet-table td .sub { display: block; font-size: 12px; color: var(--ink-2); margin-top: 1px; }
/* Somewhere to write the date it was actually done, because this sheet lives in a glovebox. */
.dl-sheet-blank { width: 1.3in; border-bottom: 1px solid var(--line); }
.dl-sheet-foot { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 12px; }
.dl-sheet-foot p { margin: 0 0 5px; font-size: 12px; color: var(--ink-2); }
.dl-sheet-small { font-size: 11px; }

@media print {
  /* The sheet is the page. Everything the browser would otherwise put round it is furniture. */
  .dl-sheet { border: 0; padding: 0; max-width: none; }
  .dl-sheet-table { font-size: 11.5px; }
  .dl-sheet-blank { border-bottom: 1px solid #999; }
}

/* A row of buttons under a panel, or over a printable sheet. */
.dl-row-btns { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.dl-row-btns-top { margin: 0 0 16px; }

/* ------------------------------------------------------------------ a car, anywhere

   The photograph, the name, and a way through to the record. Used in every list where a
   car appears, so a car looks the same whether it is on the lot, on a customer's account
   or saved in their app. */
.dl-chip { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
a.dl-chip:hover .dl-chip-name { text-decoration: underline; }
.dl-chip-shot {
  flex: none;
  width: 58px;
  height: 44px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.dl-chip-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dl-chip-words { display: flex; flex-direction: column; min-width: 0; }
.dl-chip-name { font-weight: 600; }
.dl-chip-words .sub { margin-top: 1px; }

/* ------------------------------------------------------------------ the asking price

   Its own box above the costing panel, because the price a lot is asking is not the
   slider's last position and is not something only the people who can see the money are
   allowed to set. Plain label, a number, a reason, a button. */
.dl-askbox { padding: 0; }
.dl-askbox-in { padding: 16px 18px; }
.dl-askbox-in label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}
.dl-askbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dl-askbox-dollar {
  font-size: 19px;
  color: var(--ink-soft, #6b675e);
}
.dl-askbox-row input[type="number"] {
  width: 140px;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}
.dl-askbox-row input[type="text"] {
  flex: 1 1 220px;
  min-width: 180px;
}
.dl-askbox-in .sub { margin: 8px 0 0; }
@media (max-width: 560px) {
  .dl-askbox-row input[type="text"] { flex-basis: 100%; }
}

/* The Change and Remove buttons on a cost line. Right of the amount, close together, and
   they do not stretch the row: a cost sheet is read down the amount column, and two buttons
   per line should not be the widest thing on it. */
.dl-rowacts { white-space: nowrap; }
.dl-rowacts .btn + .btn { margin-left: 6px; }

/* A customer's details read as labelled facts across the width rather than one tall pair of
   columns. Wrapping each label and value in a div makes the PAIR the grid cell, so four or
   five sit on a line on a desk machine and one per line on a telephone. */
.dl-facts:has(> div) { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 24px; }
.dl-facts > div { display: block; }

/* The words on a Facebook post, in the queue table. Wide enough to read the whole post
   without opening it, and the line breaks the author typed are the line breaks shown. */
.dl-fbwords { white-space: pre-wrap; max-width: 420px; font-size: 13px; }
