/* Install Schedule — design tokens (Apple-adjacent: calm, spacious, system fonts) */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-elevated: rgba(255, 255, 255, 0.72);
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --border: rgba(0, 0, 0, 0.06);
  --border-strong: rgba(0, 0, 0, 0.1);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.06);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --accent: #0071e3;
  --accent-soft: rgba(0, 113, 227, 0.12);
  --focus-ring: 0 0 0 3px rgba(0, 113, 227, 0.35);
  --grid-hour: 52px;
  --calendar-viewport-hour: 52px;
  --calendar-visible-hours: 9.5;
  --calendar-header-height: 54px;
  --time-col-width: 52px;
  --day-col-min: 112px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Segoe UI", system-ui, sans-serif;
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* Location-specific accents (types will use per-calendar colors from settings later) */
[data-location="charlotte"] {
  --accent: #007aff;
  --accent-soft: rgba(0, 122, 255, 0.14);
  --today-column-bg: rgba(0, 122, 255, 0.07);
}

[data-location="dc"] {
  --accent: #ff9500;
  --accent-soft: rgba(255, 149, 0, 0.16);
  --today-column-bg: rgba(255, 149, 0, 0.08);
}

[data-location="raleigh"] {
  --accent: #34c759;
  --accent-soft: rgba(52, 199, 89, 0.14);
  --today-column-bg: rgba(52, 199, 89, 0.07);
}

[data-location="richmond"] {
  --accent: #9a6b4f;
  --accent-soft: rgba(154, 107, 79, 0.16);
  --today-column-bg: rgba(154, 107, 79, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text-primary);
}

.app-shell {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 20px 20px 32px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .app-shell {
    padding: 28px 32px 40px;
  }
}

@media (min-width: 1200px) {
  .app-shell {
    padding: 28px 40px 40px;
  }

  :root {
    --day-col-min: 128px;
  }
}

@media (min-width: 1600px) {
  :root {
    --day-col-min: 148px;
  }
}

@media (min-width: 1800px) {
  .app-shell {
    padding: 32px 48px 44px;
  }

  :root {
    --day-col-min: 168px;
  }
}

@media (min-width: 2200px) {
  :root {
    --day-col-min: 196px;
  }
}

/* Top bar — desktop title only; hidden on mobile */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 10px;
  min-width: 0;
}

.brand-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-sub {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 400;
  flex: 1 1 100%;
}

@media (min-width: 720px) {
  .brand-sub {
    flex: 0 1 auto;
  }
}

/* Segmented location control */
.location-switch {
  display: inline-flex;
  align-items: stretch;
  padding: 2px;
  background: rgba(120, 120, 128, 0.12);
  border-radius: 999px;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 420px;
}

.location-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.location-switch label {
  flex: 1;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 7px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
  min-width: 0;
}

.location-switch label:hover {
  color: var(--text-primary);
}

.location-switch input:focus-visible + label {
  box-shadow: var(--focus-ring);
}

