/* Lead surface structure: Lead collections are rows and a concrete Lead is a page.
   This file owns Lead/list/detail/fullscreen structure only. Semantic colors live in semantic-depth.css;
   focused viewport scrolling lives in focused-list-scroll.css. */

/* Focused sections are real edge-to-edge pages, not giant rounded cards. */
body .shell.shell--section-focus {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

body .shell.shell--section-focus > .panel--focused {
  width: min(760px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}

body .shell.shell--section-focus > .panel--focused::before {
  display: none;
}

body .panel--focused .panel__fullscreen-toggle,
body .lead-card--actions-screen > .lead-card__actions-back {
  width: auto;
  min-width: 0;
  min-height: 44px;
  padding: 8px 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #17396f;
  box-shadow: none;
}

body .panel--focused .lead-list-tools input,
body .panel--focused .lead-list-tools select {
  min-height: 46px;
  border: 1px solid rgb(96 125 165 / .34);
  border-radius: 9px;
  background-color: rgb(255 255 255 / .64);
  box-shadow: none;
}

/* Lead collections are rows separated by rhythm/dividers, never nested cards. */
body .shell[data-primary-area]:not([data-primary-area='home']) .lead-list,
body .shell.shell--section-focus .lead-list {
  min-width: 0;
  max-width: 100%;
  gap: 0;
}

body .shell[data-primary-area]:not([data-primary-area='home']) .lead-list > .lead-card:not(.lead-card--actions-screen),
body .shell.shell--section-focus .lead-list > .lead-card:not(.lead-card--actions-screen) {
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 18px 0;
  border: 0;
  border-bottom: 1px solid rgb(96 125 165 / .22);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

body .shell[data-primary-area]:not([data-primary-area='home']) .lead-list > .lead-card:not(.lead-card--actions-screen):last-child,
body .shell.shell--section-focus .lead-list > .lead-card:not(.lead-card--actions-screen):last-child {
  border-bottom: 0;
}

/* Context/state belongs to the page and visible labels, not decorative vertical rails. */
body .shell[data-primary-area]:not([data-primary-area='home']) .lead-list > .lead-card--action:not(.lead-card--actions-screen),
body .shell[data-primary-area]:not([data-primary-area='home']) .lead-list > .lead-card--paused:not(.lead-card--actions-screen),
body .shell[data-primary-area='customers'] .lead-list > .lead-card:not(.lead-card--actions-screen),
body .shell.shell--section-focus .lead-list > .lead-card:not(.lead-card--actions-screen) {
  padding-left: 0;
  border-left: 0;
  background: transparent;
}

/* Record internals are one continuous surface. */
body .shell[data-primary-area]:not([data-primary-area='home']) .lead-card__meta,
body .shell.shell--section-focus .lead-card__meta,
body .lead-card--actions-screen .lead-card__meta {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body .shell[data-primary-area]:not([data-primary-area='home']) .lead-card__meta-item,
body .shell.shell--section-focus .lead-card__meta-item,
body .lead-card--actions-screen .lead-card__meta-item {
  border: 0;
  border-bottom: 1px solid rgb(148 163 184 / .24);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body .shell[data-primary-area]:not([data-primary-area='home']) .lead-card__meta-item:last-child,
body .shell.shell--section-focus .lead-card__meta-item:last-child,
body .lead-card--actions-screen .lead-card__meta-item:last-child {
  border-bottom: 0;
}

body .shell[data-primary-area]:not([data-primary-area='home']) .lead-card__need,
body .shell[data-primary-area]:not([data-primary-area='home']) .lead-card__next,
body .shell[data-primary-area]:not([data-primary-area='home']) .lead-history,
body .shell.shell--section-focus .lead-card__need,
body .shell.shell--section-focus .lead-card__next,
body .shell.shell--section-focus .lead-history,
body .lead-card--actions-screen .lead-card__need,
body .lead-card--actions-screen .lead-card__next,
body .lead-card--actions-screen .lead-history {
  border: 0;
  border-top: 1px solid rgb(148 163 184 / .28);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body .shell[data-primary-area]:not([data-primary-area='home']) .lead-card__need,
body .shell.shell--section-focus .lead-card__need,
body .lead-card--actions-screen .lead-card__need {
  margin-top: 8px;
  padding: 12px 0 2px;
}

/* Next action shares exactly the same left edge/icon column as the other information rows. */
body .shell[data-primary-area]:not([data-primary-area='home']) .lead-card__next,
body .shell.shell--section-focus .lead-card__next,
body .lead-card--actions-screen .lead-card__next {
  margin-top: 10px;
  padding: 12px 0 2px;
  border-left: 0;
}

body .shell[data-primary-area]:not([data-primary-area='home']) .lead-history,
body .shell.shell--section-focus .lead-history,
body .lead-card--actions-screen .lead-history {
  margin-top: 10px;
  padding: 10px 0 0;
}

/* Fullscreen Lead is a viewport page. Its opaque semantic background is owned by semantic-depth.css. */
body .shell[data-primary-area]:not([data-primary-area='home']) .lead-list > .lead-card.lead-card--actions-screen,
body .shell.shell--section-focus .lead-list > .lead-card.lead-card--actions-screen,
body .lead-card--actions-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  width: 100vw;
  max-width: none;
  min-height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding-top: max(18px, env(safe-area-inset-top));
  padding-right: max(22px, env(safe-area-inset-right));
  padding-bottom: max(30px, env(safe-area-inset-bottom));
  padding-left: max(22px, env(safe-area-inset-left));
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  overflow: auto;
  content-visibility: visible;
  contain: none;
}

body .lead-card--actions-screen > .lead-card__heading,
body .lead-card--actions-screen > .lead-card__meta,
body .lead-card--actions-screen > .lead-card__need,
body .lead-card--actions-screen > .lead-card__next,
body .lead-card--actions-screen > .lead-history,
body .lead-card--actions-screen > .lead-card__actions {
  width: min(100%, 680px);
  margin-right: auto;
  margin-left: auto;
}

body .lead-card--actions-screen > .lead-card__actions-back {
  right: max(22px, env(safe-area-inset-right));
}

body .lead-card--actions-screen .lead-card__heading,
body .lead-card--actions-screen .lead-card__meta {
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body .lead-card--actions-screen .lead-card__heading {
  padding-top: 2px;
  padding-bottom: 5px;
  padding-left: 0;
}

body .lead-card--actions-screen .lead-card__meta {
  margin-top: 0;
  padding-top: 0;
  padding-right: 0;
  padding-bottom: 6px;
  padding-left: 0;
}

body .lead-card--actions-screen .lead-card__meta-item {
  padding-top: 4px;
  padding-bottom: 4px;
}

body .lead-card--actions-screen .lead-card__need,
body .lead-card--actions-screen .lead-card__next {
  margin-top: 4px;
  padding-top: 9px;
  padding-right: 0;
  padding-bottom: 4px;
  padding-left: 0;
}

/* Action disclosure/editor are sections, not cards inside the Lead page. */
body .panel--focused .lead-card__actions[open],
body .lead-card--actions-screen .lead-card__actions,
body .lead-card--actions-screen .lead-card__actions[open] {
  border: 0;
  border-top: 1px solid rgb(148 163 184 / .32);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body .lead-card--actions-screen .lead-card__actions {
  margin-top: 8px;
  padding: 8px 0 0;
}

body .panel--focused .lead-details-editor,
body .lead-card--actions-screen .lead-details-editor {
  margin: 10px 0 0;
  padding: 0;
  border: 0;
  border-top: 1px solid rgb(148 163 184 / .30);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body .lead-card--actions-screen .lead-details-editor {
  margin-top: 0;
  border-top: 0;
}

body .panel--focused .lead-details-editor > summary,
body .lead-card--actions-screen .lead-details-editor > summary {
  padding: 10px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body .panel--focused .lead-details-editor__form,
body .lead-card--actions-screen .lead-details-editor__form {
  padding: 2px 0 10px;
}

body .panel--focused .lead-card__actions-content .action-row,
body .lead-card--actions-screen .action-row {
  margin-top: 8px;
  padding: 10px 0 0;
  border: 0;
  border-top: 1px solid rgb(148 163 184 / .24);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body .panel--focused .lead-card__actions-content .action-row:first-of-type,
body .lead-card--actions-screen .action-row:first-of-type {
  border-top: 0;
}

body .panel--focused .lead-card__actions-content .action-row--close,
body .lead-card--actions-screen .action-row--close {
  margin-top: 16px;
  padding-top: 16px;
  border-top-color: rgb(185 28 28 / .22);
}

body .lead-card--actions-screen input,
body .lead-card--actions-screen select,
body .lead-card--actions-screen textarea,
body .panel--focused .lead-card input,
body .panel--focused .lead-card select,
body .panel--focused .lead-card textarea {
  border-radius: 9px;
  background: rgb(255 255 255 / .72);
  box-shadow: none;
}

body .lead-card--actions-screen .action-row > button,
body .panel--focused .lead-card__actions-content .action-row > button {
  border-radius: 9px;
  box-shadow: none;
}

@media (max-width: 620px) {
  body .shell[data-primary-area]:not([data-primary-area='home']) .lead-list > .lead-card.lead-card--actions-screen,
  body .shell.shell--section-focus .lead-list > .lead-card.lead-card--actions-screen,
  body .lead-card--actions-screen {
    padding-right: max(20px, env(safe-area-inset-right));
    padding-left: max(20px, env(safe-area-inset-left));
  }

  body .lead-card--actions-screen > .lead-card__actions-back {
    right: max(20px, env(safe-area-inset-right));
  }
}
