/* Job Autopilot V7.2: Suggested Roles (CMP-31, CMP-25) & Apply Queue / Pack (CMP-32) */
/* Tokens only (var(--...)); single reduced-motion-safe v7-pulse animation on .v7-live-dot. */

.v7-opportunities-page,
.v7-role-detail,
.v7-apply-page,
.v7-pack-page {
  min-width: 0;
  padding-bottom: var(--sp-16);
}

.v7-muted {
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 18px;
}

.v7-kicker {
  display: inline-block;
  color: var(--ink-3);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
}

.v7-sep {
  display: inline-block;
  width: 3px;
  height: 3px;
  flex: 0 0 3px;
  border-radius: calc(var(--r-box) * 99);
  background: var(--ink-3);
  vertical-align: middle;
}

.v7-panel {
  border: 1px solid var(--rule);
  border-radius: calc(var(--r-box) + 4px);
  padding: var(--sp-4);
  background: var(--page);
  min-width: 0;
}

/* Inline status / Undo banner on Roles and Apply */
.v7-undo-bar,
.v7-queue-feedback {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-3);
  padding: 10px 14px;
  border: 1px solid var(--rule);
  border-radius: calc(var(--r-box) + 2px);
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 19px;
}

.v7-queue-feedback {
  border-color: var(--good);
  background: var(--good-wash);
}

.v7-undo-bar-copy {
  color: var(--ink-2);
  font-size: 13px;
  line-height: 19px;
}

.v7-undo-bar-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
  flex: 0 0 auto;
}

/* Roles Single-Line Toolbar (CMP-31) */
.v7-feed-tools {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto auto auto;
  align-items: center;
  gap: var(--sp-2);
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: calc(var(--r-box) + 4px);
  background: var(--page);
  min-width: 0;
}

.v7-search {
  display: block;
  min-width: 0;
}

.v7-search .input {
  width: 100%;
  min-height: 40px;
  font-size: 13px;
  line-height: 19px;
}

.v7-feed-tools .btn {
  min-height: 40px;
  white-space: nowrap;
  font-size: 13px;
  padding: 0 var(--sp-3);
}

.v7-bulk-apply-btn {
  white-space: nowrap;
}

.v7-opportunity-counts {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.v7-stat-pill {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--rule);
  border-radius: var(--r-box);
  background: var(--wash);
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 16px;
  white-space: nowrap;
}

.v7-stat-pill strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.v7-stat-pill.is-link {
  cursor: pointer;
  background: var(--navy-wash);
  border-color: var(--rule);
  color: var(--navy);
  transition: border-color var(--t-ctl) ease, background-color var(--t-ctl) ease;
}

.v7-stat-pill.is-link strong {
  color: var(--navy);
}

.v7-stat-pill.is-link:hover,
.v7-stat-pill.is-link:focus-visible {
  border-color: var(--navy);
}

/* Collapsible Filter Panel (JOB-01e) */
.v7-filter-panel {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr)) auto;
  align-items: end;
  gap: var(--sp-2);
  padding: 12px;
  border: 1px solid var(--rule);
  border-radius: calc(var(--r-box) + 2px);
  background: var(--page);
}

.v7-filter-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.v7-filter-field label {
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
}

.v7-filter-panel .select {
  width: 100%;
  min-height: 38px;
  padding: 6px var(--sp-2);
  font-size: 12px;
  line-height: 18px;
}

.v7-filter-panel .btn {
  min-height: 38px;
  white-space: nowrap;
}

/* Roles Card Grid & Cards (CMP-31, CMP-25) */
.v7-role-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 13px;
}

.v7-role-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--rule);
  border-radius: calc(var(--r-box) + 4px);
  background: var(--page);
  transition: border-color var(--t-ctl) ease;
}

.v7-role-card:hover {
  border-color: var(--field-border);
}

.v7-role-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: 10px;
}

.v7-role-type,
.v7-match-score {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 9px;
  border-radius: calc(var(--r-box) * 99);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
}

