#panel-my-leads {
  --ml-ink: #361d1a;
  --ml-muted: #705e55;
  --ml-line: #dfd4c7;
  --ml-paper: #fffcf8;
  width: 100%;
  min-width: 0;
  color: var(--ml-ink);
}

#panel-my-leads[hidden], #panel-my-leads [hidden] { display: none !important; }

.ml-toolbar, .ml-profile-nav, .ml-tools, .ml-rep, .ml-views {
  display: flex;
  align-items: center;
}
.ml-toolbar, .ml-profile-nav { justify-content: space-between; gap: 1rem; }
.ml-rep { gap: .45rem; min-width: 0; }
.ml-rep label { white-space: nowrap; }
.ml-rep label, .ml-count { color: var(--ml-muted); font-size: .8rem; font-weight: 600; }
.ml-rep select, .ml-rep [role="combobox"] { min-width: 9rem; max-width: min(16rem, 54vw); }
.ml-toolbar { margin-bottom: 1rem; gap: .75rem; flex-wrap: wrap; }
.ml-views { align-self: stretch; gap: .2rem; padding: .2rem; border: 1px solid #d5c8ba; border-radius: 7px; }
.ml-views button { white-space: nowrap; }
#panel-my-leads .ml-views button, #panel-my-leads .ml-profile-nav button, #my-leads-retry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 2.2rem;
  padding: .45rem .8rem;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  box-shadow: none;
  font: inherit;
  font-size: .83rem;
  font-weight: 650;
  line-height: 1.25;
  color: var(--ml-muted);
  letter-spacing: normal;
  text-transform: none;
  cursor: pointer;
}
#panel-my-leads .ml-views button[aria-pressed="true"] { background: #472020; color: #fffaf5; }
#panel-my-leads .ml-views button[aria-pressed="false"]:hover { background: #eae1d6; color: var(--ml-ink); }
.ml-tools { gap: .9rem; }
.ml-count { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ml-search {
  position: relative;
  display: block;
  margin: 0;
  color: var(--ml-muted);
}
.ml-search svg { position: absolute; width: 1rem; height: 1rem; left: .72rem; top: 50%; transform: translateY(-50%); pointer-events: none; }
#my-leads-search {
  box-sizing: border-box;
  width: clamp(9rem, 19vw, 16rem);
  min-height: 2.55rem;
  margin: 0;
  padding: .5rem .65rem .5rem 2.18rem;
  border: 1px solid var(--ml-line);
  border-radius: 6px;
  font: inherit;
  color: var(--ml-ink);
  font-size: .85rem;
  background: var(--ml-paper);
}
.ml-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(12.5rem, 1fr);
  overflow-x: auto;
  gap: clamp(.55rem, calc(2vw - .75rem), 1.25rem);
  width: 100%;
  min-width: 0;
}
.ml-lane {
  --ml-card-inset: .6rem;
  --lane-accent: #8d5351;
  --lane-tint: #e9d9d4;
  min-width: 0;
  display: flex;
  flex-direction: column;
  max-height: max(19rem, calc(100dvh - 14.8rem - var(--admin-hub-dock-clearance, 1rem)));
  border: 1px solid var(--ml-line);
  border-radius: 10px;
  background: #efe8de;
}
.ml-lane[data-stage="follow_up"], .ml-lane[data-stage="qualified"], .ml-lane[data-stage="handoff"] { --lane-accent: #8b632d; --lane-tint: #e9d9b9; }
.ml-lane[data-stage="upcoming_call"], .ml-lane[data-stage="ping_chefs"], .ml-lane[data-stage="won"] { --lane-accent: #466654; --lane-tint: #d5e0d3; }
.ml-lane__head {
  display: flex;
  flex: none;
  align-items: center;
  gap: .4rem;
  padding: .5rem .65rem;
  border-bottom: 1px solid var(--ml-line);
}
.ml-lane__head::before { content: ""; flex: none; width: .45rem; height: .45rem; border-radius: 50%; background: var(--lane-accent); }
.ml-lane__head h2 { margin: 0; font-family: inherit; font-weight: 700; font-size: .86rem; line-height: 1.25; }
.ml-lane__count {
  flex: none;
  margin-left: auto;
  background: var(--lane-tint);
  padding: .15rem .4rem;
  border-radius: 4px;
  color: var(--ml-ink);
  font-size: .75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ml-lane__list {
  overflow-y: auto;
  min-height: 0;
  padding: .4rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  scrollbar-width: thin;
  scrollbar-color: #bfae9d transparent;
}
#my-leads-board .ml-card {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  align-items: stretch;
  flex-direction: column;
  gap: .1rem;
  width: 100%;
  min-width: 0;
  height: auto;
  margin: 0;
  padding: 0 var(--ml-card-inset) .45rem;
  border: 1px solid #ddcfc0;
  border-radius: 7px;
  background: var(--ml-paper);
  box-shadow: 0 1px 2px rgb(65 37 21 / 5%);
  color: var(--ml-ink);
  text-align: left;
  text-transform: none;
  font: inherit;
  letter-spacing: normal;
  cursor: pointer;
}
@media (hover: hover) {
  #my-leads-board .ml-card:hover { border-color: var(--lane-accent); background: #fff; }
}
#panel-my-leads :is(button, a, input, select):focus-visible { outline: 2px solid #774328; outline-offset: 2px; }
.ml-card__banner {
  margin: 0 calc(-1 * var(--ml-card-inset)) .16rem;
  padding: .17rem var(--ml-card-inset);
  border-radius: 6px 6px 0 0;
  background: #e5ede6;
  color: #2c503c;
  font-size: .7rem;
  font-weight: 700;
  line-height: 1.25;
}
.ml-card[data-timing="unknown"] .ml-card__banner { background: #f1ece5; color: #635e57; }
.ml-card:is([data-timing="today"], [data-timing="ongoing"]) .ml-card__banner { background: #f6e5bd; color: #674615; }
.ml-card[data-timing="past"] .ml-card__banner { background: #f8dcd6; color: #882725; }
#my-leads-board .ml-card__open {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  color: inherit;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
  font-family: var(--font-serif, Georgia, serif);
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.22;
  margin: 0;
}
.ml-card:has(.ml-card__open:focus-visible) { outline: 2px solid #774328; outline-offset: 1px; }
.ml-card__contacts { display: grid; grid-template-columns: minmax(0, 1fr); gap: .12rem; margin: .18rem 0 0; }
.ml-card__contacts > div { display: grid; grid-template-columns: 2.15rem minmax(0, 1fr); gap: .2rem; align-items: baseline; }
.ml-card__contacts dt, .ml-card__contacts dd { min-width: 0; margin: 0; font-size: .75rem; line-height: 1.25; }
.ml-card__contacts dt, .ml-card__missing { color: var(--ml-muted); }
.ml-card__contacts a { display: block; width: fit-content; max-width: 100%; color: #70362d; }
.ml-card__contacts a:hover { color: #461510; background: #f4eae2; }
.ml-card__outcome { margin: .15rem 0 0; padding-left: .4rem; border-left: 2px solid #b96459; color: #80322a; font-size: .74rem; line-height: 1.25; }
.ml-card__client { font-size: .77rem; line-height: 1.25; }
.ml-card__meta, .ml-card__next { font-size: .73rem; line-height: 1.25; color: var(--ml-muted); }
.ml-card__next { margin-top: .15rem; border-top: 1px solid #e7dfd6; padding-top: .22rem; font-weight: 600; }
.ml-lane__head h2,
.ml-card > :is(button, span, p, .ml-card__banner),
.ml-card__contacts :is(a, dd:not(:has(a))) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ml-lane__empty { margin: 0; padding: 1.1rem .6rem; font-size: .83rem; color: var(--ml-muted); text-align: center; }
.ml-feedback { display: flex; align-items: center; gap: 1rem; margin: 0 0 1rem; padding: 1rem; background: var(--ml-paper); border: 1px solid var(--ml-line); border-radius: 7px; }
.ml-feedback p { margin: 0; }
#my-leads-retry { border-color: var(--ml-line); background: var(--ml-paper); color: var(--ml-ink); }
.ml-profile-nav { gap: .55rem; margin: 0 0 .2rem; }
#panel-my-leads .ml-profile-nav button {
  min-height: 2rem;
  padding: .3rem 0;
  border: 0;
  border-radius: 3px;
  color: #6c5146;
  font-size: .78rem;
}
#panel-my-leads .ml-profile-nav button:hover {
  color: var(--ml-ink);
  background: #eee6db;
}

.ml-next-action {
  --action-ink: #77502c;
  --action-icon-fill: #f3e8d8;
  display: grid;
  gap: .65rem;
  min-width: 0;
  margin: 0 0 1.35rem;
  color: var(--ml-ink);
}
.ml-next-action.is-critical {
  --action-ink: #873327;
  --action-icon-fill: #f7e4dd;
}
.ml-next-action.is-done {
  --action-ink: #365c43;
  --action-icon-fill: #e5efe5;
}
.ml-next-action__heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: .65rem;
}
.ml-next-action__icon {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: .55rem;
  background: var(--action-icon-fill);
  color: var(--action-ink);
}
.ml-next-action__icon svg { display: block; width: 1.22rem; height: 1.22rem; }
.ml-next-action__label {
  display: block;
  margin: 0 0 .1rem;
  color: var(--action-ink);
  font-size: .76rem;
  font-weight: 650;
  line-height: 1.25;
}
.ml-next-action__title {
  margin: 0;
  color: var(--ml-ink);
  font: 700 1.05rem/1.35 "DM Sans", sans-serif;
  letter-spacing: normal;
  text-transform: none;
  overflow-wrap: anywhere;
}
.ml-next-action__detail, .ml-next-action__meta { margin: 0; color: #644e43; font-size: .87rem; line-height: 1.5; }
.ml-next-action__meta { font-size: .78rem; }
.ml-next-action__footer { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem 1rem; }
.ml-next-action__footer:empty { display: none; }
.ml-next-action__footer .ml-next-action__meta { margin-right: auto; }
.ml-next-action button {
  min-height: 2.3rem;
  padding: .4rem .85rem;
  border: 0;
  border-radius: .4rem;
  background: #f2e9df;
  color: #573429;
  font: 650 .8rem/1.35 "DM Sans", sans-serif;
  letter-spacing: normal;
  text-transform: none;
  cursor: pointer;
}
.ml-next-action button:hover { background: #e9dccf; }
.ml-next-action button:disabled { cursor: default; opacity: .65; }
.ml-next-action__form { display: grid; gap: .4rem; }
.ml-next-action__form label { font-size: .8rem; font-weight: 650; }
.ml-next-action__form textarea {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 4rem;
  padding: .5rem .6rem;
  border: 1px solid #c8b6a6;
  border-radius: 4px;
  background: #fff;
  color: var(--ml-ink);
  font: inherit;
  font-size: .9rem;
  resize: vertical;
}
.ml-next-action__error { margin: 0; color: #8d2929; font-size: .82rem; }
.ml-next-action__controls { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.ml-next-action [data-action-submit] { background: #543126; color: #fff; }
.ml-next-action [data-action-submit]:hover { background: #3b211a; }
.ml-next-action [data-action-cancel] { background: transparent; }
.ml-next-action :is(button, textarea):focus-visible {
  outline: 2px solid #865239;
  outline-offset: 2px;
}
#panel-my-leads .ml-profile-nav button:focus-visible {
  background: #eee6db;
  outline: 2px solid #774328;
}
#my-leads-workspace-host { min-width: 0; }
#my-leads-workspace-host .inq-lead-workspace { width: 100%; }
#my-leads-detail .my-leads-duplicate-title { display: none; }
#my-leads-detail .inq-view-event-hero { padding: .7rem 1rem; }
#my-leads-detail .inq-view-event-hero__sub { margin: 0; }
#my-leads-detail .inq-event-header-actions { z-index: 60; }
@container inq-lead-main (max-width: 38rem) {
  .ml-next-action {
    gap: .65rem;
    padding-bottom: .95rem;
    margin-bottom: .95rem;
    border-bottom: 1px solid var(--ml-line);
  }
  .ml-next-action__detail { font-size: .95rem; }
  .ml-next-action__title { font-size: 1.12rem; }

  /* Live event timing is shown with the stage. Older leads can have only an action date. */
  .inq-view-hpanel:has([data-event-dated]) .ml-next-action__meta,
  .inq-view-hpanel:has([data-event-dated]) .ml-next-action__footer:has(.ml-next-action__meta:only-child) { display: none; }
  .ml-next-action__footer { flex-direction: column; align-items: stretch; }
  .ml-next-action button { min-height: 44px; }
  .ml-next-action [data-action-complete] {
    background: var(--event-accent);
    color: #fff;
    font-size: .9rem;
  }
  .ml-next-action [data-action-complete]:hover { background: #4b281f; }
  .ml-next-action__form textarea { font-size: 1rem; }
}
@media (min-width: 761px) {
  #panel-my-leads .ml-views button { min-height: 1.875rem; padding: .3rem .65rem; font-size: .78rem; }
  #my-leads-search { min-height: 2.2rem; padding-block: .3rem; }
  .ml-lane { container: lead-lane / inline-size; }
}
@media (min-width: 761px) and (max-width: 1366px) {
  .ml-toolbar { gap: .6rem; margin-bottom: .75rem; }
  .ml-tools { gap: .65rem; flex-wrap: wrap; }
  #my-leads-search { width: clamp(9rem, 16vw, 13rem); }
  .ml-lane { max-height: max(19rem, calc(100dvh - 10.75rem - var(--admin-hub-dock-clearance, 1rem))); }
}
/* Let an address or phone number use the full line in the smallest lanes.
   Keep the field name visible when contact information is missing. */
@container lead-lane (max-width: 14rem) {
  .ml-card__contacts > div:has(a) { display: block; }
  .ml-card__contacts > div:has(a) dt {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}
@media (max-width: 720px) {
  .ml-toolbar { align-items: flex-start; margin-bottom: .75rem; }
  .ml-board {
    grid-template-columns: none;
    grid-auto-columns: min(82%, 20rem);
    grid-auto-flow: column;
    gap: .65rem;
    overflow-x: auto;
    padding: 1px 0 .45rem;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }
  .ml-lane { scroll-snap-align: start; max-height: max(18rem, calc(100dvh - 13rem - var(--admin-hub-dock-clearance, 1rem))); }
}
@media (max-width: 620px) {
  .ml-rep { grid-area: rep; justify-self: end; }
  .ml-rep label { display: none; }
  .ml-toolbar { display: grid; grid-template: "views rep" auto "search count" auto / 1fr auto; row-gap: .6rem; }
  .ml-tools { display: contents; }
  .ml-views { grid-area: views; justify-self: start; }
  .ml-count { grid-area: count; justify-self: end; align-self: center; }
  .ml-search { grid-area: search; }
  #my-leads-search { width: 11rem; max-width: 60vw; }
  .ml-lane { max-height: max(18rem, calc(100dvh - 16rem - var(--admin-hub-dock-clearance, 1rem))); }
}

.admin-dash__main:has(#panel-my-leads:not([hidden]) #my-leads-detail:not([hidden])) .admin-dash__head { display: none; }


@media (max-width: 365px) {
  #panel-my-leads .ml-views button { padding-inline: .5rem; }
  .ml-rep select, .ml-rep [role="combobox"] { min-width: 7.5rem; }
}