.location-switch input:checked + label {
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* Calendar chrome */
.calendar-chrome {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  overflow: hidden;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.calendar-toolbar {
  position: relative;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.calendar-chrome:has(.toolbar-menu[open]) {
  overflow: visible;
}

.toolbar-primary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.toolbar-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}

.toolbar-nav .btn-today {
  padding: 7px 10px;
  font-size: 13px;
  min-height: 36px;
}

.toolbar-range {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.view-switch-primary {
  flex: 1 1 auto;
  min-width: 0;
}

.view-switch-primary .btn-seg {
  flex: 1 1 0;
}

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

.toolbar-secondary #btn-new {
  flex-shrink: 0;
  white-space: nowrap;
}

.notification-bell-btn {
  position: relative;
  flex-shrink: 0;
  font-size: 15px;
}

.notification-bell-btn.has-unread {
  color: #b42318;
  background: #fff1f0;
  border-color: rgba(180, 35, 24, 0.3);
}

.notification-badge {
  position: absolute;
  top: -6px;
  right: -7px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: #d92d20;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
}

.toolbar-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toolbar-menu {
  position: relative;
  flex: 0 0 auto;
}

.toolbar-menu > summary {
  list-style: none;
}

.toolbar-menu > summary::-webkit-details-marker {
  display: none;
}

.toolbar-menu-trigger::after {
  content: "⌄";
  margin-left: 6px;
  color: var(--text-secondary);
}

.toolbar-menu[open] > .toolbar-menu-trigger,
.toolbar-menu[open] > .toolbar-account-trigger {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(0, 122, 255, 0.3);
}

.toolbar-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 90;
  display: grid;
  gap: 4px;
  width: 230px;
  padding: 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.toolbar-menu-item {
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.toolbar-menu-item:hover,
.toolbar-menu-item:focus-visible {
  background: var(--accent-soft);
  color: var(--accent);
  outline: none;
}

.toolbar-menu-group {
  display: grid;
  gap: 7px;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
}

.toolbar-menu-label {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
}

.toolbar-menu-group .zoom-switch {
  width: 100%;
  justify-content: space-between;
  box-shadow: none;
}

.toolbar-account-trigger {
  width: 36px;
  height: 36px;
  padding: 2px;
  border-radius: 50%;
}

.toolbar-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.toolbar-account-summary {
  display: grid;
  gap: 2px;
  padding: 6px 10px 10px;
  border-bottom: 1px solid var(--border);
}

.toolbar-account-summary strong {
  font-size: 13px;
}

.toolbar-account-summary span {
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: capitalize;
}

.toolbar-account-panel .acting-as {
  align-items: stretch;
}

.toolbar-account-panel .acting-as select {
  width: 100%;
  max-width: none;
}

.view-switch {
  display: inline-flex;
  align-items: stretch;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  overflow: hidden;
  max-width: 100%;
  box-shadow: var(--shadow-sm);
}

.view-switch .btn-seg {
  border-radius: 0;
  border: none;
  box-shadow: none;
  padding: 7px 10px;
  font-size: 13px;
  background: var(--surface);
  color: var(--text-secondary);
  flex: 0 0 auto;
  white-space: nowrap;
  min-height: 36px;
}

.view-switch .btn-seg:hover {
  background: #f5f5f7;
  color: var(--text-primary);
}

.view-switch .btn-seg.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.view-switch .btn-seg:focus {
  outline: none;
  box-shadow: none;
}

.view-switch .btn-seg:focus-visible {
  box-shadow: var(--focus-ring);
}

.zoom-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.zoom-switch .btn {
  min-width: 0;
}

.zoom-switch .btn-icon {
  width: 32px;
  padding: 8px 0;
  font-size: 18px;
  line-height: 1;
}

.zoom-switch .btn-seg {
  padding: 7px 8px;
  font-size: 12px;
  border: none;
  box-shadow: none;
}

.zoom-switch .btn-seg.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.zoom-switch .btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.mobile-office-field,
.mobile-toolbar-actions,
.mobile-more-menu {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.legend-collapsible {
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.legend-collapsible:not([open]) {
  border-bottom: none;
}

.legend-toggle {
  list-style: none;
  cursor: pointer;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  user-select: none;
}

.legend-toggle::-webkit-details-marker {
  display: none;
}

.legend-toggle::before {
  content: "▸";
  display: inline-block;
  margin-right: 6px;
  transition: transform 0.15s ease;
}

.legend-collapsible[open] .legend-toggle::before {
  transform: rotate(90deg);
}

@media (min-width: 900px) {
  .calendar-toolbar {
    padding: 12px 16px;
    gap: 10px;
  }

  .toolbar-range {
    font-size: 16px;
    flex: 0 1 auto;
    text-align: left;
  }

  .toolbar-nav {
    flex: 0 1 auto;
  }

  .view-switch-primary {
    flex: 0 1 auto;
  }
}

@media (max-width: 719px) {
  .app-shell {
    padding: 8px 10px 16px;
  }

  .calendar-toolbar {
    padding: 8px 10px;
    gap: 6px;
  }

  .toolbar-primary {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .toolbar-nav {
    width: 100%;
  }

  .toolbar-nav .btn-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
  }

  .toolbar-nav .btn-today {
    min-height: 40px;
    margin-left: auto;
  }

  .toolbar-range {
    font-size: 14px;
    white-space: normal;
    line-height: 1.25;
  }

  .view-switch-primary {
    width: 100%;
  }

  .view-switch .btn-seg {
    min-height: 40px;
    padding: 10px 8px;
  }

  .toolbar-secondary {
    gap: 6px;
  }

  .toolbar-secondary .location-switch {
    flex: 1 1 100%;
    max-width: none;
  }

  .toolbar-secondary .acting-as {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
  }

  .toolbar-secondary .acting-as select {
    max-width: 100%;
    min-height: 40px;
  }

  .toolbar-secondary #btn-settings {
    min-height: 40px;
  }

  .calendar-viewport,
  .calendar-scroll {
    max-height: none;
  }
}

.job-search {
  position: relative;
  min-width: 200px;
  max-width: 280px;
  flex: 1 1 200px;
}

@media (min-width: 1200px) {
  .job-search {
    max-width: 360px;
    flex: 1 1 280px;
  }
}

@media (min-width: 1800px) {
  .job-search {
    max-width: 420px;
  }
}

.job-search-input,
.job-search input[type="search"] {
  width: 100%;
  font: inherit;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.job-search input[type="search"]::-webkit-search-cancel-button {
  cursor: pointer;
}

.job-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  max-height: min(320px, 50vh);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 6px;
}

.job-search-empty {
  margin: 8px 10px;
  font-size: 12px;
  color: var(--text-secondary);
}

.job-search-hit {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  font: inherit;
  color: var(--text-primary);
}

.job-search-hit:hover,
.job-search-hit.is-active {
  background: var(--accent-soft);
}

.job-search-hit-main {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.job-search-hit-meta {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.35;
}

.event-block.is-search-highlight,
.month-event-pill.is-search-highlight {
  outline: 3px solid rgba(255, 214, 10, 0.95);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(255, 214, 10, 0.28), 0 8px 28px rgba(0, 0, 0, 0.18);
  z-index: 30;
  animation: search-highlight-pulse 0.9s ease-in-out 2;
}

@keyframes search-highlight-pulse {
  0%,
  100% {
    outline-color: rgba(255, 214, 10, 0.95);
  }
  50% {
    outline-color: rgba(255, 255, 255, 0.95);
  }
}

.btn {
  appearance: none;
  border: none;
  background: var(--surface);
  color: var(--text-primary);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease,
    filter 0.15s ease;
}

.btn:hover {
  background: #e8e8ed;
  border-color: rgba(0, 0, 0, 0.16);
  color: var(--text-primary);
}

.btn:active {
  background: #d2d2d7;
  border-color: rgba(0, 0, 0, 0.2);
  color: var(--text-primary);
  transform: scale(0.98);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring), var(--shadow-sm);
}

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

.btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 82%, #000);
  color: #fff;
  border-color: transparent;
  filter: none;
}

.btn-primary:active {
  background: color-mix(in srgb, var(--accent) 68%, #000);
  color: #fff;
  border-color: transparent;
  transform: scale(0.98);
}

.btn-danger {
  background: #fff1f2;
  color: #be123c;
  border-color: rgba(190, 18, 60, 0.25);
}

.btn-danger:hover {
  background: #fecdd3;
  color: #9f1239;
}

.btn-danger:active {
  background: #fda4af;
  color: #9f1239;
  transform: scale(0.98);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 18px;
  line-height: 1;
}

.chip {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

/* Legend (event types — colors will be settings-driven per location) */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 8px 12px 10px;
  background: var(--surface);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.legend-lead-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #ffd60a;
  border: 1.5px solid rgba(0, 0, 0, 0.22);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.type-scheduled {
  background: var(--type-scheduled, #007aff);
}

.type-tentative {
  background: var(--type-tentative, #af52de);
}

.type-survey {
  background: var(--type-survey, #ff9500);
}

.type-delivery {
  background: var(--type-delivery, #34c759);
}

.type-need_to_schedule {
  background: var(--type-need_to_schedule, #636366);
}

.type-blocked {
  background: var(--type-blocked, #ffd60a);
}

.type-task {
  background: var(--type-task, #8e8e93);
}

/* Scroll grid + off-view event hints */
.calendar-viewport {
  position: relative;
  flex: 1 1 auto;
  min-height: 280px;
  height: var(
    --calendar-viewport-height,
    min(
      calc(var(--calendar-visible-hours) * var(--calendar-viewport-hour) + var(--calendar-header-height)),
      calc(100dvh - 200px)
    )
  );
  max-height: none;
  display: flex;
  flex-direction: column;
}

.calendar-scroll {
  overflow-x: auto;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: none;
  -webkit-overflow-scrolling: touch;
}

body[data-calendar-view="month"] .calendar-viewport {
  height: var(--calendar-viewport-height, min(72vh, 840px));
}

body[data-calendar-view="month"] .calendar-scroll {
  height: 100%;
  max-height: none;
}

.calendar-hint {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 12;
  padding: 10px 14px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #1d1d1f;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.calendar-hint-top {
  top: 0;
  background: linear-gradient(180deg, rgba(255, 204, 77, 0.98) 0%, rgba(255, 204, 77, 0.55) 45%, transparent 100%);
}

.calendar-hint-bottom {
  bottom: 0;
  background: linear-gradient(0deg, rgba(255, 204, 77, 0.98) 0%, rgba(255, 204, 77, 0.55) 45%, transparent 100%);
}

.calendar-hint.is-visible {
  opacity: 1;
}

.idle-sleep-banner {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 20;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.idle-sleep-banner[hidden] {
  display: none !important;
}

.idle-sleep-banner-btn {
  pointer-events: auto;
  appearance: none;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  padding: 10px 16px;
  max-width: 100%;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  text-align: center;
}

.idle-sleep-banner-btn:hover {
  background: #e8e8ed;
}

.idle-sleep-banner-btn:active {
  background: #d2d2d7;
  transform: scale(0.98);
}

.calendar-grid {
  display: grid;
  grid-template-columns: var(--time-col-width) repeat(7, minmax(var(--day-col-min), 1fr));
  min-width: 720px;
}

.calendar-grid.calendar-grid--day {
  min-width: 360px;
}

.calendar-grid.calendar-grid--day .day-header .day-name {
  font-size: 14px;
}

.calendar-grid.calendar-grid--day .day-header .day-num {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.9;
}

.corner-cell {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--surface);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.day-header {
  padding: 4px 4px 5px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: var(--calendar-header-height);
  box-sizing: border-box;
}

.day-header.is-today {
  background: var(--today-column-bg, rgba(0, 122, 255, 0.07));
}

.day-header--link {
  cursor: pointer;
}

.day-header.is-weekend-collapsed {
  padding-left: 2px;
  padding-right: 2px;
}

.day-header.is-weekend-collapsed .day-name {
  font-size: 9px;
  letter-spacing: 0;
}

.day-header.is-weekend-collapsed .day-num {
  font-size: 12px;
}

.day-track.is-weekend-collapsed {
  background: rgba(0, 0, 0, 0.02);
}

.day-header--link:hover {
  background: rgba(0, 122, 255, 0.1);
}

.day-header--link:hover .day-name {
  color: var(--accent);
}

.day-header.is-today .day-name {
  color: var(--accent);
}

.day-name {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  line-height: 1.2;
}

.day-num {
  display: block;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 1px;
  color: var(--text-primary);
  line-height: 1.15;
}

.day-capacity {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin-top: 3px;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.15;
  cursor: default;
  max-width: 100%;
}

.day-capacity.is-editable {
  cursor: pointer;
}

.day-capacity.is-editable:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.day-capacity.is-weekend-unset {
  border-style: dashed;
  border-color: #c45c26;
  background: rgba(196, 92, 38, 0.08);
  color: #8a3d12;
}

.day-capacity.is-weekend-unset .day-capacity-avail {
  color: #8a3d12;
}

.day-capacity-weekend-note {
  font-style: normal;
  font-weight: 650;
  font-size: 9px;
  opacity: 0.9;
}

.day-capacity-avail {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text-primary);
  line-height: 1.1;
  white-space: nowrap;
}

.day-capacity.is-editable:hover .day-capacity-avail {
  color: var(--accent);
}

.day-capacity-out-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin-top: 1px;
  max-width: 100%;
}

.day-capacity-out {
  font-size: 9px;
  font-weight: 600;
  color: #b71c1c;
  opacity: 0.95;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

.day-capacity.has-unavailable {
  border-color: color-mix(in srgb, #c62828 40%, var(--border));
  background: rgba(198, 40, 40, 0.06);
}

.day-header.is-weekend-collapsed .day-capacity {
  display: none;
}

.month-day-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 4px;
  flex-shrink: 0;
}

.month-day-head .month-day-num {
  margin-bottom: 0;
}

.month-day-head .day-capacity {
  margin-top: 0;
  padding: 1px 5px;
  flex-shrink: 1;
  min-width: 0;
  align-items: flex-end;
}

.month-day-head .day-capacity-out-list {
  align-items: flex-end;
}

.month-day-head .day-capacity-out {
  text-align: right;
  max-width: 84px;
}

.list-day-staffing {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  justify-content: flex-start;
  margin: 0 0 12px;
}

.list-day-staffing .day-capacity {
  margin-top: 0;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 6px 10px;
  font-size: 12px;
  align-items: center;
}

.list-day-staffing .day-capacity-avail {
  font-size: 13px;
}

.list-day-staffing .day-capacity-out-list {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 0;
}

.list-day-staffing .day-capacity-out {
  font-size: 12px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.day-staffing-extras-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 8px;
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
}

.day-staffing-extras-toggle:has(input:disabled) {
  cursor: default;
}

.day-staffing-extras-panel.is-collapsed {
  display: none;
}

.day-staffing-extras-people {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.day-staffing-extra-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: end;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.day-staffing-extra-row .field {
  margin: 0;
}

.day-staffing-extras-add {
  margin-bottom: 6px;
}

.day-capacity-extra {
  font-size: 9px;
  font-weight: 600;
  color: #1565c0;
  opacity: 0.95;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

.day-capacity.has-extras {
  border-color: color-mix(in srgb, #1565c0 35%, var(--border));
}

.list-day-staffing .day-capacity-extra {
  font-size: 12px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.user-actions-cell {
  white-space: nowrap;
}

.user-actions-cell .link-btn {
  margin-left: 0;
}

.context-menu-extra-tag,
.assign-extra-tag {
  font-style: normal;
  font-size: 11px;
  font-weight: 650;
  color: #1565c0;
  margin-left: 4px;
}

.context-menu-helper-tag,
.assign-helper-tag {
  font-style: normal;
  font-size: 11px;
  font-weight: 650;
  color: #6a1b9a;
  margin-left: 4px;
}

.context-menu-check--extra {
  background: rgba(21, 101, 192, 0.04);
}

.context-menu-check--helper {
  background: rgba(106, 27, 154, 0.05);
}

.context-menu-helper-add,
.assign-helper-add {
  margin-top: 6px;
  padding: 8px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.context-menu-helper-add-label,
.assign-helper-add-label {
  font-size: 12px;
  font-weight: 650;
  color: var(--text-primary);
}

.context-menu-helper-add-hint,
.assign-helper-add-hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
}

.context-menu-helper-add-row,
.assign-helper-add-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
}

.context-menu-helper-add-row input,
.assign-helper-add-row input {
  min-width: 0;
  width: 100%;
  padding: 7px 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13px;
  background: var(--surface);
  color: var(--text-primary);
}

.context-menu-helper-add-btn,
.assign-helper-add-btn {
  min-height: 34px;
  padding: 6px 10px;
  white-space: nowrap;
}

.assign-row--helper {
  background: rgba(106, 27, 154, 0.04);
  border-radius: 6px;
}

.day-staffing-sheet {
  max-width: 420px;
}

.day-staffing-lead {
  margin: 0 0 8px;
  font-weight: 600;
}

.day-staffing-demand {
  margin: 0 0 12px;
}

.day-staffing-capacity-field {
  margin-bottom: 6px;
}

.day-staffing-hint {
  margin: 0 0 14px;
  font-size: 12px;
}

.day-staffing-section-label {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.day-staffing-tech-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 240px;
  overflow-y: auto;
}

.day-staffing-tech {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}

.day-staffing-tech:has(input:disabled) {
  cursor: default;
  opacity: 0.9;
}

.day-staffing-tech-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

.day-staffing-tech-hint {
  font-size: 11px;
  color: var(--text-tertiary);
}

.day-staffing-tech:has(input:checked) {
  border-color: color-mix(in srgb, #c62828 45%, var(--border));
  background: rgba(198, 40, 40, 0.06);
}

.day-staffing-tech:has(input:checked) .day-staffing-tech-hint {
  color: #b71c1c;
  font-weight: 600;
}

.event-block.event-block--over-capacity:not(.event-tech-gap-violation),
.month-event-pill.event-block--over-capacity:not(.month-event-pill--warn),
.today-card.event-block--over-capacity {
  background: linear-gradient(145deg, #e53935, #b71c1c) !important;
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.event-block.event-block--over-capacity:not(.event-tech-gap-violation):not(.is-dragging):not(.is-resizing):hover {
  box-shadow: 0 4px 16px rgba(183, 28, 28, 0.35);
}

.today-card.event-block--over-capacity .today-card-customer,
.today-card.event-block--over-capacity .today-card-title,
.today-card.event-block--over-capacity .today-card-jobno,
.today-card.event-block--over-capacity .today-card-time,
.today-card.event-block--over-capacity .today-card-address,
.today-card.event-block--over-capacity .today-card-detail,
.today-card.event-block--over-capacity .today-card-detail-label {
  color: #fff;
}

.time-slot {
  height: var(--grid-hour);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: relative;
}

.time-slot:nth-child(7n + 2) {
  /* subtle column zebra for readability */
  background: rgba(0, 0, 0, 0.015);
}

.time-label {
  position: sticky;
  left: 0;
  z-index: 2;
  height: var(--grid-hour);
  padding: 0 6px 0 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding-top: 4px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  transform: translateY(-1px);
}

.time-label span {
  line-height: 1;
}

/* Week view — full-color event card; field status uses .event-field-status frosted chip */
.event-block {
  position: absolute;
  left: 4px;
  right: 4px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  line-height: 1.35;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 1;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.event-block.calendar-event-dimmed,
.month-event-pill.calendar-event-dimmed,
.today-card.calendar-event-dimmed {
  opacity: 0.34;
  filter: saturate(0.45);
}

.event-block.calendar-event-dimmed:hover,
.month-event-pill.calendar-event-dimmed:hover,
.today-card.calendar-event-dimmed:hover {
  opacity: 0.55;
}

/* Concurrent jobs: side-by-side; type/crew scale with lane width (big monitors get readable pills). */
.event-block--narrow {
  container-type: inline-size;
  container-name: event-lane;
}

.event-block--narrow .event-block-main {
  padding: 4px 4px 3px;
}

.event-block--narrow .event-block-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  height: 100%;
}

.event-block--narrow .event-block-text,
.event-block--narrow.event-block--compact .event-block-text,
.event-block--narrow.event-block--ultra-compact .event-block-text {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  padding-right: 0 !important;
}

.event-block--narrow .event-title {
  font-size: 10px;
  line-height: 1.2;
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

.event-block--narrow .event-jobno,
.event-block--narrow .event-meta {
  font-size: 9px;
}

.event-block--narrow .event-techs {
  font-size: 9px;
  font-weight: 700;
}

.event-block--narrow .event-field-status {
  max-width: 100%;
  font-size: 8px;
  padding: 2px 5px;
  margin-top: 2px;
  letter-spacing: 0.02em;
  line-height: 1.15;
}

.event-block--narrow .crew-avatar {
  width: 16px;
  height: 16px;
}

.event-block--narrow .crew-avatar-inner {
  font-size: 7px;
}

.event-block--narrow .crew-avatar--more {
  font-size: 7px;
}

/* Lane-width steps: kick in earlier so 2–3 side-by-side jobs on desktop stay readable */
@container event-lane (min-width: 72px) {
  .event-title {
    font-size: 11px;
    line-height: 1.2;
    -webkit-line-clamp: 4;
  }

  .event-techs,
  .event-jobno,
  .event-meta {
    font-size: 10px;
  }

  .event-field-status {
    font-size: 8px;
    padding: 2px 5px;
  }

  .crew-avatar {
    width: 18px;
    height: 18px;
  }

  .crew-avatar-inner,
  .crew-avatar--more {
    font-size: 8px;
  }
}

@container event-lane (min-width: 96px) {
  .event-title {
    font-size: 12px;
    line-height: 1.25;
  }

  .event-techs,
  .event-jobno,
  .event-meta {
    font-size: 11px;
  }

  .event-field-status {
    font-size: 9px;
    padding: 3px 6px;
    letter-spacing: 0.03em;
  }

  .crew-avatar {
    width: 20px;
    height: 20px;
  }

  .crew-avatar-inner,
  .crew-avatar--more {
    font-size: 9px;
  }

  .event-block-main {
    padding: 5px 6px 3px;
  }
}

@container event-lane (min-width: 130px) {
  .event-title {
    font-size: 13px;
    -webkit-line-clamp: 5;
  }

  .event-techs,
  .event-jobno,
  .event-meta {
    font-size: 12px;
  }

  .event-field-status {
    font-size: 10px;
    padding: 3px 7px;
    letter-spacing: 0.04em;
  }

  .crew-avatar {
    width: 24px;
    height: 24px;
  }

  .crew-avatar-inner,
  .crew-avatar--more {
    font-size: 10px;
  }

  .crew-avatar--lead::after {
    width: 7px;
    height: 7px;
  }

  .event-block-main {
    padding: 6px 7px 4px;
  }
}

@container event-lane (min-width: 180px) {
  .event-title {
    font-size: 14px;
  }

  .event-techs,
  .event-jobno,
  .event-meta {
    font-size: 12px;
  }

  .event-field-status {
    font-size: 11px;
    padding: 4px 8px;
  }

  .crew-avatar {
    width: 28px;
    height: 28px;
  }

  .crew-avatar-inner,
  .crew-avatar--more {
    font-size: 11px;
  }
}

@container event-lane (min-width: 240px) {
  .event-title {
    font-size: 15px;
  }

  .crew-avatar {
    width: 32px;
    height: 32px;
  }

  .crew-avatar-inner,
  .crew-avatar--more {
    font-size: 12px;
  }
}

.event-block--narrow .event-assignees,
.event-block--narrow.event-block--compact .event-assignees,
.event-block--narrow.event-block--crew-expanded .event-assignees {
  display: flex;
  position: static;
  right: auto;
  top: auto;
  transform: none;
  margin-top: 0;
  min-height: 0;
  flex: 0 0 auto;
  justify-content: flex-start;
  z-index: 1;
  padding: 0;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  pointer-events: none;
}

.event-block--narrow .event-assignees .crew-avatars,
.event-block--narrow .event-assignees .crew-avatar {
  pointer-events: auto;
}

.event-block--narrow .crew-avatars {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 2px;
  align-items: center;
  max-width: 100%;
}

.event-block--narrow .crew-avatar--pm {
  border-radius: 3px;
}

.event-block--narrow .crew-avatar--lead::after {
  width: 4px;
  height: 4px;
  top: -2px;
}

.event-block--narrow .crew-empty {
  font-size: 8px;
}

.event-block--narrow.event-assign-incomplete .event-assignees {
  right: auto;
}

/* 3+ lanes: keep job #; hide longer meta until the lane is wide enough. */
.event-block--crowded .event-meta {
  display: none;
}

.event-block--crowded .event-jobno {
  display: block;
}

.event-block--crowded .event-techs {
  display: block;
}

.event-block--crowded .event-title {
  -webkit-line-clamp: 3;
}

.event-block:not(.event-block--compact):not(.is-dragging):not(.is-resizing):hover {
  transform: scale(1.01);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
}

.event-block.is-dragging,
.event-block.is-resizing {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
  z-index: 20;
  opacity: 0.96;
}

/* While dragging across columns, span full track width so the card is easy to place */
.event-block.is-dragging {
  left: 4px !important;
  right: 4px !important;
  width: auto !important;
}

.event-block.event-assign-incomplete::after,
.month-event-pill.event-assign-incomplete::after,
.today-card.event-assign-incomplete::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 7px;
  height: 100%;
  pointer-events: none;
  z-index: 3;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  /* High-contrast diagonal stripe (readable on any event color) */
  background-image: repeating-linear-gradient(
    -45deg,
    #ffffff,
    #ffffff 4px,
    rgba(255, 255, 255, 0.58) 4px,
    rgba(255, 255, 255, 0.58) 8px
  );
  background-size: 22.627px 22.627px; /* 8px × √2 × 2 — one full stripe cycle */
  box-shadow: -1px 0 0 rgba(0, 0, 0, 0.12);
  animation: assign-incomplete-barber 2.8s linear infinite;
}

.month-event-pill.event-assign-incomplete::after {
  z-index: 2;
  border-radius: 0 4px 4px 0;
}

.today-card.event-assign-incomplete::after {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

@keyframes assign-incomplete-barber {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 22.627px 0;
  }
}

.event-missed-punch {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 6;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff3b30;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95), 0 0 0 3px rgba(255, 59, 48, 0.45);
  pointer-events: none;
  animation: missed-punch-pulse 1.1s ease-in-out infinite;
  border: 0;
  padding: 0;
  appearance: none;
}

button.event-missed-punch--action {
  pointer-events: auto;
  cursor: pointer;
}

button.event-missed-punch--action:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95), 0 0 0 4px #ff3b30;
}

.event-block.event-assign-incomplete .event-missed-punch {
  right: 11px;
}

.month-event-pill .event-missed-punch {
  top: 3px;
  right: 3px;
  width: 8px;
  height: 8px;
}

.today-card .event-missed-punch {
  top: 10px;
  right: 10px;
  width: 12px;
  height: 12px;
}

@keyframes missed-punch-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.35;
    transform: scale(0.85);
  }
}

.event-block-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  position: relative;
}

.event-block-main {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 8px 10px 8px;
  cursor: grab;
  touch-action: none;
}

.event-block-body {
  height: 100%;
  min-height: 0;
}

.event-block-text {
  min-width: 0;
}

.event-block.is-dragging .event-block-main {
  cursor: grabbing;
}

.event-title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-jobno {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.01em;
  opacity: 0.82;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-block .event-meta {
  font-size: 11px;
  font-weight: 400;
  opacity: 0.92;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-techs {
  display: none;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-top: 1px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.95;
}

/* Stacked / short cards: hide the long meta line until the lane is wide enough */
.event-block--narrow .event-meta {
  display: none;
}

@container event-lane (min-width: 110px) {
  .event-meta {
    display: block;
  }
}

.event-block--narrow .event-techs,
.event-block--crowded .event-techs,
.event-block--ultra-compact .event-techs {
  display: block;
}

.event-assignees {
  margin-top: 6px;
  min-height: 22px;
}

.crew-avatars {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.crew-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.93);
  color: rgba(0, 0, 0, 0.78);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
}

.crew-avatar--lead::after {
  content: "";
  position: absolute;
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffd60a;
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.crew-avatar--pm {
  border-radius: 5px;
}

.crew-avatar--extra {
  box-shadow: 0 0 0 1.5px rgba(21, 101, 192, 0.55), 0 1px 4px rgba(0, 0, 0, 0.18);
}

.crew-avatar--helper {
  box-shadow: 0 0 0 1.5px rgba(106, 27, 154, 0.55), 0 1px 4px rgba(0, 0, 0, 0.18);
}

.crew-avatar--more {
  background: rgba(255, 255, 255, 0.82);
  font-size: 8px;
}

.crew-avatar-inner {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.crew-empty {
  opacity: 0.8;
  font-size: 11px;
  font-weight: 500;
}

/* Short events — title uses full width; crew pills overlay the right edge */
.event-block--compact .event-block-main {
  padding: 3px 4px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.event-block--compact .event-block-body {
  position: relative;
  display: block;
  min-height: 0;
  width: 100%;
}

.event-block--compact .event-block-text {
  min-width: 0;
  overflow: hidden;
  padding-right: 54px;
}

.event-block--compact .event-title {
  font-size: 10px;
  font-weight: 650;
  line-height: 1.15;
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-block--compact .event-assignees {
  position: absolute;
  right: 1px;
  top: 50%;
  transform: translateY(-50%);
  margin-top: 0;
  min-height: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}

.event-block--compact .event-assignees .crew-avatars,
.event-block--compact .event-assignees .crew-avatar {
  pointer-events: auto;
}

.event-block--compact.event-assign-incomplete .event-assignees {
  right: 5px;
}

.event-block--compact .crew-avatars {
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 2px;
  align-items: center;
}

.event-block--compact .crew-avatar {
  width: 15px;
  height: 15px;
}

.event-block--compact .crew-avatar--pm {
  border-radius: 3px;
}

.event-block--compact .crew-avatar-inner {
  font-size: 7px;
}

.event-block--compact .crew-avatar--lead::after {
  width: 4px;
  height: 4px;
  top: -2px;
}

.event-block--compact .crew-empty {
  font-size: 9px;
}

.event-block--compact .event-field-status {
  max-width: 100%;
  margin-top: 2px;
  padding: 1px 4px;
  font-size: 8px;
  letter-spacing: 0.03em;
  line-height: 1.15;
}

.event-block--ultra-compact .event-block-main {
  padding: 2px 3px;
}

.event-block--ultra-compact .event-meta,
.event-block--ultra-compact .event-jobno {
  display: none;
}

/* Keep job # visible when stacked — even on short cards */
.event-block--narrow .event-jobno,
.event-block--crowded .event-jobno {
  display: block;
}

.event-block--ultra-compact .event-field-status {
  display: inline-block;
  max-width: 100%;
  margin-top: 1px;
  padding: 1px 3px;
  font-size: 6px;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.event-block--ultra-compact .event-techs {
  display: block;
  font-size: 8px;
  font-weight: 700;
}

.event-block--ultra-compact .event-block-text {
  padding-right: 44px;
}

.event-block--ultra-compact .event-title {
  font-size: 9px;
  line-height: 1.12;
  -webkit-line-clamp: 2;
}

.event-block--ultra-compact .crew-avatar {
  width: 13px;
  height: 13px;
}

.event-block--ultra-compact .crew-avatar-inner {
  font-size: 6px;
}

/* Job details open in .event-preview-pop on hover (week/day blocks and month pills). */

.event-preview-pop {
  position: fixed;
  z-index: 80;
  width: min(320px, calc(100vw - 16px));
  max-height: min(420px, calc(100vh - 16px));
  overflow: auto;
  display: flex;
  background: #fff;
  color: #1d1d1f;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
  pointer-events: auto;
}

.event-preview-pop.event-preview-pop--openable {
  cursor: pointer;
}

.event-preview-pop[hidden] {
  display: none !important;
}

.event-preview-accent {
  flex: 0 0 8px;
  border-radius: 12px 0 0 12px;
}

.event-preview-body {
  flex: 1 1 auto;
  min-width: 0;
  padding: 12px 14px 14px;
}

.event-preview-type {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6e6e73;
  margin-bottom: 4px;
}

.event-preview-title {
  font-size: 16px;
  font-weight: 650;
  line-height: 1.25;
  color: #1d1d1f;
  margin-bottom: 2px;
}

.event-preview-jobno {
  font-size: 13px;
  font-weight: 600;
  color: #424245;
  margin-bottom: 6px;
}

.event-preview-when {
  font-size: 13px;
  color: #6e6e73;
  margin-bottom: 8px;
}

.event-preview-line {
  font-size: 13px;
  line-height: 1.35;
  color: #1d1d1f;
  margin: 4px 0;
}

.event-preview-line strong {
  font-weight: 650;
  color: #6e6e73;
  margin-right: 4px;
}

.event-preview-line.muted {
  color: #86868b;
}

.event-preview-crew-pills {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.event-preview-crew-pills .crew-avatars {
  gap: 5px;
}

.event-preview-crew-pills .crew-avatar {
  width: 28px;
  height: 28px;
}

.event-preview-crew-pills .crew-avatar-inner {
  font-size: 11px;
  color: #1d1d1f;
}

.event-preview-crew-pills .crew-empty {
  color: #86868b;
  font-size: 13px;
}

.event-preview-open {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 13px;
  font-weight: 650;
  color: #007aff;
}

/* Measured lane-fit scaling (from JS) — more predictable than container queries alone */
.event-block--narrow[data-lane-fit="xs"] .event-title {
  font-size: 10px;
}

.event-block--narrow[data-lane-fit="xs"] .crew-avatar {
  width: 16px;
  height: 16px;
}

.event-block--narrow[data-lane-fit="xs"] .crew-avatar-inner {
  font-size: 7px;
}

.event-block--narrow[data-lane-fit="sm"] .event-title {
  font-size: 11px;
}

.event-block--narrow[data-lane-fit="sm"] .event-jobno,
.event-block--narrow[data-lane-fit="sm"] .event-techs {
  font-size: 10px;
}

.event-block--narrow[data-lane-fit="sm"] .crew-avatar {
  width: 18px;
  height: 18px;
}

.event-block--narrow[data-lane-fit="sm"] .crew-avatar-inner {
  font-size: 8px;
}

.event-block--narrow[data-lane-fit="md"] .event-title {
  font-size: 12px;
}

.event-block--narrow[data-lane-fit="md"] .event-jobno,
.event-block--narrow[data-lane-fit="md"] .event-techs,
.event-block--narrow[data-lane-fit="md"] .event-meta {
  font-size: 11px;
}

.event-block--narrow[data-lane-fit="md"] .crew-avatar {
  width: 22px;
  height: 22px;
}

.event-block--narrow[data-lane-fit="md"] .crew-avatar-inner {
  font-size: 9px;
}

.event-block--narrow[data-lane-fit="lg"] .event-title {
  font-size: 13px;
}

.event-block--narrow[data-lane-fit="lg"] .event-jobno,
.event-block--narrow[data-lane-fit="lg"] .event-techs,
.event-block--narrow[data-lane-fit="lg"] .event-meta {
  font-size: 12px;
}

.event-block--narrow[data-lane-fit="lg"] .crew-avatar {
  width: 26px;
  height: 26px;
}

.event-block--narrow[data-lane-fit="lg"] .crew-avatar-inner {
  font-size: 10px;
}

.event-block--narrow[data-lane-fit="xl"] .event-title {
  font-size: 14px;
}

.event-block--narrow[data-lane-fit="xl"] .event-jobno,
.event-block--narrow[data-lane-fit="xl"] .event-techs,
.event-block--narrow[data-lane-fit="xl"] .event-meta {
  font-size: 12px;
}

.event-block--narrow[data-lane-fit="xl"] .crew-avatar {
  width: 30px;
  height: 30px;
}

.event-block--narrow[data-lane-fit="xl"] .crew-avatar-inner {
  font-size: 11px;
}

.event-block--narrow.event-block--compact .event-title,
.event-block--narrow.event-block--ultra-compact .event-title,
.event-block--narrow.event-block--crowded.event-block--ultra-compact .event-title,
.event-block--crowded.event-block--ultra-compact .event-title {
  -webkit-line-clamp: 2;
}

.event-block--narrow.event-block--ultra-compact .event-block-main {
  padding: 1px 2px;
}

.event-resize-handle {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 9px;
  z-index: 5;
  cursor: ns-resize;
  /* Transparent hit target — no wash over pills/text */
  background: transparent;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.event-resize-handle::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.22);
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.12s ease, background 0.12s ease;
}

.event-resize-handle:hover::after,
.event-block.is-resizing .event-resize-handle::after {
  opacity: 1;
  background: rgba(255, 255, 255, 0.85);
}

.event-blocked .event-resize-handle::after {
  background: rgba(0, 0, 0, 0.28);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.calendar-scroll.is-panning {
  cursor: grabbing;
  user-select: none;
}

.calendar-scroll {
  cursor: default;
}

.event-scheduled {
  background: linear-gradient(145deg, var(--type-scheduled, #007aff), var(--type-scheduled-end, #004d9e));
}

.event-tentative {
  background: linear-gradient(145deg, var(--type-tentative, #af52de), var(--type-tentative-end, #6d3aad));
}

.event-survey {
  background: linear-gradient(145deg, var(--type-survey, #ff9500), var(--type-survey-end, #9e5c00));
}

.event-delivery {
  background: linear-gradient(145deg, var(--type-delivery, #34c759), var(--type-delivery-end, #207a37));
}

.event-need-to-schedule {
  background: linear-gradient(
    145deg,
    var(--type-need_to_schedule, #636366),
    var(--type-need_to_schedule-end, #3a3a3c)
  );
}

.event-blocked {
  background: linear-gradient(145deg, var(--type-blocked, #ffd60a), var(--type-blocked-end, #9a8200));
  color: #1d1d1f;
  border-color: rgba(0, 0, 0, 0.12);
}

.event-blocked .event-meta,
.event-blocked .event-title,
.event-blocked .event-field-status {
  color: #1d1d1f;
}

.event-blocked .event-field-status {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(0, 0, 0, 0.1);
}

.event-task {
  background: linear-gradient(145deg, var(--type-task, #8e8e93), var(--type-task-end, #57575c));
}

.month-event-pill.event-blocked {
  color: #1d1d1f;
}

/** Same-tech spacing warning (per market min gap not met) */
.event-block.event-tech-gap-violation {
  background: linear-gradient(145deg, #d32f2f, #8b0000) !important;
  border-color: rgba(255, 255, 255, 0.35);
}

.event-block.event-tech-gap-violation:not(.is-dragging):not(.is-resizing):hover {
  box-shadow: 0 4px 16px rgba(139, 0, 0, 0.35);
}

.calendar-grid.calendar-grid--month {
  grid-template-columns: repeat(7, minmax(92px, 1fr));
  min-width: 680px;
}

.month-weekday-h {
  padding: 10px 6px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  background: #fafafa;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 2;
}

.month-weekday-h:nth-child(7n) {
  border-right: none;
}

.month-day-cell {
  position: relative;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 6px 6px 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 104px;
  cursor: pointer;
}

.month-day-cell:hover {
  background: rgba(0, 122, 255, 0.05);
}

.month-day-cell.is-other-month {
  background: rgba(0, 0, 0, 0.02);
}

.month-day-cell.is-other-month .month-day-num {
  color: var(--text-tertiary);
  opacity: 0.85;
}

.month-day-cell.is-today {
  background: var(--today-column-bg, rgba(0, 122, 255, 0.07));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
}

.month-day-num {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 6px;
  flex-shrink: 0;
}

.month-day-events {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.month-event-pill {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  border-radius: 4px;
  padding: 5px 7px;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  line-height: 1.25;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  transition: filter 0.12s ease, transform 0.12s ease;
}

.month-event-pill:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.month-event-pill.event-assign-incomplete {
  position: relative;
}

.month-event-pill--warn {
  outline: 2px solid rgba(198, 40, 40, 0.95);
  outline-offset: 0;
}

.helper-text {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
}

.helper-text kbd {
  font: inherit;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
}

.calendar-grid {
  display: grid;
}

/* Week body: sticky time ruler + day tracks */
.time-ruler {
  position: sticky;
  left: 0;
  z-index: 2;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.time-ruler-label {
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  text-align: right;
  padding-right: 6px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-tertiary);
  line-height: 1;
  transform: translateY(-5px);
}

.day-track {
  position: relative;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.day-track.is-today {
  background: var(--today-column-bg, rgba(0, 122, 255, 0.07));
}

.now-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 2px solid #ff3b30;
  pointer-events: none;
  z-index: 15;
  filter: drop-shadow(0 0 4px rgba(255, 59, 48, 0.35));
}

.now-line::before {
  content: "";
  position: absolute;
  left: 0;
  top: -5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff3b30;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.92);
}

.day-track-slot-hover {
  position: absolute;
  left: 0;
  right: 0;
  height: calc(var(--grid-hour) / 2);
  background: var(--calendar-slot-hover, rgba(0, 122, 255, 0.22));
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.08s ease;
}

.day-track-slot-hover.is-visible {
  opacity: 1;
}

.day-track-drop-guide {
  position: absolute;
  left: 3px;
  right: 3px;
  border-radius: 10px;
  border: 2px solid rgba(0, 122, 255, 0.9);
  background: rgba(0, 122, 255, 0.16);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.55),
    0 0 22px rgba(0, 122, 255, 0.35);
  pointer-events: none;
  z-index: 12;
  opacity: 0;
  transition: top 0.05s ease-out, height 0.05s ease-out, opacity 0.1s ease;
}

.day-track-drop-guide.is-visible {
  opacity: 1;
}

.day-track-drop-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  margin-top: -1px;
  background: #007aff;
  box-shadow: 0 0 10px 2px rgba(0, 122, 255, 0.75);
  pointer-events: none;
  z-index: 26;
  opacity: 0;
  transition: top 0.05s ease-out, opacity 0.1s ease;
}

.day-track-drop-line.is-visible {
  opacity: 1;
}

.event-block.is-dragging {
  transition: top 0.05s ease-out;
  opacity: 0.9;
}

.event-block.is-dragging.juice-drag-target {
  box-shadow:
    0 0 0 2px #ffffff,
    0 0 0 5px rgba(0, 122, 255, 0.95),
    0 14px 32px rgba(0, 0, 0, 0.28);
  opacity: 0.95;
  z-index: 22;
}

@keyframes juice-drop-thud {
  0% {
    transform: scale(1.06);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.55), 0 14px 32px rgba(0, 0, 0, 0.24);
  }
  55% {
    transform: scale(0.98);
  }
  100% {
    transform: scale(1);
  }
}

.event-block.juice-drop-snap {
  animation: juice-drop-thud 0.55s cubic-bezier(0.22, 1.2, 0.36, 1);
  z-index: 24;
}

@keyframes juice-btn-on-way {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(0.88);
  }
  65% {
    transform: scale(1.07);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes juice-btn-in-progress {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(0.92);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes juice-btn-complete {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(0.9);
  }
  70% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

.tech-field-comms-actions .btn.juice-btn-on-way,
.today-card-status-actions .btn.juice-btn-on-way {
  animation: juice-btn-on-way 0.45s cubic-bezier(0.22, 1.2, 0.36, 1);
}

.tech-field-comms-actions .btn.juice-btn-in-progress,
.today-card-status-actions .btn.juice-btn-in-progress {
  animation: juice-btn-in-progress 0.4s ease-out;
}

.tech-field-comms-actions .btn.juice-btn-complete,
.today-card-status-actions .btn.juice-btn-complete {
  animation: juice-btn-complete 0.5s cubic-bezier(0.22, 1.2, 0.36, 1);
}

@keyframes juice-status-slide {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.82);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes juice-status-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
    transform: scale(0.9);
  }
  55% {
    box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
    transform: scale(1.12);
  }
  100% {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14);
    transform: scale(1);
  }
}

@keyframes juice-status-complete-chip {
  0% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  55% {
    transform: scale(1.14);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.event-field-status.juice-status-slide {
  animation: juice-status-slide 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.event-field-status.juice-status-glow {
  animation: juice-status-glow 0.8s ease-out;
}

.event-field-status.juice-status-complete {
  animation: juice-status-complete-chip 0.7s cubic-bezier(0.22, 1.2, 0.36, 1);
}

@keyframes juice-block-on-way {
  0% {
    filter: brightness(1);
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.55);
  }
  40% {
    filter: brightness(1.12);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.4);
  }
  100% {
    filter: brightness(1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  }
}

@keyframes juice-block-in-progress {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.55);
  }
  45% {
    box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.35);
  }
  100% {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  }
}

@keyframes juice-complete-settle {
  0% {
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.55);
  }
  40% {
    box-shadow: 0 0 0 6px rgba(22, 163, 74, 0.35);
  }
  100% {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  }
}

.event-block.juice-status-on-way,
.today-card.juice-status-on-way,
.event-block.juice-status-in-progress,
.today-card.juice-status-in-progress,
.event-block.juice-complete-settle,
.today-card.juice-complete-settle {
  position: relative;
  z-index: 22;
  overflow: visible;
}

.event-block.juice-status-on-way,
.today-card.juice-status-on-way {
  animation: juice-block-on-way 0.85s ease-out;
}

.event-block.juice-status-in-progress,
.today-card.juice-status-in-progress {
  animation: juice-block-in-progress 0.85s ease-out;
}

.event-block.juice-complete-settle,
.today-card.juice-complete-settle {
  animation: juice-complete-settle 1s ease-out;
}

.event-block.juice-status-on-way::before,
.today-card.juice-status-on-way::before,
.event-block.juice-status-in-progress::before,
.today-card.juice-status-in-progress::before,
.event-block.juice-complete-settle::before,
.today-card.juice-complete-settle::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 6;
  animation: juice-wash-fade 0.9s ease-out forwards;
}

.event-block.juice-status-on-way::before,
.today-card.juice-status-on-way::before {
  background: rgba(37, 99, 235, 0.36);
}

.event-block.juice-status-in-progress::before,
.today-card.juice-status-in-progress::before {
  background: rgba(37, 99, 235, 0.36);
}

.event-block.juice-complete-settle::before,
.today-card.juice-complete-settle::before {
  background: rgba(22, 163, 74, 0.42);
  animation-duration: 1.05s;
}

@keyframes juice-wash-fade {
  0% {
    opacity: 0;
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .day-track-drop-guide,
  .day-track-drop-line,
  .event-block.is-dragging {
    transition: none;
  }

  .event-missed-punch {
    animation: none;
    opacity: 1;
  }

  .event-block.event-assign-incomplete::after,
  .month-event-pill.event-assign-incomplete::after,
  .today-card.event-assign-incomplete::after {
    animation: none;
  }

  .event-block.juice-drop-snap,
  .tech-field-comms-actions .btn.juice-btn-on-way,
  .tech-field-comms-actions .btn.juice-btn-in-progress,
  .tech-field-comms-actions .btn.juice-btn-complete,
  .today-card-status-actions .btn.juice-btn-on-way,
  .today-card-status-actions .btn.juice-btn-in-progress,
  .today-card-status-actions .btn.juice-btn-complete,
  .event-field-status.juice-status-slide,
  .event-field-status.juice-status-glow,
  .event-field-status.juice-status-complete,
  .event-block.juice-status-on-way,
  .today-card.juice-status-on-way,
  .event-block.juice-status-in-progress,
  .today-card.juice-status-in-progress,
  .event-block.juice-complete-settle,
  .today-card.juice-complete-settle,
  .event-block.juice-status-on-way::before,
  .today-card.juice-status-on-way::before,
  .event-block.juice-status-in-progress::before,
  .today-card.juice-status-in-progress::before,
  .event-block.juice-complete-settle::before,
  .today-card.juice-complete-settle::before {
    animation: none;
  }
}

.hour-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 1px solid var(--border);
  pointer-events: none;
}

.acting-as {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.acting-as[hidden] {
  display: none !important;
}

.acting-as select {
  font: inherit;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  min-width: 160px;
}

.my-jobs-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.my-jobs-filter input {
  margin: 0;
  cursor: pointer;
}

/* Modal */
#modal-root,
#viewer-root {
  position: relative;
  z-index: 100;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 101;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.modal-backdrop.is-open {
  opacity: 1;
}

.modal-sheet {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, calc(-50% + 12px)) scale(0.985);
  width: min(640px, calc(100vw - 32px));
  max-height: min(88vh, 900px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  z-index: 102;
  overflow: hidden;
  opacity: 0;
  transition:
    opacity 0.24s ease,
    transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-sheet.is-open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .modal-backdrop,
  .modal-sheet {
    transition: none;
  }

  .modal-backdrop {
    opacity: 1;
  }

  .modal-sheet {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.modal-sheet-wide {
  width: min(960px, calc(100vw - 32px));
}

@media (min-width: 1100px) {
  .modal-sheet-wide {
    width: min(1120px, calc(100vw - 48px));
  }
}

@media (min-width: 1600px) {
  .modal-sheet-wide {
    width: min(1280px, calc(100vw - 64px));
  }
}

.unsaved-prompt-backdrop {
  z-index: 103;
}

.unsaved-prompt-sheet {
  z-index: 104;
  width: min(520px, calc(100vw - 32px));
  max-height: none;
}

.unsaved-prompt-body {
  padding: 24px 20px 20px;
  text-align: center;
}

.unsaved-prompt-msg {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-primary);
}

.unsaved-prompt-foot {
  flex-wrap: wrap;
  gap: 8px;
}

.unsaved-prompt-foot .btn {
  flex: 1 1 auto;
  min-width: 140px;
}

.series-scope-backdrop {
  z-index: 105;
}

.series-scope-sheet {
  z-index: 106;
}

.series-scope-blurb {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.45;
}

.series-scope-foot {
  flex-direction: column;
  align-items: stretch;
}

.series-scope-foot .btn {
  width: 100%;
}

.series-info-banner {
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-elevated));
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
}

.series-info-banner p {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
}

.series-detached-label {
  color: var(--text-secondary);
}

.schedule-block-repeat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
}

.schedule-block-repeat-row #duration-display {
  margin: 0;
  min-width: 7.5rem;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  text-overflow: ellipsis;
}

#event-form[data-active-tab="schedule"] [name="durationHours"] {
  width: 100%;
  min-width: 0;
}

#event-form[data-active-tab="schedule"] .schedule-block-field {
  min-width: 0;
}

.schedule-block-field .recurrence-enable {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 13px;
}

.recurrence-options-panel {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.02);
}

.recurrence-options-panel .recurrence-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  min-width: 0;
}

.recurrence-preview {
  margin: 0;
  font-size: 12px;
  grid-column: 1 / -1;
  word-break: break-word;
}

@media (max-width: 560px) {
  .recurrence-options-panel .recurrence-options {
    grid-template-columns: 1fr;
  }
}

.create-job-prompt-backdrop {
  z-index: 103;
}

.create-job-prompt-sheet {
  z-index: 104;
  width: min(420px, calc(100vw - 32px));
  max-height: none;
}

.create-job-prompt-body {
  padding: 24px 20px 8px;
  text-align: center;
}

.create-job-prompt-msg {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.create-job-prompt-meta {
  margin: 8px 0 0;
  font-size: 13px;
}

.create-job-prompt-foot {
  gap: 8px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.event-modal-heading-wrap {
  min-width: 0;
}

.event-modal-summary {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-body {
  padding: 16px 18px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-width: 0;
}

.modal-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: #fafafa;
}

.modal-foot-spacer {
  flex: 1;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  min-width: 0;
}

.form-grid fieldset {
  min-width: 0;
}

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

/* Author display rules beat the UA [hidden] stylesheet — force hide. */
.form-grid [hidden],
.modal-sheet [hidden] {
  display: none !important;
}

/* Delivery short form — belt-and-suspenders beyond [hidden]. */
.modal-sheet.event-form--delivery #job-amount-field,
.modal-sheet.event-form--delivery #contact2-details,
.modal-sheet.event-form--delivery #contact1-phone2-details,
.modal-sheet.event-form--delivery #contact1-paste-wrap,
.modal-sheet.event-form--delivery .field-c1email,
.modal-sheet.event-form--delivery .job-type-fieldset,
.modal-sheet.event-form--delivery .assets-fieldset,
.modal-sheet.event-form--delivery .drive-block,
.modal-sheet.event-form--delivery .event-form-reminders {
  display: none !important;
}

.field > span:first-child,
.field legend {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.field .req-star {
  margin-left: 2px;
  color: #c62828;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  font: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
}

.field textarea {
  resize: vertical;
  min-height: 88px;
}

.amount-field select {
  max-width: 7.5rem;
}

.amount-field--disabled > span:first-child {
  color: var(--text-tertiary);
}

.amount-field--disabled select:disabled {
  background: #f5f5f7;
  color: var(--text-tertiary);
  cursor: not-allowed;
}

.field-span-2 {
  grid-column: span 2;
}

@media (min-width: 900px) {
  .modal-sheet .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .modal-sheet .field-span-2,
  .modal-sheet-wide .field-span-2 {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .field-span-2 {
    grid-column: span 1;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

.muted {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.distance-readout {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-primary);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #f5f5f7;
  border: 1px solid var(--border);
}

.address-readout {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
}

.address-maps-link {
  color: var(--accent, #0071e3);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}

.address-field .address-maps-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.address-field .address-maps-link:hover {
  text-decoration: underline;
}

.distance-readout .address-maps-link {
  font-weight: 500;
}

.check-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 14px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-primary);
}

.reminder-checks,
.job-type-checks,
.asset-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  margin-top: 6px;
}

.job-type-other,
.asset-other {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.job-type-other-check,
.asset-other-check {
  margin-bottom: 0;
}

.job-type-other-input,
.asset-other-input {
  flex: 1 1 180px;
  min-width: 160px;
  max-width: 420px;
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13px;
  background: var(--surface);
  color: var(--text-primary);
}

.job-type-other-input:focus,
.asset-other-input:focus {
  outline: none;
  box-shadow: var(--focus-ring);
  border-color: var(--accent);
}

.assign-checks {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}

.assign-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0;
}

.assign-row--unavailable {
  opacity: 0.48;
  color: var(--text-tertiary);
}

.assign-row--unavailable .assign-row-main {
  cursor: not-allowed;
}

.assign-unavail-tag {
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-left: 4px;
}

.assign-row-main {
  flex: 1;
  min-width: 0;
}

.assign-lead-pick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.assign-lead-pick input {
  flex-shrink: 0;
}

.assign-lead-pick input:disabled {
  cursor: not-allowed;
}

.assign-row:has(.assign-lead-pick input:disabled) .assign-lead-pick {
  opacity: 0.45;
  cursor: not-allowed;
}

.assign-slot-counter {
  margin: 6px 0 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.assign-slot-counter.assign-slot-counter--low {
  color: #b45309;
}

.job-type-fieldset,
.assets-fieldset,
.assign-fieldset,
.forms-fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 0;
}

.audit-details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0;
  margin: 0;
  align-self: start;
}

.audit-summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 14px;
  list-style: none;
  color: var(--text-primary);
  user-select: none;
}

.audit-summary::-webkit-details-marker {
  display: none;
}

.audit-summary::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid var(--text-tertiary);
  margin-right: 8px;
  transform: translateY(-1px);
  transition: transform 0.15s ease;
}

.audit-details[open] .audit-summary::before {
  transform: rotate(90deg) translateY(-1px);
}

.audit-summary:hover {
  background: rgba(0, 0, 0, 0.03);
}

.contact2-details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0;
  margin: 0;
  align-self: start;
}

.contact-extra-details,
.reminder-details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0;
  margin: 0;
  align-self: start;
}

.contact2-summary,
.contact-extra-summary,
.reminder-summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 14px;
  list-style: none;
  color: var(--text-primary);
  user-select: none;
}

.contact2-summary::-webkit-details-marker,
.contact-extra-summary::-webkit-details-marker,
.reminder-summary::-webkit-details-marker {
  display: none;
}

.contact2-summary::before,
.contact-extra-summary::before,
.reminder-summary::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid var(--text-tertiary);
  margin-right: 8px;
  transform: translateY(-1px);
  transition: transform 0.15s ease;
}

.contact2-details[open] .contact2-summary::before,
.contact-extra-details[open] .contact-extra-summary::before,
.reminder-details[open] .reminder-summary::before {
  transform: rotate(90deg) translateY(-1px);
}

.contact2-summary:hover,
.contact-extra-summary:hover,
.reminder-summary:hover {
  background: rgba(0, 0, 0, 0.03);
}

.contact2-fields-inner,
.contact-extra-fields,
.reminder-details-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  padding: 0 14px 14px;
}

.reminder-details-body {
  grid-template-columns: 1fr;
}

.contact-paste {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-paste-blurb {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}

.contact-paste-input {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  background: var(--surface);
  color: var(--text-primary);
}

.contact-paste-input:focus {
  outline: none;
  box-shadow: var(--focus-ring);
  border-color: var(--accent);
}

.contact-paste-actions {
  display: flex;
  justify-content: flex-start;
}

@media (max-width: 560px) {
  .contact2-fields-inner,
  .contact-extra-fields {
    grid-template-columns: 1fr;
  }
}

.audit-trail {
  margin-top: 0;
  padding: 0 14px 12px;
  max-height: 220px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.audit-line {
  margin: 0 0 10px;
}

.audit-line:last-child {
  margin-bottom: 0;
}

.audit-line strong {
  color: var(--text-primary);
  font-weight: 600;
}

.audit-empty {
  margin: 0;
}

.notification-center-sheet {
  width: min(700px, calc(100vw - 24px));
  max-height: min(820px, calc(100dvh - 24px));
}

.notification-center-subtitle,
.notification-center-sheet .modal-head h2,
.activity-log-sheet .modal-head h2,
.activity-log-sheet .modal-head p {
  margin: 0;
}

.notification-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 16px 0;
  border-top: 1px solid var(--border);
}

.notification-tab {
  flex: 1 1 0;
}

.notification-tab.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(0, 122, 255, 0.3);
}

.notification-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
}

.notification-list {
  display: grid;
  gap: 10px;
  padding: 14px 16px 18px;
  overflow-y: auto;
}

.notification-item {
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.notification-item.is-unread {
  border-left: 4px solid #d92d20;
  background: #fffafa;
}

.notification-item.is-complete {
  opacity: 0.7;
}

.notification-item.is-complete .notification-title {
  text-decoration: line-through;
}

.notification-item.is-archived {
  opacity: 0.58;
}

.notification-item-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.notification-check {
  display: flex;
  align-items: center;
  padding-top: 2px;
}

.notification-check input {
  width: 18px;
  height: 18px;
}

.notification-unread-dot {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: #d92d20;
  flex: 0 0 auto;
}

.notification-item:not(.is-unread) .notification-unread-dot {
  background: var(--border-strong);
}

.notification-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.notification-title {
  font-size: 14px;
  font-weight: 650;
}

.notification-copy p {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.4;
}

.notification-copy .notification-meta {
  color: var(--text-secondary);
  font-size: 11px;
}

.notification-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-left: 28px;
}

.notification-actions .btn {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}

.notification-empty {
  padding: 40px 18px;
  text-align: center;
}

.notification-empty p {
  margin: 6px 0 0;
}

.activity-log-sheet {
  max-height: min(900px, calc(100dvh - 24px));
}

.activity-log-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.activity-log-filters label {
  display: grid;
  gap: 4px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
}

.activity-search-label {
  grid-column: span 3;
}

.activity-log-filters .activity-apply {
  align-self: end;
}

.activity-log-list {
  padding: 0;
  overflow-y: auto;
}

.activity-log-item {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.activity-log-when,
.activity-log-location {
  color: var(--text-secondary);
  font-size: 11px;
}

.activity-log-job {
  margin-top: 4px;
  font-weight: 600;
}

@media (max-width: 700px) {
  .notification-center-sheet,
  .activity-log-sheet {
    width: calc(100vw - 12px);
    max-height: calc(100dvh - 12px);
  }

  .notification-actions {
    padding-left: 0;
  }

  .activity-log-filters {
    grid-template-columns: 1fr 1fr;
  }

  .activity-search-label {
    grid-column: 1 / -1;
  }

  .activity-log-item {
    grid-template-columns: 1fr auto;
    gap: 6px 10px;
  }

  .activity-log-when {
    grid-column: 1 / -1;
  }
}

.form-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.form-link-card {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: #fafafa;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
  line-height: 1.3;
}

.form-link-card:hover {
  background: var(--accent-soft);
  border-color: rgba(0, 0, 0, 0.08);
}

.form-links-note {
  margin-top: 10px;
  margin-bottom: 0;
}

.forms-fieldset code,
.drive-block code {
  font-size: 11px;
  word-break: break-word;
}

.drive-block .drive-folder-name-preview,
.drive-block code.drive-folder-name-preview {
  padding: 3px 8px;
  background: #f5f5f7;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.upload-field input[type="file"] {
  font-size: 13px;
}

.list-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.file-chips {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.file-chips li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.file-chip {
  font: inherit;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  cursor: pointer;
}

.link-btn {
  font: inherit;
  font-size: 12px;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
}

.event-form-simple[hidden],
.event-form-install[hidden],
.event-form-install-core[hidden],
.event-form-extended[hidden],
.event-form-install-tail[hidden] {
  display: none !important;
}

/* Let install/simple field groups participate in the parent .form-grid */
.event-form-simple,
.event-form-install,
.event-form-install-core,
.event-form-extended,
.event-form-install-tail {
  display: contents;
}

.event-form-description {
  grid-column: 1 / -1;
}

.event-form-tabs {
  position: sticky;
  top: -16px;
  z-index: 8;
  display: flex;
  gap: 4px;
  margin: -4px -2px 2px;
  padding: 8px 2px;
  overflow-x: auto;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}

.event-form-tabs::-webkit-scrollbar {
  display: none;
}

.event-form-tab {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.event-form-tab:hover {
  color: var(--text-primary);
  background: rgba(120, 120, 128, 0.08);
}

.event-form-tab.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(0, 122, 255, 0.22);
}

#event-form[data-active-tab="schedule"] .event-tab-item:not(.event-tab-schedule),
#event-form[data-active-tab="site"] .event-tab-item:not(.event-tab-site),
#event-form[data-active-tab="details"] .event-tab-item:not(.event-tab-details),
#event-form[data-active-tab="crew"] .event-tab-item:not(.event-tab-crew),
#event-form[data-active-tab="files"] .event-tab-item:not(.event-tab-files),
#event-form[data-active-tab="activity"] .event-tab-item:not(.event-tab-activity) {
  display: none !important;
}

#event-form[data-active-tab="schedule"] {
  gap: 10px 12px;
}

#event-form[data-active-tab="schedule"] .field {
  gap: 4px;
}

#event-form[data-active-tab="schedule"] .field input,
#event-form[data-active-tab="schedule"] .field select {
  padding: 8px 10px;
  font-size: 13px;
}

#event-form[data-active-tab="schedule"] .field-hint {
  display: none;
}

#event-form[data-active-tab="schedule"] .amount-field select {
  max-width: none;
  width: 100%;
}

.event-save-status {
  color: var(--text-secondary);
  font-size: 11px;
  white-space: nowrap;
}

.event-save-status.is-dirty {
  color: #9a6700;
  font-weight: 600;
}

.modal-foot {
  position: relative;
  z-index: 10;
  box-shadow: 0 -8px 18px rgba(0, 0, 0, 0.035);
}

@media (max-width: 560px) {
  .event-form-tabs {
    top: -16px;
    margin-right: -10px;
    margin-left: -10px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .event-save-status {
    order: -1;
    flex: 1 1 100%;
  }

  .modal-foot {
    flex-wrap: wrap;
  }
}

.notes-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.notes-editor-head #event-description-label {
  margin: 0;
}

.notes-popout-btn {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 4px 10px;
  font-size: 12px;
}

.notes-editor {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: visible;
}

.notes-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.notes-toolbar-sep {
  width: 1px;
  height: 18px;
  background: var(--border-strong);
  margin: 0 4px;
}

.notes-tool-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 6px;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  line-height: 1;
}

.notes-tool-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: var(--border);
}

.notes-tool-btn:active {
  background: rgba(0, 0, 0, 0.08);
}

.notes-hl {
  width: 28px;
  min-width: 28px;
  padding: 0;
  border: 1px solid var(--border-strong);
}

.notes-hl-yellow {
  background: #fef08a;
}

.notes-hl-green {
  background: #bbf7d0;
}

.notes-hl-orange {
  background: #fed7aa;
}

.notes-editor-body {
  min-height: 96px;
  height: 160px;
  max-height: min(70vh, 720px);
  resize: vertical;
  overflow-y: auto;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-primary);
  outline: none;
  box-sizing: border-box;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.notes-editor-body.is-readonly {
  background: #f5f5f7;
  color: var(--text-primary);
  resize: vertical;
}

.notes-editor-body:empty:before {
  content: "Add notes for the technicians…";
  color: var(--text-tertiary);
}

.notes-popout-backdrop {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.45);
  box-sizing: border-box;
}

.notes-popout-sheet {
  width: min(920px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  overflow: hidden;
}

.notes-popout-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.notes-popout-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
}

.notes-editor--popout {
  flex: 1 1 auto;
  margin: 12px 16px 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.notes-editor--popout .notes-editor-body {
  flex: 1 1 auto;
  height: min(62vh, 560px);
  min-height: 280px;
  max-height: none;
  resize: vertical;
}

.notes-popout-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px 16px;
}

.job-summary-notes-body,
.installer-notes-content {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.45;
  white-space: normal;
}

.job-summary-notes-body p,
.installer-notes-content p {
  margin: 0 0 0.5em;
}

.job-summary-notes-body p:last-child,
.installer-notes-content p:last-child {
  margin-bottom: 0;
}

.tech-quick-open {
  margin-bottom: 14px;
}

.tech-file-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tech-file-links .btn {
  flex: 1 1 160px;
}

.attachment-bucket + .attachment-bucket {
  margin-top: 4px;
}

.attachment-bucket-blurb {
  margin: 4px 0 10px;
  font-size: 13px;
  line-height: 1.4;
}

.attachment-upload {
  margin-bottom: 10px;
}

.attachment-gallery-empty {
  margin: 0;
  font-size: 13px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: #f5f5f7;
  border: 1px dashed var(--border-strong);
}

.attachment-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.attachment-gallery-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.attachment-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #f5f5f7;
  cursor: pointer;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.attachment-thumb:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.attachment-thumb:focus-visible {
  outline: 2px solid var(--accent, #0071e3);
  outline-offset: 2px;
}

.attachment-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.attachment-thumb-badge {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.attachment-gallery-caption {
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-secondary);
  word-break: break-word;
}

.attachment-remove {
  align-self: flex-start;
}

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

  .tech-file-links .btn {
    flex: 1 1 100%;
  }
}

.field-status-banner {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  font-size: 14px;
}

.crew-ts-editor {
  margin-bottom: 16px;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.02);
}

.crew-ts-editor--focus {
  border-color: #ff3b30;
  box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.22);
  background: rgba(255, 59, 48, 0.06);
}

.crew-ts-editor-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
}

.crew-ts-editor-blurb {
  margin: 0 0 12px;
  font-size: 13px;
}

.crew-ts-editor-fields {
  display: grid;
  gap: 10px;
}

@media (min-width: 560px) {
  .crew-ts-editor-fields {
    grid-template-columns: 1fr 1fr;
  }
}

.crew-ts-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.crew-ts-label {
  font-weight: 600;
}

.crew-ts-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface, #fff);
  color: inherit;
  font: inherit;
}

.crew-ts-preview {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.4;
}

.crew-ts-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tech-field-comms {
  margin-bottom: 16px;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.02);
}

.tech-field-comms-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
}

.tech-field-comms-blurb {
  margin: 0 0 12px;
  font-size: 13px;
}

.tech-field-comms-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-status-stacked {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.15;
  min-height: 44px;
  padding: 6px 14px;
}

.btn-status-main {
  font-size: inherit;
}

.btn-status-sub {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.72;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tech-field-comms-times {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
}

.tech-field-comms-times ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.tech-field-comms-times li {
  margin: 2px 0;
}

.tech-field-comms-actions .btn.is-phase-active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(0, 113, 227, 0.12);
}

.tech-field-comms-actions .btn:focus {
  outline: none;
}

.tech-field-comms-actions .btn:focus-visible {
  box-shadow: var(--focus-ring), var(--shadow-sm);
}

.tech-field-comms-actions .btn:active {
  transform: scale(0.98);
}

.event-field-status,
.field-status-badge {
  display: inline-block;
  align-self: flex-start;
  max-width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.field-status-badge {
  margin-top: 0;
  flex-shrink: 1;
  min-width: 0;
}

.event-field-status--in-transit,
.field-status-badge.event-field-status--in-transit {
  color: #1e3a8a;
  background: #dbeafe;
  border-color: #3b82f6;
}

.event-field-status--in-progress,
.field-status-badge.event-field-status--in-progress {
  color: #1e3a8a;
  background: #bfdbfe;
  border-color: #2563eb;
}

.event-field-status--complete,
.field-status-badge.event-field-status--complete {
  color: #14532d;
  background: #dcfce7;
  border-color: #22c55e;
}

.today-card-head-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.today-card-head-top .today-card-customer {
  flex: 1 1 auto;
  min-width: 0;
}

.today-card-status-badge-wrap {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 46%;
  padding-top: 2px;
}

.crew-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.eta-pick-backdrop,
.call-pick-backdrop {
  z-index: 110;
}

.eta-pick-sheet,
.call-pick-sheet {
  z-index: 111;
  max-width: 420px;
}

.eta-pick-lead,
.call-pick-lead {
  margin: 0 0 12px;
}

.eta-pick-grid,
.call-pick-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.eta-pick-btn,
.call-pick-btn {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  white-space: normal;
  line-height: 1.35;
  min-height: 44px;
}

.eta-pick-btn:active,
.call-pick-btn:active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.eta-pick-btn:focus,
.call-pick-btn:focus {
  outline: none;
  box-shadow: var(--focus-ring), var(--shadow-sm);
}

.eta-pick-btn:focus-visible,
.call-pick-btn:focus-visible {
  box-shadow: var(--focus-ring), var(--shadow-sm);
}

.context-menu {
  position: fixed;
  display: none;
  flex-direction: column;
  min-width: 220px;
  max-width: 280px;
  padding: 6px;
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  z-index: 200;
}

.context-menu--assign {
  padding: 0;
  min-width: 240px;
}

.context-menu-head {
  font-size: 13px;
  font-weight: 600;
  padding: 10px 12px 6px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}

.context-menu-meta {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.02);
  border-bottom: 1px solid var(--border);
}

.context-menu-checks {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  max-height: 280px;
  overflow-y: auto;
}

.context-menu-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  color: var(--text-primary);
}

.context-menu-check--unavailable {
  opacity: 0.48;
  color: var(--text-tertiary);
  cursor: not-allowed;
}

.context-menu-check--unavailable:hover {
  background: transparent;
}

.context-menu-check > span {
  flex: 1;
  min-width: 0;
}

.context-menu-lead-btn {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-tertiary);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}

.context-menu-lead-btn:hover:not(:disabled) {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(0, 0, 0, 0.08);
}

.context-menu-lead-btn.is-active {
  background: #fff8dc;
  color: #b45309;
  border-color: rgba(180, 83, 9, 0.35);
}

.context-menu-lead-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.context-menu-check:hover {
  background: var(--accent-soft);
}

.context-menu-check input {
  flex-shrink: 0;
}

.context-menu-empty {
  margin: 8px 10px;
  font-size: 12px;
}

.context-menu.is-open {
  display: flex;
}

.context-menu button {
  font: inherit;
  font-size: 13px;
  text-align: left;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  color: var(--text-primary);
}

.context-menu button:hover {
  background: var(--accent-soft);
}

.viewer {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: #000;
  display: flex;
  flex-direction: column;
}

.viewer-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(30, 30, 30, 0.92);
  color: #f5f5f7;
}

.viewer-head .viewer-title {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-count {
  font-size: 12px;
  opacity: 0.85;
}

.viewer-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  touch-action: pan-y;
}

.viewer-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.viewer-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}

