/* =====================================================
   split.css — Split-screen layout for index page
   sp_* prefix for split layout, warm cream palette
   ===================================================== */

/* ---- Reset for split body ---- */
html.split_html, body.split_body {
  height: 100%;
  overflow: hidden;
}

/* ---- Wrapper ---- */
.sp_wrap {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: var(--canvas);
}

/* =====================================================
   LEFT PANEL
   ===================================================== */
.sp_left {
  flex: 0 0 46%;
  max-width: 540px;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--canvas);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.sp_left::-webkit-scrollbar { width: 5px; }
.sp_left::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

.sp_left_inner {
  padding: 44px 40px 56px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ---- Profile block ---- */
.sp_profile {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sp_avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sp_avatar span {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  line-height: 1;
}

.sp_name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
}

.sp_role {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0;
}

.sp_meta {
  font-size: 0.85rem;
  color: var(--ink_2);
  margin: 0;
}

.sp_avail {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  color: #3c6e47;
  background: #dde8dd;
  padding: 4px 10px;
  border-radius: 20px;
  width: fit-content;
}
[data-theme="dark"] .sp_avail {
  color: #7ec99a;
  background: rgba(60,110,71,0.18);
}
.sp_avail_dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3c6e47;
  animation: sp_pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
[data-theme="dark"] .sp_avail_dot { background: #7ec99a; }

@keyframes sp_pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.sp_socials {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.sp_social_btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--ink_2);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  font-family: inherit;
}
.sp_social_btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.sp_social_btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent_wash);
}

/* ---- Book a call loading dots ---- */
@keyframes sp_dot_bounce {
  0%, 80%, 100% { opacity: 0.2; transform: translateY(0); }
  40%            { opacity: 1;   transform: translateY(-3px); }
}
.sp_loading_dots span {
  display: inline-block;
  animation: sp_dot_bounce 1.2s infinite ease-in-out;
}
.sp_loading_dots span:nth-child(2) { animation-delay: 0.2s; }
.sp_loading_dots span:nth-child(3) { animation-delay: 0.4s; }

/* ---- Stats grid ---- */
.sp_stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.sp_stat {
  background: var(--canvas_2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
}
.sp_stat_val {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.02em;
}
.sp_stat_lbl {
  font-size: 0.75rem;
  color: var(--ink_2);
  margin-top: 4px;
  line-height: 1.4;
}

/* ---- Section headers ---- */
.sp_section_label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink_3);
  margin-bottom: 12px;
}

/* ---- About ---- */
.sp_about p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--ink_2);
  margin: 0 0 10px;
}
.sp_about p:last-child { margin-bottom: 0; }
.sp_about strong { color: var(--ink); font-weight: 600; }

/* ---- Experience timeline ---- */
.sp_xp_list {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}
.sp_xp_list::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--line);
}

.sp_xp_item {
  display: flex;
  gap: 20px;
  padding-bottom: 24px;
  position: relative;
}
.sp_xp_item:last-child { padding-bottom: 0; }

.sp_xp_dot {
  flex-shrink: 0;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--canvas);
  margin-top: 4px;
  position: relative;
  z-index: 1;
}
.sp_xp_item:first-child .sp_xp_dot {
  background: var(--accent);
}

.sp_xp_body {
  flex: 1;
  min-width: 0;
}
.sp_xp_role {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}
.sp_xp_co {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 500;
  margin-top: 1px;
}
.sp_xp_date {
  font-size: 0.75rem;
  color: var(--ink_3);
  margin-top: 2px;
}
.sp_xp_industry {
  font-size: 0.75rem;
  color: var(--accent);
  font-style: italic;
  line-height: 1.45;
  margin-top: 4px;
  opacity: 0.85;
}
.sp_xp_note {
  font-size: 0.82rem;
  color: var(--ink_2);
  line-height: 1.6;
  margin-top: 6px;
}

/* ---- Education (reuses xp_ dot/body styles, different dot fill) ---- */
.sp_edu_list { }
.sp_edu_list .sp_xp_list::before { background: var(--line); }
.sp_edu_item .sp_xp_dot {
  border-color: var(--ink_3);
  background: var(--canvas);
}

