/*
 * RingCraft Design V1 — Call Mode
 * Presentation only. All queue, outcome, logging and dialer contracts remain unchanged.
 */

#callmode-screen {
  isolation: isolate;
  color: var(--rc-ink);
  background:
    radial-gradient(circle at 8% -8%, color-mix(in srgb, var(--rc-blue) 10%, transparent), transparent 30rem),
    var(--rc-canvas);
}

#callmode-screen .cm-hero {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  padding: 18px clamp(20px, 3vw, 44px) 14px;
  color: #fff;
  background:
    linear-gradient(115deg, color-mix(in srgb, var(--rc-navy) 96%, var(--rc-blue)), var(--rc-navy) 58%, #152344);
  border-bottom: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 10px 30px rgba(8, 15, 31, .14);
}

#callmode-screen .cm-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 70%, rgba(255,255,255,.035)),
    radial-gradient(circle at 91% 0, rgba(95,130,238,.32), transparent 24rem);
}

#callmode-screen .cm-hero-main,
#callmode-screen .cm-hero-toolbar,
#callmode-screen .cm-toolbar-left,
#callmode-screen .cm-toolbar-right {
  display: flex;
  align-items: center;
}

#callmode-screen .cm-hero-main { min-width: 0; }
#callmode-screen .cm-hero-toolbar { gap: 18px; justify-content: flex-end; }
#callmode-screen .cm-toolbar-left,
#callmode-screen .cm-toolbar-right { gap: 8px; }

#callmode-screen .cm-hero-eyebrow {
  margin-bottom: 3px;
  font: 700 10px/1.2 var(--rc-font-ui);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #9eb6ff;
}

#callmode-screen .cm-hero-title {
  margin: 0;
  font: 720 clamp(24px, 2.2vw, 34px)/1.08 var(--rc-font-ui);
  letter-spacing: -.035em;
  color: #fff;
}

#callmode-screen .cm-hero-subtitle {
  margin: 7px 0 0;
  max-width: 680px;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255,255,255,.66);
}

#callmode-screen .cm-hero .btn {
  min-height: 36px;
  color: rgba(255,255,255,.84);
  background: rgba(255,255,255,.075);
  border-color: rgba(255,255,255,.16);
  backdrop-filter: blur(8px);
}

#callmode-screen .cm-hero .btn:hover {
  color: #fff;
  background: rgba(255,255,255,.13);
  border-color: rgba(255,255,255,.28);
  transform: translateY(-1px);
}

#callmode-screen #cm-queue-info {
  font: 600 11px/1.2 var(--rc-font-mono);
  color: #b7c8f9;
  white-space: nowrap;
}

#callmode-screen .callmode-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 350px);
  align-items: start;
  gap: clamp(16px, 2vw, 26px);
  width: min(1440px, 100%);
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(18px, 2vw, 30px);
}

#callmode-screen .callmode-left,
#callmode-screen .callmode-right { min-width: 0; width: auto; }

#callmode-screen .callmode-right {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 12px;
}

#callmode-screen .callmode-right > .card,
#callmode-screen #cm-log-section,
#callmode-screen #cm-lead-card {
  margin: 0 !important;
  background: color-mix(in srgb, var(--rc-surface) 97%, var(--rc-canvas));
  border: 1px solid var(--rc-line);
  border-radius: var(--rc-radius-lg);
  box-shadow: var(--rc-shadow-sm);
}

#callmode-screen #cm-lead-card {
  position: relative;
  overflow: hidden;
  min-height: 260px;
  padding: clamp(20px, 2.2vw, 30px);
}

#callmode-screen #cm-lead-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--rc-blue), #7595f2 65%, transparent);
}

#callmode-screen .cm-filter-container { max-width: 820px; margin: 0 auto; }

#callmode-screen .cm-filter-header {
  padding-bottom: 18px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--rc-line);
}

#callmode-screen .cm-filter-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#callmode-screen .cm-filter-header-title {
  font-size: 17px;
  font-weight: 720;
  letter-spacing: -.018em;
}

