/* ==============
   GLOBAL WRAPPER
   ============== */

#cp-ai-min-wrapper,
.cp-ai-card-auth {
  max-width: 980px;
  margin: 24px auto;
  background: radial-gradient(circle at top left, #f4f7ff 0, #ffffff 40%, #ffffff 100%);
  border-radius: 20px;
  padding: 18px 22px 20px;
  box-shadow:
    0 24px 70px rgba(15, 23, 42, 0.16),
    0 0 0 1px rgba(148, 163, 184, 0.28);
  border: 1px solid rgba(148, 163, 184, 0.35);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  position: relative;
  overflow: hidden;
}

#cp-ai-min-wrapper::before,
.cp-ai-card-auth::before {
  content: "";
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, 0.09), transparent 60%),
    radial-gradient(circle at 100% 0%, rgba(236, 72, 153, 0.07), transparent 55%);
  pointer-events: none;
  opacity: 0.6;
}

#cp-ai-min-wrapper > *,
.cp-ai-card-auth > * {
  position: relative;
  z-index: 1;
}

/* ==========
   HEADINGS
   ========== */

.cp-ai-heading,
.cp-ai-heading-auth {
  font-size: 22px;
  font-weight: 750;
  color: #020617;
  letter-spacing: -0.03em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cp-ai-heading::before,
.cp-ai-heading-auth::before {
  content: "";
  width: 7px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(160deg, #0ea5e9, #6366f1);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.18);
}

.cp-ai-subtitle,
.cp-ai-subtitle-auth {
  margin: 4px 0 12px;
  font-size: 12px;
  line-height: 1.5;
  color: #64748b;
}

/* ==========
   TOP ROW
   ========== */

.cp-ai-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.cp-ai-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cp-ai-logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(148, 163, 184, 0.45);
}

.cp-ai-logout-btn:hover {
  background: #e5e7eb;
}

/* ==========
   AUTH CARD
   ========== */

.cp-ai-card-auth {
  max-width: 520px;
  padding-top: 20px;
}

.cp-ai-tabs {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px;
  background: rgba(15, 23, 42, 0.04);
  margin: 10px 0 14px;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.35);
}

.cp-ai-tab {
  border: none;
  background: transparent;
  padding: 6px 16px;
  font-size: 12px;
  border-radius: 999px;
  cursor: pointer;
  color: #64748b;
  font-weight: 500;
  transition: all 0.16s ease-in-out;
}

.cp-ai-tab-active {
  background: #0f172a;
  color: #e5e7eb;
  box-shadow:
    0 8px 16px rgba(15, 23, 42, 0.35),
    0 0 0 1px rgba(15, 23, 42, 0.75);
}

.cp-ai-auth-form {
  margin-top: 6px;
  padding: 10px 12px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow:
    0 10px 26px rgba(15, 23, 42, 0.08),
    0 0 0 1px rgba(226, 232, 240, 0.9);
}

.cp-ai-note {
  margin-top: 10px;
  font-size: 11px;
  color: #94a3b8;
}

/* =======
   FIELDS
   ======= */

.cp-ai-field {
  margin-bottom: 10px;
}

.cp-ai-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 3px;
}

.cp-ai-label span.cp-ai-label-hint {
  font-weight: 400;
  color: #9ca3af;
  font-size: 10px;
}

.cp-ai-input,
.cp-ai-textarea,
.cp-ai-answer-text {
  width: 100%;
  border-radius: 11px;
  border: 1px solid rgba(203, 213, 225, 0.9);
  padding: 7px 10px;
  font-size: 12px;
  color: #0f172a;
  background: linear-gradient(135deg, #f9fafb, #ffffff);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, transform 0.08s ease;
  box-sizing: border-box;
}

.cp-ai-input:focus,
.cp-ai-textarea:focus,
.cp-ai-answer-text:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow:
    0 0 0 1px rgba(14, 165, 233, 0.35),
    0 0 0 4px rgba(56, 189, 248, 0.16);
  background: #ffffff;
  transform: translateY(-0.5px);
}