/* ---- Skills ---- */
.sp_skills_grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.sp_skill_tag {
  font-size: 0.78rem;
  color: var(--ink_2);
  background: var(--canvas_2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 4px 11px;
  line-height: 1.4;
  white-space: nowrap;
}
.sp_skill_tag.accent {
  color: var(--accent_ink);
  background: var(--accent_wash);
  border-color: transparent;
}

/* ---- Contact card wrapper ---- */
.sp_contact_card {
  background: var(--accent_wash);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: 14px;
  padding: 20px;
}

.sp_contact_card_head {
  margin-bottom: 16px;
}
.sp_contact_card_label {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent_ink);
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.sp_contact_card_sub {
  font-size: 0.8rem;
  color: var(--accent_ink);
  opacity: 0.75;
  margin: 0;
  line-height: 1.45;
}

/* Override field backgrounds inside the card */
.sp_contact_card .sp_field input,
.sp_contact_card .sp_field textarea {
  background: var(--canvas);
}
.sp_contact_card .sp_field input:focus,
.sp_contact_card .sp_field textarea:focus {
  background: var(--canvas);
  border-color: var(--accent);
}

/* ---- Contact form ---- */
.sp_contact_form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sp_field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.sp_field label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink_2);
  letter-spacing: 0.02em;
}
.sp_field input,
.sp_field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 13px;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--canvas_2);
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
  resize: none;
}
.sp_field input:focus,
.sp_field textarea:focus { border-color: var(--accent); background: var(--canvas); }
.sp_field input::placeholder,
.sp_field textarea::placeholder { color: var(--ink_3); }
.sp_field textarea { min-height: 80px; line-height: 1.5; }

.sp_contact_row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sp_contact_submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  width: 100%;
}
.sp_contact_submit:hover { background: var(--accent_ink); }
.sp_contact_submit:active { transform: scale(0.98); }
.sp_contact_submit svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Field error messages */
.sp_field_err {
  display: block;
  font-size: 0.72rem;
  color: #c0392b;
  margin-top: 4px;
  min-height: 1em;
  line-height: 1.3;
}
.sp_field.has_error input,
.sp_field.has_error textarea {
  border-color: #c0392b;
  background: #fff5f5;
}
[data-theme="dark"] .sp_field.has_error input,
[data-theme="dark"] .sp_field.has_error textarea {
  background: rgba(192,57,43,0.08);
}
.sp_field.is_valid input,
.sp_field.is_valid textarea {
  border-color: #3c6e47;
}

/* Submit button loading state */
.sp_submit_spinner {
  display: none;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  animation: sp_spin 0.8s linear infinite;
}
.sp_contact_submit.loading .sp_submit_icon { display: none; }
.sp_contact_submit.loading .sp_submit_label { opacity: 0.7; }
.sp_contact_submit.loading .sp_submit_spinner { display: block; }
.sp_contact_submit:disabled { opacity: 0.7; cursor: not-allowed; }

@keyframes sp_spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Success card */
.sp_contact_success {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 16px 20px;
  animation: sp_success_in 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.sp_contact_success.visible { display: flex; }

@keyframes sp_success_in {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

.sp_success_check {
  width: 56px;
  height: 56px;
  margin-bottom: 14px;
}
.sp_success_check svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.sp_check_circle {
  stroke: #3c6e47;
  stroke-dasharray: 150;
  stroke-dashoffset: 150;
  animation: sp_circle_draw 0.5s ease forwards 0.1s;
}
.sp_check_mark {
  stroke: #3c6e47;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: sp_check_draw 0.35s ease forwards 0.5s;
}
[data-theme="dark"] .sp_check_circle,
[data-theme="dark"] .sp_check_mark { stroke: #7ec99a; }

@keyframes sp_circle_draw {
  to { stroke-dashoffset: 0; }
}
@keyframes sp_check_draw {
  to { stroke-dashoffset: 0; }
}

.sp_success_title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px;
}
.sp_success_sub {
  font-size: 0.82rem;
  color: var(--ink_2);
  line-height: 1.55;
  margin: 0;
}
.sp_success_sub strong { color: var(--ink); }

[data-theme="dark"] .sp_field input,
[data-theme="dark"] .sp_field textarea {
  background: rgba(255,255,255,0.04);
}

/* ---- FAB + sheet + backdrop — hidden on desktop ---- */
.sp_fab_wrap,
.sp_sheet_backdrop,
.sp_sheet_handle { display: none; }

/* ---- Theme toggle — pinned top-right of left panel ---- */
.sp_theme_btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--canvas_2);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  color: var(--ink_2);
  font-size: 0;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  z-index: 2;
}
.sp_theme_btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent_wash);
}
.sp_theme_btn svg { width: 15px; height: 15px; flex-shrink: 0; }

/* =====================================================
   CHARACTER — helmet-style bot in chat header
   ===================================================== */
.sp_char_wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  position: relative;
  overflow: visible;
}
/* Invisible spacer — reserves room for the bubble so the heading never shifts */
.sp_char_wrap::after {
  content: '';
  display: block;
  width: 175px;
  flex-shrink: 0;
}
.sp_char { width: 58px; height: 58px; overflow: visible; }

