:root {
  color-scheme: light;
  --app-viewport-width: 100vw;
  --app-viewport-height: 100dvh;
  --app-viewport-offset-top: 0px;
  --app-browser-bottom-offset: 0px;
  --app-keyboard-clearance: 0px;
  --ink: #17212b;
  --muted: #607080;
  --line: #d9e0e6;
  --panel: #ffffff;
  --page: #f4f7f8;
  --blue: #1769aa;
  --primary: #1769aa;
  --green: #24745c;
  --amber: #a96512;
  --red: #b03a48;
  --violet: #6651a6;
  --shadow: 0 14px 40px rgba(20, 33, 43, 0.08);
  --input-bg: #ffffff;
  --button-bg: #ffffff;
  --soft-panel: #fbfcfd;
  --active-bg: #eef7ff;
  --header-bg: rgba(250, 252, 253, 0.96);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f5f7f9;
  --muted: #a8b3bd;
  --line: #303941;
  --panel: #181d22;
  --page: #0d1014;
  --blue: #4fb6ff;
  --primary: #4fb6ff;
  --green: #55c79a;
  --amber: #f1b45f;
  --red: #ff7b8a;
  --violet: #a99bff;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
  --input-bg: #11161b;
  --button-bg: #1d242b;
  --soft-panel: #151a20;
  --active-bg: #162d3f;
  --header-bg: rgba(13, 16, 20, 0.96);
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: var(--page);
  color: var(--ink);
  letter-spacing: 0;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

:root[data-theme="dark"] img[src*="agentic_interflow_logo"] {
  filter: drop-shadow(0 0 10px rgba(88, 181, 255, 0.12));
}

body.workspace-body {
  height: 100vh;
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.72;
}

.compact-qty {
  max-width: 90px;
}

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

.sidebar {
  background: #13202b;
  color: #eef5f7;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 6px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.brand-logo {
  display: block;
  width: 190px;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #36a87d, #2475b8);
  font-weight: 800;
}

.brand strong {
  display: block;
  font-size: 16px;
}

.brand span {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: #aebdc8;
}

.login-logo {
  display: block;
  width: min(300px, 78vw);
  height: auto;
}

.page-logo {
  display: block;
  width: 220px;
  max-width: 80vw;
  height: auto;
  margin-bottom: 10px;
}

.sr-message:empty {
  display: none;
}

.tenant-picker label,
.field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.field-message {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--red);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.field-message.success {
  color: var(--green);
}

.field-message.neutral {
  color: var(--muted);
}

.field-message.error {
  color: var(--red);
}

.field-message:empty {
  display: none;
}

.tenant-picker label {
  color: #aebdc8;
}

.tenant-picker select,
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 11px;
  background: #fff;
  color: var(--ink);
}

.tenant-picker select {
  background: #1b2d3a;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
}

.nav {
  display: grid;
  gap: 5px;
}

.nav button {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  min-height: 42px;
  padding: 9px 10px;
  border-radius: 7px;
  color: #d7e1e8;
  background: transparent;
  text-align: left;
}

.nav button:hover,
.nav button.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.nav .count {
  font-size: 12px;
  color: #9db0be;
}

.sidebar-note {
  margin-top: auto;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
  line-height: 1.45;
  color: #c9d6dd;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  background: rgba(244, 247, 248, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.title h1 {
  margin: 0;
  font-size: 23px;
  line-height: 1.15;
}

.title p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn {
  min-height: 38px;
  padding: 9px 12px;
  border-radius: 7px;
  background: #e7edf1;
  color: var(--ink);
}

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

.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
}

.btn.danger {
  border-color: rgba(239, 68, 68, 0.5);
  color: #ef4444;
}

.content {
  padding: 22px 24px 36px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi,
.panel,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.kpi {
  padding: 16px;
}

.kpi span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.kpi strong {
  display: block;
  margin-top: 8px;
  font-size: 27px;
}

.kpi small {
  display: block;
  margin-top: 7px;
  color: var(--green);
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 16px;
}

.panel {
  overflow: hidden;
}

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

.panel-head h2 {
  margin: 0;
  font-size: 16px;
}

.panel-head .meta {
  min-width: 0;
  overflow-wrap: anywhere;
}

.panel-body {
  padding: 16px;
}

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

.table th,
.table td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 14px;
}

.table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.compact-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.compact-table th,
.compact-table td {
  padding: 6px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  background: #e8eef3;
  color: #334554;
}

.badge.green { background: #e4f3ed; color: var(--green); }
.badge.amber { background: #fff0db; color: var(--amber); }
.badge.red { background: #fae6e8; color: var(--red); }
.badge.blue { background: #e4f0fa; color: var(--blue); }
.badge.violet { background: #ece8f8; color: var(--violet); }
.badge.developer {
  background: #172033;
  color: #ffffff;
  letter-spacing: 0;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}

.authorization-stack {
  display: grid;
  gap: 14px;
}

.authorization-stack > .card,
.history-section {
  min-width: 0;
}

.history-section .cards {
  margin-top: 10px;
}

.card {
  padding: 15px;
  box-shadow: none;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.selected-card {
  border-color: #b8d8f4;
  background: #f7fbff;
}

.section-subhead {
  margin: 18px 0 4px;
  font-size: 16px;
}

.section-subhead span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  margin-left: 8px;
}

.developer-tools-strip {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 14px;
  background: #10202d;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.account-tenant-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.account-tenant-name {
  font-weight: 700;
}

.tenant-onboarding-card {
  max-width: 860px;
  margin: 18px auto;
}

.filemaker-import-card {
  max-width: 960px;
  margin: 18px auto;
}

.filemaker-preview {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.filemaker-mapping-preview {
  display: grid;
  gap: 16px;
}

.filemaker-preview-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.filemaker-preview-summary div,
.filemaker-table-card,
.filemaker-field-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.filemaker-preview-summary strong {
  display: block;
  font-size: 24px;
}

.filemaker-preview-summary span,
.filemaker-field-row span,
.filemaker-field-row small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.filemaker-warning-list {
  border: 1px solid #f8c7a5;
  border-radius: 8px;
  background: #fff7ed;
  padding: 10px 12px;
  color: #9a3412;
}

.filemaker-warning-list p {
  margin: 4px 0;
}

.filemaker-table-grid,
.filemaker-field-list {
  display: grid;
  gap: 12px;
}

.card-header.compact {
  margin-bottom: 8px;
}

.filemaker-sample-list {
  display: grid;
  gap: 8px;
}

.filemaker-sample-list details,
.filemaker-field-row {
  border: 1px solid #d7e4ee;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.filemaker-sample-list summary,
.filemaker-field-group summary {
  cursor: pointer;
  font-weight: 700;
}

.filemaker-sample-list dl {
  display: grid;
  grid-template-columns: minmax(120px, 190px) minmax(0, 1fr);
  gap: 6px 10px;
  margin: 10px 0 0;
}

.filemaker-sample-list dt {
  color: var(--muted);
  font-weight: 700;
}

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

.filemaker-field-grid {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  background: #e8f3ff;
  color: #0f5f9f;
  font-size: 12px;
  font-weight: 700;
}

.tenant-logo-preview {
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f8fafc;
}

.tenant-logo-preview img {
  max-width: 220px;
  max-height: 64px;
  object-fit: contain;
}

.tenant-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
}

.tenant-row img,
.tenant-logo-fallback {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.tenant-logo-fallback {
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e8f3ff;
  color: #0f5f9f;
  font-weight: 800;
}

.form-status {
  margin-top: 12px;
  color: #31516f;
}

.form-status.error {
  color: #b42318;
}

.developer-tools-strip a {
  color: #dff0ff;
  text-decoration: none;
  white-space: nowrap;
  padding: 6px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
}

.workspace-shell {
  height: 100vh;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--page);
  touch-action: manipulation;
}

.workspace-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(160px, 320px) auto minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 4px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 28px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--button-bg);
  color: var(--ink);
  font-size: 0;
  font-weight: 800;
}

.theme-toggle span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  place-items: center;
  min-width: 28px;
  min-height: 24px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
}

.theme-toggle .theme-option.light {
  background: #fff;
  color: #121820;
}

.theme-toggle .theme-option.dark {
  background: #020304;
  color: #ffd35d;
}

.theme-toggle b {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1;
}

.theme-toggle em {
  display: none;
  font-style: normal;
}

.theme-toggle span.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(79, 182, 255, 0.22), 0 0 13px rgba(79, 182, 255, 0.18);
}

.workspace-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  white-space: nowrap;
}

.workspace-actions > .btn {
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 8px;
  line-height: 1;
}

.fast-pass-menu {
  position: relative;
  display: inline-flex;
}

.fast-pass-menu-button {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.02;
}

.fast-pass-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  width: min(360px, 88vw);
  display: grid;
  gap: 1px;
  overflow: hidden;
  padding: 6px;
  border: 1px solid rgba(209, 217, 230, 0.9);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.96);
  color: #111827;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.28), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
  backdrop-filter: blur(18px);
}

.fast-pass-menu-panel button {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 11px;
  background: #ffffff;
  color: #111827;
  font: inherit;
  font-size: 15px;
  font-weight: 850;
  text-align: center;
  padding: 10px 12px;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(17, 24, 39, 0.06);
}

.fast-pass-menu-panel button:hover,
.fast-pass-menu-panel button:focus-visible {
  background: #eaf5ff;
  outline: none;
}

.fast-pass-menu-panel button:active {
  background: #d9efff;
  transform: scale(0.99);
}

.fast-pass-menu-panel button:last-child {
  margin-top: 5px;
  color: #b42318;
}

.time-clock-menu {
  position: relative;
}

.time-clock-menu summary {
  list-style: none;
  cursor: pointer;
}

.time-clock-menu summary::-webkit-details-marker {
  display: none;
}

.time-clock-button {
  cursor: pointer;
  font-family: inherit;
}

.time-clock-button:disabled {
  cursor: wait;
  opacity: 0.78;
}

.time-clock-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--button-bg);
  color: var(--ink);
}

.time-clock-chip strong {
  width: 100%;
  font-size: 11px;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.time-clock-chip em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  line-height: 1;
}

.time-clock-chip.clocked_in {
  border-color: rgba(48, 209, 88, 0.45);
  background: rgba(48, 209, 88, 0.14);
  color: #69e98f;
  box-shadow: 0 0 14px rgba(48, 209, 88, 0.12);
}

.time-clock-chip.clocked_out,
.time-clock-chip.break,
.time-clock-chip.lunch {
  border-color: rgba(255, 77, 79, 0.48);
  background: rgba(255, 77, 79, 0.14);
  color: #ff9d9f;
  box-shadow: 0 0 14px rgba(255, 77, 79, 0.10);
}

.time-clock-actions {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  display: grid;
  min-width: 210px;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.time-clock-actions button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--button-bg);
  color: var(--ink);
  font-weight: 900;
}

.time-clock-actions p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  white-space: normal;
}

.swipe-hint {
  display: none;
}

.pane-edge-control {
  display: none;
}

.workspace-actions div {
  min-width: 0;
}

.workspace-logo {
  flex: 0 0 auto;
  width: auto;
  min-width: 132px;
  max-width: min(260px, 30vw);
  height: 46px;
  max-height: calc(var(--topbar-height) - 10px);
  object-fit: contain;
  object-position: left center;
}

.header-notification {
  justify-self: stretch;
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  min-height: 36px;
  overflow: hidden;
  border: 1px solid rgba(255, 214, 10, 0.62);
  border-radius: 999px;
  background: linear-gradient(110deg, rgba(255, 214, 10, 0.92), rgba(255, 161, 22, 0.94), rgba(255, 214, 10, 0.92));
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 12px 28px rgba(255, 177, 0, 0.18);
  color: #171717;
  font-weight: 950;
  white-space: nowrap;
  cursor: pointer;
  animation: header-alert-warn 3.4s ease-in-out infinite;
}

.header-notification.critical {
  border-color: rgba(255, 73, 73, 0.72);
  background: linear-gradient(110deg, rgba(255, 214, 10, 0.92), rgba(255, 111, 0, 0.96), rgba(218, 32, 32, 0.94));
  animation: header-alert-critical 2.7s ease-in-out infinite;
}

.header-notification span {
  display: inline-block;
  min-width: 100%;
  padding: 0 18px;
  text-align: center;
  animation: header-alert-scroll 12s linear infinite;
}

@keyframes header-alert-warn {
  0%, 100% { filter: brightness(0.94); }
  50% { filter: brightness(1.18); }
}

@keyframes header-alert-critical {
  0%, 100% { filter: brightness(0.96); box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 10px 30px rgba(255, 177, 0, 0.18); }
  50% { filter: brightness(1.2); box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 10px 34px rgba(255, 54, 54, 0.30); }
}

@keyframes header-alert-scroll {
  0% { transform: translateX(18%); }
  50% { transform: translateX(-18%); }
  100% { transform: translateX(18%); }
}

.workspace-actions strong,
.workspace-actions span,
.tenant-identity strong,
.tenant-identity span,
.module-identity strong,
.module-identity span {
  display: block;
}

.module-identity strong {
  font-size: 18px;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-identity span,
.tenant-identity span {
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tenant-identity {
  display: block;
  max-width: 260px;
  text-align: right;
}

.tenant-identity strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.05;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tenant-identity em {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tenant-identity b {
  color: var(--primary);
  font-size: 10px;
}

.tenant-location-menu {
  position: relative;
  min-width: 0;
}

.tenant-location-menu summary {
  display: block;
  list-style: none;
  cursor: pointer;
}

.tenant-location-menu summary::-webkit-details-marker {
  display: none;
}

.location-menu-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  display: grid;
  gap: 6px;
  width: min(280px, 86vw);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.location-menu-list button {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--button-bg);
  color: var(--ink);
  text-align: left;
}

.location-menu-list button.active {
  border-color: var(--primary);
  background: var(--active-bg);
}

.location-menu-list span {
  color: var(--muted);
  font-size: 11px;
}

.module-identity {
  min-width: 0;
  max-width: 520px;
}

.recent-strip {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  min-width: 0;
  overflow: hidden;
}

.recent-strip span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.recent-strip button {
  min-width: 0;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--button-bg);
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
  padding: 3px 7px;
  cursor: pointer;
}

.tenant-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--button-bg);
}

.tenant-chip img {
  width: 42px;
  max-height: 24px;
  object-fit: contain;
}

.tenant-chip span,
.tenant-chip strong {
  display: block;
}

.tenant-chip span {
  color: var(--muted);
  font-size: 10px;
}

.tenant-chip strong {
  font-size: 13px;
}

.workspace-account {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: end;
}

.pane-nav {
  display: none;
  grid-template-columns: minmax(92px, 1fr) auto minmax(92px, 1fr);
  align-items: center;
  gap: 8px;
}

.pane-nav button {
  min-height: 36px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--button-bg);
  color: var(--ink);
  text-align: left;
}

.pane-nav button:last-child {
  text-align: right;
}

.pane-nav button span,
.pane-nav button strong {
  display: block;
}

.pane-nav button span {
  color: var(--muted);
  font-size: 11px;
}

.pane-nav button strong {
  margin-top: 2px;
  font-size: 12px;
}

.pane-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 34px;
}

.pane-dots button {
  width: 6px;
  height: 6px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #a9bac8;
  opacity: 0.7;
}

.pane-dots button.active {
  width: 15px;
  background: var(--primary);
  opacity: 1;
}

.pane-bottom-dots {
  display: none;
}

.workspace-error {
  margin: 12px 18px 0;
  padding: 12px;
  border: 1px solid #efb9c0;
  border-radius: 7px;
  background: #fff5f6;
  color: var(--red);
}

.workspace-loading {
  min-height: calc(100vh - 48px);
  display: grid;
  place-items: center;
  color: var(--muted);
}

