:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --line: #dce3ea;
  --line-strong: #c9d3dc;
  --text: #172033;
  --muted: #66758a;
  --teal: #008f9a;
  --teal-dark: #06717a;
  --green: #17803b;
  --amber: #c76f00;
  --red: #d92d20;
  --shadow: 0 12px 28px rgba(23, 32, 51, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 22px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  font-size: 22px;
  letter-spacing: 0;
}

.brand span {
  color: var(--teal);
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: contain;
}

.nav-list {
  display: grid;
  gap: 0;
}

.nav-list button {
  border: 0;
  border-left: 3px solid transparent;
  background: transparent;
  color: #2e3b4f;
  padding: 7px 14px;
  text-align: left;
  border-radius: 6px;
  cursor: pointer;
}

.nav-list button.nav-child {
  font-size: 14px;
  margin-left: 18px;
  padding: 5px 12px;
}

.scan3d-nav-button {
  align-items: center;
  display: flex;
  gap: 9px;
}

.scan3d-cube-icon {
  --cube: 18px;
  display: inline-block;
  height: var(--cube);
  position: relative;
  transform: rotateX(58deg) rotateZ(42deg);
  transform-style: preserve-3d;
  width: var(--cube);
}

.scan3d-cube-icon::before,
.scan3d-cube-icon::after {
  content: "";
  border: 1px solid rgba(6, 113, 122, .8);
  box-shadow: 0 2px 6px rgba(15, 23, 42, .2);
  inset: 0;
  position: absolute;
}

.scan3d-cube-icon::before {
  background: linear-gradient(135deg, #d9f99d, #14b8a6);
  transform: translateZ(6px);
}

.scan3d-cube-icon::after {
  background: linear-gradient(135deg, #0f766e, #082f49);
  transform: rotateX(90deg) translateZ(-6px);
}

.nav-list button.active,
.nav-list button:hover {
  border-left-color: var(--teal);
  background: #eefbfc;
  color: var(--teal-dark);
  font-weight: 700;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.workspace {
  min-width: 0;
}

.topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 14px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.module-picker {
  display: none;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.module-picker select {
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: white;
  color: var(--text);
  padding: 0 12px;
  font-weight: 800;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  width: 23ch;
  max-width: 23ch;
  min-width: 120px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 14px;
  color: var(--muted);
}

.search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
}

.clear-search-button {
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: #e8eef5;
  color: #536278;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.clear-search-button:hover {
  background: #dbe5ee;
  color: var(--text);
}

.connection {
  display: inline-flex;
  align-items: center;
  justify-self: start;
}

.user-menu {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}

.device-id {
  display: none;
}

.dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #11a34a;
  box-shadow: 0 0 0 4px rgba(17, 163, 74, 0.14);
}

.connection.offline .dot {
  background: #e11d48;
  box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.14);
}

.icon-button,
.user-chip {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
}

.logout-button {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  height: 38px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.mobile-job-button {
  align-items: center;
  background: #d9f99d;
  border: 1px solid #84cc16;
  border-radius: 999px;
  box-shadow: none;
  color: #0f3b20;
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  height: 38px;
  justify-content: center;
  padding: 0 10px;
  width: auto;
}

.mobile-job-button:hover {
  background: #bef264;
  border-color: #65a30d;
}

.mobile-job-submit-button {
  display: none;
}

.mobile-call-ticket-button {
  align-items: center;
  background: #d9f99d;
  border: 1px solid #84cc16;
  border-radius: 999px;
  color: #0f3b20;
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  height: 38px;
  justify-content: center;
  padding: 0 10px;
}

.mobile-call-ticket-button:hover {
  background: #bef264;
  border-color: #65a30d;
}

.mobile-todo-button,
.mobile-calendar-button {
  align-items: center;
  background: #d9f99d;
  border: 1px solid #84cc16;
  border-radius: 999px;
  color: #0f3b20;
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  height: 38px;
  justify-content: center;
  padding: 0 10px;
}

.mobile-refresh-button {
  align-items: center;
  background: #d9f99d;
  border: 1px solid #84cc16;
  border-radius: 50%;
  color: #0f3b20;
  cursor: pointer;
  display: inline-flex;
  font-size: 22px;
  font-weight: 900;
  height: 38px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 38px;
}

.mobile-todo-button:hover,
.mobile-calendar-button:hover,
.mobile-refresh-button:hover {
  background: #bef264;
  border-color: #65a30d;
}

.mobile-refresh-button.is-refreshing {
  animation: panelSpinner 0.8s linear infinite;
  opacity: 0.78;
}

.mobile-refresh-button:disabled {
  cursor: wait;
}

.quick-note-button {
  align-items: center;
  background: #d9f99d;
  border: 1px solid #84cc16;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  height: 38px;
  justify-content: center;
  position: relative;
  width: 38px;
}

.quick-note-button:hover {
  background: #bef264;
  border-color: #65a30d;
}

.quick-note-button span,
.quick-note-button::before {
  display: block;
  content: "";
}

.quick-note-button span {
  width: 17px;
  height: 20px;
  border: 2px solid #0f3b20;
  border-radius: 3px;
  background:
    linear-gradient(#0f3b20, #0f3b20) 4px 6px / 9px 2px no-repeat,
    linear-gradient(#0f3b20, #0f3b20) 4px 11px / 9px 2px no-repeat,
    white;
}

.quick-note-button::before {
  position: absolute;
  width: 9px;
  height: 2px;
  right: 7px;
  bottom: 9px;
  border-radius: 2px;
  background: #0f3b20;
  transform: rotate(-45deg);
}

#quickNoteDialog {
  width: min(560px, calc(100vw - 24px));
}

#calendarDialog {
  width: min(540px, calc(100vw - 24px));
}

.calendar-form {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.calendar-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.calendar-form input,
.calendar-form textarea,
.calendar-form select {
  width: 100%;
}

.calendar-two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.calendar-repeat-toggle {
  display: inline-flex !important;
  align-items: center;
  gap: 8px !important;
  width: max-content;
}

.calendar-repeat-toggle input,
.calendar-repeat-days input {
  width: auto;
}

.calendar-repeat-days {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.calendar-repeat-days[hidden] {
  display: none;
}

.calendar-repeat-days legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.calendar-repeat-days label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 48px;
  color: var(--text);
}

.quick-note-form {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.quick-note-list-section,
.quick-note-editor-section {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.quick-note-list {
  display: grid;
  gap: 8px;
  max-height: min(520px, calc(100vh - 210px));
  overflow: auto;
}

.quick-note-row {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fbfd;
  color: var(--text);
  cursor: pointer;
  padding: 10px 12px;
  text-align: left;
}

.quick-note-row:hover {
  border-color: #84cc16;
  background: #f7fee7;
}

.quick-note-row strong {
  color: var(--teal-dark);
  font-size: 13px;
}

.quick-note-row span {
  display: -webkit-box;
  overflow: hidden;
  color: #243245;
  font-size: 13px;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.quick-note-row em {
  color: #007a00;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.quick-note-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.quick-note-form textarea {
  width: 100%;
  min-height: 170px;
  resize: vertical;
}

.quick-note-photo-actions {
  display: flex;
  justify-content: flex-start;
}

.icon-text-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.icon-text-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.icon-only-button {
  display: inline-grid;
  width: 44px;
  min-width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
}

.icon-only-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.quick-note-photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 24px;
}

.quick-note-photo-thumb {
  width: 92px;
  height: 72px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fbfd;
  cursor: pointer;
}

.quick-note-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.quick-note-stamp {
  margin: 0;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 800;
}

.quick-note-save-state {
  min-height: 1.1em;
  margin: -4px 0 0;
  color: #007a00;
  font-size: 12px;
  font-weight: 800;
}

.ticket-toolbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 10px;
}

.mobile-ticket-job-button {
  display: none;
}

.menu-action-button {
  width: 100%;
  height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  padding: 0 12px;
  text-align: left;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.menu-action-button:hover {
  background: #eefbfc;
  color: var(--teal-dark);
}

.user-menu {
  position: relative;
}

.user-menu .user-chip {
  border: 0;
  cursor: pointer;
}

.user-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  min-width: 110px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.user-menu-panel .logout-button {
  width: 100%;
}

body.app-locked .app-shell {
  filter: blur(7px);
  pointer-events: none;
  user-select: none;
}

.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(245, 247, 250, 0.48);
}

.lock-card {
  display: grid;
  gap: 12px;
  width: min(360px, 100%);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 22px;
}

.lock-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lock-heading img {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  object-fit: contain;
}

.lock-card input {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 6px;
}

.lock-card .error-box {
  margin: 0;
}

.context-menu {
  position: fixed;
  z-index: 100;
  min-width: 130px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.context-menu button {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  padding: 9px 10px;
  text-align: left;
  font-weight: 800;
  cursor: pointer;
}

.context-menu button:hover {
  background: #eefbfc;
  color: var(--teal-dark);
}

.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(0, 143, 154, 0.12), transparent 34%),
    var(--bg);
  overflow-x: hidden;
}

.login-card {
  width: min(420px, calc(100vw - 48px));
  max-width: 100%;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.login-brand {
  margin-bottom: 28px;
}

.login-brand-mark {
  width: 48px;
  height: 48px;
}

.login-card h1 {
  font-size: 26px;
  margin-bottom: 8px;
}

.login-card p {
  color: var(--muted);
  margin-bottom: 20px;
}

.login-form {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 0;
  width: 100%;
}

.login-form label {
  min-width: 0;
  width: 100%;
}

.login-form input,
.login-form button,
.login-form .primary-button {
  display: block;
  max-width: 100%;
  min-width: 0;
  width: 100%;
}

.login-form .primary-button {
  margin-top: 4px;
}

.pin-form input {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: clamp(1px, 1vw, 6px);
  text-align: center;
}

.pin-form .trust-check {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.pin-form .trust-check input {
  width: 18px;
  height: 18px;
}

.pin-form .device-name-field input {
  font-size: 14px;
  text-align: left;
  letter-spacing: 0;
  font-weight: 500;
}

@media (max-width: 560px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .login-page {
    align-items: center;
    justify-items: center;
    min-height: 100svh;
    width: 100svw;
    max-width: 100svw;
    padding: 12px;
  }

  .login-card {
    padding: 20px;
    width: calc(100svw - 24px);
    max-width: 340px;
    margin-inline: auto;
  }

  .login-brand {
    justify-content: center;
    margin-bottom: 22px;
  }

  .login-card h1,
  .login-card p {
    text-align: center;
  }

  .login-card h1 {
    font-size: 24px;
  }

  .login-card p {
    font-size: 15px;
  }

  .login-form input,
  .login-form button {
    display: block;
    min-width: 0;
    width: 100%;
  }

  .pin-form input {
    letter-spacing: 3px;
  }
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--teal-dark);
  font-weight: 800;
  cursor: pointer;
}

.trust-panel {
  display: grid;
  gap: 14px;
}

.trust-panel h2 {
  font-size: 20px;
}

.trust-panel label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.trust-panel input {
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 12px;
}

.trust-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.trust-actions button:not(.primary-button) {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: white;
  cursor: pointer;
}

.error-box {
  border: 1px solid #f2b8b5;
  border-radius: 6px;
  background: #fff4f2;
  color: #a4161a;
  padding: 11px 12px;
  font-size: 14px;
  margin-bottom: 16px;
}

.icon-button {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.user-chip {
  background: var(--teal);
  color: white;
  font-weight: 800;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(82px, 1fr));
  gap: 6px;
  min-width: 0;
  padding: 0;
}

.metrics article {
  display: grid;
  grid-template-columns: max-content auto;
  align-items: baseline;
  gap: 6px;
  min-height: 38px;
  background: #d9f99d;
  border: 1px solid #84cc16;
  border-radius: 8px;
  min-width: 0;
  padding: 7px 8px;
  box-shadow: var(--shadow);
}

.metric-button {
  cursor: pointer;
}

.metric-button:hover,
.metric-button:focus-visible {
  border-color: #65a30d;
  background: #bef264;
  outline: none;
}

.metric-button.active {
  background: #65a30d;
  border-color: #3f6212;
  box-shadow: 0 12px 24px rgba(63, 98, 18, 0.18);
}

.metric-button.active span,
.metric-button.active strong,
.metric-button.active small {
  color: #ffffff !important;
}

.metrics span,
.metrics small {
  color: #365314;
  font-size: 12px;
}

.metrics strong {
  color: #071522;
  font-size: 20px;
  line-height: 1;
}

.metrics small {
  display: none;
  white-space: nowrap;
}

.up {
  color: var(--green) !important;
}

.warn {
  color: var(--amber) !important;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  padding: 0 28px 28px;
}

.full-width-panel {
  grid-column: 1 / -1;
}

#accountsView {
  grid-template-columns: minmax(0, 7fr) minmax(300px, 3fr);
}

#ncrView {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

#totemsView {
  grid-template-columns: minmax(0, 2fr) minmax(360px, 1fr);
}

#totemsView:has(#totemBuildDashboardPanel:not([hidden])) {
  height: calc(100vh - 156px);
  overflow: hidden;
  padding-bottom: 8px;
}

#accountsView.company-dashboard-open {
  grid-template-columns: minmax(0, 1fr);
  height: calc(100vh - 170px);
  overflow: hidden;
}