/* --- Chat bubble (cycles in standby, shows dots while thinking) --- */
.sp_char_bubble {
  position: absolute;
  left: 70px; /* 58px robot + 12px gap */
  top: 50%;
  transform: translateY(-50%);
  background: var(--canvas);
  border: 1.5px solid var(--ink_3);
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 11px;
  font-family: var(--font_sans, 'Inter Tight', sans-serif);
  color: var(--ink);
  white-space: nowrap;
  opacity: 1;
  transition: opacity 0.35s;
  pointer-events: none;
  user-select: none;
  z-index: 2;
}
/* Tail pointing left toward the robot */
.sp_char_bubble::after {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: var(--ink_3);
  border-left: 0;
}
.sp_char_bubble::before {
  content: '';
  position: absolute;
  right: calc(100% - 1px);
  top: 50%;
  transform: translateY(-50%);
  border: 4px solid transparent;
  border-right-color: var(--canvas);
  border-left: 0;
  z-index: 1;
}
/* Thinking dots — individual staggered blinks */
.sp_char_bubble.is-thinking {
  letter-spacing: 0.2em;
  animation: none;
}
.sp_dot {
  display: inline-block;
  animation: sp_dot_blink 1.2s ease-in-out infinite;
  opacity: 0.2;
}
.sp_dot:nth-child(1) { animation-delay: 0s; }
.sp_dot:nth-child(2) { animation-delay: 0.2s; }
.sp_dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes sp_dot_blink {
  0%, 100% { opacity: 0.2; }
  30%       { opacity: 1; }
  65%       { opacity: 0.2; }
}

/* --- Colors --- */
.sp_c_helmet  { fill: #f6f6f8; stroke: #2a2a2a; stroke-width: 2.5; }
.sp_c_ear     { fill: #e4e4ea; stroke: #2a2a2a; stroke-width: 2; }
.sp_c_visor   { fill: #ffd54f; stroke: #2a2a2a; stroke-width: 2; }
.sp_c_eye     { fill: #1a1a1a; }
.sp_c_smile   { stroke: #1a1a1a; }
.sp_c_shadow  { fill: rgba(0,0,0,0.1); }
/* Star eyes */
.sp_c_star    { fill: #ffd54f; }

/* Eye state transitions — all eye groups fade smoothly */
.sp_c_eyes_normal  { opacity: 1; transition: opacity 0.15s; }
.sp_c_eyes_think,
.sp_c_eyes_excited { opacity: 0; transition: opacity 0.15s; }

/* ---- STANDBY: gentle float ---- */
.sp_c_all { animation: sp_c_float 3s ease-in-out infinite; }

@keyframes sp_c_float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-5px); }
}

/* ---- THINKING: bob + tilt, flat dash eyes ---- */
.sp_char.is-thinking .sp_c_all          { animation: sp_c_think_bob 1.2s ease-in-out infinite; }
.sp_char.is-thinking .sp_c_eyes_normal  { opacity: 0; }
.sp_char.is-thinking .sp_c_eyes_think   { opacity: 1; }

@keyframes sp_c_think_bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  30%       { transform: translateY(-3px) rotate(-4deg); }
  70%       { transform: translateY(-3px) rotate(4deg); }
}

/* ---- ANSWERING: bounce then float, excited ^ ^ eyes ---- */
.sp_char.is-answering .sp_c_all           { animation: sp_c_bounce 0.55s cubic-bezier(.36,.07,.19,.97) forwards, sp_c_float 3s ease-in-out 0.55s infinite; }
.sp_char.is-answering .sp_c_eyes_normal   { opacity: 0; }
.sp_char.is-answering .sp_c_eyes_excited  { opacity: 1; }

@keyframes sp_c_bounce {
  0%   { transform: translateY(0); }
  22%  { transform: translateY(-13px); }
  50%  { transform: translateY(4px); }
  75%  { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}

/* =====================================================
   RIGHT PANEL — Chat
   ===================================================== */
.sp_right {
  flex: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--canvas_2);
  overflow: hidden;
  min-width: 0;
}

/* Chat header */
.sp_chat_head {
  flex-shrink: 0;
  padding: 18px 24px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.sp_chat_head_text { flex: 1; min-width: 0; }
.sp_chat_head_text h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 3px;
  letter-spacing: -0.015em;
}
.sp_chat_head_text p {
  font-size: 0.82rem;
  color: var(--ink_2);
  margin: 0;
  line-height: 1.4;
}

.sp_clear_btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 11px;
  font-size: 0.78rem;
  color: var(--ink_2);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.sp_clear_btn:hover { border-color: var(--accent); color: var(--accent); }

/* Messages area */
.sp_msgs {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.sp_msgs::-webkit-scrollbar { width: 5px; }
.sp_msgs::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

/* Message bubbles */
.sp_msg {
  max-width: 88%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.6;
  word-break: break-word;
}
.sp_msg_ai {
  background: var(--canvas);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 4px 14px 14px 14px;
  align-self: flex-start;
}
.sp_msg_link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}
.sp_msg_link:hover { opacity: 0.8; }

/* Inline list inside chat AI bubble */
.sp_msg_list {
  margin: 6px 0 0 0;
  padding-left: 18px;
}
.sp_msg_list li {
  margin-bottom: 3px;
}

/* WhatsApp-style CTA bubble */
/* Note: no overflow:hidden here — it causes flex-child height collapse after DOM mutations */
.sp_msg_ai:has(.sp_cta_footer) { padding: 0; }
.sp_cta_text { padding: 12px 16px; }
.sp_cta_footer {
  border-top: 1px solid var(--line);
  display: flex;
  border-radius: 0 0 14px 14px; /* clip to parent bubble's bottom corners */
  overflow: hidden;              /* clips button hover bg to the rounded corners */
}
.sp_cta_btn {
  flex: 1;
  padding: 11px 16px;
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: background 0.15s;
}
.sp_cta_btn:hover { background: var(--accent_wash); }
.sp_msg_user {
  background: var(--accent);
  color: #fff;
  border-radius: 14px 14px 4px 14px;
  align-self: flex-end;
}
.sp_msg_thinking {
  opacity: 0.6;
  font-style: italic;
}

/* Chips */
.sp_chips {
  flex-shrink: 0;
  padding: 0 32px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sp_chip {
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.8rem;
  color: var(--ink_2);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  line-height: 1.3;
}
.sp_chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent_wash);
}

/* Input form */
.sp_form {
  flex-shrink: 0;
  padding: 0 32px 16px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.sp_input_wrap {
  flex: 1;
  position: relative;
}

.sp_input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--canvas);
  resize: none;
  outline: none;
  line-height: 1.5;
  transition: border-color 0.15s;
  box-sizing: border-box;
  min-height: 48px;
  max-height: 120px;
  overflow-y: auto;
}
.sp_input:focus { border-color: var(--accent); }
.sp_input::placeholder { color: var(--ink_3); }