.v7-role-type {
  color: var(--ink-2);
  background: var(--wash);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v7-match-score {
  color: var(--good);
  background: var(--good-wash);
  white-space: nowrap;
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}

.v7-match-score.is-good {
  color: var(--navy);
  background: var(--navy-wash);
}

.v7-match-score.is-possible {
  color: var(--caution);
  background: var(--caution-wash);
}

.v7-role-title {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 21px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.v7-role-title:hover,
.v7-role-title:focus-visible {
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.v7-role-company {
  margin-top: 2px;
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 19px;
  font-weight: 500;
}

.v7-role-meta-line {
  margin-top: 4px;
  color: var(--ink-3);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 17px;
}

.v7-role-sponsor {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-top: 10px;
  padding-top: var(--sp-2);
  border-top: 1px solid var(--rule);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 17px;
}

.v7-role-sponsor span {
  color: var(--ink-3);
  flex: 0 0 auto;
}

.v7-role-sponsor strong {
  color: var(--ink-2);
  text-align: right;
  font-weight: 500;
}

.v7-role-reasons {
  display: grid;
  gap: 5px;
  margin: 10px 0 12px;
  padding-left: 16px;
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 18px;
}

.v7-role-reasons li.warn {
  color: var(--caution);
}

.v7-role-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: var(--sp-2);
}

.v7-role-card-actions .btn {
  font-family: var(--font-sans);
  font-size: 12.5px;
  min-height: 38px;
  padding: 0 12px;
}

.v7-role-card-actions .btn-primary {
  flex: 1 1 115px;
}

/* Empty Panel (JOB-01d, APP-01 empty) */
.v7-empty-panel {
  display: grid;
  justify-items: start;
  gap: var(--sp-2);
  padding: var(--sp-6);
  border: 1px dashed var(--field-border);
  border-radius: calc(var(--r-box) + 4px);
  background: var(--page);
}

.v7-empty-panel h2 {
  margin: 0;
  font-size: var(--t-title-size);
  line-height: var(--t-title-line);
  color: var(--ink);
}

.v7-empty-panel p {
  margin: 0;
  max-width: 62ch;
  color: var(--ink-2);
  font-size: var(--t-meta-size);
  line-height: var(--t-meta-line);
}

/* Role Detail (JOB-02, JOB-02a) */
.v7-detail-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: 2px 0 var(--sp-2);
}

.v7-detail-role-heading {
  margin: 4px 0;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 24px;
  line-height: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.v7-detail-subline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px var(--sp-2);
  color: var(--ink-2);
  font-size: 13px;
  line-height: 19px;
}

.v7-detail-score {
  display: grid;
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  place-items: center;
  border: 1px solid var(--good);
  border-radius: calc(var(--r-box) * 99);
  color: var(--good);
  background: var(--good-wash);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.v7-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
  align-items: start;
  gap: 14px;
}

.v7-detail-grid > .v7-panel {
  padding: 18px;
}

.v7-detail-reasons {
  display: grid;
  gap: 6px;
  margin: var(--sp-2) 0 var(--sp-3);
  padding-left: 18px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 19px;
}

.v7-detail-reasons li.warn {
  color: var(--caution);
}

.v7-detail-rule {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 9px 0;
  border-top: 1px solid var(--rule);
  font-size: 12px;
  line-height: 17px;
}

.v7-detail-rule span {
  color: var(--ink-3);
}

.v7-detail-rule strong {
  color: var(--ink);
  text-align: right;
  font-weight: 500;
}

.v7-detail-actions {
  display: grid;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}

.v7-detail-actions .btn {
  width: 100%;
  min-height: 44px;
}

.v7-detail-process-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--r-box);
  background: var(--navy-wash);
  color: var(--navy);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
}

.v7-detail-process-pill.is-ready {
  background: var(--good-wash);
  color: var(--good);
}

.v7-skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.v7-skill-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: calc(var(--r-box) * 99);
  font-size: 12px;
  line-height: 17px;
  font-weight: 500;
  background: var(--good-wash);
  color: var(--good);
}

