/* Leads 'Sections' button (Build Q): group, order, hide and sort the inbox sections, saved per person.
   components/lead-layout.js; look: state/lanes/leadsprio-design.md 5. Class prefix llay- (.lead-layout is the
   lead panel's grid, never reuse it). Tokens only. */

/* ---- Trigger: a blue dot on the icon while the layout is not the default ---- */
.llay-ic-wrap { position: relative; display: inline-flex; }
.llay-dot {
  position: absolute; top: -2px; right: -3px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--blue-bright); box-shadow: 0 0 0 2px var(--bg-surface); display: none;
}
.llay-btn[data-custom="1"] .llay-dot { display: block; }
.llay-btn.is-open { border-color: var(--border-focus); }

/* ---- Popover ---- */
.llay-pop { padding: 0; border-radius: var(--menu-radius); box-shadow: var(--menu-shadow); }
.llay { width: 320px; max-width: calc(100vw - 32px); display: flex; flex-direction: column; }
.llay-sec { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-5) var(--sp-6) 0; }
.llay-cap { font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: var(--fw-semibold); color: var(--text-2); }

/* Group by: segmented control. */
.llay-seg { display: flex; padding: 2px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-app); }
.llay-seg-btn {
  flex: 1; height: 28px; padding: 0 var(--sp-3); border: 0; border-radius: 6px; background: none; color: var(--text-2);
  font: inherit; font-size: var(--fs-md); cursor: pointer;
}
.llay-seg-btn:hover { color: var(--text); }
.llay-seg-btn.is-on { background: var(--bg-surface); color: var(--text); font-weight: var(--fw-semibold); box-shadow: var(--shadow-button), 0 0 0 1px var(--border); }
.llay-seg-btn:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 0; }

/* Section rows. */
.llay-list { display: flex; flex-direction: column; margin: 0 calc(-1 * var(--sp-3)); max-height: 280px; overflow-y: auto; }
.llay-row {
  display: flex; align-items: center; gap: var(--sp-3); min-height: 36px; padding: 0 var(--sp-2);
  border-radius: var(--r-sm); background: var(--bg-surface);
}
.llay-row:hover { background: var(--bg-hover); }
.llay-row.is-dragging { background: var(--bg-selected); box-shadow: inset 0 -2px 0 var(--border-focus); }
.llay-row.is-hidden .llay-name, .llay-row.is-hidden .llay-sec-ic { color: var(--text-muted); }
.llay-drag, .llay-eye {
  display: grid; place-items: center; width: 28px; height: 28px; flex: none; padding: 0; border: 0;
  border-radius: var(--r-sm); background: none; color: var(--text-2); cursor: grab; touch-action: none;
}
.llay-eye { cursor: pointer; }
.llay-drag svg, .llay-eye svg { width: 16px; height: 16px; display: block; }
.llay-drag:hover, .llay-eye:hover { background: var(--bg-surface); color: var(--text); }
.llay-drag:focus-visible, .llay-eye:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 0; }
.llay-drag[aria-disabled="true"] { color: var(--border-strong); cursor: default; }
.llay-row.is-hidden .llay-eye { color: var(--text-muted); }
.llay-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.llay-sec-ic svg { width: 16px; height: 16px; display: block; }
.llay-sec-ic.is-new { color: var(--blue-bright); }
.llay-sec-ic.is-hot { color: var(--quality-hot); }
.llay-sec-ic.is-medium { color: var(--quality-medium); }
.llay-sec-ic.is-low { color: var(--quality-low); }
.llay-sec-ic.is-unsure { color: var(--quality-unsure); }
.llay-sec-ic.is-notgood { color: var(--quality-not-good); }
.llay-none { padding: var(--sp-3) var(--sp-4); color: var(--text-2); font-size: var(--fs-sm); }

/* Show empty sections: the shared 16px checkbox. */
.llay-check {
  display: flex; align-items: center; gap: var(--sp-4); min-height: var(--control-h); padding: 0; border: 0;
  background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.llay-check:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; border-radius: var(--r-sm); }
.llay-box {
  display: grid; place-items: center; width: 16px; height: 16px; flex: none; border: 1px solid var(--border-strong);
  border-radius: 3px; background: var(--bg-surface); color: transparent;
}
.llay-box svg { width: 12px; height: 12px; display: block; }
.llay-check.is-checked .llay-box { border-color: var(--blue-bright); background: var(--blue-bright); color: var(--text-inverse); }

.llay-sort.select-trigger { width: 100%; }

.llay-foot { margin-top: var(--sp-5); padding: var(--sp-4) var(--sp-6); border-top: 1px solid var(--border); }
.llay-reset {
  height: var(--control-h); padding: 0 var(--sp-3); margin-left: calc(-1 * var(--sp-3)); border: 0; border-radius: var(--r-sm);
  background: none; color: var(--link); font: inherit; font-weight: var(--fw-semibold); cursor: pointer;
}
.llay-reset:hover { background: var(--bg-hover); }
.llay-reset[aria-disabled="true"] { color: var(--text-muted); cursor: default; background: none; }
.llay-reset:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 0; }

/* ---- Phone: a full-width sheet with a 16px gutter ---- */
@media (max-width: 640px) {
  .popover.llay-pop { left: 16px !important; right: 16px; width: auto; }
  .llay { width: 100%; max-width: none; }
}
