/* ===== from globals.css ===== */
/* Task Tracker. Named for what field crews actually carry: carbon-copy work order
   books. Blue carbon ink on white, canary quote copies, pink invoice copies, and
   the punched stub that follows a job from first call to paid. */

:root {
  --ink: #16233b;
  --ink-2: #44526a;
  --ink-3: #66748b;
  --night: #131c33;
  --night-2: #1f2b4a;
  --steel: #eef1f6;
  --steel-2: #e3e8f0;
  --paper: #ffffff;
  --line: #d9dfe9;
  --line-2: #bcc6d5;

  --carbon: #2742c4;
  --carbon-dark: #1b2f93;
  --carbon-wash: #e8ecfb;
  --canary: #fff3b0;
  --canary-deep: #ffd84d;
  --canary-ink: #6b5400;
  --pink: #ffdbe3;
  --pink-deep: #f48fa9;
  --pink-ink: #8f1d41;
  --goldenrod: #ffe3a1;
  --serial: #c4252f;

  --ok: #157347;
  --ok-wash: #dcf3e6;
  --warn: #975a00;
  --warn-wash: #fff0d4;
  --danger: #b3261e;
  --danger-wash: #fde5e3;
  --orange: #b4470c;
  --orange-wash: #ffe7d6;
  --purple: #7e2aa3;
  --purple-wash: #f3e3fb;

  --font-body-stack: var(--font-body), system-ui, sans-serif;
  --font-display-stack: var(--font-display), var(--font-body), system-ui, sans-serif;

  --radius: 8px;
  --radius-sm: 5px;
  --shadow-menu: 0 12px 32px -8px rgb(19 28 51 / 0.28), 0 2px 6px rgb(19 28 51 / 0.1);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--steel);
  color: var(--ink);
  font-family: var(--font-body-stack);
  font-size: 15px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display-stack);
  font-weight: 600;
  line-height: 1.15;
}

h1 {
  font-size: 30px;
  letter-spacing: -0.005em;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 15px;
}

p {
  margin: 0;
}

a {
  color: var(--carbon);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

small {
  font-size: 12.5px;
}

:focus-visible {
  outline: 2px solid var(--carbon);
  outline-offset: 2px;
  border-radius: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

[data-required-label]::after,
.required-field-marker::before {
  content: " *" / "";
  color: var(--danger);
}

.required-field-marker {
  flex: none;
  align-self: center;
  font-weight: 600;
}

.muted {
  color: var(--ink-3);
}

.strong {
  font-weight: 600;
}

.nowrap {
  white-space: nowrap;
}

.block {
  display: block;
}

.text-danger {
  color: var(--danger);
}

.text-warn {
  color: var(--warn);
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.row > .input {
  width: auto;
}

.row.between {
  justify-content: space-between;
}

.row-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stack-lg {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.stack-tight {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stack-tight-top {
  margin-top: 12px;
}

.spin {
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ----- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 13px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  font: 600 14px/1.2 var(--font-body-stack);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
}

.btn:hover {
  background: var(--steel);
  border-color: var(--ink-3);
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn-primary {
  background: var(--carbon);
  border-color: var(--carbon);
  color: #fff;
}

.btn-primary:hover {
  background: var(--carbon-dark);
  border-color: var(--carbon-dark);
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #8f1e18;
  border-color: #8f1e18;
}

.btn-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--ink-2);
}

.btn-quiet:hover {
  background: var(--steel-2);
  border-color: transparent;
}

.btn-small {
  min-height: 30px;
  padding: 3px 10px;
  font-size: 13px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: none;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--steel-2);
  color: var(--ink);
}

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--carbon);
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.link-btn:hover {
  text-decoration: underline;
}

.danger-link {
  display: inline-block;
  margin-top: 14px;
  color: var(--danger);
}

.row > .danger-link,
.row > form > .danger-link {
  margin-top: 0;
}

.link-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ----- forms */

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.field label,
.label-like {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
}

.field-hint {
  color: var(--ink-3);
  font-size: 12.5px;
}

.field-error {
  color: var(--danger);
  font-size: 13.5px;
}

.input {
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.3 var(--font-body-stack);
}

textarea.input {
  resize: vertical;
}

.input:focus {
  outline: 2px solid var(--carbon);
  outline-offset: -1px;
  border-color: var(--carbon);
}

.input.num {
  text-align: right;
}

.input-quiet {
  border-color: var(--line);
  color: var(--ink-2);
  font-size: 13.5px;
  min-height: 32px;
}

input[type='color'].input {
  padding: 3px;
}

.select-inline {
  width: auto;
  min-width: 180px;
}

.input-icon {
  position: relative;
}

.input-icon > svg {
  position: absolute;
  left: 10px;
  top: 50%;
  translate: 0 -50%;
  color: var(--ink-3);
}

.input-icon .input {
  padding-left: 32px;
}

.check-field {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  cursor: pointer;
}

.check-field input {
  margin: 3px 0 0;
  width: 16px;
  height: 16px;
  accent-color: var(--carbon);
}

.check-field small {
  display: block;
  color: var(--ink-3);
}

.check-field[hidden] {
  display: none;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.copy-row {
  display: flex;
  gap: 8px;
}

.hp {
  position: absolute;
  left: -9999px;
}

/* ----- badges */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--steel-2);
  color: var(--ink-2);
}

.badge-blue {
  background: var(--carbon-wash);
  color: var(--carbon-dark);
}

.badge-yellow {
  background: var(--canary);
  color: var(--canary-ink);
}

.badge-green {
  background: var(--ok-wash);
  color: var(--ok);
}

.badge-red {
  background: var(--danger-wash);
  color: var(--danger);
}

.badge-pink {
  background: var(--pink);
  color: var(--pink-ink);
}

.badge-purple {
  background: var(--purple-wash);
  color: var(--purple);
}

.badge-orange {
  background: var(--orange-wash);
  color: var(--orange);
}

/* ----- shell */

.shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 12px;
  background: var(--night);
  color: #d6dcea;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 6px;
  font: 700 20px/1 var(--font-display-stack);
  color: #fff;
}

.org-switch {
  position: relative;
}

.org-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #33405f;
  border-radius: var(--radius-sm);
  background: var(--night-2);
  color: #fff;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.org-button:hover {
  background: #2a3760;
}

.org-text {
  min-width: 0;
}

.org-text strong {
  display: block;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.org-text small {
  color: #a9b4cc;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 12px;
}

.nav-heading {
  padding: 0 8px 4px;
  color: #93a0bd;
  font-size: 12.5px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  color: #d6dcea;
  font-weight: 500;
}

.nav-link:hover {
  background: var(--night-2);
  color: #fff;
  text-decoration: none;
}

.nav-on,
.nav-on:hover {
  background: var(--canary-deep);
  color: var(--night);
  font-weight: 600;
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 12px;
}

.sidebar-legal {
  margin: 8px 9px 0;
  font-size: 12px;
  color: #8f9bb3;
}

.sidebar-legal a {
  color: inherit;
}

.sidebar-legal a:hover {
  color: #d6dcea;
}

.sidebar-scrim {
  display: none;
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 58px;
  padding: 0 22px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.menu-toggle {
  display: none;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 460px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: var(--steel);
  color: var(--ink-3);
}

.search:focus-within {
  outline: 2px solid var(--carbon);
  background: var(--paper);
}

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

/* The box shows focus (.search:focus-within); the field inside must not add a second ring. */
.search input:focus,
.search input:focus-visible {
  outline: 0;
}

.search kbd {
  padding: 0 5px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  font: 500 11.5px var(--font-body-stack);
}

.menu {
  position: absolute;
  z-index: 40;
  display: flex;
  flex-direction: column;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-menu);
}

.search-menu {
  top: 42px;
  left: 0;
  right: 0;
  max-height: 60vh;
  overflow-y: auto;
}

.org-menu {
  top: calc(100% + 5px);
  left: 0;
  width: 270px;
}

.create,
.user-menu {
  position: relative;
}

.create-menu {
  top: calc(100% + 5px);
  right: 0;
  width: 170px;
}

.user-dropdown {
  top: calc(100% + 5px);
  right: 0;
  width: 240px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.menu-item:hover {
  background: var(--steel);
  text-decoration: none;
}

.menu-grow {
  flex: 1;
  min-width: 0;
}

.menu-grow small {
  display: block;
  color: var(--ink-3);
}

.menu-split {
  margin-top: 4px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding-top: 9px;
}

.menu-item-danger {
  color: var(--danger);
}

.menu-item-danger:hover {
  background: var(--danger-wash);
}

.menu-divider {
  margin: 4px 0;
  border-top: 1px solid var(--line);
}

.dispatch-menu {
  position: fixed;
  z-index: 50;
  min-width: 190px;
  font-size: 14px;
}

.menu-note {
  padding: 7px 9px;
  color: var(--ink-2);
  font-size: 13.5px;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  border-radius: 50%;
  color: #fff;
  font-weight: 600;
  line-height: 1;
}

.avatar-empty {
  width: 26px;
  height: 26px;
  background: none;
  border: 1.5px dashed var(--line-2);
}

.avatars {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}

.avatar-btn {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 50%;
}

.timer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px 2px 12px;
  border-radius: 99px;
  background: var(--orange-wash);
  color: var(--orange);
  font-size: 13.5px;
  white-space: nowrap;
}

.timer .icon-btn {
  border-radius: 50%;
  color: inherit;
}

.timer .icon-btn:hover,
.timer .icon-btn:focus-visible {
  background: color-mix(in srgb, var(--orange) 15%, transparent);
}

.timer-dot,
.dot-live {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--orange);
}

@media (prefers-reduced-motion: no-preference) {
  .timer-dot,
  .dot-live {
    animation: pulse 1.8s ease-in-out infinite;
  }
}

@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

.dot-road {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 2px;
  background: var(--purple);
}

.demo-banner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 14px;
  padding: 5px 16px;
  background: var(--canary);
  color: var(--canary-ink);
  font-size: 13.5px;
}

.demo-banner .link-btn {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
}

.content {
  flex: 1;
  width: 100%;
  max-width: 1460px;
  margin: 0 auto;
  padding: 24px 26px 60px;
}

.full-center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

/* ----- page structure */

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 18px;
}

.page-head-text {
  min-width: 0;
}

.page-sub {
  margin-top: 4px;
  color: var(--ink-2);
}

.back-link {
  display: inline-block;
  margin-bottom: 5px;
  color: var(--ink-2);
  font-size: 13.5px;
}

.back-link::before {
  content: '‹ ';
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 small {
  margin-left: 6px;
  color: var(--ink-3);
  font: 400 13px var(--font-body-stack);
}

.panel-collapsible > summary {
  list-style: none;
  cursor: pointer;
  border-radius: var(--radius);
}

.panel-collapsible > summary::-webkit-details-marker {
  display: none;
}

.panel-collapsible:not([open]) > summary {
  border-bottom: 0;
}

.panel-collapsible > summary > svg {
  flex: none;
  color: var(--ink-3);
}

.panel-collapsible[open] > summary > svg {
  rotate: 180deg;
}

.panel-actions {
  display: flex;
  gap: 8px;
  flex: none;
}

.panel-disclosure-actions {
  justify-content: flex-end;
  margin-bottom: 12px;
}

.panel-link {
  font-size: 13.5px;
}

.panel-body {
  padding: 16px;
}

.panel-flush {
  padding: 0;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 14px;
}

.toolbar .tabs {
  margin-bottom: 0;
}

.toolbar-search {
  flex: 1;
  min-width: 220px;
  max-width: 340px;
}

.tabs {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--ink-2);
  font: 500 14px var(--font-body-stack);
  cursor: pointer;
}

.tab:hover {
  background: var(--steel-2);
}

.tab-on,
.tab-on:hover {
  background: var(--ink);
  color: #fff;
}

.tab-count {
  min-width: 20px;
  padding: 0 5px;
  border-radius: 99px;
  background: rgb(68 82 106 / 0.14);
  font-size: 12px;
  text-align: center;
}

.tab-on .tab-count {
  background: rgb(255 255 255 / 0.22);
}

.empty {
  padding: 34px 20px;
  text-align: center;
}

.empty h3 {
  font-size: 17px;
}

.empty p {
  margin-top: 5px;
  color: var(--ink-2);
}

.empty-action {
  margin-top: 13px;
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 30px;
  color: var(--ink-3);
}

.error-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  background: var(--danger-wash);
  color: var(--danger);
}

/* ----- tables */

th,
td {
  vertical-align: middle;
}

.table-scroll {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--steel-2);
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover {
  background: #f7f8fb;
}

.table small {
  display: block;
  color: var(--ink-3);
}

.table small.row-inline {
  display: flex;
}

.num {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
}

.row-link {
  cursor: pointer;
}

.row-off {
  opacity: 0.55;
}

.cell-action {
  text-align: right;
  white-space: nowrap;
}

