/* ============================================================================
   COACH SIR — Vercel ai-chatbot style chat
   All rules scoped under #chatApp (ID) so they beat the legacy
   .chat-app rules in landing.css regardless of body class state.
   ============================================================================ */

:root {
  --cs-bg:           #0a0a0a;
  --cs-bg-elevated:  #131313;
  --cs-bg-soft:      #161616;
  --cs-bg-hover:     #1c1c1c;
  --cs-border:       rgba(255, 255, 255, 0.08);
  --cs-border-soft:  rgba(255, 255, 255, 0.05);
  --cs-border-focus: rgba(255, 255, 255, 0.22);
  --cs-text:         #ededed;
  --cs-text-muted:   #a1a1a1;
  --cs-text-faint:   #6f6f6f;
  --cs-user-bubble:  #262626;
  --cs-accent:       #ffffff;
  --cs-accent-fg:    #0a0a0a;
  --cs-green:        #22c55e;
  --cs-radius-lg:    24px;
  --cs-radius-md:    16px;
  --cs-radius-sm:    12px;
}

/* CRITICAL: respect the hidden attribute — don't render chat when unauthed */
#chatApp[hidden] { display: none !important; }

/* Kill page scroll AND hide every landing element underneath the chat. */
html:has(#chatApp:not([hidden])),
body:has(#chatApp:not([hidden])) {
  overflow: hidden !important;
  height: 100vh !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  background: var(--cs-bg) !important;
}
body.is-authed,
html.is-authed {
  overflow: hidden !important;
  height: 100vh !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  background: var(--cs-bg) !important;
}

/* When the chat is mounted, every direct child of <body> EXCEPT the
   chat-app itself is hidden. Stops the landing's loader/grain/footer
   from peeking out underneath through any scroll or z-index gap. */
body.is-authed > *:not(#chatApp) {
  display: none !important;
}

/* =====================================================================
   STAGE
   ===================================================================== */
#chatApp.chat-app {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  inset: 0 !important;
  height: 100vh !important;
  height: 100dvh !important;
  width: 100vw !important;
  max-width: 100vw !important;
  max-height: 100dvh !important;
  z-index: 9999 !important;
  display: flex;
  flex-direction: column;
  /* Modern full-bleed dark backdrop — one gradient across the whole app so the
     header/thread/input read as a single surface (no flat patches, no leak). */
  background: radial-gradient(125% 90% at 50% -8%, #18181c 0%, #101012 42%, #0a0a0a 100%) !important;
  background-attachment: fixed !important;
  color: var(--cs-text);
  font-family:
    "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  isolation: isolate;
}

/* =====================================================================
   HEADER
   ===================================================================== */
#chatApp .ca-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  padding-bottom: 12px;
  padding-left: max(16px, calc(50vw - 384px)) !important;
  padding-right: max(16px, calc(50vw - 384px)) !important;
  background: transparent;
  border-bottom: 1px solid var(--cs-border-soft);
  box-shadow: none;
  flex-shrink: 0;
  height: 56px;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}
#chatApp .ca-id {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

#chatApp .ca-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--cs-bg-elevated);
  border: 1px solid var(--cs-border);
  flex-shrink: 0;
  position: relative;
}
#chatApp .ca-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 28%;
  display: block;
}

#chatApp .ca-meta {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  line-height: 1.1;
}
#chatApp .ca-name {
  font-family: "Geist", system-ui, sans-serif;
  font-style: normal;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--cs-text);
}
#chatApp .ca-status {
  font-family: "Geist", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--cs-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
#chatApp .ca-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cs-green);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.35);
  animation: cs-pulse-dot 2.2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes cs-pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.45); }
  50%      { box-shadow: 0 0 0 5px rgba(34,197,94,0); }
}

#chatApp .ca-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
}
#chatApp .ca-iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--cs-text-muted);
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
#chatApp .ca-iconbtn:hover {
  background: var(--cs-bg-hover);
  color: var(--cs-text);
}
#chatApp .ca-iconbtn svg { width: 18px; height: 18px; }

