/* RHFChoiceField: tick chips for a few options, a compact dropdown for many
   (design-preview: EmployeeSelect). Own styles, so it works on any page. */
.cf-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
/* a quiet text button right after the label, not a boxed one */
.cf-add {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 6px;
  color: var(--sh-accent);
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
}
.cf-add:hover {
  background: var(--sh-hover);
}
.cf-add:focus-visible {
  outline: 2px solid var(--sh-focus);
  outline-offset: 1px;
}
.cf-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.cf-chips .ant-checkbox-wrapper {
  margin: 0;
  padding: 6px 12px;
  border: 1px solid var(--sh-border, var(--color-border));
  border-radius: 8px;
  background: var(--sh-surface, var(--color-surface));
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease;
}
.cf-chips .ant-checkbox-wrapper:hover {
  border-color: var(--sh-focus);
}
.cf-chips .ant-checkbox-wrapper-checked {
  border-color: var(--sh-accent);
  background: var(--sh-accent-bg);
}
.cf-chips .ant-checkbox-wrapper-disabled {
  opacity: 0.6;
}
.cf-empty {
  margin: 6px 0 0;
  color: var(--sh-muted);
  font-size: 13px;
}
.cf-bulk {
  display: flex;
  gap: 14px;
  padding: 6px 12px 8px;
  border-bottom: 1px solid var(--sh-border, var(--color-border));
}
.cf-bulk button {
  padding: 0;
  color: var(--sh-accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.cf-bulk button:hover {
  text-decoration: underline;
}

/* ---- the picker for long lists (design-preview EmployeeSelect) ---- */
.cf-picker {
  position: relative;
  min-width: 0;
  margin-top: 6px;
}
.cf-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  padding: 5px 12px;
  border: 1px solid var(--sh-border, var(--color-border));
  border-radius: 8px;
  background: var(--sh-surface, var(--color-surface));
  color: var(--sh-text, var(--color-text));
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.cf-trigger > svg {
  flex-shrink: 0;
  color: var(--sh-muted);
}
.cf-trigger:hover:not(:disabled),
.cf-trigger[aria-expanded="true"] {
  border-color: var(--sh-accent);
}
.cf-trigger:focus-visible {
  outline: 2px solid var(--sh-focus);
  outline-offset: 1px;
}
.cf-trigger:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.cf-names {
  display: flex;
  flex: 1;
  align-items: center;
  min-width: 0;
  gap: 6px;
}
.cf-chip {
  min-width: 0;
  max-width: 40%;
  padding: 2px 8px;
  overflow: hidden;
  border-radius: 5px;
  background: var(--sh-accent-bg);
  color: var(--sh-accent);
  font-size: 13px;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cf-more {
  flex-shrink: 0;
  color: var(--sh-muted);
  font-size: 12px;
  white-space: nowrap;
}
.cf-placeholder {
  color: var(--sh-muted);
}
.cf-panel {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  left: 0;
  z-index: 30;
  padding: 8px;
  border: 1px solid var(--sh-border, var(--color-border));
  border-radius: 10px;
  background: var(--sh-surface, var(--color-surface));
  box-shadow: 0 8px 24px rgb(0 0 50 / 14%);
  color: var(--sh-text, var(--color-text));
}
.cf-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--sh-border, var(--color-border));
  border-radius: 6px;
  color: var(--sh-muted);
}
.cf-search input {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 7px 0;
  border: 0;
  background: transparent;
  color: var(--sh-text, var(--color-text));
  font: inherit;
  font-size: 14px;
}
.cf-search:focus-within {
  outline: 2px solid var(--sh-focus);
  outline-offset: 1px;
}
.cf-search input:focus-visible {
  outline: none;
}
.cf-toolbar,
.cf-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 4px;
  font-size: 12px;
}
.cf-toolbar > span,
.cf-footer > span {
  margin-right: auto;
  color: var(--sh-muted);
}
.cf-toolbar button,
.cf-footer > button:not(.cf-done) {
  color: var(--sh-accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.cf-toolbar button:disabled,
.cf-footer button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.cf-list {
  max-height: 220px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.cf-list > label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 7px 8px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}
.cf-list > label > span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cf-list > label:hover,
.cf-list > label.selected {
  background: var(--sh-accent-bg);
}
.cf-list input {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  accent-color: var(--sh-accent);
}
.cf-empty-list {
  margin: 16px 8px;
  color: var(--sh-muted);
  font-size: 13px;
}
.cf-footer {
  border-top: 1px solid var(--sh-border, var(--color-border));
  padding-bottom: 0;
}
.cf-done {
  min-height: 28px;
  padding: 4px 12px;
  border: 1px solid var(--sh-border, var(--color-border));
  border-radius: 6px;
  background: var(--sh-surface, var(--color-surface));
  color: var(--sh-text, var(--color-text));
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.cf-done:hover {
  background: var(--sh-hover);
}
.lm-map {
  position: relative;
  z-index: 0;
}

.lm-pin {
  color: var(--color-primary-500);
  filter: drop-shadow(0 2px 3px rgb(0 0 0 / 0.35));
  line-height: 0;
}

.lm-results {
  max-height: 14rem;
  overflow-y: auto;
}
/*
 * D2-11: the 3-step "Create a new task" form. Ported from
 * src/design-preview/{TaskEditor.jsx,TaskEditorFields.css,preview.css} onto the
 * shell tokens. It carries its own button styles: it opens from any page, and
 * other pages' stylesheets are only loaded with those pages.
 */
.ct {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 20px;
}
@media (min-width: 1200px) {
  .ct {
    grid-template-columns: minmax(0, 1fr) 280px;
  }
}
.ct-main {
  min-width: 0;
  border: 1px solid var(--sh-border);
  border-radius: 10px;
  background: var(--sh-surface);
}

/* ---- stepper ---- */
.ct-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 16px 24px;
  border-bottom: 1px solid var(--sh-border);
  list-style: none;
}
.ct-stepper-item {
  display: flex;
  flex: 1;
  align-items: center;
}
.ct-stepper-item:not(:last-child)::after {
  content: "";
  flex: 1;
  height: 1px;
  margin: 0 12px;
  background: var(--sh-border);
}
.ct-stepper-item:last-child {
  flex: none;
}
.ct-step {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  color: var(--sh-muted);
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  cursor: pointer;
}
.ct-step:focus-visible {
  outline: 2px solid var(--sh-focus);
  outline-offset: 3px;
  border-radius: 6px;
}
.ct-step-dot {
  display: grid;
  flex: none;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--sh-border);
  border-radius: 50%;
  background: var(--sh-surface);
  font-size: 12px;
  font-weight: 650;
}
.ct-step.is-active {
  color: var(--sh-heading);
}
.ct-step.is-active .ct-step-dot {
  border-color: var(--sh-control);
  background: var(--sh-control);
  color: #fff;
}
.ct-step.is-done .ct-step-dot {
  border-color: var(--sh-accent-bg);
  background: var(--sh-accent-bg);
  color: var(--sh-accent);
}
.ct-step-errors {
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--color-error);
  color: #fff;
  font-size: 10px;
  font-weight: 650;
}