.v7-skill-tag.is-missing {
  background: var(--caution-wash);
  color: var(--caution);
}

/* Apply Queue Toolbar & Full-Width Horizontal Rows (CMP-32) */
.v7-queue-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 10px 14px;
  border: 1px solid var(--rule);
  border-radius: calc(var(--r-box) + 4px);
  background: var(--page);
}

.v7-queue-toolbar.is-active {
  border-color: var(--navy);
  background: var(--navy-wash);
}

.v7-queue-toolbar-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 19px;
  color: var(--ink);
}

.v7-queue-toolbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.v7-queue-list.v7-queue-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.v7-queue-card.v7-queue-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  border-radius: calc(var(--r-box) + 4px);
  background: var(--page);
}

.v7-queue-card.v7-queue-row.is-in-process {
  border-color: var(--navy);
}

.v7-queue-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.v7-queue-row-main {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}

.v7-queue-row-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
}

.v7-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 2px 9px;
  border-radius: calc(var(--r-box) * 99);
  color: var(--ink-2);
  background: var(--wash);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  white-space: nowrap;
}

.v7-status-badge.ready {
  color: var(--good);
  background: var(--good-wash);
}

.v7-status-badge.preparing,
.v7-status-badge.queued {
  color: var(--navy);
  background: var(--navy-wash);
}

.v7-status-badge.needs-look {
  color: var(--caution);
  background: var(--caution-wash);
}

.v7-queue-version {
  font-size: 12px;
  line-height: 17px;
  color: var(--ink-2);
  font-weight: 500;
}

.v7-queue-loc {
  font-size: 12px;
  line-height: 17px;
  color: var(--ink-3);
}

.v7-queue-title-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.v7-queue-title-btn {
  padding: 0;
  border: 0;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 21px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-decoration: none;
  text-align: left;
  cursor: pointer;
}

.v7-queue-title-btn:hover,
.v7-queue-title-btn:focus-visible {
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.v7-queue-company {
  font-size: 13px;
  line-height: 19px;
  color: var(--ink-2);
  font-weight: 500;
}

.v7-queue-subline {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 18px;
  color: var(--ink-3);
}

.v7-attention-line {
  margin: 4px 0 0;
  padding: 6px 10px;
  border-radius: var(--r-box);
  color: var(--caution);
  background: var(--caution-wash);
  font-size: 12px;
  line-height: 18px;
}

.v7-queue-row-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
  flex: 0 0 auto;
}

.v7-queue-eta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 10px;
  border-radius: calc(var(--r-box) * 99);
  background: var(--wash);
  color: var(--ink-2);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.v7-queue-confirm {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--caution);
  border-radius: calc(var(--r-box) + 2px);
  background: var(--caution-wash);
  font-size: 13px;
  line-height: 19px;
  color: var(--ink);
}

/* Live In-Process Dot & Progress Bar (CMP-32: single permitted v7-pulse animation, reduced-motion safe) */
.v7-live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: calc(var(--r-box) * 99);
  background: var(--navy);
  vertical-align: middle;
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes v7-pulse {
    0%, 100% {
      opacity: 1;
      transform: scale(1);
    }
    50% {
      opacity: 0.45;
      transform: scale(0.82);
    }
  }

  .v7-live-dot {
    animation: v7-pulse 1.3s ease-in-out infinite;
  }
}

.v7-card-progress {
  display: grid;
  gap: 6px;
  margin: 4px 0 2px;
}

.v7-card-progress-copy {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 17px;
  font-weight: 500;
  color: var(--navy);
}

.v7-gen-progress {
  height: 5px;
  width: 100%;
  border-radius: calc(var(--r-box) * 99);
  background: var(--navy-wash);
  overflow: hidden;
}

.v7-gen-progress-fill {
  display: block;
  height: 100%;
  border-radius: calc(var(--r-box) * 99);
  background: var(--navy);
  transition: width var(--t-sheet) ease;
}

