/* Look A from mockups/A-desktop.png: white sidebar, rounded white panels on light gray, slate and
   navy, Plus Jakarta Sans. One dark button per screen at most. Money in even-width digits. On a
   computer the menu runs down the left; on a phone it sits along the bottom. */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --line: #e3e6eb;
  --line-soft: #eef0f3;
  --ink: #18212f;
  --ink-2: #4a5568;
  --ink-3: #6b7585;
  --primary: #1f2a44;
  --accent: #2f4f86;
  --accent-soft: #eaf0f8;
  --ok: #2f6b4f;
  --ok-soft: #e8f2ec;
  --warn: #8a5a12;
  --warn-soft: #f8f0e1;
  --danger: #a3302a;
  --danger-soft: #fbeceb;
  --muted-soft: #eef0f3;
  --radius: 12px;
  --radius-sm: 8px;
  --side: 232px;
  --nav-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* ---------- frame ---------- */

body { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); }
#side {
  position: sticky; top: 0; height: 100vh;
  background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 20px 14px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 22px; }
.mark {
  width: 30px; height: 30px; border-radius: 8px; background: var(--accent-soft); color: var(--primary);
  border: 1px solid #d3deee; display: grid; place-items: center; font-weight: 700; font-size: 15px; flex-shrink: 0;
}
.brand-name { display: block; font-weight: 700; font-size: 15px; line-height: 1.15; }
.brand-sub { display: block; font-size: 12px; color: var(--ink-3); }

#nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 9px 10px; border: 0; border-radius: var(--radius-sm); background: none;
  color: var(--ink-2); font-weight: 500; text-align: left; cursor: pointer;
}
.nav-item:hover { background: var(--bg); }
.nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--primary); font-weight: 650; }
.nav-label {
  font-size: 11.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3);
  padding: 18px 10px 8px;
}
.phone-only { display: none; }

/* Saying hi is for a phone. On a computer, who you are is at the foot of the menu, with the sync
   just above. */
#top { margin-top: auto; }
#hello { display: none; }
#status { padding: 10px 10px; font-size: 12.5px; color: var(--ink-3); }
#status[data-phase="noSignal"], #status[data-phase="failed"] { color: var(--warn); }

.me {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer;
  padding: 12px 8px 4px; border: 0; border-top: 1px solid var(--line-soft); background: none;
}
.me-name { display: block; font-weight: 600; font-size: 13.5px; }
.me-role { display: block; font-size: 12px; color: var(--ink-3); }
.me[aria-current="page"] .me-name { color: var(--accent); }

#main { min-width: 0; padding: 28px 32px 48px; }
.page { max-width: 760px; }

/* Signing in and making a password take the whole screen, with no menu. */
body.gate { display: block; }
body.gate #side { display: none; }
body.gate #main { max-width: 400px; margin: 0 auto; padding: 72px 20px 40px; }
.gate-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }

/* ---------- type ---------- */