#jobsView.job-dashboard-open {
  grid-template-columns: minmax(0, 1fr);
}

#esimView.esim-dashboard-open {
  grid-template-columns: minmax(0, 1fr);
}

#accountsView.company-dashboard-open > .accounts-panel {
  display: none;
}

#jobsView.job-dashboard-open > .accounts-panel {
  display: none;
}

#esimView.esim-dashboard-open > .accounts-panel {
  display: none;
}

.accounts-panel,
.detail-panel {
  position: relative;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel-loading-overlay {
  align-items: center;
  background: rgba(255, 255, 255, 0.86);
  color: var(--teal-dark);
  display: flex;
  font-weight: 900;
  gap: 10px;
  inset: 74px 0 0;
  justify-content: center;
  min-height: 160px;
  position: absolute;
  z-index: 8;
}

.panel-loading-overlay[hidden] {
  display: none;
}

.panel-loading-spinner {
  animation: panelSpinner 0.8s linear infinite;
  border: 4px solid #d7f99a;
  border-top-color: var(--teal);
  border-radius: 50%;
  display: inline-block;
  height: 34px;
  width: 34px;
}

.inline-loading-spinner {
  animation: panelSpinner 0.8s linear infinite;
  border: 3px solid #d7f99a;
  border-top-color: var(--teal);
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
  height: 18px;
  width: 18px;
}

.totem-auto-create-processing {
  align-items: center;
  color: var(--teal-dark);
  display: inline-flex;
  font-size: 0.85rem;
  font-weight: 900;
  gap: 6px;
  min-height: 30px;
  white-space: nowrap;
}

.totem-auto-create-processing[hidden] {
  display: none;
}

@keyframes panelSpinner {
  to {
    transform: rotate(360deg);
  }
}

.panel-toolbar {
  display: grid;
  grid-template-columns: max-content minmax(0, auto);
  align-items: start;
  justify-content: start;
  gap: 6px 12px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.panel-toolbar.has-new-action {
  grid-template-columns: max-content max-content minmax(0, auto);
}

.panel-toolbar > div:first-of-type {
  display: contents;
}

.panel-toolbar h1,
.panel-toolbar .contacts-heading-row {
  grid-column: 1;
  grid-row: 1;
}

.panel-toolbar.has-new-action h1,
.panel-toolbar.has-new-action .contacts-heading-row {
  grid-column: 2;
}

.panel-toolbar > .toolbar-actions,
.panel-toolbar > .ticket-toolbar-actions,
.panel-toolbar > .primary-button,
.panel-toolbar > .lime-action-button {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  justify-self: start;
}

.panel-toolbar > .toolbar-new-action {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  justify-self: start;
  width: auto;
}

.panel-toolbar.has-new-action > .toolbar-actions,
.panel-toolbar.has-new-action > .ticket-toolbar-actions {
  grid-column: 3;
  justify-self: end;
}

#ticketsView .panel-toolbar.has-new-action {
  grid-template-columns: max-content max-content minmax(0, 1fr);
  align-items: start;
}

#ticketsView .panel-toolbar.has-new-action > .toolbar-new-action {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  justify-self: start;
}

#ticketsView .panel-toolbar.has-new-action h1 {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
}

#ticketsView .panel-toolbar.has-new-action > div:first-of-type {
  display: contents;
}

#ticketsView .panel-toolbar.has-new-action p {
  grid-column: 1 / -1;
  grid-row: 2;
  margin-top: 0;
}

#ticketsView .ticket-toolbar-actions {
  grid-column: 3;
  grid-row: 1 / span 2;
  justify-self: end;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
}

.panel-toolbar p {
  grid-column: 1 / -1;
  margin-top: 0;
  color: var(--muted);
  font-size: 14px;
}

.panel-toolbar.has-new-action p {
  grid-column: 2 / -1;
}

.dashboard-inline-search {
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--muted);
  display: flex;
  gap: 6px;
  height: 38px;
  max-width: 18ch;
  min-width: 130px;
  padding: 0 8px;
  width: 18ch;
}

.dashboard-inline-search input {
  border: 0;
  color: var(--text);
  min-width: 0;
  outline: 0;
  width: 100%;
}

#totemsView .panel-toolbar.has-new-action {
  grid-template-columns: max-content max-content max-content minmax(0, 1fr);
}

#totemsView .panel-toolbar.has-new-action > #newTotemOrderButton {
  grid-column: 1;
}

#totemsView .panel-toolbar.has-new-action > #buildTotemOrderButton {
  grid-column: 2;
}

#totemsView .panel-toolbar.has-new-action h1 {
  grid-column: 3;
}

#totemsView .panel-toolbar.has-new-action p {
  grid-column: 3 / -1;
}

#totemsView .panel-toolbar.has-new-action > .toolbar-actions {
  grid-column: 4;
}

.contacts-heading-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.inline-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(320px, 42vw);
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 8px 0 12px;
}

.inline-search-input {
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  font: inherit;
  font-size: 14px;
}

.inline-search-wrap:has(.inline-search-input.missing-value),
.inline-search-input.missing-value {
  border-color: var(--red);
  color: var(--red);
}

.contact-add-button {
  flex: 0 0 auto;
  font-size: 20px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 20px;
}

.pager button {
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: white;
  color: var(--teal-dark);
  font-weight: 800;
  cursor: pointer;
}

.pager button:disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.55;
}

.pager span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 12px;
}

.toggle-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #46546a;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.toggle-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
}

.lime-toggle-option input {
  accent-color: #84cc16;
}

.primary-button {
  border: 0;
  border-radius: 6px;
  background: var(--teal);
  color: white;
  padding: 11px 16px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button:hover {
  background: var(--teal-dark);
}

.danger-button {
  border: 1px solid #dc2626;
  border-radius: 6px;
  background: #fee2e2;
  color: #991b1b;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
}

.danger-button:hover {
  background: #fecaca;
  border-color: #b91c1c;
}

.dialog-actions-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.csv-import-panel {
  display: grid;
  gap: 10px;
}

.csv-import-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.csv-import-actions span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.csv-preview-wrap {
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.csv-preview-wrap .detail-table {
  min-width: 760px;
}

.tabs {
  display: flex;
  gap: 24px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
}

.tabs button {
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 16px 0 12px;
  cursor: pointer;
}

.tabs .selected {
  color: var(--teal-dark);
  border-bottom-color: var(--teal);
  font-weight: 800;
}

.table-wrap {
  overflow: auto;
}

.left-overflow-indicator,
.right-overflow-indicator {
  align-items: center;
  background: #d9f99d;
  border: 1px solid #84cc16;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
  color: #0f3b20;
  cursor: pointer;
  display: inline-flex;
  font-size: 34px;
  font-weight: 900;
  height: 46px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  position: fixed;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  z-index: 25;
}

.left-overflow-indicator {
  animation: leftOverflowPulse 1.1s ease-in-out infinite;
  left: 10px;
  right: auto;
}

.right-overflow-indicator {
  animation: rightOverflowPulse 1.1s ease-in-out infinite;
  right: 10px;
}

.left-overflow-indicator[hidden],
.right-overflow-indicator[hidden] {
  display: none;
}

@keyframes leftOverflowPulse {
  0%,
  100% {
    opacity: 0.55;
    transform: translateY(-50%) translateX(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-50%) translateX(6px);
  }
}

@keyframes rightOverflowPulse {
  0%,
  100% {
    opacity: 0.55;
    transform: translateY(-50%) translateX(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-50%) translateX(-6px);
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
}

th {
  background: var(--surface-soft);
  color: #46546a;
  font-weight: 800;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover,
tbody tr.selected-row {
  background: #eefbfc;
}

tbody tr.hardware-row-stock {
  background: #d9fbe7;
}

tbody tr.hardware-row-hire {
  background: #ffe2b8;
}

tbody tr.hardware-row-sold {
  background: #ffd6de;
}

tbody tr.hardware-row-stock:hover,
tbody tr.hardware-row-hire:hover,
tbody tr.hardware-row-sold:hover {
  filter: brightness(0.98);
}

tbody tr.totem-status-ordered {
  background: #ffd6de;
}

tbody tr.totem-status-building {
  background: #ff9f1c;
}

tbody tr.totem-status-complete {
  background: #eadcff;
}

tbody tr.totem-status-paid {
  background: #c8f86a;
}

tbody tr.totem-status-closed {
  background: #e5e7eb;
}

tbody tr.totem-status-sample {
  background: #d8b4fe;
}

tbody tr.totem-status-ordered:hover,
tbody tr.totem-status-building:hover,
tbody tr.totem-status-complete:hover,
tbody tr.totem-status-paid:hover,
tbody tr.totem-status-closed:hover,
tbody tr.totem-status-sample:hover {
  filter: brightness(0.98);
}

#totemOrderRows tr.selected-row {
  box-shadow: inset 9px 0 0 #071632, inset -9px 0 0 #071632;
  color: #000;
  font-weight: 900;
  filter: brightness(0.9);
}

#totemOrderRows tr.selected-row td,
#totemOrderRows tr.selected-row span,
#totemOrderRows tr.selected-row button,
#totemOrderRows tr.selected-row select {
  color: #000;
  font-weight: 900;
}

.totem-status-select {
  border: 1px solid #a9bdd5;
  border-radius: 6px;
  font: inherit;
  font-weight: 800;
  padding: 5px 7px;
  width: max-content;
}

.account-link {
  color: var(--teal-dark);
  font-weight: 800;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  border-radius: 999px;
  background: #e9f7ed;
  color: var(--green);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
}

.danger {
  color: var(--red);
  font-weight: 800;
}

.muted-cell,
.notes-copy {
  color: var(--muted);
  font-size: 13px;
}

.pre-line-cell {
  white-space: pre-line;
}

.inline-text-button {
  border: 0;
  background: transparent;
  color: var(--teal-dark);
  padding: 0;
  text-align: left;
  font-weight: 800;
  cursor: pointer;
}

.inline-text-button:hover {
  text-decoration: underline;
}

.row-action-button {
  min-width: 86px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: white;
  color: var(--teal-dark);
  font-weight: 800;
  cursor: pointer;
}

.row-action-button:hover {
  border-color: var(--teal);
  background: #eefbfc;
}

.row-icon-cell {
  width: 42px;
  padding-right: 0;
}

.row-icon-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid #84cc16;
  border-radius: 6px;
  background: #d9f99d;
  color: #365314;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
}

.row-icon-button:hover {
  border-color: #65a30d;
  background: #bef264;
}

.ticket-lock-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.ticket-lock-icon.open {
  border: 1px solid #84cc16;
  background: #d9f99d;
  color: #365314;
}

.ticket-lock-icon.closed {
  border: 1px solid #fb7185;
  background: #ffe4e6;
  color: #9f1239;
}

.contact-head-button,
.contact-building-button {
  font-size: 15px;
}

.primary-contact-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.extra-contact-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  border: 1px solid #84cc16;
  border-radius: 5px;
  background: #d9f99d;
  color: #365314;
  padding: 0 7px;
  font-size: 12px;
  font-weight: 900;
}

.compact-contact-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.compact-contact-list li {
  display: grid;
  gap: 1px;
}

.compact-contact-list span {
  color: var(--muted);
  font-size: 12px;
}

.contact-company-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 8px;
  align-items: center;
}

.contact-company-row select,
.contact-company-row input {
  min-width: 0;
}

.contact-company-row input.missing-value,
#accountContactInput.missing-value {
  border-color: var(--red);
  color: var(--red);
}

.contact-company-add-button {
  width: 34px;
  height: 34px;
  font-size: 20px;
}