.workspace-panes {
  height: calc(100vh - 48px);
  height: calc(100dvh - 48px);
  display: grid;
  grid-template-columns: 360px minmax(390px, 1fr) minmax(390px, 1fr);
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.workspace-panes::-webkit-scrollbar {
  display: none;
}

.workspace-panes.no-detail-pane {
  grid-template-columns: 360px minmax(390px, 1fr);
}

.workspace-pane {
  min-width: 0;
  overflow-y: auto;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  padding: 18px;
  border-right: 1px solid var(--line);
}

.workspace-pane.split-pane-scroll {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.workspace-pane.split-pane-scroll > .pane-scroll-body {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: 12px;
  padding-bottom: 18px;
  -webkit-overflow-scrolling: touch;
}

.module-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  padding: 10px;
  background: color-mix(in srgb, var(--page) 78%, var(--panel));
}

.module-pane *,
.module-pane .workspace-record {
  min-width: 0;
}

.module-pane .record-groups,
.module-results {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.detail-pane {
  background: var(--panel);
}

.communications-pane {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.communications-pane > .communications-shell,
.communications-pane > .communication-thread {
  height: 100%;
  min-height: 0;
}

.pane-sticky {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: -18px -18px 10px;
  padding: 10px 18px 12px;
  background: inherit;
  border-bottom: 1px solid var(--line);
}

.module-pane .pane-sticky {
  margin: -10px -10px 8px;
  padding: 10px;
  position: static;
}

.pane-sticky h2,
.pane-title h1,
.workspace-section h2,
.record-group h3 {
  margin: 0;
}

.pane-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.pane-title h1 {
  font-size: 21px;
  line-height: 1.2;
}

.pane-title p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.pane-context {
  flex: 0 0 auto;
  max-width: 42%;
  padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--blue) 62%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--blue) 18%, var(--panel));
  color: var(--blue);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.pane-context.stat {
  max-width: 46%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

.module-list,
.workspace-tabs {
  display: grid;
  grid-template-columns: repeat(4, 78px);
  justify-content: center;
  gap: 8px;
}

.module-list {
  margin-top: 8px;
}

.workspace-tabs {
  margin: 0 0 14px;
  max-width: 100%;
  overflow: visible;
}

.module-list button,
.workspace-tabs button {
  display: grid;
  align-items: center;
  justify-items: center;
  gap: 3px;
  width: 78px;
  height: 78px;
  aspect-ratio: auto;
  min-height: 0;
  padding: 6px 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--button-bg);
  color: var(--ink);
  text-align: center;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.workspace-tabs button.no-icon {
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
}

.workspace-tabs button.no-icon strong,
.workspace-tabs button.no-icon span {
  justify-self: center;
}

.workspace-tabs button.no-icon strong {
  font-size: 12px;
}

.workspace-tabs button.no-icon span {
  font-size: 12px;
  color: var(--ink);
}

.module-icon {
  order: 2;
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.82;
}

.module-list button span,
.workspace-tabs button strong {
  order: 1;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.module-list button.active,
.workspace-tabs button.active {
  border-color: color-mix(in srgb, var(--blue) 68%, var(--line));
  background: var(--active-bg);
  color: var(--blue);
}

.module-list button.active .module-icon,
.workspace-tabs button.active .module-icon {
  opacity: 1;
}

.module-list small,
.workspace-tabs button span {
  order: 3;
  min-height: 11px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.1;
}

.module-actions {
  display: grid;
  gap: 8px;
  margin-top: 0;
}

.module-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
  margin-top: 8px;
}

.module-tools .module-actions .btn {
  min-height: 32px;
  padding: 6px 10px;
  white-space: nowrap;
}

.mobile-module-search-results {
  display: none;
}

.workspace-search {
  display: block;
  margin-top: 0;
}

.module-search-toggle {
  width: 100%;
  min-height: 32px;
  margin-top: 0;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--button-bg);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.workspace-search input,
.pane-search input {
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--input-bg);
  color: var(--ink);
  font-size: 13px;
}

.search-status {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.search-status:empty {
  display: none;
}

.mobile-search-sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  padding: 24px;
  background: rgba(0, 0, 0, 0.42);
}

.mobile-search-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: min(620px, calc(100vw - 48px));
  max-height: min(760px, calc(100vh - 48px));
  min-height: 0;
  overflow: hidden;
  place-self: start center;
  border-radius: 18px;
  background: #f8fafc;
  color: #111827;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}

.mobile-search-header {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 8px;
  align-items: end;
  padding: 10px 10px 8px;
  border-bottom: 1px solid #d1d5db;
}

.mobile-search-header button {
  min-width: 34px;
  min-height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #111827;
  font-size: 17px;
  font-weight: 900;
}

.mobile-search-header label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.mobile-search-header span {
  overflow: hidden;
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.mobile-search-header input {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #94a3b8;
  border-radius: 11px;
  background: #fff;
  color: #111827;
  font-size: 17px;
}

.mobile-search-sheet-status {
  margin: 0;
  padding: 7px 12px;
  border-bottom: 1px solid #e5e7eb;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.mobile-search-results {
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
  -webkit-overflow-scrolling: touch;
}

.mobile-search-results .record-groups,
.mobile-search-results .module-results,
.mobile-search-results .workspace-section {
  display: grid;
  gap: 8px;
  margin: 0;
}

.mobile-search-results .record-group {
  margin-bottom: 8px;
}

.mobile-search-results .workspace-record,
.mobile-search-results .workspace-card {
  background: #fff;
  color: #111827;
  border-color: #cbd5e1;
}

.pane-search {
  display: block;
  margin: -2px 0 10px;
}

.mobile-search-launcher {
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--input-bg);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.mobile-search-launcher span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-groups,
.record-group,
.workspace-section,
.quick-links {
  display: grid;
  gap: 10px;
}

.record-group {
  margin-bottom: 18px;
}

.record-group h3,
.workspace-section h2 {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.empty-list {
  margin: 0;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
}

.schedule-context-strip span {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.schedule-toolbar,
.schedule-detail-actions,
.schedule-period-actions,
.schedule-approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.schedule-toolbar {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  justify-content: space-between;
  min-width: 0;
}

.schedule-pane > .pane-sticky {
  position: sticky;
  top: -18px;
  z-index: 8;
  margin: -18px -18px 8px;
  padding: 7px 10px 8px;
  background: var(--panel);
  box-shadow: 0 10px 22px color-mix(in srgb, var(--page) 42%, transparent);
}

.schedule-compact-header {
  display: flex;
  max-width: 100%;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.schedule-compact-header::-webkit-scrollbar {
  display: none;
}

.schedule-compact-title {
  display: flex;
  flex: 1 1 auto;
  min-width: 76px;
  align-items: baseline;
  white-space: nowrap;
}

.schedule-compact-title strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.1;
}

.schedule-compact-title span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-view-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--button-bg) 72%, var(--panel));
}

.schedule-view-toggle button {
  min-height: 26px;
  padding: 4px 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.schedule-period-actions {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 5px;
}

.schedule-period-actions .btn {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 11px;
}

.schedule-nav-button {
  width: 30px;
}

.schedule-view-toggle button.active {
  background: var(--active-bg);
  color: var(--blue);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blue) 38%, var(--line));
}

.schedule-shell,
.schedule-day-view,
.schedule-agenda-list,
.schedule-staff-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.schedule-shell {
  padding-top: 4px;
}

.schedule-month-stack {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.schedule-month-section {
  display: grid;
  gap: 8px;
  min-width: 0;
  scroll-margin-top: 12px;
}

.schedule-month-title {
  margin: 0;
  color: var(--ink);
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: 0;
}

.schedule-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(42px, 1fr));
  gap: 5px;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
}

.schedule-weekday {
  color: var(--muted);
  min-width: 0;
  font-size: 10px;
  font-weight: 850;
  text-align: center;
  text-transform: uppercase;
}

.schedule-day-cell {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 132px;
  align-content: start;
  gap: 6px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 86%, var(--page));
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.schedule-day-cell.outside {
  opacity: 0.48;
}

.schedule-day-cell.selected {
  border-color: color-mix(in srgb, var(--blue) 70%, var(--line));
  background: var(--active-bg);
}

.schedule-day-cell.today {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--green) 45%, transparent);
}

.schedule-day-number {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 7px;
  background: color-mix(in srgb, var(--button-bg) 80%, var(--panel));
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.schedule-day-cell strong {
  font-size: 12px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.schedule-shift-window {
  display: grid;
  min-width: 0;
  min-height: 68px;
  align-content: space-between;
  gap: 3px;
}

.schedule-shift-window span {
  display: grid;
  min-width: 0;
  gap: 1px;
  padding: 4px 5px;
  border: 1px solid color-mix(in srgb, var(--blue) 34%, var(--line));
  border-radius: 6px;
  background: color-mix(in srgb, var(--blue) 10%, var(--panel));
  color: var(--muted);
  line-height: 1.05;
}

.schedule-shift-chips span {
  display: flex;
  min-width: 0;
  justify-content: space-between;
  gap: 4px;
  align-items: center;
  padding: 3px 5px;
  border: 1px solid color-mix(in srgb, var(--blue) 34%, var(--line));
  border-radius: 6px;
  background: color-mix(in srgb, var(--blue) 10%, var(--panel));
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  line-height: 1.1;
}

.schedule-shift-window b {
  color: var(--muted);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.schedule-shift-window strong,
.schedule-shift-chips strong {
  color: var(--ink);
  font-size: 11px;
  white-space: nowrap;
}

.schedule-shift-window em {
  min-width: 0;
  color: var(--ink);
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-shift-window.off {
  align-content: center;
}

.schedule-shift-window.off span {
  justify-content: center;
  border-color: var(--line);
  background: var(--button-bg);
}

.schedule-shift-window.off strong {
  justify-self: center;
  color: var(--muted);
  font-size: 11px;
}

.schedule-shift-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.schedule-day-cell small,
.schedule-agenda-item small,
.schedule-row-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.schedule-day-dots {
  display: flex;
  gap: 4px;
  margin-top: auto;
}

.schedule-day-dots i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--blue);
}

.schedule-day-dots .time_off_request {
  background: var(--amber);
}

.schedule-day-dots .job {
  background: var(--green);
}

.schedule-day-dots .meeting {
  background: var(--violet);
}

.schedule-day-dots .reminder {
  background: var(--amber);
}

.schedule-week-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  min-width: 0;
}

.schedule-week-column {
  display: grid;
  grid-template-columns: minmax(96px, 0.18fr) minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
}

.schedule-week-heading {
  display: grid;
  gap: 2px;
  min-height: 74px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--button-bg);
  color: var(--ink);
  cursor: pointer;
}

.schedule-week-column .schedule-agenda-list {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.schedule-week-column.selected .schedule-week-heading {
  border-color: color-mix(in srgb, var(--blue) 70%, var(--line));
  background: var(--active-bg);
}

.schedule-week-heading span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.schedule-week-heading strong {
  font-size: 22px;
}

.schedule-year-view {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 10px;
  min-width: 0;
}

.schedule-year-month-card {
  display: grid;
  min-width: 0;
  min-height: 112px;
  align-content: space-between;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 86%, var(--page));
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.schedule-year-month-card.current {
  border-color: color-mix(in srgb, var(--green) 58%, var(--line));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 34%, transparent);
}

.schedule-year-month-card strong {
  font-size: 18px;
}

.schedule-year-month-card span,
.schedule-year-month-card small {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.schedule-day-hero {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--blue) 9%, var(--panel));
}

.schedule-day-hero div {
  display: grid;
  gap: 3px;
}

.schedule-day-hero span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.schedule-day-hero strong {
  font-size: 20px;
}

.schedule-agenda-item,
.schedule-row-card {
  display: grid;
  gap: 4px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--button-bg);
  color: var(--ink);
  text-align: left;
}

.schedule-agenda-item {
  cursor: pointer;
}

button.schedule-row-card {
  width: 100%;
  appearance: none;
  font: inherit;
  cursor: pointer;
}

.schedule-agenda-item.active,
.schedule-record.active,
.schedule-row-card.active {
  border-color: color-mix(in srgb, var(--blue) 70%, var(--line));
  background: var(--active-bg);
}

.schedule-agenda-item span,
.schedule-row-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.schedule-agenda-item .schedule-shift-chips span,
.schedule-row-card .schedule-shift-chips span {
  text-transform: none;
}

.schedule-agenda-item strong,
.schedule-row-card strong {
  font-size: 14px;
  line-height: 1.25;
}

.schedule-agenda-item.time_off_request,
.schedule-row-card.time-off {
  border-left-color: var(--amber);
}

.schedule-agenda-item.job,
.schedule-row-card.job {
  border-left-color: var(--green);
}

.schedule-agenda-item.meeting,
.schedule-row-card.meeting {
  border-left-color: var(--violet);
}

.schedule-agenda-item.reminder,
.schedule-row-card.reminder {
  border-left-color: var(--amber);
}

.schedule-selected-panel .detail-grid {
  margin-top: 0;
}

.schedule-alert-panel {
  display: grid;
  gap: 9px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--button-bg) 76%, var(--panel));
}

.schedule-alert-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: end;
  min-width: 0;
}

.schedule-alert-form .field {
  min-width: 0;
}

.schedule-alert-form .field span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.schedule-alert-form select {
  min-height: 38px;
  background: var(--input-bg);
  color: var(--ink);
  color-scheme: light;
}

:root[data-theme="dark"] .schedule-alert-form select {
  color-scheme: dark;
}

.schedule-alert-list {
  display: grid;
  gap: 7px;
}

.schedule-alert-message {
  margin: 0;
  border-color: color-mix(in srgb, var(--blue) 42%, var(--line));
  background: color-mix(in srgb, var(--blue) 9%, var(--panel));
}

.schedule-alert-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(88px, auto) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
}

.schedule-alert-row span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.schedule-alert-row strong {
  min-width: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.schedule-alert-row small {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.schedule-alert-badge {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  white-space: nowrap;
}

.schedule-alert-empty {
  margin: 0;
}

.schedule-shift-section h2 {
  white-space: normal;
  overflow-wrap: anywhere;
}

.schedule-notice {
  border-color: color-mix(in srgb, var(--blue) 45%, var(--line));
  background: color-mix(in srgb, var(--blue) 10%, var(--panel));
}

.schedule-request-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(5, 12, 20, 0.58);
}

.schedule-request-modal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(620px, 100%);
  max-height: min(780px, calc(100dvh - 36px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.schedule-request-modal header,
.schedule-request-modal footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.schedule-request-modal footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: flex-end;
}

.schedule-request-modal header div {
  display: grid;
  gap: 3px;
}

.schedule-request-modal header strong {
  font-size: 18px;
}

.schedule-request-modal header span {
  color: var(--muted);
  font-size: 13px;
}

.schedule-request-body {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding: 14px;
}

.schedule-request-body textarea {
  resize: vertical;
}

.schedule-request-modal .field input,
.schedule-request-modal .field select,
.schedule-request-modal .field textarea {
  background: var(--input-bg);
  color: var(--ink);
  color-scheme: dark;
}

[data-theme="light"] .schedule-request-modal .field input,
[data-theme="light"] .schedule-request-modal .field select,
[data-theme="light"] .schedule-request-modal .field textarea {
  color-scheme: light;
}

.schedule-request-modal .field input::placeholder,
.schedule-request-modal .field textarea::placeholder {
  color: var(--muted);
}

@media (max-width: 640px), (hover: none) and (pointer: coarse) {
  .schedule-detail-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .schedule-pane > .pane-sticky {
    margin: -10px -14px 8px;
    padding: 7px 8px;
  }

  .schedule-compact-header {
    gap: 6px;
  }

  .schedule-compact-title {
    flex: 0 0 auto;
    min-width: auto;
  }

  .schedule-compact-title strong {
    display: none;
  }

  .schedule-compact-title span {
    max-width: 96px;
    font-size: 11px;
  }

  .schedule-period-actions,
  .schedule-view-toggle {
    width: auto;
  }

  .schedule-period-actions .btn,
  .schedule-view-toggle button {
    flex: 0 0 auto;
  }

  .schedule-month-grid {
    width: calc(100vw - 28px);
    grid-template-columns: repeat(7, calc((100vw - 52px) / 7));
    gap: 4px;
  }

  .schedule-month-title {
    font-size: 19px;
  }

  .schedule-weekday {
    font-size: 9px;
  }

  .schedule-day-cell {
    min-height: 96px;
    padding: 4px 3px;
    gap: 2px;
  }

  .schedule-day-number {
    width: 19px;
    height: 19px;
    font-size: 10px;
  }

  .schedule-day-cell strong {
    font-size: 9px;
  }

  .schedule-shift-window {
    min-height: 52px;
    gap: 2px;
  }

  .schedule-shift-window span {
    padding: 2px 3px;
  }

  .schedule-shift-window b,
  .schedule-shift-window strong {
    font-size: 8px;
  }

  .schedule-shift-window em {
    font-size: 8px;
  }

  .schedule-shift-chips {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .schedule-day-cell small {
    display: none;
  }

  .schedule-week-grid {
    grid-template-columns: 1fr;
  }

  .schedule-week-column {
    grid-template-columns: 1fr;
  }

  .schedule-day-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .schedule-alert-form,
  .schedule-alert-row {
    grid-template-columns: 1fr;
  }

  .schedule-alert-row .btn {
    width: 100%;
  }

  .schedule-request-overlay {
    align-items: end;
    padding: 10px;
  }

  .schedule-request-modal {
    max-height: calc(100dvh - 20px);
    border-radius: 14px;
  }
}

.context-strip {
  display: block;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--blue) 45%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--blue) 13%, var(--panel));
}

.context-strip span,
.context-strip strong {
  display: block;
}

.context-strip span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.context-strip strong {
  margin-top: 4px;
  color: var(--ink);
}

.direction-pane {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 360px;
  padding: 24px;
  text-align: left;
}

.direction-pane.module-target {
  align-items: start;
  min-height: 230px;
  padding-top: 48px;
}

.direction-pane.list-target {
  align-items: start;
  min-height: 430px;
  padding-top: 165px;
}

.direction-pane h2 {
  margin: 0;
  color: var(--ink);
  font-size: 30px;
  line-height: 1.15;
}

.direction-pane p {
  margin: 7px 0 0;
  max-width: 340px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.4;
}

.flow-arrow {
  position: relative;
  display: block;
  width: 94px;
  height: 34px;
  animation: flow-arrow-nudge 1.45s ease-in-out infinite;
}

.flow-arrow-line {
  position: absolute;
  left: 12px;
  right: 16px;
  top: 15px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(15, 93, 150, 0), #0f5d96);
}

.flow-arrow-head {
  position: absolute;
  left: 8px;
  top: 8px;
  width: 18px;
  height: 18px;
  border-left: 4px solid #0f5d96;
  border-bottom: 4px solid #0f5d96;
  transform: rotate(45deg);
}

.point-right .flow-arrow {
  transform: rotate(180deg);
}

.point-right .flow-arrow {
  animation-name: flow-arrow-nudge-right;
}

@keyframes flow-arrow-nudge {
  0%, 100% {
    transform: translateX(0);
    opacity: 0.72;
  }
  50% {
    transform: translateX(-10px);
    opacity: 1;
  }
}

@keyframes flow-arrow-nudge-right {
  0%, 100% {
    transform: rotate(180deg) translateX(0);
    opacity: 0.72;
  }
  50% {
    transform: rotate(180deg) translateX(-10px);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flow-arrow {
    animation: none;
  }
}

.workspace-record,
.workspace-card {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--button-bg);
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  overflow: hidden;
}

.workspace-record.active {
  border-color: color-mix(in srgb, var(--blue) 70%, var(--line));
  background: var(--active-bg);
  box-shadow: inset 3px 0 0 var(--blue);
}

.workspace-record.information-ro-record {
  border-color: color-mix(in srgb, var(--blue) 38%, var(--line));
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--blue) 70%, var(--line));
}

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

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

.communication-safety-panel .button-row {
  margin-top: 10px;
}

.communication-safety-lookup-form {
  grid-template-columns: minmax(112px, 0.75fr) minmax(112px, 0.75fr) minmax(180px, 1.4fr) auto;
  align-items: end;
  margin-top: 10px;
}

.communication-safety-lookup-form label {
  display: grid;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}

.communication-safety-lookup-form button {
  min-height: 38px;
}

.communication-safety-message-body {
  white-space: pre-wrap;
}

@media (max-width: 760px) {
  .communication-safety-lookup-form {
    grid-template-columns: 1fr;
  }
}