#chatApp .ca-menu-pop {
  position: absolute;
  top: 40px; right: 0;
  min-width: 180px;
  background: var(--cs-bg-elevated);
  border: 1px solid var(--cs-border);
  border-radius: 10px;
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.4),
    0 8px 24px rgba(0,0,0,0.4),
    0 16px 56px rgba(0,0,0,0.5);
  padding: 4px;
  flex-direction: column;
  z-index: 5;
}
#chatApp .ca-menu-pop a,
#chatApp .ca-menu-pop button {
  text-align: left;
  background: transparent;
  border: 0;
  padding: 8px 10px;
  font: 500 13px "Geist", system-ui, sans-serif;
  color: var(--cs-text);
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: -0.005em;
}
#chatApp .ca-menu-pop a:hover,
#chatApp .ca-menu-pop button:hover {
  background: var(--cs-bg-hover);
}

/* =====================================================================
   THREAD
   ===================================================================== */
#chatApp .ca-thread {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  height: auto !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-top: 32px;
  padding-bottom: 24px;
  padding-left: max(16px, calc(50vw - 384px));
  padding-right: max(16px, calc(50vw - 384px));
  display: flex;
  flex-direction: column;
  gap: 24px;
  scroll-behavior: smooth;
  position: relative;
  background: transparent;
  width: 100%;
  box-sizing: border-box;
}
#chatApp .ca-thread > * {
  width: 100%;
  max-width: 768px;
  margin-left: auto;
  margin-right: auto;
}
#chatApp .ca-thread::-webkit-scrollbar { width: 6px; }
#chatApp .ca-thread::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
}
#chatApp .ca-thread::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.16);
}
#chatApp .ca-thread::-webkit-scrollbar-track { background: transparent; }

#chatApp .ca-day-sep {
  align-self: center;
  margin: 4px 0;
  max-width: 768px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
}
#chatApp .ca-day-sep::before,
#chatApp .ca-day-sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--cs-border);
}
#chatApp .ca-day-sep span {
  display: inline-block;
  padding: 4px 10px;
  background: transparent;
  color: var(--cs-text-faint);
  font-family: "Geist", system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
  border-radius: 999px;
  font-weight: 400;
}

#chatApp .ca-thread .ca-row {
  display: flex;
  margin: 0;
  animation: cs-row-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}
#chatApp .ca-thread .ca-row.from-sir { justify-content: flex-start; }
#chatApp .ca-thread .ca-row.from-you { justify-content: flex-end; }
@keyframes cs-row-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

/* =====================================================================
   BUBBLES
   ===================================================================== */
#chatApp .ca-bubble {
  max-width: 100%;
  padding: 0;
  border-radius: 0;
  font-size: 15px;
  line-height: 1.65;
  box-shadow: none !important;
  position: relative;
  word-wrap: break-word;
  border: none !important;
  background: transparent !important;
  color: var(--cs-text);
  font-family: "Geist", system-ui, sans-serif;
  letter-spacing: -0.005em;
}

#chatApp .ca-row.from-sir { padding-left: 40px; position: relative; }
#chatApp .ca-row.from-sir::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--cs-bg-elevated);
  background-image: url("/coach.png");
  background-size: cover;
  background-position: 50% 28%;
  border: 1px solid var(--cs-border);
  flex-shrink: 0;
}
#chatApp .ca-row.from-sir .ca-bubble {
  max-width: 100%;
  background: transparent !important;
  color: var(--cs-text);
  font-family: "Geist", system-ui, sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.65;
  letter-spacing: -0.005em;
  padding: 0;
  border: none !important;
}

#chatApp .ca-row.from-you .ca-bubble {
  background: var(--cs-user-bubble) !important;
  color: var(--cs-text);
  font-family: "Geist", system-ui, sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  border: none !important;
  border-radius: 18px;
  padding: 10px 16px;
  max-width: min(85%, 600px);
  box-shadow: none !important;
}

#chatApp .ca-row.from-sir .ca-bubble::before,
#chatApp .ca-row.from-sir .ca-bubble::after,
#chatApp .ca-row.from-you .ca-bubble::before,
#chatApp .ca-row.from-you .ca-bubble::after { content: none !important; background: transparent !important; }

#chatApp .ca-bubble-text { white-space: pre-wrap; }
#chatApp .ca-bubble-image {
  display: block;
  width: auto;
  max-width: min(320px, 75%);
  height: auto;
  max-height: 380px;
  object-fit: contain;
  border-radius: 12px;
  margin: 0 0 8px;
  border: 1px solid var(--cs-border-soft);
  cursor: zoom-in;
}
#chatApp .ca-bubble-audio { width: 100%; margin: 6px 0; }

