/* DefendEye Quotes - staff screens.
   Light theme, tables first, one accent colour. Numbers are set in a
   monospace face so columns of money line up. */
@font-face { font-family: "Hanken Grotesk"; font-weight: 400; font-display: swap; src: url("../fonts/hanken-grotesk-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 500; font-display: swap; src: url("../fonts/hanken-grotesk-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 600; font-display: swap; src: url("../fonts/hanken-grotesk-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 700; font-display: swap; src: url("../fonts/hanken-grotesk-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  --paper: #ffffff;
  --canvas: #f5f6f8;
  --ink: #14181f;
  --ink-2: #3c4553;
  --muted: #667085;
  --line: #e3e6eb;
  --line-2: #cfd4dc;
  --accent: #2f6feb;
  --accent-ink: #1b4fc0;
  --accent-soft: #eaf1ff;
  --ok: #1e8e5a;
  --ok-soft: #e4f4ec;
  --warn: #9a5b00;
  --warn-soft: #fff1d6;
  --bad: #c2362b;
  --bad-soft: #fdecea;
  --idle: #5b6472;
  --idle-soft: #eceef2;
  --radius: 6px;
  --font: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--canvas); -webkit-text-size-adjust: 100%; }
body { margin: 0; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 600; }
h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.07rem; }
h3 { font-size: 0.95rem; }
p { margin: 0 0 0.75rem; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
.num, .mono { font-family: var(--mono); font-size: 0.92em; font-variant-numeric: tabular-nums; }
.num { text-align: right; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 0.87rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hide { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* ---- frame ---------------------------------------------------------- */
.shell { display: grid; grid-template-columns: 214px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--paper); border-right: 1px solid var(--line); padding: 18px 12px 14px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { font-weight: 700; font-size: 1.12rem; color: var(--ink); padding: 2px 10px 14px; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand span { font-weight: 500; color: var(--muted); }
.side a.nav { display: block; padding: 7px 10px; border-radius: var(--radius); color: var(--ink-2); font-weight: 500; }
.side a.nav:hover { background: var(--canvas); text-decoration: none; }
.side a.nav.on { background: var(--accent-soft); color: var(--accent-ink); }
.side .group { margin: 14px 10px 4px; font-size: 0.8rem; color: var(--muted); }
.side a.nav .count { display: inline-block; min-width: 20px; margin-left: 4px; padding: 1px 6px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: 0.8rem; font-weight: 700; text-align: center; }
.side .new { margin: 0 0 12px; }
.side-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); font-size: 0.87rem; }
.side-foot .who { font-weight: 600; overflow-wrap: anywhere; }
.side-foot form { margin-top: 6px; }
.main { padding: 26px 34px 60px; min-width: 0; }
.wrap { max-width: 1180px; }
.wrap.narrow { max-width: 780px; }

.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.head .sub { color: var(--muted); margin-top: 3px; }
.head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumb { font-size: 0.87rem; color: var(--muted); margin-bottom: 4px; }

/* ---- buttons and fields --------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; font-size: 0.93rem; line-height: 1.2; padding: 8px 14px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--paper); color: var(--ink); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--canvas); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--accent-ink); padding-left: 6px; padding-right: 6px; }
.btn.quiet:hover { background: var(--accent-soft); }
.btn.sm { padding: 5px 10px; font-size: 0.86rem; }
.btn.block { display: flex; width: 100%; }
button.linklike { font: inherit; background: none; border: 0; padding: 0; color: var(--accent-ink); cursor: pointer; }
button.linklike:hover { text-decoration: underline; }

label { display: block; font-size: 0.87rem; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
label.check { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; font-size: 0.95rem; color: var(--ink); margin: 0; cursor: pointer; }
label.check input { margin-top: 4px; flex: none; }
input[type=text], input[type=email], input[type=date], input[type=number], input[type=search], input[type=file], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 7px 10px; line-height: 1.35; }
textarea { resize: vertical; min-height: 64px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
input.num { text-align: right; }
.hint { font-size: 0.84rem; color: var(--muted); margin-top: 4px; }
.field { margin-bottom: 14px; }
.grid { display: grid; gap: 14px 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.span3 { grid-column: span 3; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline > * { flex: none; }
.inline > .grow { flex: 1 1 160px; min-width: 0; }

/* ---- surfaces ------------------------------------------------------- */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px; margin-bottom: 18px; }
.panel > h2 { margin-bottom: 12px; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush > h2 { padding: 14px 18px 0; }
.panel .lead { color: var(--muted); margin: -6px 0 14px; font-size: 0.92rem; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.cols.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.flash { border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; border: 1px solid; font-weight: 500; }
.flash.ok { background: var(--ok-soft); border-color: #b9e0cb; color: #14603c; }
.flash.error { background: var(--bad-soft); border-color: #f3c3bd; color: #8f2219; }
.flash.info { background: var(--accent-soft); border-color: #c6d8fb; color: #1b4fc0; }
.notice { background: var(--warn-soft); border: 1px solid #f0d49a; color: #6b4000; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; }

/* ---- tables --------------------------------------------------------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 0.82rem; font-weight: 600; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; background: var(--paper); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th.num, .tbl td.num { text-align: right; }
.tbl th.num, .items th.num { font-family: var(--font); font-size: 0.82rem; }
.tbl tbody tr:hover td { background: #fafbfc; }
.tbl .main-cell { font-weight: 600; }
.tbl a.row-link { color: var(--ink); font-weight: 600; }
.tbl tfoot td { font-weight: 600; border-top: 1px solid var(--line-2); border-bottom: 0; }
.tbl-scroll { overflow-x: auto; }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty .btn { margin-top: 10px; }

/* ---- badges --------------------------------------------------------- */
.badge { display: inline-block; font-size: 0.8rem; font-weight: 600; line-height: 1; padding: 4px 8px; border-radius: 999px; background: var(--idle-soft); color: var(--idle); white-space: nowrap; }
.badge.sent { background: var(--accent-soft); color: var(--accent-ink); }
.badge.opened { background: #e6edff; color: #2a3fa8; }
.badge.approved, .badge.po, .badge.ach, .badge.check, .badge.processing, .badge.invoiced, .badge.unpaid, .badge.wait { background: var(--warn-soft); color: var(--warn); }
.badge.paid, .badge.ship { background: var(--ok-soft); color: var(--ok); }
.badge.declined, .badge.payment_failed, .badge.overdue { background: var(--bad-soft); color: var(--bad); }
.badge.failed { background: var(--bad-soft); color: var(--bad); }
.badge.review { background: var(--warn-soft); color: var(--warn); }
.badge.held { background: var(--bad-soft); color: var(--bad); }
.badge.ready { background: var(--ok-soft); color: var(--ok); }

/* ---- filter tabs ---------------------------------------------------- */
.tabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs a { padding: 8px 12px; color: var(--ink-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.on { color: var(--accent-ink); border-bottom-color: var(--accent); font-weight: 600; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters input, .filters select { width: auto; }
.filters input[type=search] { width: 260px; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; padding: 12px 0 0; color: var(--muted); font-size: 0.9rem; }

/* ---- numbers across the top of a page ------------------------------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--paper); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 18px; }
.stats > div { padding: 14px 18px; border-left: 1px solid var(--line); }
.stats > div:first-child { border-left: 0; }
.stats .k { font-size: 0.86rem; color: var(--muted); }
.stats .v { font-family: var(--mono); font-size: 1.45rem; font-weight: 500; letter-spacing: -0.02em; margin-top: 2px; }
.stats .d { font-size: 0.86rem; color: var(--ink-2); margin-top: 1px; }

/* ---- the life of a quote, left to right ------------------------------ */
.track { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 4px 0 2px; }
.track.seven { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.track .step { position: relative; padding-top: 22px; text-align: center; font-size: 0.86rem; color: var(--muted); }
.track .step::before { content: ""; position: absolute; top: 6px; left: -50%; width: 100%; height: 2px; background: var(--line-2); }
.track .step:first-child::before { display: none; }
.track .step::after { content: ""; position: absolute; top: 0; left: calc(50% - 7px); width: 14px; height: 14px; border-radius: 50%; background: var(--paper); border: 2px solid var(--line-2); }
.track .step.done { color: var(--ink); }
.track .step.done::before { background: var(--accent); }
.track .step.done::after { background: var(--accent); border-color: var(--accent); }
.track .step.stop::after { background: var(--bad); border-color: var(--bad); }
.track .step .name { font-weight: 600; }
.track .step .when { font-size: 0.8rem; color: var(--muted); }

/* ---- facts list ----------------------------------------------------- */
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 9px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) max-content; gap: 2px 12px; }
.timeline li:last-child { border-bottom: 0; }
.timeline .what { font-weight: 500; }
.timeline .detail { grid-column: 1 / -1; color: var(--ink-2); font-size: 0.88rem; overflow-wrap: anywhere; }
.timeline .when { color: var(--muted); font-size: 0.84rem; white-space: nowrap; }

.pdf-frame { width: 100%; height: 760px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.linkbox { display: flex; gap: 8px; }
.linkbox input { font-family: var(--mono); font-size: 0.82rem; }
.stack > * + * { margin-top: 10px; }
details.more { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 12px; }
details.more summary { cursor: pointer; font-weight: 600; color: var(--accent-ink); }
details.more[open] summary { margin-bottom: 10px; }

/* ---- quote editor --------------------------------------------------- */
.items { width: 100%; border-collapse: collapse; }
.items th { text-align: left; font-size: 0.82rem; font-weight: 600; color: var(--muted); padding: 0 6px 6px; }
.items th.num { text-align: right; }
.items td { padding: 8px 6px; vertical-align: top; border-top: 1px solid var(--line); }
.items td:first-child, .items th:first-child { padding-left: 0; }
.items td:last-child, .items th:last-child { padding-right: 0; }
.items .pick { margin-bottom: 6px; }
.items textarea { min-height: 38px; margin-top: 6px; font-size: 0.9rem; }
.items .c-qty { width: 78px; } .items .c-price { width: 122px; } .items .c-disc { width: 78px; } .items .c-amt { width: 118px; } .items .c-x { width: 34px; }
.items .amt { padding-top: 15px; }
.items .sku { margin-top: 6px; font-family: var(--mono); font-size: 0.84rem; }
/* A long item text is folded to about six lines (quote-editor.js); it scrolls inside its box. */
.items textarea.folded { overflow-y: auto; }

/* The contacts of a customer: a grid with a label on every field, so the email
   field is wide enough to read on a computer and nothing is squeezed on a phone. */
.contact-row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px 14px; align-items: end; padding: 14px 0; border-top: 1px solid var(--line); }
.contact-row:first-child { padding-top: 2px; border-top: 0; }
.contact-row label { margin: 0; font-size: inherit; font-weight: 400; color: var(--ink); }  /* the field inside takes the label's font */
.contact-row label > span { display: block; margin-bottom: 4px; font-size: 0.87rem; font-weight: 600; color: var(--ink-2); }
.contact-row .c-first, .contact-row .c-last { grid-column: span 3; }
.contact-row .c-email { grid-column: span 6; }
.contact-row .c-title, .contact-row .c-phone { grid-column: span 4; }
.contact-row .c-main, .contact-row .c-quotes { grid-column: span 2; align-self: center; align-items: center; padding-top: 18px; }
.contact-row label.check > span { display: inline; margin: 0; font-size: 0.95rem; font-weight: 400; color: var(--ink); }
.contact-row label.check input { margin-top: 0; }
@media (max-width: 720px) {
  .contact-row .c-first, .contact-row .c-last, .contact-row .c-title, .contact-row .c-phone { grid-column: span 6; }
  .contact-row .c-email { grid-column: span 12; }
  .contact-row .c-main, .contact-row .c-quotes { grid-column: span 6; padding-top: 4px; min-height: 36px; }
}
/* the role menu on the Users page must show the whole word */
select.role-pick { min-width: 136px; }
.rm { border: 0; background: none; color: var(--muted); font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 8px 6px; border-radius: var(--radius); }
.rm:hover { color: var(--bad); background: var(--bad-soft); }
.sum { width: 330px; margin-left: auto; border-collapse: collapse; }
.sum.edit { width: 440px; }
.sum.edit .inline { flex-wrap: nowrap; }
.sum td { padding: 5px 0; }
.sum td.k { color: var(--ink-2); }
.sum tr.grand td { border-top: 1px solid var(--ink); padding-top: 9px; font-weight: 700; font-size: 1.08rem; }
.sum .inline input, .sum .inline select { width: auto; }
.sum input.num { width: 104px; }
.savebar { position: sticky; bottom: 0; background: rgba(245, 246, 248, 0.94); backdrop-filter: blur(4px); border-top: 1px solid var(--line); margin: 0 -34px -60px; padding: 12px 34px; display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.savebar .grow { margin-right: auto; color: var(--muted); font-size: 0.9rem; }
.errors { background: var(--bad-soft); border: 1px solid #f3c3bd; color: #8f2219; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; }
.errors ul { margin: 4px 0 0 18px; padding: 0; }

/* ---- reports -------------------------------------------------------- */
.bar { height: 8px; border-radius: 4px; background: var(--accent); }
.bar.soft { background: #b9cff8; }
.barcell { width: 150px; vertical-align: middle !important; }
.bars { display: flex; flex-direction: column; gap: 3px; }

/* ---- sign-in and simple pages --------------------------------------- */
.center { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 30px 30px 26px; width: 100%; max-width: 400px; }
.card h1 { font-size: 1.35rem; margin-bottom: 6px; }
.card .brand { padding: 0 0 18px; display: block; }
.gbtn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 10px 14px; margin-top: 18px; }
.gbtn svg { width: 18px; height: 18px; flex: none; }
.devbox { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--line-2); }

/* ---- approval before sending ----------------------------------------- */
.decide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--line); }
.decide > form + form { padding-left: 28px; border-left: 1px solid var(--line); }
.decide .btn { padding: 11px 14px; font-size: 1rem; }
.pricenote { font-size: 0.87rem; color: var(--muted); margin-top: 2px; }
.pricenote.below { color: var(--bad); font-weight: 600; }
.pricenote.above, .pricenote.custom { color: var(--warn); font-weight: 600; }
td.pricenote { font-size: inherit; margin: 0; }
.pricesum { margin: 0; padding: 12px 18px 16px; border-top: 1px solid var(--line); color: var(--ink-2); }
.mailbody { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--canvas); color: var(--ink-2); overflow-wrap: anywhere; }

/* Up to 1040px wide the menu sits across the top. With the menu at the left (214px) the page
   was too narrow from 821px to about 1040px: a tablet held upright, half of a laptop screen. */
@media (max-width: 1040px) {
  .cols, .cols.even { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats > div:nth-child(3) { border-left: 0; }
  .stats > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 12px; gap: 4px; }
  .brand { padding: 2px 8px; }
  .side .group, .side-foot .who, .side-foot .role { display: none; }
  .side .new { margin: 0 4px 0 0; }
  .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; display: flex; gap: 8px; align-items: center; }
  .side-foot form { margin: 0; }
  body.focus .side a.nav, body.focus .side .new { display: none; }
}
@media (max-width: 820px) {
  .main { padding: 18px 14px 60px; }
  .savebar { margin: 0 -14px -60px; padding: 10px 14px; }
  .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); }
  .span2, .span3 { grid-column: auto; }
  .track .step .when { display: none; }
  .decide { grid-template-columns: minmax(0, 1fr); gap: 18px 0; }
  .decide > form + form { padding-left: 0; border-left: 0; padding-top: 16px; border-top: 1px solid var(--line); }
  .sum { width: 100%; }
  /* 16px stops phones from zooming in when a field gets the focus; 42px is a comfortable touch height */
  input[type=text], input[type=email], input[type=date], input[type=number], input[type=search], select, textarea { font-size: 16px; }
  input[type=text], input[type=email], input[type=date], input[type=number], input[type=search], select { min-height: 42px; }
}

/* ---- phones: the quote editor ------------------------------------------
   A quote line is a table row on a wide screen. The four number columns
   and the remove column take 430px, so on a narrow screen the Item column
   was left one letter wide. Up to 720px each line is stacked instead: the
   item fields over the full width, then quantity, price and discount side
   by side, then the amount. From 721px on the Item column is 220px or
   more and the table stays. */
@media (max-width: 720px) {
  .items.lines, .items.lines tbody { display: block; }
  .items.lines thead { display: none; }
  .items.lines tr.item-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1fr); gap: 10px; padding: 16px 0; border-top: 1px solid var(--line-2); }
  .items.lines tr.item-row:first-child { padding-top: 2px; border-top: 0; }
  .items.lines td { display: block; min-width: 0; padding: 0; border-top: 0; }
  .items.lines td.c-item { grid-column: 1 / -1; }
  .items.lines td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 4px; font-family: var(--font); font-size: 0.82rem; font-weight: 600; color: var(--muted); text-align: left; white-space: nowrap; }
  .items.lines td.amt { grid-column: 2 / -1; grid-row: 3; align-self: center; padding: 0; font-size: 1.02rem; font-weight: 500; }
  .items.lines td.amt::before { display: inline; margin: 0 10px 0 0; }
  .items.lines td.c-rm { grid-column: 1; grid-row: 3; align-self: center; }
  .items.lines .rm { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 10px 0 0; }
  .items.lines .rm::after { content: "Remove"; font-family: var(--font); font-size: 0.88rem; font-weight: 600; }
  .panel { padding: 16px 14px; }
  /* the totals: the 440px table ran off the right edge of a phone */
  .sum.edit { width: 100%; }
  .sum.edit td.k { padding-right: 10px; }
  /* discount: the word on its own line, the kind and the value side by side below it */
  .sum.edit .inline { flex-wrap: wrap; }
  .sum.edit .inline > span { flex: 1 0 100%; }
  .sum.edit tr.disc td { vertical-align: top; }
  /* the bar with the buttons: the total on its own line, the buttons below it */
  .savebar { flex-wrap: wrap; }
  .savebar .grow { flex: 1 0 100%; margin: 0; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
  .savebar .btn { padding: 10px 12px; }
  .savebar .btn.primary { flex: 1 1 0; white-space: normal; text-align: center; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .side a.nav { transition: background-color 0.12s ease; }
}

/* a block inside a settings panel (ways to pay) */
.subpanel { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 16px; background: var(--canvas); }
.subpanel h3 { margin: 0 0 4px; }
.panel .subpanel .lead { margin: 2px 0 12px; }
.ways-row { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 2px; }
