/* Final UX fixes layered after ui.css. */

.stats {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.stat.stat-nav {
  cursor: pointer;
  user-select: none;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.stat.stat-nav:hover {
  border-color: #3b506e;
  background: #111a28;
}
.stat.stat-nav:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.stat.stat-nav.is-active {
  border-color: #4a6c9d;
  background: linear-gradient(180deg, #152236, #101a2a);
  box-shadow: inset 0 0 0 1px rgba(141, 180, 255, .28), 0 4px 14px rgba(0, 0, 0, .2);
}
.stat.stat-nav.is-active::before {
  opacity: 1;
  width: 3px;
}

.filter-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}
.field,
.field select,
.field input {
  min-width: 0;
}
.field select {
  text-overflow: clip;
}

.control-label-row {
  align-items: flex-start;
}
.local-state-note {
  margin: 12px 2px 0;
  font-size: .76rem;
}

.job-card::before {
  display: none !important;
}
.job-card {
  align-items: stretch;
}
.job-heading {
  align-items: flex-start;
}
.badge {
  white-space: normal;
  line-height: 1.25;
  text-align: right;
  justify-content: flex-end;
  max-width: 260px;
}
.location.multi-location {
  cursor: help;
}

.link-quality.direct,
.link-quality.listing,
.link-quality.source {
  background: #111b27;
  color: #aebfd4;
  border-color: #22344b;
}

.job-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(74px, 1fr));
  grid-template-rows: auto auto;
  gap: 7px;
  min-width: 300px;
  align-content: center;
}
.job-actions .save-btn { grid-column: 1; grid-row: 1; }
.job-actions .applied-btn { grid-column: 2; grid-row: 1; }
.job-actions .hide-btn { grid-column: 3; grid-row: 1; }
.job-actions .apply-btn {
  grid-column: 1 / -1;
  grid-row: 2;
  min-height: 38px;
}
.job-actions .hide-btn {
  position: static !important;
  inset: auto !important;
  opacity: 1 !important;
  width: auto !important;
  min-height: 35px;
  color: #93a0b1;
}

.results-tools {
  flex-wrap: wrap;
}
.hidden-toggle {
  height: 36px;
  white-space: nowrap;
}
.hidden-toggle.active {
  background: #1d2d46;
  border-color: #3c5b87;
  color: #e6efff;
}
.hidden-toggle:disabled {
  cursor: default;
  opacity: .48;
}

.ux-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 1000;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: min(92vw, 520px);
  border: 1px solid #35445a;
  border-radius: 12px;
  background: #151e2b;
  color: #e7edf6;
  padding: 11px 13px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .35);
  font-size: .86rem;
}
.ux-toast button {
  border: 0;
  background: transparent;
  color: #b9ceff;
  font-weight: 800;
  cursor: pointer;
  padding: 3px;
}

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .filter-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
  .job-actions {
    width: 100%;
    min-width: 0;
    max-width: none;
    padding-right: 0;
  }
  .job-actions .apply-btn { margin-left: 0; }
  .badge {
    text-align: left;
    justify-content: flex-start;
    max-width: none;
  }
}

@media (max-width: 620px) {
  .filter-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .job-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .job-actions .hide-btn {
    position: static !important;
    width: auto !important;
  }
  .results-tools {
    width: 100%;
    justify-content: stretch;
  }
  .sort-field { min-width: 0; }
  .hidden-toggle { flex: 1; }
  .ux-toast {
    bottom: 14px;
    width: calc(100% - 24px);
  }
}