/* ShiftNevis mobile generated-schedule result. Mobile only. */
@media (max-width: 760px) {
  .builder-mobile-result {
    gap: 12px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }

  .builder-mobile-result-hero {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    grid-template-areas: "check copy" "status status";
    align-items: center;
    gap: 10px 12px;
    padding: 16px;
    border: 1px solid #cceede;
    border-radius: 20px;
    background: linear-gradient(145deg, #ffffff, #f0fdf8);
    box-shadow: 0 12px 30px rgba(5, 150, 105, .08);
  }

  .builder-mobile-result-hero__check {
    grid-area: check;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    color: #fff;
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 9px 20px rgba(5, 150, 105, .2);
    font-size: 20px;
  }

  .builder-mobile-result-hero__copy {
    grid-area: copy;
    min-width: 0;
  }
  .builder-mobile-result-hero__copy small {
    display: block;
    margin-bottom: 3px;
    color: #047857;
    font-size: 10.5px;
    font-weight: 900;
  }
  .builder-mobile-result-hero__copy h2 {
    margin: 0;
    color: #21172d;
    font-size: 21px;
    line-height: 1.45;
  }
  .builder-mobile-result-hero__copy p {
    margin: 3px 0 0;
    color: #746b80;
    font-size: 11px;
    font-weight: 800;
  }
  .builder-mobile-result-hero__status {
    grid-area: status;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 950;
  }
  .builder-mobile-result-hero__status.is-ready { color: #047857; background: #dcfce7; }
  .builder-mobile-result-hero__status.is-warning { color: #92400e; background: #fff7dd; }

  .builder-mobile-result-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .builder-mobile-result-kpis > span {
    display: grid;
    justify-items: center;
    gap: 4px;
    min-width: 0;
    padding: 11px 6px;
    border: 1px solid #e6ddf7;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(67, 38, 112, .05);
  }
  .builder-mobile-result-kpis i { color: #7c3aed; font-size: 15px; }
  .builder-mobile-result-kpis small { color: #786f84; font-size: 9.5px; font-weight: 850; }
  .builder-mobile-result-kpis b { color: #21172d; font-size: 17px; line-height: 1; }

  .builder-mobile-result-actions {
    display: grid;
    gap: 8px;
  }
  .builder-mobile-result-actions > button {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 24px;
    align-items: center;
    gap: 10px;
    min-height: 66px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2d7f6;
    border-radius: 17px;
    background: #fff;
    color: #33263f;
    text-align: right;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  .builder-mobile-result-actions > button:active { transform: translateY(1px); }
  .builder-mobile-result-actions > button > i:first-child {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    color: #6d28d9;
    background: #f0e9ff;
  }
  .builder-mobile-result-actions > button > i:last-child { color: #8b5cf6; justify-self: end; }
  .builder-mobile-result-actions span { min-width: 0; }
  .builder-mobile-result-actions b,
  .builder-mobile-result-actions small { display: block; }
  .builder-mobile-result-actions b { font-size: 12.5px; font-weight: 950; }
  .builder-mobile-result-actions small { margin-top: 3px; color: #81778c; font-size: 9.5px; font-weight: 750; }
  .builder-mobile-result-actions > button.is-primary {
    border-color: #7c3aed;
    color: #fff;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    box-shadow: 0 12px 28px rgba(109, 40, 217, .18);
  }
  .builder-mobile-result-actions > button.is-primary > i:first-child,
  .builder-mobile-result-actions > button.is-primary > i:last-child { color: #fff; }
  .builder-mobile-result-actions > button.is-primary > i:first-child { background: rgba(255,255,255,.16); }
  .builder-mobile-result-actions > button.is-primary small { color: rgba(255,255,255,.76); }

  /* Rebuild is a deliberate secondary CTA: clearly actionable without competing
     with the main "view schedule" action. */
  .builder-mobile-result-actions > button.is-review {
    min-height: 72px;
    border: 1.5px solid #cdb9f5;
    color: #4c1d95;
    background: linear-gradient(145deg, #ffffff 0%, #f8f3ff 100%);
    box-shadow: 0 9px 22px rgba(109, 40, 217, .09);
  }
  .builder-mobile-result-actions > button.is-review > i:first-child {
    color: #fff;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    box-shadow: 0 6px 14px rgba(124, 58, 237, .18);
  }
  .builder-mobile-result-actions > button.is-review > i:last-child {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #6d28d9;
    background: #eee7ff;
  }
  .builder-mobile-result-actions > button.is-review b {
    color: #4c1d95;
    font-size: 13px;
  }
  .builder-mobile-result-actions > button.is-review small {
    color: #746580;
    line-height: 1.55;
  }
  .builder-mobile-result-actions > button.is-review:focus-visible {
    outline: 3px solid rgba(124, 58, 237, .14);
    outline-offset: 2px;
  }

  .builder-mobile-rebuild-review__back {
    border-color: #d7c7f4 !important;
    background: linear-gradient(145deg, #fff, #faf7ff) !important;
  }

  .builder-mobile-result-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 2px 0;
  }
  .builder-mobile-result-section-head small,
  .builder-mobile-result-section-head b { display: block; }
  .builder-mobile-result-section-head small { color: #7c3aed; font-size: 10px; font-weight: 900; }
  .builder-mobile-result-section-head b { margin-top: 2px; color: #2d2238; font-size: 13px; }
  .builder-mobile-result-section-head > span {
    flex: 0 0 auto;
    padding: 5px 8px;
    border-radius: 999px;
    color: #6d28d9;
    background: #f2ecff;
    font-size: 10px;
    font-weight: 950;
  }

  .builder-mobile-result-people { display: grid; gap: 8px; }
  .builder-mobile-result-person {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 92px;
    padding: 11px;
    border: 1px solid #e6ddf7;
    border-radius: 17px;
    background: #fff;
    color: #2b2035;
    text-align: right;
    box-shadow: 0 7px 20px rgba(67, 38, 112, .045);
  }
  .builder-mobile-result-person__avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    color: #6d28d9;
    background: #f0e9ff;
    font-size: 16px;
  }
  .builder-mobile-result-person__main { display: grid; gap: 7px; min-width: 0; }
  .builder-mobile-result-person__head { min-width: 0; }
  .builder-mobile-result-person__head b,
  .builder-mobile-result-person__head small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .builder-mobile-result-person__head b { font-size: 12.5px; font-weight: 950; }
  .builder-mobile-result-person__head small { margin-top: 2px; color: #82788e; font-size: 9.5px; font-weight: 750; }
  .builder-mobile-result-person__shifts { display: flex; flex-wrap: wrap; gap: 4px; }
  .builder-mobile-result-person__shifts > span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 22px;
    padding: 3px 6px;
    border-radius: 7px;
    color: #5b21b6;
    background: #f5f0ff;
    font-size: 9px;
    font-weight: 850;
  }
  .builder-mobile-result-person__shifts > span b { font-size: 9px; }
  .builder-mobile-result-person__shifts > span.is-empty { color: #82788e; background: #f5f3f7; }
  .builder-mobile-result-person__meta { display: flex; flex-wrap: wrap; gap: 7px 10px; color: #6f657b; }
  .builder-mobile-result-person__meta > span { display: inline-flex; align-items: center; gap: 4px; font-size: 9px; font-weight: 800; }
  .builder-mobile-result-person__meta i { color: #8b5cf6; }
  .builder-mobile-result-person__side {
    display: grid;
    justify-items: end;
    align-self: stretch;
    align-content: space-between;
    gap: 8px;
    padding-block: 2px;
  }
  .builder-mobile-result-person__side em {
    display: inline-flex;
    padding: 4px 6px;
    border-radius: 8px;
    font-size: 8.5px;
    font-style: normal;
    font-weight: 900;
    white-space: nowrap;
  }
  .builder-mobile-result-person__side em.is-deficit { color: #b42318; background: #fff0ee; }
  .builder-mobile-result-person__side em.is-overtime { color: #9a6700; background: #fff7dd; }
  .builder-mobile-result-person__side em.is-balanced { color: #047857; background: #ecfdf5; }
  .builder-mobile-result-person__side > i { color: #9b8ead; font-size: 11px; }

  .builder-mobile-result-bottom-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding-top: 2px;
  }
  .builder-mobile-result-bottom-actions button {
    min-height: 46px;
    padding: 8px 7px;
    border: 1px solid #e1d7f4;
    border-radius: 13px;
    color: #5b21b6;
    background: #faf8ff;
    font-size: 10px;
    font-weight: 900;
  }
  .builder-mobile-result-bottom-actions i { margin-left: 5px; }

  /* The existing per-person schedule modal is the same canonical renderer used
     by dashboard/portal. Make only its geometry phone-friendly here. */
  .person-calendar { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 7px !important; }
  .person-day-slot { min-height: 76px !important; padding: 8px !important; border-radius: 12px !important; }
  .person-day-slot > b { font-size: 9.5px !important; }
  .person-slot { min-height: 29px !important; height: auto !important; margin-top: 6px !important; font-size: 11px !important; }
  .person-calendar-modal .modal-card,
  .person-calendar-modal { max-width: 100% !important; }
}

@media (max-width: 390px) {
  .builder-mobile-result-actions > button.is-review {
    min-height: 68px;
    grid-template-columns: 38px minmax(0, 1fr) 22px;
    gap: 8px;
    padding-inline: 10px;
  }
  .builder-mobile-result-actions > button.is-review > i:first-child {
    width: 38px;
    height: 38px;
  }
  .builder-mobile-result-actions > button.is-review b { font-size: 12px; }
  .builder-mobile-result-actions > button.is-review small { font-size: 9px; }
  .builder-mobile-result-person { grid-template-columns: 38px minmax(0, 1fr); }
  .builder-mobile-result-person__avatar { width: 38px; height: 38px; }
  .builder-mobile-result-person__side { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 0 48px 0 0; }
}