.viewer-foot {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 12px;
  background: rgba(30, 30, 30, 0.92);
}

#toast-bar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 400;
  max-width: min(480px, calc(100vw - 32px));
  pointer-events: none;
}

#toast-bar.is-visible {
  pointer-events: auto;
}

.toast {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  padding: 14px 16px;
}

.toast p {
  margin: 0 0 8px;
  font-size: 13px;
}

.toast p:last-of-type {
  margin-bottom: 12px;
}

.toast-simple {
  padding: 12px 16px;
}

.toast-simple p {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.toast-success {
  border-left: 4px solid var(--accent);
}

.toast-error {
  border-left: 4px solid #d14343;
}

.toast-reminders .toast-reminder-row {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.toast-reminders .toast-reminder-row:first-of-type {
  margin-top: 8px;
  padding-top: 0;
  border-top: none;
}

.toast-reminder-preview {
  font-size: 12px;
  margin-bottom: 8px !important;
}

.reminder-blurb {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.45;
}

.settings-collapsible {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 16px;
  min-width: 0;
  max-width: 100%;
}

.settings-collapsible-toggle {
  list-style: none;
  cursor: pointer;
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 600;
  user-select: none;
}

.settings-collapsible-toggle::-webkit-details-marker {
  display: none;
}

.settings-collapsible-toggle::before {
  content: "▸";
  display: inline-block;
  margin-right: 6px;
  transition: transform 0.15s ease;
}

.settings-collapsible[open] .settings-collapsible-toggle::before {
  transform: rotate(90deg);
}

.settings-collapsible-body {
  padding: 0 12px 12px;
  border-top: 1px solid var(--border);
  min-width: 0;
  max-width: 100%;
}

.settings-section-title {
  margin: 20px 0 10px;
  font-size: 15px;
  font-weight: 600;
}

.settings-section-title:first-child {
  margin-top: 0;
}

.settings-catalog-blurb {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.45;
}

.users-table-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px 14px;
  margin: 0 0 10px;
}

.users-sort-field,
.users-filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  min-width: 0;
}

