/*
 * Customer 360 (2 Oct 2026): the customers list, one customer's page, the
 * Create service case drawer, and the customer bits in the call list, the
 * call drawer and the Live calls drawer. --ag-* tokens only. Prefix cs-.
 */

/* ---------- shared marks ---------- */
.cs-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
}
/* repeat: a small red outline chip (colour on the edge and word, no fill) */
.cs-repeat {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--ag-red) 35%, var(--ag-line));
  background: var(--ag-card);
  color: var(--ag-red);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.cs-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--ag-btn-line);
  background: var(--ag-card);
  color: var(--ag-ink-2);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.cs-caselink {
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ag-ink);
  text-decoration: underline;
  text-decoration-color: var(--ag-dot);
  text-underline-offset: 3px;
  border-radius: 4px;
  white-space: nowrap;
}
.cs-caselink:hover {
  text-decoration-color: currentColor;
}
.cs-dot {
  color: var(--ag-faint);
}

/* ---------- the list ---------- */
.cs-search {
  flex: 0 1 300px;
}
.cs-dates {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ag-muted);
}
.cs-dates[hidden] {
  display: none;
}
.ap .cs-date {
  width: 150px;
  height: 38px;
}
.cs-cust {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--ag-ink);
  border-radius: 4px;
}
.cs-cust__name {
  font-weight: 500;
}
.cs-row:hover .cs-cust__name {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cs-open {
  font-weight: 500;
  color: var(--ag-ink);
}
.cs-empty {
  padding: 64px 24px;
}

/* ---------- one customer: the header card ---------- */
.cs-page {
  gap: 20px;
}
.cs-crumbs {
  margin-bottom: -8px;
}
.cs-head {
  gap: 20px;
  padding: 22px 24px;
}
.cs-head__top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.cs-head__who {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.cs-avatar {
  width: 48px;
  height: 48px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ag-well);
  border: 1px solid var(--ag-well-line);
  color: var(--ag-ink-2);
}
.cs-title {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.cs-numline {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--ag-ink-2);
}
.cs-numline .cs-num {
  margin-inline-end: 4px;
}
.ap .cs-mini {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border-color: transparent;
  color: var(--ag-muted);
}
.ap .cs-mini:hover {
  color: var(--ag-ink);
}
.cs-revealed {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--ag-muted);
}
.cs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.cs-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding-block: 0;
  padding-inline: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--ag-set-line);
  background: var(--ag-set);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ag-ink-2);
}
.cs-chip .cv-dot {
  width: 18px;
  height: 18px;
}
.cs-chip .cv-dot svg {
  width: 9px;
  height: 9px;
}
.cs-head__actions {
  flex: none;
  display: flex;
  gap: 8px;
}
.cs-head__actions .ag-btn {
  gap: 6px;
}
.cs-facts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}
.cs-fact {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px 12px;
  border-radius: 12px;
  background: var(--ag-well);
  border: 1px solid var(--ag-well-line);
}
.cs-fact dt {
  font-size: 12px;
  color: var(--ag-muted);
}
.cs-fact dd {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ag-ink);
  font-variant-numeric: tabular-nums;
}