.selected-companies {
  margin: -6px 0 0 130px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.count-action-button {
  min-width: 40px;
  height: 30px;
  border: 1px solid #84cc16;
  border-radius: 6px;
  background: #d9f99d;
  color: #365314;
  font-weight: 800;
  cursor: pointer;
}

.count-action-button:hover {
  border-color: #65a30d;
  background: #bef264;
}

.count-action-button:disabled {
  border-color: var(--line-strong);
  background: #f2f4f7;
  color: var(--muted);
  cursor: default;
  opacity: 0.65;
}

.count-action-button:disabled:hover {
  border-color: var(--line-strong);
  background: white;
}

.sheet-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.sheet-actions button:not(.primary-button):not(.lime-action-button) {
  border: 1px solid var(--line-strong);
  background: white;
  border-radius: 6px;
  padding: 10px 12px;
  font-weight: 800;
  cursor: pointer;
}

.job-photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.job-photo-thumb {
  display: block;
  width: 300px;
  max-width: 100%;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-soft);
  cursor: pointer;
}

.job-photo-thumb img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.photo-preview-dialog {
  width: min(96vw, 1100px);
  max-width: 96vw;
  padding: 0;
}

.photo-preview-shell {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.photo-preview-shell img {
  display: block;
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.detail-panel {
  align-self: start;
}

.detail-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 22px 18px;
  border-bottom: 1px solid var(--line);
}

#accountsView.company-dashboard-open .detail-header {
  grid-template-columns: auto auto 1fr auto;
}

#jobsView.job-dashboard-open .detail-header {
  grid-template-columns: auto auto 1fr auto;
}

#esimView.esim-dashboard-open .detail-header {
  grid-template-columns: auto 1fr auto;
}

#accountsView.company-dashboard-open .detail-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

#jobsView.job-dashboard-open .detail-list {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

#esimView.esim-dashboard-open .detail-list {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

#jobsView.job-dashboard-open .timeline {
  padding: 22px 24px;
}

#esimView.esim-dashboard-open .timeline {
  padding: 22px 24px;
}

.dashboard-note-editor {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  font: inherit;
}

.back-button {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: white;
  color: var(--teal-dark);
  padding: 8px 12px;
  font-weight: 800;
  cursor: pointer;
}

#backTotemBuildDashboardButton {
  border-color: #ef4444;
  background: #fee2e2;
  color: #991b1b;
}

.star-button {
  border: 0;
  background: transparent;
  color: var(--amber);
  font-size: 28px;
  cursor: pointer;
}

.detail-header h2 {
  font-size: 20px;
}

.company-title-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
}

.detail-header p {
  color: var(--teal-dark);
  font-size: 13px;
  margin: 0;
  font-weight: 400;
}

.detail-header .detail-subline {
  color: var(--muted);
  margin-top: 4px;
}

.job-header-copy {
  min-width: 0;
}

.job-header-summary {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px 22px;
  margin-top: 5px;
  overflow-x: auto;
  color: #425466;
  font-size: 13px;
}

.job-header-summary > span {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}

.job-header-summary strong {
  color: #000;
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
}

.job-header-summary .job-header-company,
#jobDetailTitle {
  color: var(--teal-dark);
  font-weight: 700;
}

#jobsView:not(.job-dashboard-open) .job-header-summary {
  display: grid;
  gap: 4px;
  font-size: 14px;
  line-height: 1.25;
  overflow-x: visible;
}

#jobsView:not(.job-dashboard-open) .job-header-summary > span {
  align-items: baseline;
  display: grid;
  gap: 4px;
  grid-template-columns: minmax(74px, max-content) minmax(0, 1fr);
  min-width: 0;
  white-space: normal;
}

#jobsView:not(.job-dashboard-open) .job-header-summary strong {
  font-size: 14px;
}

#jobsView:not(.job-dashboard-open) .job-header-summary > span > span {
  overflow-wrap: anywhere;
}

#jobsView:not(.job-dashboard-open) .job-work-summary-grid .job-inline-detail-row h3 {
  font-size: 12px;
}

#jobsView:not(.job-dashboard-open) .job-work-summary-grid .job-inline-detail-row [data-job-inline-field] {
  font-size: 11px;
  line-height: 1.25;
}

#jobsView:not(.job-dashboard-open) .detail-header {
  align-items: center;
  display: grid;
  gap: 4px 10px;
  grid-template-columns: auto 1fr auto;
  padding: 18px;
}

#jobsView:not(.job-dashboard-open) .detail-header .star-button {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  line-height: 1;
}

#jobsView:not(.job-dashboard-open) .detail-header .status-pill {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}

#jobsView:not(.job-dashboard-open) .detail-header .job-header-copy {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
}

#jobsView:not(.job-dashboard-open) .job-notes-lines {
  font-size: 10px;
  line-height: 1.3;
}

#jobsView:not(.job-dashboard-open) .job-note-line {
  gap: 3px;
  width: 100%;
}

#jobsView:not(.job-dashboard-open) .job-note-meta {
  flex: 1 1 100%;
  font-size: 10px;
  line-height: 1.15;
  overflow-wrap: anywhere;
  white-space: normal;
}

#jobsView:not(.job-dashboard-open) .job-note-display {
  flex: 1 1 100%;
  font-size: 10px;
  line-height: 1.25;
}

.detail-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 20px 18px;
  border-bottom: 1px solid var(--line);
}

.detail-list div {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
}

.detail-list .totem-detail-order-po {
  align-items: center;
  grid-template-columns: auto max-content auto minmax(0, 1fr);
}

.totem-detail-edit-field select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 6px 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}

.company-detail-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  overflow-x: visible;
  padding-top: 14px;
  padding-bottom: 14px;
}

.company-detail-list .company-contacts-title {
  gap: 0;
}

.company-detail-list .company-contacts-title dt {
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
}

.company-contact-actions {
  margin-left: auto;
}

.company-detail-list div {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  white-space: nowrap;
}

.company-contact-line {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.company-detail-list .company-summary-field {
  display: inline-flex;
}

.company-detail-list .company-address-field {
  display: inline-flex;
}

.company-detail-list .company-status-field {
  display: inline-flex;
}

.company-detail-list dd {
  margin-left: 0;
  border: 1px solid #84cc16;
  border-radius: 5px;
  background: #d9f99d;
  color: #365314;
  padding: 2px 5px;
  font-weight: 800;
  cursor: pointer;
}

.company-detail-list dd[data-no-company-edit] {
  cursor: default;
}

.company-detail-list dt,
.company-detail-list dd {
  font-size: 13px;
}

dt {
  color: var(--muted);
  font-size: 13px;
}

dd {
  margin: 0;
  font-size: 14px;
}

.timeline {
  padding: 8px 18px 24px;
}

#accountsView.company-dashboard-open .timeline {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.timeline h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.timeline h3:not(:first-child) {
  margin-top: 14px;
}

.detail-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.detail-section-heading h3 {
  margin-bottom: 0;
}

.detail-section-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lime-action-button {
  border: 1px solid #84cc16;
  border-radius: 6px;
  background: #d9f99d;
  color: #365314;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.lime-action-button:hover {
  border-color: #65a30d;
  background: #bef264;
}

.blue-action-button {
  border: 1px solid #2563eb;
  border-radius: 6px;
  background: #dbeafe;
  color: #1e3a8a;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.blue-action-button:hover {
  border-color: #1d4ed8;
  background: #bfdbfe;
}

.purple-action-button {
  border: 1px solid #7c3aed;
  border-radius: 6px;
  background: #eadcff;
  color: #4c1d95;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.purple-action-button:hover {
  border-color: #6d28d9;
  background: #ddd6fe;
}

.compact-action-button {
  padding: 6px 10px;
  white-space: nowrap;
}

.signature-dialog {
  max-width: min(94vw, 980px);
  width: min(94vw, 980px);
}

.signature-form {
  display: grid;
  gap: 14px;
}

.signature-order-details {
  display: grid;
  gap: 8px 12px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.signature-order-details div {
  background: #f8fafc;
  border: 1px solid #d8e2ee;
  border-radius: 6px;
  padding: 8px 10px;
}

.signature-order-details span {
  color: #64748b;
  display: block;
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 4px;
}

.signature-order-details strong {
  color: #071632;
  display: block;
  font-size: 14px;
}

#totemSignatureCanvas {
  background: #fff;
  border: 2px solid #0f969c;
  border-radius: 8px;
  display: block;
  height: 300px;
  touch-action: none;
  width: 100%;
}

.signature-hint {
  color: #64748b;
  font-size: 13px;
  margin: -4px 0 0;
}

.totem-station-preview-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.totem-station-preview-list li {
  background: #f8fafc;
  border: 1px solid #d8e2ee;
  border-radius: 6px;
  padding: 8px 10px;
}

.totem-station-preview-list strong {
  color: #006d77;
  display: inline-block;
  min-width: 32px;
}

.totem-station-settings-wrap,
.totem-station-preview-wrap {
  overflow-x: auto;
}

.totem-station-settings-table,
.totem-station-preview-table {
  border-collapse: collapse;
  min-width: 1240px;
  width: 100%;
}

.totem-station-preview-table {
  min-width: 0;
  table-layout: fixed;
}

.totem-station-preview-table th:nth-child(1),
.totem-station-preview-table td:nth-child(1) {
  width: 220px;
}

.totem-station-preview-table th:nth-child(2),
.totem-station-preview-table td:nth-child(2) {
  width: 44px;
}

.totem-station-settings-table th,
.totem-station-settings-table td,
.totem-station-preview-table th,
.totem-station-preview-table td {
  border-bottom: 1px solid #d8e2ee;
  font-size: 12px;
  padding: 6px 8px;
  text-align: left;
}

.totem-station-settings-table th,
.totem-station-preview-table th {
  color: #627089;
  font-weight: 800;
}

.totem-station-settings-table input,
.totem-station-settings-table select {
  border: 1px solid #c8d4e3;
  border-radius: 5px;
  font: inherit;
  min-width: 90px;
  padding: 6px 7px;
  width: 100%;
}

.totem-station-settings-table input[readonly] {
  background: #f8fafc;
}

.totem-station-preview-image-button {
  align-items: center;
  background: transparent;
  border: 0;
  cursor: pointer;
  display: flex;
  justify-content: center;
  padding: 0;
  width: 204px;
}

.totem-station-preview-image {
  display: block;
  height: auto;
  max-height: 56px;
  object-fit: contain;
  width: 200px;
}

.totem-station-preview-generated {
  display: block;
  width: 200px;
}

.totem-station-preview-generated .totem-shape-svg {
  display: block;
  height: auto;
  width: 200px;
}

.totem-preview-actions {
  display: flex;
  gap: 8px;
}