.users-sort-field .field-label,
.users-filter-field .field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.users-sort-field select,
.users-filter-field input {
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13px;
  background: var(--surface);
  color: var(--text-primary);
}

.users-filter-field {
  flex: 1 1 180px;
}

.users-filter-field input {
  width: 100%;
  box-sizing: border-box;
}

.catalog-editor {
  margin-bottom: 8px;
}

.catalog-editor-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

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

.catalog-label-input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-primary);
}

.catalog-editor-add {
  display: flex;
  gap: 8px;
  align-items: center;
}

.catalog-editor-add input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.catalog-del {
  flex-shrink: 0;
  font-size: 12px;
  padding: 6px 10px;
}

.color-loc-block {
  margin-bottom: 16px;
}

.color-loc-block h4 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 13px;
}

.color-row-gradient {
  margin-left: 10px;
  padding: 4px 0 4px 10px;
  border-left: 2px solid var(--border);
  margin-bottom: 10px;
}

.color-override-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
}

.color-override-check input {
  margin: 0;
}

.color-row-gradient .grad-end-picker:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  background: #fafafa;
  font-weight: 600;
}

/* Users list: stacked rows so Send setup / Remove stay visible (no sideways scroll). */
.users-list-wrap {
  max-height: min(480px, 55vh);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.users-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.users-list-empty {
  margin: 0;
  padding: 14px 12px;
}

.user-row {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}

.user-row:last-child {
  border-bottom: none;
}

.user-row-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.user-row-identity {
  flex: 1 1 auto;
  min-width: 0;
}

.user-row-identity .user-name-inp {
  width: 100%;
  max-width: 320px;
  font: inherit;
  font-weight: 600;
  padding: 6px 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.user-row-name {
  font-weight: 600;
  font-size: 14px;
}

.user-row-email {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  word-break: break-word;
}

.user-row .user-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex: 0 0 auto;
}

.user-row .user-actions .link-btn {
  white-space: nowrap;
  margin: 0;
  padding: 2px 0;
  font-size: 12px;
}

.user-row-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 10px;
  margin-bottom: 10px;
}

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