/* ---------- tabs body ---------- */
.cs-body {
  padding: 18px 20px 20px;
}
.cs-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.cs-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cs-fchip {
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--ag-btn-line);
  background: var(--ag-card);
  font-size: 13px;
  font-weight: 500;
  color: var(--ag-ink-2);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.cs-fchip:hover {
  background: var(--ag-hover);
}
.cs-fchip[aria-checked="true"] {
  background: var(--ag-dark);
  border-color: var(--ag-dark);
  color: var(--ag-dark-ink);
}
.cs-day {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cs-day__label {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ag-muted);
}
.cs-calls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cs-call {
  border-radius: 14px;
  border: 1px solid var(--ag-line);
  background: var(--ag-card);
  transition: border-color 0.15s ease;
}
.cs-call:hover,
.cs-call.is-open {
  border-color: var(--ag-btn-line);
}
.cs-call__head {
  position: relative;
}
.cs-call__toggle {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  text-align: start;
  color: var(--ag-ink);
}
.cs-call__dir {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--ag-well);
  border: 1px solid var(--ag-well-line);
  color: var(--ag-ink-2);
}
.cs-call__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cs-call__line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--ag-ink-2);
}
.cs-call__strong {
  font-weight: 600;
  color: var(--ag-ink);
}
.cs-call__line .cv-dot {
  width: 18px;
  height: 18px;
}
.cs-call__line .cv-dot svg {
  width: 9px;
  height: 9px;
}
.cl-chan__disc {
  position: relative;
  display: inline-flex;
}
.cs-call__summary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ag-muted);
}
.cs-call.is-open .cs-call__summary {
  display: none;
}
.cs-call__chev {
  flex: none;
  margin-top: 6px;
  color: var(--ag-faint);
  transition: transform 0.15s ease;
}
.cs-call.is-open .cs-call__chev {
  transform: rotate(180deg);
}
.cs-call__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-block: 0 14px;
  padding-inline: 60px 16px;
  margin-top: -6px;
}
.cs-alerttag {
  margin-top: 0;
}
.cs-call__body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-block: 4px 18px;
  padding-inline: 60px 16px;
}
.cs-call__body[hidden] {
  display: none;
}
.cs-sec {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cv-actlist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cs-call__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cs-call__links .ag-btn {
  gap: 6px;
}
.cs-none {
  margin: 0;
  padding: 24px 0;
  text-align: center;
  font-size: 14px;
  color: var(--ag-muted);
}
.cs-noncases {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 0 32px;
}
.cs-noncases .ag-btn {
  gap: 6px;
}
.cs-caseframe {
  margin: 0;
}
.cs-casenum {
  font-weight: 600;
}
.cs-status--open {
  background: var(--ag-i-blue);
}
.cs-status--closed {
  background: var(--ag-dot);
}
.cs-pri {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--ag-btn-line);
  font-size: 12px;
  font-weight: 500;
  color: var(--ag-ink-2);
}
.cs-pri--high {
  border-color: color-mix(in srgb, var(--ag-red) 35%, var(--ag-line));
  color: var(--ag-red);
}

/* ---------- Create service case drawer ---------- */
.cs-case {
  max-width: 560px;
}
.cs-case__for {
  margin: 4px 0 0;
  font-size: 13.5px;
  color: var(--ag-muted);
}
.cs-case .drawer__body {
  gap: 20px;
  font-family: var(--font-ui);
  line-height: normal;
  color: var(--ag-ink);
}
.cs-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cs-label {
  margin: 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ag-ink);
}
.cs-help {
  margin: 0;
  font-size: 12.5px;
  color: var(--ag-muted);
}
.cs-error {
  margin: 0;
  font-size: 12.5px;
  color: var(--ag-red);
}
.cs-case .input,
.cs-case .textarea,
.cs-case .select-trigger {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--ag-btn-line);
  background: var(--ag-card);
  color: var(--ag-ink);
  font-size: 14px;
}
.cs-case .input,
.cs-case .select-trigger {
  height: 42px;
}
.cs-textarea {
  min-height: 130px;
  line-height: 1.55;
  resize: vertical;
}
.cs-case [aria-invalid="true"] {
  border-color: var(--ag-red);
}
.cs-seg {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--ag-hover);
}
.cs-seg__opt {
  height: 36px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ag-muted);
}
.cs-seg__opt[aria-checked="true"] {
  background: var(--ag-card);
  color: var(--ag-ink);
  box-shadow: 0 0 0 1px var(--ag-line), 0 1px 3px rgba(0, 0, 0, 0.06);
}
.cs-readonly {
  margin: 0;
  padding: 11px 12px;
  border-radius: 10px;
  background: var(--ag-well);
  border: 1px solid var(--ag-well-line);
  font-size: 14px;
  color: var(--ag-ink-2);
}

