/* Career world modal. Mirrors the finder sheet's mechanics so both
   dialogs behave identically, but wears the page's white/hairline skin. */
.world-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.world-backdrop {
  position: absolute;
  inset: 0;
  background: #061c4372;
  opacity: 0;
  transition: opacity .2s ease;
}
.world-modal.is-open .world-backdrop { opacity: 1; }
.world-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1080px, 100%);
  max-height: 92dvh;
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 30px 70px -30px #061c4370;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .2s ease, transform .2s ease;
}
.world-modal.is-open .world-dialog { opacity: 1; transform: none; }

.world-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
  border-top: 4px solid var(--brand-red);
  background: var(--white);
  flex: none;
}
.world-modal-index {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  color: var(--brand-blue);
  margin-bottom: 7px;
}
.world-dialog-head #world-modal-title {
  font-size: clamp(22px, 2.4vw, 31px);
  line-height: 1.15;
  letter-spacing: -.035em;
  font-weight: 800;
  color: var(--brand-navy);
  margin: 0;
}
.world-head-note {
  display: block;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  margin-top: 8px;
  max-width: 62ch;
}
.world-close {
  width: 42px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--brand-blue);
  cursor: pointer;
}
.world-close:hover { background: var(--brand-blue); color: #fff; border-color: var(--brand-blue); }
.world-close .icon { width: 20px; height: 20px; }

.world-dialog-body {
  padding: 22px 28px 26px;
  overflow: auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-gutter: stable;
  touch-action: pan-y;
  overscroll-behavior: contain;
}
/* The card body moves in wholesale, so reset the in-page indents. */
.world-dialog-body .career-description { display: none; } /* shown in the head */
.world-dialog-body .career-setting { margin-left: 0; font-size: 13px; margin-bottom: 4px; }
.world-dialog-body .role-profile { margin: 16px 0 20px; border-radius: 10px; }
.world-dialog-body .career-levels { margin-top: 0; }

/* Nothing inside may force the dialog wider than the screen. */
.world-dialog, .world-dialog-body { max-width: 100%; min-width: 0; }
.world-dialog-body > * { min-width: 0; }
.world-dialog-body .role-profile { min-width: 0; }
.world-dialog-body .role-profile > * { min-width: 0; }

.world-dialog-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 13px 28px;
  border-top: 1px solid var(--line);
  background: #fff;
  flex: none;
}
.world-nav-button {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: min(100%, 300px);
  padding: 7px 0;
  border: 0;
  background: transparent;
  color: var(--brand-navy);
  text-align: left;
}
.world-nav-button--next { justify-self: end; justify-content: flex-end; text-align: right; }
.world-nav-button--prev .icon { transform: rotate(180deg); }
.world-nav-button .icon {
  width: 30px;
  height: 30px;
  padding: 7px;
  border-radius: 50%;
  background: #edf4fd;
  color: var(--brand-blue);
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.world-nav-button--prev:hover .icon { transform: rotate(180deg) translateX(3px); }
.world-nav-button--next:hover .icon { transform: translateX(3px); }
.world-nav-button:hover .icon { background: var(--brand-blue); color: #fff; }
.world-nav-button span { display: grid; min-width: 0; }
.world-nav-button small {
  color: var(--brand-blue);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.world-nav-button strong {
  overflow: hidden;
  color: var(--brand-navy);
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.world-nav-status { display: grid; justify-items: center; min-width: 128px; }
.world-position { color: var(--brand-navy); font-size: 11px; letter-spacing: .12em; }
.world-nav-hint { margin-top: 2px; color: var(--muted); font-size: 9px; white-space: nowrap; }
.world-nav-hint--touch { display: none; }

@media (max-width: 900px) {
  .world-modal { padding: 0; align-items: flex-end; }
  .world-dialog { max-height: 94dvh; width: 100%; border-radius: 16px 16px 0 0; }
  .world-dialog-head { padding: 16px 18px; gap: 12px; }
  .world-dialog-head #world-modal-title { font-size: 20px; }
  .world-head-note { font-size: 12px; margin-top: 6px; }
  .world-close { width: 38px; height: 38px; }
  .world-dialog-body { padding: 16px 18px 22px; scrollbar-gutter: auto; }
  .world-dialog-nav { gap: 10px; padding: 11px 18px calc(11px + env(safe-area-inset-bottom)); }
  .world-nav-button { gap: 7px; }
  .world-nav-button .icon { width: 32px; height: 32px; }
  .world-nav-button strong { max-width: 23vw; }
  .world-nav-hint--keyboard { display: none; }
  .world-nav-hint--touch { display: inline; }
  /* Single column so the 160px image track cannot force overflow. */
  .world-dialog-body .role-profile {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px;
    gap: 14px;
    margin: 14px 0 16px;
  }
  .world-dialog-body .role-profile img { height: 180px; min-height: 0; aspect-ratio: auto; width: 100%; }
  .world-dialog-body .career-levels { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}
@media (max-width: 480px) {
  .world-dialog-body .career-levels { grid-template-columns: minmax(0, 1fr); }
  .world-dialog-nav { grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr); padding-inline: 12px; }
  .world-nav-button strong { display: none; }
  .world-nav-status { min-width: 0; }
  .world-nav-hint { font-size: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .world-backdrop, .world-dialog { transition: none; }
  .world-dialog { transform: none; }
}

/* The card no longer expands in place, so it always invites opening
   rather than offering a "close" state. */
.js .career-card-close { display: none !important; }
.js .career-detail[open] .career-card-open { display: inline !important; }