.cp-ai-textarea,
.cp-ai-answer-text {
  min-height: 96px;
  resize: vertical;
}

/* ========
   BUTTONS
   ======== */

.cp-ai-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}

.cp-ai-btn {
  border-radius: 999px;
  padding: 7px 15px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.16s ease-in-out;
}

.cp-ai-btn-primary {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #e5e7eb;
  box-shadow:
    0 10px 26px rgba(15, 23, 42, 0.45),
    0 0 0 1px rgba(15, 23, 42, 0.9);
}

.cp-ai-btn-primary:hover {
  background: linear-gradient(135deg, #020617, #020617);
  transform: translateY(-1px);
}

.cp-ai-btn-secondary {
  background: #e5e7eb;
  color: #111827;
  border-color: #cbd5f5;
  box-shadow: 0 5px 14px rgba(148, 163, 184, 0.45);
}

.cp-ai-btn-secondary:hover {
  background: #d4d4d8;
  transform: translateY(-1px);
}

.cp-ai-btn-ghost {
  background: transparent;
  color: #0f172a;
  border-color: #e5e7eb;
}

.cp-ai-btn-ghost:hover {
  background: #f3f4f6;
  transform: translateY(-1px);
}

/* ========
   STATUS
   ======== */

.cp-ai-status {
  font-size: 11px;
  color: #64748b;
  margin-top: 5px;
}

/* MICRO COPY */

.cp-ai-microcopy {
  margin: 4px 0 6px;
  font-size: 10px;
  color: #9ca3af;
}

/* ===========
   DASHBOARD
   =========== */

.cp-ai-dash {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: radial-gradient(circle at top left, #eff6ff 0, #f9fafb 30%, #ffffff 100%);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow:
    0 16px 40px rgba(15, 23, 42, 0.12),
    0 0 0 1px rgba(148, 163, 184, 0.25);
}

/* PLAN STRIP */

.cp-ai-plan {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  border-radius: 13px;
  background: linear-gradient(125deg, #020617, #0b1120 32%, #111827 100%);
  color: #e5e7eb;
  margin-bottom: 12px;
  box-shadow:
    0 22px 40px rgba(15, 23, 42, 0.9),
    0 0 0 1px rgba(15, 23, 42, 0.8);
}

.cp-ai-plan-info {
  max-width: 70%;
}

.cp-ai-plan-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.2);
  border: 1px solid rgba(148, 163, 184, 0.7);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.cp-ai-plan-credits {
  display: block;
  font-size: 12px;
  font-weight: 600;
}

.cp-ai-plan-warning {
  margin-top: 5px;
  font-size: 11px;
  color: #facc15;
}

.cp-ai-plan-btn-zone {
  text-align: right;
}

.cp-ai-plan-btn-zone a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid #facc15;
  font-size: 11px;
  font-weight: 600;
  color: #111827;
  text-decoration: none;
  background: linear-gradient(135deg, #f97316, #facc15);
  box-shadow:
    0 13px 28px rgba(250, 204, 21, 0.45),
    0 0 0 1px rgba(250, 250, 250, 0.7);
}

.cp-ai-plan-btn-zone a:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.cp-ai-plan-btn-zone div {
  font-size: 10px;
  color: #e5e7eb;
  margin-top: 4px;
}

/* DASH HEADER */

.cp-ai-dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 5px;
}

.cp-ai-dash-title {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
}

.cp-ai-dash-sub {
  margin: 0;
  font-size: 11px;
  color: #6b7280;
}

.cp-ai-dash-count {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-weight: 600;
  box-shadow: 0 3px 8px rgba(79, 70, 229, 0.25);
}

/* DASH TABLE */

.cp-ai-dash-table {
  margin-top: 9px;
  border-radius: 13px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  overflow: hidden;
}

.cp-ai-dash-row {
  display: grid;
  grid-template-columns: 20% 30% 15% 35%;
  padding: 5px 9px;
  font-size: 11px;
  column-gap: 8px;
  align-items: center;
}

.cp-ai-dash-row-header {
  background: #f3f4f6;
  font-weight: 600;
  color: #4b5563;
}

.cp-ai-dash-row:nth-child(odd):not(.cp-ai-dash-row-header) {
  background: #f9fafb;
}

.cp-ai-dash-session summary {
  cursor: pointer;
}

.cp-ai-dash-session summary::-webkit-details-marker {
  display: none;
}

.cp-ai-dash-session summary::after {
  content: "▾";
  font-size: 10px;
  color: #9ca3af;
  margin-left: 4px;
}

.cp-ai-dash-session[open] summary::after {
  content: "▴";
}

.cp-ai-dash-details {
  padding: 7px 9px 9px;
  font-size: 11px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}

.cp-ai-dash-summary-title {
  font-weight: 600;
  margin-bottom: 4px;
  color: #0f172a;
}

/* PILLS */

.cp-ai-dash-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #111827;
}

