.shared-trip-manager {
  position: fixed;
  z-index: 2550;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #F8FAFC;
  color: #0F172A;
  opacity: 0;
  transform: translateX(-100%);
  transition: transform 280ms cubic-bezier(.22,.8,.26,1), opacity 180ms ease;
  pointer-events: none;
}

.shared-trip-manager[hidden] {
  display: none !important;
}

.shared-trip-manager.is-open {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.shared-trip-manager *,
.shared-trip-manager button,
.shared-trip-manager input,
.shared-trip-manager select {
  box-sizing: border-box;
  font-family: var(--font-family);
}

.shared-trip-manager-header {
  flex: 0 0 auto;
  min-height: calc(64px + env(safe-area-inset-top));
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(100,116,139,.16);
  background: linear-gradient(180deg,#fff,#f8fafc);
}

.shared-trip-manager-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.shared-trip-manager-title > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #ECFDF5;
  font-size: 22px;
}

.shared-trip-manager-title > div {
  min-width: 0;
}

.shared-trip-manager-title h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -.02em;
}

.shared-trip-manager-title small {
  display: block;
  margin-top: 2px;
  color: #64748B;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shared-trip-manager-close {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  background: #F1F5F9;
  color: #475569;
  font-size: 25px;
  cursor: pointer;
}

.shared-trip-manager-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 14px calc(30px + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}

.shared-trip-manager-shell {
  width: min(100%, 1040px);
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.shared-trip-manager-card {
  border: 1px solid rgba(100,116,139,.16);
  border-radius: 20px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 8px 26px rgba(15,23,42,.05);
}

.shared-trip-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.shared-trip-section-head h3,
.shared-trip-guest-detail h3,
.shared-trip-permission-title h4 {
  margin: 0;
}

.shared-trip-section-head h3 {
  font-size: 17px;
  font-weight: 900;
}

.shared-trip-section-head p {
  margin: 5px 0 0;
  max-width: 700px;
  color: #64748B;
  font-size: 13px;
  line-height: 1.45;
}

#sharedTripGuestCapacity {
  flex: 0 0 auto;
  padding: 7px 9px;
  border-radius: 999px;
  background: #F1F5F9;
  color: #475569;
  font-size: 11px;
  font-weight: 850;
}

.shared-trip-invite-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
}

.shared-trip-invite-channels button {
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid #CBD5E1;
  border-radius: 12px;
  background: #fff;
  color: #334155;
  font-size: 13px;
  font-weight: 850;
}

.shared-trip-invite-channels button:disabled {
  opacity: .52;
  cursor: not-allowed;
}

.shared-trip-manager-readonly {
  padding: 11px 13px;
  border: 1px solid #FDE68A;
  border-radius: 14px;
  background: #FFFBEB;
  color: #92400E;
  font-size: 12px;
  line-height: 1.45;
}

.shared-trip-manager-grid {
  display: grid;
  grid-template-columns: minmax(260px,.72fr) minmax(0,1.55fr);
  gap: 14px;
  align-items: start;
}

.shared-trip-guest-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.shared-trip-guest-row {
  width: 100%;
  min-height: 62px;
  display: grid;
  grid-template-columns: 38px minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  background: #fff;
  color: #0F172A;
  text-align: left;
  cursor: pointer;
}

.shared-trip-guest-row.is-selected {
  border-color: rgba(13,148,136,.40);
  background: #F0FDFA;
  box-shadow: 0 0 0 2px rgba(13,148,136,.08);
}

.shared-trip-guest-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #CCFBF1;
  color: #0F766E;
  font-size: 12px;
  font-weight: 900;
}

.shared-trip-guest-copy {
  min-width: 0;
}

.shared-trip-guest-copy strong,
.shared-trip-guest-copy small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shared-trip-guest-copy strong {
  font-size: 14px;
  font-weight: 850;
}

.shared-trip-guest-copy small {
  margin-top: 3px;
  color: #64748B;
  font-size: 11px;
}