/* ---- step body ---- */
.ct-step-body {
  padding: 24px;
}
.ct-step-body h2 {
  margin: 0;
  color: var(--sh-heading);
  font-size: 20px;
  font-weight: 650;
}
.ct-step-text {
  margin: 4px 0 22px;
  color: var(--sh-muted);
  font-size: 13px;
}
.ct-section {
  display: grid;
  gap: 20px;
}
.ct-grid {
  display: grid;
  gap: 16px 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.ct-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 900px) {
  .ct-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.ct-grid > .col-span-full {
  grid-column: 1 / -1;
}
.ct-field-label {
  margin: 0 0 6px;
  color: var(--sh-heading);
  font-size: 14px;
}
.ct-type-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.ct-type-head > :first-child {
  flex: 1;
  min-width: 0;
}

/* ---- task type tiles ---- */
.ct-tiles {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.ct-tile {
  position: relative;
  display: grid;
  gap: 4px;
  justify-items: start;
  padding: 14px 16px;
  border: 1px solid var(--sh-border);
  border-radius: 8px;
  background: var(--sh-surface);
  color: var(--sh-muted);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease;
}
.ct-tile strong {
  margin-top: 6px;
  color: var(--sh-heading);
  font-size: 14px;
}
.ct-tile span {
  font-size: 12px;
}
.ct-tile:hover {
  border-color: var(--sh-focus);
}
.ct-tile.is-selected {
  border-color: var(--sh-accent);
  background: var(--sh-accent-bg);
}
.ct-tile:focus-visible {
  outline: 2px solid var(--sh-focus);
  outline-offset: 2px;
}
.ct-tile-radio {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 14px;
  height: 14px;
  border: 1px solid var(--sh-border);
  border-radius: 50%;
}
.ct-tile.is-selected .ct-tile-radio {
  border: 4px solid var(--sh-control);
  background: #fff;
}

.ct-hint {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--sh-accent-bg);
  color: var(--sh-accent);
  font-size: 13px;
}

/* ---- switch rows ---- */
.ct-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--sh-border);
}
.ct-switch-lead {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.ct-switch-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--sh-accent-bg);
  color: var(--sh-accent);
}
.ct-switch-copy {
  display: grid;
  gap: 2px;
}
.ct-switch-row strong {
  color: var(--sh-heading);
  font-size: 14px;
}
.ct-switch-row span {
  color: var(--sh-muted);
  font-size: 12px;
}

/* ---- footer ---- */
.ct-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 24px;
  border-top: 1px solid var(--sh-border);
  border-radius: 0 0 10px 10px;
  background: var(--sh-surface);
}
.ct-footer-end {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ct-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ct-btn {
  display: inline-flex;
  flex: none;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--sh-border);
  border-radius: 8px;
  background: var(--sh-surface);
  color: var(--sh-text);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
}
.ct-btn:hover {
  background: var(--sh-hover);
}
.ct-btn:focus-visible {
  outline: 2px solid var(--sh-focus);
  outline-offset: 1px;
}