#chatApp .ca-bubble-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  font-family: "Geist", system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
  font-style: normal;
  color: var(--cs-text-faint);
  opacity: 0;
  transition: opacity 0.18s ease;
  float: none;
  margin-left: 0;
}
#chatApp .ca-row:hover .ca-bubble-meta { opacity: 1; }
#chatApp .ca-row.from-you .ca-bubble-meta {
  color: rgba(237, 237, 237, 0.55);
  justify-content: flex-end;
  width: 100%;
  display: flex;
}
#chatApp .ca-bubble-tick {
  color: var(--cs-text-faint);
  font-size: 11px;
  line-height: 1;
}

/* =====================================================================
   EMPTY STATE
   ===================================================================== */
#chatApp .ca-empty {
  margin: auto;
  text-align: center;
  color: var(--cs-text);
  max-width: 768px;
  width: 100%;
  padding: 32px 16px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
#chatApp .ca-empty p { display: none; }
#chatApp .ca-empty::before {
  content: "Hello, ready to start?";
  display: block;
  font-family: "Geist", system-ui, sans-serif;
  font-size: clamp(28px, 4.4vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 500;
  background: linear-gradient(180deg, #ededed 0%, #6f6f6f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  margin: 0 0 8px;
}
#chatApp .ca-empty::after {
  content: "Tell Sir what you want a coach for. He'll push you every day in Hinglish.";
  display: block;
  font-family: "Geist", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 400;
  color: var(--cs-text-muted);
  letter-spacing: -0.005em;
  line-height: 1.5;
  max-width: 520px;
  margin: 0;
}

#chatApp .ca-sys {
  align-self: center;
  background: rgba(220, 38, 38, 0.08);
  color: #fca5a5;
  font-family: "Geist", monospace;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  padding: 6px 12px;
  border: 1px solid rgba(220, 38, 38, 0.18);
  border-radius: 8px;
  margin: 4px 0;
}

/* =====================================================================
   TYPING
   ===================================================================== */
/* Mirror the thread layout exactly: full-width gutter on the container, a
   centered 768px inner, then a 40px indent so the text lines up with the
   message text (where the avatar sits). */
#chatApp .ca-typing {
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 2px max(16px, calc(50vw - 384px)) 12px;
  box-sizing: border-box;
}
#chatApp .ca-typing-bubble {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 768px;
  margin: 0 auto;
  background: transparent !important;
  border: none !important;
  padding: 0 0 0 40px !important;
}
#chatApp .ca-typing-bubble::before,
#chatApp .ca-typing-bubble::after { content: none !important; }

/* White shining "Sir is typing…" text. Explicit width/height/display defeat a
   legacy `.ca-typing-bubble span { width:6px;height:6px }` rule in landing.css
   that was collapsing this span to a 6px dot (the real reason it was invisible). */
#chatApp .ca-think {
  display: inline-block !important;
  width: auto !important;
  height: auto !important;
  border-radius: 0 !important;
  font-family: "Geist", system-ui, sans-serif;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.5;
  /* Use background-IMAGE (not the `background` shorthand) so we never reset
     background-position — the shorthand + !important was locking position to
     0% 0%, freezing the sweep. The animation drives background-position. */
  background-color: transparent !important;
  background-image: linear-gradient(
    100deg,
    #8f8f8f 0%,
    #9a9a9a 38%,
    #ffffff 48%,
    #ffffff 52%,
    #9a9a9a 62%,
    #8f8f8f 100%
  ) !important;
  background-size: 260% 100% !important;
  background-repeat: no-repeat !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent;
  /* inertia: highlight flies in fast then decelerates (easeOutQuint), holds,
     and repeats — momentum, not a constant linear crawl. */
  animation: cs-shimmer 3.1s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}
@keyframes cs-shimmer {
  0%   { background-position: 170% 0; }
  55%  { background-position: -70% 0; }
  100% { background-position: -70% 0; }
}

/* =====================================================================
   INPUT
   ===================================================================== */