.user-field .field-label,
.user-row-locs > .field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.user-field select {
  width: 100%;
  font: inherit;
  font-size: 13px;
  padding: 6px 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.user-field-static {
  font-size: 13px;
  padding: 6px 0;
}

.user-row-locs {
  max-width: none;
}

.user-locs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 2px;
  margin-top: 4px;
}

@media (max-width: 640px) {
  .user-row-fields {
    grid-template-columns: 1fr;
  }

  .user-row-head {
    flex-wrap: wrap;
  }

  .user-row .user-actions {
    align-items: flex-start;
    width: 100%;
  }
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 16px;
}

.inline-form h4 {
  width: 100%;
  margin: 0 0 4px;
  font-size: 13px;
}

.inline-form input,
.inline-form select {
  font: inherit;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
}

.mini-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 8px;
  font-size: 12px;
}

.loc-cell {
  max-width: 220px;
}

/* —— Role-based Today view + job summary —— */

.brand {
  position: relative;
}

.sync-status-chip {
  display: inline-block;
  margin-left: 10px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.05);
  border-radius: 999px;
  vertical-align: middle;
  transition: opacity 0.35s ease;
}

.sync-status-chip--error {
  color: #fff;
  background: var(--danger, #ff3b30);
}

body[data-app-view="list"] .calendar-viewport,
body[data-app-view="list"] .legend-collapsible,
body[data-app-view="list"] #zoom-switch {
  display: none !important;
}