/* ----- the journey stub */

.job-journey {
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  overflow: hidden;
}

.stub {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stub-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  flex: 1 1 0;
  min-width: 0;
  outline: 1px solid var(--line);
}

.stub-stage + .stub-stage {
  border-inline-start: 2px solid var(--line-2);
}

.stub-stage-pair {
  flex-grow: 2;
}

.stub-stage-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 25px;
  padding: 0 6px;
  border-block-end: 1px solid var(--line);
  background: color-mix(in srgb, var(--steel) 72%, var(--paper));
  color: var(--ink-2);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.stub-stage-current .stub-stage-head {
  background: var(--carbon-wash);
  color: var(--carbon-dark);
}

.stub-stage-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
}

.stub-stage-title {
  min-width: 0;
  overflow-wrap: anywhere;
}

.stub-milestones {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stub-step {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  border-inline-start: 1px solid var(--line);
}

.stub-step:first-child {
  border-inline-start: 0;
}

.stub-step > a,
.stub-step:not(:has(a)) {
  color: inherit;
}

.stub-step > a {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  justify-content: center;
}

.stub-step > a:hover {
  text-decoration: none;
  background: var(--steel);
}

.stub-step > a:focus-visible {
  outline-offset: -3px;
}

.stub-step .stub-hole {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin: 9px auto 4px;
  border: 1.5px solid var(--line-2);
  border-radius: 50%;
  background: var(--paper);
}

.stub-label {
  display: block;
  padding: 0 4px 8px;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

.stub-detail {
  display: block;
  margin-top: 2px;
  color: var(--ink-2);
  font-size: 0.86em;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.journey-guidance {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--carbon-wash) 48%, var(--paper));
  color: var(--ink-2);
  font-size: 13.5px;
}

.journey-guidance > svg {
  color: var(--carbon);
}

.journey-guidance strong {
  color: var(--ink);
}

/* Done: a green tick on a green-washed cell. Filled means finished. */
.stub-done {
  background: color-mix(in srgb, var(--ok-wash) 54%, var(--paper));
}

.stub-done > a:hover {
  background: color-mix(in srgb, var(--ok) 10%, var(--ok-wash));
}

.stub-done .stub-hole {
  border-color: var(--ok);
  background: var(--ok);
  color: var(--paper);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.stub-done .stub-label {
  color: var(--ink);
}

.stub-now {
  background: color-mix(in srgb, var(--carbon-wash) 62%, var(--paper));
}

.stub-now > a:hover {
  background: var(--carbon-wash);
}

.stub-now .stub-hole {
  border-color: var(--carbon);
  background: var(--carbon);
  box-shadow: inset 0 0 0 3px var(--paper);
}

.stub-now .stub-label {
  color: var(--carbon-dark);
  font-weight: 700;
}

.stub-tag {
  display: block;
  width: max-content;
  margin: 3px auto 0;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--carbon-dark);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 16px;
  text-transform: uppercase;
}

/* Still to come: faded. */
.stub-todo .stub-label {
  color: var(--ink-3);
  font-weight: 400;
}

.stub-todo .stub-hole {
  border-color: var(--line);
}

/* ----- printed forms */

.sheet {
  position: relative;
  min-width: 0;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-top: 6px solid var(--carbon);
  border-radius: 3px;
  background: var(--paper);
}

.sheet-quote {
  border-top-color: var(--canary-deep);
  background: linear-gradient(#fffcea, var(--paper) 170px);
}

.sheet-invoice {
  border-top-color: var(--pink-deep);
  background: linear-gradient(#fff4f6, var(--paper) 170px);
}

.sheet-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 14px;
  border-bottom: 1.5px solid var(--ink);
}

.sheet-org {
  font: 700 22px/1.1 var(--font-display-stack);
}

.sheet-head p {
  margin-top: 4px;
  color: var(--ink-2);
  font-size: 13.5px;
  white-space: pre-line;
}

.sheet-title {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  text-align: right;
}

.sheet-title span:first-child {
  color: var(--ink-2);
  font-weight: 500;
}

.serial {
  color: var(--serial);
  font: 700 22px/1.1 var(--font-display-stack);
  letter-spacing: 0.01em;
}

.sheet-parties {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px 20px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.sheet-parties h3 {
  margin-bottom: 3px;
  color: var(--ink-3);
  font: 600 13px var(--font-body-stack);
}

.sheet-parties p {
  overflow-wrap: anywhere;
}

.sheet-instructions {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.sheet-instructions h3 {
  margin-bottom: 3px;
  color: var(--ink-3);
  font: 600 13px var(--font-body-stack);
}

.lines {
  width: 100%;
  border-collapse: collapse;
}

.lines th {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line-2);
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}

.lines td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--steel-2);
}

.lines th:first-child,
.lines td:first-child {
  padding-left: 0;
}

.lines th:last-child,
.lines td:last-child {
  padding-right: 0;
}

.lines small {
  display: block;
  color: var(--ink-3);
}

.totals {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: min(100%, 320px);
  margin: 14px 0 0 auto;
}

.totals > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.totals dt {
  color: var(--ink-2);
}

.totals dd {
  margin: 0;
}

.totals-grand {
  padding-top: 6px;
  border-top: 1.5px solid var(--ink);
  font-size: 19px;
  font-weight: 700;
}

.totals-grand dt {
  color: var(--ink);
}

.sheet-terms {
  margin-top: 16px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13.5px;
  white-space: pre-line;
}

/* Quote choices: add-ons the customer ticks, and lines not chosen once approved. */
.lines .line-flag {
  display: inline-block;
  margin-top: 2px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lines .line-not-chosen td {
  color: var(--ink-3);
}

.lines .line-not-chosen strong {
  font-weight: 500;
  text-decoration: line-through;
}

.line-pick {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
}

.line-pick input {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  flex: none;
}

.sheet-choice {
  margin-bottom: 4px;
}

.lines .line-option th {
  text-align: left;
  padding-top: 16px;
  font-size: 15px;
  font-weight: 700;
  border-bottom: 1.5px solid var(--ink);
}

.lines .line-option small {
  display: block;
  font-weight: 400;
}

.lines .line-option-total td {
  font-weight: 600;
  border-top: 1px solid var(--line);
}

.sheet-options-note {
  margin-top: 14px;
}

/* ----- line items */

.doc-line-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}

.doc-line-optional .doc-line-money {
  opacity: 0.7;
}

.doc-line-elsewhere {
  display: none;
}

.quote-options,
.quote-options-start {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.quote-options .tabs {
  flex-wrap: wrap;
}

.quote-option-actions {
  flex-wrap: wrap;
  align-items: center;
}

.quote-options-stop summary {
  list-style: none;
  cursor: pointer;
}

.quote-options-stop[open] .stack-tight {
  margin-top: 8px;
}

.line-editor {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.line-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.line-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 76px 110px 50px 96px 32px;
  gap: 10px;
  align-items: start;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--steel-2);
}

.line-main {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.line-num {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: var(--ink-3);
  font-size: 12.5px;
}

.line-tax {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--ink-3);
  font-size: 12.5px;
  flex-direction: column-reverse;
  justify-content: flex-end;
}

.line-amount {
  padding-top: 26px;
  font-weight: 600;
  text-align: right;
}

.line-row .icon-btn {
  margin-top: 21px;
}

.line-empty {
  padding: 4px 0;
}

.line-add {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.line-add select {
  flex: 1;
  min-width: 220px;
  max-width: 380px;
}

.line-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
  margin-top: 6px;
}

.line-adjust {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 150px));
  gap: 12px;
  align-content: start;
}

.line-foot .totals {
  margin: 0;
}

/* ----- pickers */

.picked {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 38px;
  padding: 4px 6px 4px 11px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
}

.picked small {
  display: block;
  color: var(--ink-3);
}

.pick-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 6px;
  margin-top: 4px;
}

.pick-row {
  display: flex;
  flex-direction: column;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.pick-row:hover {
  border-color: var(--carbon);
  background: var(--carbon-wash);
}

.pick-row small {
  color: var(--ink-3);
}

.assign-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.assign-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 8px;
  border: 1px solid var(--line-2);
  border-radius: 99px;
  cursor: pointer;
  font-weight: 500;
}

.assign-chip:has(> .avatar) {
  padding-inline: 5px 11px;
}

.assign-chip input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.assign-chip:has(input:focus-visible) {
  outline: 2px solid var(--carbon);
  outline-offset: 2px;
}

.assign-on {
  border-color: var(--carbon);
  background: var(--carbon-wash);
}

.day-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
  padding: 0;
  border: 0;
}

.day-picker legend {
  margin-bottom: 5px;
  padding: 0;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
}

.day-chip {
  position: relative;
  padding: 5px 11px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.day-chip input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.day-chip:has(input:focus-visible) {
  outline: 2px solid var(--carbon);
  outline-offset: 2px;
}

.day-on {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.checklist-edit {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.checklist-edit li {
  display: flex;
  gap: 6px;
}

/* ----- dialogs */

.modal {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: var(--ink);
  box-shadow: 0 30px 70px -18px rgb(19 28 51 / 0.45);
}

.modal-wide {
  width: min(860px, calc(100vw - 24px));
}

.modal::backdrop {
  background: rgb(19 28 51 / 0.45);
}

.modal-frame {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 13px 13px 13px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-body {
  /* Keep positioned controls inside this scroll area, not the outer dialog. */
  position: relative;
  padding: 16px 18px;
  overflow-y: auto;
}

.modal-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
}

.preview-img {
  display: block;
  max-width: 100%;
  margin: 0 auto;
}

.toasts {
  inset: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
  position: fixed;
  z-index: 100;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(380px, calc(100vw - 36px));
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--night);
  color: #fff;
  box-shadow: var(--shadow-menu);
}

.toast-error {
  background: var(--danger);
}

.detail-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0;
}

.detail-list > div {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  gap: 10px;
}

.detail-list dt {
  color: var(--ink-3);
}

.detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.detail-list.compact {
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.detail-text {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--steel);
  white-space: pre-line;
}

.role-list > div {
  grid-template-columns: 130px minmax(0, 1fr);
}

/* ----- records side panels */

.note-form {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
}

.note-list,
.activity-list,
.file-list,
.site-list,
.plain-list,
.contact-list,
.checklist,
.attention {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.note-list {
  margin-top: 12px;
}

.note-list li {
  padding: 9px 0;
  border-top: 1px solid var(--steel-2);
}

.note-list p {
  white-space: pre-line;
}

.note-list footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 3px;
  color: var(--ink-3);
  font-size: 12.5px;
}

.activity-list {
  gap: 9px;
}

.activity-list small {
  color: var(--ink-3);
}

.file-list {
  gap: 2px;
}

.file-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--steel-2);
}

.file-list li > svg {
  flex: none;
  color: var(--ink-3);
}

.file-name {
  flex: 1;
  min-width: 100px;
  overflow-wrap: anywhere;
}

.file-list small {
  order: 5;
  width: 100%;
  padding-left: 24px;
  color: var(--ink-3);
}

.site-list {
  gap: 2px;
}

.site-list li {
  display: flex;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--steel-2);
}

.site-list li:last-child {
  border-bottom: 0;
}

.site-list li > svg {
  flex: none;
  margin-top: 2px;
  color: var(--ink-3);
}

.site-list li > div:nth-child(2) {
  flex: 1;
  min-width: 0;
}

.contact-list {
  gap: 7px;
}

.contact-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  overflow-wrap: anywhere;
}

.contact-list svg {
  flex: none;
  margin-top: 3px;
  color: var(--ink-3);
}

.plain-list {
  gap: 9px;
}

.checklist {
  gap: 8px;
}

.access-note {
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: var(--canary);
  color: var(--canary-ink);
  font-size: 13.5px;
}

.visit-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.visit-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--steel-2);
}

.visit-list li:last-child {
  border-bottom: 0;
}

.visit-when {
  min-width: 170px;
}

.visit-when small {
  display: block;
  color: var(--ink-3);
}

.visit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}

.visit-off {
  opacity: 0.5;
}

/* ----- site editing */

.site-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.pin-map {
  height: 320px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--steel-2);
}

.pin-icon span {
  display: block;
  width: 18px;
  height: 18px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--carbon);
  box-shadow: 0 1px 4px rgb(19 28 51 / 0.5);
}

/* ----- dashboard */