.totem-build-dashboard-panel {
  grid-column: 1 / -1;
  height: 100%;
  margin-bottom: 0;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.totem-build-dashboard-layout {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 60fr) minmax(0, 40fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.totem-build-grid-wrap {
  border: 1px solid var(--line);
  border-radius: 6px;
  height: 100%;
  min-height: 0;
  overflow: auto;
}

.totem-build-info-panel {
  border: 1px solid var(--line);
  border-radius: 6px;
  height: 100%;
  min-height: 0;
  overflow: auto;
  padding: 12px;
}

.totem-build-info-top {
  align-items: start;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 0.92fr) minmax(260px, 1.08fr);
  margin-bottom: 10px;
}

.totem-build-info-heading {
  min-width: 0;
  padding-top: 1.35rem;
}

.totem-build-info-heading h1 {
  color: #071632;
  font-size: 1.22rem;
  font-weight: 900;
  margin: 0 0 3px;
}

.totem-build-info-heading p {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
  margin: 0;
}

.totem-build-info-heading .totem-build-progress {
  color: var(--teal-dark);
  font-size: 1rem;
  font-weight: 900;
  margin-top: 5px;
}

.totem-build-info-sections {
  display: grid;
  gap: 10px;
}

.totem-build-info-section {
  border: 1px solid #d7e2ef;
  border-radius: 6px;
  padding: 8px;
}

.totem-build-info-section h3 {
  align-items: center;
  color: #071632;
  display: flex;
  font-size: 0.86rem;
  font-weight: 900;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 7px;
}

.totem-build-section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.totem-build-section-actions .compact-action-button {
  font-size: 0.72rem;
  padding: 4px 7px;
}

.totem-build-info-panel dl {
  display: grid;
  gap: 6px 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.totem-build-info-panel dl div {
  border-bottom: 1px solid #e8edf4;
  display: grid;
  gap: 6px;
  grid-template-columns: max-content minmax(0, 1fr);
  padding-bottom: 5px;
}

.totem-build-info-panel dl div:nth-last-child(-n + 2) {
  border-bottom: 0;
  padding-bottom: 0;
}

.totem-build-loading-overlay {
  inset: 0;
  min-height: 100%;
}

.totem-build-info-panel .totem-build-order-section dl {
  grid-template-columns: max-content max-content max-content minmax(0, 1fr);
  gap: 5px 8px;
}

.totem-build-info-panel .totem-build-order-section dl div {
  align-items: baseline;
  display: inline-flex;
  gap: 3px;
  min-width: 0;
  white-space: nowrap;
}

.totem-build-info-panel .totem-build-order-section dl div:nth-child(n + 5) {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  grid-column: span 2;
  white-space: normal;
}

.totem-build-info-panel .totem-build-finance-section dl {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
}

.totem-build-info-panel .totem-build-box-section dl {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.totem-build-info-panel .totem-build-box-section dl div {
  grid-template-columns: 1fr;
  gap: 2px;
}

.totem-build-info-panel .totem-build-finance-section dl div {
  grid-template-columns: 1fr;
  gap: 2px;
}

.totem-build-info-panel .totem-build-finance-section dt,
.totem-build-info-panel .totem-build-finance-section dd {
  font-size: 0.66rem;
}

.totem-build-info-panel .totem-build-sage-section dl {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.totem-build-info-panel .totem-build-sage-section dl div {
  align-items: baseline;
  display: inline-flex;
  gap: 3px;
  min-width: 0;
  white-space: nowrap;
}

.totem-build-info-panel .totem-build-sage-section dt,
.totem-build-info-panel .totem-build-sage-section dd {
  font-size: 0.72rem;
}

.totem-build-info-panel dt {
  color: #627089;
  font-size: 0.74rem;
  font-weight: 800;
}

.totem-build-info-panel dd {
  color: #071632;
  font-size: 0.86rem;
  font-weight: 800;
  margin: 0;
  overflow-wrap: anywhere;
}

.totem-build-info-value {
  background: #d9fa8b;
  border: 1px solid #84cc16;
  border-radius: 5px;
  color: #071632;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  max-width: 100%;
  padding: 2px 6px;
  text-align: left;
}

.totem-build-info-value:hover,
.totem-build-info-value:focus-visible {
  background: #bef264;
}

.totem-build-info-input {
  border: 1px solid #9ab0ca;
  border-radius: 5px;
  color: #071632;
  font: inherit;
  font-weight: 800;
  max-width: 100%;
  min-width: 0;
  padding: 2px 6px;
  width: 100%;
}

.totem-build-info-action-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.totem-build-sage-button {
  font-size: 0.74rem;
  padding: 3px 7px;
}

.totem-build-invoice-button {
  background: #bae6fd;
  border: 1px solid #38bdf8;
  border-radius: 6px;
  color: #075985;
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 3px 7px;
}

.totem-build-invoice-button:hover {
  background: #7dd3fc;
}

.totem-invoice-dialog {
  width: min(96vw, 980px);
}

.totem-invoice-dialog .dialog-heading {
  margin-bottom: 10px;
}

.totem-invoice-preview {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  height: min(72vh, 760px);
  width: 100%;
}

.totem-build-customer-preview {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 220px;
}

.totem-build-customer-preview span {
  color: #627089;
  font-size: 0.78rem;
  font-weight: 800;
}

.totem-build-customer-preview .totem-shape-svg {
  display: block;
  height: auto;
  max-width: 260px;
  width: 260px;
}

.totem-build-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin: -4px 0 6px;
}

.totem-build-dashboard-panel .totem-build-actions {
  justify-content: stretch;
  margin: 0 0 10px;
}

.totem-build-dashboard-panel .totem-build-actions .compact-action-button {
  flex: 1 1 76px;
  font-size: 0.78rem;
  min-width: 0;
  padding: 5px 7px;
}

.totem-build-dashboard-panel .totem-build-actions .totem-build-short-button {
  flex: 0 1 52px;
}

.totem-build-dashboard-panel .totem-build-customer-preview {
  cursor: pointer;
  justify-content: flex-end;
  min-width: 0;
  width: 100%;
}

#totemStationDetailDialog[data-mode="default"] .dialog-actions {
  justify-content: flex-end;
}

.totem-build-dashboard-panel .totem-build-customer-preview .totem-shape-svg {
  max-width: 520px;
  width: 100%;
}

.totem-build-dashboard-panel .totem-build-customer-preview .totem-default-production-image {
  display: block;
  height: auto;
  max-width: 520px;
  object-fit: contain;
  width: 100%;
}

@media (max-width: 900px) {
  .totem-build-info-top {
    grid-template-columns: minmax(0, 1fr);
  }

  .totem-build-dashboard-panel .totem-build-customer-preview {
    justify-content: flex-start;
  }
}

.wide-dialog {
  max-width: min(94vw, 900px);
  width: min(94vw, 900px);
}

.totem-build-dashboard-dialog {
  max-height: calc(100vh - 24px);
  max-width: calc(100vw - 24px);
  width: calc(100vw - 24px);
}

.totem-build-dashboard-dialog .customer-form {
  max-height: calc(100vh - 44px);
  overflow: hidden;
}

.totem-build-grid {
  border-collapse: collapse;
  table-layout: auto;
  min-width: 100%;
  width: max-content;
}

.totem-build-grid th,
.totem-build-grid td {
  border-bottom: 1px solid var(--line);
  padding: 6px 7px;
  text-align: left;
  vertical-align: middle;
}

.totem-build-grid th {
  background: #f8fafc;
  color: #627089;
  font-size: 13px;
  font-weight: 800;
  position: sticky;
  top: 0;
}

.totem-build-column-total {
  color: #071632;
  display: block;
  font-size: 1.05rem;
  line-height: 1.1;
  margin-top: 2px;
}

.totem-build-grid td:not(:nth-child(3)),
.totem-build-grid th:not(:nth-child(3)) {
  text-align: center;
  white-space: nowrap;
  width: 1%;
}

.totem-build-grid td:nth-child(1),
.totem-build-grid th:nth-child(1) {
  width: 44px;
}

.totem-build-grid td:nth-child(2),
.totem-build-grid th:nth-child(2) {
  min-width: 250px;
  padding-left: 0;
  padding-right: 0;
  text-align: center;
  width: 250px;
}

.totem-build-grid td:nth-child(3),
.totem-build-grid th:nth-child(3) {
  max-width: 190px;
  min-width: 170px;
  white-space: nowrap;
  width: 190px;
}

.totem-build-grid td:nth-child(3) .inline-text-button {
  display: block;
  font-size: 14px;
  font-weight: 900;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.totem-build-grid td:nth-child(4),
.totem-build-grid th:nth-child(4) {
  min-width: 72px;
}

.totem-build-colour-cell {
  color: var(--teal-dark);
  font-size: 18px;
  font-weight: 800;
}

.totem-build-artwork-button {
  background: #f8fafc;
  border: 1px solid #d8e2ee;
  border-radius: 6px;
  box-sizing: border-box;
  cursor: pointer;
  display: block;
  margin: 0 auto;
  padding: 5px;
  width: 250px;
}

.totem-build-artwork-button .totem-shape-svg {
  max-width: 238px;
}

.totem-build-missing-png-button {
  align-items: center;
  color: #000;
  display: flex;
  font-size: 16px;
  font-weight: 900;
  justify-content: center;
  min-height: 58px;
  text-align: center;
}

.totem-build-missing-png-button span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.totem-production-image {
  display: block;
  height: auto;
  max-height: 92px;
  object-fit: contain;
  width: 100%;
}

.totem-image-required-button {
  background: #fff7ed;
  border: 1px solid #fb923c;
  border-radius: 6px;
  color: #9a3412;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 8px 10px;
  width: 250px;
}

.totem-image-preview-dialog {
  max-width: min(900px, calc(100vw - 32px));
  padding: 16px;
  width: 720px;
}

.totem-image-preview-dialog .dialog-heading {
  padding: 0 2px 12px;
}

.totem-image-preview-body {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #d8e2ee;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  margin: 0 0 16px;
  min-height: 160px;
  padding: 16px;
}

.totem-image-preview-dialog .dialog-actions {
  padding-top: 4px;
}

.totem-image-preview-img,
.totem-image-preview-generated .totem-shape-svg {
  display: block;
  height: auto;
  max-height: 360px;
  max-width: 100%;
  object-fit: contain;
}

.totem-image-preview-generated {
  width: 100%;
}

.totem-25up-carousel-dialog {
  max-width: min(1100px, calc(100vw - 24px));
  width: min(1100px, calc(100vw - 24px));
}

.totem-25up-carousel-dialog .dialog-heading {
  padding: 18px 18px 0;
}

.totem-25up-carousel-dialog .dialog-heading h2 {
  margin: 0;
}

.totem-25up-carousel-dialog .dialog-heading p {
  color: #5b6d86;
  font-weight: 800;
  margin: 3px 0 0;
}

.totem-25up-carousel-body {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 14px 18px;
}

#totem25upCarouselImage {
  background: #f8fafc;
  border: 1px solid #d8e2ee;
  border-radius: 8px;
  display: block;
  max-height: 70vh;
  max-width: 100%;
  object-fit: contain;
  width: 100%;
}

.totem-25up-carousel-dialog .dialog-actions {
  padding: 0 18px 18px;
}

@media (max-width: 700px) {
  .totem-25up-carousel-body {
    grid-template-columns: 1fr;
  }

  .totem-25up-carousel-body .back-button {
    width: 100%;
  }
}

.totem-build-grid input[type="checkbox"] {
  height: 18px;
  width: 18px;
}

.totem-build-box-input {
  border: 1px solid #c8d4e3;
  border-radius: 5px;
  font: inherit;
  padding: 4px 6px;
  width: 8ch;
}

.totem-build-label-button {
  background: #f8fafc;
  border: 1px solid #c8d4e3;
  border-radius: 5px;
  color: #071632;
  cursor: pointer;
  font: inherit;
  padding: 4px 6px;
  text-align: left;
  width: 16ch;
}

.totem-build-label-button:hover {
  background: #eef6ff;
  border-color: #93c5fd;
}

@media (max-width: 900px) {
  .totem-build-dashboard-layout {
    grid-template-columns: 1fr;
  }
}

.stuff-table input,
.stuff-table textarea,
.stuff-table select {
  border: 1px solid #c8d4e3;
  border-radius: 5px;
  font: inherit;
  padding: 5px 6px;
  width: 100%;
}

.stuff-table {
  table-layout: fixed;
  width: 100%;
}

.stuff-table th,
.stuff-table td {
  padding-left: 6px;
  padding-right: 6px;
}

.stuff-table th:nth-child(1),
.stuff-table td:nth-child(1) {
  padding-right: 2px;
  width: 34px;
}

.stuff-table th:nth-child(2),
.stuff-table td:nth-child(2) {
  padding-left: 2px;
}

.stuff-user-initial {
  align-items: center;
  background: #d9f99d;
  border: 1px solid #84cc16;
  border-radius: 999px;
  color: #0f172a;
  display: inline-flex;
  font-weight: 800;
  height: 28px;
  justify-content: center;
  line-height: 1;
  min-width: 28px;
  padding: 0;
  text-align: center;
  width: 28px;
}

.stuff-table th:nth-child(2),
.stuff-table td:nth-child(2),
.stuff-title-cell {
  width: 25%;
}

.stuff-table th:nth-child(3),
.stuff-table td:nth-child(3) {
  width: 25%;
}

.stuff-table th:nth-child(4),
.stuff-table td:nth-child(4) {
  width: 88px;
}

.stuff-table th:nth-child(5),
.stuff-table td:nth-child(5) {
  width: 128px;
}

.stuff-table textarea {
  resize: vertical;
}

.stuff-notes-cell {
  align-items: start;
  display: grid;
  gap: 4px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.stuff-delete-empty-button {
  background: transparent;
  border: 0;
  color: #e11d48;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 5px;
}

.stuff-delete-empty-button:hover {
  transform: scale(1.08);
}

.stuff-table .center-cell {
  text-align: center;
}

.stuff-table .center-cell input {
  width: auto;
}

.stuff-status-select {
  border: 0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  min-width: 64px;
  padding: 5px 10px;
  text-align: center;
  width: auto;
}

.stuff-status-select.status-open-select {
  background: #e9f7ed;
  color: var(--green);
}

.stuff-status-select.status-closed-select {
  background: #ffe4e6;
  border-color: #fb7185;
  color: #9f1239;
}

.stuff-row-complete {
  background: #f8fafc;
  color: #64748b;
}

.calendar-table td {
  vertical-align: top;
}

.calendar-note-cell {
  max-width: 440px;
  white-space: pre-wrap;
}

.totem-shape-preview {
  background: #f8fafc;
  border: 1px solid #d8e2ee;
  border-radius: 8px;
  margin-bottom: 14px;
  padding: 12px;
}

.totem-shape-svg {
  display: block;
  height: auto;
  max-width: 760px;
  width: 100%;
}

#totemStationDetailDialog {
  width: min(860px, calc(100vw - 32px));
}

.totem-station-setup-grid {
  display: grid;
  gap: 7px 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.totem-station-setup-grid label {
  color: #627089;
  font-size: 12px;
  font-weight: 800;
}

.totem-station-setup-grid > label,
.totem-detail-colour-line > label {
  align-items: center;
  display: grid;
  gap: 4px;
  grid-template-columns: max-content minmax(0, 1fr);
}

.totem-station-setup-grid input,
.totem-station-setup-grid select {
  border: 1px solid #c8d4e3;
  border-radius: 6px;
  color: #071632;
  font: inherit;
  margin-top: 1px;
  padding: 6px 8px;
  width: 100%;
}

.totem-quantity-station-line {
  align-items: end;
  display: grid;
  gap: 5px;
  grid-column: 1 / -1;
  grid-template-columns: max-content max-content max-content max-content max-content;
}

.totem-quantity-station-line label {
  align-items: center;
  display: flex;
  gap: 2px;
}

.totem-quantity-station-line .top-stacked-field,
.totem-quantity-station-line .totem-option-field {
  align-items: center;
  display: grid;
  gap: 2px;
  grid-template-columns: 1fr;
  justify-items: center;
}

.top-cmyk-line label {
  justify-items: center;
}

.totem-quantity-station-line input {
  margin-top: 0;
}

.totem-quantity-field input {
  width: 4ch;
}

.totem-station-field input {
  min-width: 8ch;
  max-width: 100%;
  width: auto;
}

.totem-option-field {
  width: max-content;
}

.totem-option-field select {
  min-width: 18ch;
  width: 18ch;
}

.totem-colour-field {
  width: max-content;
}

.totem-detail-colour-line,
.totem-detail-cmyk-picker {
  grid-column: auto;
}

.totem-custom-colour-name-field input {
  width: 14ch;
}

.totem-detail-colour-line {
  align-items: end;
  display: grid;
  gap: 5px;
  grid-template-columns: max-content max-content;
}

.totem-text-line-editor {
  display: grid;
  gap: 4px 4px;
  grid-column: 1 / -1;
  grid-template-columns: max-content max-content max-content max-content max-content;
}

.totem-text-line-editor label {
  align-items: center;
  display: grid;
  gap: 2px;
  grid-template-columns: max-content minmax(0, 1fr);
}

#totemStationDetailForm .totem-text-line-editor label {
  grid-template-columns: max-content max-content;
}

.totem-text-line-editor input[name$="Font"],
.totem-text-line-editor input[name="font"] {
  width: 10ch;
}

.totem-text-line-editor input[name$="FontSize"],
.totem-text-line-editor input[name="fontSize"],
.totem-text-line-editor input[name$="TextSpacing"],
.totem-text-line-editor input[name="textSpacing"],
.totem-text-line-editor input[name$="FontWidth"],
.totem-text-line-editor input[name="fontWidth"] {
  width: 5ch;
}

.totem-text-line-editor input {
  min-width: 0;
}

.totem-text-line-editor input[name="topLine"],
.totem-text-line-editor input[name="text"],
.totem-text-line-editor input[name="extraMiddleLine"],
.totem-text-line-editor input[name="bottomLine"] {
  min-width: 8ch;
  max-width: 42ch;
  text-align: right;
  width: var(--totem-line-text-width, 10ch);
}

#totemStationDetailForm .totem-text-line-editor > label:nth-child(5n + 1) {
  justify-content: end;
  width: 100%;
}

.totem-text-line-editor input[type="number"] {
  width: 100%;
}

.totem-colour-picker {
  display: grid;
  gap: 2px;
  min-width: 0;
  width: max-content;
}

.totem-colour-picker select {
  border: 1px solid #c8d4e3;
  border-radius: 5px;
  font: inherit;
  padding: 6px 7px;
  min-width: 7ch;
  width: 7ch;
}

.totem-colour-select-wrap {
  align-items: center;
  display: flex;
  gap: 4px;
}

.lime-icon-button {
  align-items: center;
  background: #bef264;
  border: 1px solid #84cc16;
  border-radius: 5px;
  color: #064e3b;
  cursor: pointer;
  display: inline-flex;
  font-weight: 900;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.totem-colour-edit-wrap {
  max-height: 360px;
  overflow-y: auto;
  overflow-x: hidden;
}

#totemColourDialog {
  width: min(420px, calc(100vw - 32px));
}

#totemColourForm {
  width: 100%;
}