.communication-safety-panel .workspace-card.danger {
  border-color: rgba(239, 68, 68, 0.45);
  box-shadow: inset 3px 0 0 #ef4444;
}

.workspace-record.static {
  cursor: default;
}

.workspace-record strong,
.workspace-record span,
.workspace-record small,
.workspace-card strong,
.workspace-card p {
  display: block;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.workspace-record span,
.workspace-record small,
.workspace-card p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.customer-record {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
}

.customer-record-main,
.customer-ro-line {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.customer-record-main strong,
.customer-ro-line em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-record-main strong {
  font-size: 14px;
  line-height: 1.15;
}

.customer-flags {
  display: inline-flex !important;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  margin: 0 !important;
}

.customer-flags b {
  display: inline-flex;
  min-height: 17px;
  align-items: center;
  padding: 1px 5px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.customer-flags b.warn {
  background: rgba(255, 214, 10, 0.2);
  color: #ffd60a;
}

.customer-flags b.urgent {
  background: rgba(255, 69, 58, 0.18);
  color: #ff8b83;
}

.customer-ro-lines {
  display: grid !important;
  gap: 2px;
  margin: 0 !important;
}

.customer-ro-line {
  margin: 0 !important;
}

.customer-ro-line em,
.customer-ro-line small {
  display: block;
  margin: 0 !important;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.15;
}

.customer-ro-line small {
  text-align: right;
  white-space: nowrap;
}

.intake-quick-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.vehicle-customer-panel {
  margin: 10px 0 14px;
}

.vehicle-customer-panel.compact {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-panel);
}

.vehicle-customer-current {
  display: grid;
  gap: 4px;
}

.vehicle-customer-current.needs-customer {
  border-color: color-mix(in srgb, var(--blue) 42%, var(--line));
  background: color-mix(in srgb, var(--blue) 10%, var(--panel));
}

.vehicle-customer-current p,
.vehicle-customer-current small,
.ownership-history-row span,
.ownership-history-row small {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.vehicle-customer-assign-form,
.vehicle-customer-create-form,
.ownership-history {
  display: grid;
  gap: 10px;
}

.ownership-history-row {
  display: grid;
  gap: 4px;
  border-left: 4px solid var(--line);
}

.ownership-history-row.current {
  border-left-color: var(--green);
}

.failed-vin-panel {
  margin: 12px 0;
}

.failed-vin-panel input {
  width: 100%;
  margin: 8px 0;
}

.failed-vin-upload {
  position: relative;
  overflow: hidden;
}

.failed-vin-upload input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.rpo-capture-card {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--amber) 35%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--amber) 10%, var(--surface));
}

.rpo-capture-card.complete {
  border-color: color-mix(in srgb, var(--green) 35%, var(--line));
  background: color-mix(in srgb, var(--green) 8%, var(--surface));
}

.rpo-paste-box {
  min-height: 90px;
  resize: vertical;
}

.service-info-session {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.service-info-session p {
  grid-column: 1 / -1;
  margin: 0;
}

.service-info-launch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 9px;
  align-items: start;
}

.service-info-provider-card {
  display: grid;
  gap: 6px;
}

.service-provider-button {
  width: 100%;
  min-height: 40px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--button-bg);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 4px;
  align-items: center;
  overflow: hidden;
}

.service-provider-button span,
.service-provider-button small {
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-provider-button span {
  font-size: 16px;
  font-weight: 900;
  line-height: 1.05;
}

.service-provider-button small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  line-height: 0.95;
  text-transform: uppercase;
}

.service-provider-button small b {
  display: block;
}

.service-provider-button.alldata {
  background: #0b5cab;
  border-color: #4da3ff;
  color: #fff;
}

.service-provider-button.alldata small {
  color: #f6fbff;
}

.service-provider-button.google small {
  color: #1f2937;
}

.service-provider-button.favorite small,
.service-provider-button.mitchell small {
  color: var(--ink);
}

.service-provider-button.google {
  background: #fff;
  border-color: #dadce0;
}

.service-provider-button.google b:nth-child(1),
.service-provider-button.google b:nth-child(4) {
  color: #4285f4;
}

.service-provider-button.google b:nth-child(2),
.service-provider-button.google b:nth-child(6) {
  color: #ea4335;
}

.service-provider-button.google b:nth-child(3) {
  color: #fbbc05;
}

.service-provider-button.google b:nth-child(5) {
  color: #34a853;
}

.service-provider-button.mitchell {
  background: color-mix(in srgb, #1652f0 16%, var(--button-bg));
}

.service-provider-button.youtube {
  background: #ff0033;
  border-color: #ff6b82;
  color: #fff;
}

.service-provider-button.youtube small {
  color: #ffe1e7;
}

.service-provider-button.favorite {
  background: color-mix(in srgb, var(--green) 15%, var(--button-bg));
  border-color: color-mix(in srgb, var(--green) 45%, var(--line));
}

.service-provider-button.identifix {
  background: #1f3f7a;
  border-color: #6f94e8;
  color: #fff;
}

.service-provider-button.identifix small,
.service-provider-button.shopkey small {
  color: #fff;
}

.service-provider-button.shopkey {
  background: #1c4d2e;
  border-color: #51b779;
  color: #fff;
}

.service-provider-button.motologic {
  background: color-mix(in srgb, #00a6d6 18%, var(--button-bg));
  border-color: color-mix(in srgb, #00a6d6 45%, var(--line));
}

.service-provider-button.oem1stop {
  background: color-mix(in srgb, #f6c343 24%, var(--button-bg));
  border-color: color-mix(in srgb, #f6c343 55%, var(--line));
}

.service-provider-button.partstech {
  background: #111827;
  border-color: #48b2ff;
  color: #fff;
}

.service-provider-button.chatgpt {
  background: #10a37f;
  border-color: #65d6bd;
  color: #fff;
}

.service-provider-button.claude {
  background: #d97745;
  border-color: #f4b089;
  color: #fff;
}

.service-provider-button.chatgpt small,
.service-provider-button.claude small,
.service-provider-button.partstech small {
  color: #fff;
}

.service-session-links {
  display: grid;
  gap: 4px;
  min-height: 24px;
}

.service-info-provider-card {
  position: relative;
  z-index: 1;
}

.service-info-provider-card:hover,
.service-info-provider-card:focus-within {
  z-index: 75;
}

.service-session-links.empty {
  align-content: center;
  min-height: 24px;
  padding: 3px 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.service-session-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px;
  gap: 4px;
}

.service-session-row button {
  min-height: 25px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--soft-panel);
  color: var(--ink);
  font-size: 10px;
  font-weight: 850;
  text-align: left;
  white-space: nowrap;
}

.service-session-row .service-session-close {
  text-align: center;
  color: var(--muted);
}

.service-session-preview {
  position: absolute;
  z-index: 90;
  left: calc(100% + 10px);
  right: auto;
  top: 0;
  width: max-content;
  max-width: min(380px, 80vw);
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
  display: none;
  gap: 4px;
  pointer-events: none;
}

.service-info-provider-card:nth-child(n+3) .service-session-preview {
  left: auto;
  right: calc(100% + 10px);
}

.service-session-row:hover .service-session-preview,
.service-session-row:focus-within .service-session-preview {
  display: grid;
}

.service-session-preview strong,
.service-session-preview span,
.service-session-preview small,
.service-session-preview em {
  overflow-wrap: anywhere;
}

.service-session-preview strong {
  font-size: clamp(24px, 3.2vw, 34px);
  line-height: 1.05;
  white-space: nowrap;
}

.service-session-preview span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.service-session-preview small {
  color: var(--accent);
  font-size: 10px;
}

.service-session-preview em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.service-favorite-form {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(180px, 1.3fr) auto;
  gap: 8px;
  margin: 10px 0 12px;
}

.service-favorite-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.service-favorite-list button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft-panel);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.detail-grid div,
.workspace-kpi {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-panel);
}

.detail-grid span,
.workspace-kpi span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.detail-grid strong,
.workspace-kpi strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.copyable-value {
  display: inline-flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  max-width: 100%;
}

.copy-chip {
  min-height: 24px;
  min-width: 40px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--button-bg);
  color: var(--ink);
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
}

.copy-chip.copied {
  border-color: rgba(47, 191, 113, 0.78);
  background: rgba(47, 191, 113, 0.16);
  color: #2fbf71;
}

.vehicle-identity-strip {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto;
  gap: 4px;
  margin: 6px 0 8px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-panel);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.25;
  overflow: hidden;
}

.vehicle-identity-main,
.vehicle-identity-detail-row {
  min-width: 0;
  display: grid;
  align-items: center;
  gap: 7px;
}

.vehicle-identity-main {
  grid-template-columns: minmax(0, 1fr) auto;
}

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

.vehicle-identity-strip span {
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.vehicle-identity-title {
  color: var(--ink);
  font-size: 16px;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vehicle-identity-km {
  color: var(--primary);
  font-size: 18px;
  font-weight: 950;
  white-space: nowrap;
}

.vehicle-identity-ro {
  color: var(--ink);
  font-size: 16px;
  font-weight: 950;
  white-space: nowrap;
}

.vehicle-identity-vin {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  white-space: nowrap;
}

.vehicle-identity-vin b {
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workspace-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.workspace-note {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.45;
}

.vin-detail-section {
  margin-top: 16px;
}

.vin-detail-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.management-chart {
  margin-top: 16px;
}

.cash-flow-panel {
  margin-top: 16px;
}

.cash-flow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.cash-flow-grid div {
  display: grid;
  gap: 4px;
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-panel);
}

.cash-flow-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.cash-flow-grid strong {
  align-self: end;
  font-size: 20px;
}

.cash-flow-grid .positive strong {
  color: var(--green);
}

.cash-flow-grid .negative strong {
  color: var(--red);
}

.brand-upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.brand-upload-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.brand-upload-grid input {
  min-width: 0;
}

.tech-job-detail {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.tech-job-detail-heading {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 8px;
  padding-top: 2px;
  line-height: 1.25;
}

.tech-job-detail-title {
  flex: 1 1 180px;
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.tech-job-detail-heading strong {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.25;
  font-weight: 950;
  text-transform: uppercase;
}

.tech-job-assignment-pill {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(96, 112, 128, 0.32);
  border-radius: 6px;
  background: var(--soft-panel);
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.tech-job-assignment-pill.current {
  border-color: rgba(85, 199, 154, 0.5);
  color: var(--green);
}

.tech-job-assignment-pill.open {
  border-color: rgba(241, 180, 95, 0.46);
  color: var(--amber);
}

.tech-job-detail-heading .tech-job-metrics {
  flex: 1 1 auto;
  min-width: 0;
}

.tech-job-box {
  display: grid;
  gap: 6px;
}

.tech-job-box-head {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: visible;
  white-space: nowrap;
}

.tech-job-box-head b {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.tech-job-metrics {
  flex: 1 0 auto;
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 7px;
  margin-left: auto;
}

.tech-job-metrics em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  text-transform: none;
}

.tech-flat-rate-metric {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
}

.tech-job-card {
  display: grid;
  gap: 5px;
}

.tech-job-list-section {
  padding-top: 12px;
}

.tech-job-card-top {
  min-width: 0;
  display: block;
}

.tech-job-card-bottom {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 66px;
  align-items: center;
  gap: 8px;
}

.tech-job-card-bottom > .tech-status-menu,
.tech-job-card-bottom > .tech-job-status {
  justify-self: end;
}

.tech-job-card-pick {
  min-width: 0;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.tech-job-card-pick:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.tech-job-card-pick strong,
.tech-job-card-pick span,
.tech-job-card-pick small {
  display: block;
  min-width: 0;
}

.tech-job-card-pick strong,
.tech-job-card-pick small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tech-job-card-pick small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.tech-job-card-meta {
  display: grid;
  gap: 2px;
}

.tech-job-card-assignee {
  color: var(--ink);
  font-weight: 950;
}

.tech-job-card-assignee.current {
  color: var(--green);
}

.tech-job-metrics em.good {
  border-color: rgba(85, 199, 154, 0.52);
  color: var(--green);
}

.tech-job-metrics em.warn {
  border-color: rgba(241, 180, 95, 0.52);
  color: var(--amber);
}

.tech-status-menu {
  flex: 0 0 auto;
}

.tech-status-trigger,
.tech-status-menu summary {
  width: 66px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid rgba(79, 182, 255, 0.72);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(79, 182, 255, 0.24), rgba(79, 182, 255, 0.12));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
  color: var(--ink);
  font-size: 10px;
  font-weight: 900;
  list-style: none;
  cursor: pointer;
  text-transform: uppercase;
}

.tech-job-status,
.tech-status-trigger,
.tech-status-menu summary {
  border-color: var(--line);
}

.tech-job-status {
  width: 66px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-working,
.status-working summary {
  border-color: rgba(47, 191, 113, 0.72);
  background: rgba(47, 191, 113, 0.16);
  color: #2fbf71;
}

.status-open,
.status-open summary {
  border-color: rgba(250, 204, 21, 0.78);
  background: rgba(250, 204, 21, 0.18);
  color: #facc15;
}

.status-hold,
.status-hold summary {
  border-color: rgba(251, 146, 60, 0.78);
  background: rgba(251, 146, 60, 0.18);
  color: #fb923c;
}

.status-finished,
.status-finished summary {
  border-color: rgba(148, 163, 184, 0.62);
  background: rgba(148, 163, 184, 0.14);
  color: #94a3b8;
}

.tech-status-menu summary::after {
  content: "";
}

.tech-status-menu summary::-webkit-details-marker {
  display: none;
}

.tech-status-popover-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30000;
  display: grid;
  place-items: start center;
  padding: calc(var(--mobile-header-height, 0px) + 14px) 16px max(96px, env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.18);
}

.tech-status-popover-panel {
  width: min(240px, calc(100vw - 32px));
  max-height: calc(100dvh - var(--mobile-header-height, 0px) - max(112px, env(safe-area-inset-bottom)));
  overflow-y: auto;
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  box-shadow: var(--shadow);
}

.tech-status-popover-panel button {
  min-height: 34px;
  border-radius: 6px;
  background: #f8fafc;
  color: #111827;
  text-align: left;
  font-weight: 850;
}

.tech-status-popover-panel button.current {
  cursor: default;
  opacity: 1;
}

.tech-status-popover-panel button.current.status-working {
  border-color: rgba(47, 191, 113, 0.72);
  background: rgba(47, 191, 113, 0.18);
  color: #047857;
}

.tech-status-popover-panel button.current.status-open {
  border-color: rgba(202, 138, 4, 0.72);
  background: rgba(250, 204, 21, 0.24);
  color: #854d0e;
}

.tech-status-popover-panel button.current.status-hold {
  border-color: rgba(234, 88, 12, 0.72);
  background: rgba(251, 146, 60, 0.22);
  color: #9a3412;
}

.tech-status-popover-panel button.current.status-finished {
  border-color: rgba(100, 116, 139, 0.72);
  background: rgba(148, 163, 184, 0.22);
  color: #334155;
}

.tech-context-links {
  margin: 0 0 10px;
}

.tech-pane > .pane-sticky {
  z-index: 9;
}

.tech-pane > .pane-sticky .workspace-tabs:first-child {
  margin-top: 0;
}

.tech-right-pane.split-pane-scroll > .pane-scroll-body {
  padding-top: 14px;
}

.tech-right-pane .tech-job-detail-heading {
  position: relative;
  z-index: 1;
  scroll-margin-top: 12px;
}

.tech-right-service-info {
  position: relative;
  z-index: 1;
  clear: both;
  margin: 18px 0 10px;
}

.tech-right-service-info .service-info-launch-grid {
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 6px;
}

.tech-right-service-info .service-provider-button {
  min-height: 36px;
  padding: 5px 7px;
}

.tech-right-service-info .service-provider-button span {
  font-size: clamp(12px, 1.8vw, 15px);
}

.tech-right-service-info .service-favorite-form,
.tech-right-service-info .service-favorite-list,
.tech-right-service-info .service-session-links {
  display: none;
}

.tech-job-box textarea {
  min-height: 58px;
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--ink);
  padding: 11px;
  line-height: 1.45;
  overflow: hidden;
  field-sizing: content;
}

.tech-job-box textarea[readonly] {
  background: var(--soft-panel);
  color: var(--muted);
}

.service-info-panel .quick-links {
  margin-bottom: 12px;
}

.shop-setup-panel {
  margin-top: 16px;
}

.staff-platform-action {
  margin: 10px 0 12px;
}

.staff-development-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 340px;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid rgba(79, 182, 255, 0.34);
  border-radius: 8px;
  background: var(--active-bg);
  color: var(--ink);
  text-align: left;
}

.staff-development-button .module-icon {
  width: 28px;
  height: 28px;
}

.staff-development-button span {
  display: grid;
  gap: 2px;
}

.staff-development-button small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.setup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.workspace-form {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-panel);
}

.workspace-form.compact {
  padding: 0;
  border: 0;
  background: transparent;
}

.inline-create-panel {
  margin-bottom: 10px;
}

.inline-create-panel h2 {
  font-size: 16px;
}

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

.workspace-form h3 {
  margin: 0;
}

.workspace-form input,
.workspace-form select,
.workspace-form textarea {
  min-height: 38px;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--input-bg);
  color: var(--ink);
  padding: 8px 10px;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  color: var(--text);
  font-size: 13px;
}

.checkbox-line input {
  width: 16px;
  height: 16px;
  min-width: 16px;
  accent-color: var(--blue);
}

.intake-information-toggle {
  padding: 6px 0;
}

.communications-shell {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.communication-fixed-top {
  flex: 0 0 auto;
}

.communication-placeholder {
  min-height: 0;
  overflow-y: auto;
}

.communication-thread {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
}

.communication-context-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 88%, var(--page));
}

.communication-context-bar div {
  min-width: 0;
}

.communication-context-bar span,
.communication-context-bar strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.communication-context-bar span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.communication-context-bar strong {
  margin-top: 2px;
  color: var(--ink);
  font-size: 12px;
}

.message-thread {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px 78px 10px;
}

.communication-latest-positioning .workspace-pane .communication-thread .message-thread {
  opacity: 0;
}

.message-bubble {
  --communication-channel-color: #16a34a;
  --communication-channel-soft: rgba(22, 163, 74, 0.12);
  position: relative;
  display: block;
  width: min(82%, 520px);
  margin-top: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--panel);
}