.dash {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dash-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.dash-head h1 {
  font-size: 34px;
}

/* The ticket: five connected stubs, perforated between stages, in the colours of the
   carbon copies each stage produces. */
.ticket {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  filter: drop-shadow(0 1px 1px rgb(19 28 51 / 0.1));
}

.ticket-part {
  --stub: var(--paper);
  --notch: 9px;
  position: relative;
  min-width: 0;
  background: radial-gradient(circle at 100% 50%, var(--steel) var(--notch), transparent calc(var(--notch) + 0.5px)) no-repeat,
    radial-gradient(circle at 0 50%, var(--steel) var(--notch), transparent calc(var(--notch) + 0.5px)) no-repeat, var(--stub);
}

.ticket-part + .ticket-part {
  border-left: 2px dashed rgb(22 35 59 / 0.28);
}

.ticket-part:first-child {
  border-radius: var(--radius) 0 0 var(--radius);
  background: radial-gradient(circle at 100% 50%, var(--steel) var(--notch), transparent calc(var(--notch) + 0.5px)) no-repeat, var(--stub);
}

.ticket-part:last-child {
  border-radius: 0 var(--radius) var(--radius) 0;
  background: radial-gradient(circle at 0 50%, var(--steel) var(--notch), transparent calc(var(--notch) + 0.5px)) no-repeat, var(--stub);
}

.ticket-requests {
  --stub: var(--paper);
}

.ticket-quotes {
  --stub: var(--canary);
}

.ticket-schedule {
  --stub: #d9e0fb;
}

.ticket-invoice {
  --stub: var(--goldenrod);
}

.ticket-paid {
  --stub: var(--pink);
}

.ticket-part > a {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 2px 8px;
  height: 100%;
  padding: 16px 20px 15px;
  color: var(--ink);
}

.ticket-part > a:hover {
  text-decoration: none;
  background: rgb(22 35 59 / 0.05);
}

.ticket-part > a > svg {
  grid-column: 2;
  grid-row: 1;
  color: var(--ink-2);
}

.ticket-value {
  grid-column: 1;
  grid-row: 1;
  font: 700 44px/0.95 var(--font-display-stack);
  letter-spacing: -0.01em;
}

.ticket-label {
  grid-column: 1 / -1;
  font-weight: 600;
}

.ticket-note {
  grid-column: 1 / -1;
  color: var(--ink-2);
}

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.today-board {
  --who: 186px;
}

.today-hours {
  position: relative;
  height: 18px;
  margin-left: var(--who);
  color: var(--ink-3);
  font-size: 12px;
}

.today-hours span {
  position: absolute;
  translate: -50% 0;
  white-space: nowrap;
}

.today-hours span:first-child {
  translate: 0 0;
}

.today-row {
  display: grid;
  grid-template-columns: var(--who) minmax(0, 1fr);
  align-items: center;
  min-height: 56px;
  border-top: 1px solid var(--steel-2);
}

.today-who {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding-right: 10px;
}

.today-who span:last-child {
  min-width: 0;
}

.today-who strong {
  display: block;
  font-weight: 600;
}

.today-who small {
  display: block;
  color: var(--ink-3);
}

.today-track {
  position: relative;
  height: 56px;
}

.hour-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--steel-2);
}

.now-line {
  position: absolute;
  z-index: 4;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--serial);
  pointer-events: none;
}

.today-block {
  position: absolute;
  top: 6px;
  bottom: 6px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 8px;
  padding: 1px 7px;
  border-left: 4px solid var(--tech);
  border-radius: 3px;
  background: color-mix(in srgb, var(--tech) 14%, white);
  color: var(--ink);
  overflow: hidden;
  font-size: 12.5px;
  line-height: 1.25;
  white-space: nowrap;
}

.today-block:hover {
  z-index: 3;
  text-decoration: none;
  background: color-mix(in srgb, var(--tech) 24%, white);
}

.today-block strong {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

.today-block span {
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
}

.today-unassigned {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: var(--danger);
}

.status-completed.today-block,
.status-completed.day-card,
.status-completed.week-card,
.status-completed.month-chip {
  background: repeating-linear-gradient(135deg, #f1f3f7, #f1f3f7 5px, #e7eaf1 5px, #e7eaf1 10px);
  border-left-color: color-mix(in srgb, var(--tech) 50%, #bcc6d5);
}

.status-in_progress.today-block,
.status-in_progress.day-card,
.status-in_progress.week-card {
  background: color-mix(in srgb, var(--tech) 30%, white);
  box-shadow: inset 0 0 0 1px var(--tech);
}

.attention {
  gap: 8px;
}

.attention li {
  display: flex;
  align-items: flex-start;
  gap: 7px;
}

.attention svg {
  flex: none;
  margin-top: 3px;
}

.attention-danger svg {
  color: var(--danger);
}

.attention-warn svg {
  color: var(--warn);
}

.money-big {
  font: 700 36px/1 var(--font-display-stack);
}

.money-compare {
  margin-top: 3px;
  color: var(--ink-2);
  font-size: 13.5px;
}

.spark {
  margin-top: 12px;
}

.spark-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 62px;
}

.spark-slot {
  display: flex;
  align-items: flex-end;
  flex: 1;
  height: 100%;
}

.spark-bar {
  width: 100%;
  border-radius: 3px 3px 0 0;
  background: #b9c4f0;
}

.spark-slot:hover .spark-bar {
  background: var(--carbon-dark);
}

.spark-now {
  background: var(--carbon);
}

.spark-note {
  display: block;
  margin-top: 5px;
  color: var(--ink-3);
}

/* ----- technician's day */

.field-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.field-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.field-card.status-in_progress {
  border-color: var(--orange);
  box-shadow: inset 4px 0 0 var(--orange);
}

.field-card.status-completed {
  background: #f7f8fb;
}

.field-time strong {
  display: block;
  font: 700 21px/1.1 var(--font-display-stack);
}

.field-time small {
  color: var(--ink-3);
}

.field-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
}

.field-main .strong {
  font-size: 16.5px;
}

.field-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  min-width: 134px;
}

.field-actions .badge {
  align-self: flex-end;
}

/* ----- schedule */

.schedule {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.schedule-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
}

.schedule-bar .tabs {
  margin: 0 0 0 auto;
}

.schedule-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.schedule-title {
  margin-left: 6px;
  font: 600 18px var(--font-display-stack);
}

.schedule-body {
  display: grid;
  grid-template-columns: 214px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.schedule-body-solo {
  grid-template-columns: minmax(0, 1fr);
}

.unscheduled {
  position: sticky;
  top: 70px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: calc(100vh - 92px);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.unscheduled-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 5px;
  overflow-y: auto;
}

.wait-card {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 10px;
  border: 1px solid var(--line-2);
  border-top: 4px solid var(--canary-deep);
  border-radius: 3px;
  background: #fffdf2;
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.3;
  text-align: left;
  cursor: grab;
  touch-action: none;
}

.wait-card:hover {
  border-color: var(--ink-3);
  border-top-color: var(--canary-deep);
}

.wait-card strong {
  font-weight: 600;
}

.wait-card small {
  color: var(--ink-3);
}

.wait-card em {
  font-style: normal;
  font-weight: 600;
  text-transform: capitalize;
}

.board-wrap {
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.row-label {
  position: sticky;
  left: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 170px;
  padding: 8px 10px;
  border-right: 1px solid var(--line);
  background: var(--paper);
}

.row-label strong {
  display: block;
  font-weight: 600;
  line-height: 1.2;
}

.row-label small {
  display: block;
  color: var(--ink-3);
  line-height: 1.2;
}

.day-board {
  width: max-content;
  min-width: 100%;
}

.day-head {
  position: sticky;
  top: 0;
  z-index: 7;
  display: flex;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.day-corner {
  position: sticky;
  left: 0;
  z-index: 8;
  flex: none;
  width: 170px;
  border-right: 1px solid var(--line);
  background: var(--paper);
}

.day-hours {
  display: flex;
  width: var(--board-width);
}

.day-hours span {
  flex: none;
  padding: 6px 0 6px 5px;
  border-left: 1px solid var(--steel-2);
  color: var(--ink-3);
  font-size: 12.5px;
}

.day-row {
  display: flex;
  border-bottom: 1px solid var(--line);
}

.day-row:last-child {
  border-bottom: 0;
}

.day-track {
  position: relative;
  flex: none;
  width: var(--board-width);
}

.drop-on {
  background: var(--carbon-wash) !important;
}

.drop-preview {
  position: absolute;
  top: 3px;
  bottom: 3px;
  border: 2px dashed var(--carbon);
  border-radius: 4px;
  pointer-events: none;
}

.day-card,
.week-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 3px 7px;
  border: 0;
  border-left: 4px solid var(--tech);
  border-radius: 3px;
  background: color-mix(in srgb, var(--tech) 14%, white);
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  line-height: 1.25;
  text-align: left;
  cursor: grab;
  touch-action: none;
  overflow: hidden;
}

.day-card {
  position: absolute;
  z-index: 2;
  height: 57px;
}

.day-card:hover,
.week-card:hover {
  background: color-mix(in srgb, var(--tech) 24%, white);
}

.day-card strong,
.week-card strong {
  width: 100%;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-top {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-2);
  white-space: nowrap;
}

.card-sub {
  width: 100%;
  overflow: hidden;
  color: var(--ink-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-resize {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 8px;
  cursor: ew-resize;
}

.card-resize:hover {
  background: rgb(22 35 59 / 0.15);
}

.status-completed.day-card,
.status-completed.week-card,
.status-completed.month-chip {
  cursor: default;
}

.dragging {
  opacity: 0.3;
}

.drag-ghost {
  position: fixed;
  z-index: 200;
  display: flex;
  flex-direction: column;
  padding: 6px 10px;
  border-left: 4px solid var(--carbon);
  border-radius: 4px;
  background: var(--paper);
  box-shadow: var(--shadow-menu);
  font-size: 13px;
  rotate: 1.5deg;
  pointer-events: none;
}

.drag-ghost strong {
  font-weight: 600;
}

.drag-ghost span {
  color: var(--ink-2);
}

.week-board {
  min-width: 880px;
}

.week-row {
  display: grid;
  grid-template-columns: 150px repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.week-row:last-child {
  border-bottom: 0;
}

.week-head {
  position: sticky;
  top: 0;
  z-index: 7;
  background: var(--paper);
}

.week-row .row-label {
  width: 150px;
}

.week-corner {
  position: sticky;
  left: 0;
  border-right: 1px solid var(--line);
  background: var(--paper);
}

.week-day {
  padding: 7px 8px;
  border-right: 1px solid var(--steel-2);
  color: var(--ink-2);
  font-size: 13px;
}

.week-day strong {
  color: var(--ink);
  font-size: 15px;
}

.week-day.week-today {
  background: var(--canary);
}

.week-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 74px;
  padding: 4px;
  border-right: 1px solid var(--steel-2);
}

.week-cell:last-child,
.week-day:last-child {
  border-right: 0;
}

.week-cell.week-today {
  background: #fffdf1;
}

.week-card {
  flex: none;
  width: 100%;
  min-width: 0;
}

.month-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  min-width: 910px;
}

.month-name {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
}

.month-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 106px;
  padding: 4px;
  border-right: 1px solid var(--steel-2);
  border-bottom: 1px solid var(--steel-2);
}

.month-cell.week-today {
  background: #fffdf1;
}

.month-out {
  background: #f7f8fb;
}

.month-out .month-date {
  color: var(--ink-3);
}

.month-date {
  align-self: flex-start;
  padding: 0 5px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--ink);
  font: 600 13px var(--font-body-stack);
  cursor: pointer;
}

.month-date:hover {
  background: var(--steel-2);
}

.month-chip {
  width: 100%;
  padding: 1px 5px;
  border: 0;
  border-left: 3px solid var(--tech);
  border-radius: 2px;
  background: color-mix(in srgb, var(--tech) 14%, white);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: grab;
  touch-action: none;
}

.month-more {
  padding-left: 5px;
  font-size: 12px;
}

/* ----- map */

.content:has(> .map-layout) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-width: none;
  padding: 12px;
}

/* The map fills the screen below the top bar and any banner (free trial, practice mode). */
.main:has(> .content > .map-layout) {
  height: 100dvh;
}

.map-layout {
  --map-site: #99511c;
  --map-visit: #68429e;
  --map-crew: #4e6078;
  --map-office: #153e59;
  --map-route-start: #00685b;
  --map-route-stop: #253f85;
  --map-route-end: #7d3463;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas:
    "map date"
    "map side";
  gap: 12px;
  flex: 1;
  min-height: 420px;
}

.map-stage {
  position: relative;
  grid-area: map;
  min-width: 0;
}