/* Pack Auto-Prep Banner & Layout (APP-02, APP-02a) */
.v7-gen-banner {
  display: grid;
  gap: var(--sp-2);
  padding: 12px 14px;
  border: 1px solid var(--navy);
  border-radius: calc(var(--r-box) + 4px);
  background: var(--navy-wash);
}

.v7-gen-banner-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--navy);
  font-size: 13px;
  line-height: 19px;
}

.v7-pack-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

.v7-pack-section {
  border: 1px solid var(--rule);
  border-radius: calc(var(--r-box) + 4px);
  padding: var(--sp-4);
  background: var(--page);
}

.v7-pack-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.v7-pack-section-head h2 {
  margin: 0;
}

.v7-pack-details summary {
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: var(--t-title-size);
  line-height: var(--t-title-line);
  font-weight: 600;
  color: var(--ink);
  min-height: 44px;
  display: flex;
  align-items: center;
}

.v7-pack-details[open] summary {
  margin-bottom: var(--sp-3);
}

/* Responsive Breakpoints */
@media (max-width: 1180px) {
  .v7-feed-tools {
    grid-template-columns: minmax(180px, 1fr) auto auto;
  }

  .v7-opportunity-counts {
    grid-column: 1 / -1;
    order: 4;
  }

  .v7-role-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .v7-filter-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 899px) {
  .v7-feed-tools {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-2);
  }

  .v7-feed-tools .v7-search,
  .v7-feed-tools .v7-opportunity-counts,
  .v7-feed-tools .v7-bulk-apply-btn {
    grid-column: 1 / -1;
  }

  .v7-opportunity-counts {
    order: 0;
    flex-wrap: wrap;
  }

  .v7-feed-tools .btn,
  .v7-stat-pill,
  .v7-role-card-actions .btn,
  .v7-queue-row-actions .btn,
  .v7-queue-confirm .btn,
  .v7-undo-bar .btn {
    min-height: 44px;
  }

  .v7-role-title,
  .v7-queue-title-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .v7-role-grid,
  .v7-detail-grid,
  .v7-filter-panel {
    grid-template-columns: 1fr;
  }

  .v7-queue-row-top {
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-3);
  }

  .v7-queue-row-actions {
    justify-content: flex-start;
  }

  .v7-detail-title {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Apply queue: what goes to an AI service, notes said once, and "Show more" under a long list */
.v7-ai-note {
  margin: 0;
  padding: 8px 12px;
  border-left: 3px solid var(--rule);
  color: var(--ink-3);
  font-size: 13px;
  line-height: 19px;
}

.v7-queue-shared-notes {
  display: grid;
  gap: var(--sp-2);
}

.v7-queue-shared-notes:empty {
  display: none;
}

.v7-queue-shared-note {
  margin: 0;
  padding: 8px 12px;
  border-radius: var(--r-box);
  background: var(--caution-wash);
  color: var(--caution);
  font-size: 13px;
  line-height: 19px;
}

.v7-queue-pager {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-3);
  padding-top: var(--sp-2);
}

.v7-queue-pager .btn {
  min-height: 44px;
}

/* Referral hold & share-ready kit (JA-035) */
.v7-referral-marker {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: calc(var(--r-box) * 99);
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  white-space: nowrap;
}

.v7-referral-marker.is-secured {
  background: var(--good-wash);
  color: var(--good);
}

.v7-referral-marker.is-ended {
  background: var(--caution-wash);
  color: var(--caution);
}

.v7-referral-copy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--r-box);
  background: var(--wash);
}

.v7-referral-copy-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.v7-referral-preview {
  max-height: 360px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  border: 1px solid var(--rule);
  border-radius: var(--r-box);
}

.v7-referral-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
}

.v7-referral-drawer-footer {
  flex-wrap: wrap;
  gap: var(--sp-2);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--rule);
}

@media (max-width: 720px) {
  .v7-referral-copy-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .v7-referral-actions .btn,
  .v7-referral-window-group .btn {
    min-height: 40px;
  }
}