body[data-app-view="list"] .today-viewport {
  display: flex !important;
}

body[data-app-view="calendar"] .today-viewport,
body[data-app-view="calendar"] .pm-dashboard-viewport {
  display: none !important;
}

body[data-app-view="dashboard"] .calendar-viewport,
body[data-app-view="dashboard"] .today-viewport,
body[data-app-view="dashboard"] .legend-collapsible,
body[data-app-view="dashboard"] #zoom-switch {
  display: none !important;
}

body[data-app-view="dashboard"] .pm-dashboard-viewport {
  display: flex !important;
}

body[data-app-view="list"] .pm-dashboard-viewport {
  display: none !important;
}

.pm-dashboard-viewport {
  display: none;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 12px 24px;
  background:
    radial-gradient(ellipse 80% 50% at 10% 0%, rgba(0, 122, 255, 0.06), transparent 55%),
    radial-gradient(ellipse 70% 45% at 90% 10%, rgba(175, 82, 222, 0.05), transparent 50%),
    var(--bg, #f5f5f7);
}

.pm-dashboard {
  width: min(1120px, 100%);
  margin: 0 auto;
}

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

@media (max-width: 900px) {
  .pm-dash-grid {
    grid-template-columns: 1fr;
  }
}

.pm-dash-section {
  display: flex;
  flex-direction: column;
  min-height: 220px;
  max-height: min(52vh, 560px);
  border: 1px solid var(--border, #d2d2d7);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  overflow: hidden;
}

.pm-dash-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border, #e5e5ea);
}

.pm-dash-section-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.pm-dash-section-hint {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.35;
}

.pm-dash-section-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 8px;
}

.pm-dash-empty {
  margin: 12px 8px;
  font-size: 13px;
}

.pm-dash-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px 6px 10px;
  margin-bottom: 6px;
  border-radius: 8px;
  color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.pm-dash-card:last-child {
  margin-bottom: 0;
}

.pm-dash-card-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.pm-dash-card-meta {
  margin-top: 1px;
  font-size: 11px;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.88) !important;
}

.pm-dash-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.pm-dash-action {
  font-size: 11px;
  padding: 3px 7px;
  min-height: 0;
  background: rgba(255, 255, 255, 0.92);
  color: #1d1d1f;
  border-color: rgba(0, 0, 0, 0.12);
}

.pm-dash-action.btn-primary {
  background: #1d1d1f;
  color: #fff;
  border-color: #1d1d1f;
}

input.is-need-schedule-date,
.event-form--need-to-schedule input[name="date"] {
  background: #ececec !important;
  color: #8e8e93 !important;
  cursor: not-allowed;
}

body[data-role="technician"] .legend-collapsible {
  display: none;
}

body[data-role="technician"] .job-search {
  display: none;
}

.today-viewport {
  display: none;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 4px 16px;
}

.today-header {
  padding: 4px 4px 0;
}

.today-title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.today-subtitle {
  margin: 6px 0 0;
  font-size: 15px;
}

.list-day-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.list-day-label {
  flex: 1 1 auto;
  text-align: center;
  min-width: 0;
}

.list-day-nav .btn-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

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

.today-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  text-align: left;
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  font: inherit;
  color: inherit;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.today-card-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  margin: -16px -18px 0;
  padding: 12px 18px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  color: #fff;
}

.today-card-head .today-card-title {
  color: inherit;
  opacity: 0.95;
}

.today-card-crew {
  margin-top: 8px;
}

.today-card-crew .crew-avatars--list-head {
  gap: 6px;
}

.today-card-crew .crew-avatar--named {
  width: auto;
  min-width: 32px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  background: rgba(255, 255, 255, 0.96);
  color: rgba(0, 0, 0, 0.82);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
}

.today-card-crew .crew-avatar--named.crew-avatar--pm {
  border-radius: 8px;
}

.today-card-crew .crew-avatar--named .crew-avatar-inner {
  font-size: inherit;
  font-weight: inherit;
  line-height: 1;
}