.totem-colour-edit-table {
  border-collapse: collapse;
  display: block;
  width: 100%;
}

.totem-colour-edit-table thead,
.totem-colour-edit-table tbody {
  display: block;
}

.totem-colour-edit-table tr {
  align-items: center;
  display: grid;
  gap: 4px;
  grid-template-columns: var(--totem-colour-name-width, 8ch) 52px 52px 52px 52px;
  width: max-content;
}

.totem-colour-edit-table th,
.totem-colour-edit-table td {
  border-bottom: 1px solid #d8e2ee;
  display: block;
  padding: 3px 0;
  text-align: left;
  white-space: nowrap;
}

.totem-colour-edit-table input {
  border: 1px solid #c8d4e3;
  border-radius: 5px;
  font: inherit;
  padding: 6px 7px;
}

.totem-colour-name-input {
  box-sizing: border-box;
  width: 100%;
}

.totem-colour-cmyk-input {
  width: 48px;
}

.ncr-form {
  display: grid;
  gap: 10px 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0 20px 18px;
}

.ncr-form label {
  color: #627089;
  display: grid;
  font-size: 12px;
  font-weight: 800;
  gap: 4px;
}

.ncr-form input,
.ncr-form select {
  border: 1px solid #c8d4e3;
  border-radius: 6px;
  color: #071632;
  font: inherit;
  padding: 8px 10px;
  width: 100%;
}

.ncr-preview-actions {
  display: grid;
  gap: 8px;
  grid-column: 1 / -1;
  margin: 0 0 4px;
}

.ncr-save-actions,
.ncr-blue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ncr-preview-actions .compact-action-button {
  font-size: 13px;
  padding-left: 9px;
  padding-right: 9px;
}

.ncr-save-actions {
  flex-wrap: nowrap;
  gap: 6px;
}

.ncr-blue-actions {
  flex-wrap: nowrap;
}

.ncr-perf-actions {
  display: inline-flex;
  gap: 8px;
}

.ncr-pdf-name {
  color: #627089;
  font-size: 13px;
  grid-column: 1 / -1;
  margin: -2px 0 4px;
  order: 30;
  white-space: nowrap;
}

.ncr-preview-details > .ncr-perf-list {
  grid-column: 1 / -1;
  order: 31;
}

.ncr-preview-contact-line {
  color: #071632;
  font-size: 13px;
  font-weight: 800;
  margin-top: 2px;
}

.ncr-preview-layout {
  display: grid;
  gap: 10px;
}

.ncr-preview-layout.portrait {
  align-items: stretch;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.ncr-preview-layout.landscape {
  grid-template-columns: minmax(0, 1fr);
}

.ncr-preview-details {
  align-content: start;
  align-items: start;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 6px 4px;
  grid-template-columns: repeat(6, max-content);
  padding: 10px;
}

.ncr-preview-details label {
  max-width: 100%;
  min-width: 0;
  width: max-content;
}

.ncr-preview-details .ncr-contact-field,
.ncr-preview-details .ncr-mobile-field,
.ncr-preview-details .ncr-company-field {
  display: none;
}

.ncr-preview-details .ncr-name-field {
  grid-column: 1;
  grid-row: 2;
}

.ncr-preview-details .ncr-type-field {
  grid-column: 2;
  grid-row: 2;
}

.ncr-preview-details .ncr-invoice-field {
  grid-column: 3;
  grid-row: 2;
}

.ncr-inline-row {
  align-items: start;
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  grid-column: 1 / -1;
}

.ncr-preview-details .ncr-inline-row > label {
  grid-column: auto;
  grid-row: auto;
}

.ncr-count-row {
  grid-row: 3;
}

.ncr-layout-row {
  grid-row: 4;
}

.ncr-sheet-row {
  grid-row: 5;
}

.ncr-preview-details .ncr-sets-field {
  grid-column: 1;
  grid-row: 3;
}

.ncr-preview-details .ncr-sheets-in-set-field {
  grid-column: 2;
  grid-row: 3;
}

.ncr-preview-details .ncr-total-field {
  grid-column: 3;
  grid-row: 3;
}

.ncr-preview-details .ncr-total-field input {
  min-width: 4ch;
}

.ncr-preview-details .ncr-prefix-field {
  grid-column: 4;
  grid-row: 3;
}

.ncr-preview-details .ncr-start-field {
  grid-column: 5;
  grid-row: 3;
}

.ncr-preview-details .ncr-end-field {
  grid-column: 6;
  grid-row: 3;
}

.ncr-preview-details .ncr-sheet-size-field {
  grid-column: 1;
  grid-row: 4;
}

.ncr-preview-details .ncr-orientation-field {
  grid-column: 2;
  grid-row: 4;
}

.ncr-preview-details .ncr-font-name-field {
  grid-column: 3;
  grid-row: 4;
}

.ncr-preview-details .ncr-font-size-field {
  grid-column: 4;
  grid-row: 4;
}

.ncr-preview-details .ncr-top-sheet-field {
  grid-column: 1;
  grid-row: 5;
}

.ncr-preview-details .ncr-middle-sheet-field {
  grid-column: 2;
  grid-row: 5;
}

.ncr-preview-details .ncr-bottom-sheet-field {
  grid-column: 3;
  grid-row: 5;
}

.ncr-preview-details input,
.ncr-preview-details select {
  field-sizing: content;
  max-width: 100%;
  min-width: 6ch;
  width: auto;
}

.ncr-preview-layout.landscape .ncr-preview-details {
  grid-template-columns: repeat(6, max-content);
}

.ncr-preview-detail-item {
  min-width: 0;
}

.ncr-preview-detail-item span {
  color: #627089;
  display: block;
  font-size: 11px;
  font-weight: 800;
}

.ncr-preview-detail-item strong {
  color: #071632;
  display: block;
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.ncr-preview-wrap {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
  min-height: 420px;
  overflow: auto;
  padding: 10px;
}

.ncr-sheet-side-label {
  background: transparent;
  border: 0;
  color: #071632;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  padding: 0;
  text-align: left;
  width: 100%;
}

.ncr-preview-layout.portrait .ncr-preview-wrap {
  min-height: 520px;
}

.ncr-preview-svg {
  max-height: none;
  max-width: 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.ncr-sheet-layer {
  stroke: #94a3b8;
  stroke-width: 1;
}

.ncr-preview-side-toggle {
  cursor: pointer;
}

.ncr-side-peek-sheet {
  filter: drop-shadow(0 2px 2px rgba(15, 23, 42, .18));
  stroke: #64748b;
  stroke-width: 1.2;
}

.ncr-side-peek-label {
  fill: #475569;
  font-size: 11px;
  font-weight: 800;
  pointer-events: none;
}

.ncr-perf-line {
  cursor: grab;
  stroke: #0f172a;
  stroke-dasharray: 7 5;
  stroke-width: 2;
}

.ncr-perf-line-back {
  opacity: .35;
  stroke: #64748b;
}

.ncr-perf-hit {
  cursor: grab;
  opacity: 0;
  stroke: transparent;
  stroke-width: 18;
}

.ncr-number-marker {
  cursor: grab;
  fill: #071632;
  font-family: Arial, sans-serif;
  font-size: 20px;
  font-weight: 800;
  paint-order: stroke;
  stroke: #ffffff;
  stroke-width: 4px;
  user-select: none;
}

.ncr-number-hit {
  cursor: grab;
  fill: transparent;
}

.ncr-active-sheet-hit {
  cursor: pointer;
  fill: transparent;
}

.ncr-perf-list {
  color: #44546a;
  display: grid;
  font-size: 13px;
  gap: 5px;
  margin-top: 0;
}

.ncr-perf-list span {
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow-wrap: anywhere;
  padding: 0;
}

.split-actions {
  align-items: center;
  display: flex;
  justify-content: flex-end;
}

.split-actions span {
  display: flex;
  gap: 10px;
}

#totemColourForm .split-actions {
  gap: 10px;
}

.totem-cmyk-picker {
  display: grid;
  gap: 2px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.totem-cmyk-picker.hidden {
  display: none;
}

.totem-cmyk-picker label {
  align-items: center;
  color: #627089;
  display: grid;
  font-size: 11px;
  gap: 2px;
}

.totem-cmyk-picker input {
  min-width: 0;
  padding: 4px;
  width: 40px;
}

.totem-detail-colour-line .totem-cmyk-picker {
  grid-column: auto;
  grid-template-columns: repeat(4, minmax(54px, 1fr));
  min-width: 230px;
}

.totem-station-detail-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.totem-station-detail-list dd {
  word-break: break-word;
}

@media (max-width: 820px) and (orientation: portrait) {
  .signature-order-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .totem-detail-colour-line {
    grid-template-columns: 1fr;
  }

  #totemSignatureCanvas {
    height: 240px;
  }
}

@media (max-width: 980px) and (orientation: landscape) {
  .signature-dialog {
    max-width: 96vw;
    width: 96vw;
  }

  .signature-order-details {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  #totemSignatureCanvas {
    height: 260px;
  }
}

.detail-table-wrap {
  overflow-x: auto;
}

#accountsView:not(.company-dashboard-open) .detail-table-wrap {
  max-height: calc(100vh - 470px);
  min-height: 120px;
  overflow-y: auto;
}

#accountsView.company-dashboard-open .detail-table-wrap {
  flex: 1;
  min-height: 120px;
  overflow-y: auto;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.detail-table th,
.detail-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 6px;
  text-align: left;
  vertical-align: top;
}