.map-load-status {
  position: absolute;
  top: 12px;
  right: 12px;
  left: 55px;
  z-index: 1;
  margin: 0;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.map-site-search > .input {
  flex: 1;
  min-width: 0;
}

.map-site-range {
  margin: 10px 0 6px;
  color: var(--ink-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.map-site-pagination {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: var(--radius-sm);
  background: var(--steel);
  text-align: center;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.map-site-pagination [aria-disabled="true"] {
  opacity: 0.5;
  cursor: default;
}

.map-date {
  grid-area: date;
  justify-content: center;
}

.crew-map {
  height: 100%;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: #e8ebf1;
  background-image: linear-gradient(#dde2eb 1px, transparent 1px), linear-gradient(90deg, #dde2eb 1px, transparent 1px);
  background-size: 48px 48px;
  overflow: hidden;
  z-index: 0;
}

.crew-map-marker > div {
  position: absolute;
  white-space: nowrap;
}

.crew-site-pin::before,
.crew-site-pin::after {
  position: absolute;
  content: "";
}

.crew-site-pin::before {
  top: 2px;
  left: 5px;
  width: 18px;
  height: 18px;
  box-sizing: border-box;
  border: 2px solid #fff;
  border-radius: 50% 50% 50% 0;
  background: var(--site-pin-color, var(--map-site));
  transform: rotate(-45deg);
  box-shadow: 0 2px 4px #13284080;
}

.crew-site-pin::after {
  top: 8px;
  left: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}

.crew-map .crew-site-cluster {
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #334b68;
  color: #fff;
  font: 700 12px var(--font-body-stack);
  box-shadow: 0 1px 5px #13284080;
}

.map-side {
  grid-area: side;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  padding-inline-end: 4px;
}

.map-side section {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.map-side h2 {
  margin-bottom: 8px;
}

.crew-list,
.stop-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.crew-list li {
  display: flex;
  align-items: center;
  gap: 4px;
  border-top: 1px solid var(--steel-2);
}

.crew-day-route {
  flex-shrink: 0;
}

.crew-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  flex: 1;
  min-width: 0;
  padding: 8px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.crew-row:disabled {
  cursor: default;
}

.crew-row:not(:disabled):hover strong {
  color: var(--carbon);
}

.crew-text {
  min-width: 0;
}

.crew-text strong {
  display: block;
  font-weight: 600;
}

.crew-text small {
  display: block;
  color: var(--ink-2);
  line-height: 1.3;
}

.stop-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 2px 8px;
  padding: 7px 0;
  border-top: 1px solid var(--steel-2);
}

.stop-time {
  min-width: 52px;
  font-weight: 600;
}

.stop-text {
  flex: 1;
  min-width: 140px;
}

.stop-text small {
  display: block;
  color: var(--ink-3);
}

.job-pin-mark {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid rgb(255 255 255 / 0.85);
  border-radius: 99px;
  background: #fff;
  color: #29263b;
  font: 600 11.5px/1.5 var(--font-body-stack);
  white-space: nowrap;
  box-shadow: 0 2px 8px rgb(11 23 39 / 0.5);
}

.job-pin-mark::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tech, var(--map-visit));
}

.job-pin-mark.status-completed {
  background: #eaf4ef;
  color: #265443;
}

.job-pin-mark.status-completed::before {
  background: #328467;
}

.job-pin-mark.status-in_progress {
  background: #57358b;
  color: #fff;
}

.job-pin-mark.status-in_progress::before {
  background: #e5cdfc;
}

.crew-pin span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  font: 700 12px var(--font-body-stack);
  box-shadow: 0 2px 8px rgb(19 28 51 / 0.5);
}

.viewer-pin {
  z-index: 1;
  width: 22px;
  height: 22px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #1679ee;
  box-shadow: 0 0 0 7px rgb(66 169 255 / 0.38), 0 2px 10px rgb(9 32 66 / 0.75);
}

.viewer-pin span {
  position: absolute;
  top: 24px;
  left: 50%;
  padding: 3px 7px;
  transform: translateX(-50%);
  border-radius: 99px;
  background: #123a67;
  color: #fff;
  font: 700 11px/1 var(--font-body-stack);
  box-shadow: 0 1px 4px rgb(9 32 66 / 0.4);
}

.viewer-pin[hidden] {
  display: none;
}

.office-pin {
  display: grid;
  place-items: center;
  padding: 0 12px;
  height: 38px;
  border: 2px solid #fff;
  border-radius: 12px;
  background: var(--map-office);
  color: #fff;
  box-shadow: 0 3px 9px #13284080;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  z-index: 2;
}

.office-pin::after {
  position: absolute;
  bottom: -7px;
  left: calc(50% - 6px);
  width: 12px;
  height: 12px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  background: var(--map-office);
  transform: rotate(45deg);
  content: "";
}

.route-waypoint {
  --pin-color: var(--map-route-stop);
  z-index: 2;
  padding-bottom: 6px;
  filter: drop-shadow(0 3px 4px rgb(11 23 39 / 0.55));
}

.route-waypoint--start { --pin-color: var(--map-route-start); }
.route-waypoint--end { --pin-color: var(--map-route-end); }

.route-waypoint::after {
  content: "";
  position: absolute;
  bottom: 3px;
  left: calc(50% - 4px);
  width: 8px;
  height: 8px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  background: var(--pin-color);
  transform: rotate(45deg);
}

.route-pin-number {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 4px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--pin-color);
  color: #fff;
  font: 750 13px/1 var(--font-body-stack);
  font-variant-numeric: tabular-nums;
}

.route-waypoint--start .route-pin-number,
.route-waypoint--end .route-pin-number {
  min-width: 34px;
  height: 34px;
  font-size: 14px;
}

.route-waypoint--location .route-pin-number {
  box-shadow: 0 0 0 4px rgb(107 234 204 / 0.6);
}

/* ----- reports */

.report-filters .field {
  flex-direction: row;
  align-items: center;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.chip {
  padding: 5px 12px;
  border: 1px solid var(--line-2);
  border-radius: 99px;
  background: var(--paper);
  color: var(--ink-2);
  font: 500 13.5px var(--font-body-stack);
  cursor: pointer;
}

.chip:hover {
  border-color: var(--ink-3);
}

.chip-on,
.chip-on:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.span-2 {
  grid-column: 1 / -1;
}

.report-kpis {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.kpi {
  display: flex;
  flex-direction: column;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.kpi span {
  color: var(--ink-2);
  font-size: 13.5px;
}

.kpi strong {
  font: 700 28px/1.15 var(--font-display-stack);
}

.kpi small {
  color: var(--ink-3);
}

.chart {
  margin: 0;
}

.chart-legend {
  display: flex;
  gap: 16px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
  color: var(--ink-2);
  font-size: 13.5px;
}

.chart-legend li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-legend span {
  width: 11px;
  height: 11px;
  border-radius: 2px;
}

.chart-frame {
  position: relative;
}

.chart-frame svg {
  display: block;
  width: 100%;
  height: auto;
}

.chart-grid {
  stroke: var(--steel-2);
  stroke-width: 1;
}

.chart-tick {
  fill: var(--ink-3);
  font: 12px var(--font-body-stack);
}

.chart-tip {
  position: absolute;
  top: 4px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: var(--night);
  color: #fff;
  font-size: 13px;
  white-space: nowrap;
  pointer-events: none;
  translate: -50% 0;
}

.chart-tip span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-tip i {
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

.chart-table {
  margin-top: 8px;
}

.chart-table summary {
  color: var(--carbon);
  cursor: pointer;
  font-size: 13.5px;
}

.bars {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) 92px;
  align-items: center;
  gap: 10px;
}

.bar-label {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.bar-label small {
  display: block;
  color: var(--ink-3);
}

.bar-track {
  height: 11px;
  border-radius: 4px;
  background: var(--steel);
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: 0 4px 4px 0;
}

.bar-value {
  text-align: right;
  font-weight: 600;
}

.settings-body {
  max-width: 880px;
}

/* ----- sign-in */

.auth {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  min-height: 100vh;
}

.auth-art {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 26px;
  padding: 34px 46px;
  background: var(--night);
  color: #fff;
}

.auth-brand {
  font: 700 24px var(--font-display-stack);
}

.auth-ticket {
  max-width: 400px;
  padding: 24px 28px;
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  rotate: -1.4deg;
  box-shadow: 0 24px 50px -18px rgb(0 0 0 / 0.6);
  border-top: 7px solid var(--canary-deep);
}

.auth-ticket-title {
  margin-bottom: 14px;
  font: 700 25px/1.1 var(--font-display-stack);
}

.auth-ticket ol {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.auth-ticket li {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink-3);
  font-weight: 500;
}

.auth-ticket li span {
  width: 15px;
  height: 15px;
  border: 1.5px solid var(--line-2);
  border-radius: 50%;
}

.auth-ticket li.punched {
  color: var(--ink);
}

.auth-ticket li.punched span {
  border-color: var(--night);
  background: var(--night);
}

.auth-ticket li.current {
  color: var(--ink);
  font-weight: 700;
}

.auth-ticket li.current span {
  border: 2.5px solid var(--night);
  background: var(--canary-deep);
}

.auth-line {
  max-width: 420px;
  color: #c8d0e2;
  font-size: 17px;
}

.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: var(--paper);
}

.auth-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: min(100%, 400px);
}

.auth-alt {
  color: var(--ink-2);
}

.demo-accounts {
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.demo-accounts h2 {
  margin-bottom: 8px;
  font-size: 15px;
}

.demo-accounts ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.demo-account {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 8px 11px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}

.demo-account:hover {
  border-color: var(--carbon);
  background: var(--carbon-wash);
}

.demo-account small {
  color: var(--ink-3);
}

/* ----- customer-facing pages */

.portal {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: min(100%, 820px);
  margin: 0 auto;
  padding: 26px 16px 50px;
}

.portal-narrow {
  width: min(100%, 580px);
}

.portal-answer h2 {
  margin-bottom: 6px;
}

.portal-print {
  justify-content: center;
}

/* the customer portal (notes-tasks/41) */
.portal-business {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 10px;
  border-top: 4px solid var(--ink-3);
}

.portal-logo {
  max-height: 40px;
  width: auto;
}

.portal-business-name {
  font-size: 1.15rem;
}

.portal-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.portal-list > li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.portal-list > li:first-child {
  border-top: 0;
}

.portal-list p {
  margin: 2px 0 0;
  color: var(--ink-3);
}

.portal-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-top: 12px;
}

.sent-note {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 0;
  text-align: center;
  color: var(--ok);
}

.sent-note h1 {
  color: var(--ink);
}

.sent-note p {
  color: var(--ink-2);
}

/* ----- small screens */

@media (max-width: 1180px) {
  .two-col,
  .dash-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .map-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    grid-template-areas: "date" "map" "side";
    flex: none;
    min-height: 0;
  }

  .main:has(> .content > .map-layout) {
    height: auto;
  }

  .crew-map {
    height: 60dvh;
  }

  .map-side {
    overflow: visible;
    padding-inline-end: 0;
  }
}

@media (max-width: 960px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    z-index: 60;
    top: 0;
    left: 0;
    width: 260px;
    translate: -100% 0;
    transition: translate 0.18s ease;
  }

  .sidebar-open {
    translate: 0 0;
  }

  .sidebar-scrim {
    position: fixed;
    z-index: 55;
    inset: 0;
    display: block;
    border: 0;
    background: rgb(19 28 51 / 0.45);
  }

  .menu-toggle {
    display: inline-flex;
  }

  .ticket {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    filter: none;
  }

  .ticket-part,
  .ticket-part:first-child,
  .ticket-part:last-child {
    border-left: 0 !important;
    border-radius: var(--radius);
    background: var(--stub);
  }

  .ticket-part:last-child {
    grid-column: 1 / -1;
  }

  .report-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-art {
    display: none;
  }
}

@media (max-width: 760px) {
  .content {
    padding: 16px 14px 50px;
  }

  .topbar {
    padding: 0 10px;
    gap: 6px;
  }

  .search kbd,
  .timer-job {
    display: none;
  }

  .timer {
    gap: 4px;
    padding-inline: 7px 2px;
    font-size: 12px;
  }

  h1,
  .dash-head h1 {
    font-size: 26px;
  }

  .form-grid,
  .form-grid-3,
  .site-editor {
    grid-template-columns: minmax(0, 1fr);
  }

  .schedule-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .unscheduled {
    position: static;
    max-height: 260px;
  }

  .field-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
  }

  .field-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .stub {
    flex-wrap: wrap;
  }

  .stub-stage {
    min-width: 84px;
  }

  .stub-stage-pair {
    min-width: 96px;
  }

  .stub-label {
    padding-inline: 3px;
    overflow-wrap: anywhere;
    font-size: 11px;
  }

  .line-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  }

  .line-main {
    grid-column: 1 / -1;
  }

  .line-amount {
    grid-column: 1 / 3;
    padding-top: 0;
    text-align: left;
  }

  .line-row .icon-btn {
    margin-top: 0;
  }

  .today-board {
    --who: 112px;
  }

  .today-who small,
  .today-who .avatar {
    display: none;
  }

  .sheet {
    padding: 16px 14px;
  }

  .bar-row {
    grid-template-columns: minmax(0, 1.2fr) 74px;
  }

  .bar-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