.message-bubble.channel-email,
.communication-timeline-card.channel-email {
  --communication-channel-color: #2563eb;
  --communication-channel-soft: rgba(37, 99, 235, 0.12);
}

.message-bubble.channel-voice,
.communication-timeline-card.channel-voice {
  --communication-channel-color: #8b5cf6;
  --communication-channel-soft: rgba(139, 92, 246, 0.14);
}

.message-bubble.channel-text,
.communication-timeline-card.channel-text {
  --communication-channel-color: #16a34a;
  --communication-channel-soft: rgba(22, 163, 74, 0.12);
}

.communication-gutter-stack {
  position: absolute;
  top: 50%;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 4px;
  transform: translateY(-50%);
  pointer-events: none;
}

.communication-channel-gutter {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid color-mix(in srgb, var(--communication-channel-color) 58%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--communication-channel-color) 14%, var(--panel));
  color: var(--communication-channel-color);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

.communication-channel-gutter .module-icon {
  width: 15px;
  height: 15px;
}

.message-bubble.inbound .communication-gutter-stack,
.communication-timeline-card.inbound .communication-gutter-stack {
  right: -40px;
}

.message-bubble.outbound .communication-gutter-stack,
.communication-timeline-card.outbound .communication-gutter-stack {
  left: -40px;
}

.message-bubble.outbound {
  margin-left: auto;
  background: #007aff;
  border-color: #007aff;
  color: #fff;
}

.message-bubble.inbound {
  margin-right: auto;
  background: #e9e9eb;
  border-color: #e0e0e3;
  color: #111827;
}

.message-bubble strong,
.message-bubble small {
  font-size: 10px;
  line-height: 1.2;
}

.message-meta-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.message-meta-line strong,
.message-meta-line small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-bubble.outbound strong,
.message-bubble.outbound small {
  color: rgba(255, 255, 255, 0.82);
}

.message-bubble.inbound strong,
.message-bubble.inbound small {
  color: rgba(17, 24, 39, 0.62);
}

.message-bubble .message-delivery-status {
  display: block;
  margin-top: 3px;
  font-weight: 700;
}

.message-bubble .message-delivery-status.failed {
  color: #ffe3e0;
}

.message-bubble .message-delivery-status.unverified,
.message-bubble .message-delivery-status.pending,
.message-bubble .message-delivery-status.retry {
  color: rgba(255, 255, 255, 0.72);
}

.message-bubble .message-delivery-status.verified {
  color: rgba(255, 255, 255, 0.86);
}

.communication-cost-chip {
  justify-self: end;
  display: inline-grid;
  gap: 1px;
  max-width: min(100%, 260px);
  margin-top: 3px;
  padding: 3px 6px;
  border: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--panel) 78%, transparent);
  color: var(--muted);
  font-size: 9px;
  line-height: 1.15;
  text-align: right;
  white-space: normal;
}

.communication-gutter-stack .communication-cost-chip {
  width: 66px;
  max-width: 66px;
  margin: 0;
  padding: 3px 4px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.18);
  text-align: center;
}

.communication-gutter-stack .communication-cost-chip span {
  font-size: 9px;
}

.communication-gutter-stack .communication-cost-chip small {
  font-size: 7.5px;
}

.communication-link-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  margin-top: 6px;
  padding: 4px 7px;
  border: 1px solid color-mix(in srgb, var(--blue) 35%, var(--line));
  border-radius: 6px;
  background: color-mix(in srgb, var(--blue) 9%, var(--panel));
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.communication-link-chip strong {
  color: var(--ink);
  font-size: 11px;
}

.communication-cost-chip span {
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
}

.communication-cost-chip small {
  display: block;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 8.5px;
}

.message-bubble > .communication-cost-chip {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.12);
}

.message-bubble.outbound > .communication-cost-chip,
.message-bubble.outbound > .communication-cost-chip span,
.message-bubble.outbound > .communication-cost-chip small {
  color: rgba(255, 255, 255, 0.84);
  border-color: rgba(255, 255, 255, 0.22);
}

.message-bubble.inbound > .communication-cost-chip {
  background: rgba(17, 24, 39, 0.05);
}

.message-bubble p {
  margin: 4px 0;
  font-size: 14px;
  line-height: 1.35;
}

.communication-timeline-card {
  --communication-channel-color: #16a34a;
  --communication-channel-soft: rgba(22, 163, 74, 0.12);
  position: relative;
  display: grid;
  gap: 6px;
  width: min(calc(100% - 78px), 660px);
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--communication-channel-color) 34%, var(--line));
  border-left-width: 3px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--communication-channel-color) 7%, var(--panel));
}

.communication-timeline-card.outbound {
  margin-left: auto;
  border-color: color-mix(in srgb, var(--communication-channel-color) 46%, var(--line));
  border-left-width: 1px;
  border-right-width: 3px;
  background: color-mix(in srgb, var(--communication-channel-color) 10%, var(--panel));
}

.communication-timeline-card.inbound {
  margin-right: auto;
}

.communication-timeline-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.communication-timeline-card strong {
  font-size: 13px;
}

.communication-timeline-card small {
  color: var(--muted);
  font-size: 11px;
}

.communication-timeline-card p {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
}

.email-card {
  width: min(86%, 560px);
}

.email-card p {
  white-space: pre-wrap;
}

.email-card.outbound {
  margin-left: auto;
}

.email-card.inbound {
  margin-right: auto;
}

.email-card-open {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.email-card-open > span:last-child {
  min-width: 0;
}

.email-card-open strong,
.email-card-open small {
  display: block;
}

.email-recipient-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.communication-timeline-card .email-recipient-meta {
  align-items: flex-start;
  justify-content: flex-start;
}

.email-recipient-meta span {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-recipient-meta b {
  color: color-mix(in srgb, var(--ink) 72%, var(--muted));
  font-size: 9px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.email-card-icon {
  flex: 0 0 auto;
  padding: 4px 6px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--blue) 15%, var(--panel));
  color: var(--blue);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.voice-card {
  width: min(92%, 620px);
}

.voice-card.outbound {
  margin-left: auto;
}

.voice-card.inbound {
  margin-right: auto;
}

.voice-card-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
}

.voice-card-title {
  min-width: 0;
}

.voice-card-title strong,
.voice-card-title small {
  display: block;
}

.voice-card-icon {
  flex: 0 0 auto;
  min-width: 42px;
  padding: 4px 6px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--green) 14%, var(--panel));
  color: var(--green);
  font-size: 9px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.voice-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
}

.voice-card-meta span {
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--button-bg);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-transcript {
  display: grid;
  margin-top: 2px;
}

.voice-transcript-flow {
  display: grid;
  gap: 5px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 92%, var(--page));
}

.voice-transcript-line {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  white-space: normal;
  word-break: break-word;
}

.voice-transcript-line strong {
  margin-right: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.voice-transcript-line.ai strong {
  color: #be185d;
}

.voice-transcript-line.customer strong {
  color: #1d4ed8;
}

.voice-transcript-quote,
.voice-transcript-customer-quote {
  white-space: pre-wrap;
}

.voice-transcript-customer-quote {
  padding: 1px 4px;
  border-radius: 5px;
  background: #dbeafe;
  color: #0f172a;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.latest-messages-only .voice-transcript-line {
  font-size: 14px;
  line-height: 1.35;
}

.latest-messages-only .voice-transcript-line strong {
  font-size: 10px;
}

.communication-summary-button {
  width: fit-content;
  max-width: 100%;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid color-mix(in srgb, var(--blue) 34%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, var(--blue) 9%, var(--panel));
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
}

.communication-summary-button.detail {
  margin-top: 4px;
}

.message-bubble .communication-summary-button,
.communication-timeline-card .communication-summary-button {
  margin-top: 5px;
}

.message-bubble.outbound .communication-summary-button {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.message-bubble.inbound .communication-summary-button {
  border-color: rgba(17, 24, 39, 0.16);
  background: rgba(255, 255, 255, 0.62);
  color: #1d4ed8;
}

.communication-summary-bar {
  display: flex;
  justify-content: flex-end;
  padding: 2px;
}

.communication-summary-bar.detail {
  padding-right: 6px;
}

.voice-recording audio {
  width: 100%;
  max-width: 520px;
}

.voice-recording.compact {
  margin-top: 2px;
}

.voice-action-items {
  display: grid;
  gap: 4px;
  margin-top: 2px;
}

.voice-action-items strong {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.voice-action-items ul {
  margin: 0;
  padding-left: 18px;
}

.voice-action-items li {
  font-size: 12px;
  line-height: 1.35;
}

.voice-action-items.detail {
  padding: 14px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.communication-history-only .message-thread {
  padding: 6px 2px 10px;
}

.communication-history-only .message-bubble {
  width: min(94%, 380px);
  margin-top: 5px;
  margin-bottom: 8px;
  padding: 4px 7px;
  border-radius: 11px;
  cursor: pointer;
}

.communication-history-only .message-bubble strong,
.communication-history-only .message-bubble small {
  font-size: 8px;
}

.communication-history-only .message-bubble .message-stamp {
  margin-top: 3px;
  font-size: 11px;
  font-weight: 800;
}

.communication-history-only .message-bubble p {
  margin: 2px 0;
  font-size: 9.5px;
  line-height: 1.18;
}

.communication-history-only .message-bubble:not(.expanded) p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.communication-history-only .message-bubble.expanded {
  width: min(96%, 520px);
  max-height: calc(100% - 14px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 12px;
  border-radius: 17px;
}

.communication-history-only .message-bubble.expanded strong,
.communication-history-only .message-bubble.expanded small {
  font-size: 14px;
}

.communication-history-only .message-bubble.expanded p {
  font-size: 22px;
  line-height: 1.28;
}

.communication-history-only .message-bubble.expanded .message-stamp {
  font-size: 16px;
}

.message-attachments {
  display: grid;
  gap: 6px;
  margin: 6px 0;
}

.message-image-link {
  display: block;
  overflow: hidden;
  border-radius: 14px;
}

.message-image-link img {
  display: block;
  max-width: min(100%, 280px);
  max-height: 260px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.08);
}

.message-file-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  color: #111827;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.message-file-link::before {
  content: "PDF";
  margin-right: 8px;
  padding: 2px 5px;
  border-radius: 5px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
}

.communication-composer {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  align-items: end;
  gap: 8px;
  padding: 8px 0 0;
  border-top: 1px solid var(--line);
}

.mobile-compose-launcher {
  display: none;
}

.mobile-compose-row {
  display: contents;
}

.new-email-action {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--blue) 34%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--blue) 8%, var(--panel));
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.new-email-action span {
  color: var(--blue);
  font-size: 16px;
  line-height: 1;
}

.external-communication-compose {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--blue) 34%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 86%, var(--blue) 14%);
}

.external-compose-channel-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.external-compose-channel-row button {
  display: grid;
  min-width: 0;
  min-height: 38px;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  padding: 6px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--button-bg);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.external-compose-channel-row button.active {
  border-color: color-mix(in srgb, var(--blue) 66%, var(--line));
  background: color-mix(in srgb, var(--blue) 16%, var(--panel));
  color: var(--ink);
}

.external-compose-channel-row button:disabled {
  opacity: 0.46;
}

.external-compose-channel-row .module-icon {
  width: 18px;
  height: 18px;
}

.external-communication-composer {
  display: grid;
  gap: 7px;
}

.external-communication-composer input,
.external-communication-composer select,
.external-communication-composer textarea,
.email-copy-fields input,
.email-composer input {
  min-width: 0;
}

.compose-wide-input {
  overflow: hidden;
  text-overflow: ellipsis;
}

.compose-wide-input:hover,
.compose-wide-input:focus {
  overflow-x: auto;
  text-overflow: clip;
}

.external-communication-composer .compose-wide-input:focus,
.email-address-with-copy .compose-wide-input:focus,
.email-copy-fields .compose-wide-input:focus {
  position: relative;
  z-index: 8;
  width: min(520px, calc(100vw - 36px));
  max-width: calc(100vw - 36px);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent);
}

.email-address-with-copy {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: start;
}

.email-copy-fields {
  position: relative;
  min-width: 78px;
}

.email-copy-fields summary {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--button-bg);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.email-copy-fields summary::-webkit-details-marker {
  display: none;
}

.email-copy-fields[open] summary {
  border-color: color-mix(in srgb, var(--blue) 58%, var(--line));
  color: var(--ink);
}

.email-copy-fields > div {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.email-address-with-copy .email-copy-fields > div {
  position: absolute;
  right: 0;
  top: 36px;
  z-index: 6;
  width: min(340px, calc(100vw - 36px));
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26);
}

.email-composer .email-copy-fields {
  grid-column: 1 / -1;
}

.external-communication-composer input,
.external-communication-composer select,
.external-communication-composer textarea {
  min-height: 34px;
  border-radius: 8px;
}

.external-communication-composer textarea {
  min-height: 96px;
  resize: vertical;
}

.jenn-call-action {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, #a855f7 34%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, #a855f7 9%, var(--panel));
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.jenn-call-action span {
  color: #c084fc;
  font-size: 15px;
  line-height: 1;
}

.jenn-call-action.mobile {
  display: none;
}

.voice-action-menu {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}

.voice-action-menu summary {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, #a855f7 34%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, #a855f7 9%, var(--panel));
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.voice-action-menu summary::-webkit-details-marker {
  display: none;
}

.voice-action-menu summary span {
  color: #c084fc;
  font-size: 15px;
  line-height: 1;
}

.voice-action-menu[open] summary {
  border-color: color-mix(in srgb, #c084fc 70%, var(--line));
  background: color-mix(in srgb, #a855f7 18%, var(--panel));
}

.voice-action-menu-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 30;
  display: grid;
  width: min(250px, calc(100vw - 32px));
  gap: 6px;
  padding: 8px;
  border: 1px solid color-mix(in srgb, #a855f7 34%, var(--line));
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34);
}

.voice-action-menu-panel button {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 46px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--button-bg);
  color: var(--ink);
  text-align: left;
}

.voice-action-menu-panel button:hover {
  border-color: color-mix(in srgb, #c084fc 62%, var(--line));
  background: color-mix(in srgb, #a855f7 12%, var(--panel));
}

.voice-action-menu-panel button span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  white-space: normal;
}

.voice-action-menu.mobile {
  display: none;
}

.new-email-action.mobile {
  display: none;
}

.email-new-compose-bar {
  display: flex;
  justify-content: flex-end;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.communication-context-assist {
  display: flex;
  min-height: 0;
  height: 100%;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 8px 2px 12px;
}

.communication-context-actions.workspace-tabs {
  grid-template-columns: repeat(3, 78px);
  justify-content: start;
  margin: 0;
}

.communication-context-actions.workspace-tabs button:disabled {
  cursor: not-allowed;
  opacity: 0.44;
}

.communication-context-actions.workspace-tabs button:not(:disabled):hover {
  border-color: color-mix(in srgb, var(--blue) 58%, var(--line));
  background: color-mix(in srgb, var(--blue) 10%, var(--panel));
}

.communication-context-card {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 88%, var(--button-bg));
}

.communication-context-card h2 {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.communication-context-card .detail-grid {
  grid-template-columns: 1fr;
}

.communication-context-card p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
}

.communication-context-mini-list {
  display: grid;
  gap: 5px;
}

.communication-context-mini-list span {
  min-width: 0;
  padding: 5px 7px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--button-bg) 68%, transparent);
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
}

/* Unified Communications middle pane: compact bubbles for scanning more history. */
.latest-messages-only .message-thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 78px;
  overflow-y: auto;
}

.latest-messages-only .message-bubble,
.latest-messages-only .email-card {
  box-sizing: border-box;
  width: min(94%, 560px);
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 14px;
}

.latest-messages-only .message-bubble strong,
.latest-messages-only .message-bubble small,
.latest-messages-only .message-bubble .message-stamp {
  font-size: 10px;
  line-height: 1.22;
}

.latest-messages-only .message-bubble p {
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.35;
}

.latest-messages-only .email-card-open strong {
  font-size: 14px;
}

.latest-messages-only .email-card-open small {
  margin-top: 4px;
  font-size: 13px;
}

.latest-messages-only .email-card p {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.4;
}

/* Message view overlay (global, for right-panel message reading) */
.message-view-overlay {
  position: fixed;
  inset: 0;
  z-index: 119;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.46);
}

.message-view-sheet {
  display: flex;
  width: min(820px, 100%);
  max-height: min(820px, calc(100dvh - 48px));
  min-height: 480px;
  flex-direction: column;
  border-radius: 16px;
  background: #fff;
  color: #111827;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.42);
  overflow: hidden;
}

.message-view-header {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #e5e7eb;
}

.message-view-header-info {
  min-width: 0;
}

.message-view-header-info strong {
  display: block;
  font-size: 18px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-view-header-info span {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: #6b7280;
}

.message-view-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #f9fafb;
  color: #111827;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.message-view-meta {
  flex: 0 0 auto;
  display: grid;
  gap: 5px;
  padding: 12px 20px;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
  font-size: 13px;
}

.message-view-meta div {
  display: flex;
  gap: 10px;
  min-width: 0;
}

.message-view-meta dt {
  min-width: 44px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  font-size: 10px;
  padding-top: 1px;
}

.message-view-meta dd {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #111827;
}

.message-view-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 22px 24px;
}

.message-view-subject {
  margin: 0 0 16px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
}

.message-view-text {
  font-size: 20px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-view-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid #e5e7eb;
}

.message-view-actions .btn {
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 15px;
}

/* Text-message popup: styled like a messaging thread, distinct from email */
.message-view-sheet.text {
  background: #f5f5f7;
}

.message-view-text-body {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
}

.message-view-text-bubble {
  max-width: 88%;
  padding: 16px 20px;
  border-radius: 24px;
}

.message-view-text-bubble.outbound {
  align-self: flex-end;
  background: #007aff;
  color: #fff;
  border-bottom-right-radius: 7px;
}

.message-view-text-bubble.inbound {
  align-self: flex-start;
  background: #e9e9eb;
  color: #111827;
  border-bottom-left-radius: 7px;
}