#callmode-screen .cm-filter-subtitle,
#callmode-screen .cm-mobile-toggle-hint,
#callmode-screen .cm-log-hint {
  color: var(--rc-muted);
  font-size: 12px;
  line-height: 1.5;
}

#callmode-screen .cm-filter-total-badge,
#callmode-screen .cm-filter-total-loading {
  padding: 5px 9px;
  border: 1px solid color-mix(in srgb, var(--rc-blue) 20%, var(--rc-line));
  border-radius: 999px;
  font: 650 10px/1 var(--rc-font-mono);
  color: var(--rc-blue);
  background: var(--rc-blue-soft);
}

#callmode-screen .cm-session-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid var(--rc-line);
  border-radius: var(--rc-radius-sm);
  color: var(--rc-muted);
  background: var(--rc-surface-muted);
  font-size: 12px;
}

#callmode-screen .cm-session-banner-clear {
  border: 0;
  color: var(--rc-blue);
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}

#callmode-screen .cm-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

#callmode-screen .cm-filter-grid > div {
  padding: 13px;
  border: 1px solid var(--rc-line);
  border-radius: var(--rc-radius-md);
  background: color-mix(in srgb, var(--rc-surface-muted) 55%, transparent);
}

#callmode-screen .cm-filter-col-label {
  margin: 0 0 9px;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--rc-muted);
}

#callmode-screen .cm-filter-label {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--rc-motion-fast), border-color var(--rc-motion-fast), transform var(--rc-motion-fast);
}

#callmode-screen .cm-filter-label:hover {
  border-color: var(--rc-line);
  background: var(--rc-surface);
  transform: translateX(2px);
}

#callmode-screen .cm-filter-label input { accent-color: var(--rc-blue) !important; }
#callmode-screen .cm-filter-stage-name,
#callmode-screen .cm-filter-outcome-name { min-width: 0; font-size: 12px; font-weight: 620; }
#callmode-screen .cm-filter-label-dim { opacity: .55; }

#callmode-screen .cm-filter-count-stage,
#callmode-screen .cm-filter-count-outcome {
  padding: 2px 6px !important;
  border-radius: 999px !important;
  font: 650 10px/1.2 var(--rc-font-mono) !important;
}

#callmode-screen .cm-mobile-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 9px;
  align-items: center;
  margin: 16px 0;
  padding: 12px 14px;
  border: 1px solid var(--rc-line);
  border-radius: var(--rc-radius-md);
  background: var(--rc-surface);
}

#callmode-screen .cm-mobile-toggle-hint { grid-column: 2; }
#callmode-screen .cm-mobile-toggle-label { font-size: 12px; font-weight: 680; cursor: pointer; }

#callmode-screen .cm-start-calling-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: var(--rc-blue);
  box-shadow: 0 8px 20px rgba(30,79,216,.18);
  font-size: 13px;
  font-weight: 720;
  cursor: pointer;
  transition: transform var(--rc-motion-fast), background var(--rc-motion-fast), box-shadow var(--rc-motion-fast);
}

#callmode-screen .cm-start-calling-btn:hover {
  background: var(--rc-blue-hover);
  box-shadow: 0 10px 24px rgba(30,79,216,.26);
  transform: translateY(-1px);
}

#callmode-screen #cm-perf-bar:not(:empty) { margin-bottom: 12px; }
#callmode-screen .cm-perf-bar {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) repeat(3, auto);
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 1px solid var(--rc-line);
  border-radius: var(--rc-radius-md);
  color: var(--rc-muted);
  background: var(--rc-surface);
  font-size: 11px;
}

#callmode-screen .cm-perf-total { font: 750 16px/1 var(--rc-font-mono); color: var(--rc-ink); }
#callmode-screen .cm-perf-total-target { color: var(--rc-muted); font-size: 11px; }
#callmode-screen .cm-perf-progress-track { height: 5px; overflow: hidden; border-radius: 999px; background: var(--rc-surface-muted); }
#callmode-screen .cm-perf-progress-fill { height: 100%; border-radius: inherit; background: var(--rc-blue) !important; }
#callmode-screen .cm-perf-booked { color: var(--rc-booked) !important; font-weight: 700; }

