    /* --- Base/Reset --- */
    @import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
    *,
    *::before,
    *::after {
      box-sizing: border-box
    }

    html,
    body {
      height: 100%
    }

    body {
      margin: 0;
      /* font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji" */
    font-family: "Poppins", sans-serif;
    }

    
    body.setup-active,
    body.convo-active {
      min-height: 100vh
    }

    body.setup-active {
      /* background: linear-gradient(120deg, #4834d4, #686de0); */
     background: 
  radial-gradient(1200px circle at 10% 10%, rgba(107, 114, 128, 0.35), transparent 55%),
  radial-gradient(900px circle at 90% 20%, rgba(107, 114, 128, 0.25), transparent 60%),
  linear-gradient(160deg, #e5e7eb 0%, #d1d5db 100%);

      color: #fff;
      display: flex;
      flex-direction: column;
      align-items: center;
      /* justify-content: center; */
      overflow-y: auto;
      overflow-x: hidden;
      /* padding: clamp(24px, 6vh, 48px) clamp(16px, 6vw, 32px) */
    }

    body.setup-active.auth-surface {
      background-color: #f1f5f9;
      color: #0f172a;
     background: 
    radial-gradient(1200px circle at 10% 10%, rgba(107, 114, 128, 0.20), transparent 55%),
    radial-gradient(900px circle at 90% 20%, rgba(107, 114, 128, 0.15), transparent 60%),
    linear-gradient(160deg, #f9fafb 0%, #e5e7eb 100%);

    }

    body.profile-body,
    body.change-password-page {
      align-items: center;
      justify-content: flex-start;
      gap: clamp(32px, 6vh, 56px);
      padding: 0 0 clamp(64px, 10vh, 96px)
    }

    body.profile-body #site-top-nav,
    body.change-password-page #site-top-nav {
      align-self: stretch
    }

    body.convo-active {
      background: linear-gradient(120deg, #4834d4, #686de0);
      color: #000;
      display: flex;
      align-items: center;
      /* justify-content: center; */
      overflow: hidden;
      padding: 40px;
    }

    button {
      cursor: pointer
    }

    :focus-visible {
      outline: 3px solid #ffd166;
      outline-offset: 2px
    }

    .hidden { display: none !important; }

    /* put near your other styles */
    .message-content .word {
      transition: background 0.08s linear;
    }

    .message-content .word.active {
      background: rgba(255, 255, 255, 0.25);
      border-radius: 6px;
    }

    /* Inline feedback card */
    .feedback-card {
      position: absolute;
      left: 24px;
      /* sits over the left side */
      top: 24px;
      width: 360px;
      max-width: calc(100vw - 48px);
      background: #fff;
      color: #111827;
      border-radius: 16px;
      padding: 18px 20px;
      box-shadow: 0 15px 40px rgba(0, 0, 0, .18);
      z-index: 600;
      /* above chat */
      display: none;
      /* hidden by default */
    }

    .feedback-card h3 {
      margin: 0 0 8px 0;
      font-size: 18px;
      font-weight: 800;
    }

    .feedback-card .feedback-body {
      font-size: 14px;
      line-height: 1.45;
    }

    .feedback-card .close-btn {
      position: absolute;
      right: 10px;
      top: 10px;
      width: 28px;
      height: 28px;
      border-radius: 50%;
      border: 0;
      background: #f3f4f6;
      color: #111827;
      cursor: pointer;
    }

    @media (max-width: 800px) {
      .feedback-card {
        left: 12px;
        right: 12px;
        width: auto;
      }
    }



    /* --- Setup --- */
    .setup-wrapper {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 56px;
      padding: 24px;
      width: 100%;
      max-width: 900px
    }

    .setup-card {
      background: #fff;
      color: #111827;
      padding: 24px;
      border-radius: 16px;
      width: 100%;
      max-width: 670px;
      box-shadow: 0 15px 40px rgba(0, 0, 0, .18)
    }

    .setup-header {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 14px;
      font-weight: 800
    }

    .form-group {
      margin-bottom: 16px
    }

    /* .form-group label {
      display: block;
      font-size: 14px;
      font-weight: 700;
      margin-bottom: 6px;
      color: #374151
    } */

    .form-group select {
      width: 100%;
      padding: 12px;
      border: 1px solid #d1d5db;
      border-radius: 10px;
      background: #f9fafb;
      appearance: none;
      background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
      background-position: right .7rem center;
      background-repeat: no-repeat;
      background-size: 1.5em 1.5em
    }

   

    .radio-group input[type=radio] {
      accent-color: #4834d4
    }

    .lets-go-btn {
      width: 100%;
      padding: 12px;
      border: none;
      border-radius: 10px;
      background: #4834d4;
      color: #fff;
      font-weight: 800
    }

    .branding-side {
      text-align: center
    }

    /* .branding-logo-wrapper {
      width: 120px;
      height: 120px;
      border-radius: 50%;
      background: rgba(255, 255, 255, .95);
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 0 auto 14px;
      box-shadow: 0 8px 25px rgba(0, 0, 0, .15);
      overflow: hidden;
    } */

    .branding-logo-wrapper img,
    .popup-logo-img {
      width: 100%;
      height: 100%;
      display: block;
      /* remove inline-gap */
      object-fit: cover;
      /* fill the circle; crops if needed */
      border-radius: 50%;
      /* not strictly required with overflow, but safe */
    }

    @media (max-width:900px) {
      .setup-wrapper {
        flex-direction: column-reverse;
        gap: 20px
      }
    }

    /* --- Conversation Layout --- */
    .app-container {
      display: flex;
      width: 100%;
    }
    .convo-view {
      display: flex;
      position: relative;
      width: min(1400px, 98vw);
      height: 95vh;
      max-height: 900px;
      gap: 18px
    }

    .mobile-panel-toggle {
      display: none;
    }

    /* COMPACT left panel: fixed narrow width like screenshot */
    .convo-left-panel {
      position: relative;
      width: 340px;
      min-width: 300px;
      max-width: 380px;
      flex: 0 0 auto;
      background: #fff;
      color: #111827;
      border-radius: 18px;
      box-shadow: 0 8px 30px rgba(0, 0, 0, .1);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: space-between;
      padding: 22px 18px;
      overflow: auto;
      text-align: center;
    }

    .left-panel-close-btn {
      position: absolute;
      top: 18px;
      right: 18px;
      width: 36px;
      height: 36px;
      display: none;
      align-items: center;
      justify-content: center;
      border: 0;
      border-radius: 999px;
      background: transparent;
      color: #111827;
      font-size: 20px;
      font-weight: 600;
      line-height: 1;
      cursor: pointer;
      transition: background-color 0.2s ease, color 0.2s ease;
    }

    .left-panel-close-btn:hover,
    .left-panel-close-btn:focus-visible {
      background: rgba(17, 24, 39, 0.06);
      color: #111827;
    }

    .left-panel-close-btn:focus-visible {
      outline: 2px solid #6366f1;
      outline-offset: 2px;
    }

    .convo-right-panel {
      flex: 1 1 auto;
      min-width: 0;
      background: white;
      color: #000;
      display: none;
      flex-direction: column;
      overflow: hidden;
      padding: 20px;
      border-radius: 20px;


    }

    .convo-right-main {
      display: flex;
      flex-direction: column;
      flex: 1 1 auto;
      min-width: 0;
      overflow: auto;
    }

    .convo-right-panel.with-timings {
      flex-direction: column;
    }

    @media (max-width: 800px) {
      .convo-view {
        width: 100%;
        max-width: 100%;
        gap: 0;
        overflow: hidden;
      }
      .body.convo-active{
        padding: 0px !important;
      }
      .convo-right-panel.visible {
      display: flex !important;
      /* border: 1px solid gray !important; */
      border-radius: 0px !important;
    }
.convo-left-panel {
    min-height: 0 !important;
    /* border: 1px solid gray !important; */
    border-radius: 0px !important;
}
      .convo-right-panel {
        flex: 1 1 auto;
        width: 100%;
      }

      .convo-right-main {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-width: 0;
        overflow: auto;
      }

      .mobile-panel-toggle {
        display: none !important;
      }

      .right-panel-header {
        justify-content: center;
        padding-inline: 12px;
      }

      .right-panel-header span {
        text-align: center;
      }

      .right-panel-header .mobile-sidebar-toggle {
        display: inline-flex;
        position: absolute;
        left: 12px;
      }

      .right-panel-header .right-panel-close {
        position: absolute;
        right: 12px;
      }

      .convo-left-panel {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        height: 100%;
        width: min(88vw, 340px);
        max-width: 100%;
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
        transition: transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
        box-shadow: 0 20px 40px rgba(15, 23, 42, 0.35);
        z-index: 40;
        margin: 0;
        overflow-y: auto;
        /* padding-top: 68px; */
        z-index: 1000;
      }

      .convo-left-panel.hidden-panel {
        transform: translateX(-105%);
        opacity: 0;
        pointer-events: none;
        box-shadow: none;
      }

      .left-panel-close-btn {
        display: inline-flex;
      }
    }

    .convo-right-panel.visible {
      display: flex;
      /* border: 1px solid gray; */
    }

    @media (min-width: 1024px) {
      .convo-right-panel.with-timings {
        flex-direction: row;
        align-items: stretch;
        gap: 20px;
      }

      .convo-right-panel.with-timings .convo-right-main {
        flex: 1 1 auto;
      }

      .convo-right-panel.with-timings .timings-panel {
        flex: 0 0 280px;
        max-width: 320px;
      }
    }

    .right-panel-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 6px 2px;
      font-weight: 800;
      position: relative;
      gap: 8px;
    }

    .right-panel-header span {
      flex: 1 1 auto;
    }

    .right-panel-header button {
      background: transparent;
      border: 0;
      color: #e5e7eb;
      font-size: 18px;
      cursor: pointer
    }

    .right-panel-close {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 36px;
      height: 36px;
      border-radius: 10px;
      font-size: 20px;
      color: #111827;
      transition: background-color 0.2s ease;
    }

    .right-panel-close:hover {
      background-color: rgba(17, 24, 39, 0.08);
    }

    .right-panel-close:focus-visible {
      outline: 2px solid #4834d4;
      outline-offset: 2px;
    }

    .mobile-sidebar-toggle {
      display: none;
      align-items: center;
      justify-content: center;
      gap: 4px;
      width: 40px;
      height: 40px;
      border: none;
      background: transparent;
      color: #111827;
      cursor: pointer;
      border-radius: 10px;
      transition: background-color 0.2s ease;
    }

    .right-panel-header .mobile-sidebar-toggle {
      color: #4f5051;
          display: none;
    flex-direction: column;
    height: 21px;
    }

    .mobile-sidebar-toggle:hover {
      background-color: rgba(17, 24, 39, 0.08);
    }

    .mobile-sidebar-toggle:focus-visible {
      outline: 2px solid #4834d4;
      outline-offset: 2px;
    }

    .mobile-sidebar-toggle span {
      display: block;
      width: 20px;
      height: 2px;
      border-radius: 999px;
      background: currentColor;
      transition: transform 0.3s ease, opacity 0.3s ease;
    }

    .mobile-sidebar-toggle.is-open span:nth-child(2) {
      opacity: 0;
    }

    .mobile-sidebar-toggle.is-open span:nth-child(1) {
      transform: translateY(6px) rotate(45deg);
    }

    .mobile-sidebar-toggle.is-open span:nth-child(3) {
      transform: translateY(-6px) rotate(-45deg);
    }

    .convo-chat-container {
      flex: 1;
      overflow-y: auto;
      padding-right: 6px;
      display: flex;
      flex-direction: column;
      gap: 14px
    }

    .message {
      display: flex;
      flex-direction: column
    }

    .message-header {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 6px;
      font-size: 14px;
      font-weight: 800;
      color: #4f4c4c
    }

    .message-header svg {
      width: 22px;
      height: 22px;
      padding: 4px;
      border-radius: 50%
    }

    .bot-message .message-header svg {
      background: rgba(0, 0, 0, .25)
    }

    .user-message .message-header svg {
      background: rgba(255, 255, 255, .18)
    }

    .user-message {
      align-items: flex-end;
      margin-top: 20px;
      /* parent .message is column-flex */
    }

    .user-message .message-header {
      align-self: flex-end;
      /* <-- key */
      display: flex;
      flex-direction: row-reverse;
      justify-content: flex-start;
      /* content flows [avatar][You] on the right */
      gap: 8px;
      /* remove any width:100% from earlier rules */
      width: auto;
      color: #3b82f6;
    }




    .bot-message {
      align-items: flex-start;
      margin-top: 20px;
    }

    /* Tidy spacing when reversed */
    .user-message .message-header svg {
      margin-left: 8px;
      /* space between name and avatar */
      margin-right: 0;
    }

    .user-message .message-header span {
      white-space: nowrap;
    }

    .user-message .message-header svg {
      margin-left: 8px;
      margin-right: 0;
    }

    /* (optional) keep bot header tidy on the left */
    .bot-message .message-header {
      justify-content: flex-start;
    }


    .message-content {
      padding: 12px 16px;
      border-radius: 12px;
      font-size: 16px;
      line-height: 1.55;
      word-wrap: break-word;
      max-width: 92%;
      position: relative
    }

    .bot-message .message-content {
      background: rgb(98 84 84 / 22%)
    }

    .user-message .message-content {
      background: linear-gradient(135deg, #4834d4, #7c5af0);
      color: #fff;
      align-self: flex-end
    }

    .bot-message-actions {
      display: flex;
      gap: 10px;
      margin-top: 6px
    }

    .bot-message-actions button {
      background: transparent;
      border: 0;
      color: #000
    }

    .bot-message-actions svg {
      width: 18px;
      height: 18px
    }

    .right-panel-footer {
      padding: 10px 0
    }

    .chat-input-form {
      display: flex;
      gap: 10px
    }

    .audio-upload-btn {
      border: 1px solid rgba(75,75,75,0.5);
      background: rgba(255,255,255,.2);
      border-radius: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 0 10px;
      cursor: pointer
    }

    .audio-upload-btn svg {
      width: 20px;
      height: 20px;
      fill: #111827
    }

    .audio-upload-input {
      display: none
    }

    .chat-input-form input {
      flex: 1;
      border-radius: 12px;
      border: 1px solid rgba(75, 75, 75, 0.5);
      background: rgba(255, 255, 255, .2);
      color: #000;
      padding: 12px 14px;
      outline: none;
      box-shadow: rgba(50, 50, 93, 0.25) 0px 2px 5px -1px, rgba(0, 0, 0, 0.3) 0px 1px 3px -1px;
    }

    .chat-input-form input::placeholder {
      color: #676767;
      opacity: .85
    }

    .chat-input-form button {
      border-radius: 12px;
      padding: 0 14px;
      background: #111827;
      border: 1px solid #111827;
      color: #fff
    }

    /* Left panel states */
    .popup-logo-circle {
      width: 92px;
      height: 92px;
      border-radius: 50%;
      /* background: #e0e7ff; */
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 0 auto 14px;
      overflow: hidden;

    }
.btn-restart{
  background: linear-gradient(135deg, #4834d4, #7c5af0) !important;
}
    /* .popup-logo-img {
      width: 70px;
      height: 70px;
      border-radius: 50%
    } */

    .popup-logo-img {
      width: 100%;
      /* fill the circle */
      height: 100%;
     border-radius: 50%;
      background: #fff;
      box-shadow: 0 8px 25px rgba(0, 0, 0, .15);
      padding: 6px;
      object-fit: cover;
      /* crop to circle */
      /* border-radius: 50%;  optional now due to overflow */
    }

    .popup-lets-talk {
      font-size: 22px;
      font-weight: 800;
      margin-top: 8px;
      color: #1f2937
    }

    .popup-mic-button {
      background: none;
      border: 1px solid #e5e7eb;
      border-radius: 50%;
      width: 52px;
      height: 52px;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: transform .15s ease
    }

    .popup-mic-button:hover {
      transform: scale(1.05)
    }

    .popup-click-to-speak {
      font-size: 13px;
      color: #6b7280;
      margin-top: 8px
    }

    .idle-loading-message {
      display: none;
    }

    #stateIdle.loading .popup-mic-button,
    #stateIdle.loading .popup-click-to-speak:not(.idle-loading-message) {
      display: none;
    }

    #stateIdle.loading .idle-loading-message {
      display: block;
    }
    /* Scenario intro/details under logo */
    .scenario-intro {
      width: 100%;
      text-align: left;
      background: #f9fafb;
      color: #374151;
      border: 1px solid #e5e7eb;
      border-radius: 12px;
      padding: 10px 12px;
      margin: 8px 0 6px;
      font-size: 13px;
      line-height: 1.35;
      white-space: pre-wrap;
    }
    .scenario-intro strong { color: #111827; }

    /* Scenario hint under intro */
    .scenario-hint {
      width: 100%;
      text-align: left;
      background: #eef2ff; /* subtle different bg */
      color: #374151;
      border: 1px dashed #c7d2fe;
      border-radius: 10px;
      padding: 8px 10px;
      margin: 6px 0 8px;
      font-size: 12.5px;
    }

    .left-panel-state {
      display: none
    }

    /* Left-panel feedback card */
    .left-feedback-card {
      /* hidden until used */
      width: 100%;
      background: #ffffff;
      color: #111827;
      border-radius: 16px;
      box-shadow: 0 10px 30px rgba(0, 0, 0, .10);
      padding: 16px 18px;
      margin-top: 8px;
      /* space below the logo */
      text-align: left;
      /* height: 400px;
      overflow: auto; */
    }

    .left-feedback-card h3 {
      margin: 0 0 8px 0;
      font-size: 16px;
      font-weight: 800;
    }

    .left-feedback-card .body {
      font-size: 14px;
      line-height: 1.5;
      display: flex;
      flex-direction: column;
      gap: 12px;
      white-space: normal;
    }

    .feedback-session-header {
      font-weight: 700;
      color: #1f2937;
    }

    .feedback-session-header.is-empty {
      font-weight: 500;
      color: #6b7280;
    }

    .feedback-accordion {
      border: 1px solid #e5e7eb;
      border-radius: 12px;
      overflow-y: scroll;
      scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none;
    }

    .feedback-accordion::-webkit-scrollbar {
  display: none; /* Chrome, Safari */
}
    .feedback-accordion-item + .feedback-accordion-item {
      border-top: 1px solid #e5e7eb;
    }

    .feedback-accordion-trigger {
      width: 100%;
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 12px 14px;
      background: transparent;
      border: none;
      font-weight: 600;
      font-size: 14px;
      color: #1f2937;
      cursor: pointer;
      transition: background-color 0.15s ease, color 0.15s ease;
    }

    .feedback-accordion-item.open .feedback-accordion-trigger {
      background: #f3f4ff;
      color: #4834d4;
    }

    .feedback-accordion-title {
      text-align: left;
    }

    .feedback-accordion-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      margin-left: 8px;
      color: #6b7280;
      font-size: 16px;
    }

    .feedback-accordion-icon::before {
      content: '\2304';
      display: inline-block;
      transition: transform 0.2s ease;
    }

    .feedback-accordion-item.open .feedback-accordion-icon::before {
      transform: rotate(180deg);
    }

    .feedback-accordion-item.open .feedback-accordion-icon {
      color: #4834d4;
    }

    .feedback-accordion-panel {
      padding: 12px 16px;
      background: #f9fafb;
    }

    .feedback-accordion-panel[hidden] {
      display: none;
    }

    .feedback-bullet-list {
      margin: 0;
      padding-left: 18px;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .feedback-bullet-list li {
      line-height: 1.45;
      color: #374151;
    }

    .grammar-diff {
      margin-top: 10px;
      padding: 12px 14px;
      border: 1px solid #e5e7eb;
      border-radius: 10px;
      background: #ffffff;
    }

    .grammar-diff-title {
      margin: 0 0 6px;
      font-weight: 600;
      color: #111827;
      font-size: 13px;
    }

    .grammar-diff-line {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      font-size: 13px;
      color: #1f2937;
      white-space: pre-wrap;
      line-height: 1.55;
    }

    .grammar-diff-label {
      font-weight: 600;
      color: #6b7280;
      margin-right: 4px;
    }

    .grammar-diff .diff-del {
      background: #fee2e2;
      text-decoration: line-through;
    }

    .grammar-diff .diff-add {
      background: #dcfce7;
    }

    .feedback-overall-note {
      background: #eef2ff;
      border: 1px solid #c7d2fe;
      border-radius: 10px;
      padding: 12px 14px;
      font-weight: 500;
      color: #1f2937;
    }

    .pronunciation-feedback-block {
      border: 1px solid #e0e7ff;
      border-radius: 14px;
      padding: 14px;
      background: #fefefe;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .pronunciation-feedback-header {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .pronunciation-feedback-title {
      font-weight: 700;
      color: #111827;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .pronunciation-feedback-sub {
      font-size: 12px;
      color: #6b7280;
    }

    .pronunciation-overall-note {
      font-size: 13px;
      color: #374151;
      background: #eef2ff;
      border-radius: 10px;
      padding: 8px 10px;
      margin: 0;
    }

    .pronunciation-feedback-sentence {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    .pronunciation-word {
      border: none;
      border-radius: 8px;
      padding: 6px 10px;
      font-size: 13px;
      background: #fff3dc;
      color: #92400e;
      cursor: pointer;
      transition: transform 0.15s ease, box-shadow 0.15s ease;
    }

    .pronunciation-word:hover,
    .pronunciation-word:focus-visible {
      transform: translateY(-1px);
      box-shadow: 0 2px 6px rgba(0,0,0,0.15);
      outline: none;
    }

    .pronunciation-word.active {
      background: #fde68a;
      color: #854d0e;
    }

    .pronunciation-word.pron-sev-high {
      background: #fee2e2;
      color: #b91c1c;
    }

    .pronunciation-word.pron-sev-medium {
      background: #fff7ed;
      color: #c2410c;
    }

    .pronunciation-word.pron-sev-info {
      background: #f3f4f6;
      color: #374151;
    }

    .pronunciation-tip-panel {
      border-top: 1px dashed #d1d5db;
      padding-top: 8px;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .pronunciation-tip-word {
      font-weight: 600;
      color: #1f2937;
    }

    .pronunciation-tip-text {
      font-size: 13px;
      color: #374151;
    }

    .pronunciation-tip-audio {
      align-self: flex-start;
      border-radius: 10px;
      background: #4834d4;
      color: #fff;
      border: none;
      padding: 6px 12px;
      cursor: pointer;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .pronunciation-tip-audio.disabled,
    .pronunciation-tip-audio:disabled {
      background: #d1d5db;
      color: #6b7280;
      cursor: not-allowed;
    }

    .left-feedback-card .feedback-extra-container {
      display: flex;
      flex-direction: column;
      gap: 12px;
      margin: 12px 0;
    }

    .left-feedback-card .feedback-extra-section .feedback-extra-overall {
      margin: 0 0 10px;
      font-weight: 600;
      color: #1f2937;
    }


    .left-panel-state.active {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      width: 100%
    }

    #audioPlayer {
      /* width: 100%; */
      margin: 10px 0
    }

    .recorded-actions {
      display: flex;
      gap: 10px;
      margin-top: 6px
    }

    .recorded-actions .primary {
      background: #4834d4;
      color: #fff;
      border: 1px solid #4834d4;
      border-radius: 10px;
      padding: 8px 14px
    }
    #sendBtn{
      background: linear-gradient(135deg, #4834d4, #7c5af0);
     width: 62px;
      height: 33px;
    }

    #retryBtn{
      background: transparent;
      border: 1px solid gray;
      width: 62px;
      height: 33px;
      border-radius: 5px;
    }
    #endConversationBtn {
      width: 100%;
      padding: 10px;
      border: 1px solid #e5e7eb;
      color: white;
      background: linear-gradient(135deg, #4834d4, #7c5af0);
      border-radius: 12px;
      font-weight: 800
    }

    .exit-conversation-btn {
      position: absolute;
      top: 10px;
      right: 10px;
      background: rgba(0, 0, 0, .22);
      color: #fff;
      border: none;
      border-radius: 50%;
      width: 34px;
      height: 34px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      z-index: 500
    }

    .lets-go-btn:disabled {
      opacity: 0.6;
      cursor: not-allowed;
    }


    /* Modals */
    .modal-overlay {
      position: fixed;
      inset: 0;
      align-items: center;
      justify-content: center;
      z-index: 400;
      background: rgba(0, 0, 0, .38)
    }

    .modal-content {
      background: #fff;
      color: #111827;
      border-radius: 16px;
      padding: 24px 26px;
      text-align: center;
      width: min(92vw, 420px);
      box-shadow: 0 10px 40px rgba(0, 0, 0, .2)
    }

    .modal-title {
      font-size: 20px;
      font-weight: 800;
      margin-bottom: 12px
    }

    .modal-buttons {
      display: flex;
      gap: 12px;
      justify-content: center
    }

    .modal-buttons .primary {
      background: #4834d4;
      color: #fff;
      border: 1px solid #4834d4;
      border-radius: 10px;
      padding: 10px 16px
    }

    /* Feedback page tweaks (re-uses your .modal-overlay/.modal-content) */
    .feedback-title {
      font-size: 22px;
      font-weight: 900;
      margin: 0 0 10px;
    }

    .feedback-summary {
      text-align: left;
      white-space: pre-wrap;
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
      font-size: 13px;
      line-height: 1.45;
      color: #111827;
      background: #f9fafb;
      border: 1px solid #e5e7eb;
      border-radius: 10px;
      padding: 12px;
      max-height: 50vh;
      overflow: auto;
      margin: 10px 0 16px;
    }

    .feedback-actions {
      display: flex;
      gap: 10px;
      justify-content: center;
    }

    .feedback-actions .secondary {
      background: #f3f4f6;
      border: 1px solid #e5e7eb;
      border-radius: 10px;
      padding: 10px 16px;
    }

    .lf-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}
.lf-mode-checkboxes {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.lf-mode-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
  font-weight: 500;
}
.lf-mode-option input[type='checkbox'] {
  accent-color: #4834d4;
}
.lf-action-buttons {
  display: flex;
  gap: 10px;
}
.lf-actions button {
  border-radius: 10px;
  padding: 8px 14px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  font-weight: 700;
}
.lf-actions .primary {
  background: #4834d4;
  color: #fff;
  border-color: #4834d4;
}
/* let the left column allow inner scroll areas */
.convo-left-panel { min-height: 0;  }
.convo-view { min-height: 0; width: 100%; }


/* make the feedback text scroll instead of growing forever */
.left-feedback-card .body {
  /* max-height: clamp(280px, 60vh, 640px);  */
  overflow: auto;
  padding-right: 6px; /* space for scrollbar */
}

/* hide the close “✕” and End Conversation while feedback is active */
body.feedback-active #endConversationBtn,
body.feedback-active .exit-conversation-btn {
  display: none !important;
}


/* optional: tidy scrollbar */
.left-feedback-card .body::-webkit-scrollbar { width: 8px; }
.left-feedback-card .body::-webkit-scrollbar-thumb {
  background: #e5e7eb; border-radius: 8px;
}

.bot-message .message-header svg{
  width: 28px;
  height: 28px;
}
    /* Small screens: stack with chat first and left panel below */
    @media (max-width:800px) {
      .convo-view {
        flex-direction: column-reverse;
        height: 100vh
      }
      
     .right-panel-header .mobile-sidebar-toggle {
      color: #4f5051;
          display: flex;
    flex-direction: column;
    height: 21px;
    }

      .convo-left-panel {
        width: 66%;
        max-width: none


      }
      .convo-left-panel{
        border: 0px;
      }
      body.convo-active{
        padding: 0;
        background: #fff !important;
      }
      .popup-logo-img{
         width: 80px;
      height: 80px;
      border-radius: 50%;
      background: #fff;
      box-shadow: 0 8px 25px rgba(0, 0, 0, .15);
      padding: 6px;
      object-fit: cover;
      }
      #stateRecorded{
        margin-bottom: 8px;
      }
    }

    /* AlphaHowl Chatbot UI Styles
   Moved from inline <style> in alphahowl_chat.html
   Edit this file to update chatbot UI styles. */

    /* Styles for conversational bot speaker select and action button */
    #convoSpeakerSelect {
      margin-left: 16px;
      border-radius: 8px;
      padding: 4px 8px;
      font-size: 1rem;
      border: 1px solid #ccc;
      background: #f9fafb;
      color: #222;
    }

    #convoSpeakerSelect:focus {
      outline: none;
      border-color: #6c63ff;
    }

    .convo-stop-btn {
      margin-left: 16px;
    }

    /* Optional: dark mode for select */
    .dark-mode #convoSpeakerSelect {
      background: #232336;
      color: #eee;
      border: 1px solid #4b8aff44;
    }

    .footer-powered {
      width: 100%;
      position: absolute;
      left: 0;
      bottom: 0;
      text-align: center;
      padding: 16px;
      font-size: 14px;
      color: #555;
      background: transparent;
      z-index: 20;
    }

    .footer-logo {
      height: 20px;
      vertical-align: middle;
      margin-left: 8px;
    }

    .main-content {
      position: relative;
      padding-bottom: 56px;
      /* Height of footer + some margin */
    }

    audio#ttsAudio {
      display: none;
    }

    /* Animated dots for Listening/Processing/Thinking states */
    .pulsing-dots::after {
      content: '...';
      display: inline-block;
      overflow: hidden;
      width: 0;
      animation: ellipsis 1s steps(4, end) infinite;
    }

    .d-none { display: none !important; }
      .loading-overlay {
        position: fixed; inset: 0; width: 100%; height: 100%;
        background: rgba(0,0,0,0.5);
        display: flex; align-items: center; justify-content: center;
        z-index: 2000;
      }
      .loading-box {
        background: #fff; color: #111;
        padding: 2em 2.25em; border-radius: 12px; text-align: center;
        box-shadow: 0 10px 30px rgba(0,0,0,0.25); min-width: 260px;
      }
      .spinner {
        width: 44px; height: 44px; margin: 0 auto 12px auto;
        border: 4px solid #e5e7eb; border-top: 4px solid var(--primary-color, #3b82f6);
        border-radius: 50%; animation: spin 1s linear infinite;
      }
      @keyframes spin { 100% { transform: rotate(360deg); } }
      .loading-text { margin: 0.25rem 0 0; font-weight: 500; }
      .loading-subtext { margin: 0.25rem 0 0; font-size: 0.9rem; color: #6b7280; }

      /* "Go to Home" in top bar */
      .user-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
      }
      .user-actions {
        display: flex;
        gap: 1.25rem;
        align-items: center;
      }
      .user-bar a.home-link {
        color: var(--primary-color, #3b82f6);
        font-weight: 500;
        text-decoration: none;
      }
      .user-bar a.home-link:hover {
        text-decoration: underline;
      }

    @keyframes ellipsis {
      to {
        width: 1.2em;
      }
    }
    /* Small Hint under bot question */
    .bot-message .hint-text {
      margin-top: 6px;
      font-size: 12px;
      opacity: 0.85;
      color: #d1d5db;
    }
