/* Phase 109 - mobile QA polish and class/team roster bridge */

/* Keep the newer Spatial wall/blocking planner from floating over the
   production spatial controls. The audit was catching real overlap here. */
#spatial-app .phase107-spatial-panel {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: min(1540px, calc(100% - 28px)) !important;
  max-height: none !important;
  overflow: visible !important;
  margin: 0 auto 132px !important;
  box-sizing: border-box !important;
}

#spatial-app .phase107-grid {
  align-items: stretch !important;
}

#spatial-app .phase107-grid > *,
#spatial-app .phase107-row > * {
  min-width: 0 !important;
  box-sizing: border-box !important;
}

#spatial-app .phase107-btn,
#spatial-app .phase107-select,
#spatial-app .phase107-input {
  width: 100% !important;
  max-width: 100% !important;
}

#spatial-app .phase107-row {
  grid-template-columns: minmax(0, 1fr) minmax(150px, auto) !important;
}

#spatial-app .phase107-row > div:last-child {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  justify-content: flex-end !important;
}

#spatial-app .phase107-row > div:last-child .phase107-input {
  width: 84px !important;
  flex: 0 0 84px !important;
}

#spatial-app .phase107-row > div:last-child .phase107-btn {
  width: auto !important;
  min-width: 86px !important;
  flex: 0 0 auto !important;
}

#phase109-roster-invites {
  background:
    radial-gradient(circle at 12% 0%, rgba(37, 99, 235, .09), transparent 32%),
    linear-gradient(180deg, rgba(239, 246, 255, .74), rgba(255, 255, 255, .96));
}

.phase109-roster-note {
  margin: -4px 0 12px;
  color: #64748b;
  font-size: .82rem;
  line-height: 1.45;
}

.phase109-roster-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.phase109-roster-list {
  display: grid;
  gap: 8px;
}

.phase109-roster-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(118px, .42fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(37, 99, 235, .13);
  border-radius: 14px;
  background: rgba(255, 255, 255, .86);
}

.phase109-roster-row.disabled {
  opacity: .58;
}

.phase109-roster-person {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.phase109-roster-person strong,
.phase109-roster-person small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phase109-roster-person small {
  color: #64748b;
}

.phase109-roster-row select,
.phase109-invite-line input {
  min-width: 0;
  border: 1px solid rgba(37, 99, 235, .16);
  border-radius: 10px;
  padding: 8px 9px;
  background: #fff;
  font: inherit;
}

.phase109-send-roster {
  width: 100%;
  margin-top: 12px;
}

.phase109-roster-status {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.phase109-invite-line {
  display: grid;
  grid-template-columns: minmax(0, .9fr) auto minmax(0, 1.5fr);
  gap: 8px;
  align-items: center;
  padding: 9px;
  border-radius: 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #14532d;
  font-size: .78rem;
}

.phase109-invite-line.error {
  display: block;
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

@media (max-width: 760px) {
  #spatial-app .phase107-spatial-panel {
    width: calc(100% - 20px) !important;
    margin-bottom: calc(94px + env(safe-area-inset-bottom, 0px)) !important;
    padding: 12px !important;
  }

  #spatial-app .phase107-row {
    grid-template-columns: 1fr !important;
  }

  #spatial-app .phase107-row > div:last-child {
    justify-content: stretch !important;
  }

  #spatial-app .phase107-row > div:last-child .phase107-input,
  #spatial-app .phase107-row > div:last-child .phase107-btn {
    width: 100% !important;
    flex: 1 1 100% !important;
  }

  .phase109-roster-row,
  .phase109-invite-line {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .phase109-roster-row select,
  .phase109-invite-line input {
    grid-column: 1 / -1;
    width: 100%;
  }
}