.today-card-crew .crew-avatar--lead::after {
  top: -4px;
  width: 8px;
  height: 8px;
}

.today-card-crew .crew-empty {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(0, 0, 0, 0.22);
  border: 1px dashed rgba(255, 255, 255, 0.45);
}

.today-card.event-blocked .today-card-crew .crew-empty {
  color: rgba(0, 0, 0, 0.7);
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.28);
}

.today-card.event-scheduled .today-card-head {
  background: linear-gradient(145deg, var(--type-scheduled, #007aff), var(--type-scheduled-end, #004d9e));
}

.today-card.event-tentative .today-card-head {
  background: linear-gradient(145deg, var(--type-tentative, #af52de), var(--type-tentative-end, #6d3aad));
}

.today-card.event-survey .today-card-head {
  background: linear-gradient(145deg, var(--type-survey, #ff9500), var(--type-survey-end, #9e5c00));
}

.today-card.event-delivery .today-card-head {
  background: linear-gradient(145deg, var(--type-delivery, #34c759), var(--type-delivery-end, #207a37));
}

.today-card.event-blocked .today-card-head {
  color: #1d1d1f;
  background: linear-gradient(145deg, var(--type-blocked, #ffd60a), var(--type-blocked-end, #9a8200));
}

.today-card.event-task .today-card-head {
  background: linear-gradient(145deg, var(--type-task, #8e8e93), var(--type-task-end, #57575c));
}

.today-card.event-scheduled .today-card-jobno,
.today-card.event-tentative .today-card-jobno,
.today-card.event-survey .today-card-jobno,
.today-card.event-delivery .today-card-jobno,
.today-card.event-task .today-card-jobno {
  color: rgba(255, 255, 255, 0.88);
}

.today-card.event-blocked .today-card-jobno {
  color: rgba(0, 0, 0, 0.55);
}

.today-card:hover {
  box-shadow: var(--shadow-md);
}

.today-card:active {
  transform: scale(0.995);
}

.today-card-customer {
  margin: 0;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.today-card-title {
  margin: 3px 0 0;
  font-size: 15px;
  font-weight: 550;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--text-primary);
}

.today-card-jobno {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 0.78;
  color: var(--text-primary);
}

.today-card-techs-needed {
  font-weight: 600;
  opacity: 1;
}

.event-forms-sheet {
  max-width: 420px;
}

.event-forms-meta {
  margin: 0 0 12px;
  font-size: 13px;
}

.event-forms-modal-body .form-links-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.today-list-empty {
  margin: 24px 12px;
  text-align: center;
  font-size: 15px;
}

.today-card-status {
  padding: 0 14px 10px;
}

.today-card-status-actions {
  padding-top: 2px;
}

.today-card-status-actions .btn {
  flex: 1 1 calc(50% - 4px);
  min-height: 44px;
}

.today-card-actions .btn-call {
  font-weight: 600;
}

.today-card-time {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.today-card-address {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

.today-card-contact {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-primary);
}

.today-card-contact a {
  color: var(--accent);
  text-decoration: none;
}

.today-card-contact a:active {
  opacity: 0.75;
}

.job-summary-line a {
  color: var(--accent);
  text-decoration: none;
}

.job-summary-line a:active {
  opacity: 0.75;
}

.today-card-meta {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.today-card-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.today-card-detail {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

.today-card-detail-label {
  font-weight: 600;
  color: var(--text-secondary);
}

.today-card-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

.today-card-actions .btn,
.today-card-actions a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.2;
  text-align: center;
  min-width: 0;
  box-sizing: border-box;
}

.today-card-actions .btn-notes--has-text {
  font-weight: 600;
}

.today-card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.today-card-body:hover {
  opacity: 0.98;
}

.today-card-notes-preview {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
}

.installer-notes-sheet {
  width: min(520px, calc(100vw - 32px));
}

.installer-notes-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.installer-notes-meta {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

.installer-notes-content {
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: #f5f5f7;
  border: 1px solid var(--border);
  font-size: 16px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.installer-notes-content--empty {
  color: var(--text-secondary);
  font-style: italic;
  font-size: 15px;
}

.installer-notes-foot {
  flex-wrap: wrap;
  gap: 8px;
}

.installer-notes-foot .btn-maps {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 14px;
}

.job-summary-hero {
  margin-bottom: 16px;
  padding: 12px 14px;
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.job-summary-hero-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.job-summary-hero-head-text {
  min-width: 0;
  flex: 1;
}

.job-summary-hero-toggle {
  flex-shrink: 0;
  font-size: 12px;
  padding: 4px 10px;
  min-height: 0;
  white-space: nowrap;
}

.job-summary-hero-peek {
  display: none;
  margin: 2px 0 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.3;
}

.job-summary-hero.is-collapsed {
  padding: 10px 12px;
  margin-bottom: 12px;
}

.job-summary-hero.is-collapsed .job-summary-hero-body {
  display: none;
}

.job-summary-hero.is-collapsed .job-summary-title {
  display: none;
}

.job-summary-hero.is-collapsed .job-summary-hero-peek {
  display: block;
}

.job-summary-hero.is-collapsed .job-summary-customer {
  font-size: 16px;
  margin-bottom: 0;
}

.job-summary-hero-body {
  margin-top: 8px;
}

.job-summary-customer {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.job-summary-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 550;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.job-summary-jobno {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
}

.job-summary-actions .btn-call {
  font-weight: 600;
}

.job-summary-line {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.45;
}

.job-summary-line:last-child {
  margin-bottom: 0;
}

.job-summary-notes {
  display: block;
}

.job-summary-notes-body {
  margin-top: 6px;
  white-space: normal;
}

.job-summary-forms {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.job-summary-forms > span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.job-summary-forms .form-links-grid {
  margin: 0;
}

.job-summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.job-summary-actions .btn {
  min-height: 40px;
}

.modal-sheet--tech-read .event-form-install-core,
.modal-sheet--tech-read .event-form-install-tail,
.modal-sheet--tech-read .event-form-description,
.modal-sheet--tech-read .drive-block,
.modal-sheet--tech-read .reminder-checks,
.modal-sheet--tech-read .audit-details {
  display: none !important;
}

/* Install jobs: summary hero has everything; hide duplicate form fields. */
.modal-sheet--tech-read-install #event-form {
  display: none !important;
}

.modal-sheet--tech-read .tech-field-comms-blurb {
  display: none;
}

.modal-sheet--tech-read .modal-head h2 {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.event-title-primary {
  font-weight: 650;
}

@media (max-width: 768px) {
  body[data-app-view="list"] .calendar-toolbar {
    flex-wrap: wrap;
  }

  body[data-role="technician"] .toolbar-secondary {
    flex-wrap: wrap;
  }

  body[data-role="technician"] .job-search {
    order: 10;
    width: 100%;
  }

  .today-card-customer {
    font-size: 18px;
  }

  .modal-sheet {
    max-height: 96vh;
  }

  .job-summary-customer {
    font-size: 20px;
  }
}

/* New job — prior customer autofill */
.field-autofill-wrap {
  position: relative;
}

.field-hint {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.3;
}

.job-form-autofill {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 2px);
  z-index: 60;
  max-height: min(240px, 40vh);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 4px;
}

.job-form-autofill[hidden] {
  display: none !important;
}

.job-form-autofill-hit {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.job-form-autofill-hit:hover,
.job-form-autofill-hit:focus {
  background: var(--accent-soft);
  outline: none;
}

.job-form-autofill-hit-main {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.job-form-autofill-hit-meta {
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-secondary);
}

/* ——— Phone / tablet (≤1023px): Day default, List optional, compact chrome ——— */
body[data-mobile-layout="true"] {
  -webkit-text-size-adjust: 100%;
  min-height: 100dvh;
}

body[data-mobile-layout="true"] .app-shell {
  padding: 4px 6px max(8px, env(safe-area-inset-bottom));
  min-height: 100dvh;
}

body[data-mobile-layout="true"] .brand-sub {
  display: none;
}

.toolbar-secondary .sync-status-chip {
  flex-shrink: 0;
}

#btn-refresh.is-refreshing {
  opacity: 0.7;
}

body[data-mobile-layout="true"] .brand-title {
  font-size: 18px;
}

body[data-mobile-layout="true"] .top-bar {
  display: none;
}

body[data-mobile-layout="true"] .calendar-chrome {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  overflow: visible;
}

body[data-mobile-layout="true"] .calendar-toolbar {
  position: relative;
  gap: 0;
  padding: 5px 6px 6px;
}

body[data-mobile-layout="true"] .toolbar-primary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "nav nav"
    "views actions";
  align-items: center;
  gap: 5px 6px;
}

body[data-mobile-layout="true"] .toolbar-nav {
  grid-area: nav;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px minmax(82px, 112px);
  align-items: center;
  gap: 4px;
  width: 100%;
}

body[data-mobile-layout="true"] .toolbar-nav .btn-icon {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
}

body[data-mobile-layout="true"] .toolbar-nav .btn-today {
  display: none;
}

body[data-mobile-layout="true"] .toolbar-range {
  min-height: 34px;
  padding: 2px 3px;
  font-size: 13px;
  line-height: 1.15;
  white-space: nowrap;
  cursor: pointer;
}

body[data-mobile-layout="true"] .mobile-office-field {
  display: block;
  min-width: 0;
}

body[data-mobile-layout="true"] .mobile-office-field[hidden] {
  display: none;
}

body[data-mobile-layout="true"] .mobile-office-field select {
  width: 100%;
  height: 34px;
  min-width: 0;
  padding: 0 24px 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-primary);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
}

body[data-mobile-layout="true"] .view-switch-primary {
  grid-area: views;
  width: 100%;
}

body[data-mobile-layout="true"] .view-switch-primary .btn-seg {
  min-height: 36px;
  padding: 6px 8px;
  font-size: 12px;
}

body[data-mobile-layout="true"] .zoom-switch,
body[data-mobile-layout="true"] .toolbar-secondary {
  display: none !important;
}

body[data-mobile-layout="true"] .mobile-toolbar-actions {
  grid-area: actions;
  display: flex;
  align-items: center;
  gap: 4px;
}

body[data-mobile-layout="true"] .mobile-toolbar-actions .btn {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  font-size: 18px;
}

body[data-mobile-layout="true"] #mobile-more {
  font-size: 13px;
  letter-spacing: 1px;
}

body[data-mobile-layout="true"] .mobile-more-menu {
  position: absolute;
  top: calc(100% - 3px);
  right: 6px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(300px, calc(100vw - 24px));
  max-height: min(70dvh, 520px);
  overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

body[data-mobile-layout="true"] .mobile-more-menu[hidden] {
  display: none !important;
}

body[data-mobile-layout="true"] .mobile-more-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

body[data-mobile-layout="true"] .mobile-more-section[hidden],
body[data-mobile-layout="true"] .mobile-acting-as[hidden],
body[data-mobile-layout="true"] #mobile-reports[hidden],
body[data-mobile-layout="true"] #mobile-settings[hidden],
body[data-mobile-layout="true"] #mobile-my-jobs[hidden],
body[data-mobile-layout="true"] #mobile-new[hidden] {
  display: none !important;
}

body[data-mobile-layout="true"] .mobile-more-label {
  font-size: 11px;
  font-weight: 650;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

body[data-mobile-layout="true"] .mobile-more-zoom {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

body[data-mobile-layout="true"] .mobile-more-zoom .btn,
body[data-mobile-layout="true"] .mobile-more-wide,
body[data-mobile-layout="true"] .mobile-acting-as select {
  min-height: 40px;
  width: 100%;
}

body[data-mobile-layout="true"] .mobile-acting-as select {
  padding: 7px 9px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-primary);
  font: inherit;
}

body[data-mobile-layout="true"] .job-search {
  display: none !important;
}

body[data-mobile-layout="true"] .legend-collapsible {
  display: none;
}

body[data-mobile-layout="true"] .my-jobs-filter {
  font-size: 14px;
  min-height: 40px;
  align-items: center;
}

body[data-mobile-layout="true"] .my-jobs-filter input {
  width: 18px;
  height: 18px;
}

body[data-mobile-layout="true"][data-app-view="list"] .today-viewport {
  display: flex !important;
}

body[data-mobile-layout="true"][data-app-view="calendar"] .calendar-viewport {
  display: flex !important;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
}

body[data-mobile-layout="true"][data-app-view="calendar"] .calendar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

body[data-mobile-layout="true"][data-app-view="list"] .calendar-viewport {
  display: none !important;
}

body[data-mobile-layout="true"] .today-list {
  gap: 10px;
}

body[data-mobile-layout="true"] .today-card {
  padding: 14px 16px;
  gap: 10px;
}

body[data-mobile-layout="true"] .today-card-head {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin: -14px -16px 0;
  padding: 12px 16px;
}

body[data-mobile-layout="true"] .today-card-customer {
  font-size: 19px;
}

body[data-mobile-layout="true"] .today-card-time {
  font-size: 17px;
}

body[data-mobile-layout="true"] .today-card-detail {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

body[data-mobile-layout="true"] .today-card-detail-label {
  font-weight: 600;
  color: var(--text-secondary);
}

body[data-mobile-layout="true"] .today-card-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 8px;
  margin-top: 4px;
}

body[data-mobile-layout="true"] .today-card-actions .btn,
body[data-mobile-layout="true"] .today-card-actions a.btn {
  min-height: 44px;
  font-size: 13px;
  padding: 8px 10px;
}

/* Full-screen job sheet on narrow screens */
body[data-mobile-layout="true"] .modal-sheet {
  left: 0;
  top: auto;
  bottom: 0;
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: 100dvh;
  border-radius: 0;
  transform: translateY(100%);
  padding-bottom: env(safe-area-inset-bottom);
}

body[data-mobile-layout="true"] .modal-sheet.is-open {
  transform: translateY(0);
}

body[data-mobile-layout="true"] .modal-sheet--tech-read .modal-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: 0;
}

body[data-mobile-layout="true"] .modal-sheet--tech-read .tech-field-comms {
  order: 99;
  position: sticky;
  bottom: 0;
  margin: 16px -18px 0;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-bottom: none;
  background: var(--surface);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
}

body[data-mobile-layout="true"] .tech-field-comms-actions .btn {
  flex: 1 1 calc(50% - 4px);
  min-height: 48px;
  font-size: 14px;
}

body[data-mobile-layout="true"] .job-summary-hero {
  padding: 14px 16px;
}

body[data-mobile-layout="true"] .job-summary-customer {
  font-size: 21px;
}

body[data-mobile-layout="true"] .job-summary-actions .btn {
  flex: 1 1 calc(50% - 4px);
  min-height: 48px;
}

body[data-mobile-layout="true"] .job-summary-actions .btn-primary {
  flex: 1 1 100%;
}

/* —— Sign-in screen —— */
.login-screen {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg, #f2f2f7);
}

.login-screen[hidden],
.app-root[hidden],
.login-form[hidden],
.boot-loading[hidden] {
  display: none !important;
}

/* Full-app boot loader — covers stale calendar until cloud hydrate finishes */
.boot-loading {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(245, 245, 247, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-sizing: border-box;
}

.boot-loading-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 22px 28px;
  border-radius: var(--radius-md, 12px);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: var(--shadow-md, 0 4px 24px rgba(0, 0, 0, 0.06));
}

.boot-loading-dots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
  width: 44px;
  height: 44px;
}

.boot-loading-dots span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--accent, #007aff);
  transform: scale(0.45);
  opacity: 0.35;
  animation: boot-dot-pulse 1.05s ease-in-out infinite;
}

.boot-loading-dots span:nth-child(1) {
  animation-delay: 0s;
}

.boot-loading-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.boot-loading-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

.boot-loading-dots span:nth-child(4) {
  animation-delay: 0.45s;
}

@keyframes boot-dot-pulse {
  0%,
  100% {
    transform: scale(0.45);
    opacity: 0.35;
  }
  35% {
    transform: scale(1);
    opacity: 1;
  }
  55% {
    transform: scale(0.55);
    opacity: 0.45;
  }
}

.boot-loading-label {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #1d1d1f);
}

@media (prefers-reduced-motion: reduce) {
  .boot-loading-dots span {
    animation: none;
    transform: scale(0.85);
    opacity: 0.75;
  }
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 28px 24px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.login-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
}

.login-lead {
  margin: 0 0 20px;
  color: var(--text-muted, #6b7280);
  font-size: 14px;
  line-height: 1.45;
}

.login-mode-switch {
  display: flex;
  gap: 0;
  margin: 0 0 16px;
  width: 100%;
}

.login-mode-switch .btn-seg {
  flex: 1 1 50%;
  justify-content: center;
  min-height: 40px;
  border-radius: 0;
}

.login-mode-switch .btn-seg:first-child {
  border-radius: 8px 0 0 8px;
}

.login-mode-switch .btn-seg:last-child {
  border-radius: 0 8px 8px 0;
}

.login-link-btn {
  width: 100%;
  justify-content: center;
  background: none;
  border: none;
  color: var(--accent, #007aff);
  font-size: 14px;
  padding: 4px 0;
  cursor: pointer;
}

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

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

.login-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.login-field input {
  padding: 10px 12px;
  font-size: 16px;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 8px;
}

.login-remember {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
}

.login-remember input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.login-setup-title {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
}

.login-submit {
  width: 100%;
  justify-content: center;
  min-height: 44px;
}

.login-back {
  width: 100%;
  justify-content: center;
}

.login-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  font-size: 13px;
  color: #b42318;
  background: #fef3f2;
  border-radius: 8px;
}

.login-hint {
  margin: 0;
  font-size: 13px;
}

.personal-settings-email {
  font-size: 14px;
  margin: 0 0 16px;
}

.personal-settings-my-jobs {
  display: flex;
  margin: 12px 0 0;
}

.personal-settings-company,
.personal-settings-sign-out {
  display: block;
  width: 100%;
  margin-top: 14px;
}

.personal-settings-sign-out {
  color: #b71c1c;
  border-color: rgba(183, 28, 28, 0.35);
}

.reports-sheet {
  max-width: min(1160px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
}

.reports-head-subtitle {
  margin: 3px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.reports-body {
  overflow-y: auto;
  max-height: calc(100vh - 160px);
}

.reports-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: flex-end;
  margin-bottom: 14px;
}

.reports-filters .field {
  margin: 0;
  min-width: 140px;
}

.reports-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.reports-cost-note {
  margin: 0 0 12px;
}

.reports-view-switch {
  display: inline-flex;
  gap: 3px;
  margin: 0 0 14px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.035);
}

.reports-view-btn {
  min-width: 108px;
  border-color: transparent;
  background: transparent;
}

.reports-view-btn.is-active {
  color: var(--accent);
  border-color: rgba(0, 122, 255, 0.24);
  background: var(--surface);
  font-weight: 650;
}

.reports-context {
  display: flex;
  justify-content: space-between;
  gap: 12px 24px;
  align-items: baseline;
  margin: 0 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.reports-context > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
}

.reports-context > div span,
.reports-context-note {
  color: var(--text-secondary);
}

.reports-loading,
.reports-load-error {
  display: flex;
  min-height: 190px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 7px;
  padding: 28px;
  color: var(--text-secondary);
  text-align: center;
}

.reports-loading strong,
.reports-load-error strong {
  color: var(--text);
  font-size: 15px;
}

.reports-loading-spinner {
  width: 22px;
  height: 22px;
  margin-bottom: 5px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: reports-spin 700ms linear infinite;
}

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

.reports-load-error strong {
  color: #b71c1c;
}

.reports-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.reports-summary--operations,
.reports-summary--finance {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.reports-stat {
  min-height: 94px;
  padding: 14px 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.reports-stat-label {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}

.reports-stat-value {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.reports-stat-sub {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-secondary);
}

.reports-stat--highlight {
  border-color: rgba(0, 122, 255, 0.35);
  background: rgba(0, 122, 255, 0.06);
}

.reports-stat--highlight .reports-stat-value {
  font-size: 22px;
}

.reports-stat--muted {
  opacity: 0.88;
}

.reports-stat--hero {
  border-color: rgba(0, 122, 255, 0.32);
  background: rgba(0, 122, 255, 0.055);
}

.reports-stat--warning {
  border-color: rgba(198, 112, 0, 0.38);
  background: rgba(245, 124, 0, 0.07);
}

.reports-execution-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.6fr);
  gap: 14px;
  margin: 0 0 18px;
}

.reports-progress-block,
.reports-hours-block,
.reports-chart,
.reports-formula {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.018);
}

.reports-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 650;
}

.reports-progress-head strong {
  font-size: 20px;
}

.reports-progress-track,
.reports-bar-track {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.09);
}

.reports-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.reports-progress-block p {
  margin: 9px 0 0;
  font-size: 12px;
}

.reports-hours-block {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 16px;
  align-content: center;
}

.reports-hours-block span {
  color: var(--text-secondary);
  font-size: 12px;
}

.reports-hours-block strong {
  text-align: right;
  font-size: 16px;
}

.reports-hours-block small {
  grid-column: 1 / -1;
  color: var(--text-tertiary);
}

.reports-chart {
  margin: 0 0 18px;
}

.reports-chart h3 {
  margin: 0 0 2px;
  font-size: 15px;
}

.reports-chart > p {
  margin: 0 0 14px;
  font-size: 12px;
}

.reports-bar-row {
  display: grid;
  grid-template-columns: minmax(180px, 230px) minmax(120px, 1fr);
  gap: 12px;
  align-items: center;
  margin: 8px 0;
}

.reports-bar-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

.reports-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--text-tertiary);
}

.reports-bar-fill--good {
  background: #2e7d32;
}

.reports-bar-fill--accent {
  background: var(--accent);
}

.reports-bar-fill--warn {
  background: #ef8d22;
}

.reports-bar-fill--bad {
  background: #c62828;
}

.reports-section {
  margin: 0 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.reports-section > summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 13px 15px;
  cursor: pointer;
  list-style: none;
  font-size: 14px;
  font-weight: 650;
}

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

.reports-section-chevron {
  color: var(--text-tertiary);
  transition: transform 140ms ease;
}

.reports-section[open] .reports-section-chevron {
  transform: rotate(180deg);
}

.reports-section-body {
  padding: 0 15px 15px;
  border-top: 1px solid var(--border);
}

.reports-section-description {
  margin: 11px 0 8px;
  font-size: 12px;
}

.reports-section--attention[open] {
  border-color: rgba(198, 112, 0, 0.28);
}

.reports-attention-text {
  color: #a34b00;
  font-weight: 600;
}

.reports-formula {
  margin: 0 0 18px;
  border-left: 3px solid var(--accent);
}

.reports-formula strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.reports-formula p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
}

.reports-reference-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

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

.reports-band-compare {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.reports-band-compare-label {
  font-size: 12px;
  font-weight: 650;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.reports-panel {
  margin: 0 0 22px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.reports-panel h3 {
  margin: 14px 0 4px;
  font-size: 16px;
}

.reports-panel-blurb {
  margin: 0 0 10px;
  font-size: 13px;
}

.reports-table-wrap {
  margin-top: 6px;
}

.reports-empty {
  margin: 8px 0;
}

.reports-aggregate {
  margin: 10px 0 0;
  font-size: 13px;
}

.reports-arrival-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.reports-arrival-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: #f7f7f8;
}

.reports-arrival-pill--early {
  background: rgba(46, 125, 50, 0.1);
  border-color: rgba(46, 125, 50, 0.35);
  color: #1b5e20;
}

.reports-arrival-pill--on_window {
  background: rgba(25, 118, 210, 0.1);
  border-color: rgba(25, 118, 210, 0.35);
  color: #0d47a1;
}

.reports-arrival-pill--grace {
  background: rgba(245, 124, 0, 0.12);
  border-color: rgba(245, 124, 0, 0.4);
  color: #e65100;
}

.reports-arrival-pill--late {
  background: rgba(198, 40, 40, 0.1);
  border-color: rgba(198, 40, 40, 0.4);
  color: #b71c1c;
}

.reports-arrival-pill--unknown {
  color: var(--text-secondary);
}

.tech-hourly-inp {
  width: 110px;
  max-width: 100%;
}

.extra-hourly-rate-row {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border, rgba(0, 0, 0, 0.1));
  max-width: 320px;
}

.extra-hourly-rate-row .settings-catalog-blurb {
  margin-top: 6px;
  margin-bottom: 0;
}

.form-links-editor {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.form-link-row {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border, rgba(0, 0, 0, 0.12));
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.02);
}

.form-link-row .field {
  margin: 0;
}

.form-link-types .field-label {
  display: block;
  margin-bottom: 6px;
}

.form-link-type-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

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

@media (min-width: 720px) {
  .form-link-row {
    grid-template-columns: 1fr 1.4fr;
  }

  .form-link-types,
  .form-link-row-actions {
    grid-column: 1 / -1;
  }
}

.installer-retail-rates {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 8px;
}

.installer-retail-loc {
  padding: 12px 14px;
  border: 1px solid var(--border, rgba(0, 0, 0, 0.12));
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.02);
}

.installer-retail-loc h4 {
  margin: 0 0 10px;
  font-size: 15px;
}

.installer-retail-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 14px;
}

.installer-retail-fields .field {
  margin: 0;
}

.installer-retail-inp {
  width: 100%;
  max-width: 140px;
}

@media (max-width: 720px) {
  .installer-retail-fields {
    grid-template-columns: 1fr;
  }
}

.reports-money--profit {
  color: #1b5e20;
  font-weight: 600;
}

.reports-money--profit::before {
  content: "▲ ";
  font-size: 0.72em;
}

.reports-money--loss {
  color: #b71c1c;
  font-weight: 600;
}

.reports-money--loss::before {
  content: "▼ ";
  font-size: 0.72em;
}

.reports-band-summary {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--border, rgba(0, 0, 0, 0.12));
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.02);
}

.reports-band-summary-title {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 8px;
}

.reports-band-table {
  margin: 0;
  width: 100%;
  max-width: 520px;
}

.reports-band-table th,
.reports-band-table td {
  font-size: 12px;
  padding: 4px 8px;
}

.reports-band-empty {
  margin: 0;
  font-size: 12px;
}

.reports-day-band-wrap {
  padding: 8px 10px 12px;
}

.reports-day-band-label {
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--text-secondary);
}

.reports-day-job-bands > td {
  padding-top: 0;
  padding-bottom: 10px;
  background: transparent;
}

.reports-day-toggle {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 2px 4px;
  color: var(--text-secondary);
}

.reports-day-toggle:focus-visible,
.reports-day-row:focus-visible,
.reports-section > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.reports-day-row {
  cursor: pointer;
}

.reports-day-row:hover {
  background: rgba(0, 0, 0, 0.03);
}

.reports-day-row.is-expanded {
  background: rgba(0, 122, 255, 0.06);
}

.reports-day-toggle-cell {
  width: 28px;
}

.reports-day-detail > td {
  padding: 0 0 10px;
  background: rgba(0, 0, 0, 0.02);
}

.reports-day-detail-table {
  margin: 0;
  width: 100%;
}

.reports-day-job td {
  font-size: 13px;
  vertical-align: top;
}

.reports-day-job-meta {
  font-size: 12px;
  margin-top: 2px;
}

@media (max-width: 760px) {
  .reports-summary--operations,
  .reports-summary--finance {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reports-execution-grid {
    grid-template-columns: 1fr;
  }

  .reports-context {
    align-items: flex-start;
    flex-direction: column;
  }

  .reports-bar-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (max-width: 520px) {
  .reports-sheet {
    max-width: calc(100vw - 12px);
    max-height: calc(100vh - 12px);
  }

  .reports-filters .field {
    min-width: calc(50% - 8px);
    flex: 1 1 calc(50% - 8px);
  }

  .reports-filters .field:last-of-type {
    flex-basis: 100%;
  }

  .reports-view-switch {
    display: flex;
  }

  .reports-view-btn {
    flex: 1;
  }

  .reports-summary--operations,
  .reports-summary--finance {
    grid-template-columns: 1fr 1fr;
  }

  .reports-stat {
    min-height: 88px;
    padding: 11px;
  }

  .reports-stat-value {
    font-size: 18px;
  }

  .reports-section > summary {
    padding: 12px;
  }

  .reports-section-body {
    padding: 0 12px 12px;
  }
}