.shared-trip-invite-status {
  width: fit-content;
  padding: 5px 7px;
  border-radius: 999px;
  background: #F1F5F9;
  color: #475569;
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}

.shared-trip-invite-status.is-accepted {
  background: #ECFDF5;
  color: #047857;
}

.shared-trip-invite-status.is-pending {
  background: #FFFBEB;
  color: #B45309;
}

.shared-trip-invite-status.is-inactive {
  background: #FEF2F2;
  color: #B91C1C;
}

.shared-trip-manager-empty {
  margin: 12px 0 0;
  padding: 14px;
  border: 1px dashed #CBD5E1;
  border-radius: 14px;
  background: #F8FAFC;
  color: #64748B;
  font-size: 13px;
  line-height: 1.45;
}

.shared-trip-guest-detail {
  display: grid;
  gap: 16px;
}

.shared-trip-guest-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.shared-trip-guest-detail-head h3 {
  margin-bottom: 7px;
  font-size: 18px;
  font-weight: 900;
}

.shared-trip-role-field {
  min-width: 150px;
  display: grid;
  gap: 5px;
}

.shared-trip-role-field span {
  color: #64748B;
  font-size: 11px;
  font-weight: 800;
}

.shared-trip-role-field select {
  min-height: 40px;
  width: 100%;
  border: 1px solid #CBD5E1;
  border-radius: 11px;
  background: #F8FAFC;
  color: #334155;
  padding: 0 9px;
  font-size: 13px;
  font-weight: 800;
}

.shared-trip-permission-title {
  padding-top: 3px;
  border-top: 1px solid #E2E8F0;
}

.shared-trip-permission-title h4 {
  margin-top: 13px;
  font-size: 15px;
  font-weight: 900;
}

.shared-trip-permission-title p {
  margin: 5px 0 0;
  color: #64748B;
  font-size: 12px;
  line-height: 1.45;
}

.shared-trip-permission-matrix {
  display: grid;
  gap: 8px;
}

.shared-trip-permission-row {
  display: grid;
  grid-template-columns: minmax(135px,.7fr) minmax(0,1.6fr);
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #F1F5F9;
}

.shared-trip-permission-row:last-child {
  border-bottom: 0;
}

.shared-trip-permission-label {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.shared-trip-permission-label > span {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #F8FAFC;
  font-size: 15px;
}

.shared-trip-permission-label strong {
  min-width: 0;
  font-size: 12px;
  font-weight: 850;
}

.shared-trip-permission-options {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.shared-trip-permission-chip {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid #E2E8F0;
  border-radius: 999px;
  background: #F8FAFC;
  color: #64748B;
  font-size: 10px;
  font-weight: 850;
}

.shared-trip-permission-chip.is-current {
  border-color: rgba(13,148,136,.30);
  background: #CCFBF1;
  color: #0F766E;
}

.shared-trip-permission-chip:disabled {
  opacity: 1;
}

.shared-trip-manager-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

.shared-trip-manager-actions button {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #CBD5E1;
  border-radius: 11px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 850;
}

.shared-trip-manager-actions button.is-danger {
  border-color: #FECACA;
  color: #B91C1C;
  background: #FEF2F2;
}

.shared-trip-manager-actions button:disabled {
  opacity: .52;
  cursor: not-allowed;
}

@media (max-width: 760px) {
  .shared-trip-manager-grid {
    grid-template-columns: 1fr;
  }

  .shared-trip-guest-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .shared-trip-guest-list::-webkit-scrollbar {
    display: none;
  }

  .shared-trip-guest-row {
    flex: 0 0 min(82vw, 310px);
  }
}

@media (max-width: 520px) {
  .shared-trip-manager-scroll {
    padding-inline: 10px;
  }

  .shared-trip-manager-card {
    padding: 13px;
    border-radius: 17px;
  }

  .shared-trip-guest-detail-head {
    display: grid;
  }

  .shared-trip-role-field {
    width: 100%;
  }

  .shared-trip-permission-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .shared-trip-permission-options {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shared-trip-manager {
    transition: none;
  }
}
