  [x-cloak] { display: none !important; }

  .support-wrap {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    align-items: start;
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 20px 60px;
  }
  @media(max-width:720px){
    .support-wrap { grid-template-columns: 1fr; }
    .support-sidebar { display: none; }
  }

  /* ── Sidebar ── */
  .support-sidebar { position: sticky; top: 80px; }
  .sidebar-card {
    background: #fff; border: 1px solid #E4E8EF;
    border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 14px;
  }
  .sidebar-head {
    padding: 13px 16px; border-bottom: 1px solid #F0F2F5;
    font-size: 13px; font-weight: 800; color: var(--text);
  }
  .sidebar-menu { padding: 8px; }
  .sidebar-item {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 10px; border-radius: 8px;
    font-size: 13px; font-weight: 700; color: var(--text-muted);
    cursor: pointer; transition: background .12s, color .12s;
    margin-bottom: 2px; border: none; background: none; width: 100%; text-align: left;
    font-family: 'Nunito Sans', sans-serif; text-decoration: none;
  }
  .sidebar-item:hover { background: var(--bg-card); color: var(--text); }
  .sidebar-item.active { background: var(--blue-light); color: var(--blue); }
  .sidebar-faq-item {
    padding: 10px 16px; border-bottom: 1px solid #F0F2F5;
    font-size: 13px; color: var(--text-muted); cursor: pointer;
    transition: color .12s;
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
  }
  .sidebar-faq-item:last-child { border-bottom: none; }
  .sidebar-faq-item:hover { color: var(--blue); }
  .sidebar-footer { font-size: 12px; color: var(--text-hint); padding: 0 4px; line-height: 1.6; }

  /* ── Chat ── */
  .chat-card {
    background: #fff; border: 1px solid #E4E8EF;
    border-radius: var(--radius-lg); overflow: hidden;
    display: flex; flex-direction: column;
    height: calc(100vh - 120px); min-height: 500px; max-height: 760px;
  }
  .chat-header {
    padding: 14px 20px; border-bottom: 1px solid #F0F2F5;
    display: flex; align-items: center; gap: 12px; flex-shrink: 0;
  }
  .chat-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
  }
  .chat-avatar.bot { background: var(--blue-light); }
  .chat-avatar.human { background: #E8F5E9; }
  .chat-agent-name { font-size: 14px; font-weight: 800; color: var(--text); }
  .chat-agent-status { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
  .status-dot {
    width: 7px; height: 7px; border-radius: 50%; display: inline-block;
  }
  .status-dot.online { background: #4CAF50; }
  .status-dot.ai { background: var(--blue); }
  .escalate-btn {
    margin-left: auto; flex-shrink: 0;
    padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 700;
    background: #F0F2F5; color: var(--text-muted); border: none; cursor: pointer;
    font-family: 'Nunito Sans', sans-serif; transition: background .12s, color .12s;
  }
  .escalate-btn:hover { background: #E4E8EF; color: var(--text); }

  /* Messages */
  .chat-messages {
    flex: 1; overflow-y: auto; padding: 20px;
    display: flex; flex-direction: column; gap: 14px;
    scroll-behavior: smooth;
  }
  .msg { display: flex; gap: 10px; max-width: 85%; }
  .msg.user { align-self: flex-end; flex-direction: row-reverse; }
  .msg-avatar {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; margin-top: 2px;
  }
  .msg-avatar.bot { background: var(--blue-light); }
  .msg-avatar.human-agent { background: #E8F5E9; }
  .msg-avatar.user { background: var(--blue); color: #fff; font-size: 12px; font-weight: 800; }
  .msg-bubble {
    padding: 10px 14px; border-radius: 14px;
    font-size: 14px; line-height: 1.55;
  }
  .msg.bot .msg-bubble, .msg.human-agent .msg-bubble {
    background: #F5F7FA; color: var(--text);
    border-bottom-left-radius: 4px;
  }
  .msg.user .msg-bubble {
    background: var(--blue); color: #fff;
    border-bottom-right-radius: 4px;
  }
  .msg-meta { font-size: 11px; color: var(--text-hint); margin-top: 4px; }
  .msg.user .msg-meta { text-align: right; }

  /* Typing indicator */
  .typing-bubble {
    background: #F5F7FA; border-radius: 14px; border-bottom-left-radius: 4px;
    padding: 12px 16px; display: inline-flex; gap: 4px; align-items: center;
  }
  .typing-dot {
    width: 7px; height: 7px; border-radius: 50%; background: var(--text-hint);
    animation: typing-bounce .9s ease-in-out infinite;
  }
  .typing-dot:nth-child(2) { animation-delay: .15s; }
  .typing-dot:nth-child(3) { animation-delay: .30s; }
  @keyframes typing-bounce {
    0%,60%,100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
  }

  /* System message */
  .msg-system {
    text-align: center; font-size: 12px; color: var(--text-hint);
    padding: 4px 0;
  }
  .msg-system span {
    background: #F0F2F5; padding: 3px 10px; border-radius: 20px;
  }

  /* Quick replies */
  .quick-replies {
    display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px;
  }
  .quick-reply-btn {
    padding: 6px 12px; border-radius: 20px; font-size: 13px; font-weight: 700;
    border: 1.5px solid var(--blue); color: var(--blue); background: #fff;
    cursor: pointer; font-family: 'Nunito Sans', sans-serif;
    transition: background .12s, color .12s;
  }
  .quick-reply-btn:hover { background: var(--blue); color: #fff; }

  /* Input */
  .chat-input-area {
    border-top: 1px solid #F0F2F5; padding: 14px 16px;
    display: flex; gap: 10px; align-items: flex-end; flex-shrink: 0;
    background: #fff;
  }
  .chat-input {
    flex: 1; padding: 10px 14px;
    border: 1.5px solid #D0D6E2; border-radius: 22px;
    font-family: 'Nunito Sans', sans-serif; font-size: 14px; color: var(--text);
    outline: none; resize: none; max-height: 120px; line-height: 1.5;
    transition: border-color .15s;
    overflow-y: auto;
  }
  .chat-input:focus { border-color: var(--blue); }
  .chat-input::placeholder { color: var(--text-hint); }
  .chat-send-btn {
    width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
    background: var(--blue); border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .12s; color: #fff;
  }
  .chat-send-btn:hover { background: var(--blue-dark); }
  .chat-send-btn:disabled { background: #D0D6E2; cursor: default; }