.message-view-text-bubble .message-view-text {
  font-size: clamp(20px, 2.6vh, 30px);
  line-height: 1.4;
}

.message-view-text-reply {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid #e1e1e6;
  background: #fff;
}

.message-view-text-reply textarea {
  flex: 1 1 auto;
  min-height: 46px;
  max-height: 140px;
  padding: 11px 14px;
  border: 1px solid #d1d5db;
  border-radius: 20px;
  background: #fff;
  color: #111827;
  font-size: 16px;
  resize: none;
}

.message-view-text-reply .btn {
  flex: 0 0 auto;
  min-height: 46px;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 15px;
}

.message-view-sheet.voice {
  background: #f8fafc;
}

.voice-view-body {
  display: grid;
  align-content: start;
  gap: 12px;
}

.voice-detail-section {
  display: grid;
  gap: 7px;
  padding: 14px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.voice-detail-section h2,
.voice-detail-section summary,
.voice-action-items.detail strong {
  margin: 0;
  color: #374151;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.voice-detail-section p {
  margin: 0;
  color: #111827;
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.voice-detail-section.transcript summary {
  cursor: pointer;
}

.message-view-sheet.voice .voice-transcript-flow {
  background: #fff;
}

.message-view-sheet.voice .voice-transcript-line {
  font-size: 15px;
}

.voice-recording.detail {
  padding: 14px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.communication-summary-overlay {
  position: fixed;
  inset: 0;
  z-index: 122;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(0, 0, 0, 0.48);
}

.communication-summary-modal {
  width: min(680px, 100%);
  max-height: min(720px, calc(100dvh - 44px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
  color: #111827;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.42);
}

.communication-summary-modal header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid #e5e7eb;
}

.communication-summary-modal header strong,
.communication-summary-modal header span {
  display: block;
}

.communication-summary-modal header strong {
  font-size: 18px;
}

.communication-summary-modal header span {
  margin-top: 2px;
  color: #6b7280;
  font-size: 12px;
}

.communication-summary-body {
  display: grid;
  gap: 12px;
  overflow-y: auto;
  padding: 18px;
}

.communication-summary-body p,
.communication-summary-body li {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
}

.communication-summary-body ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 19px;
}

.communication-summary-body details {
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
}

.communication-summary-body summary {
  cursor: pointer;
  color: #374151;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.mobile-compose-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.42);
}

.mobile-compose-sheet {
  display: flex;
  width: min(680px, 100%);
  max-height: min(760px, calc(100dvh - 48px));
  min-height: 460px;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  background: #fff;
  color: #111827;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
}

.mobile-compose-header,
.mobile-compose-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mobile-compose-header span {
  display: block;
  color: #2563eb;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.mobile-compose-header strong {
  display: block;
  color: #111827;
  font-size: 17px;
}

.mobile-compose-header button {
  width: 38px;
  height: 38px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #f9fafb;
  color: #111827;
  font-size: 28px;
  line-height: 1;
}

.mobile-compose-sheet input,
.mobile-compose-sheet textarea {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827;
  font-size: 16px;
}

.mobile-compose-sheet input {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 9px;
}

.mobile-compose-sheet textarea {
  flex: 1 1 auto;
  min-height: 160px;
  padding: 10px;
  border-radius: 12px;
  resize: none;
}

.mobile-compose-actions .btn {
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 14px;
}

.communication-composer textarea {
  min-height: 36px;
  max-height: 96px;
  resize: vertical;
  border-radius: 8px;
  padding: 8px 12px;
}

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

.email-composer input[name="subject"] {
  grid-column: 1 / -1;
  min-height: 34px;
  border-radius: 8px;
  padding: 7px 10px;
}

.email-composer textarea {
  min-height: 74px;
  border-radius: 8px;
}

.email-thread .communication-timeline-card {
  border-radius: 8px;
}

.unified-communication-thread {
  grid-template-rows: minmax(0, 1fr) auto;
}

.detail-communication-thread {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.communication-compose-stack {
  display: grid;
  gap: 8px;
  min-height: 0;
}

.communication-compose-stack .communication-composer {
  padding-top: 6px;
}

.communication-plus,
.communication-send {
  min-height: 36px;
  border: 1px solid var(--line);
  font-weight: 900;
}

.communication-plus {
  width: 34px;
  border-radius: 10px;
  background: var(--button-bg);
  color: var(--blue);
  font-size: 22px;
  line-height: 1;
}

.communication-text-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 4px;
  min-width: 0;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 86%, var(--button-bg));
}

.communication-text-control textarea {
  min-width: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.communication-text-control textarea:focus {
  outline: none;
  box-shadow: none;
}

.communication-send {
  display: grid;
  align-content: center;
  gap: 1px;
  padding: 4px 10px;
  border-radius: 9px;
  background: var(--blue);
  color: #fff;
  line-height: 1.05;
}

.communication-send span {
  font-size: 13px;
}

.communication-send small {
  display: block;
  color: rgba(255, 255, 255, .82);
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.communication-send kbd {
  display: inline-flex;
  align-items: center;
  min-height: 14px;
  padding: 1px 4px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, .45);
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font: inherit;
}

.communication-attachment-tray {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-panel);
}

.communication-attachment-tray > strong,
.communication-attachment-tray > p {
  flex: 1 0 100%;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.attachment-chip {
  max-width: 180px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--button-bg);
  color: var(--ink);
  text-align: left;
}

.attachment-chip span,
.attachment-chip small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.estimate-builder {
  margin-top: 14px;
}

.estimate-builder.compact {
  gap: 8px;
}

.estimate-add-form {
  margin-bottom: 4px;
}

.line-form-grid,
.estimate-line-fields,
.estimate-part-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  align-items: end;
}

.line-form-grid label,
.estimate-line-fields label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.estimate-line-fields input,
.estimate-part-form input {
  min-height: 34px;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--input-bg);
  color: var(--ink);
  padding: 7px 9px;
}

.estimate-line-list {
  display: grid;
  gap: 10px;
}

.estimate-line-card {
  display: grid;
  gap: 10px;
}

.estimate-line-card.active {
  border-color: color-mix(in srgb, var(--blue) 70%, var(--line));
  box-shadow: inset 3px 0 0 var(--blue);
}

.estimate-line-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.estimate-line-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: end;
}

.estimate-line-header button:first-child {
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.estimate-part-list {
  display: grid;
  gap: 7px;
  padding-left: 10px;
  border-left: 2px solid color-mix(in srgb, var(--blue) 42%, var(--line));
}

.estimate-part-line {
  display: grid;
  gap: 6px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--soft-panel);
}

.compact-fields {
  grid-template-columns: minmax(150px, 1.5fr) 78px 110px;
}

.estimate-part-form {
  grid-template-columns: minmax(150px, 1fr) 76px 112px auto;
}

.estimate-totals {
  display: grid;
  gap: 6px;
  justify-self: end;
  min-width: min(100%, 270px);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-panel);
}

.estimate-totals div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.estimate-totals strong {
  color: var(--ink);
}

.estimate-totals .grand-total {
  padding-top: 6px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.intake-form {
  max-width: 760px;
}

.intake-vin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.intake-scanner-panel {
  position: relative;
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-panel);
}

.intake-scanner-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.scanner-close-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 98, 98, 0.46);
  border-radius: 999px;
  background: rgba(255, 98, 98, 0.12);
  color: var(--ink);
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
}

.intake-mileage-gate .workspace-section {
  border-color: rgba(79, 182, 255, 0.48);
  background: var(--active-bg);
}

.intake-job-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 7px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.intake-job-picker legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.intake-job-picker small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
}

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

.role-check-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
}

.role-check {
  display: flex;
  align-items: center;
  min-height: 36px;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--input-bg);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
}

.role-check input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--accent);
}

.role-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 4px;
}

.role-pill {
  padding: 4px 7px;
  border: 1px solid rgba(79, 182, 255, 0.34);
  border-radius: 999px;
  background: var(--active-bg);
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 900;
}

.role-pill.platform-managed {
  border-color: rgba(255, 202, 104, 0.38);
  background: rgba(255, 202, 104, 0.12);
  color: var(--warning, #f59e0b);
}

.staff-role-editor {
  display: grid;
  gap: 9px;
  margin-top: 10px;
}

.staff-role-editor .btn {
  justify-self: start;
}

.staff-schedule-summary {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.staff-schedule-editor {
  min-width: 0;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--button-bg) 76%, var(--panel));
}

.staff-schedule-editor legend {
  padding: 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.staff-schedule-rule-grid {
  display: grid;
  gap: 8px;
}

.staff-schedule-rule {
  display: grid;
  grid-template-columns: minmax(94px, 0.9fr) repeat(2, minmax(92px, 1fr));
  gap: 8px;
  align-items: end;
  min-width: 0;
}

.staff-schedule-rule .role-check {
  min-height: 36px;
}

.compact-schedule-time {
  gap: 4px;
}

.compact-schedule-time span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.compact-schedule-time input {
  min-height: 34px;
  background: var(--input-bg);
  color: var(--ink);
  color-scheme: light;
  -webkit-text-fill-color: var(--ink);
  opacity: 1;
}

:root[data-theme="dark"] .compact-schedule-time input {
  color-scheme: dark;
}

.compact-schedule-time [data-schedule-time-display] {
  min-height: 18px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
}

:root[data-theme="dark"] .compact-schedule-time input::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

@media (max-width: 640px), (hover: none) and (pointer: coarse) {
  .staff-schedule-rule {
    grid-template-columns: 1fr;
  }
}

.payroll-panel {
  display: grid;
  gap: 12px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.payroll-summary,
.payroll-staff-list,
.payroll-staff-card {
  display: grid;
  gap: 12px;
}

.payroll-profile-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 8px;
}

.payroll-profile-form input,
.payroll-profile-form select {
  min-height: 36px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--input-bg);
  color: var(--ink);
  padding: 7px 9px;
}

.payroll-profile-form .btn {
  justify-self: start;
}

.qb-employee-picker {
  display: grid;
  grid-column: 1 / -1;
  gap: 7px;
}

.qb-employee-picker > span,
.payroll-qb-picker-note {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.qb-employee-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.qb-employee-chip {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--ink);
  padding: 7px 9px;
  font-weight: 800;
}

.qb-employee-chip[aria-pressed="true"] {
  border-color: rgba(74, 222, 128, 0.72);
  background: rgba(74, 222, 128, 0.14);
  color: var(--ink);
}

.payroll-punch-list {
  display: grid;
  gap: 7px;
}

.payroll-settings-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(140px, 0.5fr) auto;
  align-items: end;
  gap: 8px;
}

.payroll-setting-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  color: var(--ink);
  font-weight: 800;
}

.payroll-setting-check input {
  width: 18px;
  height: 18px;
}

.payroll-review-callout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--soft-panel);
}

.payroll-review-callout.needs-review {
  border-color: rgba(241, 180, 95, 0.56);
}

.payroll-review-callout.reviewed {
  border-color: rgba(85, 199, 154, 0.56);
}

.payroll-review-callout strong,
.payroll-rule-group strong,
.payroll-rule-sources strong {
  color: var(--ink);
}

.payroll-review-callout p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.payroll-review-overlay {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 8, 18, 0.68);
}

.payroll-review-modal {
  width: min(760px, calc(100vw - 36px));
  max-height: min(84vh, 760px);
  overflow: auto;
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.45);
}

.payroll-review-modal h3,
.payroll-review-modal p {
  margin: 0;
}

.payroll-rule-group,
.payroll-rule-sources {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
}

.payroll-rule-group p,
.payroll-rule-choice span {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.payroll-rule-choice {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.payroll-rule-choice input {
  margin-top: 2px;
}

.payroll-rule-choice b {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
}

.payroll-rule-sources {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.payroll-rule-sources strong {
  grid-column: 1 / -1;
}

.payroll-rule-sources a {
  color: var(--primary);
  font-weight: 800;
}

.payroll-jurisdiction-checklist {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
}

.payroll-jurisdiction-checklist strong {
  color: var(--ink);
}

.payroll-jurisdiction-checklist p,
.payroll-jurisdiction-checklist small {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.payroll-punch-list > strong {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.payroll-correction-reason {
  width: 100%;
}

.payroll-punch-row {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) minmax(118px, 1.2fr) minmax(70px, 0.7fr) auto;
  align-items: center;
  gap: 7px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
}

.payroll-punch-row.needs-review {
  border-color: rgba(255, 171, 64, 0.7);
}

.payroll-punch-row span {
  min-width: 0;
  color: var(--ink);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.payroll-notes,
.payroll-warnings,
.payroll-job-list {
  display: grid;
  gap: 5px;
}

.payroll-salary-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

@media (max-width: 760px) {
  .vehicle-identity-strip {
    margin: 5px 0 7px;
    padding: 5px 7px;
  }

  .vehicle-identity-km {
    font-size: 19px;
  }

  .vehicle-identity-ro {
    font-size: 17px;
  }

  .vehicle-identity-title {
    font-size: 17px;
  }

  .tech-job-box-head {
    gap: 5px;
  }

  .tech-job-metrics {
    justify-content: flex-end;
  }

  .payroll-settings-form {
    grid-template-columns: 1fr;
  }
}

.payroll-notes p,
.payroll-warnings p,
.payroll-job-list p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.payroll-warnings p {
  color: #a15c00;
  font-weight: 800;
}

.dispatch-job-card {
  display: grid;
  gap: 10px;
}

.dispatch-job-open {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.dispatch-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.dispatch-controls label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.dispatch-controls select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--input-bg);
  color: var(--ink);
  padding: 7px 9px;
}

.setup-message {
  margin: 0 0 10px;
  padding: 9px 10px;
  border: 1px solid rgba(79, 182, 255, 0.38);
  border-radius: 8px;
  background: var(--active-bg);
  color: var(--ink);
  font-weight: 800;
}

.chart-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(120px, 2fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.chart-row div {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel-soft);
}

.chart-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--cyan, #4fd1c5));
}

.quick-links {
  align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.empty-pane {
  display: grid;
  min-height: 160px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.timestamp-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 12px;
}

.timestamp-grid p {
  border: 1px solid var(--line);
  border-radius: 7px;
  margin: 0;
  padding: 9px 10px;
  background: #fbfcfd;
}

.timestamp-grid span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  margin-bottom: 4px;
}

.timestamp-grid strong {
  display: block;
  font-size: 13px;
}

.workflow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafb;
}

.phone-login [data-login-mode="qr"],
.phone-approval [data-login-mode="qr"] {
  display: none;
}

.phone-login .segmented,
.phone-approval .segmented {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.segmented button {
  border-radius: 6px;
  padding: 9px 10px;
  background: transparent;
  color: var(--muted);
}

.segmented button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 6px rgba(20, 33, 43, 0.1);
}

.section-title {
  margin: 0;
}

.login-methods {
  display: grid;
  gap: 12px;
}

.login-method-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.login-method-primary {
  border-color: #9dc8ec;
  background: #f7fbff;
}

.login-method-card h3 {
  margin: 0 0 4px;
  padding-right: 34px;
}

.login-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  align-items: end;
}

.login-action-row .btn {
  min-height: 46px;
  white-space: normal;
  line-height: 1.2;
}

.login-code-sent .login-action-row {
  grid-template-columns: minmax(112px, 0.72fr);
}

.login-code-sent .login-action-row .btn {
  display: none;
}

.compact-field {
  margin: 0;
}

.step-number {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e7f1fb;
  color: var(--primary);
  font-weight: 700;
}

.qr-box {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.qr-box img {
  width: 220px;
  height: 220px;
  image-rendering: crisp-edges;
}

.qr-result {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.qr-result img {
  width: 220px;
  height: 220px;
  image-rendering: crisp-edges;
}

.qr-approval-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #9dc8ec;
  border-radius: 8px;
  background: #f7fbff;
  color: var(--ink);
}

.qr-approval-card strong {
  font-size: 1.05rem;
}

.qr-approval-card p {
  margin: 0;
}

.qr-approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stack {
  display: grid;
  gap: 12px;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 12px;
  align-items: start;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.timeline-item strong {
  font-size: 13px;
}

.timeline-list {
  display: grid;
  gap: 0;
}

.timeline-event {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 12px;
  padding: 0 0 14px;
  position: relative;
}

.timeline-event:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 18px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}

.timeline-marker {
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px #e7f1fb;
  z-index: 1;
}

.timeline-time {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.correction-note {
  min-height: 0;
  color: #245a86;
  font-size: 12px;
}

.correction-note:not(:empty) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #b9d7f2;
  border-radius: 7px;
  background: #eef7ff;
}

.correction-note button {
  border: 0;
  border-radius: 6px;
  background: #d8ecfb;
  color: #12466f;
  cursor: pointer;
  font: inherit;
  padding: 4px 8px;
}

.money-input {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  overflow: hidden;
}

.money-input span {
  display: grid;
  place-items: center;
  min-width: 36px;
  height: 100%;
  color: var(--muted);
  background: #f5f8fa;
  border-right: 1px solid var(--line);
  font-weight: 700;
}

.money-input input {
  border: 0;
  border-radius: 0;
}

.money-input:focus-within {
  border-color: #8ebfe8;
  box-shadow: 0 0 0 3px #e7f1fb;
}

.customer-auth-summary {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid #b9d7f2;
  border-radius: 8px;
  background: #f3f8fd;
}

.customer-auth-summary strong {
  display: block;
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.05;
}

.customer-auth-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.decoded-grid.compact {
  max-height: none;
}

.estimate-line-row {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.estimate-line-row h3 {
  margin: 0;
  font-size: 15px;
}

.authorization-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.authorization-terms,
.authorization-agreement {
  padding: 12px 14px;
  border: 1px solid #b9d7f2;
  border-radius: 8px;
  background: #f3f8fd;
  color: #18384f;
  font-weight: 600;
  line-height: 1.45;
}

.authorization-agreement {
  display: grid;
  gap: 12px;
  padding: 16px;
  font-weight: 500;
}

.authorization-agreement h2 {
  margin: 2px 0 0;
  font-size: 20px;
}

.authorization-agreement-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 20px;
}

.authorization-agreement-list li {
  padding-left: 2px;
}

.authorization-consent {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid #c9dcec;
  border-radius: 8px;
  background: #fff;
  color: #18384f;
  font-weight: 700;
  line-height: 1.45;
}

.authorization-consent input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.authorization-consent a {
  color: var(--blue);
}

.search-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.search-row input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 11px;
}

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

.field.full {
  grid-column: 1 / -1;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(13, 24, 32, 0.42);
  display: grid;
  justify-items: end;
  z-index: 10;
}

.drawer {
  width: min(520px, 100%);
  height: 100%;
  background: #fff;
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
}

.drawer header,
.drawer footer {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.drawer footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.drawer h2 {
  margin: 0;
  font-size: 18px;
}

.drawer main {
  padding: 16px;
  overflow: auto;
}

.empty {
  padding: 26px;
  text-align: center;
  color: var(--muted);
}

.split-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.status-line {
  height: 8px;
  border-radius: 99px;
  background: #edf1f4;
  overflow: hidden;
  margin-top: 10px;
}

.status-line span {
  display: block;
  height: 100%;
  background: var(--green);
}

.decoded-box {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.decoded-box h3 {
  margin: 0;
  font-size: 14px;
}

.vin-scan-box {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #b9d7f2;
  border-radius: 8px;
  background: #f3f8fd;
}

.vin-scan-box h3 {
  margin: 0 0 4px;
}

.vin-scan-reader {
  overflow: hidden;
  border: 1px solid #b9d7f2;
  border-radius: 8px;
  background: #0f172a;
  min-height: 260px;
}

.vin-scan-reader video {
  width: 100% !important;
  min-height: 260px;
  border-radius: 8px;
  object-fit: cover;
}

.vin-scan-reader img,
.vin-scan-reader button,
.vin-scan-reader select {
  display: none !important;
}

.scan-diagnostics {
  padding: 10px 12px;
  border: 1px dashed #98b8d2;
  border-radius: 8px;
  background: #fff;
}

.scan-diagnostics summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
}

.scan-diagnostics pre {
  max-height: 180px;
  margin: 10px 0 0;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
}

.vin-photo-cropper {
  position: relative;
  overflow: auto;
  max-height: 420px;
  border: 1px solid #b9d7f2;
  border-radius: 8px;
  background: #0f172a;
  touch-action: pan-x pan-y;
}

.vin-photo-cropper canvas {
  display: block;
  width: 100%;
}

.vin-photo-cropper .meta {
  margin: 0;
  padding: 10px 12px;
  background: #fff;
}

.vin-crop-band {
  pointer-events: none;
  position: absolute;
  left: 5%;
  right: 5%;
  top: 42%;
  height: 16%;
  border: 2px solid #1d72b8;
  border-radius: 6px;
  box-shadow: 0 0 0 999px rgba(15, 23, 42, 0.46);
}

.vin-scan-video {
  width: 100%;
  max-height: 360px;
  border-radius: 8px;
  background: #0f172a;
  object-fit: cover;
}

.receipt-capture {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d7e3eb;
  border-radius: 8px;
  background: #fbfcfd;
}

.receipt-capture h3 {
  margin: 0 0 4px;
}

.receipt-preview-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(240px, 1.2fr);
  gap: 12px;
}

.receipt-preview,
.receipt-analysis {
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.receipt-preview img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  background: #0f172a;
}

.receipt-analysis {
  padding: 12px;
}

.receipt-analysis.empty,
.receipt-preview.empty {
  display: grid;
  place-items: center;
}

.receipt-detail-grid {
  max-height: none;
  margin-top: 0;
}

.inventory-review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.inventory-review-grid .important-field {
  grid-column: 1 / -1;
}

.inventory-review-grid .important-field input {
  border-color: #8ebfe8;
  background: #f7fbff;
  font-weight: 700;
}

.receipt-warnings {
  margin: 12px 0 0;
  padding-left: 18px;
  color: #7a4c00;
  font-size: 13px;
}

.receipt-card .timestamp-grid {
  margin-top: 10px;
}

.inventory-line-table,
.inventory-detail-table,
.matrix-table {
  display: grid;
  gap: 6px;
  overflow-x: auto;
}

.inventory-line-head,
.inventory-line-row,
.matrix-head,
.matrix-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.9fr) minmax(180px, 1.5fr) minmax(76px, 0.6fr) minmax(90px, 0.7fr) minmax(90px, 0.7fr) minmax(130px, 1fr);
  gap: 6px;
  min-width: 760px;
  align-items: center;
}