/* ---- side summary ---- */
.ct-side {
  display: none;
  gap: 16px;
}
@media (min-width: 1200px) {
  .ct-side {
    position: sticky;
    top: 16px;
    display: grid;
  }
}
.ct-tip {
  display: grid;
  gap: 6px;
  padding: 4px 6px;
  color: var(--sh-accent);
}
.ct-tip strong {
  color: var(--sh-heading);
  font-size: 13px;
}
.ct-tip p {
  margin: 0;
  color: var(--sh-muted);
  font-size: 12px;
}

/* ---- the create page: heading shared by the basic and three-step forms ---- */
.ct-page-wrap {
  /* a positioned box, so absolutely placed bits inside (the hidden file input
     of the attachments dropzone) stay inside the scrolling content instead of
     stretching the whole document and adding a second scrollbar */
  position: relative;
  padding: 24px 30px 40px;
}
.ct-page {
  display: grid;
  gap: 20px;
}
.ct-page-head {
  display: grid;
  gap: 14px;
}
.ct-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 0;
  color: var(--sh-muted);
  font-size: 13px;
  cursor: pointer;
}
.ct-back:hover {
  color: var(--sh-heading);
}
.ct-back:focus-visible {
  outline: 2px solid var(--sh-focus);
  outline-offset: 3px;
  border-radius: 4px;
}
.ct-page-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.ct-eyebrow {
  margin: 0 0 6px;
  color: var(--sh-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.35px;
  text-transform: uppercase;
}
.ct-page-title h1 {
  margin: 0;
  color: var(--sh-heading);
  font-size: 24px;
  font-weight: 650;
  line-height: 1.25;
}
.ct-page-sub {
  margin: 6px 0 0;
  color: var(--sh-muted);
  font-size: 14px;
}
.ct-page-tools {
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
}
.ct-step-count {
  color: var(--sh-muted);
  font-size: 13px;
}

/* ---- the Checklist card (a switch on top of the task type) ---- */
.ct-tile-check {
  border-radius: 4px;
}
.ct-tile.is-selected .ct-tile-check {
  border: 1px solid var(--sh-control);
  background: var(--sh-control);
  box-shadow: inset 0 0 0 2px #fff;
}

/* ---- checklist / SOP step editor (design-preview: Checklist / SOP steps) ---- */
.sf {
  display: grid;
  gap: 16px;
}
.sf-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.sf-head h3,
.sf-rules h3 {
  margin: 0;
  color: var(--sh-heading);
  font-size: 16px;
  font-weight: 650;
}
.sf-head span {
  color: var(--sh-muted);
  font-size: 13px;
}
.sf-list {
  display: grid;
  gap: 12px;
}
.sf-item {
  border-top: 2px solid transparent;
  border-radius: 8px;
  transition: opacity 0.15s ease;
}
.sf-item.is-over {
  border-top-color: var(--sh-accent);
}
.sf-item.is-dragging {
  opacity: 0.4;
}
.sf-card {
  border: 1px solid var(--sh-border);
  border-radius: 8px;
  background: var(--sh-surface);
}
.sf-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px 8px 0 0;
  background: var(--sh-surface-alt);
}
.sf-grip {
  display: inline-flex;
  color: var(--sh-muted);
  cursor: grab;
}
.sf-grip:active {
  cursor: grabbing;
}
.sf-num {
  min-width: 14px;
  color: var(--sh-muted);
  font-size: 13px;
  text-align: center;
}
.sf-title-btn {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: baseline;
  gap: 8px;
  padding: 0;
  color: var(--sh-heading);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.sf-title-btn span {
  overflow: hidden;
  color: var(--sh-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sf-title-btn:focus-visible,
.ct-icon-btn:focus-visible {
  outline: 2px solid var(--sh-focus);
  outline-offset: 2px;
  border-radius: 4px;
}
.sf-actions {
  display: flex;
  gap: 2px;
}
.ct-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--sh-muted);
  cursor: pointer;
}
.ct-icon-btn:hover:not(:disabled) {
  background: var(--sh-hover);
  color: var(--sh-heading);
}
.ct-icon-btn.is-danger:hover:not(:disabled) {
  background: color-mix(in srgb, var(--color-error) 12%, transparent);
  color: var(--color-error);
}
.ct-icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.sf-card-body {
  display: grid;
  gap: 16px;
  padding: 16px;
}
.sf-two {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.sf-hint {
  margin: 0;
  color: var(--sh-muted);
  font-size: 12px;
}
.sf-checks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
}
.sf-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 40px;
  border: 1px dashed var(--sh-border);
  border-radius: 8px;
  color: var(--sh-heading);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
}
.sf-add:hover {
  background: var(--sh-hover);
}
.sf-add:focus-visible {
  outline: 2px solid var(--sh-focus);
  outline-offset: 2px;
}
.sf-rules {
  display: grid;
  gap: 0;
  padding-top: 8px;
}
.sf-rules h3 {
  margin-bottom: 4px;
}
.sf-rules .ct-switch-row {
  padding: 14px 0;
}
