/* Phase 1: waiting on who, since when, contacts and Chase. Same tones as the rest: the amber
   "waiting" colour, and the hot (danger) one past the limit. */

/* the line on a card: "Waiting on Sarah · 6 days", with Chase on hover */
.pm-wait { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; min-width: 0; color: var(--amber); font-size: 12px; font-weight: 600; line-height: 16px; }
.pm-wait-text { min-width: 0; overflow-wrap: anywhere; } /* wraps rather than cutting the name short */
.pm-wait.hot { color: var(--danger); }
.pm-nowrap { white-space: nowrap; }
.pm-chase { flex: none; height: 24px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--text); font: inherit; font-size: 12px; font-weight: 600; line-height: 22px; text-decoration: none; cursor: pointer; opacity: 0; transition: opacity .12s, border-color .12s, color .12s; }
.pm-card:hover .pm-chase, .pm-card:focus-within .pm-chase, .pm-chase:focus-visible { opacity: 1; }
.pm-chase:hover, .pm-chase:focus-visible { border-color: var(--accent); color: var(--accent); outline: none; }
@media (hover: none), (max-width: 760px) { .pm-chase { opacity: 1; height: 32px; padding: 0 14px; line-height: 30px; } }
@media (max-width: 760px) { .pm-wait { margin-top: 10px; } .pm-wait .pm-chase { min-height: 40px; line-height: 38px; } }

/* the Board run sheet's pill */
.pm-chip.pm-wait-chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* the popup's Waiting on row: like Priority, two columns wide */
.pm-prop[data-prop="waiting"] { grid-column: span 2; }
@media (max-width: 760px) { .pm-prop[data-prop="waiting"] { grid-column: 1 / -1; } }
.pm-wait-field { display: flex; flex-direction: column; gap: 6px; width: 100%; min-width: 0; }
.pm-wait-pick { position: relative; width: 100%; }
#pm-panel .pm-props .pm-wait-btn { display: flex; align-items: center; gap: 8px; width: calc(100% + 8px); min-width: 0; height: 36px; margin-left: -8px; padding: 0 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
#pm-panel .pm-props .pm-wait-btn .pm-names { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#pm-panel .pm-props .pm-wait-btn .face { width: 22px; height: 22px; font-size: 9px; }
.pm-wait-foot { display: flex; align-items: center; gap: 10px; min-height: 24px; color: var(--muted); font-size: 12px; }
.pm-wait-foot[hidden] { display: none; }
.pm-wait-since { color: var(--amber); font-weight: 600; }
.pm-wait-since.hot { color: var(--danger); }
.pm-chase-btn { height: 26px; padding: 0 12px; text-decoration: none; }
.pm-wait-pop { width: 300px; }
.pm-wait-group { padding: 8px 8px 2px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; }
.pm-wait-noface { background: var(--raised); color: var(--muted); }
.pm-wait-pop .pm-assign-opt[data-key="new"] b { color: var(--accent); }
.face.pm-cface { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.pm-assign-opt:not(.on) .pm-assign-tick { color: transparent; }

/* the Email / WhatsApp choice */
.pm-chase-ways { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.pm-chase-ways .btn { text-decoration: none; }

/* the contact form */
.pm-contact-panel { width: min(520px, calc(100vw - 32px)); }
.pm-contact-panel .panel-inner { display: flex; flex-direction: column; gap: 16px; padding: 24px; }
.pm-contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
.pm-contact-grid .field:nth-child(1), .pm-contact-grid .field:nth-child(6) { grid-column: 1 / -1; }
.pm-contact-grid .field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pm-contact-grid .field p { font-size: 12px; }
.pm-contact-grid select { width: 100%; }
@media (max-width: 760px) { .pm-contact-grid { grid-template-columns: minmax(0, 1fr); } }

/* Settings › Contacts: one row per person */
.pm-contacts-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.pm-contacts { margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.pm-contacts:empty { display: none; }
.pm-contact-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.3fr) minmax(0, .8fr) auto; align-items: center; gap: 12px; min-height: 60px; padding: 10px 16px; }
.pm-contact-row + .pm-contact-row { border-top: 1px solid var(--line); }
.pm-contact-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pm-contact-names { display: flex; flex-direction: column; min-width: 0; }
.pm-contact-names b, .pm-contact-names small, .pm-contact-reach a, .pm-contact-branch { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-contact-names small { color: var(--muted); font-size: 12px; }
.pm-contact-reach { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.pm-contact-reach a { color: var(--text); text-decoration: none; }
.pm-contact-reach a:hover { color: var(--accent); }
.pm-contact-branch { font-size: 13px; }
.pm-contact-tools { display: flex; gap: 2px; }
.pm-contact-tools .icon-btn { width: 36px; height: 36px; }
@media (max-width: 760px) {
  .pm-contact-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; padding: 14px 16px; }
  .pm-contact-who { grid-column: 1; }
  .pm-contact-tools { grid-column: 2; grid-row: 1; }
  .pm-contact-tools .icon-btn { width: 40px; height: 40px; }
  .pm-contact-reach, .pm-contact-branch { grid-column: 1 / -1; padding-left: 44px; }
  .pm-contact-branch:empty { display: none; }
}

/* the Email / WhatsApp choice: the same small box as the confirm, its own class (the inner parts share the confirm's) */
.panel.pm-chase-ask { width: min(440px, calc(100vw - 32px)); padding: 0; border-radius: 20px; }
@media (max-width: 760px) {
  dialog.panel.pm-chase-ask {
    width: 100%; max-width: 100%; max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 24px);
    margin: auto 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 16px 16px 0 0;
  }
  .pm-chase-ask .em-ask-inner { padding: 28px 16px calc(16px + env(safe-area-inset-bottom, 0px)); }
  .pm-chase-ask .pm-chase-ways { flex-direction: column; }
  .pm-chase-ask .pm-chase-ways .btn, .pm-chase-ask .em-ask-btns .btn { width: 100%; height: 48px; }
}

/* Send from Emerald OS: To (read-only), Subject and Message, then Send. The contact form's box. */
.pm-chase-send { width: min(560px, calc(100vw - 32px)); }
.pm-chase-send .panel-inner { display: flex; flex-direction: column; gap: 16px; padding: 24px; }
.pm-chase-send-fields { display: flex; flex-direction: column; gap: 14px; }
.pm-chase-send-fields .field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pm-chase-send-fields input, .pm-chase-send-fields textarea { width: 100%; }
.pm-chase-send-fields textarea { min-height: 180px; resize: vertical; line-height: 1.5; }
.pm-chase-send-fields input[readonly] { color: var(--muted); background: transparent; cursor: default; }
.pm-chase-send-note { margin: 0; font-size: 12px; }
.pm-chase-send .error:empty { display: none; }
@media (max-width: 760px) { /* the full-screen sheet comes from mobile-sheets.css; here, the taps */
  .pm-chase-send-fields input { min-height: 44px; }
  .pm-chase-send-fields textarea { min-height: 160px; }
  .pm-chase-send .row-btns { flex-direction: column-reverse; gap: 8px; }
  .pm-chase-send .row-btns .btn { width: 100%; height: 48px; }
}