.sp_mic_btn {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  min-height: 42px;
  border-radius: 10px;
  background: var(--canvas);
  border: 1px solid var(--line);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
  color: var(--ink_2);
}
.sp_mic_btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent_wash);
}
.sp_mic_btn:active { transform: scale(0.95); }
.sp_mic_btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.sp_mic_btn.is-listening {
  background: #e53935;
  border-color: #e53935;
  color: #fff;
  animation: sp_mic_pulse 1s ease-in-out infinite;
}
@keyframes sp_mic_pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.45); }
  50%       { box-shadow: 0 0 0 7px rgba(229, 57, 53, 0); }
}

.sp_send_btn {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  min-height: 42px;
  border-radius: 10px;
  background: var(--accent);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
  color: #fff;
}
.sp_send_btn:hover { background: var(--accent_ink); }
.sp_send_btn:active { transform: scale(0.95); }
.sp_send_btn svg { width: 16px; height: 16px; }

/* Limits bar — char count left, message count right */
.sp_limits_bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px 6px;
  border-top: 1px solid var(--line);
}
.sp_char_count,
.sp_session_count {
  font-size: 0.72rem;
  color: var(--ink_3);
  transition: color 0.25s;
}
.sp_char_count_warn,
.sp_session_count_warn { color: var(--ink_2); font-weight: 500; }
.sp_char_count_over,
.sp_session_count_crit { color: #c0392b; font-weight: 600; }

/* Soft nudge message */
.sp_nudge {
  margin: 4px 0;
  padding: 10px 14px;
  background: var(--accent_wash);
  border-radius: 10px;
  font-size: 0.8rem;
  color: var(--ink_2);
  line-height: 1.5;
}
.sp_nudge a { color: var(--accent); text-decoration: none; font-weight: 500; }
.sp_nudge a:hover { text-decoration: underline; }

/* Limit reached card */
.sp_limit_card {
  margin: 8px 0 4px;
  padding: 20px 22px;
  background: var(--accent_wash);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: center;
}
.sp_limit_title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 6px;
}
.sp_limit_sub {
  font-size: 0.82rem;
  color: var(--ink_2);
  margin: 0 0 14px;
  line-height: 1.5;
}
.sp_limit_cta {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s;
}
.sp_limit_cta:hover { background: var(--accent_ink); }
.sp_limit_alt {
  font-size: 0.76rem;
  color: var(--ink_3);
  margin: 10px 0 0;
}
.sp_limit_alt a { color: var(--accent); text-decoration: none; }
.sp_limit_alt a:hover { text-decoration: underline; }