#callmode-screen #cm-log-section { margin-top: 14px !important; padding: clamp(18px, 2vw, 24px); }
#callmode-screen .card-header { margin-bottom: 12px; }
#callmode-screen .card-title { display: flex; align-items: center; color: var(--rc-ink); font-size: 12px; font-weight: 730; }
#callmode-screen .card-title svg { color: var(--rc-blue); }

#callmode-screen .outcome-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 16px;
}

#callmode-screen .outcome-btn {
  min-height: 42px;
  padding: 9px 8px;
  border: 1px solid var(--rc-line);
  border-radius: 9px;
  color: var(--rc-ink);
  background: var(--rc-surface);
  font-size: 11px;
  font-weight: 680;
  box-shadow: none;
}

#callmode-screen .outcome-btn:hover {
  border-color: color-mix(in srgb, var(--rc-blue) 42%, var(--rc-line));
  background: var(--rc-blue-soft);
  transform: translateY(-1px);
}

#callmode-screen .outcome-btn.selected {
  color: var(--rc-blue);
  border-color: var(--rc-blue);
  background: var(--rc-blue-soft);
  box-shadow: inset 0 0 0 1px var(--rc-blue);
}

#callmode-screen .outcome-booked,
#callmode-screen [data-outcome="BOOKED"] {
  color: var(--rc-booked) !important;
  border-color: color-mix(in srgb, var(--rc-booked) 42%, var(--rc-line)) !important;
}

#callmode-screen .outcome-booked.selected,
#callmode-screen [data-outcome="BOOKED"].selected {
  background: var(--rc-booked-soft) !important;
  box-shadow: inset 0 0 0 1px var(--rc-booked) !important;
}

#callmode-screen .outcome-won,
#callmode-screen [data-outcome="WON"] {
  color: var(--rc-won) !important;
  border-color: color-mix(in srgb, var(--rc-won) 42%, var(--rc-line)) !important;
}

#callmode-screen .outcome-dead,
#callmode-screen [data-outcome="DEAD"] {
  color: var(--rc-danger) !important;
  border-color: color-mix(in srgb, var(--rc-danger) 35%, var(--rc-line)) !important;
}

#callmode-screen textarea.form-control,
#callmode-screen input.form-control,
#callmode-screen .cm-followup-input,
#callmode-screen .cm-followup-tz {
  border-color: var(--rc-line);
  background: var(--rc-surface-muted);
}

#callmode-screen textarea.form-control:focus,
#callmode-screen input.form-control:focus,
#callmode-screen .cm-followup-input:focus,
#callmode-screen .cm-followup-tz:focus {
  border-color: var(--rc-blue);
  background: var(--rc-surface);
  box-shadow: var(--rc-focus);
}

#callmode-screen .callmode-right > .card { padding: 16px; }
#callmode-screen #cm-script-card { border-top: 3px solid var(--rc-blue); }
#callmode-screen #cm-script-body { color: var(--rc-ink); font-size: 12px; line-height: 1.65; }
#callmode-screen #cm-notes-history,
#callmode-screen #cm-call-history { color: var(--rc-muted); font-size: 11px; line-height: 1.55; }

#callmode-screen .cm-filter-empty,
#callmode-screen .cm-loading-state,
#callmode-screen .cm-no-leads,
#callmode-screen .cm-error-state {
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: 200px;
  padding: 24px;
  text-align: center;
  color: var(--rc-muted);
}

#callmode-screen .cm-filter-empty-icon,
#callmode-screen .cm-no-leads-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 12px;
  color: var(--rc-blue);
  border: 1px solid color-mix(in srgb, var(--rc-blue) 20%, var(--rc-line));
  border-radius: 20px;
  background: var(--rc-blue-soft);
}

