html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  min-width: 0;
}

.app,
.topbar,
.topbar__inner,
.view,
.portal,
.portal__main {
  max-width: 100%;
}

.topbar__inner {
  width: 100%;
  min-width: 0;
  gap: 12px;
}

.topbar .brand {
  flex: 0 0 auto;
}

.nav {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav__item {
  flex: 0 0 auto;
}

.topbar__spacer {
  display: none;
}

.top-search {
  flex: 0 1 360px;
  min-width: 220px;
  max-width: 360px;
}

.view {
  min-width: 0;
}

.grid-2,
.grid-3,
.kpis,
.jobs,
.info-grid,
.what-grid,
.score-grid {
  min-width: 0;
}

.card,
.kpi,
.job,
.info,
.modal,
.candidate-hero,
.applyform,
.apply-jobsum,
.jobcard {
  min-width: 0;
}

.table-wrap {
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.tbl {
  min-width: 760px;
}

.tbl .row-actions {
  opacity: 1;
}

.kanban {
  max-width: 100%;
  grid-template-columns: repeat(6, minmax(210px, 1fr));
  overscroll-behavior-x: contain;
}

.kcol {
  min-width: 0;
}

.kcol.is-drag-over {
  border-color: color-mix(in oklch, var(--purple) 70%, var(--border));
  box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--purple) 55%, transparent);
}

.kcard.is-dragging {
  opacity: .55;
  transform: scale(.985);
}

.kcard,
.job,
.jobcard,
.iv-card,
.js-row,
.js-talent {
  touch-action: manipulation;
}

.iv-card {
  cursor: pointer;
  transition: transform .12s ease, border-color .15s ease, background .15s ease;
}

.iv-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in oklch, var(--purple) 42%, var(--border));
  background: color-mix(in oklch, var(--purple) 5%, var(--surface-2));
}

.modal-root {
  overflow-y: auto;
}

.modal {
  max-width: min(780px, calc(100vw - 24px));
}

.modal--md {
  max-width: min(560px, calc(100vw - 24px));
}

.modal__foot {
  flex-wrap: wrap;
}

.candidate-hero {
  flex-wrap: wrap;
}

.candidate-hero .score-big {
  margin-left: 0;
}

.wehire-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.wehire-global-results {
  position: fixed;
  top: 58px;
  right: 156px;
  width: min(520px, calc(100vw - 32px));
  max-height: min(520px, calc(100vh - 96px));
  overflow-y: auto;
  z-index: 120;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-2);
  display: none;
}

.wehire-global-results.is-open {
  display: block;
}

.wehire-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.wehire-result:last-child {
  border-bottom: 0;
}

.wehire-result:hover {
  background: var(--surface-2);
}

.wehire-result__main {
  min-width: 0;
  flex: 1;
}

.wehire-result__title {
  font-weight: 600;
  font-size: 13px;
}

.wehire-result__sub {
  color: var(--text-3);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wehire-result__type {
  flex: 0 0 auto;
}

@media (max-width: 1240px) {
  .topbar__inner {
    flex-wrap: wrap;
  }

  .topbar .brand {
    order: 1;
  }

  .top-search {
    order: 2;
    flex: 1 1 280px;
    max-width: none;
  }

  .topbar__inner > .icon-btn,
  .topbar__inner > .avatar {
    order: 3;
  }

  .nav {
    order: 4;
    flex-basis: 100%;
    margin-left: 0;
    padding-bottom: 2px;
  }

  .wehire-global-results {
    top: 106px;
    right: 16px;
  }
}

@media (max-width: 900px) {
  .topbar__inner {
    padding: 10px 14px;
    gap: 8px;
  }

  .brand__mark {
    width: 34px;
    height: 34px;
  }

  .topbar .brand__name {
    display: none;
  }

  .top-search {
    display: flex;
    min-width: 0;
    flex-basis: calc(100% - 180px);
    padding: 7px 10px;
  }

  .top-search kbd {
    display: none;
  }

  .icon-btn,
  .avatar {
    width: 34px;
    height: 34px;
  }

  .nav__item span {
    display: none;
  }

  .nav__item {
    padding: 9px 11px;
  }

  .view {
    padding: 18px 14px 48px;
  }

  .page-head {
    align-items: flex-start;
  }

  .page-head__actions,
  .filters {
    width: 100%;
  }

  .page-head__actions > *,
  .filters > .search-mini {
    flex: 1 1 160px;
  }

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

  .grid-2,
  .grid-3,
  .jobs,
  .info-grid,
  .wehire-edit-grid {
    grid-template-columns: 1fr;
  }

  .kanban {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .kcol {
    flex: 0 0 min(82vw, 330px);
    min-height: 420px;
  }

  .modal-root {
    padding: 12px;
    align-items: flex-start;
  }

  .modal {
    max-height: calc(100vh - 24px);
  }
}

@media (max-width: 560px) {
  .top-search {
    order: 4;
    flex-basis: 100%;
  }

  .nav {
    order: 5;
  }

  .kpis {
    grid-template-columns: 1fr;
  }

  .card__head,
  .modal__head,
  .modal__body,
  .modal__foot {
    padding-left: 14px;
    padding-right: 14px;
  }

  .candidate-hero {
    align-items: flex-start;
  }

  .candidate-hero .avatar--lg {
    width: 42px;
    height: 42px;
  }

  .tabs {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tabs__btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .tbl {
    min-width: 680px;
  }

  .toast {
    left: 12px;
    right: 12px;
    bottom: 14px;
  }
}
