/* ============================================================
   MM 客服系统 — clean light login skin (18.163.247.227 only).
   47 keeps custom.css; this file replaces it on the MM deployment.
   Scope of the auth part: the auth layout <main class="... bg-n-brand/5 ...">.
   ============================================================ */

main[class*="bg-n-brand"] {
  background: #f4f6fa !important;
  color-scheme: light;
}

/* The auth shell always uses the light logo (both LOGO and LOGO_DARK point at the MM mark). */
main[class*="bg-n-brand"] img[class*="dark:block"] { display: none !important; }
main[class*="bg-n-brand"] img[class*="dark:hidden"] { display: block !important; }
main[class*="bg-n-brand"] section img {
  height: 56px !important;
  width: 56px !important;
  object-fit: contain;
  border-radius: 14px;
}

main[class*="bg-n-brand"] h2 {
  color: #101828 !important;
  font-size: 22px !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  text-shadow: none !important;
}
main[class*="bg-n-brand"] > section > p {
  color: #667085 !important;
}

/* the card */
main[class*="bg-n-brand"] section[class*="bg-white"] {
  background: #ffffff !important;
  border: 1px solid #eaecf0 !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 28px rgba(16, 24, 40, 0.06) !important;
  backdrop-filter: none !important;
}
main[class*="bg-n-brand"] section[class*="bg-white"]::before { display: none !important; }

main[class*="bg-n-brand"] label,
main[class*="bg-n-brand"] section[class*="bg-white"] span,
main[class*="bg-n-brand"] section[class*="bg-white"] p {
  color: #344054 !important;
}
main[class*="bg-n-brand"] a { color: #2563eb !important; }
main[class*="bg-n-brand"] a:hover { color: #1d4ed8 !important; }

main[class*="bg-n-brand"] input {
  background: #ffffff !important;
  color: #101828 !important;
  border: 1px solid #d0d5dd !important;
  border-radius: 10px !important;
  box-shadow: none !important;
}
main[class*="bg-n-brand"] input::placeholder { color: #98a2b3 !important; }
main[class*="bg-n-brand"] input:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
  outline: none !important;
}
main[class*="bg-n-brand"] input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
  -webkit-text-fill-color: #101828 !important;
}

main[class*="bg-n-brand"] button[type="submit"] {
  background: #2563eb !important;
  border: 0 !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em;
}
main[class*="bg-n-brand"] button[type="submit"] span { color: #ffffff !important; }
main[class*="bg-n-brand"] button[type="submit"]:hover { background: #1d4ed8 !important; }

/* The console launcher's fallback buttons exist for a dashboard whose sidebar was not found;
   on the sign-in page there is nothing to open, so keep it clean. */
body:has(main[class*="bg-n-brand"]) .cspc-fallback { display: none !important; }


/* ------------------------------------------------------------------------- */
/* Agent dashboard: conversation contact panel (the right-hand sidebar).     */
/* Scoped to the panel's own hardcoded width classes, so nothing else in the */
/* dashboard — and nothing on the auth pages — can match.                    */

/* 2026-08-21: the panel text runs large for the amount of metadata it holds.
   zoom shrinks the whole panel uniformly (text, paddings, icons) which reads
   better than shrinking fonts alone; supported by Chrome/Edge and Firefox 126+. */
div[class*="bg-n-surface-2"][class*="md:w-[320px]"][class*="md:min-w-[320px]"] {
  zoom: 0.85;
}

/* ── 2026-08-22: contacts list, compact cards (take 3) ───────────────────────
   Take 1 scoped through a layout wrapper this route does not render; take 2
   matched, but `> div` also padded the card's collapse wrapper (the expandable
   edit form), leaving a dead 16px strip under every collapsed card — and the
   user still found the rows too tall. Take 3 pads only the content row
   (`> div.flex`; the collapse wrapper is `grid`, not `flex`) and shrinks the
   avatar with `zoom`, which scales its inline px sizes and the presence badge
   together (per-element overrides would misplace the badge). */
[class*="group/cardLayout"] > div.flex {
  padding-top: 6px !important;
  padding-bottom: 6px !important;
  padding-left: 16px !important;
  padding-right: 16px !important;
}
/* the list that stacks the cards: 16px gaps become 6px */
div:has(> .relative > [class*="group/cardLayout"]) {
  gap: 6px !important;
}
/* name line a step down so the two text lines settle around 40px */
[class*="group/cardLayout"] .text-base {
  font-size: 14px !important;
  line-height: 1.3 !important;
}
[class*="group/cardLayout"] .flex.items-center.justify-start.flex-1.gap-4 {
  gap: 12px !important;
}
/* 42px avatar → ~34px, badge and initials scale along */
[class*="group/cardLayout"] [class*="group/avatar"] {
  zoom: 0.8;
}

/* ── 2026-08-22: automation editor, roomier condition/action rows ────────────
   The rows pack selects, value pickers and the delete button at a 8px gap
   with 8px row padding, which reads cramped once a value chip is present.
   The ul signature (grid + p-3 + list-none + rounded-xl) exists only on the
   automation editor's condition/action blocks. */
ul.grid.p-3.list-none.rounded-xl {
  padding: 16px !important;
}
ul.grid.p-3.list-none.rounded-xl li.list-none {
  padding-top: 6px !important;
  padding-bottom: 6px !important;
}
ul.grid.p-3.list-none.rounded-xl li .flex.items-center.gap-2 {
  gap: 10px !important;
}

/* Mobile mis-tap fix: the resolve split-button used to sit directly under the back button,
   square in thumb territory, and agents kept resolving conversations by accident. Push the
   whole action row to the right edge and order the resolve group last, so reaching it is a
   deliberate stretch. Width-gated: desktop layouts are untouched. */
@media (max-width: 768px) {
  .actions--container {
    width: 100%;
    justify-content: flex-end !important;
  }
  .actions--container > div:first-child {
    order: 99;
    margin-inline-start: 10px;
  }
}