/* ---------- in the call list: the caller links to the customer ---------- */
.cl-caller {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.cl-caller a {
  color: var(--ag-ink);
  text-decoration: underline;
  text-decoration-color: var(--ag-dot);
  text-underline-offset: 3px;
  border-radius: 4px;
}
.cl-caller a:hover {
  text-decoration-color: currentColor;
}
.cl-caller .cs-repeat {
  height: 20px;
  padding: 0 7px;
  font-size: 11.5px;
}

/* ---------- in the call drawer: the customer ---------- */
.cs-callerlink {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--ag-dot);
  text-underline-offset: 4px;
}
.cs-callerlink:hover {
  text-decoration-color: currentColor;
}
.cs-calls-count {
  font-size: 15px;
  font-weight: 500;
  color: var(--ag-muted);
}
.cs-this {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--ag-well);
  border: 1px solid var(--ag-well-line);
}
.cs-this__head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cs-this__title {
  flex: 1;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.cs-this__facts {
  margin: 0;
  font-size: 13px;
  color: var(--ag-muted);
}
.cs-this__list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cs-this__call {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 8px;
  text-align: start;
  font-size: 13px;
  color: var(--ag-ink-2);
}
.cs-this__call:hover {
  background: var(--ag-card);
}
.cs-this__when {
  min-width: 96px;
  color: var(--ag-ink);
  font-weight: 500;
}
.cs-this__agent {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cs-this__view {
  align-self: flex-start;
}

/* ---------- in the Live calls drawer: earlier calls from this number ---------- */
.lv-prev {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 899px) {
  .cs-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cs-head__top {
    flex-direction: column;
  }
}
@media (max-width: 559px) {
  .cs-call__tags,
  .cs-call__body {
    padding-inline-start: 16px;
  }
}

/* a channel chip is the disc only; its name on hover (3 Oct 2026) */
.cs-chip--icon {
  padding: 0 2px;
}

/* ---------- the list, 3 Oct 2026 (Ameer's reference) ----------
   the name with its number beside it on one line; grouped by day; counts to the end */
.cs-cust--line {
  flex-direction: row;
  align-items: baseline;
  gap: 8px;
}
.cs-num--faint {
  font-size: 12.5px;
  color: var(--ag-muted);
}
.cs-num--plain {
  color: var(--ag-ink-2);
}
.cs-row:hover .cs-num--plain {
  color: var(--ag-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cs-table .cs-n {
  text-align: end;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.cs-table th.cs-n {
  font-family: inherit;
}
.cs-n--zero {
  color: var(--ag-muted);
}
.cs-time {
  color: var(--ag-ink-2);
}
.cs-agent {
  color: var(--ag-ink-2);
}
.cs-dayrow th {
  padding: 16px 12px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ag-muted);
  text-align: start;
  border-bottom: 1px solid var(--ag-line);
  background: var(--ag-card);
}
.cs-foot {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--ag-muted);
}

/* ---------- On a call now (3 Oct 2026): a customer on a live call, beside their name ---------- */
.cs-oncall {
  margin-inline-start: 8px;
  padding-inline: 8px 9px;
  height: 22px;
  font-size: 12px;
  vertical-align: middle;
}

/* the table's screen-reader-only labels stay inside the scrolling frame (no page-wide scroll on phones) */
.cs-page .cl-frame {
  position: relative;
}

/* ---------- the list, 3 Oct 2026 rebuild: a numbers line, tabs in the card, one line a row ---------- */
.cs-numline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  margin: 4px 0 0;
  font-size: 13.5px;
  color: var(--ag-muted);
}
.cs-numline__sep {
  color: var(--ag-dot);
}
.cs-numlink {
  padding: 0 2px;
  border-radius: 4px;
  font: inherit;
  color: var(--ag-ink-2);
}
.cs-numlink:hover {
  color: var(--ag-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cs-custline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}
.cs-livedot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ag-live);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ag-live) 18%, transparent);
}
.cs-agent .cl-v {
  margin-inline-start: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ag-muted);
}
.cs-table .cs-newtab {
  width: 1%;
  padding-inline: 4px 10px;
  text-align: end;
}
.cs-newtab__btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: var(--ag-muted);
  opacity: 0;
}
.cs-row:hover .cs-newtab__btn,
.cs-newtab__btn:focus-visible {
  opacity: 1;
}
.cs-newtab__btn:hover {
  color: var(--ag-ink);
  background: var(--ag-hover);
}
@media (hover: none) {
  .cs-newtab__btn {
    opacity: 1;
  }
}

/* ---------- the list, 3 Oct 2026: the customer's round avatar, the name over the number ---------- */
.cs-custline .hm-avatar {
  width: 32px;
  height: 32px;
  font-size: 11.5px;
}
.cs-cust--stack {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.cs-cust--stack .cs-num--faint {
  font-size: 12px;
}
.cs-custline {
  gap: 10px;
}
.cs-table td {
  padding-block: 10px;
}