.detail-table th {
  color: var(--muted);
  font-weight: 800;
}

#accountsView.company-dashboard-open .detail-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
}

.detail-table tr.primary-contact-row,
.detail-table tr.owner-contact-row {
  background: #f3e8ff;
  color: #4c1d95;
}

.detail-table tr.primary-contact-row td,
.detail-table tr.owner-contact-row td {
  border-bottom-color: #d8b4fe;
}

.detail-table tr.primary-contact-row .account-link,
.detail-table tr.owner-contact-row .account-link {
  color: #6d28d9;
}

.detail-table tr.permission-contact-row {
  background: #dbeafe;
  color: #1e3a8a;
}

.detail-table tr.permission-contact-row td {
  border-bottom-color: #bfdbfe;
}

.detail-table tr.permission-contact-row .account-link {
  color: #1d4ed8;
}

.detail-table tr.active-contact-row {
  background: #dcfce7;
  color: #14532d;
}

.detail-table tr.active-contact-row td {
  border-bottom-color: #bbf7d0;
}

.detail-table tr.active-contact-row .account-link {
  color: #15803d;
}

.detail-table tr.inactive-contact-row {
  background: #ffe4e6;
  color: #881337;
}

.detail-table tr.inactive-contact-row td {
  border-bottom-color: #fecdd3;
}

.detail-table tr.inactive-contact-row .account-link {
  color: #be123c;
}

.company-dashboard-only-column {
  display: none;
}

#accountsView.company-dashboard-open .company-dashboard-only-column {
  display: table-cell;
}

#accountsView.company-dashboard-open .detail-table.hide-active-column .active-filter-column {
  display: none;
}

.contact-note-column {
  width: 100%;
  min-width: 260px;
}

.company-contact-name-column {
  width: 1%;
  min-width: 150px;
  white-space: nowrap;
}

.company-contact-mobile-column {
  width: 1%;
  min-width: 120px;
  white-space: nowrap;
}

.company-contact-email-column {
  width: 1%;
  min-width: 190px;
  white-space: nowrap;
}

.contact-note-display {
  min-height: 30px;
  max-height: 48px;
  overflow-y: auto;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 5px 8px;
  cursor: text;
  white-space: pre-wrap;
  line-height: 1.35;
}

.contact-note-display:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.6);
}

.contact-note-editor {
  display: grid;
  gap: 6px;
}

.contact-note-editor textarea {
  width: 100%;
  min-height: 72px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: 6px 8px;
  background: white;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  resize: vertical;
}

.contact-note-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.contact-note-save,
.contact-note-cancel {
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: white;
  padding: 4px 8px;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.contact-note-save {
  border-color: #84cc16;
  background: #d9f99d;
  color: #365314;
}

.inline-grid-select {
  width: 100%;
  min-width: 104px;
  height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: white;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.compact-select-column,
.compact-yes-no-column {
  width: 1%;
  white-space: nowrap;
}

.compact-select-column .inline-grid-select {
  width: auto;
  min-width: 118px;
}

.compact-yes-no-column .inline-grid-select {
  width: auto;
  min-width: 82px;
}

#accountsView.company-dashboard-open .primary-yes-no-column {
  width: 66px;
}

#accountsView.company-dashboard-open .primary-yes-no-column .primary-yes-no-select {
  width: 66px;
  min-width: 66px;
}

#accountsView.company-dashboard-open .active-yes-no-column {
  width: 52px;
}

#accountsView.company-dashboard-open .active-yes-no-column .active-yes-no-select {
  width: 52px;
  min-width: 52px;
}

.yes-no-select {
  border-width: 1px;
}

.yes-no-select-yes {
  border-color: #65a30d;
  background: #bef264;
  color: #365314;
}

.yes-no-select-no {
  border-color: #e11d48;
  background: #fecdd3;
  color: #881337;
}

.preview-copy {
  margin: 0;
  white-space: pre-wrap;
  color: #2c3a4f;
}

.job-notes-lines {
  display: block;
  line-height: 1.7;
  overflow: visible;
  white-space: normal;
  width: 100%;
}

.job-notes-detail-row {
  display: block;
  width: 100%;
}

.job-note-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  overflow: visible;
  line-height: 1.4;
  white-space: normal;
}

.job-note-line > * {
  flex: 0 0 auto;
}

.job-note-text {
  flex: 0 1 auto;
  width: auto;
  min-width: 0;
  max-width: none;
  overflow: visible;
  padding: 0 4px;
  border: 1px solid transparent;
  border-radius: 4px;
  white-space: nowrap;
  cursor: text;
}

.job-note-text::before {
  content: "—";
  margin-right: 8px;
  color: var(--muted);
}

.job-note-text:hover {
  border-color: var(--line-strong);
  background: #f8fafc;
}

.job-note-text::before {
  content: none;
  margin-right: 0;
}

.job-note-text-input {
  flex: 1 1 auto;
  width: auto;
  max-width: 100%;
  min-width: 0;
  height: 32px;
}

.job-note-remove {
  display: none;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border: 1px solid #fca5a5;
  border-radius: 50%;
  background: #fff1f2;
  color: #b91c1c;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.job-note-line:has(.job-note-text-input) .job-note-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.timeline .job-note-display {
  flex: 1 1 auto;
  min-width: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  color: #2c3a4f;
  padding: 0;
  text-align: left;
  overflow-wrap: anywhere;
  white-space: normal;
  cursor: text;
}

.timeline .job-note-meta {
  color: #000;
  display: inline;
  flex: 0 0 auto;
  font-size: 15px;
  font-weight: 800;
  margin-top: 0;
  white-space: nowrap;
}

.timeline .job-note-text-input {
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  min-height: 40px;
  resize: vertical;
  white-space: normal;
}

.timeline .job-note-remove {
  display: none;
  align-items: center;
  justify-content: center;
}

.job-inline-detail-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 38px;
}

.job-work-summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.job-work-summary-grid .job-inline-detail-row {
  display: block;
  min-height: 0;
}

.job-work-summary-grid .job-inline-detail-row h3 {
  font-size: 13px;
  line-height: 1.2;
  margin-bottom: 4px;
  white-space: nowrap;
}

.job-work-summary-grid .job-inline-detail-row [data-job-inline-field] {
  display: block;
  font-size: 12px;
  line-height: 1.35;
  overflow: visible;
  padding: 0;
  text-overflow: clip;
  white-space: pre-wrap;
  width: 100%;
}

#jobsView.job-dashboard-open .job-work-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

#jobsView.job-dashboard-open .job-work-summary-grid .job-inline-detail-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: max-content minmax(0, 1fr);
  min-height: 38px;
}

#jobsView.job-dashboard-open .job-work-summary-grid .job-inline-detail-row h3 {
  font-size: 16px;
  line-height: normal;
  margin-bottom: 0;
}

#jobsView.job-dashboard-open .job-work-summary-grid .job-inline-detail-row [data-job-inline-field] {
  font-size: 13px;
  line-height: normal;
  overflow: hidden;
  padding: 7px 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-inline-detail-row h3 {
  margin: 0;
}

.job-inline-detail-row [data-job-inline-field] {
  min-width: 0;
  overflow: hidden;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 5px;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: text;
}

.job-inline-detail-row [data-job-inline-field]:hover {
  border-color: var(--line-strong);
  background: #f8fafc;
}

.job-inline-detail-input {
  width: 100%;
  min-width: 0;
  height: 36px;
}

.timeline ol {
  display: grid;
  gap: 16px;
  margin: 0;
  padding-left: 20px;
}

.timeline li::marker {
  color: var(--teal);
}

.timeline li {
  color: #2c3a4f;
}

.timeline span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.timeline .job-notes-lines,
.timeline .job-note-line,
.timeline .job-note-text {
  color: #2c3a4f;
  display: block;
  font-size: 13px;
  margin-top: 0;
  white-space: normal;
}

.timeline .job-note-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}

.timeline .job-note-text {
  flex: 0 1 auto;
  overflow: visible;
  width: auto;
}

.timeline .job-note-remove {
  margin-top: 0;
}

dialog {
  width: min(520px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 24px 70px rgba(23, 32, 51, 0.22);
}

#contactDialog {
  width: min(980px, calc(100vw - 32px));
}

dialog::backdrop {
  background: rgba(23, 32, 51, 0.38);
}

form {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.dialog-heading,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dialog-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.dialog-id-badge {
  border: 1px solid #84cc16;
  border-radius: 5px;
  background: #d9f99d;
  color: #365314;
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.dialog-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.dialog-heading-actions button:not(.primary-button) {
  border: 1px solid var(--line-strong);
  background: white;
  border-radius: 6px;
  padding: 10px 14px;
  cursor: pointer;
}

.dialog-heading-actions .primary-button {
  padding: 10px 14px;
}

form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.job-form label {
  grid-template-columns: 130px minmax(0, 1fr);
  align-items: center;
}

.ticket-form label {
  grid-template-columns: 130px minmax(0, 1fr);
  align-items: center;
}

.ticket-customer-row,
.ticket-category-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.ticket-customer-row button,
.ticket-category-row button {
  min-height: 40px;
  border: 1px solid var(--line-strong);
  background: white;
  border-radius: 6px;
  padding: 0 12px;
  color: var(--teal-dark);
  font-weight: 800;
  cursor: pointer;
}

.customer-form label {
  grid-template-columns: 130px minmax(0, 1fr);
  align-items: center;
}

.contact-form-summary {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
}

.contact-form-summary span {
  align-items: center;
  color: var(--text-muted);
  display: inline-flex;
  font-size: 0.92rem;
  font-weight: 800;
  gap: 5px;
}

.contact-form-summary strong {
  background: var(--lime-soft);
  border: 1px solid var(--lime-border);
  border-radius: 6px;
  color: var(--teal-dark);
  line-height: 1.2;
  padding: 2px 7px;
}

#totemStationDetailForm .totem-station-setup-grid > label,
#totemStationDetailForm .totem-detail-colour-line > label {
  gap: 4px;
  grid-template-columns: max-content minmax(0, 1fr);
}

#totemStationDetailForm .totem-quantity-station-line label {
  gap: 2px;
}

#totemStationDetailForm .totem-quantity-station-line .totem-option-field {
  grid-template-columns: 1fr;
  justify-items: center;
}

#totemStationDetailForm .totem-cmyk-picker label {
  align-items: center;
  display: grid;
  gap: 2px;
  grid-template-columns: 1fr;
  justify-items: center;
}

#totemStationDetailForm .totem-cmyk-picker input {
  min-width: 0;
  width: 50px;
}


.ticket-form label textarea {
  min-width: 0;
}

#quickTicketDialog {
  overflow-x: hidden;
  width: min(520px, calc(100vw - 40px));
}

.quick-ticket-form {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  width: 100%;
}

.quick-ticket-form *,
.quick-ticket-form *::before,
.quick-ticket-form *::after {
  box-sizing: border-box;
}