@media (max-width: 1020px) {
  #callmode-screen .cm-hero { grid-template-columns: 1fr; }
  #callmode-screen .cm-hero-toolbar { justify-content: space-between; }
  #callmode-screen .callmode-body { grid-template-columns: 1fr; }
  #callmode-screen .callmode-right {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #callmode-screen #cm-script-card { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  #callmode-screen .cm-hero { padding: 14px 14px 12px; gap: 12px; }
  #callmode-screen .cm-hero-subtitle { display: none; }
  #callmode-screen .cm-hero-toolbar { align-items: stretch; gap: 8px; }
  #callmode-screen .cm-toolbar-left,
  #callmode-screen .cm-toolbar-right { flex-wrap: wrap; }
  #callmode-screen .callmode-body { padding: 12px; gap: 12px; }
  #callmode-screen #cm-lead-card { padding: 16px; border-radius: 14px; }
  #callmode-screen .cm-filter-grid { grid-template-columns: 1fr; }
  #callmode-screen .cm-perf-bar { grid-template-columns: auto 1fr auto; }
  #callmode-screen .cm-perf-meta,
  #callmode-screen .cm-perf-gap-ok,
  #callmode-screen .cm-perf-gap-bad { display: none; }
  #callmode-screen .outcome-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #callmode-screen .callmode-right { grid-template-columns: 1fr; }
  #callmode-screen #cm-script-card { grid-column: auto; }
  #callmode-screen .cm-log-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  #callmode-screen *,
  #callmode-screen *::before,
  #callmode-screen *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}


/* RingCraft responsive contract — compact desktop, tablet and touch-first mobile. */
@media (max-width: 1180px) {
  #callmode-screen .callmode-body {
    grid-template-columns: minmax(0, 1fr) minmax(270px, 320px);
    gap: 16px;
    padding: 18px;
  }

  #callmode-screen .cm-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  #callmode-screen .cm-hero-toolbar {
    justify-content: space-between;
  }
}

@media (max-width: 900px) {
  #callmode-screen .cm-hero {
    position: static;
    padding: 16px 18px 14px;
  }

  #callmode-screen .cm-hero-toolbar,
  #callmode-screen .cm-toolbar-left,
  #callmode-screen .cm-toolbar-right {
    min-width: 0;
  }

  #callmode-screen .callmode-body {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px;
  }

  #callmode-screen .callmode-right {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #callmode-screen #cm-script-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  #callmode-screen {
    min-width: 0;
    overflow-x: clip;
  }

  #callmode-screen .cm-hero {
    gap: 10px;
    padding: 13px 12px 11px;
  }

  #callmode-screen .cm-hero-main {
    align-items: flex-start;
  }

  #callmode-screen .cm-hero-title {
    font-size: 24px;
  }

  #callmode-screen .cm-hero-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    width: 100%;
  }

  #callmode-screen .cm-toolbar-left,
  #callmode-screen .cm-toolbar-right {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  #callmode-screen .cm-toolbar-left:empty {
    display: none;
  }

  #callmode-screen .cm-hero .btn {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding-inline: 10px;
    justify-content: center;
  }

  #callmode-screen #cm-queue-info {
    align-self: center;
    white-space: normal;
    text-align: center;
  }

  #callmode-screen .callmode-body {
    gap: 12px;
    padding: 12px;
  }

  #callmode-screen #cm-lead-card,
  #callmode-screen #cm-log-section,
  #callmode-screen .callmode-right > .card {
    border-radius: 14px;
  }

  #callmode-screen #cm-lead-card,
  #callmode-screen #cm-log-section {
    padding: 15px !important;
  }

  #callmode-screen .cm-filter-grid,
  #callmode-screen .callmode-right,
  #callmode-screen .cm-log-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  #callmode-screen #cm-script-card {
    grid-column: auto;
  }

  #callmode-screen .cm-filter-grid > div {
    padding: 10px;
  }

  #callmode-screen .cm-filter-label {
    min-height: 42px;
  }

  #callmode-screen .cm-mobile-toggle {
    align-items: start;
    padding: 12px;
  }

  #callmode-screen .outcome-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #callmode-screen .outcome-btn,
  #callmode-screen .cm-start-calling-btn {
    min-height: 46px;
  }

  #callmode-screen .cm-perf-bar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    overflow: hidden;
  }
}

