/* Screen-specific rules. Tokens only (var(--...)); no raw colours, gradients, shadows outside tokens, animation or uppercase. */

/* Row checkbox: the whole label is a 44px touch target, without making the row taller. */
.list-row-title-wrap .check-box-target {
  min-width: 44px;
  justify-content: center;
  margin-block: calc(var(--sp-2) * -1);
  margin-inline-start: calc(var(--sp-3) * -1);
}

/* Old list stays visible but dimmed while a new one loads. */
.is-stale {
  opacity: 0.5;
}

/* Radio and checkbox groups built as fieldsets. */
.radio-group {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

/* Job description built from headings, paragraphs and bullet lists. */
.jd-list {
  margin: 0;
  padding-inline-start: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

/* Small resume page image next to its details. */
.resume-summary {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
}

.resume-thumb {
  width: 96px;
  flex: none;
  aspect-ratio: 210 / 297;
  object-fit: contain;
  border: 1px solid var(--rule);
  border-radius: var(--r-0);
  background: var(--page);
  display: block;
}

/* Quick choice buttons (follow-up reminder). */
.quick-btn[aria-pressed="true"] {
  background: var(--navy-wash);
  border-color: var(--navy);
  color: var(--navy);
  font-weight: 600;
}

/* Per-row actions menu on the apply queue. */
.row-menu-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.action-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.action-list .btn {
  width: 100%;
  min-height: 44px;
  justify-content: flex-start;
  text-align: left;
}

/* Cover letter buttons wrap on narrow screens. */
.cover-letter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

/* Links that are tapped on phones: at least 44px tall. */
.touch-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* Confirmation with Undo (and Why?) after Shortlist or Not for me. It sits above the toast. */
.undo-bar {
  position: fixed;
  left: 50%;
  bottom: calc(var(--sp-6) + var(--sp-12));
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-3);
  max-width: calc(100vw - var(--sp-8));
  background: var(--ink);
  color: var(--page);
  padding: var(--sp-1) var(--sp-3) var(--sp-1) var(--sp-4);
  border-radius: var(--r-ctl);
  font-size: var(--t-meta-size);
  line-height: var(--t-meta-line);
  z-index: 45;
}

.undo-bar .undo-bar-btn,
.undo-bar .undo-bar-btn:hover:not(:disabled) {
  color: var(--page);
  font-weight: 600;
}

.undo-bar .undo-bar-btn:hover:not(:disabled) {
  background: var(--ink-2);
}

.undo-bar .undo-bar-link {
  text-decoration: underline;
  font-weight: 400;
}

.undo-bar :focus-visible {
  outline-color: var(--page);
}

/* Sheets: the row with the main buttons stays in view while the sheet scrolls
   (Previous and Next design, Save version, Cancel and Save). */
.sheet > .stack-md > .row-between:last-child,
.sheet > .stack-md > form > .row-between:last-child {
  position: sticky;
  bottom: 0;
  z-index: 1;
  margin-inline: calc(var(--sp-6) * -1);
  margin-bottom: calc(var(--sp-6) * -1);
  padding: var(--sp-3) var(--sp-6);
  background: var(--page);
  border-top: 1px solid var(--rule);
}

/* Phone: the job page keeps Shortlist, Apply and Not for me in a bar above the bottom navigation. */
@media (max-width: 899px) {
  .job-action-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--sp-12) + 1px);
    z-index: 32;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-4);
    background: var(--page);
    border-top: 1px solid var(--rule);
  }

  .job-action-bar .btn {
    width: 100%;
    min-width: 0;
    padding: 0 var(--sp-2);
    text-align: center;
  }

  .main-content.has-action-bar {
    padding-bottom: calc(var(--sp-16) + var(--sp-16));
  }

  body:has(.job-action-bar) .toast {
    bottom: calc(var(--sp-16) + var(--sp-16));
  }

  body:has(.job-action-bar) .undo-bar {
    bottom: calc(var(--sp-16) + var(--sp-16) + var(--sp-12));
  }

  .undo-bar {
    bottom: calc(var(--sp-16) + var(--sp-12));
  }

  /* The onboarding "Back" link is as tall as a button too. */
  .step-header-inner a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}