.quick-ticket-form label {
  grid-template-columns: 100px minmax(0, 1fr);
  align-items: center;
  min-width: 0;
}

.quick-ticket-form input,
.quick-ticket-form select,
.quick-ticket-form textarea,
.quick-ticket-form button {
  min-width: 0;
  max-width: 100%;
}

.quick-ticket-contact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
}

.lime-icon-button {
  align-items: center;
  background: #d9f99d;
  border: 1px solid #84cc16;
  border-radius: 6px;
  color: #365314;
  cursor: pointer;
  display: inline-flex;
  font-size: 22px;
  font-weight: 900;
  justify-content: center;
  min-height: 40px;
}

.quick-ticket-suggestions {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
  display: grid;
  gap: 6px;
  margin-left: 100px;
  max-height: 240px;
  overflow-y: auto;
  padding: 6px;
  position: relative;
  z-index: 5;
}

.quick-ticket-suggestions[hidden] {
  display: none;
}

.quick-ticket-suggestion {
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  text-align: left;
}

.quick-ticket-suggestion strong {
  color: var(--teal-dark);
}

.quick-ticket-suggestion span,
.quick-ticket-selected {
  color: var(--muted);
  font-size: 13px;
}

.quick-ticket-suggestion:hover,
.quick-ticket-suggestion:focus {
  border-color: var(--teal);
  outline: none;
}

@media (max-width: 560px) {
  .quick-ticket-suggestions {
    margin-left: 0;
  }
}

.quick-ticket-selected {
  background: #ecfeff;
  border: 1px solid #99f6e4;
  border-radius: 6px;
  margin: 0;
  padding: 8px 10px;
}

.quick-ticket-contact-display {
  background: #ecfeff;
  border: 1px solid #99f6e4;
  border-radius: 6px;
  color: var(--teal-dark);
  cursor: pointer;
  display: grid;
  gap: 4px;
  padding: 8px 10px;
}

.quick-ticket-contact-display span {
  overflow-wrap: anywhere;
}

.quick-ticket-contact-display strong {
  color: #041832;
  font-weight: 900;
  margin-right: 6px;
}

.quick-ticket-summary {
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 6px;
  padding: 9px 10px;
}

.quick-ticket-summary.editable {
  cursor: pointer;
}

.quick-ticket-summary div {
  align-items: baseline;
  display: grid;
  gap: 8px;
  grid-template-columns: 66px minmax(0, 1fr);
}

.quick-ticket-summary strong {
  color: #041832;
  font-size: 12px;
  font-weight: 900;
}

.quick-ticket-summary span {
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.quick-ticket-detail-step,
.quick-ticket-contact-step {
  display: grid;
  gap: 12px;
}

.quick-ticket-contact-details {
  display: grid;
  gap: 10px;
}

.quick-ticket-company-choice {
  display: grid;
  gap: 10px;
}

.quick-ticket-detail-step[hidden],
.quick-ticket-contact-step[hidden],
.quick-ticket-contact-display[hidden],
.quick-ticket-contact-details[hidden],
.quick-ticket-company-choice[hidden] {
  display: none;
}

.customer-form label textarea {
  min-width: 0;
}

#contactForm .contact-note-field {
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 6px;
  width: min(100ch, 100%);
  justify-self: stretch;
}

#contactForm .contact-note-field textarea {
  width: 100%;
}

#hardwareForm .contact-note-field {
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 6px;
  width: 100%;
}

#hardwareForm .contact-note-field textarea {
  width: 100%;
}

.job-form label textarea {
  min-width: 0;
}

.job-form .job-wide-textarea {
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px;
}

.job-map-dialog {
  width: min(900px, calc(100vw - 32px));
}

.job-map-dialog form {
  gap: 12px;
}

.map-help {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.map-picker-toolbar,
.job-map-heading,
.job-map-heading > span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.map-picker-toolbar {
  justify-content: center;
}

.map-picker-toolbar button,
.job-map-heading button {
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: white;
  padding: 0 12px;
  cursor: pointer;
  font-weight: 800;
}

.job-map-heading {
  justify-content: space-between;
  flex-wrap: wrap;
}

.slippy-map {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #dce8ec;
  user-select: none;
  touch-action: none;
}

.map-picker {
  height: min(520px, 62vh);
  cursor: crosshair;
}

.job-form-map {
  height: 420px;
}

.job-dashboard-map-section {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.job-dashboard-map-section[hidden] {
  display: none;
}

.job-dashboard-map-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.job-dashboard-map-heading h3 {
  margin: 0;
}

.job-dashboard-map-heading span {
  color: var(--muted);
  font-size: 12px;
}

.job-dashboard-map-heading button {
  padding: 8px 12px;
}

.job-dashboard-map-heading #exitJobDashboardMapDrawingButton {
  margin-left: auto;
}

.job-dashboard-map-heading select,
.job-map-heading select,
.map-picker-toolbar select {
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: white;
  padding: 0 9px;
  font-weight: 700;
}

.map-tool-active {
  border-color: var(--teal) !important;
  background: #dff8fa !important;
  color: var(--teal-dark) !important;
}

.map-colour-palette {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: white;
}

.map-colour-palette .map-colour {
  width: 25px;
  min-width: 25px;
  height: 25px;
  min-height: 25px;
  padding: 0;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--map-colour);
  box-shadow: 0 0 0 1px #9ca3af;
}

.map-colour-palette .map-colour.selected {
  box-shadow: 0 0 0 3px var(--teal);
}

.job-dashboard-map {
  height: 420px;
}

#jobDashboardMapCanvas {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.job-dashboard-map.drawing-active #jobDashboardMapCanvas {
  pointer-events: auto;
  cursor: crosshair;
  touch-action: none;
}

.map-tiles,
.map-tiles img {
  position: absolute;
}

.map-tiles {
  inset: 0;
}

.map-tiles img {
  width: 256px;
  height: 256px;
  max-width: none;
  pointer-events: none;
}

.map-marker {
  position: absolute;
  z-index: 3;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 3px solid white;
  border-radius: 50% 50% 50% 0;
  background: #e11d48;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.38);
  transform: rotate(-45deg);
  pointer-events: none;
}

.map-attribution {
  position: absolute;
  right: 4px;
  bottom: 3px;
  z-index: 5;
  padding: 2px 4px;
  background: rgba(255, 255, 255, 0.82);
  color: #425466;
  font-size: 10px;
}

.job-map-section {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.job-map-section[hidden] {
  display: none;
}

#jobMapDrawingCanvas {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

.job-form textarea[name="workRequired"],
.job-form textarea[name="siteAddress"],
.job-form textarea[name="materials"],
.job-form textarea[name="workCarriedOut"] {
  height: auto;
  min-height: 56px;
}

.job-inline-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.job-inline-fields label {
  grid-template-columns: 78px minmax(0, 1fr);
}

.job-created-category {
  grid-template-columns: minmax(0, 3fr) minmax(0, 1.4fr);
}

.job-created-category label,
.job-form .job-compact-label {
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px;
}

.job-created-category #jobEditCategorySlot {
  grid-column: 2;
}

.job-created-category.created-hidden {
  display: none;
}

.job-title-category {
  grid-template-columns: minmax(0, calc(65% - 6px)) minmax(0, calc(35% - 6px));
}

.job-title-category label {
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px;
}

#jobCreateCategorySlot {
  min-width: 0;
}

#jobCategoryField {
  gap: 4px;
  width: 100%;
}

#jobCategorySelect {
  min-width: 0;
  width: 100%;
}

.job-form .customer-picker label {
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px;
}

.job-contact-mobile {
  grid-template-columns: minmax(0, 2fr) minmax(16ch, 3fr) minmax(0, 3fr);
}

.job-form:not(.contact-first-mode) .job-contact-mobile {
  grid-template-columns: minmax(0, 1.2fr) minmax(18ch, 1fr);
}

.job-contact-mobile label {
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px;
}

.job-contact-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  position: relative;
}

.job-contact-entry.show-add {
  grid-template-columns: minmax(0, 1fr) 34px;
}

.job-contact-entry input.missing-value {
  border-color: var(--red);
  color: var(--red);
}

.job-contact-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 60;
  display: grid;
  width: min(420px, calc(100vw - 72px));
  max-height: 260px;
  overflow-y: auto;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.job-contact-suggestions[hidden] {
  display: none;
}

.job-contact-suggestion {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.job-contact-suggestion:hover,
.job-contact-suggestion:focus-visible {
  background: #eefbfc;
  outline: none;
}

.job-contact-suggestion strong {
  font-size: 14px;
}

.job-contact-suggestion small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.totem-contact-suggestions {
  display: grid;
  gap: 4px;
  max-height: 230px;
  margin-top: 6px;
  overflow-y: auto;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.totem-contact-suggestions[hidden] {
  display: none;
}

.totem-contact-suggestion {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.totem-contact-suggestion:hover,
.totem-contact-suggestion:focus-visible {
  background: #eefbfc;
  outline: none;
}

.totem-contact-suggestion strong {
  font-size: 14px;
}

.totem-contact-suggestion small,
.totem-contact-suggestion-empty {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.totem-contact-suggestion-empty {
  padding: 8px 10px;
}

.job-form:not(.contact-first-mode) .job-contact-email-field {
  display: none;
}

#jobForm.contact-first-mode > :not(.dialog-heading):not(input[type="hidden"]):not(.job-contact-mobile):not(.customer-picker):not(.job-title-category) {
  display: none;
}

#jobForm.contact-first-mode {
  min-height: min(360px, calc(100vh - 32px));
  align-content: start;
}

#jobForm.contact-first-mode:not(.contact-selected) > .customer-picker {
  display: none;
}

#jobForm.contact-first-mode:not(.job-company-selected) > .job-title-category {
  display: none;
}

#jobForm.contact-first-mode .dialog-heading-actions .primary-button {
  display: none;
}

#jobForm.contact-first-mode > .job-title-category {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

#jobForm.contact-first-mode #jobCreateCategorySlot {
  display: none;
}

#jobForm.contact-first-mode .job-contact-mobile {
  grid-template-columns: minmax(0, 1fr);
}

#jobForm.contact-first-mode .job-contact-picker {
  width: fit-content;
  max-width: 100%;
}

#jobForm.contact-first-mode .job-contact-entry input {
  width: var(--job-contact-input-width, 18ch);
  max-width: 100%;
}

#jobForm.contact-first-mode:not(.contact-selected) .job-contact-mobile label:not(.job-contact-picker) {
  display: none;
}

#jobForm.contact-first-mode.contact-selected > .customer-picker {
  display: grid;
}

#jobForm.contact-first-mode.contact-selected .job-contact-mobile {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

#jobForm.contact-first-mode.contact-selected .job-contact-picker {
  grid-column: 1 / -1;
}

#jobForm.contact-first-mode.contact-selected .job-contact-email-field {
  grid-column: 2;
}

.job-triple-fields {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
}

.job-triple-fields label {
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px;
}

.customer-inline-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.customer-inline-fields label {
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px;
}

.customer-name-status {
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 0.7fr);
}

.customer-contact-phone {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
}

.customer-email-office {
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.2fr) minmax(0, 1fr);
}

.customer-address-town {
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
}

.customer-address-town.town-is-longer {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
}

form input,
form select,
form textarea {
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 12px;
}

form textarea {
  min-height: 96px;
  padding: 10px 12px;
  resize: vertical;
}

.customer-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.customer-picker input.customer-missing,
.customer-picker select.customer-missing,
.ticket-customer-row input.customer-missing {
  color: var(--red);
  border-color: var(--red);
  font-weight: 800;
}

.customer-picker button {
  min-height: 40px;
  border: 1px solid #84cc16;
  background: #d9f99d;
  border-radius: 6px;
  padding: 0 12px;
  color: #365314;
  font-weight: 800;
  cursor: pointer;
}

.customer-picker button:hover {
  border-color: #65a30d;
  background: #bef264;
}

.scan3d-view .panel-toolbar {
  align-items: center;
}

.scan3d-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) 260px;
  padding: 18px;
}

.scan3d-viewer-panel {
  background: #07111f;
  border: 1px solid #0f2438;
  border-radius: 8px;
  min-height: 640px;
  overflow: hidden;
  position: relative;
}

.scan3d-viewer-toolbar {
  align-items: center;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid var(--line);
  color: #172033;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: space-between;
  padding: 10px 12px;
  position: relative;
  z-index: 2;
}

.scan3d-viewer-toolbar span {
  color: var(--muted);
  font-size: 13px;
}