@media (max-width: 440px) {
  #callmode-screen .cm-hero-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  #callmode-screen .cm-toolbar-left,
  #callmode-screen .cm-toolbar-right {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #callmode-screen .cm-filter-header-row {
    align-items: flex-start;
  }

  #callmode-screen .cm-filter-total-badge,
  #callmode-screen .cm-filter-total-loading {
    flex: 0 0 auto;
  }

  #callmode-screen .outcome-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  #callmode-screen .cm-mobile-toggle {
    grid-template-columns: auto minmax(0, 1fr);
  }
}


/* RingCraft V1 — Call card refinement
 * Resource actions, note composer and secondary destructive action.
 * Presentation only; existing IDs and handlers remain unchanged.
 */
#callmode-screen .cm-info-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 8px !important;
  margin-top: 10px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

#callmode-screen .cm-info-cell {
  position: relative;
  display: flex !important;
  flex-direction: column;
  align-items: flex-start !important;
  justify-content: center !important;
  min-width: 0;
  min-height: 58px;
  padding: 9px 11px !important;
  overflow: hidden;
  border: 1px solid var(--rc-line) !important;
  border-radius: 10px !important;
  background: color-mix(in srgb, var(--rc-surface-muted) 68%, var(--rc-surface)) !important;
  transition:
    border-color var(--rc-motion-fast),
    background var(--rc-motion-fast),
    transform var(--rc-motion-fast),
    box-shadow var(--rc-motion-fast);
}

#callmode-screen .cm-info-cell:hover {
  border-color: color-mix(in srgb, var(--rc-blue) 28%, var(--rc-line)) !important;
  background: var(--rc-surface) !important;
  box-shadow: 0 5px 14px rgba(15, 21, 36, .055);
  transform: translateY(-1px);
}

#callmode-screen .cm-info-label {
  margin-bottom: 5px !important;
  font: 720 8px/1.15 var(--rc-font-ui) !important;
  letter-spacing: .11em !important;
  text-transform: uppercase;
  color: var(--rc-muted) !important;
}

#callmode-screen .cm-info-value,
#callmode-screen .cm-info-value-sm {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  color: var(--rc-ink) !important;
  font: 680 11px/1.25 var(--rc-font-ui) !important;
  text-align: left !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#callmode-screen .cm-info-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--rc-blue) !important;
  font-weight: 720;
  text-decoration: none !important;
}

#callmode-screen .cm-info-link:hover {
  color: var(--rc-blue-hover) !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
}

#callmode-screen .cm-info-link svg {
  flex: 0 0 auto;
  transition: transform var(--rc-motion-fast);
}

#callmode-screen .cm-info-link:hover svg {
  transform: translate(1px, -1px);
}

#callmode-screen .cm-info-warn {
  color: var(--rc-muted) !important;
  font-weight: 600;
}

#callmode-screen #cm-log-section > .form-group:has(#cm-notes) {
  margin: 18px 0 16px !important;
  padding: 14px !important;
  border: 1px solid var(--rc-line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--rc-surface-muted) 55%, transparent);
}

#callmode-screen #cm-log-section > .form-group:has(#cm-notes) > label {
  display: flex !important;
  align-items: center;
  gap: 7px;
  margin-bottom: 9px !important;
  color: var(--rc-ink) !important;
  font-size: 11px !important;
  font-weight: 720 !important;
  letter-spacing: .01em;
}

#callmode-screen #cm-log-section > .form-group:has(#cm-notes) > label::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  background-color: var(--rc-blue);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='1.8' viewBox='0 0 24 24'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6M9 13h6M9 17h4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='1.8' viewBox='0 0 24 24'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6M9 13h6M9 17h4'/%3E%3C/svg%3E") center / contain no-repeat;
}