@media print {
  body {
    background: #fff;
  }

  .sidebar,
  .topbar,
  .demo-banner,
  .page-actions,
  .back-link,
  .stub,
  .no-print,
  .toasts {
    display: none !important;
  }

  .shell,
  .two-col {
    display: block;
  }

  .content {
    padding: 0;
    max-width: none;
  }

  .page-head {
    display: none;
  }

  /* Quotes, invoices and work orders print on letter paper with the PDF's margins.
     A named page, so other printouts (reports) keep the browser's orientation choice. */
  @page document {
    size: letter;
    margin: 14mm 12mm;
  }

  body:has(.sheet) {
    page: document;
  }

  .sheet {
    border: 0;
    padding: 0;
    background: #fff;
  }

  .panel:not(:has(.sheet)) {
    display: none;
  }
}

/* ----- smart tables */

.dt-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.dt-bar .input-icon {
  flex: 1;
  min-width: 180px;
  max-width: 320px;
}

.dt-bar select.input {
  width: auto;
  min-width: 130px;
  max-width: 100%;
}

.dt-spacer {
  flex: 1;
}

.invoice-matching-lines {
  margin-top: 4px;
  overflow-wrap: anywhere;
}

/* A filter sidebar of boxes beside the list. On a phone the sidebar
   sits above the list, hidden until Show filters. */
.catalog-layout {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  min-width: 0;
}

.catalog-results {
  min-width: 0;
}

.catalog-filters {
  min-width: 0;
  padding: 14px 12px 20px;
  border-right: 1px solid var(--line);
  background: var(--steel);
  border-radius: var(--radius) 0 0 var(--radius);
}

.catalog-filters-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 2px 4px 12px;
}

.catalog-filters-head h2 {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
}

.catalog-filters-toggle {
  display: none;
}

.catalog-filters-clear {
  font-size: 0.875rem;
}

.catalog-filters-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 1px 2px rgb(19 28 51 / 6%);
}

.filter-section > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.filter-section > summary::-webkit-details-marker {
  display: none;
}

.filter-section > summary h3 {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
}

.filter-section > summary svg {
  flex: none;
  color: var(--ink-3);
  transition: transform 0.15s;
}

.filter-section:not([open]) > summary svg {
  transform: rotate(-90deg);
}

.filter-section-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 12px 12px;
  border-top: 1px solid var(--steel-2);
  padding-top: 10px;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 260px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.filter-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 2px;
  font-size: 0.9375rem;
  cursor: pointer;
}

.filter-option input {
  flex: none;
  margin-top: 3px;
}

.filter-option-label {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.filter-option-count {
  flex: none;
  color: var(--ink-3);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.filter-option-empty {
  color: var(--ink-3);
  cursor: default;
}

.filter-option-empty .filter-option-label {
  text-decoration: line-through;
}

.filter-range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}

.filter-range .input,
.filter-section-search {
  width: 100%;
  min-width: 0;
}

.filter-hint {
  margin: 0;
  color: var(--ink-3);
  font-size: 0.8125rem;
}

@media (max-width: 960px) {
  .catalog-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .catalog-filters {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    border-radius: var(--radius) var(--radius) 0 0;
  }

  .catalog-filters-head {
    margin-bottom: 0;
  }

  .catalog-filters.is-open .catalog-filters-head {
    margin-bottom: 12px;
  }

  .catalog-filters-head h2 {
    display: none;
  }

  .catalog-filters-toggle {
    display: inline-flex;
  }

  .catalog-filters:not(.is-open) .catalog-filters-body {
    display: none;
  }
}

.dt-result-note {
  margin: 0;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.875rem;
}

.dt-menu-box {
  position: relative;
}

.dt-columns {
  top: calc(100% + 4px);
  right: 0;
  width: 220px;
  max-height: 320px;
  overflow-y: auto;
  gap: 4px;
  padding: 8px 10px;
}

.dt-bulk {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--carbon-wash);
  border-bottom: 1px solid var(--line);
}

.dt-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.dt-sort:hover {
  color: var(--ink);
}

.dt-check {
  width: 34px;
  padding-right: 0 !important;
}

.dt-check input {
  width: 15px;
  height: 15px;
  accent-color: var(--carbon);
}

.dt-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 14px;
  padding: 9px 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13.5px;
}

.dt-foot select.input {
  width: auto;
  min-height: 30px;
  padding: 2px 6px;
  font-size: 13.5px;
}

/* ----- picking a record, with add and edit in place */

.rp {
  position: relative;
  display: flex;
  gap: 5px;
  align-items: stretch;
}

.rp-box {
  position: relative;
  flex: 1;
  min-width: 0;
}

.rp-box .input {
  padding-right: 30px;
}

.rp-clear {
  position: absolute;
  top: 50%;
  right: 3px;
  translate: 0 -50%;
  width: 26px;
  height: 26px;
}

.rp-menu {
  top: calc(100% + 3px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
}

.rp-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.rp-option small {
  color: var(--ink-3);
}

.rp-option[aria-selected='true'] {
  background: var(--carbon-wash);
}

.rp-btn {
  width: 38px;
  height: auto;
  min-height: 38px;
  border: 1px solid var(--line-2);
  background: var(--paper);
}

.record-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: 100%;
}

.record-link .icon-btn {
  width: 22px;
  height: 22px;
  color: var(--ink-3);
}
/* ===== from css/records.css ===== */
/* ----- customers, job sites, products and vendor orders */

.record-image {
  display: block;
  flex: none;
  object-fit: cover;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--carbon-wash);
}

.record-image-medium {
  width: 72px;
  height: 72px;
}

.record-image-small {
  width: 40px;
  height: 40px;
}

.record-image-small svg {
  width: 18px;
  height: 18px;
}

.product-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.product-grid-select.check-field {
  margin: 14px 14px 0;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  padding: 14px;
}

.product-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  display: flex;
  flex-direction: column;
}

.product-card-image .record-image {
  width: 100%;
  max-width: none;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 0;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.product-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  overflow-wrap: anywhere;
}

.product-card-summary small {
  display: block;
  margin-top: 4px;
  color: var(--ink-2);
}

.product-card-details {
  display: grid;
  gap: 8px;
  margin: 0;
  font-size: 13px;
}

.product-card-details > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 8px;
}

.product-card-details dt {
  color: var(--ink-2);
}

.product-card-details dd {
  min-width: 0;
  margin: 0;
}

.product-card-price dd {
  font-size: 16px;
  font-weight: 700;
}

.product-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

@media (max-width: 1200px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
  .product-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Product cards used to add and replace document lines. */
.product-browser {
  width: min(1140px, calc(100vw - 24px));
}

.product-browser .modal-frame {
  max-height: calc(100dvh - 32px);
}

.product-browser [hidden] {
  display: none;
}

.product-browser-search {
  padding: 12px 18px 0;
}

.product-browser-results > p {
  color: var(--ink-2);
  margin: 0 0 10px;
}

/* Suppliers' parts not used yet, under the products while something is typed. */
.product-browser-suppliers {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.product-browser-suppliers h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  font-size: 14px;
}

.product-browser-suppliers > p {
  color: var(--ink-2);
  margin: 0 0 10px;
}

.product-browser-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.product-browser-pages {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.product-choice {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
}

.product-choice:has(input:checked) {
  border-color: var(--carbon);
  box-shadow: 0 0 0 1px var(--carbon);
  background: var(--carbon-wash);
}

.product-choice-label {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 5px;
  padding: 0 10px 10px;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.product-choice-photo {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  margin: 0 -10px 4px;
  overflow: hidden;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--carbon-wash);
}

.product-choice-photo img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
}

.product-choice-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--ink-2);
}

.product-choice-name {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.product-choice-name input {
  flex: none;
  accent-color: var(--carbon);
}

.product-choice-label small {
  color: var(--ink-2);
}

.product-choice-label small:empty {
  display: none;
}

.product-choice-description {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-choice-price {
  margin-top: auto;
  font-weight: 700;
}

.product-choice > .btn {
  align-self: start;
  margin: 0 10px 10px;
}

.product-browser .modal-foot [role="status"] {
  align-self: center;
  margin-inline-end: auto;
}

.product-browser-preview img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 65dvh;
  margin: 12px auto 0;
  object-fit: contain;
}

@media (max-width: 920px) {
  .product-browser-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .product-browser-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 340px) {
  .product-browser-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Suppliers' items not used yet, under the products. */
.product-catalog-head th {
  background: var(--steel);
  font-weight: 600;
  text-align: left;
}

.product-catalog-head th svg {
  vertical-align: -2px;
  margin-right: 4px;
}

.product-catalog-item td {
  vertical-align: middle;
}

/* The heading it was under on the price list, in the Category column, until it's sorted. */
.product-catalog-section {
  display: -webkit-box;
  max-width: 220px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--ink-2);
}

/* The same, as cards: a heading over their own grid. */
.product-catalog-cards-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--steel);
  font-size: 13px;
}

.product-catalog-card .product-catalog-mark {
  display: grid;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  border: 0;
  border-bottom: 1px dashed var(--line-2);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.product-catalog-card .product-card-summary .badge {
  margin-top: 4px;
}

.product-catalog-mark {
  display: grid;
  flex: none;
  place-items: center;
  border: 1px dashed var(--line-2);
  background: var(--steel);
  color: var(--ink-3);
}

.record-image-large {
  width: 100%;
  max-width: 320px;
  height: 180px;
}

.record-image-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--carbon, #2742c4);
  border-style: dashed;
}

.record-photo {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.image-picker {
  display: flex;
  align-items: center;
  gap: 14px;
}

.image-picker-button {
  cursor: pointer;
}

.image-picker-button.is-busy {
  opacity: 0.6;
  pointer-events: none;
}

.match-box {
  padding: 10px 13px;
  border: 1px solid var(--canary-deep);
  border-radius: var(--radius-sm);
  background: var(--canary);
  color: var(--canary-ink);
}

.match-box ul {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.match-box li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
}

.match-box small {
  display: block;
}

.record-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
}

.record-banner > div {
  flex: 1;
  min-width: 0;
}

.record-banner > svg {
  flex: none;
  margin-top: 2px;
}

.record-banner-overdue {
  background: var(--danger-wash);
  color: var(--danger);
}

.record-banner-outstanding {
  background: var(--warn-wash);
  color: var(--warn);
}

.record-banner-links {
  margin: 5px 0 0;
  padding: 0;
  list-style: none;
}

.record-banner-links a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
}

.quick-pick {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 4px;
  margin: -2px -4px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.quick-pick svg {
  flex: none;
  opacity: 0.45;
}

.quick-pick:hover {
  background: var(--carbon-wash);
}

.quick-pick:hover svg {
  opacity: 1;
}

.quick-field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.quick-field > .field {
  width: 100%;
}

.panel-note {
  padding: 14px 16px;
}
/* ===== from css/documents.css ===== */
/* Quotes, work orders, invoices, sharing and email. */

/* A document line: a numbered card. The head picks the product and group; the body
   holds what the customer reads, then the money in one row of fixed-width boxes. */
.doc-lines {
  display: flex;
  flex-direction: column;
  gap: 12px;
  counter-reset: doc-line;
}

.doc-line {
  counter-increment: doc-line;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  overflow: hidden;
}

.doc-line:focus-within {
  border-color: var(--line-2);
  box-shadow: 0 1px 6px rgb(19 28 51 / 0.07);
}

.doc-line-head {
  display: flex;
  align-items: end;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--steel);
}

.doc-line-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-width: 26px;
  height: 26px;
  margin-bottom: 6px;
  padding: 0 6px;
  border-radius: 13px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.doc-line-num::before {
  content: counter(doc-line);
}

.doc-line-product {
  flex: 1 1 280px;
}

.doc-line-group {
  flex: 0 1 220px;
}

.doc-line-remove {
  margin-bottom: 3px;
}

.doc-line-remove:hover {
  background: var(--danger-wash);
  color: var(--danger);
}

.doc-line-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
}

.doc-line-text {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 10px;
}

.doc-line-name {
  font-weight: 600;
}

.doc-line-body .field label,
.doc-line-total .label-like {
  color: var(--ink-3);
  font-size: 12.5px;
}

.doc-line-money {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}

.doc-line-qty {
  flex: 0 0 80px;
}

.doc-line-dollars {
  flex: 0 0 120px;
}

.doc-line-markup {
  flex: 0 0 96px;
}

.doc-line-tax {
  flex: 0 1 170px;
  min-width: 130px;
}

.doc-line-total {
  display: flex;
  flex-direction: column;
  align-items: end;
  gap: 5px;
  margin-left: auto;
  padding-left: 12px;
}