.sp_input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.sp_send_btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* =====================================================
   DARK MODE OVERRIDES
   ===================================================== */
[data-theme="dark"] .sp_stat {
  background: rgba(255,255,255,0.04);
}
[data-theme="dark"] .sp_msg_ai {
  background: rgba(255,255,255,0.05);
}
[data-theme="dark"] .sp_chip,
[data-theme="dark"] .sp_input {
  background: rgba(255,255,255,0.04);
}

/* =====================================================
   RESPONSIVE — FAB + bottom sheet on mobile
   ===================================================== */
@media (max-width: 768px) {
  html.split_html, body.split_body {
    height: auto;
    overflow: auto;
  }
  .sp_wrap {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }

  /* ---- Left panel: full width, normal scroll ---- */
  .sp_left {
    flex: none;
    width: 100%;
    max-width: 100%;
    height: auto;
    overflow: visible;
    border-right: none;
    border-bottom: none;
  }
  .sp_left_inner {
    padding: 32px 20px 100px; /* bottom padding so content clears the FAB */
    gap: 28px;
  }

  /* Contact form: stack Name + Email vertically */
  .sp_contact_row {
    grid-template-columns: 1fr;
  }

  /* ---- Right panel → bottom sheet ---- */
  .sp_right {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 88svh;
    z-index: 300;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -6px 40px rgba(0, 0, 0, 0.18);
  }
  .sp_right.is-open {
    transform: translateY(0);
  }

  /* Drag handle at top of sheet */
  .sp_sheet_handle {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 0 4px;
    flex-shrink: 0;
    cursor: pointer;
  }
  .sp_sheet_handle::before {
    content: '';
    width: 38px;
    height: 4px;
    background: var(--line);
    border-radius: 2px;
  }

  /* Backdrop */
  .sp_sheet_backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 299;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
  }
  .sp_sheet_backdrop.is-open {
    opacity: 1;
    pointer-events: all;
  }

  /* ---- FAB ---- */
  .sp_fab_wrap {
    display: block;
    position: fixed;
    bottom: 24px;
    right: 20px;
    z-index: 200;
  }

  /* Cycling speech bubble to the left of the FAB */
  .sp_fab_bubble {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--canvas);
    border: 1.5px solid var(--ink_3);
    border-radius: 14px;
    padding: 6px 12px;
    font-size: 0.82rem;
    font-family: var(--font_sans, 'Inter Tight', sans-serif);
    color: var(--ink);
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.35s;
    pointer-events: none;
    user-select: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  }
  /* Tail pointing right toward the FAB */
  .sp_fab_bubble::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-left-color: var(--ink_3);
    border-right: 0;
  }
  .sp_fab_bubble::before {
    content: '';
    position: absolute;
    left: calc(100% - 1px);
    top: 50%;
    transform: translateY(-50%);
    border: 4px solid transparent;
    border-left-color: var(--canvas);
    border-right: 0;
    z-index: 1;
  }

  /* FAB circle button */
  .sp_fab {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: var(--canvas);
    border: 2px solid var(--line);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
  }
  .sp_fab:active {
    transform: scale(0.92);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  }
  .sp_fab svg {
    width: 58px;
    height: 58px;
    display: block;
  }

  /* FAB star eyes — hidden by default, shown when answering */
  .sp_fab svg .sp_c_eyes_star { opacity: 0; transition: opacity 0.2s; }

  /* Chat header inside the sheet */
  .sp_chat_head {
    padding: 10px 16px 12px;
    gap: 10px;
  }
  .sp_chat_head_text h2 { font-size: 1.1rem; }
  .sp_chat_head_text p  { display: none; }

  /* Hide the header bubble (FAB bubble replaces it) */
  .sp_char_bubble { display: none; }
  /* Kill the spacer that reserves room for the bubble — not needed on mobile */
  .sp_char_wrap::after { display: none; }

  /* Bigger clear button touch target */
  .sp_clear_btn { padding: 8px 14px; min-height: 36px; }

  /* Messages */
  .sp_msgs { padding: 14px 16px; }
  .sp_msg  { max-width: 82%; }

  .sp_chips       { padding: 0 16px 10px; }
  .sp_limits_bar  { padding: 8px 16px 4px; }
  .sp_form        { padding: 0 16px 14px; }
}