#callmode-screen #cm-notes {
  display: block !important;
  width: 100% !important;
  min-height: 92px !important;
  padding: 12px 13px !important;
  resize: vertical;
  color: var(--rc-ink) !important;
  line-height: 1.5 !important;
  border: 1px solid var(--rc-line) !important;
  border-radius: 10px !important;
  background: var(--rc-surface) !important;
  box-shadow: inset 0 1px 2px rgba(15, 21, 36, .025);
}

#callmode-screen #cm-notes::placeholder {
  color: color-mix(in srgb, var(--rc-muted) 78%, transparent);
}

#callmode-screen #cm-notes:focus {
  border-color: var(--rc-blue) !important;
  box-shadow: var(--rc-focus), inset 0 1px 2px rgba(15, 21, 36, .025) !important;
  outline: 0;
}

#callmode-screen #cm-remove-btn {
  display: flex;
  justify-content: flex-end;
  margin: -4px 0 16px !important;
  padding-top: 12px;
  border-top: 1px dashed var(--rc-line);
}

#callmode-screen #cm-remove-btn button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin: 0 !important;
  padding: 7px 11px !important;
  color: var(--rc-danger) !important;
  background: transparent !important;
  border: 1px solid color-mix(in srgb, var(--rc-danger) 28%, var(--rc-line)) !important;
  border-radius: 9px !important;
  box-shadow: none !important;
  font-size: 10px !important;
  font-weight: 680 !important;
  letter-spacing: .01em;
  cursor: pointer;
  transition:
    color var(--rc-motion-fast),
    border-color var(--rc-motion-fast),
    background var(--rc-motion-fast),
    transform var(--rc-motion-fast);
}

#callmode-screen #cm-remove-btn button::before {
  content: "−";
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  margin-right: 6px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font: 750 12px/1 var(--rc-font-ui);
}

#callmode-screen #cm-remove-btn button:hover {
  color: #fff !important;
  border-color: var(--rc-danger) !important;
  background: var(--rc-danger) !important;
  transform: translateY(-1px);
}

#callmode-screen #cm-remove-btn button:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--rc-danger) 20%, transparent) !important;
}

@media (max-width: 760px) {
  #callmode-screen .cm-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #callmode-screen .cm-info-cell {
    min-height: 62px;
  }

  #callmode-screen #cm-log-section > .form-group:has(#cm-notes) {
    padding: 12px !important;
  }

  #callmode-screen #cm-notes {
    min-height: 108px !important;
    font-size: 16px !important;
  }

  #callmode-screen #cm-remove-btn {
    justify-content: stretch;
  }

  #callmode-screen #cm-remove-btn button {
    width: 100%;
    min-height: 42px;
  }
}

@media (max-width: 390px) {
  #callmode-screen .cm-info-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* ─────────────────────────────────────────────────────────────
 * RingCraft V1 — Filtered Call Mode workspace
 * Single-number hierarchy, stable support rail, and compact caller flow.
 * CSS only: dialing, queue, outcome and data contracts are unchanged.
 * ───────────────────────────────────────────────────────────── */

/* The provider-rendered secondary tel: fallback repeats the same number.
   Manual dialing remains available in the separate RingCraft Dialer. */
#callmode-screen .cm-dial-primary + .cm-dial-link {
  display: none !important;
}

#callmode-screen .cm-dial-primary {
  position: relative;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px;
  min-height: 68px !important;
  margin: 16px 0 0 !important;
  padding: 13px 16px !important;
  overflow: hidden;
  color: #fff !important;
  border: 1px solid color-mix(in srgb, var(--rc-blue) 76%, #fff) !important;
  border-radius: 13px !important;
  background:
    radial-gradient(circle at 92% 0, rgba(255,255,255,.18), transparent 11rem),
    linear-gradient(112deg, var(--rc-blue), #163eae) !important;
  box-shadow: 0 10px 24px rgba(30,79,216,.19) !important;
  cursor: pointer;
  transition:
    transform var(--rc-motion-fast),
    box-shadow var(--rc-motion-fast),
    filter var(--rc-motion-fast);
}

#callmode-screen .cm-dial-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 13px 30px rgba(30,79,216,.25) !important;
  filter: saturate(1.05);
}

