/* Three forms the listing's pages were missing (design board gaps D1, D2,
   D4), kept apart from listing.css so each stays easy to find: the
   Manage listing panel's Send a listing agreement, the editor's NDA step,
   and the editor's Add / Edit Photos. The dialogs are the NDA area's
   <details> dialogs (nda.css); only what sits around them is here */

/* Send a listing agreement (D1): a command of the More listing actions
   menu whose form opens in place, one field a row, as the board's Listing
   Options draws them; on a desktop the menu widens a little while it is
   open, and on a phone the sheet is already the screen's width */
@media (min-width: 641px) {
  .lp-menu:has(.lp-send[open]) {
    width: min(380px, calc(100vw - 32px));
  }
}

.lp-send form {
  display: grid;
  gap: var(--po-sp-3);
}

.lp-send h3 {
  margin: 0;
}

.lp-send label {
  display: grid;
  gap: var(--po-sp-1);
  font-weight: 600;
}

.lp-send input,
.lp-send textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--po-line-2);
  border-radius: 7px;
  font: inherit;
  font-weight: 400;
}

.lp-send form > .btn {
  justify-self: start;
}

/* The NDA step (D2): it takes Listing Details' place while the address
   names it, and is hidden otherwise */
.ed-nda:not(:target) {
  display: none;
}

.ed-main:has(> .ed-nda:target) > :not(.ed-nda) {
  display: none;
}

.ed-next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--po-sp-3);
  margin-top: var(--po-sp-5);
}

.ed-nda-opts {
  display: grid;
  gap: var(--po-sp-3);
  margin: var(--po-sp-4) 0;
}

.ed-nda-h {
  margin: 0;
}

/* The listing's NDA pick (D2): the options as radios, each card the
   label of its own, marked by the radio it carries */
.ed-nda-set {
  display: grid;
  gap: var(--po-sp-3);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.ed-nda-set > legend {
  margin-bottom: var(--po-sp-3);
  padding: 0;
}

/* The radio stays beside its words at any width, as PhoneFlowNda draws */
.nda-opt.is-pick {
  position: relative;
  flex-wrap: nowrap;
  cursor: pointer;
}

.nda-opt.is-pick .nda-opt__text {
  flex-basis: 0;
}

.nda-opt.is-pick:has(> .nda-opt__in:checked) {
  border: 2px solid var(--po-brand-2);
  background: var(--po-brand-tint);
}

.nda-opt.is-pick:has(> .nda-opt__in:checked) .nda-opt__mark {
  border-color: var(--po-brand-2);
}

.nda-opt.is-pick:has(> .nda-opt__in:checked) .nda-opt__mark::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--po-brand-2);
}

.nda-opt.is-pick:has(> .nda-opt__in:focus-visible) {
  outline: 2px solid var(--po-brand-2);
  outline-offset: 2px;
}

.nda-opt.is-off {
  cursor: not-allowed;
  opacity: 0.6;
}

.ed-nda .ed-save {
  justify-content: space-between;
  gap: var(--po-sp-2);
}

.ed-list > summary {
  list-style: none;
  cursor: pointer;
}

.ed-list > summary::-webkit-details-marker {
  display: none;
}

/* Add / Edit Photos (D4): the pencil beside each photo, its caption, and
   the default photo's chip */
.ed-photo-edit > summary {
  align-self: flex-start;
  list-style: none;
  cursor: pointer;
}

.ed-photo-edit > summary::-webkit-details-marker {
  display: none;
}

.ed-photo-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.ed .tag.is-default {
  align-self: flex-start;
  background: var(--po-brand-tint);
}

/* A different NDA for this listing (D2): the upload and its disclaimer,
   as the company page's NDA form takes them */
.ed-nda-up {
  display: grid;
  gap: var(--po-sp-3);
  margin: 0 0 var(--po-sp-4);
  padding: var(--po-sp-4);
  border: 1px solid var(--po-line);
  border-radius: var(--po-radius);
  background: var(--po-bg-2);
}

.ed-nda-up .nda-field {
  display: grid;
  gap: var(--po-sp-1);
}

.ed-nda-up .nda-field input {
  max-width: 100%;
  font: inherit;
}

.ed-nda-up .nda-fine,
.ed-nda-up .nda-note {
  margin: 0;
  font-size: var(--po-fs-sm);
  color: var(--po-ink-2);
}

.ed-nda-up .nda-tick {
  display: flex;
  gap: var(--po-sp-2);
  align-items: flex-start;
}
