/* Field visit is a task mode inside the single authenticated cockpit. */
body.unified-cockpit .campo-desk-tools,
body.unified-cockpit #field-visit,
body.unified-cockpit #field-leave-panel,
body.unified-cockpit #desk-handoff {
  border: 1px solid var(--cockpit-line);
  border-radius: var(--cockpit-radius);
  background: var(--cockpit-surface);
  box-shadow: var(--cockpit-shadow-card);
}

body.unified-cockpit .campo-desk-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  padding: 16px 18px;
}

body.unified-cockpit .campo-desk-tools p {
  min-width: 220px;
  flex: 1 1 auto;
  margin: 0;
  color: var(--cockpit-muted);
  font-size: 11px;
}

body.unified-cockpit #field-visit {
  margin: 22px 0;
  padding: 24px 26px;
  scroll-margin-top: 24px;
}

body.unified-cockpit #field-visit .field-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 26px;
}

body.unified-cockpit #field-visit .eyebrow,
body.unified-cockpit #field-leave-panel .eyebrow,
body.unified-cockpit #desk-handoff .eyebrow {
  margin: 0 0 7px;
  color: var(--cockpit-wine);
  font-size: 9px;
  letter-spacing: .14em;
}

body.unified-cockpit #field-stage-title,
body.unified-cockpit #field-leave-title,
body.unified-cockpit #desk-handoff-title {
  margin: 0;
  color: var(--cockpit-wine);
  font: 600 28px/1.15 var(--cockpit-serif);
  letter-spacing: -.02em;
}

body.unified-cockpit #field-stage-description,
body.unified-cockpit #field-leave-panel .panel-head p,
body.unified-cockpit #desk-handoff > p {
  max-width: 70ch;
  margin: 7px 0 0;
  color: var(--cockpit-muted);
  font-size: 12px;
}

body.unified-cockpit .field-heading-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

body.unified-cockpit #field-mode-toggle,
body.unified-cockpit #field-visit [data-field-step],
body.unified-cockpit #field-primary-action,
body.unified-cockpit .edge-scanner-btn {
  min-width: 48px;
  min-height: 48px;
  touch-action: manipulation;
}

body.unified-cockpit #field-visit .field-steps {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 8px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--cockpit-line);
}

body.unified-cockpit #field-visit [data-field-step] {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--cockpit-line-strong);
  border-radius: var(--cockpit-radius-control);
  background: var(--cockpit-paper-soft);
  color: var(--cockpit-wine);
  font: 700 11px/1.25 var(--cockpit-sans);
}

body.unified-cockpit #field-visit [data-field-step]:hover {
  border-color: var(--cockpit-gold-deep);
  background: var(--cockpit-gold-soft);
}

body.unified-cockpit #field-visit [data-field-step][aria-current="step"] {
  border-color: var(--cockpit-gold);
  background: var(--cockpit-gold-soft);
  color: var(--cockpit-wine-deep);
  box-shadow: inset 0 -3px 0 var(--cockpit-gold-deep);
}

body.unified-cockpit #draft-state-message {
  margin: 16px 0 0;
  color: var(--cockpit-muted);
  font-size: 11px;
}

body.unified-cockpit #field-leave-panel,
body.unified-cockpit #desk-handoff {
  margin: 22px 0;
  padding: 26px;
}

body.unified-cockpit .field-task-list {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(240px,1fr));
  gap: 14px;
  margin-top: 20px;
}

body.unified-cockpit .field-task,
body.unified-cockpit .field-receipt {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--cockpit-line);
  border-radius: 12px;
  background: var(--cockpit-paper-soft);
}

body.unified-cockpit .field-task h3,
body.unified-cockpit .field-receipt strong {
  color: var(--cockpit-wine);
}

body.unified-cockpit .field-task h3 {
  margin: 5px 0 8px;
  font: 600 19px/1.2 var(--cockpit-serif);
}

body.unified-cockpit .field-task p,
body.unified-cockpit .field-receipt p {
  color: var(--cockpit-muted-strong);
  font-size: 11px;
  line-height: 1.55;
}

body.unified-cockpit .field-office-list {
  margin-top: 14px;
  border: 1px solid var(--cockpit-line);
  border-radius: 12px;
  background: var(--cockpit-paper-wash);
}

body.unified-cockpit .field-office-list > summary {
  min-height: 48px;
  padding: 14px 16px;
  color: var(--cockpit-wine);
  font-size: 12px;
}