.doc-line-total .line-amount {
  min-height: 38px;
  padding: 0;
  display: flex;
  align-items: center;
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* A "$" before or "%" after the number, inside the box. */
.affix {
  position: relative;
  display: block;
}

.affix::before,
.affix::after {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  color: var(--ink-3);
  font-size: 14px;
  pointer-events: none;
}

.affix[data-before]::before {
  content: attr(data-before);
  left: 10px;
}

.affix[data-before] .input {
  padding-left: 22px;
}

.affix[data-after]::after {
  content: attr(data-after);
  right: 10px;
}

.affix[data-after] .input {
  padding-right: 26px;
}

.lines .line-group th {
  text-align: left;
  padding-top: 12px;
  font-weight: 600;
}

@media (max-width: 640px) {
  .doc-line-head {
    flex-wrap: wrap;
  }

  .doc-line-num {
    order: -1;
  }

  .doc-line-remove {
    margin-left: auto;
    order: -1;
  }

  .doc-line-product,
  .doc-line-group {
    flex: 1 1 100%;
  }

  .doc-line-text {
    grid-template-columns: minmax(0, 1fr);
  }

  .doc-line-qty,
  .doc-line-dollars,
  .doc-line-markup,
  .doc-line-tax {
    flex: 1 1 calc(50% - 5px);
    min-width: 0;
  }

  .doc-line-total {
    flex: 1 1 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0 0;
    border-top: 1px dashed var(--line);
  }

  .doc-line-total .line-amount {
    grid-column: auto;
    min-height: 0;
  }
}

.staged {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preview-pdf {
  display: block;
  width: 100%;
  height: 70vh;
  border: 1px solid var(--line);
}

.preview-video {
  display: block;
  width: 100%;
  max-height: 70vh;
}

.token-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.token-btn {
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.token-btn:hover {
  border-color: currentColor;
}

.token-btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 1px;
}

.mail-preview summary {
  cursor: pointer;
}

.pre-line {
  white-space: pre-line;
}

.notice-line {
  padding: 10px 12px;
  border-left: 3px solid var(--warn);
  background: var(--warn-wash);
}

.notice-line-info {
  margin-bottom: 18px;
  border-color: var(--carbon);
  background: var(--carbon-wash);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-tile {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.stat-tile strong {
  display: block;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.stat-tile small {
  display: block;
}

.quick-select {
  max-width: 170px;
  padding-top: 3px;
  padding-bottom: 3px;
}

/* The risk tag in a work order's page head, with its refresh and "how" buttons */
.risk-tag {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 8px;
  vertical-align: middle;
}

.risk-tag .risk-refresh {
  display: contents;
}

.risk-btn {
  width: 26px;
  height: 26px;
}

.risk-why > summary {
  list-style: none;
}

.risk-why > summary::-webkit-details-marker {
  display: none;
}

.risk-why-menu {
  top: calc(100% + 4px);
  left: 0;
  width: min(360px, calc(100vw - 32px));
  gap: 4px;
}

.risk-lines {
  margin: 0;
  padding: 4px 9px 0;
  list-style: none;
}

.risk-lines li {
  display: flex;
  gap: 10px;
  padding: 3px 0;
}

.risk-points {
  flex: none;
  min-width: 34px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.risk-lines .risk-total {
  margin-top: 4px;
  border-top: 1px solid var(--line);
  padding-top: 7px;
}

@media (max-width: 760px) {
  .risk-tag {
    display: flex;
    width: fit-content;
    margin: 6px 0 0;
  }
}

.hours-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
/* ===== from css/field.css ===== */
/* Check-ins, todos, notes, notifications, recurring work, the dashboard's personal
   cards, and the schedule and map additions. */

/* ----- rich text */

.rich-text {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.rich-text p {
  margin: 0 0 4px;
}

.rich-text ul,
.rich-text ol {
  margin: 4px 0;
  padding-left: 22px;
  white-space: normal;
}

.rich-text a {
  color: var(--carbon);
  text-decoration: underline;
}

.rich-text-cell {
  display: -webkit-box;
  max-width: 460px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.field-label {
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
}

.rte {
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.rte:focus-within {
  border-color: var(--carbon);
  box-shadow: 0 0 0 2px var(--carbon-wash);
}

.rte-tools {
  display: flex;
  gap: 2px;
  padding: 3px 4px;
  border-bottom: 1px solid var(--line);
}

.rte-link {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-bottom: 1px solid var(--line);
  background: var(--steel);
}

.rte-link .input {
  flex: 1 1 160px;
  min-width: 0;
}

.rte-link .field-error {
  flex-basis: 100%;
  margin: 0;
}

.rte-box {
  min-height: 72px;
  padding: 8px 10px;
  outline: none;
  font-size: 14.5px;
}

.rte-box:empty::before {
  content: attr(data-placeholder);
  color: var(--ink-3);
}

.note-form-rich {
  align-items: stretch;
}

.note-form-rich > .btn {
  align-self: flex-end;
}

.note-list .rich-text {
  margin-bottom: 4px;
}

/* ----- the notification bell */

.bell {
  position: relative;
}

.bell-btn {
  position: relative;
}

.bell-count {
  position: absolute;
  top: -3px;
  right: -4px;
  min-width: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--serial);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}

.bell-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 60;
  width: min(360px, calc(100vw - 24px));
  max-height: 70vh;
  overflow-y: auto;
}

.bell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

.bell-item {
  align-items: flex-start;
  width: 100%;
  text-align: left;
}

.bell-unread {
  background: var(--carbon-wash);
  font-weight: 600;
}

.bell-item small {
  display: block;
  font-weight: 400;
}

.notice-unread {
  font-weight: 600;
}

/* ----- Visits to confirm: the call list for the days ahead */

.confirm-dates,
.confirm-filters {
  align-items: flex-end;
}

.confirm-dates {
  margin-bottom: 14px;
}

.confirm-filters > .btn {
  min-height: 38px;
}

.confirm-rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.confirm-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: start;
  gap: 4px 12px;
  padding: 11px 16px;
}

.confirm-row + .confirm-row {
  border-top: 1px solid var(--line);
}

.confirm-pick {
  margin-top: 3px;
}

.confirm-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.confirm-main p {
  margin: 0;
}

.confirm-main small,
.confirm-state small {
  color: var(--ink-3);
}

.confirm-state {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  text-align: right;
}

@media (max-width: 760px) {
  .confirm-row {
    grid-template-columns: 22px minmax(0, 1fr);
  }

  .confirm-state {
    grid-column: 2;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    text-align: left;
  }
}

/* ----- the todos dropdown beside the bell */

.todo-menu-add {
  display: flex;
  gap: 6px;
  padding: 8px 9px;
  border-bottom: 1px solid var(--line);
}

.todo-menu-add .input {
  flex: 1;
  min-width: 0;
}

.todo-menu-alert {
  color: var(--danger);
}

.todo-menu-list {
  margin: 0;
  padding: 4px 0;
  list-style: none;
}

.todo-menu-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 7px 9px;
}

.todo-menu-item + .todo-menu-item {
  border-top: 1px solid var(--line);
}

.todo-menu-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  gap: 2px;
}

.todo-menu-text {
  color: var(--ink);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.todo-menu-body small {
  color: var(--ink-3);
}

.todo-tick {
  display: grid;
  flex: none;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-top: 1px;
  padding: 0;
  border: 1.5px solid var(--line-2);
  border-radius: 50%;
  background: var(--paper);
  color: transparent;
  cursor: pointer;
}

.todo-tick:hover,
.todo-tick:focus-visible {
  border-color: var(--carbon);
  color: var(--carbon);
}

.todo-menu .snooze-box > summary {
  font-size: 13px;
}

/* Inside a scrolling dropdown the snooze choices open in place, not floating. */
.todo-menu .snooze-menu {
  position: static;
  width: auto;
  margin-top: 4px;
  box-shadow: none;
}

@media (max-width: 760px) {
  .todo-menu {
    position: fixed;
    top: 58px;
    right: 10px;
    left: 10px;
    width: auto;
  }
}

.notice-unread small {
  font-weight: 400;
}

/* ----- check in */

.check-in {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

.check-in-on {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
}

.check-in-text {
  display: flex;
  flex: 1 1 140px;
  flex-direction: column;
  min-width: 0;
}

.check-in-text strong {
  font-family: var(--font-display-stack);
  font-size: 22px;
  line-height: 1.1;
}

.check-in p {
  margin: 0;
}

/* ----- dashboard */

.dash-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.quick-label {
  margin-right: 2px;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
}

.next-job {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.next-job p {
  margin: 0;
}

.next-job-when {
  color: var(--carbon-dark);
  font-family: var(--font-display-stack);
  font-size: 17px;
  font-weight: 600;
}

.todo-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.todo-list li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.todo-list .link-btn,
.todo-open {
  color: var(--ink);
  font-weight: 500;
  text-align: left;
}

.todo-list small {
  color: var(--ink-3);
}

.status-bars,
.queue-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.status-bars a {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(50px, 1.2fr) auto;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 14px;
  text-decoration: none;
}

.status-bars a:hover .status-bar-name {
  text-decoration: underline;
}

.status-bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--steel-2);
}

.status-bar-track span {
  display: block;
  height: 100%;
  border-radius: 4px;
}

.queue-list {
  margin-bottom: 10px;
}

.queue-list a {
  color: var(--ink);
}

.queue-list strong {
  display: inline-block;
  min-width: 22px;
  color: var(--pink-ink);
  font-family: var(--font-display-stack);
  font-size: 17px;
}

/* ----- lists */

.input-compact {
  min-height: 30px;
  padding: 3px 6px;
  font-size: 13.5px;
}

.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

/* "Remind me…" on a todo: quick choices, then a time picker. */
.snooze-box {
  position: relative;
}

.snooze-box > summary {
  list-style: none;
}

.snooze-box > summary::-webkit-details-marker {
  display: none;
}

.todo-list .snooze-box > summary {
  color: var(--carbon);
  font-size: 13px;
  font-weight: 400;
}

.snooze-menu {
  top: calc(100% + 5px);
  right: 0;
  width: 240px;
  white-space: normal;
}

.todo-list .snooze-menu {
  right: auto;
  left: 0;
}

.menu[popover] {
  position: fixed;
  inset: auto;
  margin: 0;
  max-width: calc(100vw - 16px);
  overflow-y: auto;
}

.menu[popover]:not(:popover-open) {
  display: none;
}

.snooze-pick {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px 9px 4px;
}

.category-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.category-list li {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
}

.color-dot,
.category-dot:not([hidden]) {
  display: inline-block;
  flex: none;
  width: 11px;
  height: 11px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  vertical-align: -1px;
}

.category-name {
  flex: 1;
}

.history-list {
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

.history-list > li + li {
  border-top: 1px solid var(--line);
}

.process-result {
  margin-bottom: 14px;
  padding: 10px 14px;
  border: 1px solid var(--line-2);
  border-left: 4px solid var(--carbon);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.process-result p,
.process-result ul {
  margin: 0 0 5px;
}

/* ----- timesheet rows */

.sheet-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sheet-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(170px, 1fr) minmax(190px, 1.4fr) minmax(150px, 1.2fr) 34px;
  align-items: start;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.sheet-row-end {
  display: flex;
  justify-content: flex-end;
  padding-top: 26px;
}

@media (max-width: 760px) {
  .sheet-row {
    grid-template-columns: 1fr;
  }

  .sheet-row-end {
    padding-top: 0;
  }
}

/* ----- schedule */

.off-hours {
  position: absolute;
  top: 0;
  bottom: 0;
  background: repeating-linear-gradient(135deg, rgb(19 28 51 / 0.05) 0 6px, rgb(19 28 51 / 0.09) 6px 12px);
  pointer-events: none;
}

.card-event {
  --tech: #6b5400 !important;
  border-left-style: dashed !important;
  background: var(--canary) !important;
}

.backlog-search {
  margin: 6px 0;
}

.backlog-hit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 8px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--paper);
  font-size: 13px;
}

.backlog-hit small {
  display: block;
  color: var(--ink-3);
}

/* ----- maps */

.record-map {
  height: 220px;
  border-radius: var(--radius-sm);
  background: var(--steel);
}

.map-layers {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.map-key {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.map-key::before {
  content: "";
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: var(--map-key-color);
}

.map-key--staff { --map-key-color: var(--map-crew); }
.map-key--office { --map-key-color: var(--map-office); }
.map-key--site { --map-key-color: var(--map-site); }
.map-key--visit { --map-key-color: var(--map-visit); }
.map-key--start { --map-key-color: var(--map-route-start); }
.map-key--stop { --map-key-color: var(--map-route-stop); }
.map-key--end { --map-key-color: var(--map-route-end); }

.map-key--site::before {
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: linear-gradient(135deg, #ac4f18 48%, #186ac0 52%);
}

.map-key--visit::before {
  width: 13px;
  border-radius: 99px;
}

.map-route-key:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 6px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 12px;
}

.route-stops {
  margin: 0 0 8px;
  padding-left: 20px;
}

.route-stops li {
  margin-bottom: 8px;
}

.route-stops.day-itinerary {
  list-style: decimal;
}

.day-itinerary .unmapped-route-stop {
  list-style: none;
}

.route-navigation:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.route-stop-address {
  display: block;
  color: var(--ink-3);
}

.route-add[aria-pressed="true"] {
  background: #e8f5ee;
  color: #14603e;
}

.route-add[aria-pressed="true"] svg {
  display: none;
}

.route-add[aria-pressed="true"]::after {
  content: "✓";
  font-weight: 700;
}

.route-stops li > span {
  margin-right: 4px;
}

.route-stops .icon-btn {
  display: inline-flex;
  vertical-align: middle;
}

.route-answer {
  margin: 8px 0 0;
}
/* ===== from css/platform.css ===== */
/* Settings */
.pf-settings {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.pf-settings-nav {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pf-settings-heading {
  margin: 0 0 4px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
}

.pf-settings-tab {
  display: block;
  width: 100%;
  padding: 6px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--ink-2);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.pf-settings-tab:hover {
  background: var(--steel-2);
}

.pf-settings-on,
.pf-settings-on:hover {
  background: var(--carbon-wash);
  color: var(--carbon-dark);
  font-weight: 600;
}

@media (max-width: 860px) {
  .pf-settings {
    grid-template-columns: minmax(0, 1fr);
  }

  .pf-settings-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .pf-settings-tab {
    display: inline-block;
    width: auto;
  }
}

.pf-table-hint {
  margin: 0;
  padding: 10px 16px;
}

.pf-swatch {
  width: 34px;
  height: 24px;
  padding: 1px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--paper);
  cursor: pointer;
}

.icon-btn[aria-disabled='true'] {
  opacity: 0.35;
  cursor: not-allowed;
}

/* A plain statement of something that isn't available or wasn't done */
.pf-note {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid var(--canary-deep);
  border-radius: var(--radius-sm);
  background: var(--canary);
  color: var(--canary-ink);
}

.pf-note a {
  color: inherit;
  font-weight: 600;
}

.pf-note-gap {
  margin-bottom: 14px;
}

#business-logo {
  scroll-margin-top: 74px;
}

.pf-logo {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: flex-start;
}

.pf-logo-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 170px;
  height: 100px;
  padding: 8px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

.pf-logo-box img {
  max-width: 100%;
  max-height: 100%;
}

/* Plans */
.pf-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.pf-plan {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.pf-plan h3,
.pf-plan p {
  margin: 0;
}

.pf-plan-on {
  border-color: var(--carbon);
  background: var(--carbon-wash);
}

/* Sign-in */
.pf-auth-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 12px;
  font-size: 14px;
}

.pf-google {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.pf-language {
  max-width: 180px;
  margin-top: 14px;
}

/* Setup wizard */
.pf-onboarding {
  display: grid;
  gap: 16px;
  max-width: 720px;
}

.pf-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: pf-step;
}

.pf-steps li {
  counter-increment: pf-step;
  color: var(--ink-3);
}

.pf-steps li::before {
  content: counter(pf-step) '. ';
}

.pf-steps .link-btn {
  color: inherit;
}

.pf-step-on {
  color: var(--carbon-dark);
  font-weight: 600;
}

.pf-step-done {
  color: var(--ok);
}

.pf-changes {
  margin: 0;
  padding-left: 18px;
  line-height: 1.6;
}

/* Help panel */
.pf-help {
  position: fixed;
  bottom: 16px;
  z-index: 30;
}

.pf-help-right {
  right: 16px;
}

.pf-help-left {
  left: 16px;
}

/* Clear of the sidebar on wide screens, where it's always showing */
@media (min-width: 1000px) {
  .pf-help-left {
    left: 256px;
  }
}

.pf-help {
  width: min(320px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-menu);
  font-size: 14px;
}

.pf-help header,
.pf-help footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pf-help h2 {
  margin: 0;
  font-size: 15px;
}

.pf-help ul {
  margin: 8px 0 10px;
  padding-left: 18px;
  line-height: 1.45;
}

/* Hank's orb. hank_orb_renderer.js draws it live on the canvas; until then, or without
   WebGL, the still image underneath shows. The glow is CSS behind it, so it's never cut
   off: blue, with violet fading in over it while Hank is thinking (html.hank-thinking). */
.hank-orb {
  --orb: 20px;

  position: relative;
  display: inline-block;
  flex: none;
  width: var(--orb);
  height: var(--orb);
  border-radius: 50%;
  background: url("/assets/hank/orb-66a38cb9.webp") center / cover no-repeat;
  isolation: isolate;
}

.hank-orb canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  opacity: 0;
}

.hank-orb.is-drawn canvas {
  opacity: 1;
}

.hank-orb::before,
.hank-orb::after {
  content: "";
  position: absolute;
  inset: -30%;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}

.hank-orb::before {
  background: radial-gradient(circle, rgb(70 110 255 / 55%) 35%, rgb(70 110 255 / 18%) 52%, transparent 70%);
}

.hank-orb::after {
  background: radial-gradient(circle, rgb(130 85 255 / 65%) 35%, rgb(130 85 255 / 22%) 55%, transparent 72%);
  opacity: 0;
  transition: opacity var(--hank-glow-ms, 1200ms) cubic-bezier(0.65, 0, 0.35, 1);
}

.hank-thinking .hank-orb::after {
  opacity: 1;
}

/* The button in the corner is just the orb */
.hank-button {
  position: fixed;
  bottom: 18px;
  z-index: 30;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}

.hank-button .hank-orb {
  --orb: 46px;

  transition: transform 0.2s ease;
}

.hank-button:hover .hank-orb,
.hank-button:focus-visible .hank-orb {
  transform: scale(1.06);
}

.hank-button:focus-visible {
  outline: 2px solid var(--carbon);
  outline-offset: 3px;
}

.hank-button[hidden] {
  display: none;
}

@media print {
  .hank-button {
    display: none;
  }
}

.pf-help.assistant header {
  justify-content: flex-start;
}

/* The assistant: the help panel grown into a chat with the command center */
.pf-help.assistant {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(460px, calc(100vw - 32px));
  max-height: min(720px, calc(100dvh - 32px));
}

.pf-help.assistant[hidden] {
  display: none;
}

/* Opening, the panel grows out of the corner where Hank sits; closing, it shrinks back. */
.pf-help.assistant {
  opacity: 0;
  transform: translateY(14px) scale(0.94);
  transform-origin: bottom right;
  transition:
    opacity 0.18s ease,
    transform 0.24s cubic-bezier(0.2, 0.9, 0.25, 1);
}

.pf-help.assistant.is-open {
  opacity: 1;
  transform: none;
}

/* After the panel closes, Hank pops back in */
.hank-button.is-returning .hank-orb {
  animation: hank-return 0.28s cubic-bezier(0.2, 0.9, 0.25, 1.2);
}

@keyframes hank-return {
  from {
    opacity: 0;
    transform: scale(0.6);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pf-help.assistant {
    transition: none;
  }

  .hank-button.is-returning .hank-orb {
    animation: none;
  }
}

/* The screen's name, its guide beside it, then the header icons pushed right. */
.pf-help.assistant header .pf-help-guide {
  margin: 0 auto 0 10px;
}

.assistant-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.assistant-frame {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.assistant-chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.assistant-msg {
  max-width: 92%;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--steel);
}

.assistant-msg > p {
  margin: 0;
}

.assistant-msg .ai-presets {
  margin-top: 8px;
}

.assistant-msg-mine {
  align-self: flex-end;
  background: var(--carbon-wash);
}

/* An answer: plain rows on the page, no panel around them */
.assistant-answer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.assistant-msg-plan {
  max-width: 100%;
  padding: 0;
  background: none;
}

.assistant-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--steel);
  font-size: 14px;
}

.assistant-card p {
  margin: 0;
}

.assistant-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.assistant-card-done .assistant-card-head svg {
  color: var(--ok);
}

.assistant-card-failed .assistant-card-head svg {
  color: var(--danger);
}

.assistant-flag {
  margin-left: auto;
  color: var(--ink-3);
  font-size: 12px;
}

.assistant-card .table-scroll {
  max-height: 260px;
  overflow: auto;
  font-size: 13px;
}

.assistant-details summary {
  color: var(--ink-3);
  font-size: 13px;
  cursor: pointer;
}

.assistant-details[open] summary {
  margin-bottom: 8px;
}

/* The corner panel is narrow, so a card's rows stack one field per line */
.assistant .ai-rows .form-grid {
  grid-template-columns: minmax(0, 1fr);
}

/* Hank's own words, above the cards */
.assistant-reply {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

/* In the chat, Hank's orb sits in from the edge, so the scrolling panel doesn't cut its glow */
.assistant-reply .hank-orb,
.hank-working .hank-orb {
  flex: none;
  margin-inline-start: 6px;
}

.assistant-reply p {
  margin: 0;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--steel);
}

/* Hank at work on a request (org/ai_plans/_thinking): shimmering words on what he's
   doing, a running clock, and his reply as he writes it, in the bubble it ends up in.
   Not .hank-thinking: that one goes on <html> to turn the orbs violet. */
.hank-working {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.hank-working-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.hank-working-status {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 0;
  font-size: 14px;
}

/* A brighter band sweeps across the words, over and over */
.hank-working-words {
  background: linear-gradient(90deg, var(--ink-3) 0%, var(--ink-3) 35%, var(--ink) 50%, var(--ink-3) 65%, var(--ink-3) 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: hank-shimmer 2s linear infinite;
}

@keyframes hank-shimmer {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}

.hank-working-clock {
  color: var(--ink-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.hank-working-reply {
  margin: 0;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--steel);
}

.hank-working-reply:empty {
  display: none;
}

/* A blinking caret at the end while he writes */
.hank-working-reply::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--ink-3);
  animation: hank-caret 1s steps(1) infinite;
}

@keyframes hank-caret {
  50% { opacity: 0; }
}

.hank-working-slow {
  margin: 0;
  color: var(--ink-3);
  font-size: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .hank-working-words {
    background: none;
    color: var(--ink-2);
    animation: none;
  }

  .hank-working-reply::after {
    animation: none;
  }
}

/* Asking the business, once, before anything goes to the AI provider */
.assistant-consent {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 4px 16px rgb(0 0 0 / 8%);
  font-size: 14px;
}

.assistant-consent p {
  margin: 0;
}

/* A question about what's still empty, such as whether a new customer has an address */
.assistant-question {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--ink);
  font-weight: 500;
}

.assistant-question svg {
  flex: none;
  margin-top: 2px;
  color: var(--carbon);
}

.assistant-note {
  margin: 0;
  color: var(--ink-3);
  font-size: 13px;
}

.assistant-actions {
  display: flex;
  gap: 8px;
}

/* The ask box: a slim pill with the send arrow inside, growing as you type. It stays in
   view while the chat above it scrolls. */
.assistant-dock {
  position: sticky;
  bottom: 0;
  z-index: 1;
  padding-top: 6px;
  background: var(--paper);
}

.assistant-ask {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  margin-top: 4px;
  padding: 5px 5px 5px 14px;
  border: 1px solid var(--line-2);
  border-radius: 20px;
  background: var(--paper);
}

.assistant-ask:focus-within {
  border-color: var(--carbon);
}

/* The pill shows focus, so the box inside it doesn't */
.assistant-ask textarea:focus,
.assistant-ask textarea:focus-visible {
  outline: none;
  box-shadow: none;
}

.assistant-ask textarea {
  flex: 1;
  min-width: 0;
  max-height: 120px;
  padding: 5px 0;
  border: 0;
  outline: none;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  resize: none;
}

.assistant-send {
  display: grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--carbon);
  color: #fff;
  cursor: pointer;
}

.assistant-send:hover {
  background: var(--carbon-dark);
}

/* An older request that wasn't finished, folded to one line */
.assistant-later summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--steel);
  font-size: 14px;
  list-style: none;
  cursor: pointer;
}

.assistant-later summary::-webkit-details-marker {
  display: none;
}

.assistant-later summary svg {
  color: var(--ink-3);
  transition: transform 0.15s ease;
}

.assistant-later[open] summary {
  margin-bottom: 8px;
}

.assistant-later[open] summary svg {
  transform: rotate(90deg);
}

/* The chat's empty state. In the corner panel: a plain bubble (the panel header shows Hank). */
.assistant-empty {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--steel);
}

.assistant-empty p {
  margin: 0;
}

.assistant-empty .ai-presets {
  margin: 0;
}

/* The note about where requests go: quiet, not a callout */
.assistant-empty .ai-privacy {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-3);
  font-size: 13px;
}

