/* Status strip and duplicate review. Tokens follow the main desk (light and dark). */

.status-overview {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 8px 16px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.status-overview-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto;
  box-sizing: border-box;
  min-height: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.status-overview-count {
  font-weight: 600;
  color: var(--text);
}

.status-overview-btn.is-on {
  background: var(--accent-fill);
  color: var(--bg);
  border-color: var(--accent-fill);
}

.status-overview-btn.is-on .status-overview-count {
  color: inherit;
}

.status-overview-btn:focus-visible,
#dupReviewOverlay .action-btn:focus-visible,
#dupReviewOverlay .overlay-close:focus-visible,
#dupReviewOverlay .dup-review-choice:focus-within {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

body.dark-mode .status-overview {
  background: var(--bg);
  color: var(--text);
  border-bottom-color: var(--border);
}

body.dark-mode .status-overview-btn {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

body.dark-mode .status-overview-count {
  color: var(--text);
}

body.dark-mode .status-overview-btn.is-on {
  background: var(--accent-fill);
  color: #111;
  border-color: var(--accent-fill);
}

@media (max-width: 480px) {
  .status-overview {
    padding: 8px;
    gap: 8px;
  }
  .status-overview-btn {
    min-height: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0 10px;
  }
}

.dup-review-note,
.dup-review-msg {
  margin: 0 0 12px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.4;
}

.dup-review-msg.is-error {
  color: var(--badge-danger-text, #7f1d1d);
}

.dup-review-group {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  background: var(--card-bg);
  color: var(--text);
}

.dup-review-why {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
}

.dup-review-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dup-review-card {
  flex: 1 1 200px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: var(--bg);
  color: var(--text);
}

.dup-review-card p {
  margin: 0 0 4px;
  font-size: 13px;
  word-break: break-word;
}

.dup-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

#dupReviewOverlay .overlay-close,
#dupReviewOverlay .action-btn,
#dupReviewOverlay .dup-review-choice {
  box-sizing: border-box;
  min-height: 44px;
  min-width: 44px;
}

#dupReviewOverlay .overlay-close {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.dup-review-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  margin: 4px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}

.dup-review-confirm {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: 12px 0;
  color: var(--text);
  font-size: 14px;
}

.dup-review-field {
  margin: 8px 0;
  padding: 0;
  border: 0;
}

.dup-review-field legend,
.dup-review-field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

body.dark-mode #dupReviewOverlay .dup-review-group,
body.dark-mode #dupReviewOverlay .dup-review-card,
body.dark-mode #dupReviewOverlay .dup-review-choice {
  background: var(--card-bg);
  color: var(--text);
  border-color: var(--border);
}

body.dark-mode .dup-review-msg.is-error {
  color: var(--badge-danger-text, #fecaca);
}

@media (max-width: 480px) {
  #dupReviewOverlay .overlay-content {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    height: auto;
    max-height: calc(100dvh - 16px);
  }
  .dup-review-cards {
    flex-direction: column;
  }
  #dupReviewOverlay .action-btn,
  #dupReviewOverlay .dup-review-choice,
  #dupReviewOverlay .overlay-close {
    min-height: 44px;
    min-width: 44px;
  }
}

/* Logout stays a 44px target at every width, including the desktop bar. */
.header .header-user-logout {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  position: relative;
  z-index: 2;
}

/* em follows text size, so Firefox 2x text wraps the bar on a much wider window. */
.header {
  container-type: inline-size;
  container-name: imcd-header;
  font-size: 1rem;
}

.header .header-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  height: auto;
  min-height: 44px;
  row-gap: 4px;
}

.header .header-top > div:first-child {
  display: block;
  flex: 1 1 auto;
  min-width: min(100%, max-content);
  max-width: 100%;
  overflow: hidden;
  white-space: normal;
}

.header .header-top .header-brand,
.header .header-top .header-subtitle {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header .header-top .header-user,
.header .header-top .header-overflow {
  flex: 0 0 auto;
  position: static;
  max-width: 100%;
}

.header .header-top .header-user {
  flex-wrap: wrap;
  justify-content: flex-end;
}

@container imcd-header (max-width: 44em) {
  .header .header-top > div:first-child {
    flex-basis: 100%;
  }
}

/* The header scrolls away with the strip and controls. desk1564.js adds this
   when the stack is taller than about 40% of the screen, including at 500px
   and just above, so a full contact fits above the bottom nav. */
.sticky-top.sticky-top-static {
  position: static;
}