#scan3dCanvas {
  display: block;
  height: calc(100% - 43px);
  min-height: 590px;
  touch-action: none;
  width: 100%;
}

.scan3d-help {
  bottom: 10px;
  color: rgba(255, 255, 255, .82);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 10px;
  left: 12px;
  position: absolute;
  z-index: 2;
}

.scan3d-help span {
  background: rgba(2, 6, 23, .62);
  border: 1px solid rgba(148, 163, 184, .35);
  border-radius: 999px;
  padding: 4px 8px;
}

.scan3d-info-panel {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.scan3d-info-panel h2 {
  font-size: 18px;
  margin-bottom: 12px;
}

.scan3d-info-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.scan3d-info-list div {
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.scan3d-info-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.scan3d-info-list dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}

.scan3d-saved-header {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 14px;
}

.scan3d-saved-header h3 {
  font-size: 16px;
  margin: 0 0 10px;
}

.scan3d-saved-list {
  display: grid;
  gap: 8px;
  max-height: 270px;
  overflow-y: auto;
}

.scan3d-saved-item {
  align-items: flex-start;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #041832;
  cursor: pointer;
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  text-align: left;
}

.scan3d-saved-item:hover,
.scan3d-saved-item:focus {
  border-color: var(--teal);
  outline: none;
}

.scan3d-saved-item strong {
  color: var(--teal-dark);
}

.scan3d-saved-item span {
  color: var(--muted);
  font-size: 12px;
}

body.scan3d-maximized .topbar,
body.scan3d-maximized .metrics,
body.scan3d-maximized #scan3dView > .accounts-panel > .panel-toolbar,
body.scan3d-maximized .scan3d-info-panel {
  display: none;
}

body.scan3d-maximized .content-grid {
  padding: 0;
}

body.scan3d-maximized #scan3dView {
  display: block;
}

body.scan3d-maximized #scan3dView > .accounts-panel {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  height: 100vh;
}

body.scan3d-maximized .scan3d-layout {
  display: block;
  height: 100vh;
  padding: 0;
}

body.scan3d-maximized .scan3d-viewer-panel {
  border: 0;
  border-radius: 0;
  height: 100vh;
  min-height: 100vh;
}

body.scan3d-maximized #scan3dCanvas {
  height: calc(100vh - 43px);
  min-height: 0;
}

body.login-page,
body.login-page * {
  max-inline-size: 100%;
}

body.login-page {
  inline-size: 100%;
  min-inline-size: 0;
  overflow-x: hidden !important;
}

body.login-page .login-card {
  inline-size: min(420px, calc(100vw - 32px)) !important;
  max-inline-size: calc(100vw - 32px) !important;
  min-inline-size: 0 !important;
  overflow: hidden !important;
}

body.login-page .login-form,
body.login-page .login-form label {
  inline-size: 100% !important;
  max-inline-size: 100% !important;
  min-inline-size: 0 !important;
  overflow: hidden;
}

body.login-page .login-form input,
body.login-page .login-form button,
body.login-page .login-form .primary-button {
  box-sizing: border-box !important;
  inline-size: 100% !important;
  max-inline-size: 100% !important;
  min-inline-size: 0 !important;
}

body.login-page.login-step-pin .login-card,
body.login-page.login-step-pin-only .login-card {
  inline-size: min(340px, calc(100vw - 32px)) !important;
  max-inline-size: calc(100vw - 32px) !important;
}

body.login-page.login-step-pin .login-form,
body.login-page.login-step-pin-only .login-form {
  inline-size: 100% !important;
  max-inline-size: 100% !important;
}

body.login-page.login-step-pin .pin-form input,
body.login-page.login-step-pin .pin-form button,
body.login-page.login-step-pin-only .pin-form input,
body.login-page.login-step-pin-only .pin-form button {
  inline-size: 100% !important;
  max-inline-size: 100% !important;
  min-inline-size: 0 !important;
}

@media (max-width: 560px) {
  body.login-page .login-card {
    inline-size: min(340px, calc(100vw - 32px)) !important;
    max-inline-size: calc(100vw - 32px) !important;
  }
}

.dialog-actions {
  justify-content: flex-end;
  padding-top: 8px;
}

.dialog-actions button:not(.primary-button) {
  border: 1px solid var(--line-strong);
  background: white;
  border-radius: 6px;
  padding: 10px 14px;
  cursor: pointer;
}

@media (max-width: 1050px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .module-picker {
    display: flex;
  }

  .topbar {
    grid-template-columns: auto minmax(140px, 1fr) auto auto;
  }

  .metrics {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }

  .search {
    width: 100%;
    min-width: 0;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .scan3d-layout {
    grid-template-columns: 1fr;
  }

  .scan3d-viewer-panel {
    min-height: 480px;
  }

  #scan3dCanvas {
    min-height: 430px;
  }

  .customer-picker {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

@media (max-width: 760px) {
  .topbar,
  .content-grid {
    padding-left: 14px;
    padding-right: 14px;
  }

  .metrics {
    display: grid;
    gap: 8px;
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 0;
  }

  .metrics article {
    grid-template-columns: max-content auto;
    min-height: 42px;
    padding: 8px 7px;
  }

  .metrics span {
    font-size: 12px;
  }

  .metrics strong {
    font-size: 22px;
  }

  .metrics small {
    display: none;
  }

  .topbar {
    grid-template-columns: auto minmax(120px, 0.5fr) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
  }

  .module-picker {
    grid-column: 2;
    grid-row: 1;
    justify-self: start;
    width: 100%;
    min-width: 0;
  }

  .module-picker span {
    display: none;
  }

  .search {
    grid-column: 3;
    grid-row: 1;
    width: 100%;
    min-width: 0;
  }

  .module-picker select {
    width: 100%;
  }

  .connection,
  .logout-button,
  .user-chip {
    display: none;
  }

  .mobile-todo-button {
    align-items: center;
    background: #d9f99d;
    border: 1px solid #84cc16;
    border-radius: 999px;
    color: #0f3b20;
    cursor: pointer;
    display: inline-flex;
    font-size: 13px;
    font-weight: 900;
    height: 38px;
    justify-content: center;
    padding: 0 10px;
  }

  .mobile-todo-button:hover {
    background: #bef264;
    border-color: #65a30d;
  }

  .mobile-calendar-button {
    align-items: center;
    background: #d9f99d;
    border: 1px solid #84cc16;
    border-radius: 999px;
    color: #0f3b20;
    cursor: pointer;
    display: inline-flex;
    font-size: 13px;
    font-weight: 900;
    height: 38px;
    justify-content: center;
    padding: 0 10px;
  }

  .mobile-calendar-button:hover {
    background: #bef264;
    border-color: #65a30d;
  }

  .mobile-refresh-button {
    align-items: center;
    background: #d9f99d;
    border: 1px solid #84cc16;
    border-radius: 50%;
    color: #0f3b20;
    cursor: pointer;
    display: inline-flex;
    font-size: 22px;
    font-weight: 900;
    height: 38px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    width: 38px;
  }

  .mobile-refresh-button:hover {
    background: #bef264;
    border-color: #65a30d;
  }

  .user-menu {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    gap: 6px;
  }

  .panel-toolbar {
    grid-template-columns: max-content minmax(0, auto);
    align-items: start;
    justify-content: start;
  }

  .panel-toolbar.has-new-action {
    grid-template-columns: max-content max-content minmax(0, 1fr);
    gap: 6px 8px;
  }

  .panel-toolbar.has-new-action > .toolbar-new-action {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
  }

  .panel-toolbar.has-new-action h1,
  .panel-toolbar.has-new-action .contacts-heading-row {
    grid-column: 2;
    grid-row: 1;
  }

  .panel-toolbar.has-new-action > .toolbar-actions,
  .panel-toolbar.has-new-action > .ticket-toolbar-actions {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    min-width: 0;
  }

  .panel-toolbar.has-new-action p {
    grid-column: 2 / -1;
  }

  .primary-button {
    width: 100%;
  }

  .panel-toolbar > .primary-button,
  .panel-toolbar .toolbar-actions .primary-button,
  .panel-toolbar .ticket-toolbar-actions .primary-button,
  .panel-toolbar .lime-action-button {
    width: auto;
  }

  #jobForm .customer-picker {
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: end;
  }

  #jobForm .job-contact-mobile {
    grid-template-columns: 1fr;
  }

  #jobForm .job-contact-mobile label {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  #jobDialog .dialog-heading {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  #jobDialog .dialog-heading h2 {
    grid-column: 1;
    grid-row: 1;
    margin: 0;
    text-align: center;
  }

  #jobDialog .dialog-heading-actions {
    display: grid;
    grid-template-columns: 1fr;
    grid-column: 1 / -1;
    grid-row: 2;
    margin-left: 0;
    justify-items: center;
  }

  #jobDialog .dialog-heading-actions .primary-button {
    display: none;
  }

  #jobDialog .dialog-heading-actions button:not(.primary-button) {
    grid-row: 1;
    width: min(80%, 420px);
  }

  #jobForm .mobile-job-submit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    width: min(80%, 420px);
  }

  #jobDialog .icon-button {
    grid-column: 2;
    grid-row: 1;
  }

  #jobForm .customer-picker label {
    min-width: 0;
  }

  #jobForm label,
  #ticketForm label,
  #accountForm label,
  #contactForm label,
  #accountContactForm label,
  #contactCompanyForm label {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 6px;
    justify-self: center;
    width: min(80%, 420px);
  }

  #jobForm .job-inline-fields,
  #jobForm .customer-picker,
  #ticketForm .ticket-customer-row,
  #accountForm .customer-inline-fields,
  #contactForm .customer-inline-fields {
    justify-items: center;
  }

  #jobForm .job-contact-entry,
  #jobForm .customer-picker,
  #ticketForm .ticket-customer-row,
  #accountContactForm .contact-company-row,
  #contactCompanyForm .contact-company-row,
  #contactForm .contact-company-row {
    width: min(80%, 420px);
    justify-self: center;
  }

  #jobForm label .job-contact-entry,
  #accountContactForm label .contact-company-row,
  #contactCompanyForm label .contact-company-row,
  #contactForm label .contact-company-row {
    width: 100%;
  }

  #addJobCustomerButton {
    width: 44px;
    min-width: 44px;
    padding: 0;
    overflow: hidden;
    color: transparent;
    font-size: 0;
  }

  #addJobCustomerButton::before {
    content: "+";
    color: #365314;
    font-size: 22px;
    line-height: 1;
  }

  #jobForm .job-title-category {
    grid-template-columns: 1fr;
  }

  #jobCreateCategorySlot {
    grid-row: 2;
  }

  #jobForm .job-title-category label,
  #jobForm #jobCategoryField {
    grid-template-columns: 1fr;
  }

  #jobForm #jobCategoryField {
    width: min(100%, 840px);
  }

  .ticket-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
  }

  .mobile-ticket-job-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid #84cc16;
    border-radius: 6px;
    background: #d9f99d;
    color: #365314;
    font-weight: 900;
    cursor: pointer;
  }

  .mobile-ticket-job-button:hover {
    border-color: #65a30d;
    background: #bef264;
  }

  .mobile-job-button {
    align-items: center;
    background: #d9f99d;
    border: 1px solid #84cc16;
    border-radius: 999px;
    box-shadow: none;
    color: #0f3b20;
    cursor: pointer;
    display: inline-flex;
    font-size: 13px;
    font-weight: 900;
    height: 38px;
    justify-content: center;
    padding: 0 10px;
    width: auto;
  }

  .mobile-job-button:hover {
    border-color: #65a30d;
    background: #bef264;
  }

  .mobile-call-ticket-button {
    align-items: center;
    background: #d9f99d;
    border: 1px solid #84cc16;
    border-radius: 999px;
    box-shadow: none;
    color: #0f3b20;
    cursor: pointer;
    display: inline-flex;
    font-size: 13px;
    font-weight: 900;
    height: 38px;
    justify-content: center;
    padding: 0 10px;
    width: auto;
  }

  #quickTicketDialog {
    width: min(420px, calc(100vw - 34px));
  }

  #quickTicketForm {
    padding: 16px;
  }

  #quickTicketForm label {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  #quickTicketForm .primary-button {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .topbar {
    grid-template-columns: minmax(112px, auto) minmax(0, 1fr);
    row-gap: 8px;
  }

  .user-menu {
    grid-column: 1 / -1;
    grid-row: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }

  .module-picker {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
  }

  .search {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
  }

  .metrics {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .user-menu::-webkit-scrollbar {
    display: none;
  }
}
