/* ==========================================================================
   APP ACTIONS  (assets/css/app-actions.css)  -  loaded on every signed-in page
   Styles for includes/app-drawers.php (help, support, calling, assistant)
   and the shared drawer form grid. Tokens from base.css only.
   ========================================================================== */
.modal .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
.modal .form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 575.98px) { .modal .form-grid { grid-template-columns: minmax(0, 1fr); } }
.modal .modal__title { display: flex; align-items: center; gap: 8px; }

/* help */
.help-search { margin-bottom: var(--sp-4); }
/* Help drawer search: styled here so it works on every page (settings.css only loads on Settings) */
.help-search {
  display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-subtle);
}
.help-search[hidden] { display: none; }
.help-search:focus-within { border-color: var(--brand); box-shadow: var(--focus-ring); }
.help-search input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 14px; color: var(--text); }
.help-search input::-webkit-search-cancel-button { cursor: pointer; }
.help-body { display: grid; gap: var(--sp-5); }
.help-sec__title { font-size: 15px; font-weight: 700; margin-bottom: var(--sp-2); }
.help-sec p { color: var(--text-muted); line-height: 1.6; }
.help-sec ul { display: grid; gap: 6px; }
.help-sec li {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px;
}
.help-sec li.is-link { cursor: pointer; }
.help-sec li.is-link:hover { border-color: var(--brand); color: var(--brand-ink); }
.help-empty { color: var(--text-muted); }

/* calling */
.dial__input { font-size: 18px; letter-spacing: .02em; }
.dial__pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: var(--sp-4); max-width: 300px; }
.dial__key { height: 52px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); font-size: 20px; font-weight: 600; }
.dial__key:hover { background: var(--surface-hover); }
.dial__status { display: flex; align-items: center; gap: var(--sp-3); margin-top: var(--sp-4); padding: var(--sp-3) var(--sp-4); border-radius: var(--radius); background: var(--success-bg); }
.dial__status .s-avatar, .dial__status [data-dial-initials] { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--surface); font-weight: 700; }
.dial__recent { display: grid; gap: 6px; }
.dial__recent button { width: 100%; display: flex; justify-content: space-between; gap: var(--sp-3); padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); text-align: left; }
.dial__recent button:hover { background: var(--surface-hover); }
.dial__recent span { color: var(--text-muted); font-size: 13px; }

/* assistant */
.asst__log { display: grid; gap: var(--sp-3); }
.asst__msg { padding: 10px 14px; border-radius: 14px 14px 14px 4px; background: var(--surface-3); line-height: 1.5; max-width: 90%; }
.asst__msg.is-me { justify-self: end; border-radius: 14px 14px 4px 14px; background: var(--brand); color: var(--brand-contrast); }
.asst__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--sp-4); }
.asst__chips .pill { height: 32px; padding: 0 12px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); background: var(--surface); font-size: 13px; font-weight: 600; }
.asst__chips .pill:hover { background: var(--surface-hover); }
.asst__form { gap: var(--sp-2); }
.asst__form .input { flex: 1; }

/* generic: "connected" state cards (calendar, email) */
.conn-state { display: flex; align-items: center; gap: var(--sp-3); }
.conn-option { display: flex; align-items: center; gap: var(--sp-3); width: 100%; padding: var(--sp-4); border: 1px solid var(--border); border-radius: var(--radius); text-align: left; background: var(--surface); }
.conn-option + .conn-option { margin-top: var(--sp-3); }
.conn-option:hover, .conn-option.is-selected { border-color: var(--brand); background: var(--brand-soft); }
.conn-option strong { display: block; }
.conn-option small { color: var(--text-muted); }
.conn-logo { width: 40px; height: 40px; border-radius: var(--radius-sm); display: inline-grid; place-items: center; font-weight: 800; color: #fff; flex: none; }
.conn-logo--google { background: #1a73e8; }
.conn-logo--ms { background: #0f6cbd; }
.conn-logo--other { background: var(--text-subtle); }
.eyebrow-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-subtle); }

/* radio cards (connect email / calendar) */
.conn-option--radio { position: relative; cursor: pointer; }
.conn-option--radio input { position: absolute; opacity: 0; pointer-events: none; }
.conn-option--radio:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.conn-option--radio:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }

/* row details drawer */
.details-list { display: grid; gap: 0; margin: 0; }
.details-list > div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: var(--sp-3); padding: var(--sp-3) 0; border-bottom: 1px solid var(--border); }
.details-list dt { color: var(--text-muted); font-size: .8125rem; }
.details-list dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.details-list__note dd { font-weight: 400; }
@media (max-width: 480px) { .details-list > div { grid-template-columns: 1fr; gap: 2px; } }
.up-head { display: flex; align-items: center; gap: var(--sp-3); }

/* ----------------------------------------------------------------------------
   Scroll lock: while any side panel or pop-up is open, only the panel scrolls.
   Covers every overlay type in the app (.popup-drawer / .popup-overlay from
   create-popup, .forms-drawer, .modal-backdrop from modal.js / sales-ui), so
   pages don't each need their own JS lock. overscroll-behavior stops a panel's
   scroll from carrying on into the page when it reaches the top or bottom.
---------------------------------------------------------------------------- */
html:has(.popup-drawer.is-open),
html:has(.popup-overlay.is-visible),
html:has(.modal-backdrop.is-open),
html:has(.popup-drawer.is-open) body,
html:has(.popup-overlay.is-visible) body,
html:has(.modal-backdrop.is-open) body { overflow: hidden; }

.popup-drawer, .popup-body-form, .forms-drawer-body,
.modal-backdrop, .modal, .modal__body,
.dropdown__menu { overscroll-behavior: contain; }