.cp-ai-dash-pill-low {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.cp-ai-dash-pill-mid {
  background: #fffbeb;
  border-color: #fed7aa;
  color: #b45309;
}

.cp-ai-dash-pill-high {
  background: #ecfdf3;
  border-color: #bbf7d0;
  color: #15803d;
}

/* EMPTY STATES */

.cp-ai-dash-empty {
  margin-top: 7px;
  font-size: 11px;
  color: #9ca3af;
  padding: 8px 8px;
  background: #f9fafb;
  border-radius: 9px;
  border: 1px dashed #e5e7eb;
}

/* =============
   STEPS LAYOUT
   ============= */

.cp-ai-step-title {
  margin: 14px 0 3px;
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cp-ai-step-title::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.22);
}

.cp-ai-step-desc {
  margin: 0 0 8px;
  font-size: 11px;
  color: #6b7280;
}

/* GRID LAYOUT */

.cp-ai-grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

/* QUESTION & ANSWER */

.cp-ai-question-box {
  padding: 10px 12px;
  border-radius: 12px;
  background: radial-gradient(circle at 0 0, #0ea5e9 0, #020617 40%, #020617 100%);
  color: #e5e7eb;
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 7px;
  border: 1px solid rgba(148, 163, 184, 0.68);
  box-shadow:
    0 12px 26px rgba(15, 23, 42, 0.88),
    0 0 0 1px rgba(15, 23, 42, 0.7);
}

.cp-ai-answer-box {
  margin-top: 6px;
}

/* VOICE CONTROLS */

.cp-ai-voice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}

.cp-ai-voice-btn {
  border-radius: 999px;
  padding: 5px 12px;
  border: 1px solid transparent;
  font-size: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  transition: all 0.18s ease-in-out;
}

/* Listen button – professional blue */
#cp-min-listen-btn {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #f9fafb;
  box-shadow:
    0 8px 18px rgba(37, 99, 235, 0.55),
    0 0 0 1px rgba(37, 99, 235, 0.7);
}

#cp-min-listen-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

/* Record button – warm “recording” colours */
#cp-min-record-btn {
  background: linear-gradient(135deg, #b91c1c, #f97316);
  color: #fefce8;
  box-shadow:
    0 8px 18px rgba(248, 113, 113, 0.6),
    0 0 0 1px rgba(248, 113, 113, 0.7);
}

#cp-min-record-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.cp-ai-voice-status {
  font-size: 10px;
  color: #64748b;
}

/* PROGRESS BAR */

