/* Tyrefox back office. From mockups/style.css + mockups/admin/admin.css + the Sales and New sale pages' own styles.
   Rubber & lime: bg #1b1d1a · accent #a6d13a · shadow #4c7a12. No inline styles anywhere (CSP style-src 'self'). */
:root {
  --bg: #1b1d1a; --accent: #a6d13a; --tint-rgb: 76, 122, 18;
  --ink: #ecebe6; --muted: #a3a49e; --on-accent: #1b1c1f; --warn: #f0a07a; --blue: #a9c3f2;
  --glass: rgba(40, 42, 46, .45); --glass-edge: rgba(255, 255, 255, .09);
  --line: rgba(236, 235, 230, .12); --field: rgba(20, 21, 24, .7);
  --shadow: 0 1px 0 var(--glass-edge) inset, 0 3px 8px -2px rgba(var(--tint-rgb), .22), 0 24px 48px -18px rgba(var(--tint-rgb), .6);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; background: var(--bg); color: var(--ink); font: 17px/1.5 'Barlow', system-ui, sans-serif; overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, .mark, .cond { font-family: 'Barlow Semi Condensed', sans-serif; font-weight: 700; letter-spacing: -.5px; }
h1, h2, h3 { margin: 0; line-height: 1.02; }
p { margin: 0; }
a { color: var(--ink); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.lime { color: var(--accent); }
.warn { color: var(--warn); }
.small { font-size: 14px; }
.block { display: block; }
input, select, textarea { font-size: max(16px, 1em); } /* iOS zooms into any field under 16px when tapped */
button { touch-action: manipulation; }
#openMsg { padding: 24px 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px;
  border: 0; border-radius: 10px; background: var(--accent); color: var(--on-accent); font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none; box-shadow: 0 8px 20px -10px rgba(var(--tint-rgb), .8);
}
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.glass {
  background: var(--glass); border: 1px solid var(--glass-edge); border-radius: 18px;
  backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); box-shadow: var(--shadow);
}
.field { flex: 1 1 110px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 14px; font-weight: 600; }
.field select, .field > input { height: 48px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font: inherit; background-color: var(--field); color: var(--ink); width: 100%; min-width: 0; }
input::placeholder { color: var(--muted); }
input[type="date"] { color-scheme: dark; }
select { -webkit-appearance: none; appearance: none; color-scheme: dark; padding-right: 36px !important;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: right 18px center, right 12px center; background-size: 6px 6px; background-repeat: no-repeat; }
select option { background: #232622; color: var(--ink); }
.tag { display: inline-block; margin-left: 8px; font-size: 13px; font-weight: 600; padding: 1px 9px; border-radius: 999px; border: 1px solid rgba(166, 209, 58, .5); color: var(--accent); }
.form-err { color: var(--warn); font-weight: 600; font-size: 15px; }
.toasts { position: fixed; left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 20; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { max-width: 480px; padding: 12px 18px; border-radius: 12px; background: #2a2d28; border: 1px solid var(--line); box-shadow: 0 12px 30px -10px #000; }
.toast.error { border-color: rgba(224, 112, 58, .7); color: var(--warn); }

/* Login and plain pages */
.solo { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px; }
.login { width: min(100%, 380px); padding: 28px 22px; display: flex; flex-direction: column; gap: 16px; }
.login .mark { font-size: 30px; }
.login h1 { font-size: 40px; }
.login .btn { width: 100%; }

/* Frame: left rail + work area */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; padding: 18px 14px; display: flex; flex-direction: column; gap: 18px; border-right: 1px solid var(--line); background: rgba(0, 0, 0, .18); }
.mark { color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 12px; }
.rail .mark { font-size: 26px; padding: 0 8px; }
.fox { width: 38px; height: 38px; flex: none; }
.fox-tyre { fill: #232622; stroke: var(--ink); stroke-width: 9; }
.fox-tread { fill: none; stroke: #8d918a; stroke-width: 9; stroke-dasharray: 3 6; }
.fox-face { fill: var(--accent); }
.fox-ink { fill: var(--ink); }
.fox-bg { fill: var(--bg); }
.rail .sub { padding: 0 10px; margin-top: -10px; font-size: 13px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); }
.rail nav { display: flex; flex-direction: column; gap: 4px; }
.rail nav a, .nav-out { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 12px; border-radius: 10px; text-decoration: none; font-weight: 500; color: var(--muted); }
.rail nav a svg { width: 20px; height: 20px; flex: none; }
.rail nav a:hover { color: var(--ink); background: rgba(255, 255, 255, .04); }
.rail nav a[aria-current="page"] { color: var(--on-accent); background: var(--accent); font-weight: 600; }
.nav-out { display: none; border: 1px solid var(--line); background: none; font: inherit; cursor: pointer; white-space: nowrap; }
.rail .who { margin-top: auto; padding: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
.linkish { align-self: flex-start; padding: 6px 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; }
.work { padding: 20px 28px 64px; min-width: 0; container: work / inline-size; }
.work-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.work-head h1 { font-size: clamp(34px, 4vw, 46px); }
.head-acts { display: flex; flex-wrap: wrap; gap: 10px; }
.crumbs { display: flex; gap: 8px; font-size: 15px; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
.card { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail { position: sticky; top: 0; z-index: 5; height: auto; flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top));
    border-right: 0; border-bottom: 1px solid var(--line); background: rgba(20, 21, 19, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
  .rail { flex-wrap: wrap; row-gap: 8px; padding-bottom: 8px; }
  .rail .mark { padding: 0; font-size: 22px; gap: 8px; }
  .rail .mark .fox { width: 32px; height: 32px; }
  .rail .sub, .rail .who { display: none; }
  .nav-out { display: flex; margin-left: auto; min-height: 40px; font-size: 15px; }
  /* All five sections always in view: one row, icon over a short label */
  .rail nav { order: 3; flex: 1 1 100%; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .rail nav a { flex-direction: column; justify-content: center; gap: 3px; min-height: 54px; padding: 6px 2px; font-size: 12.5px; line-height: 1.1; text-align: center; }
  .rail nav a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .work { padding: 16px 16px 48px; }
}

/* Segmented buttons */
.seg, .seg2 { display: inline-flex; flex-wrap: wrap; padding: 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--field); }
.seg button, .seg2 button { min-height: 40px; padding: 0 16px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.seg2 { padding: 3px; border-radius: 10px; }
.seg2 button { min-height: 38px; padding: 0 12px; }
.seg button[aria-pressed="true"], .seg2 button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }

/* Sales list */
.period { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.pick { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.pick label { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.pick input { height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; font: inherit; background: var(--field); color: var(--ink); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { padding: 18px; display: flex; flex-direction: column; gap: 4px; }
.kpi b { font: 700 36px/1 'Barlow Semi Condensed', sans-serif; }
.kpi.warn b { color: var(--warn); }
.kpi .muted { font-size: 15px; }
.list { padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.list-head { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 6px 10px; }
.list-head input, .list-head select { height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font: inherit; background-color: var(--field); color: var(--ink); }
.list-head input { flex: 1 1 200px; min-width: 0; }
.list-msg { padding: 0 8px; }
.list-msg:empty { display: none; }
.list-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 4px; }
.o { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 12px; text-decoration: none; border: 1px solid transparent; min-width: 0; }
.o:hover { background: rgba(255, 255, 255, .03); border-color: var(--line); }
.o-top, .o-foot { display: flex; align-items: center; gap: 8px; min-width: 0; }
.o-top .when { margin-left: auto; }
.o-who { font-weight: 600; font-size: 17px; overflow-wrap: anywhere; }
.o-what { font-size: 14px; overflow-wrap: anywhere; }
.o-foot { margin-top: 2px; flex-wrap: wrap; }
.o-foot .tot { margin-left: auto; font-size: 22px; }
.ch, .pay { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.ch-dropoff { background: rgba(166, 209, 58, .16); color: var(--accent); }
.ch-yard { background: rgba(120, 160, 230, .16); color: var(--blue); }
.ch-phone { background: rgba(236, 235, 230, .1); color: var(--ink); }
.p-ok { color: var(--accent); border: 1px solid rgba(166, 209, 58, .4); }
.p-credit { color: var(--blue); border: 1px solid rgba(120, 160, 230, .4); }
.p-due { color: var(--warn); border: 1px solid rgba(224, 112, 58, .5); }

/* Sale detail */
.detail { padding: 24px; display: flex; flex-direction: column; gap: 20px; max-width: 920px; }
.d-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.d-head h2 { font-size: 34px; }
.d-head .chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.info { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.box { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--field); display: flex; flex-direction: column; gap: 2px; font-size: 15px; overflow-wrap: anywhere; }
.box h3 { font: 600 12px 'Barlow', sans-serif; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 4px; }
.box a { color: var(--accent); }
.items { width: 100%; border-collapse: collapse; font-size: 15px; }
.items th, .items td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.items th { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 600; }
.items td.sz { font: 700 18px 'Barlow Semi Condensed', sans-serif; }
.items .r, .items th.r { text-align: right; white-space: nowrap; }
.items tfoot td { border-bottom: 0; font-weight: 600; padding-top: 6px; padding-bottom: 6px; }
.items tfoot .big { font: 700 28px 'Barlow Semi Condensed', sans-serif; }
.items tfoot .lime { color: var(--accent); }
.items tfoot .warn { color: var(--warn); }
.d-acts { display: flex; flex-wrap: wrap; gap: 10px; }
.d-acts .btn { min-height: 52px; flex: 1 1 150px; }
.d-acts .btn[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.note { font-size: 14px; color: var(--muted); }
.dues { font-weight: 600; }
.edit { padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0, 0, 0, .2); display: flex; flex-direction: column; gap: 12px; }
.edit h3 { font-size: 20px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.edit h3 .muted { font: 400 14px 'Barlow', sans-serif; }
.ret { display: flex; flex-direction: column; gap: 8px; }
.ret-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.ret-row > .cond { font-size: 20px; min-width: 110px; }
.stp2 { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; background: var(--field); overflow: hidden; }
.stp2 button { width: 44px; height: 44px; border: 0; background: rgba(255, 255, 255, .03); color: var(--ink); font-size: 20px; cursor: pointer; }
.stp2 input { width: 54px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); background: transparent; color: var(--ink); text-align: center; font: 700 20px 'Barlow Semi Condensed', sans-serif; }
.edit-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.adj { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.adj > input { flex: 1 1 180px; min-width: 0; height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font: inherit; background: var(--field); color: var(--ink); }
.changes { list-style: none; margin: 0; padding: 0; }
.changes li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.changes li:last-child { border-bottom: 0; }
.changes li.undone > span:first-child { color: var(--muted); text-decoration: line-through; }
.changes li.undone .tag { text-decoration: none; color: var(--muted); border-color: var(--line); }

/* New sale */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.form { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card h2 { font-size: 24px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card h2 .n { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--accent); color: var(--accent); font-size: 15px; display: inline-flex; align-items: center; justify-content: center; }
.card h2 small { font: 400 15px 'Barlow', sans-serif; color: var(--muted); }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.opts label { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--field); cursor: pointer; }
.opts label:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.opts label > span:first-of-type { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.opts input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.shopinfo { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 12px 14px; border-radius: 12px; background: rgba(0, 0, 0, .25); font-size: 15px; }
.shopinfo b { color: var(--accent); }
.tyres { width: 100%; border-collapse: collapse; }
.tyres th, .tyres td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tyres th { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 600; }
.tyres td.rim { font: 700 24px 'Barlow Semi Condensed', sans-serif; width: 120px; }
.tyres .r { text-align: right; white-space: nowrap; }
.tyres tbody tr:last-child td { border-bottom: 0; }
.stp { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--field); overflow: hidden; }
.stp button { width: 48px; height: 48px; border: 0; background: rgba(255, 255, 255, .03); color: var(--ink); font-size: 20px; cursor: pointer; }
.stp input { width: 60px; height: 48px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); background: transparent; color: var(--ink); text-align: center; font: 700 22px 'Barlow Semi Condensed', sans-serif; }
.pin { display: inline-flex; align-items: center; gap: 4px; height: 44px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--field); }
.pin input { width: 80px; min-width: 0; border: 0; background: transparent; color: var(--ink); font: 600 17px 'Barlow', sans-serif; }
.field .pin { height: 48px; }
.field .pin input { width: 100%; }
details summary { cursor: pointer; font-weight: 600; min-height: 32px; }
details .more { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.fullsize { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.fullsize .field { flex: 1 1 160px; }
.fullsize .field.narrow { flex: 0 1 100px; }
.lines { list-style: none; margin: 0; padding: 0; }
.lines li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.lines li b.cond { font-size: 20px; }
.x { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: none; color: var(--muted); font-size: 20px; cursor: pointer; }
.charge { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.partbox { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 14px; border-radius: 12px; border: 1px dashed var(--line); }
.partbox .field { flex: 1 1 140px; }
.summary { padding: 22px; display: flex; flex-direction: column; gap: 10px; position: sticky; top: 16px; }
.summary h2 { font-size: 26px; }
.sum-row { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.sum-row span:first-child { color: var(--muted); }
.sum-row.total { padding-top: 12px; border-top: 1px solid var(--line); font-size: 18px; font-weight: 600; }
.sum-row.total strong { font: 700 36px/1 'Barlow Semi Condensed', sans-serif; }
.sum-row.paid strong, .sum-row.owed strong { font-size: 24px; }
.sum-row.paid strong { color: var(--accent); }
.sum-row.owed strong { color: var(--warn); }
.summary .btn { min-height: 56px; font-size: 18px; }
.summary .inv { font-size: 14px; color: var(--muted); }

@container work (max-width: 980px) { .layout { grid-template-columns: 1fr; } .summary { position: static; } }
@container work (max-width: 620px) {
  .tyres thead { display: none; }
  .tyres, .tyres tbody { display: block; }
  .tyres tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .tyres td { border: 0; padding: 0; }
  .tyres td.rim { grid-column: 1; grid-row: 1; width: auto; }
  .tyres td.r { grid-column: 2; grid-row: 1; font-weight: 600; }
  .tyres td:nth-child(2) { grid-column: 1; grid-row: 2; }
  .tyres td:nth-child(3) { grid-column: 2; grid-row: 2; }
  .lines li { grid-template-columns: minmax(0, 1fr) auto auto; }
  .lines li > b { grid-column: 1 / -1; }
  .lines li > .r { grid-column: 1 / 3; }
  .detail { padding: 18px; }
  .card { padding: 18px; }
  .changes li { grid-template-columns: minmax(0, 1fr) auto; }
  .changes li > span:nth-child(2) { grid-column: 1; grid-row: 2; }
  .changes li > :nth-child(3) { grid-column: 2; grid-row: 1 / span 2; }
  .list-rows { grid-template-columns: minmax(0, 1fr); }
  .d-acts .btn { flex: 1 1 calc(50% - 10px); }
}
@container work (max-width: 330px) {
  .tyres td:nth-child(2), .tyres td:nth-child(3) { grid-column: 1 / -1; }
  .tyres td:nth-child(3) { grid-row: 3; }
  .stp button { width: 44px; }
}

/* Customers, Invoices, Prices, Settings (mockups/admin/customers.html, invoices.html, prices.html) */
.field textarea, .notes { width: 100%; min-height: 80px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; background: var(--field); color: var(--ink); resize: vertical; }
.notes::placeholder { color: var(--muted); }
.field input:disabled { opacity: .6; }
.flabel { font-size: 14px; font-weight: 600; }
.card > .field, .edit > .field, .cust-form > .field { flex: none; } /* in a column, flex-basis would be a height */
.pre { white-space: pre-wrap; }
.btn.danger { background: #c4562e; color: #fff; box-shadow: none; }
.o-foot .tot.warn { color: var(--warn); }
.o-foot .tot.lime { color: var(--accent); }
.cust-form { display: flex; flex-direction: column; gap: 12px; }
.cust-form .seg2 { align-self: flex-start; }
.orders { list-style: none; margin: 0; padding: 0; font-size: 15px; }
.orders li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.orders li:last-child { border-bottom: 0; }
.orders a, .edit a { color: var(--accent); }
.filter-note { margin: -6px 0 16px; }

.inv-page { display: flex; flex-direction: column; gap: 16px; max-width: 920px; }
.d-bar { padding: 14px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.d-bar .who { margin-right: auto; display: flex; flex-direction: column; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.d-bar .who b { font-size: 20px; }
.d-bar .who a { color: var(--accent); }
.d-bar .btn { min-height: 44px; padding: 0 16px; font-size: 15px; }
.payform { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.payform h3 { font-size: 22px; }
details.edit summary { font-family: 'Barlow Semi Condensed', sans-serif; font-size: 20px; }

/* The invoice as paper: fixed light colours, laid out like the PDF */
.paper { background: #fbfaf7; color: #1b1c1f; border-radius: 6px; padding: 36px 40px; box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .8), 0 0 0 1px rgba(0, 0, 0, .2); font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.paper a { color: #1b1c1f; }
.p-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 3px solid #5e7d10; }
.p-from { color: #555; }
.p-name { display: block; color: #1b1c1f; font: 700 24px 'Barlow Semi Condensed', sans-serif; }
.p-no { text-align: right; color: #555; }
.p-title { display: block; color: #1b1c1f; font: 700 28px/1.1 'Barlow Semi Condensed', sans-serif; }
.p-bill { padding: 18px 0 12px; color: #555; }
.p-bill b { color: #1b1c1f; font-size: 16px; }
.p-bill h4, .p-lines th { margin: 0 0 4px; font: 600 11px 'Barlow', sans-serif; text-transform: uppercase; letter-spacing: 1px; color: #777; }
.p-amended { text-transform: none; letter-spacing: 0; }
.p-scroll { overflow-x: auto; }
.p-lines { width: 100%; border-collapse: collapse; margin-top: 6px; }
.p-lines th { text-align: left; padding: 8px 6px; background: #efede6; }
.p-lines td { padding: 7px 6px; border-bottom: 1px solid #e4e2dc; }
.p-lines .r { text-align: right; white-space: nowrap; }
.p-lines .p-head td { font-weight: 700; padding-top: 12px; border-bottom: 0; }
.p-lines .p-head a { text-decoration: underline; text-decoration-color: #aab08f; }
.p-lines .p-item td:first-child { padding-left: 20px; }
.p-lines .p-sub td { color: #555; font-size: 13px; border-bottom-color: #ccc; }
.p-lines .p-sub td:last-child { color: #1b1c1f; font-weight: 700; font-size: 14px; }
.p-lines .p-minus, .p-lines .p-item td.p-minus { color: #777; }
.p-tot { margin-left: auto; width: min(340px, 100%); margin-top: 14px; display: flex; flex-direction: column; gap: 5px; }
.p-tot > div { display: flex; justify-content: space-between; gap: 12px; }
.p-tot .paid { color: #3f6a0f; }
.p-tot .big { margin: 8px 0 4px; padding: 7px 12px; border-radius: 3px; background: #5e7d10; color: #fff; font: 700 18px 'Barlow Semi Condensed', sans-serif; }
.p-tot .vat { color: #666; font-size: 13px; }
.p-tot .p-paid { color: #3f6a0f; font-weight: 700; }
.p-tot .p-credit { color: #b23a1a; font-size: 13px; }
.p-tot .p-bank, .p-tot .p-coll { display: block; color: #666; font-size: 13px; }
.p-tot .p-bank b { color: #1b1c1f; font-size: 14px; }
.p-foot { margin-top: 22px; padding-top: 10px; border-top: 1px solid #ccc; color: #777; font-size: 12px; }

/* Prices */
.how { padding: 14px 18px; margin-bottom: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; font-size: 15px; }
.how .step { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--field); }
.how .step b { color: var(--accent); }
.how .arrow { color: var(--muted); }
.how a { color: var(--accent); }
.work > .card + .card { margin-top: 16px; }
.rims { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.rim { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--field); }
.rim .cond { font-size: 22px; }
.rim .pin input { width: 100%; }
.pin.changed { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.size-search { height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font: inherit; background: var(--field); color: var(--ink); max-width: 320px; width: 100%; }
.size-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 4px 18px; }
.size-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.size-row b.cond { font-size: 19px; }
.size-row .pin input { width: 72px; }

/* Settings */
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 16px; align-items: start; max-width: 1000px; }
.set-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.set-line:last-of-type { border-bottom: 0; }
.set-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; }
.set-foot .btn { min-height: 52px; }
.mini { display: inline-flex; align-items: center; gap: 4px; height: 44px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--field); flex: none; }
.mini input { width: 60px; border: 0; background: transparent; color: var(--ink); font: 600 17px 'Barlow', sans-serif; text-align: right; }
.sw { appearance: none; -webkit-appearance: none; flex: none; width: 52px; height: 32px; border-radius: 999px; background: rgba(255, 255, 255, .14); position: relative; cursor: pointer; margin: 0; }
.sw::after { content: ''; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .15s; }
.sw:checked { background: var(--accent); }
.sw:checked::after { transform: translateX(20px); }
@container work (max-width: 620px) {
  .paper { padding: 22px 14px; }
  .p-no { text-align: left; }
  .d-bar .who { flex-basis: 100%; }
  .d-bar .btn { flex: 1 1 calc(50% - 10px); }
  .orders li { grid-template-columns: minmax(0, 1fr) auto; }
  .orders li > span:nth-child(2) { grid-column: 1; grid-row: 2; }
  .orders li > b { grid-column: 2; grid-row: 1 / span 2; }
}