.assistant-hero,
.assistant-top {
  display: none;
}

/* ----- The command center page: Hank's chat, full page */
.cc-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 760px;
  min-height: calc(100dvh - 140px);
  margin: 0 auto;
}

.cc-page .assistant-frame {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
}

.cc-page .assistant-chat {
  flex: 1;
  gap: 14px;
  font-size: 15px;
}

/* Before the first message: Hank large in the middle, the examples and the box under him */
.cc-page .assistant-frame:has(.assistant-empty) .assistant-chat {
  justify-content: center;
}

.cc-page .assistant-empty {
  align-items: center;
  gap: 14px;
  padding: 24px 0;
  background: none;
  text-align: center;
}

.cc-page .assistant-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.cc-page .assistant-hero h2 {
  margin: 0;
  font-size: 26px;
}

.hank-orb.hank-orb-hero {
  --orb: 104px;
}

.cc-page .assistant-intro {
  max-width: 460px;
  color: var(--ink-2);
}

.cc-page .assistant-empty .ai-presets {
  justify-content: center;
  max-width: 560px;
}

/* Once chatting: Hank, small, above the conversation */
.cc-page .assistant-top {
  position: sticky;
  top: 58px; /* under the sticky top bar */
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  background: var(--steel);
}

.cc-page .assistant-top .hank-orb {
  --orb: 28px;
}