.cp-ai-progress {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.cp-ai-progress-text {
  font-size: 10px;
  color: #6b7280;
}

.cp-ai-progress-bar {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(209, 213, 219, 0.7);
}

.cp-ai-progress-inner {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #22c55e, #16a34a);
  transition: width 0.25s ease-out;
}

/* FEEDBACK */

.cp-ai-feedback-box {
  margin-top: 9px;
  padding: 9px 11px;
  border-radius: 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  font-size: 11px;
  color: #111827;
  box-shadow: 0 8px 20px rgba(148, 163, 184, 0.25);
}

/* SUMMARY */

.cp-ai-summary-box {
  margin-top: 7px;
  padding: 9px 11px;
  border-radius: 12px;
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  font-size: 11px;
  color: #064e3b;
  white-space: pre-line;
  box-shadow: 0 8px 20px rgba(34, 197, 94, 0.25);
}

/* TAGLINE */

.cp-ai-small-tagline {
  margin-top: 12px;
  font-size: 10px;
  text-align: right;
  color: #9ca3af;
}

/* SMALL LINK */

.cp-ai-small-link {
  font-size: 11px;
  color: #0ea5e9;
  text-decoration: none;
}

.cp-ai-small-link:hover {
  text-decoration: underline;
}

/* PRO TIPS BOX */

.cp-ai-protips {
  margin: 4px 0 8px;
  padding: 6px 8px;
  border-radius: 10px;
  background: #f9fafb;
  border: 1px dashed #e5e7eb;
  font-size: 10px;
  color: #64748b;
}

.cp-ai-protips-title {
  font-weight: 600;
  font-size: 10px;
  color: #0f172a;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.cp-ai-protips-title::before {
  content: "💡";
  font-size: 11px;
}

.cp-ai-protips ul {
  margin: 0;
  padding-left: 14px;
}

.cp-ai-protips li {
  margin: 0 0 2px;
  line-height: 1.4;
}

/* PRO TIPS BOX (already used) */

.cp-ai-protips {
  margin: 4px 0 8px;
  padding: 6px 8px;
  border-radius: 10px;
  background: #f9fafb;
  border: 1px dashed #e5e7eb;
  font-size: 10px;
  color: #64748b;
}

.cp-ai-protips-title {
  font-weight: 600;
  font-size: 10px;
  color: #0f172a;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.cp-ai-protips-title::before {
  content: "💡";
  font-size: 11px;
}

.cp-ai-protips ul {
  margin: 0;
  padding-left: 14px;
}

.cp-ai-protips li {
  margin: 0 0 2px;
  line-height: 1.4;
}

/* STAR TEMPLATE BUTTON + ANSWER TOOLS */

.cp-ai-answer-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.cp-ai-star-btn {
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid #e5e7eb;
  background: linear-gradient(135deg, #f9fafb, #eef2ff);
  font-size: 10px;
  font-weight: 600;
  color: #4338ca;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(129, 140, 248, 0.28);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cp-ai-star-btn:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
}

.cp-ai-answer-hint {
  font-size: 10px;
  color: #9ca3af;
}

/* OUTLINE BUTTON */

.cp-ai-btn-outline {
  background: transparent;
  color: #0f172a;
  border-color: #cbd5f5;
  box-shadow: 0 4px 10px rgba(148, 163, 184, 0.4);
}

.cp-ai-btn-outline:hover {
  background: #eef2ff;
  transform: translateY(-1px);
}



/* ===========
   RESPONSIVE
   =========== */

@media (max-width: 720px) {
  #cp-ai-min-wrapper,
  .cp-ai-card-auth {
    margin: 12px auto;
    padding: 14px 12px 16px;
  }

  .cp-ai-top-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .cp-ai-plan {
    align-items: flex-start;
  }

  .cp-ai-plan-info {
    max-width: 100%;
  }

  .cp-ai-plan-btn-zone {
    width: 100%;
    text-align: left;
    margin-top: 6px;
  }

  .cp-ai-grid-two {
    grid-template-columns: 1fr;
  }

  .cp-ai-dash-row {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr);
    grid-auto-rows: auto;
    row-gap: 4px;
  }

  .cp-ai-dash-row-header {
    display: none;
  }

  .cp-ai-dash-session summary::after {
    display: none;
  }
}