.inventory-detail-table .inventory-line-head,
.inventory-detail-table .inventory-line-row {
  grid-template-columns: minmax(110px, 0.9fr) minmax(180px, 1.5fr) minmax(86px, 0.6fr) minmax(86px, 0.6fr) minmax(90px, 0.7fr) minmax(90px, 0.7fr) minmax(130px, 1fr);
}

.matrix-head,
.matrix-row {
  grid-template-columns: repeat(4, minmax(100px, 1fr));
  min-width: 480px;
}

.inventory-line-head,
.matrix-head {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.inventory-line-row,
.matrix-row {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.inventory-line-row input,
.inventory-line-row select,
.matrix-row input {
  min-width: 0;
}

.line-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.inventory-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.notice {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
}

.notice.amber {
  border-color: #ffd89a;
  background: #fff7e8;
  color: #6f4600;
}

.notice.blue {
  border-color: #b6d8ff;
  background: #f2f8ff;
  color: #12436b;
}

.notice.green {
  border-color: #bfe6d5;
  background: #e6f7ef;
  color: #0f7a49;
}

.notice.red {
  border-color: #f0b9c0;
  background: #fff0f2;
  color: var(--red);
}

.flow-step {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}

.flow-step.complete {
  border-color: #bfe6d5;
  background: #e6f7ef;
  color: #0f7a49;
}

.document-image {
  display: block;
  max-width: 100%;
  max-height: 420px;
  object-fit: contain;
  margin-top: 10px;
  background: #0f172a;
}

.condition-report-block {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
}

.condition-report-block h3,
.condition-zone-panel h3 {
  margin: 0;
}

.vehicle-condition-map {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(240px, 1.1fr);
  gap: 14px;
  align-items: start;
}

.vehicle-map-canvas {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

.vehicle-map-canvas svg {
  display: block;
  width: 100%;
  max-height: 520px;
}

.vehicle-reference-image {
  pointer-events: none;
}

.vehicle-shadow {
  fill: #f3f5f7;
  stroke: none;
}

.vehicle-body,
.vehicle-bumper,
.vehicle-hood,
.vehicle-roof,
.vehicle-side,
.vehicle-outline,
.vehicle-side-panel,
.vehicle-rear-panel {
  fill: #f8fafc;
  stroke: #4f5d68;
  stroke-width: 1.15;
  stroke-linejoin: round;
}

.vehicle-glass {
  fill: #eef6fb;
  stroke: #8798a7;
  stroke-width: 1;
}

.vehicle-glass.rear {
  fill: #f4f9fc;
}

.vehicle-wheel {
  fill: #ffffff;
  stroke: #4f5d68;
  stroke-width: 1.3;
}

.vehicle-wheel-inner {
  fill: #f8fafc;
  stroke: #8798a7;
  stroke-width: 0.8;
}

.vehicle-light {
  fill: #ffffff;
  stroke: #8798a7;
  stroke-width: 1;
}

.vehicle-grille,
.vehicle-door-line,
.vehicle-fold-line,
.vehicle-door-handle {
  fill: none;
  stroke: #8798a7;
  stroke-width: 1;
}

.vehicle-door-handle {
  fill: #f8fafc;
  stroke-width: 0.8;
}

.vehicle-fold-line {
  stroke-dasharray: 4 4;
  opacity: 0.65;
}

.vehicle-side-window {
  fill: #eef6fb;
  stroke: #8798a7;
  stroke-width: 0.9;
}

.vehicle-label {
  fill: #536274;
  font-size: 4px;
  font-weight: 800;
  letter-spacing: 0.4px;
  pointer-events: none;
}

.vehicle-tail-light,
.vehicle-center-light {
  fill: #ffdfe3;
  stroke: #be5262;
  stroke-width: 0.8;
}

.vehicle-line {
  stroke: #8798a7;
  stroke-width: 1;
}

.condition-zone {
  fill: rgba(29, 114, 184, 0);
  stroke: transparent;
  stroke-width: 0;
  cursor: pointer;
}

.condition-zone:hover,
.condition-zone.active {
  fill: rgba(29, 114, 184, 0.1);
  stroke: transparent;
}

.condition-zone.marked {
  fill: rgba(224, 68, 88, 0.18);
  stroke: transparent;
}

.condition-zone-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.condition-options {
  display: grid;
  gap: 6px;
}

.condition-custom-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  margin-bottom: 2px;
}

.condition-custom-option input {
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--input-bg);
  color: var(--ink);
  padding: 7px 9px;
}

.condition-custom-option button {
  min-height: 36px;
  border: 1px solid rgba(79, 182, 255, 0.44);
  border-radius: 7px;
  background: var(--active-bg);
  color: var(--accent);
  padding: 0 12px;
  font-weight: 900;
}

.condition-custom-launch {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 58px;
  border: 1px dashed rgba(15, 95, 153, 0.45);
  border-radius: 9px;
  background: #f2f8ff;
  color: #0f5f99;
  padding: 10px 12px;
  text-align: left;
}

.condition-custom-launch span {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.condition-custom-launch strong {
  color: #111827;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.15;
}

.condition-option-button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  text-align: left;
}

.condition-option-button.selected {
  border-color: rgba(79, 182, 255, 0.55);
  background: rgba(79, 182, 255, 0.16);
  color: var(--accent);
}

.condition-zone-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.condition-zone-modal {
  position: fixed;
  inset: max(18px, env(safe-area-inset-top)) 12px max(18px, env(safe-area-inset-bottom));
  transform: none;
  z-index: 90;
  width: min(720px, calc(100vw - 24px));
  max-height: none;
  overflow: auto;
  border: 1px solid #d8dee8;
  border-radius: 14px;
  background: #ffffff;
  color: #111827;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.5);
}

.condition-modal-overlay {
  z-index: 118;
}

.condition-custom-editor-overlay {
  position: fixed;
  inset: var(--app-viewport-offset-top, 0px) 0 auto;
  z-index: 140;
  display: grid;
  height: var(--app-viewport-height, 100dvh);
  place-items: center;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: max(14px, env(safe-area-inset-top)) 12px calc(max(18px, env(safe-area-inset-bottom)) + var(--app-keyboard-clearance, 0px));
  background: rgba(2, 8, 18, 0.62);
}

.condition-custom-editor-card {
  width: min(540px, calc(var(--app-viewport-width, 100vw) - 24px));
  display: grid;
  gap: 14px;
  max-height: calc(var(--app-viewport-height, 100dvh) - max(38px, env(safe-area-inset-top)) - max(28px, env(safe-area-inset-bottom)) - var(--app-keyboard-clearance, 0px));
  overflow-y: auto;
  border: 1px solid #d8dee8;
  border-radius: 14px;
  background: #ffffff;
  color: #111827;
  padding: 16px;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.46);
}

.condition-custom-editor-card header,
.condition-custom-editor-card label {
  display: grid;
  gap: 6px;
}

.condition-custom-editor-card header span,
.condition-custom-editor-card label span,
.condition-custom-next-step > span {
  color: #526170;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.condition-custom-editor-card header strong {
  color: #111827;
  font-size: clamp(22px, 5vw, 30px);
  line-height: 1.1;
}

.condition-custom-editor-card textarea {
  width: 100%;
  min-height: 168px;
  resize: vertical;
  border: 1px solid #d8dee8;
  border-radius: 10px;
  background: #ffffff;
  color: #111827;
  padding: 12px;
  font-size: 19px;
  line-height: 1.35;
  scroll-margin-bottom: calc(var(--app-keyboard-clearance, 72px) + 28px);
}

.condition-custom-next-step {
  display: grid;
  gap: 8px;
}

.condition-custom-next-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.condition-custom-next-option {
  align-content: start;
  min-width: 0;
  border: 1px solid #d8dee8;
  border-radius: 10px;
  background: #f8fafc;
  padding: 10px;
  cursor: pointer;
}

.condition-custom-next-option:has(input:checked) {
  border-color: rgba(15, 95, 153, 0.55);
  background: #eaf5ff;
  box-shadow: inset 0 0 0 1px rgba(15, 95, 153, 0.14);
}

.condition-custom-next-option input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.condition-custom-next-option strong,
.condition-custom-next-option small {
  display: block;
  min-width: 0;
}

.condition-custom-next-option strong {
  color: #111827;
  font-size: 15px;
  line-height: 1.2;
}

.condition-custom-next-option small {
  color: #526170;
  font-size: 12px;
  line-height: 1.35;
}

.condition-custom-editor-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.condition-zone-modal .condition-zone-panel {
  min-height: 100%;
  padding: 0 16px 16px;
  color: #111827;
}

.condition-zone-modal .condition-zone-panel::before {
  content: "Choose an item";
  position: sticky;
  top: 0;
  z-index: 2;
  display: block;
  margin: 0 -16px 0;
  padding: 14px 16px 8px;
  border-bottom: 1px solid #d8dee8;
  background: #ffffff;
  color: #0f5f99;
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
}

.condition-zone-modal .condition-picker-header {
  position: sticky;
  top: 41px;
  z-index: 2;
  margin: 0 -16px;
  padding: 10px 16px 12px;
  border-bottom: 1px solid #d8dee8;
  background: #ffffff;
}

.condition-zone-modal .condition-picker-header h3 {
  color: #111827;
  font-size: clamp(22px, 5vw, 30px);
}

.condition-zone-modal .condition-options {
  padding-top: 14px;
}

.condition-zone-modal .condition-custom-option input {
  min-height: 50px;
  background: #ffffff;
  color: #111827;
  font-size: 17px;
}

.condition-zone-modal .condition-custom-option button {
  min-height: 50px;
  background: #eaf5ff;
  color: #0f5f99;
  font-size: 16px;
}

.condition-zone-modal .condition-option-button {
  min-height: 52px;
  border-color: #d8dee8;
  background: #ffffff;
  color: #111827;
  font-size: 18px;
  line-height: 1.2;
}

.condition-zone-modal .condition-option-button.selected {
  border-color: #2c9be8;
  background: #eaf5ff;
  color: #0f5f99;
}

.condition-zone-modal .condition-existing-list li b {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.condition-picker-header {
  display: grid;
  gap: 10px;
}

.condition-existing-list {
  display: grid;
  gap: 7px;
  border: 1px solid #d9e3ee;
  border-radius: 8px;
  padding: 10px;
  background: #f7fbff;
  color: #111827;
}

.condition-existing-list strong {
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #245b82;
}

.condition-existing-list p {
  margin: 0;
  color: #526170;
  font-size: 14px;
}

.condition-existing-list ul {
  display: grid;
  gap: 6px;
  max-height: 18dvh;
  overflow: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}

.condition-existing-list li {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr) auto;
  gap: 8px;
  align-items: center;
  border-radius: 7px;
  padding: 7px 8px;
  background: #ffffff;
  color: #111827;
  font-size: 14px;
}

.condition-existing-list li span,
.condition-existing-list li em {
  color: #526170;
  font-style: normal;
}

.condition-existing-list li b {
  min-width: 0;
  overflow: hidden;
  color: #111827;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.intake-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 8, 18, 0.62);
}

.intake-modal-card {
  width: min(420px, calc(100vw - 36px));
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.45);
}

.intake-modal-card h2 {
  margin: 0;
  font-size: 22px;
}

.intake-modal-card p {
  margin: 0;
  color: var(--muted);
}

.intake-modal-highlight {
  display: grid;
  gap: 6px;
  justify-items: center;
  border: 2px solid color-mix(in srgb, var(--accent) 42%, var(--line));
  border-radius: 12px;
  padding: 14px 12px 16px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  text-align: center;
}

.intake-modal-highlight span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.intake-modal-highlight strong {
  max-width: 100%;
  color: var(--ink);
  font-size: clamp(44px, 14vw, 76px);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 0.95;
  overflow-wrap: anywhere;
  text-align: center;
}

.intake-modal-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
}

.intake-modal-card input {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--input-bg);
  color: var(--ink);
  padding: 8px 10px;
  font-size: 22px;
}

.intake-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