.cc-page .assistant-top strong {
  margin-right: auto;
  font-size: 16px;
}

/* On the grey page, answers sit on white */
.cc-page .assistant-msg {
  max-width: 80%;
  background: var(--paper);
  border: 1px solid var(--line);
}

.cc-page .assistant-msg-mine {
  border-color: transparent;
  background: var(--carbon-wash);
}

.cc-page .assistant-msg-plan {
  max-width: 100%;
  border: 0;
  background: none;
}

.cc-page .assistant-card,
.cc-page .assistant-later summary {
  border: 1px solid var(--line);
  background: var(--paper);
}

/* The ask box stays at the bottom of the screen */
/* On the page, the dock fades the chat out above the ask box as it scrolls behind */
.cc-page .assistant-dock {
  bottom: 0;
  margin: 0 -16px;
  padding: 28px 16px 16px;
  background: linear-gradient(to bottom, rgb(238 241 246 / 0%), var(--steel) 45%);
}

.cc-page .assistant-ask {
  padding: 7px 7px 7px 18px;
  border-radius: 24px;
  box-shadow: 0 1px 3px rgb(19 28 51 / 8%);
}

.cc-page .assistant-ask textarea {
  font-size: 15px;
}

.cc-page .assistant-send {
  width: 34px;
  height: 34px;
}

.cc-tips {
  color: var(--ink-3);
  font-size: 13px;
}

.cc-tips summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.cc-tips ul {
  margin: 8px 0;
  padding-left: 18px;
  line-height: 1.5;
}

/* Header icons: Start over, Knowledge base, Close */
.pf-help.assistant header {
  gap: 2px;
}

.pf-help.assistant header .hank-orb {
  margin-right: 6px;
}

.assistant-restart {
  display: contents;
}

@media print {
  .pf-help {
    display: none;
  }
}

/* Status filters shown as links, a personal preference */
.pf-filter-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  font-size: 14px;
}

.pf-filter-links button[aria-current='true'] {
  font-weight: 700;
  text-decoration: underline;
}

/* The top bar must fit a phone: search gives way first, then Create loses its word. */
@media (max-width: 760px) {
  .search {
    flex: 1 1 0;
    min-width: 0;
  }

  .topbar-right {
    gap: 4px;
    flex: none;
  }

  .create > .btn {
    padding: 6px 8px;
    font-size: 0;
    gap: 0;
  }
}
/* ===== from css/reports.css ===== */
/* ----- report catalog and report screens */

.report-section-title {
  margin: 26px 0 10px;
  font: 700 19px/1.2 var(--font-display-stack);
}

.report-section-title:first-of-type {
  margin-top: 4px;
}

.report-week {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.report-catalog {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.report-catalog-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.report-catalog-list li + li {
  border-top: 1px solid var(--line);
}

.report-catalog-list a {
  display: block;
  padding: 10px 16px;
  color: inherit;
  text-decoration: none;
}

.report-catalog-list a:hover strong {
  text-decoration: underline;
}

.report-catalog-list strong {
  display: block;
  font-weight: 600;
}

.report-catalog-list small {
  display: block;
  color: var(--ink-2);
  font-size: 13.5px;
}

.report-table-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 18px;
  margin-bottom: 14px;
}

.report-table-filters .preset-row {
  align-self: center;
}

.report-table-notice {
  margin: 0 0 12px;
  color: var(--ink-2);
}

.report-table-count {
  color: var(--ink-2);
  font-size: 13.5px;
  white-space: nowrap;
}

@media (max-width: 800px) {
  .report-catalog {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* ===== from css/integrations.css ===== */
/* ----- AI command center */

.ai-privacy {
  margin: 0;
  padding: 9px 12px;
  border-left: 3px solid var(--carbon);
  background: var(--carbon-wash);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
}

.ai-warning {
  margin: 0;
  padding: 8px 12px;
  background: var(--canary);
  color: var(--canary-ink);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
}

.ai-warning ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

.ai-warning p {
  margin: 0;
}

.ai-presets,
.ai-matches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-presets .btn {
  text-align: left;
  height: auto;
  white-space: normal;
}

.ai-matches .btn {
  height: auto;
  white-space: normal;
}

.ai-matches small {
  font-weight: 400;
  opacity: 0.8;
}

.ai-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--carbon);
  border-radius: var(--radius);
  background: var(--paper);
}

.ai-card > p {
  margin: 0;
}

.ai-card-blocked {
  border-left-color: var(--canary-deep);
}

.ai-card-done {
  border-left-color: var(--ok);
}

.ai-card-failed {
  border-left-color: var(--danger);
}

.ai-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ai-card-pick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  font-size: 15px;
}

/* A card's fields, in the rows its action sets out, as on the screen's own form */
.ai-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-rows .form-grid {
  align-items: start;
}

.ai-field-label {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.ai-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-line {
  display: grid;
  grid-template-columns: minmax(150px, 2fr) minmax(130px, 2fr) 90px 110px auto;
  gap: 8px;
  align-items: end;
}

.ai-line-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-line-wrap[hidden] {
  display: none;
}

.ai-line-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: end;
}

.ai-lines .tabs {
  flex-wrap: wrap;
}

.ai-result-table .num {
  text-align: right;
}

.ai-draft-button {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
}

.ai-new-record {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-sm);
}

.ai-new-record .form-grid {
  width: 100%;
}

@media (max-width: 720px) {
  .ai-line {
    grid-template-columns: 1fr 1fr;
  }
}

/* ----- knowledge base */

.kb-grid {
  display: grid;
  grid-template-columns: minmax(200px, 280px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.kb-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.kb-list li + li {
  border-top: 1px solid var(--line);
}

.kb-pick {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.kb-pick:hover {
  background: var(--steel);
}

.kb-pick-on {
  background: var(--carbon-wash);
  font-weight: 600;
}

.kb-pick small {
  display: block;
  color: var(--ink-3);
  font-weight: 400;
}

.kb-chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.kb-msg {
  max-width: 85%;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.kb-msg p {
  margin: 0;
}

.kb-msg-mine {
  align-self: flex-end;
  border-color: transparent;
  background: var(--carbon-wash);
}

.kb-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.kb-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.kb-end {
  height: 0;
}

.kb-ask {
  display: flex;
  gap: 8px;
}

.kb-ask .input {
  flex: 1;
  min-width: 0;
}

@media (max-width: 800px) {
  .kb-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .kb-msg {
    max-width: 100%;
  }
}

/* ----- QuickBooks */

.qb-log {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13.5px;
}

.qb-log li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 12px;
  padding: 6px 9px;
  background: var(--steel);
  border-radius: var(--radius-sm);
  overflow-wrap: anywhere;
}

.qb-log small {
  color: var(--ink-3);
}

.qb-log-bad {
  background: var(--danger-wash) !important;
}

.qb-details summary {
  cursor: pointer;
  font-weight: 600;
}

.qb-link {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.qb-link .field {
  flex: 1;
  min-width: 0;
}

.qb-progress {
  width: 100%;
  height: 12px;
  accent-color: var(--carbon);
}

/* ----- where we buy a product: one row per supplier, the cheapest picked out */
.supplier-prices {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.supplier-price {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.supplier-price.is-cheapest {
  border-color: var(--ok);
  background: var(--ok-wash);
}

.supplier-price-text {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  min-width: 0;
}

.supplier-price-text small {
  flex-basis: 100%;
}

/* ----- a supplier's price history under its row, with a small line of the price */
.supplier-price-history {
  flex-basis: 100%;
  font-size: 13.5px;
}

.supplier-price-history summary {
  cursor: pointer;
  color: var(--ink-2);
}

.supplier-price-history ul {
  display: grid;
  gap: 4px;
  margin: 8px 0;
  padding: 0;
  list-style: none;
}

.supplier-price-history li {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
}

.price-sparkline {
  display: block;
  width: 160px;
  max-width: 100%;
  height: auto;
  margin-top: 8px;
}

/* Team and roles, Responsibilities: a tick per role for each job. */
.responsibilities-table .center {
  text-align: center;
}

.responsibilities-table td:first-child {
  min-width: 260px;
}

.responsibility-person {
  align-items: flex-end;
  flex-wrap: wrap;
}

/* ----- supplier catalogs: a price list read in, checked, then searched */
.catalog-progress {
  width: min(420px, 100%);
  height: 12px;
  accent-color: var(--carbon);
}

.catalog-summary {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.catalog-bulk {
  flex-wrap: wrap;
  gap: 8px 16px;
}

/* Nothing to show until rows are ticked, on a list with one heading. */
.catalog-bulk:not(:has(> :not([hidden]))) {
  display: none;
}

.catalog-priced-on {
  max-width: 220px;
}

.catalog-section-form {
  flex-wrap: wrap;
  gap: 8px;
}

.catalog-section-form select {
  max-width: 340px;
}

.catalog-rows .catalog-section th {
  background: var(--steel);
  font-weight: 600;
  text-align: left;
}

.catalog-section-category {
  margin-left: 8px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
}

.catalog-section-category svg {
  vertical-align: -1px;
}

.catalog-sort {
  flex-wrap: wrap;
  gap: 8px 12px;
}

.catalog-sections-rest {
  max-width: 340px;
}

/* The dialog scrolls, not the table in it. */
.catalog-sections {
  flex: none;
}

.catalog-rows tr.is-left-out td {
  color: var(--ink-3);
  text-decoration: line-through;
}

.catalog-rows tr.is-left-out td.cell-action,
.catalog-rows tr.is-left-out td.dt-check {
  text-decoration: none;
}

/* A price list page shown to check a row against: the page as a picture, the row marked. */
.catalog-page-link {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 400;
}

.pdf-preview-row {
  margin: 0;
}

.pdf-preview-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pdf-preview-bar .btn {
  gap: 4px;
}

.pdf-preview-spacer {
  flex: 1;
}

.pdf-sheet {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}

.pdf-sheet img {
  display: block;
  width: 100%;
  height: auto;
}

/* The page's text, invisible over the picture: drag across it to select and copy. */
.pdf-sheet {
  container-type: inline-size;
}

.pdf-sheet img {
  user-select: none;
}

.pdf-text {
  position: absolute;
  inset: 0;
  overflow: hidden;
  line-height: 1;
  font-family: Arial, Helvetica, sans-serif;
}

.pdf-text span {
  position: absolute;
  color: transparent;
  white-space: pre;
  transform-origin: 0 0;
  cursor: text;
}

/* The space after a word: copied, but left out of the word's width. */
.pdf-text i {
  position: absolute;
}

.pdf-text ::selection {
  background: rgb(37 99 235 / 0.3);
  color: transparent;
}

.pdf-mark,
.pdf-mark-key {
  background: rgb(255 196 0 / 0.28);
  outline: 2px solid rgb(230 150 0 / 0.85);
}

.pdf-mark {
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
}

.pdf-mark-key {
  display: inline-block;
  width: 18px;
  height: 12px;
  margin-right: 6px;
  border-radius: 2px;
  vertical-align: -1px;
}

.catalog-linked {
  display: block;
  margin-top: 2px;
}

.catalog-search {
  flex-wrap: wrap;
  gap: 8px;
}

.catalog-search .input[type="search"] {
  flex: 1 1 220px;
}

/* Browsing the catalogs: filters above, the table under them. */
/* A filter bar, not a dialog's form: it runs across, not down. */
dialog.modal > .modal-frame > form.catalog-finder-bar {
  flex: none;
  flex-direction: row;
}

.catalog-finder-bar .input-icon {
  flex: 1 1 220px;
  max-width: none;
}

.catalog-finder-heading {
  max-width: 260px;
}

.modal .catalog-finder {
  padding: 0;
}

.modal .catalog-finder .dt-foot {
  border-top: 1px solid var(--line);
}

.catalog-uploads {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.catalog-uploads li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}

.catalog-picked {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* Refund a card payment (invoice payments): a short amount box beside the button. */
.refund-amount { max-width: 8rem; }