#chatApp .ca-input {
  position: relative;
  z-index: 3;
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding-top: 12px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  padding-left: max(16px, calc(50vw - 384px)) !important;
  padding-right: max(16px, calc(50vw - 384px)) !important;
  background: transparent;
  border-top: none !important;
  box-sizing: border-box;
}
#chatApp .ca-input::before { content: none !important; }
#chatApp .ca-input::after { content: none !important; }

#chatApp .ca-input textarea {
  flex: 1;
  appearance: none;
  background: var(--cs-bg-elevated) !important;
  border: 1px solid var(--cs-border) !important;
  border-radius: var(--cs-radius-lg);
  padding: 14px 56px 14px 18px;
  font:
    400 15px/1.55 "Geist", system-ui, sans-serif;
  color: var(--cs-text);
  resize: none;
  min-height: 52px;
  max-height: 240px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
  letter-spacing: -0.005em;
  position: relative;
  z-index: 2;
  -webkit-font-smoothing: antialiased;
  box-shadow: none !important;
}
#chatApp .ca-input textarea:hover {
  border-color: rgba(255, 255, 255, 0.14) !important;
}
#chatApp .ca-input textarea:focus {
  border-color: var(--cs-border-focus) !important;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04) !important;
}
#chatApp .ca-input textarea::placeholder {
  color: var(--cs-text-faint);
  font-style: normal;
  font-family: "Geist", system-ui, sans-serif;
  font-size: 15px;
  letter-spacing: -0.005em;
}
/* Hide WebKit scrollbar inside the textarea — was leaking the slim vertical
   capsule next to the send button on prod. */
#chatApp .ca-input textarea::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* Send button — arrow-up, sits over textarea bottom-right */
#chatApp .ca-send {
  position: absolute;
  right: calc(max(16px, calc(50vw - 384px)) + 8px);
  bottom: calc(max(20px, env(safe-area-inset-bottom)) + 8px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0 !important;
  background: var(--cs-accent) !important;
  color: var(--cs-accent-fg) !important;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
  transition: background 0.15s, transform 0.12s, opacity 0.15s;
  z-index: 4;
  flex-shrink: 0;
}
#chatApp .ca-send:hover { background: #e5e5e5 !important; }
#chatApp .ca-send:active { transform: scale(0.94); }

#chatApp .ca-send svg { display: none !important; }
#chatApp .ca-send::before {
  content: "";
  width: 14px;
  height: 14px;
  background-color: var(--cs-accent-fg);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'><line x1='12' y1='19' x2='12' y2='5'/><polyline points='5 12 12 5 19 12'/></svg>") no-repeat center / contain;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'><line x1='12' y1='19' x2='12' y2='5'/><polyline points='5 12 12 5 19 12'/></svg>") no-repeat center / contain;
  display: block;
}

/* =====================================================================
   REACTIONS
   ===================================================================== */
#chatApp .ca-bubble { position: relative; }
#chatApp .ca-react-picker {
  position: absolute;
  top: -36px;
  left: 40px;
  display: none;
  gap: 2px;
  padding: 4px 6px;
  background: var(--cs-bg-elevated) !important;
  border: 1px solid var(--cs-border) !important;
  border-radius: 999px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 4;
  animation: cs-react-in 0.16s ease-out;
}
@keyframes cs-react-in {
  from { opacity: 0; transform: translateY(4px) scale(0.94); }
  to   { opacity: 1; transform: none; }
}
#chatApp .ca-row.from-you .ca-react-picker { left: auto; right: 0; }
#chatApp .ca-row.from-sir .ca-bubble:hover > .ca-react-picker,
#chatApp .ca-bubble.picker-open > .ca-react-picker { display: inline-flex; }
#chatApp .ca-react-pick-btn {
  appearance: none;
  border: 0;
  background: transparent;
  font-size: 16px;
  line-height: 1;
  width: 28px; height: 28px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s;
}
#chatApp .ca-react-pick-btn:hover {
  background: var(--cs-bg-hover);
  transform: scale(1.16);
}
#chatApp .ca-reactions {
  margin-top: 6px;
  margin-left: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