@media (max-width: 640px), (hover: none) and (pointer: coarse) {
  .intake-modal-overlay {
    inset: var(--app-viewport-offset-top, 0px) 0 auto;
    height: var(--app-viewport-height, 100dvh);
    align-content: center;
    justify-content: center;
    place-items: center;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: max(14px, env(safe-area-inset-top)) 12px calc(max(18px, env(safe-area-inset-bottom)) + var(--app-keyboard-clearance, 0px));
  }

  .intake-modal-card {
    width: min(420px, calc(var(--app-viewport-width, 100vw) - 24px));
    max-height: calc(var(--app-viewport-height, 100dvh) - max(38px, env(safe-area-inset-top)) - max(28px, env(safe-area-inset-bottom)) - var(--app-keyboard-clearance, 0px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .soft-keyboard-open .intake-modal-overlay {
    align-content: start;
    place-items: start center;
    padding-top: max(8px, env(safe-area-inset-top));
    padding-bottom: calc(max(22px, env(safe-area-inset-bottom)) + var(--app-keyboard-clearance, 72px));
  }

  .soft-keyboard-open .intake-modal-card {
    margin-top: 0;
    max-height: calc(var(--app-viewport-height, 100dvh) - max(20px, env(safe-area-inset-top)) - var(--app-keyboard-clearance, 72px));
  }

  .intake-modal-card input {
    font-size: 24px;
    scroll-margin-bottom: calc(var(--app-keyboard-clearance, 72px) + 24px);
  }
}

.vin-warning-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.intake-checklist-summary {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.intake-selected-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(156px, auto);
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  background: var(--surface);
}

.intake-selected-item.ready-dispatch {
  border-color: rgba(30, 161, 92, 0.42);
  background: color-mix(in srgb, var(--surface) 88%, rgba(30, 161, 92, 0.16));
}

.intake-selected-item.needs-authorization {
  border-color: rgba(226, 162, 56, 0.38);
}

.intake-selected-item span,
.intake-selected-item small {
  display: block;
  min-width: 0;
}

.intake-selected-item small,
.intake-selected-item em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.intake-dispatch-control {
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  background: var(--input-bg);
  cursor: pointer;
}

.intake-dispatch-control input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.intake-dispatch-control em {
  color: var(--ink);
  font-weight: 850;
  line-height: 1.15;
}

.condition-attention-list {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.condition-attention-section {
  display: grid;
  gap: 10px;
}

.condition-attention-section h4,
.condition-attention-card h4 {
  margin: 0;
}

.condition-attention-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.condition-attention-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d7e3eb;
  border-radius: 8px;
  background: #fbfdff;
}

.condition-attention-card.note-only {
  background: #fbfcfd;
}

.condition-note {
  margin: 0;
  padding: 10px;
  border-radius: 8px;
  background: #f2f6f9;
  color: var(--text);
}

.condition-item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.estimate-line-card {
  display: grid;
  gap: 8px;
}

.estimate-line-hidden {
  background: #f7f8f9;
  color: #5b6670;
}

.estimate-line-hidden .meta {
  color: #697580;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.inline-check input {
  width: 16px;
  height: 16px;
}

.line-audit-stamp {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #e5d6b6;
  border-radius: 8px;
  background: #fff8e8;
  color: #6f4600;
  font-size: 12px;
  font-weight: 700;
}

.tech-note-override {
  border-color: #d6a419;
  background: rgba(255, 214, 102, 0.12);
}

.tech-note-audit,
.tech-note-draft {
  display: block;
  margin: 4px 0;
  padding: 6px 8px;
  border-radius: 6px;
  background: #fff8e8;
  color: #6f4600;
  font-size: 12px;
  font-weight: 800;
}

.tech-note-draft {
  background: rgba(79, 182, 255, 0.12);
  color: var(--primary-strong);
}

.tech-note-draft button {
  margin-left: 6px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.fast-pass-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: block;
  padding: 24px;
  background: rgba(2, 6, 12, 0.88);
  backdrop-filter: blur(16px);
  overflow: auto;
}

.fast-pass-card {
  width: min(520px, 100%);
  max-height: none;
  overflow: visible;
  display: grid;
  gap: 12px;
  margin: 6vh auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  text-align: center;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.4);
}

.fast-pass-card input {
  text-align: center;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0;
}

.fast-pass-card h2,
.fast-pass-card h3,
.fast-pass-card p {
  margin: 0;
}

.fast-pass-method-card {
  display: grid;
  gap: 6px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
  color: #111827;
  text-align: left;
}

.fast-pass-method-card h3 {
  color: #111827;
}

.fast-pass-method-card p {
  color: #4b5563;
}

.fast-pass-method-card strong {
  color: #0f5f99;
}

.fast-pass-primary-card {
  border-color: #9dc8ec;
  background: #f7fbff;
  text-align: center;
}

.fast-pass-login-methods {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

.fast-pass-login-methods button {
  cursor: pointer;
}

.fast-pass-compact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(104px, 132px);
  gap: 8px;
  align-items: center;
  border: 1px solid #9dc8ec;
  border-radius: 8px;
  padding: 9px 10px;
  background: #f7fbff;
  color: #111827;
  text-align: left;
}

.fast-pass-compact strong {
  font-size: 17px;
  font-weight: 950;
}

.fast-pass-compact span {
  justify-self: start;
  border-radius: 999px;
  padding: 3px 8px;
  background: #ffffff;
  color: #0f5f99;
  font-size: 13px;
  font-weight: 950;
}

.fast-pass-compact input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #c9d7e6;
  border-radius: 7px;
  background: #ffffff;
  color: #111827;
  font-size: 21px;
}

.fast-pass-compact em {
  grid-column: 1 / -1;
  color: #b42318;
  font-style: normal;
  font-weight: 850;
}

.fast-pass-device-note {
  margin: -4px 0 4px;
  color: #475569;
  font-size: 13px;
  line-height: 1.35;
}

.line-visibility-message {
  min-height: 16px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.decoded-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 10px;
  max-height: 380px;
  overflow: auto;
}

.decoded-item {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 10px;
  background: #fbfcfd;
}

.decoded-item span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 4px;
}

.decoded-item strong {
  display: block;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

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

  .grid,
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .workspace-header {
    grid-template-columns: minmax(120px, 1fr) auto minmax(180px, 1fr) auto;
  }

  .workspace-account {
    display: none;
  }

  .workspace-panes {
    grid-auto-flow: column;
    grid-auto-columns: minmax(360px, 50vw);
    grid-template-columns: none;
  }

  .workspace-panes.no-detail-pane {
    grid-template-columns: none;
  }

  .pane-nav {
    display: grid;
  }
}

@media (max-width: 1140px) {
  .pane-edge-control {
    position: fixed;
    top: 50dvh;
    z-index: 70;
    display: flex;
    width: 40px;
    height: 116px;
    align-items: center;
    justify-content: center;
    border: 0;
    background: rgba(5, 12, 20, 0.04);
    color: rgba(245, 250, 255, 0.98);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
    backdrop-filter: blur(12px);
    cursor: pointer;
    touch-action: manipulation;
    transition: opacity 0.18s ease, transform 0.18s ease, filter 0.18s ease;
  }

  .pane-edge-control.previous {
    left: 0;
    border-left: 0;
    border-radius: 0 999px 999px 0;
  }

  .pane-edge-control.next {
    right: 0;
    border-right: 0;
    border-radius: 999px 0 0 999px;
  }

  .pane-edge-control:active {
    filter: brightness(1.12);
    transform: scale(0.98);
  }

  .pane-edge-control.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.92);
  }

  .pane-edge-control span {
    display: block;
    font-size: 48px;
    font-weight: 900;
    line-height: 1;
    transform: translateY(-1px) scaleX(1.15);
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.72), 0 0 14px rgba(79, 182, 255, 0.5);
  }
}