h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.lead { color: var(--ink-2); margin: 6px 0 20px; }
.quiet { color: var(--ink-3); font-size: 13px; }
.empty { color: var(--ink-3); padding: 28px 0; }
.section-title { font-size: 14.5px; font-weight: 700; margin: 26px 0 10px; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600; white-space: nowrap; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
}
.btn:hover { border-color: #cfd4dc; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.danger { background: var(--danger-soft); border-color: #efc9c6; color: var(--danger); }
.btn.wide { width: 100%; min-height: 42px; }
.link-btn { border: 0; background: none; color: var(--accent); font-weight: 600; cursor: pointer; padding: 4px 0; }

/* The cog that opens a thing's popup for editing. */
.btn.edit {
  width: 34px; min-height: 34px; padding: 0; border-color: transparent; background: transparent;
}
.btn.edit::before {
  content: ""; width: 18px; height: 18px; background: var(--ink-3);
  -webkit-mask: var(--cog) center / contain no-repeat; mask: var(--cog) center / contain no-repeat;
}
.btn.edit:hover { background: var(--bg); }
/* Line icons for the phone's tabs. */
:root {
  --i-trucks: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 17.5V5H3.5A1.5 1.5 0 0 0 2 6.5v11h2.5'/%3E%3Cpath d='M8.5 17.5h6'/%3E%3Cpath d='M14 9h4.2l3.3 4.1v4.4h-3'/%3E%3Ccircle cx='6.5' cy='17.5' r='2'/%3E%3Ccircle cx='16.5' cy='17.5' r='2'/%3E%3C/svg%3E");
  --i-documents: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 3v5h5'/%3E%3Cpath d='M9 13h6M9 17h6'/%3E%3C/svg%3E");
  --i-overhead: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3h12v18l-3-2-3 2-3-2-3 2z'/%3E%3Cpath d='M9 8h6M9 12h6M9 16h3'/%3E%3C/svg%3E");
  --i-pnl: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 20h18'/%3E%3Cpath d='M7 16v-4M12 16V7M17 16v-7'/%3E%3C/svg%3E");
  --i-more: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='5' cy='12' r='1.2' fill='black'/%3E%3Ccircle cx='12' cy='12' r='1.2' fill='black'/%3E%3Ccircle cx='19' cy='12' r='1.2' fill='black'/%3E%3C/svg%3E");
}

:root {
  --cog: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19.4 13a7.6 7.6 0 0 0 0-2l2.1-1.6-2-3.5-2.5 1a7.4 7.4 0 0 0-1.7-1L15 3.3h-4l-.4 2.6a7.4 7.4 0 0 0-1.7 1l-2.5-1-2 3.5L6.6 11a7.6 7.6 0 0 0 0 2l-2.1 1.6 2 3.5 2.5-1a7.4 7.4 0 0 0 1.7 1l.4 2.6h4l.4-2.6a7.4 7.4 0 0 0 1.7-1l2.5 1 2-3.5zM13 15.5a3.5 3.5 0 1 1 0-7 3.5 3.5 0 0 1 0 7z' transform='translate(-1 0)'/%3E%3C/svg%3E");
}

/* ---------- forms ---------- */

.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel); font-size: 15px;
}
.input:focus { outline: 2px solid #c9d6ec; border-color: var(--accent); }
.form-error { color: var(--danger); font-size: 13px; }
.form-note { color: var(--ink-3); font-size: 13px; }

/* ---------- lists ---------- */

.list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.row + .row { border-top: 1px solid var(--line-soft); }
.row-text { flex: 1; min-width: 0; }
.row-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: 12.5px; color: var(--ink-3); }
.row-sub.warn { color: var(--warn); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--muted-soft); color: var(--ink-2);
  display: grid; place-items: center; font-weight: 700; font-size: 12.5px; flex-shrink: 0;
}

.pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 18px; white-space: nowrap;
}
.pill.stock { background: var(--accent-soft); color: var(--accent); }
.pill.sold { background: var(--muted-soft); color: var(--ink-2); }
.pill.label { background: var(--warn-soft); color: var(--warn); }

.links { display: flex; flex-direction: column; }
.links .row { cursor: pointer; border: 0; background: none; width: 100%; text-align: left; font-weight: 600; }

/* ---------- popups ---------- */