#callmode-screen .cm-dial-primary:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 4px var(--rc-blue-soft), 0 13px 30px rgba(30,79,216,.24) !important;
}

#callmode-screen .cm-dial-primary-inner {
  display: flex !important;
  align-items: center !important;
  min-width: 0;
  gap: 12px !important;
}

#callmode-screen .cm-dial-primary-inner > svg {
  flex: 0 0 auto;
  width: 19px !important;
  height: 19px !important;
}

#callmode-screen .cm-dial-number {
  color: #fff !important;
  font: 710 15px/1.15 var(--rc-font-mono) !important;
  letter-spacing: .012em;
}

#callmode-screen .cm-dial-sub {
  height: 16px;
  overflow: hidden;
  color: transparent !important;
  font-size: 0 !important;
}

#callmode-screen .cm-dial-sub::after {
  content: "RingCraft Dialer · click to call";
  color: rgba(255,255,255,.72);
  font: 560 10px/16px var(--rc-font-ui);
}

#callmode-screen .cm-dial-tag {
  flex: 0 0 auto;
  padding: 5px 8px !important;
  color: rgba(255,255,255,.82) !important;
  border: 1px solid rgba(255,255,255,.2) !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,.1) !important;
  font: 700 8px/1 var(--rc-font-ui) !important;
  letter-spacing: .1em;
}

#callmode-screen .cm-dial-tag {
  font-size: 0 !important;
}

#callmode-screen .cm-dial-tag::after {
  content: "READY";
  font-size: 8px;
}

/* Remove legacy fixed heights—the support rail must size from its content. */
#callmode-screen #cm-lead-card,
#callmode-screen #cm-script-card,
#callmode-screen #cm-notes-card,
#callmode-screen #cm-history-card,
#callmode-screen .callmode-right > .card {
  height: auto !important;
  max-height: none !important;
}

#callmode-screen #cm-lead-card {
  min-height: 0 !important;
  overflow: hidden !important;
}

#callmode-screen #cm-script-card,
#callmode-screen #cm-script-body,
#callmode-screen #cm-notes-history,
#callmode-screen #cm-call-history {
  overflow: visible !important;
}

#callmode-screen .callmode-right {
  align-content: start;
  grid-auto-rows: max-content;
}

#callmode-screen .callmode-right > .card {
  position: relative;
  min-width: 0;
  padding: 17px !important;
}

/* Lead identity: compact enough for calling, clear enough for decisions. */
#callmode-screen .cm-lead-header {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: start !important;
  gap: 16px !important;
  margin: 0 !important;
}

#callmode-screen .cm-lead-name {
  margin: 0 0 4px !important;
  color: var(--rc-ink) !important;
  font: 735 clamp(17px, 1.7vw, 22px)/1.18 var(--rc-font-ui) !important;
  letter-spacing: -.025em;
}

#callmode-screen .cm-lead-meta {
  color: var(--rc-muted) !important;
  font-size: 11px !important;
  line-height: 1.4 !important;
}

#callmode-screen .cm-lead-score-wrap {
  display: grid !important;
  justify-items: end;
  gap: 2px;
  min-width: 48px;
}

#callmode-screen .cm-lead-score {
  color: var(--rc-blue) !important;
  font: 760 24px/1 var(--rc-font-mono) !important;
  letter-spacing: -.04em;
}

#callmode-screen .cm-lead-tier {
  color: var(--rc-muted) !important;
  font-size: 9px !important;
  font-weight: 650 !important;
}

#callmode-screen .cm-lead-badges {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px !important;
  margin: 11px 0 0 !important;
}

#callmode-screen .cm-badge {
  min-height: 22px;
  padding: 4px 7px !important;
  border-radius: 999px !important;
  background: var(--rc-surface-muted);
  font-size: 9px !important;
  line-height: 1 !important;
}