body.unified-cockpit #field-local-pending,
body.unified-cockpit .field-clear-note {
  margin: 18px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--cockpit-line);
  border-radius: var(--cockpit-radius-control);
  background: var(--cockpit-gold-soft);
  color: var(--cockpit-amber);
  font-size: 11px;
}

body.unified-cockpit #field-summary-freshness {
  margin: 16px 0 0;
  color: var(--cockpit-muted);
  font-size: 10px;
}

body.unified-cockpit #desk-handoff .field-receipt {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 4px 16px;
  margin-top: 12px;
}

body.unified-cockpit #desk-handoff .field-receipt p {
  grid-column: 1;
  margin: 0;
}

body.unified-cockpit #desk-handoff .field-receipt a {
  grid-column: 2;
  grid-row: 1/3;
}

/* The visit dock is task chrome; global navigation remains the shared rail/dock. */
body.unified-cockpit.field-mode {
  padding-bottom: calc(var(--field-dock-height,112px) + var(--field-keyboard-inset,0px) + 24px);
}

body.unified-cockpit.field-mode #field-dock:not([hidden]) {
  position: fixed;
  right: 0;
  bottom: var(--field-keyboard-inset,0px);
  left: var(--cockpit-rail);
  z-index: 55;
  display: flex;
  min-height: 88px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 46px calc(14px + env(safe-area-inset-bottom));
  border: 0;
  border-top: 1px solid var(--cockpit-line);
  background: var(--cockpit-surface);
  box-shadow: var(--cockpit-shadow-dock);
}

body.unified-cockpit #field-dock [data-field-status] {
  min-width: 0;
  flex: 1;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--cockpit-muted);
  font-size: 11px;
  line-height: 1.45;
}

body.unified-cockpit #field-dock[data-sync-state="conflict"] [data-field-status],
body.unified-cockpit #field-dock[data-sync-state="validation"] [data-field-status],
body.unified-cockpit #field-dock[data-sync-state="offline"] [data-field-status] {
  color: var(--cockpit-amber);
}

body.unified-cockpit #field-primary-action {
  flex: 0 0 auto;
  min-width: 210px;
  padding: 0 20px;
  border: 1px solid var(--cockpit-gold);
  border-radius: var(--cockpit-radius-control);
  background: var(--cockpit-gold);
  color: var(--cockpit-gold-ink);
  font-weight: 700;
}

body.unified-cockpit #field-primary-action:disabled {
  border-color: var(--cockpit-line-strong);
  background: var(--cockpit-paper-soft);
  color: var(--cockpit-disabled);
  cursor: wait;
}

@media(max-width:960px) {
  body.unified-cockpit #field-visit,
  body.unified-cockpit #field-leave-panel,
  body.unified-cockpit #desk-handoff {
    margin: 16px 0;
    padding: 20px 16px;
    border-radius: 12px;
  }

  body.unified-cockpit #field-visit .field-heading {
    display: block;
  }

  body.unified-cockpit .field-heading-actions {
    justify-content: flex-start;
    margin-top: 14px;
  }

  body.unified-cockpit #field-stage-title,
  body.unified-cockpit #field-leave-title,
  body.unified-cockpit #desk-handoff-title {
    font-size: 24px;
  }

  body.unified-cockpit #field-visit .field-steps {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  body.unified-cockpit.field-mode {
    padding-bottom: calc(var(--field-dock-height,150px) + var(--field-keyboard-inset,0px) + var(--cockpit-dock) + env(safe-area-inset-bottom));
  }

  body.unified-cockpit.field-mode #field-dock:not([hidden]) {
    bottom: calc(var(--cockpit-dock) + var(--field-keyboard-inset,0px) + env(safe-area-inset-bottom));
    left: 0;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
  }

  body.unified-cockpit #field-dock [data-field-status],
  body.unified-cockpit #field-primary-action {
    flex: 1 1 100%;
  }

  body.unified-cockpit #field-primary-action {
    width: 100%;
    min-width: 0;
  }

  body.unified-cockpit #desk-handoff .field-receipt {
    display: block;
  }
}

@media(max-width:560px) {
  body.unified-cockpit .campo-desk-tools,
  body.unified-cockpit .field-heading-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  body.unified-cockpit .campo-desk-tools .button,
  body.unified-cockpit .field-heading-actions .button {
    width: 100%;
    justify-content: center;
  }

  body.unified-cockpit #field-visit .field-steps {
    grid-template-columns: 1fr;
  }
}

@media(prefers-reduced-motion:reduce) {
  body.unified-cockpit #field-visit *,
  body.unified-cockpit #field-dock * {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