dialog {
  margin: auto; width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  background: var(--panel); color: var(--ink); box-shadow: 0 18px 50px rgba(24, 33, 47, .18);
}
dialog::backdrop { background: rgba(24, 33, 47, .35); }
.dialog-title { font-size: 17px; font-weight: 700; margin-bottom: 14px; }
.dialog-body { color: var(--ink-2); margin-bottom: 16px; }
.dialog-buttons { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.dialog-steps { margin: 0 0 18px; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.dialog-part { padding: 14px 0; border-top: 1px solid var(--line-soft); }
.dialog-part:first-of-type { border-top: 0; padding-top: 0; }
dialog:has(.form-grid) { width: min(560px, calc(100vw - 32px)); }
.dialog-list { margin: 0 0 16px 18px; color: var(--ink-2); display: flex; flex-direction: column; gap: 6px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.field.wide { grid-column: 1 / -1; }
.input.area { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.45; }
select.input { padding-right: 8px; }
.label-list { margin-bottom: 14px; }
.label-list .row { padding: 8px 0; justify-content: space-between; }

/* ---------- trucks ---------- */

/* On a computer the list and the truck share the page, each scrolling on its own. */
body.full #main { padding: 0; }
.split { display: grid; grid-template-columns: 404px minmax(0, 1fr); height: 100vh; }
.list-pane { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.list-head { padding: 22px 20px 14px; border-bottom: 1px solid var(--line-soft); }
.list-head .page-head { margin-bottom: 14px; }
.filters { display: flex; gap: 8px; }
.filters .input { height: 36px; font-size: 13.5px; }
.filters select.input { width: auto; max-width: 45%; }
.items { overflow-y: auto; flex: 1; }
.empty.pad { padding: 18px 20px; }

.truck-item {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; width: 100%; text-align: left;
  padding: 14px 20px; border: 0; border-bottom: 1px solid var(--line-soft); background: none; cursor: pointer;
}
.truck-item:hover { background: #f8f9fb; }
.truck-item.on { background: #f3f6fb; box-shadow: inset 3px 0 0 var(--accent); }
.truck-item .t { font-weight: 650; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.truck-item .m { color: var(--ink-3); font-size: 12.5px; white-space: pre; }
.truck-item .amt { font-weight: 600; font-size: 14px; text-align: right; }
.truck-item .amt-sub { font-size: 12px; color: var(--ink-3); text-align: right; }
.truck-item .lbl { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
/* The main photo, to the left of the name. */
.truck-item.has-photo { grid-template-columns: 72px minmax(0, 1fr) auto; }
.truck-item.has-photo .lbl { grid-column: 2 / -1; }
.truck-photo {
  grid-row: 1 / span 2; align-self: center; width: 72px; height: 54px; object-fit: cover;
  border-radius: 8px; background: var(--bg);
}
.pill.plain { background: transparent; border: 1px solid var(--line); color: var(--ink-2); line-height: 16px; }
button.pill { cursor: pointer; font-family: inherit; }

.detail { overflow-y: auto; padding: 24px 32px 40px; min-width: 0; }
.back {
  border: 0; background: none; color: var(--accent); font-weight: 600; font-size: 15px; cursor: pointer;
  padding: 0 0 12px; display: flex; align-items: center; gap: 8px;
}
.back::before { content: ""; width: 9px; height: 9px; border: solid var(--accent); border-width: 0 0 2px 2px; transform: rotate(45deg); }
.d-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.d-title { font-size: 24px; font-weight: 700; letter-spacing: -.015em; line-height: 1.2; }
.d-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 8px; color: var(--ink-2); font-size: 13px; }
.d-meta b { color: var(--ink-3); font-weight: 500; margin-right: 5px; }
.d-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.d-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.money { display: grid; grid-template-columns: 1fr 1fr 1.2fr; margin: 22px 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.money > div { padding: 14px 18px; }
.money > div + div { border-left: 1px solid var(--line-soft); }
.money .k { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.money .v { font-size: 20px; font-weight: 650; margin-top: 2px; }
.money .in-for .v { font-size: 22px; font-weight: 750; color: var(--primary); }
.money .in-for .k { color: var(--ink-2); font-weight: 650; }

.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.card + .card { margin-top: 20px; }
.card-h { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
.card-h.flat { padding: 0 0 8px; border: 0; }
.card-h h3 { font-size: 14.5px; font-weight: 700; }
.card-h .sub { font-size: 12.5px; color: var(--ink-3); font-weight: 500; margin-left: 6px; }
.card-foot { padding: 10px 16px; border-top: 1px solid var(--line-soft); }

/* A truck's photos, the main one first, and one of them big. */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; padding: 12px 16px 16px; }
.photo-thumb {
  display: block; aspect-ratio: 4 / 3; padding: 0; border: 0; border-radius: 8px; overflow: hidden;
  background: var(--bg); cursor: pointer;
}
.photo-img { display: block; width: 100%; height: 100%; object-fit: cover; }
dialog:has(.viewer) { width: min(960px, calc(100vw - 24px)); padding: 16px; }
.viewer-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-weight: 650; }
.viewer-frame {
  display: flex; align-items: center; justify-content: center; min-height: 200px; border-radius: 10px;
  background: #0f1520; touch-action: pan-y; user-select: none;
}
.photo-full { display: block; max-width: 100%; max-height: calc(100vh - 260px); object-fit: contain; }
.viewer .dialog-buttons { display: grid; grid-template-columns: 1fr 1fr; margin-top: 12px; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 9px 14px; border-bottom: 1px solid var(--line-soft); }
td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; vertical-align: top; }
th.r, td.r { text-align: right; }
td .v2, .v2 { display: block; font-size: 12.5px; color: var(--ink-3); }
tfoot td { border-bottom: 0; font-weight: 700; }
td .btn.edit { margin: -6px -8px -6px 0; }

.work { padding: 4px 16px 4px; }
.work-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; font-size: 13.5px; }
.work-item + .work-item { border-top: 1px solid var(--line-soft); }
.work-item input[type="checkbox"] { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--ink-3); flex-shrink: 0; }
.work-text { flex: 1; min-width: 0; }
.work-item .btn.edit { margin: -6px -8px -6px 0; }
.x { color: var(--ink-3); text-decoration: line-through; }
.work-add { display: flex; gap: 8px; padding: 10px 16px 14px; border-top: 1px solid var(--line-soft); }
.work-add .input { height: 36px; font-size: 13.5px; }

.note { padding: 12px 16px 12px; }
.note + .note { border-top: 1px solid var(--line-soft); }
.note-row { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; }
.note-text { font-size: 13.5px; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.note .by { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.note .btn.edit { margin: -6px -8px 0 0; }

.kvs { padding: 6px 16px 10px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 13.5px; }
.kv span:first-child { color: var(--ink-3); }
.kv span:last-child { text-align: right; white-space: pre-line; }

.tabs { display: flex; gap: 4px; margin-top: 10px; }
.tab {
  border: 0; background: none; cursor: pointer; padding: 5px 10px; border-radius: 6px;
  font-size: 13px; font-weight: 600; color: var(--ink-3);
}
.tab[aria-pressed="true"] { background: var(--muted-soft); color: var(--ink); }
.d-actions { display: flex; gap: 8px; flex-shrink: 0; }
.sale .kv span:last-child { font-weight: 600; }
.sale .kv .link-btn { padding: 0; }
.sale-notes .note:first-child { border-top: 1px solid var(--line-soft); }
.old-invoices { border-top: 1px solid var(--line-soft); }
.table-wrap { overflow-x: auto; }
.table-wrap.card { margin-bottom: 18px; }

/* ---------- overhead and P&L ---------- */

.month + .month { margin-top: 8px; }
.month-head { display: flex; justify-content: space-between; align-items: baseline; }
.row-when { width: 92px; flex-shrink: 0; color: var(--ink-3); font-size: 13px; }
.row .amount { font-weight: 600; }
.pnl th, .pnl td { white-space: nowrap; }
.pnl tfoot td { border-top: 1px solid var(--line); }
.page.wider { max-width: 1100px; }
.form.narrow { max-width: 420px; }
.sign-in-buttons { margin-top: 16px; max-width: 320px; }

/* ---------- documents ---------- */

.document-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; }
.document-row + .document-row { border-top: 1px solid var(--line-soft); }
.list.documents .document-row { padding: 12px 16px; }
.file-mark {
  width: 30px; height: 36px; border: 1px solid var(--line); border-radius: 4px; display: grid; place-items: end center;
  padding-bottom: 4px; font-size: 9px; font-weight: 700; color: var(--ink-3); flex-shrink: 0;
}
.document-text { flex: 1; min-width: 0; }
.document-row .name { font-weight: 600; font-size: 13.5px; }
.document-row .sub { font-size: 12px; color: var(--ink-3); }
.files { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; }
.file {
  border: 0; background: none; padding: 0; cursor: pointer; color: var(--accent); font-size: 12.5px; font-weight: 600;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.document-row .btn.edit, .document-line .btn.edit { margin: -6px -8px 0 0; }
.document-line { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; font-size: 13.5px; }
.file-input { height: auto; padding: 8px 10px; font-size: 13.5px; }
.file-list .row { padding: 6px 0; }
.file-list .btn.wide { width: auto; min-height: 30px; }
img.logo { display: block; max-width: 180px; max-height: 70px; object-fit: contain; }
.logo-line { padding: 8px 0 4px; }
.invoice img.logo { margin-bottom: 10px; }

/* ---------- invoice ---------- */

.invoice-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.invoice-actions .back { padding: 0; }
.invoice {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 40px 44px; max-width: 760px; overflow: hidden;
}
.invoice-head { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 32px; color: var(--ink-2); }
.biz-name { font-size: 20px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.invoice-id { text-align: right; }
.invoice-id h2 { font-size: 22px; color: var(--ink); margin-bottom: 4px; }
.bill-to { margin-bottom: 28px; color: var(--ink-2); }
.bill-to .k { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 6px; }
.buyer-name { font-weight: 650; color: var(--ink); }
.invoice-lines th { border-bottom: 1px solid var(--line); }
.invoice-lines td { font-size: 14.5px; padding: 14px; }
.invoice-lines .item-name { font-weight: 650; }
.invoice-lines tfoot td { font-size: 16px; border-top: 2px solid var(--ink); }
.void-mark {
  position: absolute; top: 42%; left: 50%; transform: translate(-50%, -50%) rotate(-18deg);
  font-size: 96px; font-weight: 800; letter-spacing: .1em; color: rgba(163, 48, 42, .18); pointer-events: none;
}

/* Printing an invoice prints just the invoice. */
@media print {
  body { display: block; background: #fff; }
  #side, .invoice-actions, #status { display: none !important; }
  #main { padding: 0; }
  .invoice { border: 0; padding: 0; max-width: none; }
}

.page.wide { max-width: 900px; }
.page .filters { margin-bottom: 14px; }
.page-head .filters { margin: 0; }
.page-head .filters select.input { max-width: none; min-width: 110px; }
.row-text.wrap { overflow-wrap: anywhere; }

/* ---------- phone ---------- */

@media (max-width: 899px) {
  body { display: block; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
  #side { display: contents; }
  .brand, .me, .desk-only { display: none !important; }
  .phone-only { display: flex; }
  #nav {
    position: fixed; z-index: 5; left: 0; right: 0; bottom: 0; flex-direction: row; gap: 0;
    height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding: 0 8px env(safe-area-inset-bottom);
    background: var(--panel); border-top: 1px solid var(--line);
  }
  /* Each tab is as wide as its word plus an equal share of what's left, so the gaps between the words
     match, however long each word is. */
  .nav-item {
    position: relative; flex: 1 1 auto; width: auto; min-width: 0; flex-direction: column; justify-content: center; gap: 3px;
    border-radius: 0; padding: 0 2px; font-size: 11.5px; font-weight: 600; color: var(--ink-3);
  }
  .nav-item::before {
    content: ""; position: relative; z-index: 1; width: 22px; height: 22px; background: currentColor;
    -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat;
  }
  .nav-item[aria-current="page"] { background: none; color: var(--primary); }
  .nav-item[aria-current="page"]::after {
    content: ""; position: absolute; top: 9px; left: 50%; width: 52px; height: 28px; margin-left: -26px;
    border-radius: 999px; background: var(--accent-soft);
  }
  .nav-item[data-page="trucks"] { --icon: var(--i-trucks); }
  .nav-item[data-page="documents"] { --icon: var(--i-documents); }
  .nav-item[data-page="overhead"] { --icon: var(--i-overhead); }
  .nav-item[data-page="pnl"] { --icon: var(--i-pnl); }
  .nav-item[data-page="more"] { --icon: var(--i-more); }

  /* Along the top: hi, which opens your sign-in, and the sync. No signal takes a
     line of its own. */
  #top {
    position: sticky; top: 0; z-index: 4; margin: 0;
    display: flex; flex-wrap: wrap; align-items: center; column-gap: 12px; row-gap: 2px;
    min-height: calc(56px + env(safe-area-inset-top)); padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
    background: var(--primary); color: #fff;
  }
  #hello {
    display: block; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    padding: 0; border: 0; background: none; color: #fff; font-size: 16px; font-weight: 700; cursor: pointer;
  }
  #status { margin-left: auto; padding: 0; font-size: 12.5px; color: #b9c3d6; text-align: right; }
  #status[data-phase="noSignal"], #status[data-phase="failed"] { flex: 1 0 100%; margin-left: 0; text-align: left; color: #f2c879; }
  #status:empty { display: none; }
  .sign-in-buttons { max-width: none; }
  #main { padding: 18px 16px 28px; }
  .btn { min-height: 42px; font-size: 14.5px; }
  .input { height: 44px; font-size: 16px; }
  .filters .input, .work-add .input { height: 44px; font-size: 16px; }

  /* The list and the truck are each a page of their own. */
  .list-pane { background: none; border: 0; }
  .list-head { padding: 0 0 14px; border: 0; }
  .items { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
  .truck-item:last-child { border-bottom: 0; }
  .detail { padding: 0; overflow: visible; }
  .d-title { font-size: 22px; }
  /* Buttons on a phone run the width of the screen, sharing it when there are two. */
  .d-actions { width: 100%; }
  .d-actions .btn { flex: 1; min-height: 46px; }
  .money { grid-template-columns: 1fr; padding: 4px 16px; }
  .money > div { padding: 10px 0; display: flex; justify-content: space-between; align-items: baseline; }
  .money > div + div { border-left: 0; border-top: 1px solid var(--line-soft); }
  .money .v { font-size: 15px; margin: 0; }
  .money .in-for .v { font-size: 19px; }
  .grid2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  th:first-child, td:first-child { padding-left: 12px; }
  td, th { padding-left: 8px; padding-right: 8px; }
}