@media (max-width: 640px), (hover: none) and (pointer: coarse) {
  :root {
    --mobile-module-button-size: calc((var(--app-viewport-width, 100vw) - 46px) / 4);
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .login-logo {
    width: min(300px, 100%);
  }

  .login-action-row {
    grid-template-columns: minmax(0, 1fr) minmax(112px, 0.72fr);
  }

  .field-message {
    font-size: 16px;
  }

  body.workspace-body {
    position: fixed;
    inset: 0;
    width: var(--app-viewport-width);
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    overscroll-behavior: none;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .content {
    padding: 16px;
  }

  .nav {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .table {
    display: block;
    overflow-x: auto;
  }

  .authorization-actions {
    grid-template-columns: 1fr;
  }

  .timeline-event .split-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .receipt-preview-grid {
    grid-template-columns: 1fr;
  }

  .vehicle-condition-map {
    grid-template-columns: 1fr;
  }

  .workspace-shell {
    --mobile-header-height: 42px;
    position: fixed;
    inset: 0;
    display: block;
    width: var(--app-viewport-width);
    max-width: var(--app-viewport-width);
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .workspace-shell:has(.header-notification) {
    --mobile-header-height: 74px;
  }

  .workspace-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    width: var(--app-viewport-width);
    max-width: var(--app-viewport-width);
    grid-template-columns: minmax(42px, 0.42fr) minmax(44px, auto) minmax(0, 2.6fr);
    align-items: center;
    gap: 4px;
    height: var(--mobile-header-height);
    min-height: var(--mobile-header-height);
    padding: 2px 8px;
    transform: translateZ(0);
  }

  .workspace-account {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
  }

  .workspace-account .meta {
    max-width: 52px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
  }

  .workspace-account .btn {
    min-height: 30px;
    padding: 4px 6px;
    font-size: 11px;
  }

  .workspace-actions {
    min-width: 0;
    justify-content: flex-end;
    gap: 3px;
    overflow: visible;
  }

  .workspace-logo {
    min-width: 42px;
    max-width: 46px;
    height: 28px;
    max-height: 28px;
  }

  .header-notification {
    grid-column: 1 / -1;
    grid-row: 2;
    min-height: 30px;
    font-size: 12px;
  }

  .workspace-actions strong {
    font-size: 14px;
    white-space: nowrap;
  }

  .pane-nav {
    display: none;
  }

  .pane-bottom-dots {
    position: fixed;
    right: 0;
    bottom: calc(var(--app-browser-bottom-offset, 0px) + max(10px, env(safe-area-inset-bottom)));
    left: 0;
    z-index: 68;
    display: inline-flex;
    width: fit-content;
    margin: 0 auto;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 999px;
    background: transparent;
    pointer-events: auto;
  }

  .pane-bottom-dots .pane-dots {
    gap: 4px;
    min-width: 0;
  }

  .pane-bottom-dots .pane-dots button {
    width: 5px;
    height: 5px;
    background: rgba(232, 242, 250, 0.62);
    opacity: 0.72;
  }

  .pane-bottom-dots .pane-dots button.active {
    width: 13px;
    background: var(--primary);
    opacity: 1;
  }

  [data-theme="light"] .pane-bottom-dots {
    background: transparent;
  }

  [data-theme="light"] .pane-bottom-dots .pane-dots button {
    background: rgba(15, 23, 42, 0.42);
  }

  [data-theme="light"] .pane-bottom-dots .pane-dots button.active {
    background: var(--primary);
  }

  .tenant-identity {
    display: block;
    max-width: 58px;
    text-align: right;
  }

  .tenant-identity strong,
  .tenant-identity span,
  .tenant-identity em {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 9px;
    line-height: 1.05;
  }

  .tenant-identity strong {
    font-size: 0;
  }

  .tenant-identity strong::before {
    content: attr(data-short);
    display: block;
    overflow: hidden;
    color: var(--ink);
    font-size: 9px;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tenant-identity strong b {
    display: none;
  }

  .tenant-location-menu {
    flex: 0 1 58px;
    min-width: 48px;
    max-width: 58px;
  }

  .theme-toggle {
    flex: 0 0 auto;
    min-height: 28px;
    padding: 2px;
    border-radius: 8px;
  }

  .theme-toggle span {
    min-width: 28px;
    min-height: 24px;
    padding: 0;
    border-radius: 6px;
  }

  .theme-toggle span[data-mobile-hidden="true"] {
    display: none;
  }

  .theme-toggle span.active {
    box-shadow: none;
  }

  .theme-toggle b {
    width: 20px;
    height: 20px;
    font-size: 15px;
  }

  .theme-toggle em {
    display: none;
  }

  .workspace-actions .btn {
    min-height: 26px;
    padding: 3px 6px;
    border-radius: 8px;
    font-size: 10px;
    line-height: 1;
  }

  .fast-pass-menu-button {
    min-width: 50px;
  }

  .fast-pass-menu-panel {
    right: -44px;
    width: min(330px, calc(100vw - 22px));
    border-radius: 18px;
    padding: 7px;
    background: rgba(249, 250, 252, 0.98);
    box-shadow: 0 18px 54px rgba(0, 0, 0, 0.34);
  }

  .fast-pass-menu-panel button {
    min-height: 52px;
    font-size: 16px;
    font-weight: 850;
  }

  .fast-pass-overlay {
    padding: 12px;
  }

  .fast-pass-card {
    width: min(520px, 100%);
    max-height: none;
    margin: 3vh auto;
    padding: 16px;
  }

  .fast-pass-login-methods {
    grid-template-columns: 1fr;
  }

  .fast-pass-compact {
    grid-template-columns: minmax(0, 1fr) auto minmax(88px, 112px);
    gap: 6px;
    padding: 8px;
  }

  .fast-pass-compact strong {
    font-size: 15px;
  }

  .fast-pass-compact span {
    padding: 3px 6px;
    font-size: 12px;
  }

  .fast-pass-compact input {
    min-height: 38px;
    font-size: 19px;
  }

  .fast-pass-method-card {
    padding: 12px;
  }

  .time-clock-chip {
    min-width: 58px;
    min-height: 26px;
    padding: 3px 5px;
    border-radius: 8px;
  }

  .time-clock-chip strong {
    overflow: hidden;
    font-size: 0;
  }

  .time-clock-chip strong::after {
    content: attr(data-short);
    font-size: 10px;
    line-height: 1;
  }

  .time-clock-chip em {
    display: none;
  }

  .time-clock-actions {
    right: -86px;
  }

  .swipe-hint {
    display: none;
  }

  .pane-edge-control {
    position: fixed;
    top: calc(var(--mobile-header-height) + 34dvh);
    z-index: 70;
    display: flex;
    width: 36px;
    height: 148px;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: rgba(232, 242, 250, 0.98);
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    cursor: pointer;
    touch-action: manipulation;
    transition: opacity 0.18s ease, transform 0.18s ease, filter 0.18s ease;
  }

  .pane-edge-control::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30px;
    z-index: -1;
    border: 1px solid rgba(232, 242, 250, 0.58);
    background: rgba(5, 12, 20, 0.18);
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .pane-edge-control::after {
    content: "";
    position: fixed;
    top: var(--mobile-header-height);
    bottom: 0;
    width: 1px;
    background: linear-gradient(
      to bottom,
      rgba(232, 242, 250, 0.32) 0,
      rgba(232, 242, 250, 0.32) calc(34dvh - 1px),
      transparent calc(34dvh - 1px),
      transparent calc(34dvh + 148px),
      rgba(232, 242, 250, 0.32) calc(34dvh + 148px),
      rgba(232, 242, 250, 0.32) 100%
    );
    pointer-events: none;
  }

  .pane-edge-control.previous {
    left: 0;
    border-radius: 0 999px 999px 0;
  }

  .pane-edge-control.next {
    right: 0;
    border-radius: 999px 0 0 999px;
  }

  .pane-edge-control.previous::before {
    left: 0;
    border-left: 0;
    border-radius: 0 999px 999px 0;
  }

  .pane-edge-control.previous::after {
    left: 0;
  }

  .pane-edge-control.next::before {
    right: 0;
    border-right: 0;
    border-radius: 999px 0 0 999px;
  }

  .pane-edge-control.next::after {
    right: 0;
  }

  .pane-edge-control:active {
    filter: brightness(1.12);
    transform: scale(0.98);
  }

  .pane-edge-control.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.92);
  }

  .pane-edge-control span {
    display: block;
    font-size: 30px;
    font-weight: 900;
    line-height: 1;
    transform: translateY(-1px) scaleX(0.58);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.72);
  }

  .pane-edge-control.previous span {
    transform: translate(-5px, -1px) scaleX(0.58);
  }

  .pane-edge-control.next span {
    transform: translate(5px, -1px) scaleX(0.58);
  }

  [data-theme="light"] .pane-edge-control {
    color: rgba(15, 23, 42, 0.84);
  }

  [data-theme="light"] .pane-edge-control::before {
    border-color: rgba(15, 23, 42, 0.42);
    background: rgba(255, 255, 255, 0.22);
    box-shadow: none;
  }

  [data-theme="light"] .pane-edge-control::after {
    background: linear-gradient(
      to bottom,
      rgba(15, 23, 42, 0.24) 0,
      rgba(15, 23, 42, 0.24) calc(34dvh - 1px),
      transparent calc(34dvh - 1px),
      transparent calc(34dvh + 148px),
      rgba(15, 23, 42, 0.24) calc(34dvh + 148px),
      rgba(15, 23, 42, 0.24) 100%
    );
  }

  [data-theme="light"] .swipe-hint {
    background: rgba(255, 255, 255, 0.68);
    color: rgba(12, 20, 28, 0.76);
  }

  .swipe-hint strong {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0;
  }

  .intake-vin-row {
    grid-template-columns: 1fr;
  }

  .intake-vin-row .btn {
    min-height: 44px;
  }

  .recent-strip {
    flex-wrap: nowrap;
  }

  .recent-strip button {
    max-width: 72px;
  }

  .workspace-panes {
    display: block;
    position: fixed;
    top: var(--mobile-header-height);
    right: 0;
    bottom: var(--app-browser-bottom-offset, 0px);
    left: 0;
    width: var(--app-viewport-width);
    max-width: var(--app-viewport-width);
    height: calc(var(--app-viewport-height, 100dvh) - var(--mobile-header-height));
    min-height: 0;
    margin-top: 0;
    padding-top: 0;
    overflow: hidden;
    scroll-snap-type: none;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .workspace-pane {
    display: none;
    width: var(--app-viewport-width);
    max-width: var(--app-viewport-width);
    height: 100%;
    min-height: 0;
    padding: 2px 14px max(28px, env(safe-area-inset-bottom));
    overflow-y: auto;
    overflow-x: hidden;
    scroll-snap-align: none;
    scroll-snap-stop: normal;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .workspace-pane:not(.module-pane) {
    overflow-y: auto;
    padding-top: 2px;
  }

  .workspace-pane.active {
    display: block;
  }

  .workspace-pane.active.module-pane {
    display: grid;
  }

  .workspace-pane.active.split-pane-scroll {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }

  .workspace-panes:not(.dragging) .workspace-pane.split-pane-scroll:not(.active) {
    display: none;
  }

  .workspace-panes.dragging {
    position: fixed;
    top: var(--mobile-header-height);
    right: 0;
    bottom: var(--app-browser-bottom-offset, 0px);
    left: 0;
    width: var(--app-viewport-width);
    max-width: var(--app-viewport-width);
    height: calc(var(--app-viewport-height, 100dvh) - var(--mobile-header-height));
    min-height: 0;
    overflow: hidden;
    touch-action: none;
  }

  .workspace-panes.guiding .workspace-pane.drag-pane {
    transition: transform 0.68s cubic-bezier(0.18, 0.72, 0.18, 1);
  }

  .workspace-panes.guiding-full .workspace-pane.drag-pane {
    transition-duration: 1.75s;
    transition-timing-function: cubic-bezier(0.72, 0, 0.22, 1);
  }

  .workspace-panes.dragging .workspace-pane.drag-pane {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--app-viewport-width);
    max-width: var(--app-viewport-width);
    z-index: 4;
    overflow: hidden;
    background: var(--page);
    contain: paint;
    isolation: isolate;
    will-change: transform;
    box-shadow: none;
    backface-visibility: hidden;
    transform-style: preserve-3d;
  }

  .workspace-panes.dragging .workspace-pane.drag-pane.module-pane,
  .workspace-panes.dragging .workspace-pane.drag-pane.split-pane-scroll {
    overflow: hidden;
  }

  .workspace-panes.dragging .workspace-pane.drag-pane.incoming-pane::before {
    content: none;
  }

  .workspace-panes.dragging .workspace-pane.active {
    z-index: 5;
  }

  .workspace-panes.dragging .workspace-pane.drag-pane.incoming-pane {
    z-index: 5;
  }

  .vehicle-condition-map.popup-mode {
    display: block;
  }

  .condition-modal-overlay {
    place-items: stretch;
    align-content: stretch;
    justify-content: stretch;
    overflow: hidden;
    overscroll-behavior: contain;
    padding: max(10px, env(safe-area-inset-top)) 10px calc(max(10px, env(safe-area-inset-bottom)) + var(--app-browser-bottom-offset, 0px));
  }

  .condition-modal-overlay .condition-zone-modal {
    position: relative;
    inset: auto;
    display: flex;
    min-height: 0;
    height: 100%;
    flex-direction: column;
    transform: none;
    z-index: 1;
    width: 100%;
    max-height: none;
    overflow: hidden;
    border: 1px solid #d8dee8;
    border-radius: 14px;
    background: #ffffff;
    color: #111827;
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.45);
  }

  .condition-zone-modal .condition-zone-panel {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    overflow: hidden;
    padding: 0 14px 14px;
  }

  .condition-zone-modal .condition-zone-panel::before {
    position: static;
    flex: 0 0 auto;
    margin: 0 -14px;
    padding: 12px 14px 8px;
  }

  .condition-zone-modal .condition-picker-header {
    position: static;
    flex: 0 0 auto;
    margin: 0 -14px;
    padding: 10px 14px 12px;
  }

  .condition-zone-modal .condition-picker-header h3 {
    font-size: clamp(20px, 6vw, 26px);
  }

  .condition-zone-modal .condition-existing-list ul {
    max-height: 96px;
  }

  .condition-zone-modal .condition-options {
    min-height: 0;
    flex: 1 1 auto;
    grid-template-columns: 1fr;
    align-content: start;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 12px 0 18px;
  }

  .condition-zone-modal .condition-custom-option {
    position: sticky;
    top: 0;
    z-index: 3;
    grid-template-columns: minmax(0, 1fr) 84px;
    margin: 0 0 8px;
    padding-bottom: 8px;
    background: #ffffff;
    box-shadow: 0 10px 16px rgba(255, 255, 255, 0.94);
  }

  .condition-zone-modal .condition-custom-launch {
    position: sticky;
    top: 0;
    z-index: 3;
    margin: 0 0 8px;
    background: #f2f8ff;
    box-shadow: 0 10px 16px rgba(255, 255, 255, 0.94);
  }

  .soft-keyboard-open .condition-custom-editor-overlay {
    align-content: start;
    place-items: start center;
    padding-top: max(8px, env(safe-area-inset-top));
    padding-bottom: calc(max(22px, env(safe-area-inset-bottom)) + var(--app-keyboard-clearance, 72px));
  }

  .soft-keyboard-open .condition-custom-editor-card {
    max-height: calc(var(--app-viewport-height, 100dvh) - max(20px, env(safe-area-inset-top)) - var(--app-keyboard-clearance, 72px));
  }

  .condition-custom-editor-card textarea {
    min-height: 180px;
    font-size: 20px;
  }

  .condition-zone-modal .condition-option-button {
    padding: 12px 14px;
    font-size: 18px;
  }

  .condition-zone-modal .condition-zone-actions {
    flex: 0 0 auto;
    margin-top: 0;
    padding-top: 10px;
    border-top: 1px solid #d8dee8;
    background: #ffffff;
  }

  .module-pane {
    height: 100%;
    overflow: hidden;
    padding-top: 2px;
  }

  .pane-sticky {
    position: sticky;
    margin: 0 0 12px;
    padding: 0 0 12px;
    top: 0;
    z-index: 8;
    background: color-mix(in srgb, var(--page) 78%, var(--panel));
    border-bottom: 1px solid var(--line);
    backface-visibility: hidden;
    transform: translateZ(0);
    will-change: transform;
  }

  .workspace-pane:not(.module-pane) > .pane-sticky {
    position: sticky;
    top: 0;
    margin: -2px -14px 8px;
    padding: 2px 14px 8px;
  }

  .workspace-pane.split-pane-scroll > .pane-sticky {
    position: relative;
    top: auto;
    margin: -2px -14px 0;
  }

  .pane-scroll-body {
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: 12px;
    padding-bottom: max(28px, env(safe-area-inset-bottom));
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .workspace-pane.communication-pane-shell > .pane-scroll-body {
    display: block;
    overflow-y: auto;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .workspace-pane.communication-pane-shell .communications-shell {
    display: block;
    height: auto;
    min-height: 100%;
    overflow: visible;
  }

  .workspace-pane.communication-pane-shell .communication-thread {
    display: block;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .workspace-pane.communication-pane-shell .communication-compose-stack {
    min-height: 0;
    max-height: none;
    overflow-y: visible;
    overflow-x: hidden;
  }

  .workspace-pane.communication-pane-shell .message-thread {
    min-height: 0;
    overflow: visible;
  }

  .module-pane .pane-sticky {
    margin: 0 0 6px;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 8;
    overflow: visible;
    background: color-mix(in srgb, var(--page) 78%, var(--panel));
    border-bottom: 1px solid var(--line);
    backface-visibility: hidden;
    transform: translateZ(0);
    will-change: transform;
  }

  .communication-fixed-top {
    position: sticky;
    top: 0;
    margin: -10px -14px 12px;
    padding: 10px 14px 12px;
    z-index: 8;
    background: color-mix(in srgb, var(--page) 78%, var(--panel));
    border-bottom: 1px solid var(--line);
    backface-visibility: hidden;
    transform: translateZ(0);
    will-change: transform;
  }

  .module-pane.module-searching .module-actions,
  .module-pane.module-searching .recent-strip {
    display: none;
  }

  .module-pane.module-searching .mobile-module-search-results {
    display: none;
    max-height: min(35svh, 260px);
    margin-top: 8px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-module-search-results .record-groups,
  .mobile-module-search-results .module-results {
    display: block;
    padding: 0;
    overflow: visible;
  }

  .mobile-module-search-results .record-group {
    margin-top: 0;
  }

  .module-list,
  .workspace-tabs {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-template-columns: repeat(4, var(--mobile-module-button-size));
    justify-content: start;
    gap: 6px;
    overflow-x: visible;
    padding-bottom: 0;
    margin-top: 0;
  }

  .module-pane .module-results {
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .module-list button,
  .workspace-tabs button {
    width: var(--mobile-module-button-size);
    height: var(--mobile-module-button-size);
    min-height: 0;
    aspect-ratio: 1;
    padding: 4px;
    border-radius: 7px;
  }

  .module-icon {
    width: 28px;
    height: 28px;
    stroke-width: 1.9;
  }

  .module-list button span,
  .workspace-tabs button strong {
    font-size: 11px;
  }

  .module-list small,
  .workspace-tabs button span {
    font-size: 10px;
  }

  .context-module-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 8px;
  }

  .context-module-list.single {
    grid-template-columns: repeat(4, 1fr);
  }

  .context-module-list button {
    display: grid;
    min-height: 48px;
    align-items: center;
    justify-items: center;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--button-bg);
    color: var(--ink);
    text-align: center;
  }

  .context-module-list button span {
    color: var(--muted);
    font-size: 9px;
  }

  .context-module-list button strong {
    font-size: 12px;
    line-height: 1.1;
  }

  .workspace-search {
    margin-top: 0;
  }

  .module-search-toggle {
    min-height: 28px;
    margin-top: 0;
    padding: 4px 8px;
    font-size: 12px;
  }

  .module-tools {
    gap: 6px;
    margin-top: 6px;
  }

  .module-tools .module-actions .btn {
    min-height: 28px;
    padding: 4px 8px;
    font-size: 11px;
  }

  .module-tools .schedule-actions {
    grid-column: 1 / -1;
  }

  .module-tools .schedule-actions .btn {
    width: 100%;
  }

  .workspace-search span {
    margin-bottom: 3px;
    font-size: 10px;
  }

  .workspace-search input {
    min-height: 32px;
    padding: 5px 8px;
    font-size: 13px;
  }

  .search-status {
    min-height: 13px;
    margin-top: 3px;
    font-size: 10px;
  }

  .recent-strip {
    gap: 4px;
    margin-top: 4px;
    padding-bottom: 5px;
  }

  .recent-strip span {
    font-size: 9px;
  }

  .recent-strip button {
    max-width: 84px;
    padding: 2px 6px;
    font-size: 9px;
    line-height: 1.1;
  }

  .module-pane .record-groups,
  .module-results {
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 18px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .record-groups,
  .record-group,
  .workspace-section,
  .quick-links {
    gap: 6px;
  }

  .record-group {
    margin-bottom: 10px;
  }

  .record-group h3,
  .workspace-section h2 {
    font-size: 10px;
  }

  .workspace-record,
  .workspace-card {
    padding: 8px;
    border-radius: 7px;
  }

  .workspace-record strong {
    font-size: 13px;
    line-height: 1.15;
  }

  .workspace-record span,
  .workspace-record small,
  .workspace-card p {
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.2;
  }

  .customer-record {
    gap: 3px;
    padding: 7px 8px;
  }

  .customer-record-main {
    gap: 6px;
  }

  .customer-record-main strong {
    font-size: 13px;
  }

  .customer-flags b {
    min-height: 15px;
    padding: 1px 4px;
    font-size: 8px;
  }

  .customer-ro-lines {
    gap: 1px;
  }

  .customer-ro-line em,
  .customer-ro-line small {
    font-size: 10px;
    line-height: 1.1;
  }

  .detail-grid,
  .workspace-kpis {
    grid-template-columns: 1fr;
  }

  .communication-context-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 7px;
  }

  .message-bubble {
    width: min(90%, 520px);
  }

  .workspace-pane.communication-pane-shell .communication-thread,
  .workspace-pane.communication-pane-shell .unified-communication-thread {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .workspace-pane.communication-pane-shell .communication-context-bar {
    order: 1;
  }

  .workspace-pane.communication-pane-shell .setup-message {
    order: 2;
  }

  .workspace-pane.communication-pane-shell .message-thread {
    order: 3;
    flex: 1 1 auto;
  }

  .workspace-pane.communication-pane-shell .communication-compose-stack,
  .workspace-pane.communication-pane-shell .communication-composer {
    order: 4;
    flex: 0 0 auto;
  }

  .communication-composer {
    z-index: 9;
    display: block;
    gap: 6px;
    margin: 0 -2px;
    padding: 7px 2px max(8px, env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--page) 92%, var(--panel));
    flex: 0 0 auto;
  }

  .mobile-compose-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 7px;
    align-items: center;
  }

  .communication-composer > :not(.mobile-compose-launcher) {
    display: none;
  }

  .communication-composer > .mobile-compose-row {
    display: grid;
  }

  .new-email-action.desktop,
  .jenn-call-action.desktop,
  .voice-action-menu.desktop,
  .email-new-compose-bar .new-email-action.desktop {
    display: none;
  }

  .jenn-call-action.mobile,
  .voice-action-menu.mobile,
  .new-email-action.mobile {
    display: inline-block;
    width: auto;
    min-width: 92px;
    min-height: 40px;
    border-radius: 999px;
  }

  .voice-action-menu.mobile summary {
    min-width: 92px;
    min-height: 40px;
    padding: 0 10px;
    border-radius: 999px;
  }

  .voice-action-menu-panel {
    right: 0;
    bottom: calc(100% + 10px);
  }

  .jenn-call-action.mobile {
    display: inline-flex;
    padding: 0 10px;
  }

  .new-email-action.mobile {
    display: inline-flex;
    padding: 0 10px;
  }

  .new-email-action.mobile strong {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: nowrap;
  }

  .new-email-action.mobile span {
    font-size: 18px;
  }

  .workspace-pane.communication-pane-shell .communication-compose-stack .email-composer {
    display: none;
  }

  .mobile-search-sheet {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
    background: rgba(0, 0, 0, 0.42);
  }

  .mobile-search-panel {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    min-height: 0;
    overflow: hidden;
    border-radius: 18px;
    background: #f8fafc;
    color: #111827;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  }

  .mobile-search-header {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 8px;
    align-items: end;
    padding: 10px 10px 8px;
    border-bottom: 1px solid #d1d5db;
  }

  .mobile-search-header button {
    min-width: 34px;
    min-height: 34px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: #111827;
    font-size: 17px;
    font-weight: 900;
  }

  .mobile-search-header label {
    display: grid;
    gap: 4px;
    min-width: 0;
  }

  .mobile-search-header span {
    overflow: hidden;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .mobile-search-header input {
    width: 100%;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid #94a3b8;
    border-radius: 11px;
    background: #fff;
    color: #111827;
    font-size: 17px;
  }

  .mobile-search-sheet-status {
    margin: 0;
    padding: 7px 12px;
    border-bottom: 1px solid #e5e7eb;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
  }

  .mobile-search-results {
    min-height: 0;
    overflow-y: auto;
    padding: 10px;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-search-results .record-groups,
  .mobile-search-results .module-results,
  .mobile-search-results .workspace-section {
    display: grid;
    gap: 8px;
    margin: 0;
  }

  .mobile-search-results .record-group {
    margin-bottom: 8px;
  }

  .mobile-search-results .workspace-record,
  .mobile-search-results .workspace-card {
    background: #fff;
    color: #111827;
    border-color: #cbd5e1;
  }

  .mobile-search-results .workspace-record span,
  .mobile-search-results .workspace-record small,
  .mobile-search-results .workspace-note,
  .mobile-search-results h3,
  .mobile-search-results h2 {
    color: #475569;
  }

  .mobile-compose-launcher {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 30px;
    align-items: center;
    gap: 7px;
    width: 100%;
    min-height: 40px;
    padding: 5px 5px 5px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--input-bg) 88%, var(--panel));
    color: var(--ink);
    text-align: left;
  }

  .mobile-compose-launcher.email {
    border-radius: 999px;
    border-color: color-mix(in srgb, var(--blue) 34%, var(--line));
  }

  .mobile-compose-launcher .mobile-compose-channel {
    color: var(--blue);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .mobile-compose-launcher strong {
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 15px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-compose-launcher small {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 999px;
    background: #007aff;
    color: #fff;
    font-size: 20px;
    font-weight: 900;
    line-height: 1;
  }

  .mobile-compose-overlay {
    display: block;
    position: fixed;
    inset: 0 0 var(--app-browser-bottom-offset, 0px);
    z-index: 120;
    padding: max(8px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
    background: rgba(0, 0, 0, 0.42);
  }

  .message-view-overlay {
    display: block;
    padding: max(8px, env(safe-area-inset-top)) 0 0;
    background: none;
  }

  .message-view-sheet {
    width: 100%;
    height: 100%;
    max-height: calc(100dvh - max(8px, env(safe-area-inset-top)));
    min-height: 0;
    border-radius: 16px 16px 0 0;
  }

  .latest-messages-only .message-bubble p {
    font-size: 15px;
  }

  .latest-messages-only .email-card p {
    font-size: 15px;
  }

  .mobile-compose-sheet {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 0;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
    background: #fff;
    color: #111827;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
  }

  .mobile-compose-header,
  .mobile-compose-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .mobile-compose-header span {
    display: block;
    color: #2563eb;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .mobile-compose-header strong {
    display: block;
    color: #111827;
    font-size: 17px;
  }

  .mobile-compose-header button {
    width: 38px;
    height: 38px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #f9fafb;
    color: #111827;
    font-size: 28px;
    line-height: 1;
  }

  .mobile-compose-sheet input,
  .mobile-compose-sheet textarea {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #111827;
    font-size: 16px;
  }

  .mobile-compose-sheet input {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 8px 10px;
    border-radius: 9px;
  }

  .mobile-compose-sheet textarea {
    flex: 1 1 auto;
    min-height: 120px;
    padding: 10px;
    border-radius: 12px;
    resize: none;
  }

  .mobile-compose-actions .btn {
    min-height: 42px;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 14px;
  }

  .email-card {
    max-height: 142px;
    overflow: hidden;
  }

  .email-card p {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .email-card-open small {
    color: var(--muted);
    font-size: 10px;
  }

  .mobile-email-read-card {
    display: grid;
    flex: 0 0 auto;
    max-height: min(38svh, 270px);
    overflow-y: auto;
    gap: 8px;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    background: #f9fafb;
  }

  .mobile-email-read-card dl {
    display: grid;
    gap: 4px;
    margin: 0;
  }

  .mobile-email-read-card dl div {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 8px;
  }

  .mobile-email-read-card dt {
    color: #6b7280;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .mobile-email-read-card dd {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: #111827;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-email-read-card article {
    display: grid;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
  }

  .mobile-email-read-card h3,
  .mobile-email-read-card p {
    margin: 0;
    color: #111827;
  }

  .mobile-email-read-card h3 {
    font-size: 15px;
  }

  .mobile-email-read-card p {
    white-space: pre-wrap;
    line-height: 1.35;
  }

  .email-composer {
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
    padding: 8px 2px max(8px, env(safe-area-inset-bottom));
  }

  .email-composer input[name="subject"],
  .email-composer textarea,
  .email-composer .communication-send {
    grid-column: 1;
    width: 100%;
  }

  .email-composer textarea {
    min-height: 92px;
    max-height: 150px;
    font-size: 16px;
  }

  .email-composer .communication-send {
    min-height: 42px;
    border-radius: 9px;
  }

  .external-communication-composer .compose-wide-input:focus,
  .email-address-with-copy .compose-wide-input:focus,
  .email-copy-fields .compose-wide-input:focus {
    width: 100%;
    max-width: 100%;
  }

  .estimate-line-header,
  .estimate-part-form,
  .compact-fields {
    grid-template-columns: 1fr;
  }

  .estimate-line-actions,
  .estimate-line-header .btn {
    width: 100%;
  }
}

@media (max-width: 640px), (hover: none) and (pointer: coarse) {
  .communication-context-actions.workspace-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .communication-context-actions.workspace-tabs button {
    width: 100%;
    height: auto;
    min-height: 68px;
  }
}