/* Resource information is supporting context, not four competing cards. */
#callmode-screen .cm-info-grid {
  gap: 0 !important;
  margin-top: 12px !important;
  overflow: hidden;
  border: 1px solid var(--rc-line) !important;
  border-radius: 11px !important;
  background: var(--rc-surface-muted) !important;
}

#callmode-screen .cm-info-cell {
  min-height: 52px !important;
  padding: 9px 12px !important;
  border: 0 !important;
  border-right: 1px solid var(--rc-line) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#callmode-screen .cm-info-cell:last-child {
  border-right: 0 !important;
}

#callmode-screen .cm-info-cell:hover {
  border-color: var(--rc-line) !important;
  background: var(--rc-blue-soft) !important;
  box-shadow: none !important;
  transform: none;
}

#callmode-screen .cm-info-label {
  margin-bottom: 4px !important;
}

#callmode-screen .cm-lead-actions {
  display: flex !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px !important;
  margin-top: 12px !important;
  padding-top: 11px;
  border-top: 1px solid var(--rc-line);
}

/* Notes becomes a calm working surface—prominent, but not bulky. */
#callmode-screen #cm-log-section > .form-group:has(#cm-notes) {
  margin: 14px 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

#callmode-screen #cm-log-section > .form-group:has(#cm-notes) > label {
  margin-bottom: 7px !important;
}

#callmode-screen #cm-notes {
  min-height: 104px !important;
  padding: 12px 13px 30px !important;
  border-radius: 10px !important;
  background:
    linear-gradient(var(--rc-surface), var(--rc-surface)) padding-box,
    linear-gradient(135deg, color-mix(in srgb, var(--rc-blue) 22%, var(--rc-line)), var(--rc-line)) border-box !important;
}

#callmode-screen .cm-log-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 10px !important;
}

/* Supporting content stays readable without floating over adjacent cards. */
#callmode-screen .cm-script-wrap {
  min-width: 0;
}

#callmode-screen .cm-script-opener,
#callmode-screen .cm-script-pitch,
#callmode-screen .cm-script-objection {
  max-width: 100%;
  overflow-wrap: anywhere;
}

#callmode-screen .cm-script-pitch {
  white-space: pre-line;
}

#callmode-screen .cm-note-item,
#callmode-screen .cm-history-item {
  margin-top: 8px;
  padding: 10px !important;
  border: 1px solid var(--rc-line);
  border-radius: 9px;
  background: var(--rc-surface-muted);
}

/* Workspace-aware collapse: responds before the content becomes cramped. */
@media (max-width: 1180px) {
  #callmode-screen .callmode-body {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 300px) !important;
  }

  #callmode-screen .outcome-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 940px) {
  #callmode-screen .callmode-body {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #callmode-screen .callmode-right {
    position: static !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #callmode-screen #cm-script-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  #callmode-screen .cm-lead-header {
    gap: 10px !important;
  }

  #callmode-screen .cm-dial-primary {
    min-height: 64px !important;
    padding: 12px 13px !important;
  }

  #callmode-screen .cm-dial-tag {
    display: none !important;
  }

  #callmode-screen .cm-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #callmode-screen .cm-info-cell:nth-child(2) {
    border-right: 0 !important;
  }

  #callmode-screen .cm-info-cell:nth-child(-n+2) {
    border-bottom: 1px solid var(--rc-line) !important;
  }

  #callmode-screen .callmode-right,
  #callmode-screen .cm-log-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #callmode-screen #cm-script-card {
    grid-column: auto;
  }

  #callmode-screen #cm-notes {
    min-height: 118px !important;
  }
}

@media (max-width: 390px) {
  #callmode-screen .cm-info-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #callmode-screen .cm-info-cell,
  #callmode-screen .cm-info-cell:nth-child(2) {
    border-right: 0 !important;
    border-bottom: 1px solid var(--rc-line) !important;
  }

  #callmode-screen .cm-info-cell:last-child {
    border-bottom: 0 !important;
  }

  #callmode-screen .cm-dial-number {
    font-size: 14px !important;
  }
}

