/* The Issue a pass sheet (screens/resident/issueSheet.js). */
.is-sheet {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* "Who's coming?" box: picked people as chips, then the typing field. */
.is-to {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 56px;
  padding: 8px 12px;
  border: 2px solid var(--text-primary);
  border-radius: 16px;
  background: var(--surface-raised);
  box-sizing: border-box;
}
.is-chips {
  display: contents;
}
.is-to__input {
  flex: 1 1 120px;
  min-width: 0;
  height: 36px;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 16px; /* 16px stops iPhone zooming in on focus */
  color: var(--text-primary);
}
/* Beats the app-wide input look: the box above is the field. */
.is-sheet .is-to__input {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0 4px;
  background: transparent;
}
.is-sheet .is-from__input {
  flex: none;
  height: 52px;
  padding: 0 14px;
  border: 2px solid var(--text-primary);
  border-radius: 16px;
  background: var(--surface-raised);
  border-radius: 16px;
  background: var(--surface-raised);
  box-sizing: border-box;
  width: 100%;
}
.is-from {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.is-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 2px 0 4px;
  border-radius: var(--radius-full);
  background: var(--surface-sunken);
  font-size: 14.5px;
  font-weight: var(--weight-semibold);
}
.is-chip i {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--text-primary);
  color: var(--surface-raised);
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 10.5px;
  font-weight: 700;
}
.is-chip__x {
  width: 30px;
  height: 30px;
  border: 0;
  background: none;
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}

/* Visitor / Delivery / Event switch */
.is-kind {
  display: inline-flex;
  align-self: flex-start;
  padding: 3px;
  gap: 2px;
  border-radius: var(--radius-full);
  background: var(--surface-sunken);
}
.is-kind__opt {
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-full);
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  cursor: pointer;
}
.is-kind__opt--on {
  background: var(--surface-raised);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.is-label {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: var(--weight-semibold);
}
.is-opt {
  text-transform: none;
  letter-spacing: 0;
  font-weight: var(--weight-medium);
  color: var(--text-muted);
}
.is-note {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface-sunken);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-secondary);
}

/* The one-time "add your location?" ask. Shown until answered, then never. */
.is-loc {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--surface-border);
  background: var(--surface-raised);
}
.is-loc[hidden],
.is-loc--off {
  display: none;
}
.is-loc__head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.is-loc__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  background: var(--surface-sunken);
  color: var(--text-primary);
  flex-shrink: 0;
}
.is-loc__heading {
  min-width: 0;
}
.is-loc__title {
  margin: 0;
  font-size: 17px;
  font-weight: var(--weight-semibold);
  line-height: 1.3;
  color: var(--text-primary);
}
.is-loc__sub {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary);
}
.is-loc__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
}
/* What happened to the location for this pass (added, blocked, failed). */
.is-loc-status {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary);
}
.is-loc-status[hidden] {
  display: none;
}
.is-loc-status--warn {
  color: var(--text-muted);
}
.is-loc__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
/* Side by side when they fit; stacked full width on the narrowest phones. */
.is-loc__actions .btn {
  flex: 1 1 124px;
  min-width: 0;
  padding-inline: 14px;
}

/* Frequent visitors: a swipeable row of faces. */
.is-faces {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 2px 2px;
  scrollbar-width: none;
}
.is-faces::-webkit-scrollbar {
  display: none;
}
.is-face {
  flex: none;
  width: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
}
.is-face__av {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--surface-sunken);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 15px;
}
.is-face__n {
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.is-face--on {
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}
.is-face--on .is-face__av {
  background: var(--text-primary);
  color: var(--surface-raised);
}
.is-face--on .is-face__av::after {
  content: "";
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--surface-raised);
  background: var(--color-success)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-9'/%3E%3C/svg%3E")
    center / 12px no-repeat;
  box-sizing: border-box;
}

/* Typed matches and "Add as a new visitor" */
.is-list {
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface-raised);
}
.is-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  border: 0;
  border-bottom: 1px solid var(--surface-border);
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.is-row:last-child {
  border-bottom: 0;
}
.is-row--new {
  background: var(--surface-sunken);
}
.is-av {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-sunken);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
}
.is-av--new {
  background: var(--text-primary);
  color: var(--surface-raised);
}
.is-row__main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.is-row__t {
  font-size: 15px;
  font-weight: var(--weight-medium);
}
.is-row__s {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.is-fresh {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--surface-sunken);
}
.is-fresh__t {
  margin: 0;
  font-weight: var(--weight-semibold);
}

/* Purpose and length chips, with the green USUAL tag */
.is-chipset {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 6px;
}
.is-opt-chip {
  position: relative;
  min-height: 38px;
}
.is-usual {
  position: absolute;
  top: -9px;
  right: -4px;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: var(--color-success);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.is-custom {
  margin-top: 12px;
}

/* Event tab: occasion, day, time and guests, each a chip row. */
.is-event {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.is-times {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.is-times .field,
.is-times .field__input {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
/* Sections with nothing to show on this tab take no space. */
.is-sheet > div:empty {
  display: none;
}
.is-hint {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
}
@media (max-width: 360px) {
  .is-times {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Hold a face: stop iPhone's own copy/look-up bubble taking over. */
.is-face {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.is-sheet {
  position: relative;
}
.is-menu {
  position: absolute;
  z-index: 3;
  width: 240px;
  max-width: 100%;
  border-radius: 16px;
  background: var(--surface-raised);
  border: 1px solid var(--surface-border);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}
.is-menu__head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--surface-border);
}
.is-menu__t {
  margin: 0;
  font-size: 14px;
  font-weight: var(--weight-semibold);
}
.is-menu__s {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}
.is-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 0;
  border-bottom: 1px solid var(--surface-border);
  background: none;
  font: inherit;
  font-size: 14.5px;
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}
.is-menu__item:last-child {
  border-bottom: 0;
}
.is-menu__item--danger {
  color: var(--color-danger);
}