#chatApp .ca-row.from-you .ca-reactions { justify-content: flex-end; }
#chatApp .ca-react-chip {
  appearance: none;
  border: 1px solid var(--cs-border) !important;
  background: var(--cs-bg-elevated) !important;
  color: var(--cs-text);
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px !important;
  cursor: pointer;
  line-height: 1.4;
}
#chatApp .ca-react-chip:hover { background: var(--cs-bg-hover) !important; }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 720px) {
  #chatApp .ca-header { padding: 10px 12px; height: 52px; }
  #chatApp .ca-name { font-size: 14px; }
  #chatApp .ca-avatar { width: 28px; height: 28px; }
  #chatApp .ca-row.from-sir { padding-left: 36px; }
  #chatApp .ca-row.from-sir::before { width: 26px; height: 26px; }
  #chatApp .ca-row.from-sir .ca-bubble,
  #chatApp .ca-row.from-you .ca-bubble { font-size: 15px; }
  #chatApp .ca-bubble { max-width: 100%; }
  #chatApp .ca-row.from-you .ca-bubble { max-width: 86%; }
  #chatApp .ca-thread { padding: 20px 14px 12px; gap: 18px; }
  #chatApp .ca-empty::before { font-size: 26px; }
  #chatApp .ca-send { right: 22px; width: 34px; height: 34px; }
  #chatApp .ca-input { padding: 10px 14px 18px; }
  #chatApp .ca-input textarea { padding-right: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  #chatApp .ca-thread .ca-row { animation: none; }
  #chatApp .ca-status::before { animation: none; }
  #chatApp .ca-think { animation: none; color: #fff; -webkit-text-fill-color: #fff; }
}

/* ============================================================================
   Change-coach modal — rebuild Sir for a new domain (keeps chat history)
   ============================================================================ */
#chatApp .cc-change-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: cc-change-fade 0.16s ease-out;
}
#chatApp .cc-change-overlay[hidden] { display: none !important; }
@keyframes cc-change-fade { from { opacity: 0; } to { opacity: 1; } }

#chatApp .cc-change-card {
  width: 100%;
  max-width: 440px;
  background: var(--cs-bg-elevated);
  border: 1px solid var(--cs-border);
  border-radius: var(--cs-radius-md);
  padding: 24px 22px 20px;
  box-shadow: 0 24px 60px -18px rgba(0, 0, 0, 0.7);
  animation: cc-change-pop 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes cc-change-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
#chatApp .cc-change-card h3 {
  margin: 0 0 6px;
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-size: 26px;
  font-weight: 400;
  color: var(--cs-text);
  letter-spacing: 0.01em;
}
#chatApp .cc-change-sub {
  margin: 0 0 16px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--cs-text-muted);
}
#chatApp .cc-change-card textarea {
  width: 100%;
  resize: vertical;
  min-height: 84px;
  background: var(--cs-bg-soft);
  border: 1px solid var(--cs-border);
  border-radius: var(--cs-radius-sm);
  padding: 12px 14px;
  font: 400 14.5px var(--ui, "Geist", system-ui, sans-serif);
  color: var(--cs-text);
  line-height: 1.45;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#chatApp .cc-change-card textarea:focus {
  border-color: rgba(34, 197, 94, 0.5);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}
#chatApp .cc-change-card textarea::placeholder { color: var(--cs-text-faint); }
#chatApp .cc-change-err {
  margin: 10px 0 0;
  padding: 9px 12px;
  background: rgba(207, 31, 51, 0.12);
  border: 1px solid rgba(207, 31, 51, 0.4);
  border-radius: 8px;
  color: #ff9aa6;
  font-size: 13px;
}
#chatApp .cc-change-err[hidden] { display: none !important; }
#chatApp .cc-change-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
#chatApp .cc-change-actions button {
  appearance: none;
  border-radius: 999px;
  padding: 10px 18px;
  font: 600 13.5px var(--ui, "Geist", system-ui, sans-serif);
  cursor: pointer;
  transition: filter 0.15s, background 0.15s, border-color 0.15s;
}
#chatApp .cc-change-cancel {
  background: transparent;
  border: 1px solid var(--cs-border);
  color: var(--cs-text-muted);
}
#chatApp .cc-change-cancel:hover { border-color: var(--cs-border-focus); color: var(--cs-text); }
#chatApp .cc-change-go {
  background: linear-gradient(180deg, #2ade7a 0%, #0fa056 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #06231a;
}
#chatApp .cc-change-go:hover { filter: brightness(1.07); }
#chatApp .cc-change-go:disabled { opacity: 0.55; cursor: not-allowed; }
