/* appwriteFix.css */
/* [class^='appwriter'] {
  display: none !important;
}
[class*=' appwriter'] {
  display: none !important;
} */
/* 
#appwriter-predictions-wrapper {
  display: none !important;
} */

.appwriter-menu {
  display: none !important;
}

/* .appwriter-record,
.appwriter-stt__positioner {
  display: none !important;
} */

/* appwriter-snipping-overlay {
  display: none !important;
}

.appwriter-snipping-dialog__positioner {
  display: none !important;
} */

/* chatView.css */
/* ===== CHAT VIEW ===== */
.chat-view.active {
  justify-content: flex-start;
  padding: 20px;
  gap: 0;
  overflow: hidden;
  flex: 1;
  min-width: 100%;
}


.chat-new-conversation{
  position: absolute;
    top: 2px;
    right: 2px;
    z-index: 10;
    display: none;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: #d1d5db;
    transition: all 0.15s ease;
    padding: 0;
}
.chat-new-conversation svg{
  padding-left: 1px;
}
.chat-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  flex: 1;
  min-width: 100%;
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
}

/* ===== CHAT HEADER ===== */
.chat-header {
  position: relative;
  padding: 0;
  flex-shrink: 0;
}

.chat-new-conversation:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--color-text-secondary, #646e78);
}

/* Show new-conversation button only when Chat is active AND welcome state is hidden (conversation started) */
.sidebar-wrapper:has(#option-chat.active):has(.chat-welcome-state.hidden) .chat-new-conversation {
  display: flex !important;
}

/* ===== CHAT MESSAGES AREA ===== */
.chat-messages {
  flex: 1;
  min-width: 100%;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, .04) transparent;
}

/* Center content only when showing welcome state */
.chat-messages:has(.chat-welcome-state:not(.hidden)) {
  justify-content: center;
}

/* Welcome State */
.chat-welcome-state {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeInUp 0.3s ease;
}

.chat-welcome-state.hidden {
  display: none;
}

.chat-welcome-header {
  text-align: center;
  padding: 12px 0 4px;
}

.chat-welcome-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--color-bg, #FAFAF8);
  color: var(--color-text-secondary, #646e78);
  margin: 0 auto 10px;
}

.chat-welcome-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary, #384551);
  margin: 0 0 4px;
}

.chat-welcome-desc {
  font-size: 12.5px;
  color: var(--color-text-secondary, #646e78);
  margin: 0;
  font-weight: 400;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-tabs {
  display: flex;
  gap: 4px;
  background: var(--color-bg, #FAFAF8);
  border-radius: 8px;
  padding: 4px;
  flex-shrink: 0;
}

.chat-tab {
  flex: 1;
  padding: 9px 16px;
  border: 1px solid var(--color-border, #e4e6e8);
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary, #646e78);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.chat-tab.active {
  background: var(--color-card, #ffffff);
  color: var(--color-text-primary, #384551);
  border-color: var(--color-card, #ffffff);
  box-shadow: 
    0 1px 2px rgba(0, 0, 0, 0.06),
    0 1px 3px rgba(0, 0, 0, 0.04);
}

.chat-tab:hover:not(.active) {
  color: var(--color-text-primary, #384551);
  background: rgba(255, 255, 255, 0.5);
}


/* ===== CHAT FOOTER ===== */
.chat-footer {
  margin: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: #fafafa;
  flex-shrink: 0;
  border-radius: 0 0 10px 10px;
}

.chat-input-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 8px 8px 16px;
  background: var(--color-card, #ffffff);
  border: 1px solid var(--color-border, #e4e6e8);
  border-radius: 22px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.chat-input-wrapper:focus-within {
  border-color: var(--color-primary, #696cff);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.08);
}

.chat-input-wrapper textarea {
  flex: 1;
  display: block;
  border: none;
  background: transparent;
  font-size: 13px;
  color: var(--color-text-primary, #384551);
  outline: none;
  resize: none;
  overflow-y: hidden;
  line-height: 1.6;
  font-family: 'Nunito Sans', sans-serif;
  padding: 4px 0;
  margin: 0;
  min-height: 1.5em;
  scrollbar-width: thin;
scrollbar-color: rgba(0, 0, 0, .04) transparent;
}

.chat-input-wrapper textarea::placeholder {
  color: var(--color-text-secondary, #646e78);
}

.chat-mic-btn,
.chat-send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.chat-mic-btn {
  background: transparent;
  color: #c0c5cc;
}

.chat-mic-btn:hover {
  background: #f3f4f6;
  color: var(--color-text-secondary, #646e78);
}

/* chatMicBtn: spinner while connecting (centered in button) */
.chat-mic-btn .loading-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-border, #e4e6e8);
  border-top-color: #6b7280;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.chat-mic-btn.connecting .loading-spinner {
  display: block;
}

.chat-mic-btn.connecting svg {
  display: none;
}

.chat-mic-btn.connecting {
  pointer-events: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* =============================== STT chat mic glow =============================== */
/* active: SVG pulsing glow only, no button background */
.chat-mic-btn.active svg {
  color: #28a745;
  animation: pulse-chat-mic 1s infinite;
}

.chat-mic-btn.active svg path[stroke],
.chat-mic-btn.active svg line {
  stroke: #28a745;
}

@keyframes pulse-chat-mic {
  0% {
    filter: drop-shadow(0 0 5px #28a745);
  }
  50% {
    filter: drop-shadow(0 0 15px #28a745);
  }
  100% {
    filter: drop-shadow(0 0 5px #28a745);
  }
}

.chat-send-btn {
  background: var(--color-primary, #696cff);
  color: #ffffff;
}

.chat-send-btn:hover {
  background: var(--color-primary-hover);
  color: #ffffff;
}



/* =============================== CHAT Messages =============================== */

/* ===== MESSAGE BUBBLES ===== */
.message-bubble {
  max-width: 88%;
  min-width: 140px;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.6;
  animation: fadeInUp 0.25s ease;
  word-wrap: break-word;
}

.message-bubble.user {
  align-self: flex-end;
  background: var(--color-primary, #696cff);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 1px 3px rgba(var(--color-primary-rgb), 0.2);
}

.message-bubble.ai {
  align-self: flex-start;
  background: var(--color-card, #ffffff);
  color: var(--color-text-primary, #384551);
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.message-bubble.ai p {
  margin: 0 0 6px;
}

.message-bubble.ai p:last-child {
  margin-bottom: 0;
}

.message-bubble.ai ul,
.message-bubble.ai ol {
  margin: 4px 0;
  padding-left: 18px;
}

.message-bubble.ai li {
  margin-bottom: 2px;
}

.message-bubble.ai strong {
  font-weight: 600;
}

.message-bubble.ai em {
  color: var(--color-text-secondary, #646e78);
}

/* ===== MESSAGE ACTIONS ===== */
.message-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 4px;
  align-self: flex-start;
  animation: fadeInUp 0.25s ease;
}

/* Space between text buttons and icon buttons */
.message-actions .action-btn + .action-icon {
  margin-left: 8px;
}

.message-actions .action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border: 1px solid var(--color-border, #e4e6e8);
  background: var(--color-card, #ffffff);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-primary, #384551);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.message-actions .action-btn:hover {
  background: var(--color-bg, #FAFAF8);
  border-color: #d1d5db;
}

.message-actions .action-btn svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* Primary: Insert into note */
.message-actions .action-btn.apply-btn {
  background: var(--color-primary, #696cff);
  color: #ffffff;
  border-color: var(--color-primary, #696cff);
  margin-right: 8px;
  box-shadow: 0 2px 4px rgba(var(--color-primary-rgb), 0.2);
}

.message-actions .action-btn.apply-btn:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  box-shadow: 0 3px 8px rgba(var(--color-primary-rgb), 0.3);
}

/* Apply button loading state (spinner inside button) */
.message-actions .action-btn.apply-btn.loading {
  cursor: wait;
  pointer-events: none;
  opacity: 0.9;
}
.message-actions .action-btn.apply-btn.loading .loader .loading-spinner {
  width: 14px;
  height: 14px;
  border-width: 2px;
}

/* Applied state: green confirmation */
.message-actions .action-btn.applied {
  background: #f0fdf4;
  color: #16a34a;
  border-color: #bbf7d0;
  cursor: default;
}

.message-actions .action-btn.applied:hover {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

/* Icon-only action buttons (copy, read aloud) */
.message-actions .action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 6px;
  color: var(--color-text-secondary, #646e78);
  cursor: pointer;
  transition: all 0.15s ease;
}

.message-actions .action-icon:hover {
  background: #f3f4f6;
  color: var(--color-text-secondary, #646e78);
}

.message-actions .action-icon svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* Copy icon success state */
.message-actions .action-icon.copied {
  color: #16a34a;
}

/* Read aloud: playing/paused (same as tts-button - pink tint and icon color) */
.message-actions .action-icon.read-btn.playing,
.message-actions .action-icon.read-btn.paused {
  background: rgba(226, 70, 104, 0.1);
  color: #E24668;
}
.message-actions .action-icon.read-btn.playing:hover,
.message-actions .action-icon.read-btn.paused:hover {
  background: rgba(226, 70, 104, 0.18);
  color: #E24668;
}
.message-actions .action-icon.read-btn.playing svg,
.message-actions .action-icon.read-btn.paused svg {
  stroke: #E24668;
}
.message-actions .action-icon.read-btn.loading .loader .loading-spinner {
  width: 14px;
  height: 14px;
  border-width: 2px;
}


/* ===== TYPING INDICATOR ===== */
.typing-indicator {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: var(--color-card, #ffffff);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  animation: fadeInUp 0.25s ease;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background: #9ca3af;
  border-radius: 50%;
  animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}


/* =============================== Chat Tabs =============================== */
.instructions-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.instructions-list.hidden {
  display: none;
}

.instruction-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--color-card, #ffffff);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  border-radius: 8px;
  min-width: 0;
  box-shadow: var(--shadow-card, 0 3px 8px rgba(34, 48, 62, 0.1));
}

.instruction-card:hover {
  background: rgba(var(--color-primary-rgb), 0.02);
}

.instruction-card:hover .instruction-icon svg {
  color: var(--color-text-secondary, #646e78);
}

.instruction-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.instruction-icon svg {
  width: 18px;
  height: 18px;
  color: var(--color-text-secondary, #646e78);
}

.instruction-text {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary, #384551);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.instruction-send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.instruction-send svg {
  color: #d1d5db;
}

.instruction-card:hover .instruction-send svg {
  color: var(--color-text-secondary, #646e78);
}

.instruction-send:hover {
  background: rgba(0, 0, 0, 0.05);
}

.instruction-send:hover svg {
  color: var(--color-text-secondary, #646e78);
}

.instruction-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.instruction-card:hover .instruction-actions {
  opacity: 1;
}

.instruction-delete {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.instruction-delete svg {
  color: var(--color-text-secondary, #646e78);
}

.instruction-delete:hover {
  background: #fee2e2;
}

.instruction-delete:hover svg {
  color: #ef4444;
}

.instruction-edit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.instruction-edit svg {
  color: var(--color-text-secondary, #646e78);
}

.instruction-edit:hover {
  background: #f3f4f6;
}

.instruction-edit:hover svg {
  color: var(--color-text-secondary, #646e78);
}

.user-instruction .instruction-text {
  flex: 1;
}

.create-instruction-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  background: rgba(var(--color-primary-rgb), 0.06);
  border: 1px dashed rgba(var(--color-primary-rgb), 0.3);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary, #696cff);
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
}

.create-instruction-btn svg {
  color: var(--color-primary, #696cff);
}

.create-instruction-btn:hover {
  background: rgba(var(--color-primary-rgb), 0.1);
  border-color: rgba(var(--color-primary-rgb), 0.5);
  color: var(--color-primary, #696cff);
}

.create-instruction-btn:hover svg {
  color: var(--color-primary, #696cff);
}


/* Instruction Modal */
.instruction-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.instruction-modal.active {
  display: flex;
}

.instruction-modal-content {
  background: var(--color-card, #ffffff);
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  max-height: 90dvh;
  overflow-y: auto;
  box-shadow: 
    0 0 0 1px rgba(0, 0, 0, 0.03),
    0 20px 60px rgba(0, 0, 0, 0.12),
    0 8px 20px rgba(0, 0, 0, 0.08);
}

.instruction-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 24px 0;
}

.instruction-modal-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary, #384551);
  margin: 0;
  letter-spacing: -0.01em;
}

.instruction-modal-intro {
  padding: 8px 24px 0;
  font-size: 13px;
  color: var(--color-text-secondary, #646e78);
  line-height: 1.5;
}

.instruction-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  color: #c0c5cc;
  font-size: 20px;
  font-weight: 300;
  transition: all 0.15s ease;
}

.instruction-modal-close:hover {
  background: #f3f4f6;
  color: var(--color-text-secondary, #646e78);
}

.instruction-modal-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.instruction-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.instruction-field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary, #384551);
}

.instruction-field input,
.instruction-field textarea {
  padding: 10px 14px;
  border: 1px solid var(--color-border, #e4e6e8);
  border-radius: 8px;
  font-size: 13px;
  font-family: 'Nunito Sans', sans-serif;
  color: var(--color-text-primary, #384551);
  outline: none;
  transition: all 0.15s ease;
  background: #fafafa;
}

.instruction-field input:hover,
.instruction-field textarea:hover {
  border-color: #d1d5db;
  background: #ffffff;
}

.instruction-field input:focus,
.instruction-field textarea:focus {
  border-color: var(--color-primary, #696cff);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.08);
}

.instruction-field input::placeholder,
.instruction-field textarea::placeholder {
  color: #c0c5cc;
}

.instruction-field textarea {
  min-height: 88px;
  resize: none;
  line-height: 1.5;
}

.instruction-field .field-hint {
  font-size: 11.5px;
  color: #b0b5bc;
  line-height: 1.4;
  margin-top: 2px;
}

.instruction-examples {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.examples-label {
  font-size: 12px;
  font-weight: 500;
  color: #b0b5bc;
}

.example-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.example-chip {
  display: inline-block;
  padding: 5px 11px;
  background: var(--color-bg, #FAFAF8);
  border: 1px solid var(--color-border, #e4e6e8);
  border-radius: 20px;
  font-size: 12px;
  color: var(--color-text-secondary, #646e78);
  cursor: pointer;
  transition: all 0.15s ease;
}

.example-chip:hover {
  border-color: #9ca3af;
  color: var(--color-text-primary, #384551);
  background: #f3f4f6;
}

.instruction-modal-footer {
  padding: 4px 24px 24px;
}

.instruction-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  background: var(--color-primary, #696cff);
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(var(--color-primary-rgb), 0.25);
}

.instruction-submit-btn:hover {
  background: var(--color-primary-hover);
  box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.35);
}

.instruction-submit-btn:active {
  background: #4b4eff;
}

/* Empty state for user instructions */
.instructions-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  flex: 1;
  min-height: 200px;
  gap: 8px;
}

.instructions-empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(var(--color-primary-rgb), 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  color: var(--color-primary, #696cff);
}

.instructions-empty-text {
  font-size: 13px;
  color: var(--color-text-secondary, #646e78);
  line-height: 1.5;
}

/* Make instructions list fill available space when showing empty state */
#user-instructions {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#user-instructions.hidden {
  display: none;
}

/* Mine tab: loader overlay (bigger spinner while fetching) */
#user-instructions {
  position: relative;
}

.instructions-mine-content{
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.instructions-mine-loader {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.85);
  z-index: 1;
}

.instructions-mine-loader .loading-spinner {
  width: 32px;
  height: 32px;
  border: 2px solid var(--color-border, #e4e6e8);
  border-top-color: #6b7280;
  border-radius: 50%;
  animation: instructions-spin 0.8s linear infinite;
}

#user-instructions.loading .instructions-mine-loader {
  display: flex;
}

#user-instructions.loading .instructions-mine-content {
  pointer-events: none;
  opacity: 0.5;
}

@keyframes instructions-spin {
  to {
    transform: rotate(360deg);
  }
}

.instructions-empty-text {
  font-size: 13px;
  color: var(--color-text-secondary, #646e78);
  margin-bottom: 16px;
}

/* CSS-only: show chat input when Chat option is active (no JS needed). :has() targets common ancestor .sidebar-wrapper. */
.sidebar-wrapper:has(#option-chat.active) .chat-input-wrapper {
  display: flex !important;
}


/* correction-sidebar.css */
/* ================================= Correction Sidebar Styles ================================= */

/* Sidebar wrapper - flex container for sidebar and dropdown items */
.sidebar-wrapper {
  border-left: 1px solid #e5e7eb;
  flex-direction: column;
  display: flex;
  flex: 1;
  /* min-width: 0; */
}

.hmk-empty-div {
  height: 130px;
}

.sidebar-dropdown-items-container {
  display: flex;
  flex-direction: column;
  background: transparent;
  align-items: center;
  width: 100%;
  position: relative;
  flex: 0;
  order: -1;
  flex: none;
  width: 100%;
  
}

/* Dropdown items container (moved outside sidebar) */
.sidebar-dropdown-items {
  display: flex;
  flex-direction: row;
  gap: 2px;
  padding: 6px 20px;
  background: var(--color-bg, #FAFAF8);
  border-bottom: none;
  border-radius: 0;
  box-shadow: none;
  align-items: center;
  
  flex-shrink: 0;
  margin: 0;
  width: 100%;
}

/* Robot container - push to bottom */
.sidebar-dropdown-items .sidebar-robot-container {
  width: 100%;
  display: flex;
  justify-content: center;
  padding-top: 20px;
  flex-shrink: 0;
  margin-top: auto;
}

/* Dropdown items styling - column layout with text below icons */
.sidebar-dropdown-items .hk-dropdown-option {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 8px;
  background: transparent;
  border: none;
  border-bottom: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  margin-bottom: 0;
  
  flex: 1 1 0;
}

.sidebar-dropdown-items .hk-dropdown-option:hover {
  background: rgba(var(--color-primary-rgb), .06);
}

.sidebar-dropdown-items .hk-dropdown-option svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: #8e8da0;
  transition: all 0.15s ease;
  vertical-align: middle;
  display: inline-block;
}

.sidebar-dropdown-items .hk-dropdown-option:hover svg {
  color: var(--color-primary);
}

.sidebar-dropdown-items .hk-dropdown-option span {
  font-size: 13px;
  font-weight: 400;
  color: #384551;
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.sidebar-dropdown-items .hk-dropdown-option:hover span {
  color: #384551;
}

/* Active state — solid purple pill */
.sidebar-dropdown-items .hk-dropdown-option.active {
  background: var(--color-primary);
  box-shadow: 0 2px 4px rgba(var(--color-primary-rgb), .4);
}

.sidebar-dropdown-items .hk-dropdown-option.active svg {
  color: #fff;
}

.sidebar-dropdown-items .hk-dropdown-option.active span {
  color: #fff;
  font-weight: 600;
}

/* Primary option styling */
.sidebar-dropdown-items .hk-dropdown-option-primary {
  background: var(--color-bg, #FAFAF8);
  border-top: 1px solid #e4e4e4;
  margin-top: 5px;
  padding-top: 15px;
}

.sidebar-dropdown-items .hk-dropdown-option-primary span {
  background: linear-gradient(90deg, var(--color-primary) 0%, #495057 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-fill-color: transparent;
  font-size: 11px;
  font-weight: 400;
}

/* Main sidebar container */
.correction-sidebar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex: 1;
  min-width: 320px;
  background: var(--color-bg, #FAFAF8) !important;
  overflow: hidden;
  border-right: 1px solid var(--color-border, #e4e6e8);
}

.correction-sidebar.hidden {
  display: none;
}

/* ================================= Sidebar Header ================================= */
.header-section {
  display: none; /* Hide header section since it's now empty */
}

/* Sidebar toggle button */
.sidebar-toggle-btn {
  border-radius: 0;
  background: var(--color-bg-card);
  box-shadow:
    0 1px 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 1px 4px 0 rgba(0, 0, 0, 0.15);
  padding: 8px;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 32px;
  min-height: 32px;
  border: none;
  order: -1;
  flex: none;
  width: 100%;
  /* Always show first */
}

.sidebar-toggle-btn:hover {
  background: #f5f5f5;
}

/* Header dropdown */
.hk-dropdown-container {
  position: relative;
  width: 100%;
}

.hk-dropdown-button {
  width: 100%;
  padding: 8px 15px;
  background: var(--color-card, #ffffff);
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  padding: 12px;
  justify-content: space-between;
  align-items: center;
  flex: 1 0 0;
  align-self: stretch;
  border-radius: 0;
  border: 1px solid rgba(222, 226, 230, 0.8);
  background: var(--color-card, #ffffff);
  box-shadow:
    0 1px 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.hk-dropdown-button:hover {
  border-color: #e78799;
  box-shadow: 0 2px 6px rgba(75, 70, 92, 0.04);
}

.selected-option {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hk-dropdown-arrow {
  transition: transform 0.2s ease;
}

.hk-dropdown-button.active .hk-dropdown-arrow {
  transform: rotate(180deg);
}

.hk-dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  margin-top: 5px;
  background: var(--color-card, #ffffff);
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(75, 70, 92, 0.04);
  z-index: 1000;
}

.hk-dropdown-content.show {
  display: block;
}

.hk-dropdown-content-options {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hk-dropdown-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.hk-dropdown-option span {
  font-size: 14px;
  color: rgba(73, 80, 87, 1);
}

.hk-dropdown-option:hover {
  background-color: rgba(231, 135, 153, 0.1);
}

.hk-dropdown-option svg path {
  transition: stroke 0.2s ease;
}

.hk-dropdown-option.active svg:not(.correction-sidebar-dropdown2-svg) path,
.hk-dropdown-option.active svg:not(.correction-sidebar-dropdown2-svg) line,
.hk-dropdown-option.active svg:not(.correction-sidebar-dropdown2-svg) polyline,
.hk-dropdown-option.active svg:not(.correction-sidebar-dropdown2-svg) polygon{
  stroke: #fff;
}

/* For filled SVGs (like tone), change fill color instead of adding stroke */
.sidebar-dropdown-items .hk-dropdown-option.active svg.correction-sidebar-dropdown2-svg path {
  fill: #fff;
  stroke: none;
}

.hk-dropdown-option:hover .correction-sidebar-dropdown2-svg path {
    fill: #6c757d;
}

/*================================================================
  Simplified dropdown CSS with direct values and regular font sizes
================================================================*/

/*---------------------- Dropdown Container ----------------------*/
.hk-dropdown-container {
  position: relative;
  width: 100%;
}

/*---------------------- Dropdown Button -------------------------*/
.hk-dropdown-button {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--color-card, #ffffff);
  border: 1px solid #e6e6e6;
  border-radius: 0;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 1rem;
  font-weight: 500;
  color: #414141;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3rem;
  box-sizing: border-box;
  font-family: inherit;
}

.hk-dropdown-button:hover {
  border-color: #d1d1d1;
  box-shadow: 0 2px 6px rgba(75, 70, 92, 0.04);
}

/*---------------------- Selected Option -------------------------*/
.selected-option {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.selected-option svg {
  flex-shrink: 0;
}

/*---------------------- Dropdown Text ---------------------------*/
.hk-dropdown-text {
  font-size: 14px;
  flex-grow: 1;
  text-align: left;
  font-weight: 400;
  color: rgba(108, 117, 125, 1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/*---------------------- Dropdown Arrow --------------------------*/
.hk-dropdown-arrow {
  transition: transform 0.15s ease;
  width: 1.25rem;
  height: 1.25rem;
  stroke: #606060;
  flex-shrink: 0;
}

.hk-dropdown-button.active .hk-dropdown-arrow {
  transform: rotate(180deg);
}

/*---------------------- Dropdown Content ------------------------*/
.hk-dropdown-content {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 3px;
  width: 100%;
  border-radius: 0;
  border: 1px solid #e6e6e6;
  background: var(--color-card, #ffffff);
  box-shadow: 0 2px 6px rgba(75, 70, 92, 0.04);
  z-index: 1000;
  overflow: hidden;
  box-sizing: border-box;
}

.hk-dropdown-content.show {
  display: block;
  animation: dropdownFadeIn 0.15s ease-out;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-0.5rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/*---------------------- Dropdown Separator ----------------------*/
.hk-dropdown-separator {
  height: 1px;
  background: #e6e6e6;
  margin: 0.25rem 0.5rem;
}

/*---------------------- Primary Dropdown Option ------------------*/
.hk-dropdown-option-primary {
  align-items: center;
  padding: 13px 10px;
  gap: 10px;
  background: var(--color-bg, #FAFAF8);
  align-self: stretch;
  border-top: 1px solid #e4e4e4;
  justify-content: center;
  margin: 0;
}

.hk-dropdown-option-primary span {
  background: linear-gradient(90deg, var(--color-primary) 0%, #495057 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-fill-color: transparent;
  font-size: 14px;
  font-weight: 400;
  font-style: normal;
  line-height: 18px;
  flex: none !important;
}

.hk-dropdown-option-primary svg {
  height: 15.58px;
  width: 15.58px;
  stroke: none !important;
}

.hk-dropdown-option-primary.active {
}

.hk-dropdown-option-primary:hover,
.hk-dropdown-option-primary.hover,
.hk-dropdown-option-primary:focus,
.hk-dropdown-option-primary:active {
  align-items: center;
  padding: 13px 10px;
  gap: 10px;
  background: #f6f8fa !important;
  align-self: stretch;
  border-top: 1px solid #e4e4e4;
  justify-content: center;
  margin: 0 !important;
  box-shadow: none !important;
  transform: none !important;
  cursor: pointer !important;
  border-radius: unset !important;
}

/* ================================= Sidebar Content Sections ================================= */

/* Improvement section */
.improv-inner {
  display: grid;
  /* padding: 10px 10px 20px 10px; */
  row-gap: 10px;
  column-gap: 10px;
  flex: 1 0 0;
  align-self: stretch;
  grid-template-rows: repeat(4, minmax(0, 1fr));
  grid-template-columns: repeat(1, minmax(0, 1fr));
  background: var(--color-bg, #FAFAF8);
  border-radius: 0;
  flex: 1;
  overflow: hidden;
}

.correction-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  justify-content: center;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--color-bg, #FAFAF8);
  border-radius: 8px !important;
  position: relative;
  box-sizing: border-box;
  gap: 16px;
}

.grammar-basic-plus-btns {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
  width: 100%;
  flex: 1;
}

/* Custom scrollbar styles for Webkit browsers */
.correction-content::-webkit-scrollbar {
  width: 8px;
}

.correction-content::-webkit-scrollbar-track {
  background: #f9f9f9;
  border-radius: 4px;
}

.correction-content::-webkit-scrollbar-thumb {
  background: #d1d1d1;
  border-radius: 4px;
  border: 2px solid #f9f9f9;
}

.correction-content::-webkit-scrollbar-thumb:hover {
  background: #b8b8b8;
}

.correction-content #gif {
  flex-shrink: 0;
}

#gif svg {
  width: 110px !important;
  height: 110px !important;
  margin-bottom: -20px;
}

.correction-message2,
.correction-message {
  font-size: 14px;
  font-weight: 400;
  line-height: 16.8px;
  text-align: center;
  text-underline-position: from-font;
  text-decoration-skip-ink: none;
  color: #4a4a4a;
  margin-top: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.correction-content .correction-message {
  flex-shrink: 0;
}

.correction-content.has-explanations {
  align-items: flex-start;
  justify-content: flex-start !important;
  padding: 0;
}

/* Explanations */
.explanation-list {
  position: relative;
  width: 100%;
  flex: 1 1 0%;
  padding: 0px 20px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.explanation-item {
  width: 100%;
  margin: 0;
  background-color: var(--color-card, #ffffff);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow-card, 0 3px 8px rgba(34, 48, 62, 0.1));
  border: none;
  font-family: 'Nunito Sans', sans-serif;
  transition: background-color 0.15s;
  cursor: pointer;
}

.explanation-item:hover {
  box-shadow: 0 3px 8px rgba(34,48,62,.1);
  border: none;
  background-color: rgba(0, 0, 0, 0.03);
  transition: background-color 0.15s;
}

.active-explanation {
  box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), .15);
  border: 2px solid rgba(var(--color-primary-rgb), .3);
}

.change-text {
  justify-content: flex-start;
  padding-right: 30px;
  position: relative;
  margin-bottom: 10px;
  font-size: 15px !important;
  line-height: 1.6;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.change-text .corrected {
  color: rgb(73, 80, 87);
  font-weight: 600;
  font-size: 15px;
}

.explanation-arrow {
  color: rgb(73, 80, 87);
  opacity: 0.7;
  font-size: 15px;
}

.change-text .not-corrected {
  color: #a8a4b5;
  text-decoration: line-through;
  font-size: 15px;
}

.not-corrected-div {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
}

.change-reason {
  font-size: 13px !important;
  color: rgb(108, 117, 125);
  line-height: 1.6;
  font-family: 'Nunito Sans', sans-serif;
  margin-top: 6px;
}

.explanation-header-wrapper {
  padding: 12px 20px 0px;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  z-index: 2;
}

.explanation-premium-plus-btn {
  position: relative;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 13px !important;
  font-weight: 500;
  color: rgb(108, 117, 125);
  text-transform: capitalize;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid var(--color-border, #e4e6e8);
  background-color: transparent;
  transition: 0.15s;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow:
    rgba(255, 255, 255, 0.9) 0px 1px 1px 0px inset,
    rgba(0, 0, 0, 0.04) 0px 1px 3px 0px;
  transform: translateY(0px);
  line-height: 19.8px;
}

.explanation-premium-plus-btn:hover {
  border: 1px solid rgba(0, 0, 0, 0.12);
  background-color: rgba(0, 0, 0, 0.04);
  box-shadow:
    rgba(255, 255, 255, 0.9) 0px 1px 1px 0px inset,
    rgba(0, 0, 0, 0.06) 0px 2px 4px 0px;
  transform: translateY(-1px);
}

.explanation-premium-plus-tooltip {
  position: absolute;
  top: 100%;
  right: 0px;
  margin-top: 8px;
  background-color: rgb(255, 255, 255);
  color: #3c4043;
  padding: 8px 12px;
  border-radius: 6px;
  white-space: normal;
  min-width: 180px;
  max-width: 220px;
  border: 1px solid var(--color-border, #e4e6e8);
  box-shadow:
    rgba(0, 0, 0, 0.15) 0px 2px 8px,
    rgba(0, 0, 0, 0.1) 0px 1px 2px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 12px !important;
  font-weight: 400;
  color: rgb(108, 117, 125);
  line-height: 1.4;
  text-align: left;
  text-transform: none;
}

/* No arrow per provided design */

.explanation-premium-plus-btn:hover .explanation-premium-plus-tooltip {
  opacity: 1;
  visibility: visible;
}

.no-of-changes {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.no-of-changes-text {
  font-size: 16px !important;
  font-weight: 600;
  color: rgb(73, 80, 87);
}

.no-of-changes-count {
  background-color: rgba(255, 107, 129, 0.85);
  color: white;
  border-radius: 8px;
  width: 24px;
  height: 24px;
  font-size: 12px !important;
  font-weight: bold;
  font-family: 'Nunito Sans', sans-serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.sidebar-icon-btn {
  position: relative;
}

.sidebar-badge {
  display: flex;
  padding: 1px 5px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  position: absolute;
  right: 2px;
  top: -1px;
  border-radius: 100px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
}

.sidebar-badge-count {
  align-self: stretch;
  color: white;
  text-align: center;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: 16px;
}

.no-change-improve-outsider {
  display: flex;
  flex-direction: column;
}

.no-changes-impove-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.correct-text-heading {
  color: #434343;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
}

.correct-text-subheading {
  color: #5a5a5a;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 14px;
}

/* ================================= Correction Inner Section ================================= */
.correction-inner {
  display: grid;
  padding: 20px;
  row-gap: 10px;
  column-gap: 10px;
  flex: 1 0 0;
  align-self: stretch;
  grid-template-rows: repeat(4, minmax(0, 1fr));
  grid-template-columns: repeat(1, minmax(0, 1fr));
  border-radius: 0;
  background: var(--color-bg, #FAFAF8);
  justify-content: center;
}

.demo-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto 0;
  flex: 1;
}

.correction-inner-main {
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: none;
  justify-content: center;
  align-items: center;
  height: 100% !important;
  width: 100%;
}

.analysis-card {
  width: 91%;
  margin: 0 auto;
  padding: 16px;
  background: var(--color-card, #ffffff);
  border-radius: 8px;
  box-shadow: var(--shadow-card, 0 3px 8px rgba(34, 48, 62, 0.1));
}

.analysis-title {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #1a1a1a;
  font-weight: 600;
}

.search-icon {
  background-color: #e7ecf0;
  display: flex;
  padding: 3px;
  border-radius: 50%;
  justify-content: center;
  align-items: center;
}

.analysis-title-subtitle {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ai-analysis-text {
  color: var(--color-text-primary, #384551);
  font-family: 'Nunito Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 15.4px;
  text-align: left;
  text-underline-position: from-font;
  text-decoration-skip-ink: none;
}

.analysis-subtitle {
  color: #414141;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 11px;
  font-weight: 400;
  line-height: 12.6px;
  text-align: left;
  text-underline-position: from-font;
  text-decoration-skip-ink: none;
}

.warning-message {
  /* display: flex;
  align-items: center;
  gap: 8px;
  color: #414141;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 12.6px;
  text-align: left;
  text-underline-position: from-font;
  text-decoration-skip-ink: none;
  background-color: #e7ecf0; */
}

/* Improvement Options */
/* =============================================== Improvement section =============================================== */
.improvement-section {
  display: grid;
  padding: 24px;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
  grid-row: 3 / span 1;
  grid-column: 1 / span 1;
  justify-self: center;
  border-radius: 8px;
  border: none;
  background: var(--color-card, #ffffff);
  box-shadow: var(--shadow-card, 0 3px 8px rgba(34, 48, 62, 0.1));
  width: 100%;
  max-width: 100%;
}

.improvement-header {
  text-align: center;
  font-size: 20px !important;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text-primary, #384551);
  font-family: 'Nunito Sans', sans-serif;
}

.improvement-items {
  gap: 20px;
  display: flex;
  flex-direction: row;
}

.improvement-item-1 {
  display: flex;
  width: 100%;

  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.improvement-item-2 {
  display: flex;
  width: 100%;

  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.improvement-item-3 {
  display: flex;
  width: 100%;

  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.improvement-icon {
  display: flex;
  padding: 10px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 8px;
  border: 1px solid var(--Text-Primary-Dark, #e4e4e4);
  background: var(--color-card, #ffffff);
  box-shadow:
    0 1px 3px 0 rgba(0, 0, 0, 0.04),
    0 1px 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.improvement-icon-3 {
  display: flex;
  padding: 10px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 8px;
  border: 1px solid var(--Text-Primary-Dark, #e4e4e4);
  background: var(--color-card, #ffffff);
  box-shadow:
    0 1px 3px 0 rgba(0, 0, 0, 0.04),
    0 1px 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.improvement-text {
  font-size: 12px !important;
  font-family: 'Nunito Sans', sans-serif;
  
  color: var(--color-text-primary, #384551) !important;
}

.improvement-icon.tone {
  background-color: var(--color-primary, #696cff);
  box-shadow: 0 0 0 2px #dbeafe;
}

.improvement-icon.format {
  background-color: #e5a000;
  box-shadow: 0 0 0 2px #fef1d3;
}

.improvement-icon.structure {
  background-color: #c00f0c;
  box-shadow: 0 0 0 2px #f8dbda;
}

.warning-inner {
  /* display: flex;
  align-items: center;
  padding: 14px 0px;
  margin-left: 5%;
  margin-right: 5%;
  gap: 5px; */
}

.style-conversion {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}

.style-label {
  padding: 6px 14px;
  border-radius: 4px;
}

.style-label.informal {
  font-family: 'Nunito Sans', sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 12.6px;
  text-align: left;
  text-underline-position: from-font;
  text-decoration-skip-ink: none;
}

.style-label.professional {
  font-size: 12px;
  font-weight: 400;
  line-height: 12.6px;
  text-align: left;
  text-underline-position: from-font;
  text-decoration-skip-ink: none;
}

.action-button {
  background: linear-gradient(180deg, var(--color-primary-hover) 0%, var(--color-primary) 100%);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 8px;
  width: 100%;
  cursor: pointer;
  font-size: 14px;
  width: 91%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: -1px -10px 20px 6px white !important;
  transition: all 0.15s ease;
  position: relative;
}

/* Premium gradient effect from top - same as genBtn */
.action-button::before {
  content: '';
  position: absolute;
  top: -50px;
  left: 0;
  right: 0;
  height: 50px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 100%);
  filter: blur(20px);
  pointer-events: none;
  z-index: -1;
}

.action-button:hover {
  background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
  box-shadow: -1px -10px 20px 6px white !important;
  opacity: 1;
}

/* ================================= Style Inner Section ================================= */
/* ||||||||||||||||||||||||||||||||| style-inner |||||||||||||||||||||||||||||||| */
.style-inner {
  display: grid;
  padding: 20px;
  row-gap: 10px;
  column-gap: 10px;
  flex: 1 0 0;
  align-self: stretch;
  grid-template-rows: repeat(4, minmax(0, 1fr));
  grid-template-columns: repeat(1, minmax(0, 1fr));
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  background: var(--color-bg, #FAFAF8);
  flex-direction: column;
}

.style-option {
  display: flex;
  align-items: center;
  border-radius: clamp(7px, 3vw, 0px);
  border: 1px solid rgba(228, 228, 228, 1);
  box-shadow:
    0px 1px 1px 0px rgba(255, 255, 255, 0.9) inset,
    0px 1px 3px 0px rgba(0, 0, 0, 0.08);
  gap: 3px;
  padding: 10px 10px;
  justify-content: flex-start;
  font-family: 'Nunito Sans', sans-serif;
  font-weight: 400;
  font-style: normal;
  line-height: 18px;
  letter-spacing: 0%;
  cursor: pointer;
}

.style-option:hover {
  border: 1px solid rgba(228, 228, 228, 1);
  background: linear-gradient(138.61deg, #ffffff 12.36%, #f1f3f4 94.3%);
  box-shadow:
    0px 1px 1px 0px rgba(255, 255, 255, 0.9) inset,
    0px 2px 8px 0px rgba(0, 0, 0, 0.06),
    0px 1px 3px 0px rgba(0, 0, 0, 0.04);
}

@media (max-width: 480px) {
  .style-option {
    padding: 8px 10px;
  }
}

.style-icon {
  /* padding: clamp(2px, 0.5vw, 3px); */
  border-radius: 20%;
  display: flex;
  align-items: center;
  justify-content: center;
  /* margin: clamp(2px, 0.5vw, 2px) clamp(4px, 1vw, 6px) clamp(4px, 1vw, 7px) clamp(4px, 1vw, 6px); */
  font-size: clamp(16px, 4vw, 20px);
  /* flex-shrink: 0; */
  padding: 4px;
  margin-right: 5px;
}

.style-icon.formal {
  background-color: #e8eaff;
  color: #6b77ff;
}

.style-icon.chat {
  background-color: #e6faea;
  color: #2ed573;
}

.style-icon.book {
  background-color: #fff0ff;
  color: #cd84f1;
}

.style-icon.humor {
  background-color: #fff4e4;
  color: #ffaf40;
}

.style-content {
  /* flex: 1;
  min-width: 0; */
  cursor: pointer;
}

.style-title {
  font-size: clamp(12px, 3vw, 14px);
  /* font-weight: 500; */
  /* color: #414141; */
  /* margin-bottom: clamp(3px, 0.5vw, 4px); */
  /* line-height: 1.3; */
  /* word-break: break-word; */
  color: var(--Text-Muted, #6c757d);
  transition: color 0.3s ease;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  cursor: pointer !important;
  /* line-height: 18px; */
}

.style-title:hover {
  color: var(--color-text-primary, #384551);
  cursor: default;
}

.style-description {
  display: none;
  font-size: clamp(11px, 2.5vw, 12px);
  color: #414141;
  line-height: 1.4;
  word-break: break-word;
}

/* Additional responsive utilities */
@media (max-width: 320px) {
  .correction-content {
    padding: 4px;
    min-height: 100px;
  }

  .explanation-item {
    padding: 8px;
  }

  .analysis-card {
    width: 98%;
    padding: 8px 10px;
  }

  .action-button {
    width: 98%;
    font-size: 13px;
  }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .correction-content::-webkit-scrollbar {
    width: 6px;
  }
}

/* Landscape orientation adjustments for mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .correction-content {
    min-height: 80px;
  }
}

/* ================================= Collapsed Sidebar States ================================= */
.correction-sidebar-collapsed {
  display: flex;
  width: 80px;
  padding: 45px 10px;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  flex: 1 0 0;
  border-top: 1px solid var(--Text-Primary-Dark, #e4e4e4);
  background: #f8f9fa;
  border-radius: 0;
}

.collapsed-header {
  padding: 10px 0;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 15px;
  width: 100%;
  display: flex;
  justify-content: center;
}

.expand-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.expand-toggle-btn:hover {
  background-color: #e0e0e0;
}

.collapsed-options {
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;
  width: 100%;
}

.collapsed-option {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: background-color 0.2s;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.collapsed-option:hover {
  background-color: #e0e0e0;
}

.collapsed-option.active {
  background-color: #fcedf0;
  color: var(--color-primary);
}

/* Collapsed state styles */
.correction-sidebar.collapsed .header-content {
  display: none;
}

.correction-sidebar.collapsed .improv-inner,
.correction-sidebar.collapsed .correction-inner,
.correction-sidebar.collapsed .style-inner,
.correction-sidebar.collapsed .voice-section{
  display: none !important;
}

.correction-sidebar.collapsed .sidebar-collapsed-icons {
  display: flex !important;
  width: 80px;
  padding: 45px 10px;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  flex: 1 0 0;
  border-top: 1px solid var(--Text-Primary-Dark, #e4e4e4);
  background: #f8f9fa;
}

.correction-sidebar.collapsed .hk-dropdown-container {
  display: none !important;
}

.sidebar-collapsed-icons {
  display: none;
}

.sidebar-btn-container {
  width: 100%;
  display: flex;
  justify-content: center;
}

.sidebar-icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.2s;
  min-width: 48px;
  width: 100%;
}

.sidebar-icon-btn:hover {
  background-color: rgba(37, 36, 36, 0.027);
}

.sidebar-svg-icon {
  margin-bottom: 4px;
  display: flex;
  padding: 10px;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  border: 1px solid var(--Text-Primary-Dark, #e4e4e4);
  background: var(--color-card, #ffffff);
  box-shadow:
    0 1px 3px 0 rgba(0, 0, 0, 0.04),
    0 1px 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.icon-label {
  font-size: 10px !important;
  color: #666;
  text-align: center;
  line-height: 1.2;
}

/* ================================= Speech Bubble ================================= */
.hamdan-speech-bubble {
  display: flex;
  width: 100%;
  padding: 16px;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 8px;
  grid-row: 1 / span 1;
  grid-column: 1 / span 1;
  justify-self: center;
  border-radius: 8px;
  background: var(--color-card, #ffffff);
  box-shadow: var(--shadow-card, 0 3px 8px rgba(34, 48, 62, 0.1));
  color: var(--color-text-primary, #384551);
  text-align: center;

  /* UI/Meta Text */
  font-family: 'Nunito Sans', sans-serif;
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  line-height: 16px;
  /* 133.333% */
  align-self: center;
}

.hamdan-speech-bubble::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.3) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 100%
  );
  pointer-events: none;
  border-radius: 28px;
  opacity: 0.8;
}

.hamdan-speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid #ffffff;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.03)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.02));
}

.hamdan-robot-container {
  position: relative;
  display: inline-block;
  z-index: 1;
}

@keyframes hamdan-fadeInScale-5115 {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px) scale(0.8);
  }

  60% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1.05);
  }

  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

/* ================================= Responsive Design ================================= */
@media screen and (max-width: 767px) {
  .correction-sidebar {
    display: none !important;
  }
}

@media screen and (max-width: 450px) {
  .correction-sidebar {
    display: none !important;
  }
}

.hamdan-robot-container {
  position: relative;
  display: inline-block;
  z-index: 1;
  min-width: 110px;
  /* Add this */
  min-height: 110px;
  /* Add this */
}

#gif {
  width: 110px;
  /* Add this */
  height: 110px;
  /* Add this */
  display: flex;
  /* Add this */
  align-items: center;
  /* Add this */
  justify-content: center;
  /* Add this */
}

span.warning-msg {
  color: var(--Text-Primary, #495057);
  text-align: center;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  line-height: 16px;
  align-self: stretch;
}

.correction-sidebar-dropdown-svg path {
  stroke: rgba(108, 117, 125, 1);
}

.correction-sidebar-dropdown-svg {
  width: 18.66px;
  height: 18.66px;
}

.correction-sidebar-dropdown2-svg path {
  fill: #adb5bd;
  stroke: none;
}

.correction-sidebar-dropdown2-svg {
  width: 18.66px;
  height: 18.66px;
}

.hk-dropdown-option.active svg:not(.correction-sidebar-dropdown2-svg) path {
  stroke: #fff;
}

.hk-dropdown-option.active svg:not(.correction-sidebar-dropdown-svg) path {
  fill: none;
  stroke: #fff;
}

.hk-dropdown-option svg {
  width: 18.66px;
  height: 18.66px;
}

span#micButton2 {
  background: none;
  border: none;
  box-shadow: none;
}

/* --------------------- circle loader ------------------- */
@keyframes sneatSpin { to { transform: rotate(360deg); } }

.gradient-loader {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin-right: 0px !important;
  position: relative;
  overflow: hidden;
  background: transparent;
  border: 2.5px solid rgba(var(--color-primary-rgb), .15);
  border-top-color: var(--color-primary);
  animation: sneatSpin 0.9s linear infinite;
}

.demo-inner .hamdan-speech-bubble {
  margin-bottom: 8px;
}

.explanation-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 19.8px;
}

.show-hide-underlines {
  font-family: 'Nunito Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: rgb(108, 117, 125);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid var(--color-border, #e4e6e8);
  background-color: transparent;
  transition: 0.15s;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow:
    rgba(255, 255, 255, 0.9) 0px 1px 1px 0px inset,
    rgba(0, 0, 0, 0.04) 0px 1px 3px 0px;
  transform: translateY(0px);
}

.show-hide-underlines:hover {
  box-shadow:
    rgba(255, 255, 255, 0.9) 0px 1px 1px 0px inset,
    rgba(0, 0, 0, 0.06) 0px 2px 4px 0px;
  transform: translateY(-1px);
  border: 1px solid rgba(0, 0, 0, 0.12);
  background-color: rgba(0, 0, 0, 0.04);
}

.show-hide-underlines svg {
  color: rgb(108, 117, 125);
  opacity: 0.7;
}

.correction-inner .correction-inner-main .hamdan-speech-bubble {
  text-align: left !important;
}

.hamdan-speech-bubble .markdown-body {
  background-color: #fff !important;
  color: var(--color-text-primary, #384551) !important;
}

.hamdan-speech-bubble:has(.markdown-body) {
  width: 200px !important;
}
.correction-inner-main .hamdan-speech-bubble {
    
    flex-direction: column;
}

/* ===== CORRECTION LEVEL SLIDER ===== */
.correction-level-container {
  position: relative;
  width: 100%;
  background: var(--color-card, #ffffff);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow-card, 0 3px 8px rgba(34, 48, 62, 0.1));
  font-family: 'Nunito Sans', sans-serif;
}

/* Help Button - Positioned top-right of container */
.level-help-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  background: transparent;
  color: #b4b9c1;
  cursor: pointer;
  border-radius: 50%;
  transition: color 0.15s ease;
  z-index: 1;
}

.level-help-btn:hover {
  color: var(--color-text-secondary, #646e78);
}

.level-help-btn:focus {
  outline: none;
  color: var(--color-text-secondary, #646e78);
}

/* Tooltip - Opens above, light theme */
.level-help-tooltip {
  position: absolute;
  top: 16px;
  right: 6px;
  background: var(--color-card, #ffffff);
  color: var(--color-text-primary, #384551);
  padding: 12px 16px;
  border-radius: 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  width: 260px;
  text-align: left;
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-100%) translateY(-8px);
  transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.03);
}

.level-help-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 18px;
  border: 6px solid transparent;
  border-top-color: #ffffff;
}

.level-help-btn:hover + .level-help-tooltip,
.level-help-btn:focus + .level-help-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-100%) translateY(-12px);
}

/* Level Header */
.level-header {
  text-align: center;
  margin-bottom: 0;
}

.level-title {
  font-family: 'Nunito Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary, #646e78);
  text-align: center;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.level-subtitle {
  font-family: 'Nunito Sans', sans-serif;
  font-size: 20px !important;
  font-weight: 700 !important;
  color: var(--color-text-primary, #384551);
  text-align: center;
  margin-bottom: 14px;
  transition: all 0.3s ease;
}

/* Slider Container */
.level-slider-wrapper {
  position: relative;
  width: 100%;
  padding: 0 0 8px;
}

/* Hide the old track elements */
.level-slider-track,
.level-slider-progress,
.level-slider-fill {
  display: none;
}

/* Slider - matching tone-slider style */
.level-slider {
  width: calc(100% + 8px);
  margin: 0 -4px;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg,
    rgba(var(--color-primary-rgb), 0.55) 0%,
    rgba(var(--color-primary-rgb), 0.75) 25%,
    var(--color-primary) 50%,
    var(--color-primary-hover) 75%,
    rgba(var(--color-primary-rgb), 0.7) 100%
  );
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  cursor: pointer;
}

.level-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-primary, #696cff);
  border: 3px solid white;
  box-shadow: 0 2px 6px rgba(var(--color-primary-rgb), 0.3);
  cursor: pointer;
  transition: all 0.15s ease;
}

.level-slider::-webkit-slider-thumb:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.4);
}

.level-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-primary, #696cff);
  border: 3px solid white;
  box-shadow: 0 2px 6px rgba(var(--color-primary-rgb), 0.3);
  cursor: pointer;
}

/* Tick marks - hidden for cleaner design (labels are sufficient) */
.level-ticks {
  display: none;
}

.level-tick {
  width: 2px;
  height: 8px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 1px;
}


/* Labels - matching .voice-slider-labels */
.level-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  margin-left: -4px;
  margin-right: -4px;
  width: calc(100% + 8px);
  font-family: 'Nunito Sans', sans-serif;
}

.level-label {
  font-family: 'Nunito Sans', sans-serif;
  font-size: 11px !important;
  color: var(--color-text-secondary, #646e78);
  font-weight: 400;
  cursor: pointer;
  transition: color 0.2s ease;
  text-align: center;
  flex: 1;
}

.level-label:first-child {
  text-align: left;
}

.level-label:last-child {
  text-align: right;
}

.level-label:hover {
  color: var(--color-text-secondary, #646e78);
}

.level-label.active {
  color: var(--color-text-primary, #384551);
  font-weight: 600;
}

#grammarModeContainer{
  width: 100% !important;
}


/* correctionSidebarLoader.css */
/* ===================================== Correction Sidebar Loaders ================================ */

/* Base loader backdrop for correction content */
.correction-content .loader-backdrop {
  background: transparent;
  min-height: 200px;
}

/* Sneat spinner loader */
@keyframes sneatSpin { to { transform: rotate(360deg); } }

/* Small gradient loader for correction messages */
.gradient-loader {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin-right: 6px;
  position: relative;
  overflow: hidden;
  background: transparent;
  border: 2.5px solid rgba(var(--color-primary-rgb), .15);
  border-top-color: var(--color-primary);
  animation: sneatSpin 0.9s linear infinite;
}

/* Smart help gradient loader */
.gradient-loader-smart {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin-right: 6px;
  position: relative;
  overflow: hidden;
  background: transparent;
  border: 2.5px solid rgba(var(--color-primary-rgb), .15);
  border-top-color: var(--color-primary);
  animation: sneatSpin 0.9s linear infinite;
}


.perfect-state-bot-container {
  width: 85%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  margin: auto;
  gap: 10px;
}


/* explanation-TTS.css */
.explanation-audio-btn {
  gap: 10px;
  flex-shrink: 0;
  position: absolute;
  right: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  transition: 0.15s;
  opacity: 1;
  pointer-events: auto;

}

.explanation-audio-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.explanation-audio-btn {
  opacity: 0;
  visibility: hidden;
  transform: scale(0.8);
  transition: all 0.2s ease;
}

.explanation-item:hover .explanation-audio-btn {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

/* Keep visible when playing */
.explanation-audio-btn[data-state='stop'] {
  opacity: 1 !important;
  visibility: visible !important;
  transform: scale(1) !important;
}


/* explanationScrollbar.css */
/* explanationScrollbar.css custom scrollbar styles */

/* For Chrome, Edge, and Safari */
.explanation-list::-webkit-scrollbar {
  width: 8px;
}

.explanation-list::-webkit-scrollbar-track {
  background: #f9f9f9;
  border-radius: 4px;
}

.explanation-list::-webkit-scrollbar-thumb {
  background: #d1d1d1;
  border-radius: 4px;
  border: 2px solid #f9f9f9;
}

.explanation-list::-webkit-scrollbar-thumb:hover {
  background: #b8b8b8;
}

/* For Firefox */
.explanation-list {
  scrollbar-width: thin;
  scrollbar-color: #d1d1d1 #f9f9f9;
}


/* formatToolbar.css */
/* ===== FLOATING FORMAT TOOLBAR ===== */
.format-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 100px;
    box-shadow:
      0 2px 8px rgba(0, 0, 0, 0.08),
      0 1px 2px rgba(0, 0, 0, 0.04);
    z-index: 10;
  }

  .format-group {
    display: flex;
    align-items: center;
    gap: 2px;
  }

  .format-divider {
    width: 1px;
    height: 20px;
    background: rgba(0, 0, 0, 0.08);
    margin: 0;
  }

  .format-separator {
    width: 1px;
    height: 16px;
    background: rgba(0, 0, 0, 0.06);
    margin: 0 4px;
  }

  .format-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: #9ca3af;
    font-family: 'Georgia', serif;
    font-size: 15px;
    font-weight: 600;
  }

  .format-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #6b7280;
  }

  .format-btn:active {
    background: rgba(0, 0, 0, 0.08);
  }

  .format-btn.active {
    background: #f3f4f6;
    color: #374151;
  }

  .format-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
  }

  .format-btn:disabled:hover {
    background: transparent;
    color: #9ca3af;
  }

  .format-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
  }

  /* ===== UNDO/REDO ANIMATIONS ===== */
  #revertBack.triggered svg {
    animation: undoNudge 0.2s ease-out;
  }

  #redoBtn.triggered svg {
    animation: redoNudge 0.2s ease-out;
  }

  @keyframes undoNudge {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(-20deg); }
  }

  @keyframes redoNudge {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(20deg); }
  }

  /* ===== MAIN SWITCHER TOGGLE ===== */
  #mainSwitcher {
    position: relative;
    transition: all 0.2s ease;
  }

  #mainSwitcher svg {
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
  }

  #mainSwitcher:not(:disabled):active {
    transform: scale(0.92);
  }

  #mainSwitcher.viewing-original svg {
    color: #374151;
    stroke: #374151;
    transform: rotate(180deg);
  }

    #copyBtn .check-icon{
    display: block;
    color: #10b981;
    animation: checkPop 0.2s ease-out;
  }


/* global.css */
/* Remove Browser Scrollbar */
  html,
  body {
    overflow: hidden !important;
    /* Use CSS custom property for dynamic height */
    height: var(--app-height, 100dvh);
    /* Fallback for browsers that don't support dvh */
    height: var(--app-height, 100vh);
  }
  
  /* Root level CSS variable for app height */
  :root {
    --app-height: 100vh;
  }

  /* Hide Browser Scrollbar */
  html::-webkit-scrollbar,
  body::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  html::-webkit-scrollbar-button,
  body::-webkit-scrollbar-button {
    display: none !important;
    height: 0 !important;
    width: 0 !important;
   }
  
  html {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
  }
  
  /* Custom Scrollbar Styling */
  
  /* Firefox */
  * {
    scrollbar-width: thin;
    /* match global thumb + transparent track for Firefox */
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
  }
  
  /* Chrome, Edge, Safari */
  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  
  ::-webkit-scrollbar-track {
    background: transparent;
  }
  
  ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
  }
  
  ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
  }

  /* Textarea Wrapper - Thin Light Scrollbar */
  .textarea-wrapper::-webkit-scrollbar {
    width: 2px;
  }

  .textarea-wrapper::-webkit-scrollbar-track {
    background: transparent;
  }

  .textarea-wrapper::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
  }

  .textarea-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.15);
  }

  .textarea-wrapper::-webkit-scrollbar-button {
    display: none !important;
    height: 0 !important;
    width: 0 !important;
    background: #f8f9fa;
   }
   
  .textarea-wrapper {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.04) transparent;
  }

  /* Hide Explanation List Scrollbar */
  .explanation-list::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  .explanation-list {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
  }

  .elementor-28566 .elementor-element.elementor-element-bc27633.e-con {
    --align-self: center;
    --flex-grow: 0;
    --flex-shrink: 0;
    margin: 0 !important;
    border: none !important;
    padding: 0 !important;
  }

::-moz-scrollbar-button, ::-webkit-scrollbar-button {
  width: 0px;
}


/* grammer.css */
.new-korrektur {
  font-family: 'Nunito Sans', sans-serif;
}
/***********Stacking Context Issue Fix***********/

.text-area-container {
  position: relative;
  z-index: 0;
}

.main-textarea-section {
  position: relative;
  z-index: 3;
}

.correction-sidebar {
  position: relative;
  z-index: 100;
}
/* =================================== top headings div ================================ */
.top-headings-div {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 12px;
}

.top-headings-div span {
  font-size: 16px;
  font-weight: 400;
  line-height: 19.2px;
  text-align: center;
  text-underline-position: from-font;
  text-decoration-skip-ink: none;
  color: var(--color-text-primary, #384551);
}

/* -------------------------------- lang legend div ---------------------------- */
.lang-legend-div {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  width: 100%;
  flex-wrap: wrap;
}

/* --------------------------------- toolbar contaienr  ---------------------------- */
.toolbar-container {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px;
  gap: 1rem;
  background-color: #f9f9f9;
  border: 1px solid var(--color-border, #e4e6e8);
  border-radius: 7px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.toggle-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  border-right: 1px solid #f3f4f6;
}

.switch {
  position: relative;
  width: 36px;
  height: 20px;
}

.switch-input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-input:checked + .switch-slider {
  background-color: #141b34;
}

.switch-input:checked + .switch-slider:before {
  transform: translateX(13px);
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e5e7eb;
  transition: 0.4s;
  border-radius: 20px;
}

.switch-slider:before {
  position: absolute;
  content: '';
  height: 10px;
  width: 10px;
  left: 10px;
  bottom: 5px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

.switch-label {
  color: var(--color-text-primary, #384551);
  font-family: 'Nunito Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  line-height: 13.2px;
  text-align: center;
  text-underline-position: from-font;
  text-decoration-skip-ink: none;
}

/* =============================================== Legend section =============================================== */
.legend-section {
  display: flex;
  flex-direction: row;
  background: transparent;
  border: none;
  justify-content: center;
  align-items: center;
  width: fit-content;
  gap: 16px;
  border-radius: 0;
  box-shadow: none;
  padding: 8px 0;
  margin: 0 auto;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-text {
  font-size: 13px !important;
  color: var(--color-text-secondary, #646e78);
  line-height: 1;
  white-space: nowrap;
  font-weight: 500;
}

.legend-dot.change {
  background-color: var(--color-primary, #696cff);
}

.legend-dot.add {
  background-color: #f59e0b;
}

.legend-dot.remove {
  background-color: #ef4444;
}

/* =============================================== Text-area container =============================================== */
.text-area-container {
  display: flex;
  justify-content: space-between;
  position: relative;
  min-height: 420px;
  height: auto;
  max-height: none;
  transition: height 0.3s ease-in-out;
  box-sizing: border-box;
  align-items: stretch;
  /* Use CSS custom property for dynamic height, fallback to dvh and vh */
  height: var(--app-height, 100dvh);
  /* Fallback for browsers that don't support dvh */
  height: var(--app-height, 100vh);
}

.inner-textarea-bottom {
  flex-basis: 69%;
  /* background: linear-gradient(179.63deg, #ffffff 56.57%, #f8f9fa 99.68%) !important; */
  background-color: white !important;
  box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---------------------------------- left cantainer   ---------------------------- */
.main-textarea-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 420px;
  box-sizing: border-box;
  padding: 20px 60px;
  overflow: hidden;
}

/* _____________________________________ header of left container ______________________ */
.top-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  background: #f8f9fa;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 100px;
  box-shadow:
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 3px rgba(0, 0, 0, 0.04);
  flex-shrink: 0;
  box-sizing: border-box;
  margin-bottom: 0.5px;
}

/* Left Controls - no background, just flex container */
.left-controls {
  display: flex;
  align-items: center;
  gap: 0px;
}

/* Right Controls - no background, just flex container */
.right-controls {
  display: flex;
  align-items: center;
  gap: 0px;
}

/* Base button styles */
.control-btn {
  display: flex;
  padding: 8px;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  border-radius: 8px;
  border: none;
  background: transparent;
  transition: all 0.15s ease;
}

.tts-contrl-btn svg {
  color: var(--color-text-secondary, #646e78);
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  transition: all 0.15s ease;
}

.control-btn:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.05);
}

.control-btn:hover:not(:disabled) svg {
  color: var(--color-text-secondary, #646e78);
}

#showSavedResponsesBtn:hover:not(:disabled) svg {
  color: var(--color-text-secondary, #646e78);
  fill: #6b7280;
}

.control-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* SVG icon styling */
.control-btn svg {
  color: var(--color-text-secondary, #646e78);
  transition: all 0.15s ease;
}

/* Specific adjustments for different icons */

/* File input styling */
#imageUpload {
  display: none;
}

/* Remove any old styling */
.revert-clear-btn {
  display: contents;
}

.vertical-hr {
  display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .top-controls {
    /* margin: 10px 15px; */
    padding: 6px 10px;
    border-radius: 28px;
  }

  
}

/* Textarea wrapper */
.textarea-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  transition: height 0.3s ease-in-out;
  min-height: 200px;
  height: auto;
  overflow: auto;
  width: 100%;
  box-sizing: border-box;
}

/* Drop zone: only when Quill is empty; visual feedback while dragging */
.textarea-wrapper.drop-active {
  outline: 2px dashed rgba(0, 0, 0, 0.2);
  outline-offset: 2px;
  margin: 10px;
  border-radius: 8px;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.06);
}

.textarea-wrapper.drop-active::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.06);
  pointer-events: none;
  z-index: 1;
}

/* ++++++++++++++++++++++++++++++++++++++ input feild styling +++++++++++++++++++++++++++++++++ */
#inputText {
  width: 100%;
  min-height: 200px;
  height: auto;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  font-size: 16px;
  flex: 1;
  box-sizing: border-box;
}

#inputText * {
  color: var(--color-text-primary, #384551) !important;
  font-family: 'Nunito Sans', sans-serif !important;
  font-size: 16px !important;
  text-align: left !important;
  line-height: 28px;
}

#inputText blockquote {
  border-left: 3px solid !important;
}

/* Placeholder styling */
#inputText.is-empty::before {
  content: attr(placeholder);
  position: absolute;
  top: 0;
  left: 0;
  padding: inherit;
  color: #888 !important;
  pointer-events: none;
}

/* Force empty elements to minimum height */
#inputText.is-empty {
  height: auto !important;
}

.markdown-body table {
  width: 100% !important;
}

#inputText .markdown-body table tr {
  background-color: white !important;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  border-bottom: none !important;
}

/* ================================= Generate Button — Sneat style =============================== */
.write-applicationDiv {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: 100%;
  border-radius: 8px;
  border: none;
  background: var(--color-primary, #696cff);
  color: #fff;
  padding: 14px 20px;
  font-family: 'Nunito Sans', sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.1px;
  box-shadow: 0 2px 6px 0 rgba(var(--color-primary-rgb), 0.4) !important;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
}

.write-applicationDiv::before {
  display: none;
}

.write-applicationDiv:disabled {
  cursor: default !important;
  color: #fff !important;
  opacity: .65 !important;
  box-shadow: none !important;
}

.write-applicationDiv svg {
  width: 17px;
  height: 17px;
  stroke: #fff;
  fill: none;
}

.write-applicationDiv:hover {
  background: var(--color-primary-hover, #5a5ee0) !important;
  box-shadow: 0 4px 12px 0 rgba(var(--color-primary-rgb), 0.4) !important;
  transform: translateY(-1px);
}

.write-applicationDiv:focus {
  color: #ffffff !important;
}

.write-applicationDiv:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px 0 rgba(var(--color-primary-rgb), 0.4) !important;
}

/* -------------------------- gen btn disabled ---------------- */
.disabled-gen-btn {
  color: #ffffff !important;
  cursor: not-allowed !important;
  opacity: 0.7 !important;
  pointer-events: none !important;
}

.disabled-gen-btn:hover {
  color: #ffffff !important;
  cursor: not-allowed !important;
  opacity: 0.7 !important;
  pointer-events: none !important;
}

.sidebar-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0px 20px 20px 20px;
  flex-shrink: 0;
}

.bottom-buttons-wrapper {
  width: 100%;
}

/* -------------------------------------- grammer highlighting code ---------------------------- */
.grammar-correction-added {
  border-bottom: 2px solid;
  border-color: #1768fe !important;
  cursor: pointer;
}

.grammar-correction-removed {
  text-decoration: line-through;
  border-bottom: 2px solid;
  border-color: #c00f0c !important;
  cursor: pointer;
}

.grammar-correction-punctuation {
  border-bottom: 2px solid;
  border-color: #e5a000 !important;
  cursor: pointer;
}

#inputText mark.word-highlight {
  background-color: #fff1c2 !important;
  transition: background-color 3s !important;
}

.word-highlight {
  background-color: #fff1c2 !important;
  transition: background-color 3s !important;
}

.word-highlight-flash {
  animation: highlight-flash 0.5s ease-in-out !important;
}

@keyframes highlight-flash {
  0% {
    background-color: #fff1c2 !important;
  }

  50% {
    background-color: #ffffff !important;
  }

  100% {
    background-color: #fff1c2 !important;
  }
}

/* =============================== Rewrite ================================ */

/* ---------------------  new rewrite code -------------------------------------- */
/* =============================================================== rewrite modal =========================================== */
/* Modal styles */
.dk-hamdan-modal-container {
  width: 550px;
  max-width: 95vw;
  background: white;
  border-radius: 6px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  display: none;
}

/* Header styles */
.dk-hamdan-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.dk-hamdan-modal-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text-primary, #384551);
  margin: 0 0 4px 0;
}

.dk-hamdan-modal-subtitle {
  font-size: 14px;
  color: var(--color-text-secondary, #646e78);
  margin: 0;
}

.dk-hamdan-close-button {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--color-text-secondary, #646e78);
  border-radius: 6px;
  transition: all 0.2s;
}

.dk-hamdan-close-button:hover {
  background-color: #f3f4f6;
  color: var(--color-text-primary, #384551);
}

/* Options grid */
.dk-hamdan-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.dk-hamdan-option-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--color-border, #e4e6e8);
  border-radius: 6px;
  background: white;
  cursor: pointer;
}

.dk-hamdan-option-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.dk-hamdan-option-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-primary, #384551);
}

.dk-hamdan-option-description {
  font-size: 13px;
  color: var(--color-text-secondary, #646e78);
  text-align: center;
}

/* Custom input section */
.dk-hamdan-custom-input-section {
  background: #f9fafb;
  border: 1px solid var(--color-border, #e4e6e8);
  border-radius: 6px;
  padding: 16px;
  transition: all 0.2s;
}

.dk-hamdan-custom-input-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.dk-hamdan-custom-input-label {
  background: white;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--color-border, #e4e6e8);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-primary, #384551);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dk-hamdan-input-container {
  display: flex;
  padding: 20px;
  flex-direction: column;
  align-items: flex-start;
  align-self: stretch;
  background: #fff;
  flex-direction: row;
}

.dk-hamdan-custom-input {
  display: flex;
  padding: 13px 10px;
  justify-content: space-between;
  align-items: center;
  align-self: stretch;
  border-radius: 8px;
  border: 0.5px solid var(--Text-Primary-Dark, #e4e4e4);
  background: var(--Brand-card_grey, #f8f9fa);
}

.dk-hamdan-custom-input::placeholder {
  color: var(--color-text-secondary, #646e78);
}

.dk-hamdan-enter-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--color-text-secondary, #646e78);
}

.dk-hamdan-enter-key {
  background: #e5e7eb;
  color: var(--color-text-secondary, #646e78);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
}

.dk-hamdan-custom-input-controls {
  display: flex;
  gap: 4px;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: space-evenly;
  align-items: stretch;
}

/* Icons */
.dk-hamdan-icon {
  width: 20px;
  height: 20px;
  color: rgb(232, 107, 134);
}

.dk-hamdan-icon-small {
  width: 16px;
  height: 16px;
}

#convencing:hover {
  background-color: rgba(59, 130, 246, 0.1);
}

#simplify:hover {
  background-color: rgba(16, 185, 129, 0.1);
}

#elaborate:hover {
  background-color: rgba(236, 72, 153, 0.1);
}

#concise:hover {
  background-color: rgba(124, 58, 237, 0.1);
}

/* Custom input section */
.dk-hamdan-custom-input-section {
  background: #f9fafb;
  border: 1px solid var(--color-border, #e4e6e8);
  border-radius: 6px;
  padding: 16px;
  transition: all 0.2s;
}

.dk-hamdan-custom-input-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.dk-hamdan-custom-input-label {
  background: white;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--color-border, #e4e6e8);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-primary, #384551);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dk-hamdan-input-container {
  position: relative;
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--color-border, #e4e6e8);
  border-radius: 8px;
  padding: 0;
  width: 100%;
  max-width: 100%;
  align-self: flex-end;
  justify-content: space-between;
}

.dk-hamdan-custom-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--color-text-primary, #384551);
  font-family: inherit;
  max-width: 60%;
}

.dk-hamdan-custom-input::placeholder {
  color: var(--color-text-secondary, #646e78);
  font-size: 14px;
}

/* Clear/Submit icon */
.clear-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  cursor: pointer;
  border-radius: 6px;
  margin-right: 8px;
  background-color: var(--Text-Secondary-Dark, #a0a0a0);
  transition: background-color 0.15s ease;
}

.clear-icon:hover {
  background-color: var(--Text-Secondary-Dark, #7c7c7c);
}

.clear-icon svg {
  width: 16px;
  height: 16px;
  fill: white;
}

/* Hide clear icon by default - show with JavaScript */
.clear-icon.hidden {
  display: none;
}

.dk-hamdan-enter-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--color-text-secondary, #646e78);
}

.dk-hamdan-enter-key {
  background: #e5e7eb;
  color: var(--color-text-secondary, #646e78);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
}

/* Icons */
.dk-hamdan-icon {
  width: 20px;
  height: 20px;
  color: rgb(232, 107, 134);
}

.dk-hamdan-icon-small {
  width: 16px;
  height: 16px;
}

/* ------------------------------ navigation buttons ------------------------- */
.counter-nav-div {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 20px !important;
  flex-shrink: 0;
}

.word-counter-div {
  display: none;
  line-height: 21px;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  margin-bottom: 10px;
}

.word-count {
  font-size: 12px;
  color: var(--color-text-secondary, #646e78);
}
.response-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 14px;
  line-height: 18px;
  color: var(--color-text-primary, #384551);
  margin-top: 16px;
  display: none;
}

.nav-icons-div {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #667185;
  padding: 5px;
  border-radius: 6px;
}

.response-navigation button {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow:
    0 1px 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 1px 3px 0 rgba(0, 0, 0, 0.04);
}

.response-navigation button:hover:not(:disabled) {
  background: #f8f9fa;
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow:
    0 1px 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 2px 4px 0 rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.response-navigation button svg {
  width: 18px;
  height: 15px;
  flex-shrink: 0;
  display: block;
}

.response-counter {
  min-width: 130px;
  text-align: center;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 14px;
  line-height: 18px;
  color: var(--color-text-primary, #384551);
}

/* New CSS  - Response Navigation*/

div#style-response-navigation {
  justify-content: space-between;
  margin-top: 16px;
}

#voice-arrow-right {
  justify-content: center;
}

.nav-btn svg path {
  color: #6c757d;
  transition: fill 0.2s ease !important;
}

.nav-btn:disabled {
  cursor: not-allowed;
  opacity: 0.4;
  /* Remove opacity since we're handling fill color directly */
}

/* --------------------------------- download-------------------------------- */
.download-dropdown {
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-card, #ffffff);
  border-radius: 8px;
  border: none;
  box-shadow: 0 5px 16px rgba(75, 70, 92, 0.12), 0 2px 4px rgba(75, 70, 92, 0.06);
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 1000;
}

.download-dropdown::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 10px;
  height: 10px;
  background: var(--color-card, #ffffff);
  border-right: none;
  border-bottom: none;
  box-shadow: 2px 2px 4px rgba(75, 70, 92, 0.06);
  transform: translateX(-50%) rotate(45deg);
}

.download-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-family, 'Nunito Sans', sans-serif);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary, #384551);
  white-space: nowrap;
  min-height: 40px;
}
.download-option span {
  margin-bottom: -2px;
}
.download-option:hover {
  background: rgba(var(--color-primary-rgb), 0.04);
}

.download-option:last-child {
  margin-bottom: 0;
}
.download-option svg {
  width: 16px;
  height: 16px;
}

.download-option-divider {
  height: 1px;
  background: rgb(0 0 0 / 8%);
  margin: 2px 10px;
}
/* ====================================== history styling ================================ */

/* ------------------------ show saved history ------------------------------ */
/* ----------------------------------- popup of saved responses ------------------------------------ */
.popup {
  display: none;
  position: fixed;
  z-index: 1;
  top: 0;
  left: 0;
  width: 100vw;
  /* Use CSS custom property for dynamic height on mobile */
  height: var(--app-height, 100vh);
  background-color: rgba(0, 0, 0, 0.4);
  align-items: center;
  justify-content: center;
}

.hClose {
  background: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
}

.loader2 {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  border-radius: 8px;
}

.dotted-loader {
  position: relative;
  width: 16px;
  height: 20px;
}

.dotted-loader .dot {
  position: absolute;
  width: 3px;
  height: 3px;
  background-color: #888;
  border-radius: 50%;
  animation: fade 1s linear infinite;
  transform-origin: 10px 10px;
}

/* Create 8 dots positioned in a circle */
.dotted-loader .dot:nth-child(1) {
  transform: rotate(0deg) translateX(8px);
  animation-delay: 0s;
}

.dotted-loader .dot:nth-child(2) {
  transform: rotate(45deg) translateX(8px);
  animation-delay: 0.125s;
}

.dotted-loader .dot:nth-child(3) {
  transform: rotate(90deg) translateX(8px);
  animation-delay: 0.25s;
}

.dotted-loader .dot:nth-child(4) {
  transform: rotate(135deg) translateX(8px);
  animation-delay: 0.375s;
}

.dotted-loader .dot:nth-child(5) {
  transform: rotate(180deg) translateX(8px);
  animation-delay: 0.5s;
}

.dotted-loader .dot:nth-child(6) {
  transform: rotate(225deg) translateX(8px);
  animation-delay: 0.625s;
}

.dotted-loader .dot:nth-child(7) {
  transform: rotate(270deg) translateX(8px);
  animation-delay: 0.75s;
}

.dotted-loader .dot:nth-child(8) {
  transform: rotate(315deg) translateX(8px);
  animation-delay: 0.875s;
}

@keyframes fade {
  0%,
  100% {
    opacity: 0.3;
  }

  50% {
    opacity: 1;
  }
}

/* Custom scrollbar styles for Webkit browsers (Chrome, Safari, Edge) */
#savedResponsesList::-webkit-scrollbar {
  width: 11px;
}

#savedResponsesList::-webkit-scrollbar-track {
  background: #f9f9f9;
  border-radius: 4px;
}

#savedResponsesList::-webkit-scrollbar-thumb {
  background: #d1d1d1;
  border-radius: 4px;
  border: 2px solid #f9f9f9;
}

#savedResponsesList::-webkit-scrollbar-thumb:hover {
  background: #b8b8b8;
}

.text-area ul,
.text-area .editor-list {
  list-style-type: disc !important;
  margin-left: 20px !important;
  padding-left: 20px !important;
}

.text-area ol {
  list-style-type: decimal !important;
  margin-left: 20px !important;
  padding-left: 20px !important;
}

.text-area li,
.text-area .editor-list-item {
  display: list-item !important;
  list-style-position: outside !important;
}

.markdown-body table {
  width: 100% !important;
}

.markdown-body table tr {
  background-color: white !important;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  border-bottom: none !important;
  font-size: 16px !important;
}

/* =========================== input field =========================== */
/* Hide the default Quill toolbar */
.ql-toolbar.ql-snow {
  display: none;
}

/* Style the editor to match the original textarea */
.ql-container.ql-snow {
  border: none;
  font-family: inherit;
  font-size: inherit;
  height: auto !important;
  box-sizing: border-box;
}

.ql-editor {
  padding: 20px;
  min-height: 300px;
  height: auto;
  overflow-y: visible;
  box-sizing: border-box;
  resize: none;
  height: 100%;
}

.ql-editor.ql-blank::before {
  color: #adb5bd;
  content: attr(data-placeholder);
  font-style: normal;
  left: 20px;
  pointer-events: none;
  position: absolute;
  right: 15px;
}

#uploadImg {
  margin-left: 3px;
}

.revert-clear-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f5f5f5;
  border-radius: 8px;
  padding: 3.5px 2px;
}

.vertical-hr {
  border: none;
  border-left: 1px solid #d9d9d9;
  height: 15px;
  width: 0;
}

#inputText h1 {
  font-size: 16px !important;
}

#inputText h2 {
  font-size: 16px !important;
}

#inputText h3 {
  font-size: 16px !important;
}

#inputText h4 {
  font-size: 16px !important;
}

#inputText h5 {
  font-size: 16px !important;
}

#inputText h6 {
  font-size: 16px !important;
}

.ql-editor ol {
  margin: 16px 0 !important;
}

.ql-editor ul {
  margin: 16px 0 !important;
}

.ql-editor p {
  margin: 0 0 5px !important;
}

.ql-container {
  overflow-anchor: none;
}

.ql-container,
.ql-editor {
  overflow: visible !important;
  max-height: none !important;
}

.ql-table-menus-container {
  display: none !important;
}

.ql-operate-line-container {
  display: none !important;
}

.ql-table-better {
  margin-bottom: 20px !important;
}

.ql-editor table {
  font-size: 16px !important;
}

/* Smooth transitions */
.text-area-container,
.main-textarea-section,
#inputText,
.textarea-wrapper {
  transition: height 0.2s ease-in-out;
}

/* Override any conflicting box-sizing */
.text-area-container *,
.main-textarea-section * {
  font-size: 14px;
  font-family: 'Nunito Sans', sans-serif;
  box-sizing: border-box;
}

/* highlight colour for the mark blot and everything inside it */
mark.word-highlight,
mark.word-highlight * {
  background-color: #fff1c2 !important;
}

.ql-editor > h1:first-child + p > br:only-child,
.ql-editor > h2:first-child + p > br:only-child,
.ql-editor > h3:first-child + p > br:only-child,
.ql-editor > h4:first-child + p > br:only-child,
.ql-editor > h5:first-child + p > br:only-child,
.ql-editor > h6:first-child + p > br:only-child {
  display: none !important;
}

#inputText *:not(.word-highlight) {
  background-color: #fff !important;
}

/* ---------------- char limiting code ---------------- */
.char-limit-warning-limited {
  font-size: 12px !important;
  margin-bottom: 0px !important;
}

.char-limit-warning-red {
  color: var(--color-primary) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
}

.correction-sidebar-opsaeting-svg {
  width: 16px;
  height: 14px;
}

.sidebar-collapsed-icons {
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}

/* Remove autofill background for your specific input */
#custom_rewrite_input:-webkit-autofill,
#custom_rewrite_input:-webkit-autofill:hover,
#custom_rewrite_input:-webkit-autofill:focus,
#custom_rewrite_input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px white inset !important;
  box-shadow: 0 0 0 30px white inset !important;
}

/* Preserve text color for your specific input */
#custom_rewrite_input:-webkit-autofill {
  -webkit-text-fill-color: #000 !important;
}

/* ------------------------------ latest gen btn styling -------------------------------- */

/* Disable grammar element interactions when not in correction tab */
.grammar-interactions-disabled .grammar-correction-added,
.grammar-interactions-disabled .grammar-correction-removed,
.grammar-interactions-disabled .grammar-correction-punctuation,
.grammar-interactions-disabled mark.word-highlight {
  cursor: default !important;
  pointer-events: none !important;
}

.correction-sidebar.collapsed ~ .text-area-container #inputText .grammar-correction-added,
.correction-sidebar.collapsed ~ .text-area-container #inputText .grammar-correction-removed,
.correction-sidebar.collapsed ~ .text-area-container #inputText .grammar-correction-punctuation {
  cursor: default !important;
  pointer-events: none !important;
}

/* When the sidebar is collapsed, disable pointer cursor and interactions on grammar markers */
body:has(.correction-sidebar.collapsed) #inputText .grammar-correction-added,
body:has(.correction-sidebar.collapsed) #inputText .grammar-correction-removed,
body:has(.correction-sidebar.collapsed) #inputText .grammar-correction-punctuation {
  cursor: default !important;
  pointer-events: none !important;
}

/*------------------------------------- correction content styling --------------------------------- */
.correction-content .hamdan-speech-bubble {
  display: none;
}

.correction-content .hamdan-robot-container {
  display: none;
}

.premium-plus-btn {
  width: 100%;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;

  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
  font-family: inherit;
  position: relative;
  box-shadow:
    inset 0 1px 1px 0 hsla(0, 0%, 100%, 0.9),
    0 2px 6px rgba(0, 0, 0, 0.08),
    0 1px 2px rgba(0, 0, 0, 0.04);
  padding: 20px;
}

.premium-plus-btn .btn-icon {
  width: 62px;
  height: 62px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.premium-plus-btn .btn-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 2px;
  flex: 1;
  min-width: 0;
  text-align: left;
}

.premium-plus-btn svg {
  width: 22px;
  height: 22px;
  color: var(--color-text-secondary, #646e78);
  transition: all 0.15s ease;
}

.grammar-plus-title {
  font-family: 'Nunito Sans', sans-serif;
  margin: 0;
  transition: all 0.15s ease;
  color: #7a8799;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
}

.grammar-plus-desc {
  font-family: 'Nunito Sans', sans-serif;
  font-size: 14px;
  font-weight: 400;
  margin: 0;
  line-height: 1.4;
  text-align: left;
  transition: all 0.15s ease;
  color: var(--color-text-secondary, #646e78);
}

/* Selected state for grammar mode buttons */
.premium-plus-btn.selected {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow:
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.9),
    0 3px 8px rgba(0, 0, 0, 0.1),
    0 1px 3px rgba(0, 0, 0, 0.06);
}

.premium-plus-btn.selected .btn-icon {
  background: #374151;
  border-color: #374151;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.premium-plus-btn.selected svg {
  color: #ffffff;
}

.premium-plus-btn.selected .grammar-plus-title {
  color: var(--color-text-primary, #384551);
  font-weight: 700;
}

.premium-plus-btn.selected .grammar-plus-desc {
  color: var(--color-text-primary, #384551);
}

.premium-plus-btn:hover:not(.selected) {
  background: #f3f4f6;
  border-color: rgba(0, 0, 0, 0.12);
}

/* High specificity selector to override grammar-correction styles */
ham-dan.hamdanActive,
ham-dan.grammar-correction-added.hamdanActive,
ham-dan.grammar-correction-removed.hamdanActive,
ham-dan.grammar-correction-punctuation.hamdanActive,
#inputText ham-dan.hamdanActive,
.ql-editor ham-dan.hamdanActive,
.text-area-container #inputText ham-dan.hamdanActive,
.correction-sidebar ~ .text-area-container #inputText ham-dan.hamdanActive,
body:has(.correction-sidebar) #inputText ham-dan.hamdanActive {
  background-color: #fff1c2 !important;
}
/* ----------------------------- added the reset button in the bedre --------------------------- */
.analysis-reset-button {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow:
    0 1px 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 1px 3px 0 rgba(0, 0, 0, 0.04);
  margin-top: 11px;
}

.analysis-reset-button:hover:not(:disabled) {
  background: #f8f9fa;
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow:
    0 1px 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 2px 4px 0 rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.analysis-reset-button svg {
  width: 18px;
  height: 20px;
  flex-shrink: 0;
  display: block;
}
button.analysis-reset-button svg path,
.analysis-reset-button svg path {
  stroke: #717981 !important;
  fill: none !important;
}


#formatItalic{
  margin-top: 2px !important;
}


.explanation-premium-plus-btn svg{
  display: none !important;
}

.char-limit-warning-red.char-limit-warning-nudge {
   display: inline-block;
  animation: charLimitNudge 420ms ease;
}

@keyframes charLimitNudge {
  0% { transform: translateY(0); }
  45% { transform: translateY(-4px); }
  100% { transform: translateY(0); }
}

#readBtn .loader{
  margin-right: 0px !important;
}


/* hamdanHeader.css */
/* Header */
.hamdan-header {
  background: linear-gradient(278deg, #f8f9fa 37.2%, #fff 62.8%);
  padding: 32px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid rgba(222, 226, 230, 0.006);
  box-shadow:
    0px 1px 1px 0px rgba(255, 255, 255, 0.9) inset,
    0px 1px 3px 0px rgba(0, 0, 0, 0.04),
    0px 2px 8px 0px rgba(0, 0, 0, 0.06);
  border-radius: 16px;
}

.hamdan-header-left .hamdan-header-title {
  background: linear-gradient(90deg, #6c757d 0%, var(--color-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
  font-family: Poppins;
  font-weight: 700;
  font-style: Bold;
  font-size: 28px;

  line-height: 32px;
  letter-spacing: 0%;
}

.hamdan-header-subtitle {
  font-family: Poppins;
  font-weight: 400;
  font-style: Regular;
  font-size: 14px;
  leading-trim: NONE;
  line-height: 18px;
  letter-spacing: 0%;
  color: rgba(108, 117, 125, 1);
  margin-bottom: 12px !important;
}

#show-sidebar-tutorial-btn,
#show-tutorial-btn {
  font-family: Poppins;
  font-weight: 400;
  font-style: normal;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0%;
  background: rgba(173, 181, 189, 1);
  background-color: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  color: #808080;
}

#show-sidebar-tutorial-btn {
  align-items: center;
  justify-content: center;
  align-self: center;
  color: #cfd3d5;
}

#show-sidebar-tutorial-btn:hover,
#show-tutorial-btn:hover {
  color: rgba(226, 70, 104, 1);
}

#show-sidebar-tutorial-btn:hover .sidebar-tutorial-icon path,
#show-tutorial-btn:hover .tutorial-icon path {
  fill: rgba(226, 70, 104, 1);
}

.hamdan-header-right {
  display: flex;
  gap: 10px;
}

.hamdan-header-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: Poppins;
  font-weight: 400;
  font-style: Regular;
  font-size: 16px;
  line-height: 19px;
  letter-spacing: 0%;
  opacity: 1;
  border-radius: 10px;
  border: 1px solid rgba(228, 228, 228, 1);
  padding: 12px;
  color: #495057;
  background: linear-gradient(138.61deg, #ffffff 12.36%, #f1f3f4 94.3%);
  box-shadow:
    0px 1px 1px 0px rgba(255, 255, 255, 0.9) inset,
    0px 2px 8px 0px rgba(0, 0, 0, 0.06),
    0px 1px 3px 0px rgba(0, 0, 0, 0.04);
}

.hamdan-header-btn:hover {
  background: linear-gradient(138.61deg, #ffffff 12.36%, #f1f3f4 94.3%);
  border: 1px solid rgba(228, 228, 228, 1);
  box-shadow:
    0px 1px 1px 0px rgba(255, 255, 255, 0.9) inset,
    0px 2px 8px 0px rgba(0, 0, 0, 0.06),
    0px 1px 3px 0px rgba(0, 0, 0, 0.04);
  gap: 5px;
  opacity: 1;
  border-radius: 10px;
  border-width: 1px;
  padding: 12px;
}

/* Modal Styles */

.modal {
  display: none;
  /* Hidden by default */
  position: fixed;
  z-index: 1000;
  /* Ensures it is on top of other content */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  /* Black overlay with some transparency */
  overflow: auto;
  /* Enable scroll if needed */
}

/* Modal content/video container */
.modal-content {
  background-color: #000000;
  margin: 10% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 60%;
  max-width: 800px;
  height: 60vh;
  position: relative;
  border-radius: 40px;
}

/* iframe for the video */
#tutorial-video {
  width: 100%;
  height: 100%;
}

.tutorial-close-btn {
  display: none;
}

#tutorial-popup {
  display: none;
  /* Hide the popup by default */
  /* Add other styles for the popup here */
}

/* iframe for sidebar */
#sidebar-tutorial-video {
  width: 100%;
  height: 100%;
}

.sidebar-tutorial-close-btn {
  display: none;
}

#sidebar-tutorial-popup {
  display: none;
  /* Hide the popup by default */
  /* Add other styles for the popup here */
  z-index: 10002;
}

.sidebar-tutorial-modal {
  display: none;
  /* Hidden by default */
  position: fixed;
  z-index: 1000;
  /* Ensures it is on top of other content */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  /* Black overlay with some transparency */
  overflow: auto;
  /* Enable scroll if needed */
}

/* Modal content/video container */
.sidebar-modal-content {
  background-color: #000000;
  margin: 10% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 60%;
  max-width: 800px;
  height: 60vh;
  position: relative;
  border-radius: 40px;
}


/* History.css */
.saved-response {
  background: #f8f9fa;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 16px;
  transition: all 0.15s ease;
}

.saved-response:hover {
  background: #f5f6f7;
  box-shadow:
    0 1px 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 2px 4px 0 rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.saved-response:first-child {
  margin-top: 20px;
}

#savedResponsesList {
  flex: 1;
  overflow-y: auto;
  padding: 0 24px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.button-container {
  display: flex;
  justify-content: end;
  align-items: center;
  gap: 1px;
  margin-right: -4px;
  gap: 4px;
}

.button-container.loading::after {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #ccc;
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 8px;
}

.left-history-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

#popup-heading {
  font-family: 'Poppins', sans-serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  color: #495057;
  margin: 0;
}

.saved-response textarea {
  width: 100%;
  overflow: hidden;
  resize: none;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  padding: 0;
  margin: 0;
}

textarea.no-min-height {
  min-height: 0;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.del-history-text {
  color: var(--color-primary) !important;
  font-size: 14px !important;
  cursor: pointer !important;
  font-weight: 400 !important;
}

.del-history-text:hover {
  color: rgba(213, 37, 75, 1);
}

.delete-all-history {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  color: var(--color-primary);
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 18px;
  cursor: pointer;
  padding: 8px 12px;
  box-shadow:
    0 1px 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 1px 2px 0 rgba(0, 0, 0, 0.04);
  transition: all 0.15s ease;
}

.delete-all-history:hover {
  background: #f8f9fa;
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow:
    0 1px 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 2px 4px 0 rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.grammar-history-close {
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  transition: all 0.15s ease;
}

.grammar-history-close svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
}

.grammar-history-close:hover {
  background: #f8f9fa;
  transform: translateY(-1px);
}

.popup-content {
  height: 80%;
  background: #ffffff;
  border-radius: 12px;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.12),
    0 1px 3px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Poppins', sans-serif;
  position: relative;
  width: 60%;
}

/*----------------------Mark Down------------------------*/

.markdown-body {
  font-family: 'Poppins';
  background-color: rgba(248, 249, 250, 1) !important;
  background: rgba(248, 249, 250, 1);
  color: #6c757d;
  font-size: 16px !important;
}

/* Force empty elements to minimum height */
#inputText.is-empty {
  height: auto !important;
}

.markdown-body table {
  width: 100% !important;
}

#inputText .markdown-body table tr {
  background-color: white !important;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  border-bottom: none !important;
  color: #6c757d;
}

.history-action-btn {
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  transition: all 0.15s ease;
  margin: 0;
}

.history-action-btn:hover {
  background: #ffffff;
  transform: translateY(-1px);
}

.history-action-btn svg {
  width: 18px;
  height: 18px;
}

.saved-response .markdown-body {
  background: transparent !important;
}

/* ================ Auto Save History CSS ==================== */

.history-bottom-controls {
  background: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.auto-save-history {
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateX(-8px);
}

.auto-save-switch {
  position: relative;
  width: 30px;
  height: 24px;
  align-self: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auto-save-switch-input {
  /* opacity: 0;
  width: 0;
  height: 0; */
  display: none !important;
}

.auto-save-switch-label {
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  line-height: 18px;
  color: #495057;
  cursor: pointer;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

.auto-save-icon {
  cursor: pointer;
  transition: opacity 0.3s ease;
  position: absolute;
  top: 0;
  left: 0;
}


/* historyLoader.css */
/* ===================================== History Loaders ================================ */

/* Base loader backdrops for history */
.loader1 {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  border-radius: 10px;
}

.loader2 {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  border-radius: 10px;
}

/* Dotted circular loader for history operations */
.dotted-loader {
  position: relative;
  width: 16px;
  height: 20px;
}

.dotted-loader .dot {
  position: absolute;
  width: 3px;
  height: 3px;
  background-color: #888;
  border-radius: 50%;
  animation: fade 1s linear infinite;
  transform-origin: 10px 10px;
}

/* Create 8 dots positioned in a circle */
.dotted-loader .dot:nth-child(1) {
  transform: rotate(0deg) translateX(8px);
  animation-delay: 0s;
}

.dotted-loader .dot:nth-child(2) {
  transform: rotate(45deg) translateX(8px);
  animation-delay: 0.125s;
}

.dotted-loader .dot:nth-child(3) {
  transform: rotate(90deg) translateX(8px);
  animation-delay: 0.25s;
}

.dotted-loader .dot:nth-child(4) {
  transform: rotate(135deg) translateX(8px);
  animation-delay: 0.375s;
}

.dotted-loader .dot:nth-child(5) {
  transform: rotate(180deg) translateX(8px);
  animation-delay: 0.5s;
}

.dotted-loader .dot:nth-child(6) {
  transform: rotate(225deg) translateX(8px);
  animation-delay: 0.625s;
}

.dotted-loader .dot:nth-child(7) {
  transform: rotate(270deg) translateX(8px);
  animation-delay: 0.75s;
}

.dotted-loader .dot:nth-child(8) {
  transform: rotate(315deg) translateX(8px);
  animation-delay: 0.875s;
}

/* Dot fade animation */
@keyframes fade {
  0%,
  100% {
    opacity: 0.3;
  }

  50% {
    opacity: 1;
  }
}

/* Loading state for button containers in history */
.button-container.loading::after {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #ccc;
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 8px;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}


/* languageDropdown.css */
/* -------------------------------- language dropdown ---------------------------- */
.dk-translation-box {
  display: flex;
  align-items: center;
  position: relative;
  border-radius: 8px;
  width: fit-content;
}

.dk-language-select {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  font-size: 13px;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dk-language-select:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #374151;
}

.dk-language-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.dk-language-dropdown-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dk-language-dropdown-icon svg {
  width: 20px;
  height: 20px;
}

/* Search-only languages: shown only when user searches; use globe icon */
.dk-dropdown-item.dk-search-only .dk-language-dropdown-icon.dk-globe-icon svg {
  width: 20px;
  height: 20px;
}

.dk-language-icon svg {
  width: 13px;
  height: 13px;
}

.dk-language-text {
  font-size: 13px;
  color: rgba(73, 80, 87, 1);
  font-family: Poppins;
  font-weight: 400;
  line-height: 18px;
}

.dk-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  color: #999;
  width: 8px;
  height: 8px;
  font-size: 12px;
}

.dk-arrow svg {
  display: block;
  margin: 0;
  vertical-align: middle;
}

.dk-language-select.dk-active .dk-arrow {
  transform: rotate(180deg);
}

.dk-dropdown {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 12px;
  bottom: calc(100% + 8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .12), 0 2px 4px rgba(0, 0, 0, .06);
  display: none;
  left: 50%;
  min-width: 180px;
  padding: 8px;
  position: absolute;
  transform: translateX(-50%);
  z-index: 100;
}

.dk-dropdown-list {
  max-height: 264px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

.dk-dropdown-list::-webkit-scrollbar {
  width: 4px;
}

.dk-dropdown-list::-webkit-scrollbar-track {
  background: transparent;
}

.dk-dropdown-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}

.dk-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #fff transparent transparent transparent;
}

.dk-dropdown.dk-show {
  display: block;
}

.dk-dropdown-item {
  align-items: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #374151;
  cursor: pointer;
  display: flex;
  font-family: Poppins, sans-serif;
  font-size: 14px;
  gap: 10px;
  margin: 8px 0 2px;
  padding: 5px 12px;
  text-align: left;
  transition: all .15s ease;
  width: 100%;
}

.dk-dropdown-item:hover {
  background: #f3f4f6;
}

/* Selected state */
.dk-dropdown-item.dk-selected {
  background: #f3f4f6;
  font-weight: 500;
}

/* Keyboard focus (arrow key navigation) */
.dk-dropdown-item.dk-keyboard-focus {
  background: #f3f4f6;
  font-weight: 500;
}


@keyframes dkFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dk-dropdown-item.dk-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: #f0f0f0;
}

/* Custom language input styling */
.dk-custom-language {
  align-items: center;
  background: #f3f4f6;
  border-radius: 8px;
  color: var(--color-primary);
  display: flex;
  font-family: Poppins;
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  gap: 8px;
  line-height: normal;
  margin-bottom: 8px;
  padding: 6px 12px;
  position: relative;
  width: 100%;
}

.dk-custom-language:hover {
  box-shadow: 0 1px 3px rgba(217, 115, 152, 0.2);
  /* Removed margin-bottom change to prevent layout shift */
}

.dk-custom-language:focus-within {
  background: #e5e7eb;
}

.dk-custom-input {
  width: 100%;
  border: none;
  background: transparent;
  color: #495057;
  font-size: 14px;
  padding: 0px;
  padding-right: 35px !important;
}

.dk-custom-input:focus {
  outline: none;
  border: none;
}

.dk-custom-input:focus-visible {
  outline: none;
  border: none;
}

/* Add button for custom language input */
.dk-custom-language::after {
  content: '+';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #d97398;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  font-size: 16px;
  font-weight: bold;
}

.dk-custom-language:hover::after,
.dk-custom-input:focus~ ::after {
  opacity: 1;
}

.dk-custom-language::after:hover {
  background-color: rgba(217, 115, 152, 0.1);
  color: #c86587;
}

/* Text styling */
.dk-dropdown-text {
  color: #495057;
  font-family: Poppins;
  font-size: 14px;
  font-weight: 400;
  line-height: 18px;
}

/* Real button styled like the old ::after */
.dk-add-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #d97398;
  padding: 4px;
  border-radius: 4px;
  font-size: 16px;
  font-weight: bold;
  opacity: 0;
}

.dk-custom-language:hover .dk-add-btn,
.dk-custom-language:focus-within .dk-add-btn {
  opacity: 1;
}

/* .dk-add-btn:hover {
  background-color: rgba(217, 115, 152, 0.1);
  color: #c86587;
} */

.dk-custom-language {
  position: relative;
  /* so the absolute button is anchored here */
}

.dk-add-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-weight: bold;
  opacity: 0;
  z-index: 1;
  /* ensure it's above the input */
}

.dk-custom-language:hover .dk-add-btn,
.dk-custom-language:focus-within .dk-add-btn {
  opacity: 1;
}

.dk-dropdown-divider {
  height: 1px;
  width: 80%;
  background: rgba(0, 0, 0, 0.05);
  margin: auto;
}


/* mediaQueries.css */
@media (max-width: 1200px) {
  .sidebar-dropdown-items .hk-dropdown-option span {
    display: none;
  }
  .sidebar-dropdown-items .hk-dropdown-option {
    padding: 10px 12px;
    gap: 0;
  }
  .sidebar-dropdown-items {
    gap: 6px;
  }
}

@media screen and (min-width: 769px) and (max-width: 1440px) {
  .hamdan-speech-bubble {
    width: 80%;
  }
}

@media screen and (min-width: 1441px) {
  .hamdan-speech-bubble {
    width: 50%;
  }

  .improvement-section {
    width: 100%;
  }

  .improvement-items {
    gap: 31px;
  }

  
}

/* Large Desktop (1200px and above) */
@media screen and (min-width: 1200px) {
}


@media screen and (max-width: 1122px) {
  .voice-slider-labels {
    display: none;
  }
}

@media screen and (max-width: 1024px) {
  .hk-dropdown-container {
    width: 90%;
    max-width: 90%;
  }

  .improvement-text {
    font-size: 11px !important;
  }

  .improvement-items {
    gap: 7px;
  }

  .improvement-icon svg {
    width: 15px;
    height: 15px;
  }

  .improvement-icon,
  .improvement-icon-3 {
    padding: 6px;
  }
}

/* Tablet Landscape (768px to 991px) */
@media screen and (max-width: 991px) {
  .improvement-text {
    font-size: 11px !important;
  }

  .improvement-items {
    gap: 10px;
  }

  .improvement-icon svg {
    width: 15px;
    height: 15px;
  }

  .improvement-icon,
  .improvement-icon-3 {
    padding: 6px;
  }

  .divider {
    display: none;
  }

  .voice-slider-labels {
    display: none;
  }

  .hk-dropdown-container {
    width: 90%;
    max-width: 90%;
  }
}

@media screen and (max-width: 860px) {
  .sidebar-toggle-btn {
    display: none;
  }

  .hamdan-speech-bubble {
    width: 170px;
  }
}

/* Tablet Portrait (576px to 767px) */
@media screen and (max-width: 767px) {
  .hamdan-speech-bubble {
    width: 80%;
  }

  .improvement-section {
    width: 50%;
  }

  .sidebar-toggle-btn {
    display: none;
  }

  /* Adjust spacing for read button icons */
  .lucide-volume-2,
  .lucide-pause {
    width: 18px;
    height: 16px;
  }
}

/* Mobile (575px and below) */
@media screen and (max-width: 575px) {
  /* Ensure mobile uses dynamic viewport height */
  html,
  body {
    height: var(--app-height, 100vh);
  }
  
  .text-area-container {
    height: var(--app-height, 100vh);
  }
    .dk-dropdown{
    right: 43%;
    left: 0;
    min-width: 180px;
    padding: 8px;
    position: absolute;
    transform: translateX(0);
  }
  .dk-dropdown:after{
    left: 20% !important; 
  }
  .toast-notification{
    display: none !important;
  }
}

/* Small Mobile (360px and below) */
@media screen and (max-width: 360px) {
  /* Ensure small mobile uses dynamic viewport height */
  html,
  body {
    height: var(--app-height, 100vh);
  }
  
  .text-area-container {
    height: var(--app-height, 100vh);
  }
}

/* Ensure proper button behavior when keyboard is visible */
@media screen and (max-height: 500px) {
}

/* High DPI Screens */
@media screen and (min-resolution: 192dpi) {
}

@media screen and (max-width: 767px) {
  /* Explicit order for each button */

  /* Remove the divider */
  .divider {
    display: none;
  }
}

/* Touch optimization */
@media (hover: none) and (pointer: coarse) {
}

@media screen and (max-width: 399px) {
}

@media screen and (max-width: 767px) {
}

@media screen and (max-width: 767px) {
  body {
    padding-bottom: 0;
  }

  .counter-nav-div {
    flex-direction: column-reverse;
    gap: 10px;
    margin-top: 0;
  }
}

/* ============================ media queries =============================== */

/* Tablet Landscape (768px to 991px) */
@media screen and (max-width: 991px) {
  .lang-legend-div {
    justify-content: flex-start;
    align-items: flex-start;
  }

  .toolbar-container {
    max-width: 100%;
  }

  .language-controls {
    justify-content: flex-start;
    width: 100%;
  }

  .legend-section {
    flex-wrap: wrap;
  }
}

/* Tablet Portrait (576px to 767px) */
@media screen and (max-width: 767px) {
  #vertical-line {
    display: none;
  }

  #German,
  #French {
    display: none;
  }

  .other-lang-input {
    display: none;
  }

  #legend-section {
    display: none !important;
  }

  .main-textarea-section {
    flex-basis: 100% !important;
  }

  /* Help tooltip adjustments for tablet */
  .level-help-tooltip {
    width: 240px;
    right: 0;
    font-size: 12px;
  }
}

/* Mobile (575px and below) */
@media screen and (max-width: 767px) {
  .toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    width: 100%;
  }

  .legend-section {
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
  }

  .legend-item {
    justify-content: flex-start;
  }

  .language-controls {
    gap: 0.5rem;
    justify-content: center;
  }

  .other-lang-input {
    width: 100%;
    margin: 0.5rem 0;
  }

  .language-controls {
    flex-direction: row;
    align-items: stretch;
    width: 100%;
  }

  .language-btn {
    width: 100%;
    text-align: center;
    padding: 10px;
  }

  .toggle-section {
    width: 100%;
    justify-content: center;
  }

  .legend-item {
    width: 100%;
    justify-content: center;
  }

  .other-lang-input {
    padding: 10px;
    text-align: center;
  }

  .toolbar {
    padding: 12px;
  }

  .popup-content {
    background-color: #f9f9f9;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    height: 80%;
    max-height: 1000px;
    overflow: scroll;
    position: relative;
    border-radius: 10px;
  }
}

/* Small Mobile (360px and below) */
@media screen and (max-width: 360px) {
  .lang-legend-div {
    gap: 0.75rem;
  }

  .language-btn {
    font-size: 14px;
    padding: 8px;
  }

  .legend-text {
    font-size: 12px;
  }

  .switch-label {
    font-size: 12px;
  }

  .popup-content {
    background-color: #f9f9f9;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    height: 80%;
    max-height: 1000px;
    overflow: scroll;
    position: relative;
    border-radius: 10px;
  }

  /* Help tooltip adjustments for small mobile */
  .level-help-tooltip {
    width: 200px;
    font-size: 11px;
    padding: 10px 12px;
  }

  .level-help-btn {
    width: 18px;
    height: 18px;
  }

  .level-help-btn svg {
    width: 12px;
    height: 12px;
  }
}

@media screen and (max-width: 450px) {
  .toolbar-container {
    display: none;
  }

  .top-headings-div {
    margin-bottom: 24px;
  }

  .lang-legend-div * {
    color: #606060 !important;
  }

  .word-counter-div {
    display: flex;
    flex-direction: column-reverse !important;
    flex-wrap: wrap;
  }
}

/* Handle height adjustments for better touch targets on mobile */
@media (hover: none) and (pointer: coarse) {
  .language-btn,
  .other-lang-input {
    min-height: 44px;
  }

  .legend-item,
  .toggle-section {
    padding: 8px 0;
  }
}

/* Ensure proper spacing when keyboard is visible on mobile */
@media screen and (max-height: 500px) {
  .lang-legend-div {
    gap: 0.5rem;
  }

  .toolbar {
    padding: 6px;
  }
}


/* responsive.css */
/* ================================= TABLET RESPONSIVE (440px - 850px) ================================= */

@media (min-width: 768px) and (max-width: 1100px) {

  /* Header adjustments for tablet */
  .hamdan-header {
    padding: 24px 20px;
    margin-bottom: 20px;
    flex-direction: column;
    gap: 16px;
    border-radius: 14px;
    text-align: center;
  }

  .hamdan-header-left {
    order: 1;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hamdan-header-right {
    order: 2;
    flex-direction: row;
    gap: 12px;
    width: 100%;
    justify-content: center;
  }

  .hamdan-header-btn {
    font-size: 14px;
    padding: 10px 16px;
    gap: 6px;
    border-radius: 9px;
    flex: 1;
    max-width: 200px;
    justify-content: center;
    text-align: center;
  }

  .text-area-container {
    min-height: 400px;
    gap: 16px;
  }

  .inner-textarea-bottom {
    flex-basis: 54% !important;

    border-radius: 8px;
  }

  /* Top controls */
  .top-controls {
    padding: 6px 10px;
    border-radius: 25px;
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Textarea adjustments */
  .textarea-wrapper {
    min-height: 180px;
  }

  .correction-sidebar {
    min-width: 200px;
  }

  #inputText {
    min-height: 180px;
    font-size: 15px;
    padding: 16px;
  }

  .dk-language-select {
    padding: 12px 14px;
    font-size: 13px;
  }

  /* Generate button */
  .write-applicationDiv {
    padding: 10px 20px;
    flex: 0;
    border-radius: 8px;
    font-size: 15px;
    width: 100%;
  }



  .header-section {
    padding: 16px;
    flex-direction: row;
  }

  .hk-dropdown-button {
    padding: 10px 12px;
    font-size: 13px;
  }

  .correction-content {
    min-height: 150px;
    padding: 8px 12px;
  }

  /* Modal adjustments */
  .modal-content {
    width: 85%;
    margin: 5% auto;
    padding: 16px;
    /* Use CSS custom property for dynamic height on mobile */
    height: calc(var(--app-height, 100vh) * 0.7);
    border-radius: 20px;
  }

  .popup-content {
    width: 85%;
    height: 85%;
    padding: 20px;
    margin: 5% auto;
    border-radius: 10px;
  }

  #popup-heading {
    font-size: 22px;
    line-height: 26px;
  }

  /* Counter and navigation */
  .counter-nav-div {
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
    align-items: center;
  }

  .word-counter-div {
    order: 1;
    text-align: center;
  }

  .response-navigation {
    order: 2;
    justify-content: center;
  }

  /* Voice section */
  .voice-section {
    padding: 12px;
  }

  .voice-card {
    padding: 16px;
    margin-bottom: 12px;
  }

  .dk-hamdan-input-container {
    max-width: 100%;
    padding: 0;
  }

  .dk-hamdan-custom-input {
    font-size: 13px;
    padding: 10px 12px;
  }
  .ql-editor {
    padding: 20px 0 !important;
  }

  /* Title input: don't truncate */
  .top-controls {
    flex-wrap: nowrap;
  }

  .top-controls .title-input-container,
  .top-controls input[type="text"] {
    flex: 1;
    min-width: 120px;
  }

  /* Right panel: narrower on tablet */
  .correction-sidebar {
    min-width: 240px;
    max-width: 300px;
  }
}

@media (max-width: 767px) {
  .ql-editor {
    padding: 20px 0 !important;
  }
}

/* ================================= MOBILE RESPONSIVE (300px - 440px) ================================= */

@media (max-width: 767px) {
  .ql-editor {
    padding: 20px 0 !important;
  }

  .main-textarea-section {
    padding-left: 9px !important;
    padding-right: 9px !important;
  }

  /* Header mobile layout */
  .hamdan-header {
    padding: 16px 12px;
    margin-bottom: 16px;
    flex-direction: column;
    gap: 12px;
    border-radius: 12px;
  }

  .hamdan-header-left {
    order: 1;
    width: 100%;
    text-align: center;
  }

  #show-tutorial-btn {
    font-size: 10px;
    line-height: 14px;
    gap: 4px;
    justify-content: center;
    margin: 0 auto;
  }

  .hamdan-header-right {
    order: 2;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .hamdan-header-btn {
    font-size: 13px;
    padding: 10px 12px;
    gap: 4px;
    border-radius: 8px;
    width: 100%;
    justify-content: center;
    text-align: center;
    min-height: 35px;
  }

  .text-area-container {
    flex-direction: column;
    min-height: 350px;
    /* Use CSS custom property for dynamic height on mobile */
    max-height: calc(var(--app-height, 100vh) - 60px); /* Account for WordPress bottom bar (~60px) */
    gap: 12px;
    box-sizing: border-box;
    overflow: auto;
    display: flex;
  }

  .sidebar-wrapper {
  border-left: 1px solid #e5e7eb;
    display: none;
  }

  .inner-textarea-bottom {
    flex: 0 0 auto; /* Don't grow, maintain natural height */
    margin-bottom: 0;
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
    /* Use CSS custom property for dynamic height on mobile */
    height: calc(var(--app-height, 100vh) - 56px);
  }

  .main-textarea-section {
    flex: 1 1 auto; /* Grow to fill available space, but can shrink */
    min-height: 0; /* Allow shrinking below min-content */
    overflow-y: auto; /* Allow scrolling within text area */
    display: flex;
    flex-direction: column;
  }
  

  .top-controls {
    padding: 8px;
    border-radius: 20px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
  }

  /* Hide undo/redo from group-1, keep B/I/Liste */
  .format-toolbar .group-1 #revertBack,
  .format-toolbar .group-1 #redoBtn,
  /* Hide all action buttons (read aloud, copy, download, compare) */
  .format-toolbar .group-2,
  .format-toolbar .format-divider {
    display: none !important;
  }

  .ql-editor.ql-blank::before {
    left: 11px;
  }

  /* Textarea mobile */
  .textarea-wrapper {
    min-height: 150px;
  }

  #inputText {
    min-height: 150px;
    font-size: 14px;
    padding: 12px;
    line-height: 22px;
  }

  /* Language dropdown mobile */
  .dk-translation-box {
    width: 100%;
    margin-bottom: 12px;
  }

  .dk-language-select {
    padding: 12px;
    font-size: 12px;
    border-radius: 8px;
  }

  .dk-language-text {
    font-size: 12px;
  }

  .dk-dropdown {
    padding: 8px;
  }

  .dk-dropdown-item {
    padding: 10px 8px;
    font-size: 12px;
  }

  /* Generate button mobile */
  .write-applicationDiv {
    padding: 10px 12px !important;
    border-radius: 8px;
    font-size: 14px;
    width: 100%;
    gap: 8px;
    flex: 0 !important;
  }

  /* Mobile controls container */
  .mobile-controls-container {
    display: none;
    flex-direction: column;
    padding: 0px 9px 12px 9px;
    margin-bottom: 0;
  }

  .mobile-controls-container.mobile-active {
    display: flex;
  }

  /* Language and robot row wrapper - side by side */
  .mobile-controls-container .mobile-lang-robot-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: 100%;
    order: 1;
  }

  .mobile-controls-container .dk-translation-box {
    flex: 1;
    margin-bottom: 0;
    min-width: 0; /* Allow flex item to shrink below content size */
  }

  .mobile-controls-container .sidebar-robot-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-bottom: 0;
    width: fit-content;
  }

  .mobile-controls-container .sidebar-robot-gif {
    width: 70px;
    height: 70px;
  }

  /* Generate button on mobile - below language/robot */
  .mobile-controls-container #genBtn {
    order: 2;
    width: 100%;
    margin-top: 15px;
  }

  /* Hide sidebar controls on mobile */
  .sidebar-controls {
    display: none !important;
  }

  .options-row {
    flex-wrap: wrap;
  }

  /* Sidebar mobile - hidden or collapsed */
  .correction-sidebar {
    display: none !important;
  }

  /* Modal mobile */
  .modal-content {
    width: 90%;
    margin: 5% auto;
    padding: 12px;
    /* Use CSS custom property for dynamic height on mobile */
    height: calc(var(--app-height, 100vh) * 0.6);
    border-radius: 16px;
  }

  .popup-content {
    width: 95%;
    height: 60%;
    padding: 16px;
    margin: 5% auto;
    border-radius: 8px;
    background: white;
  }

  #popup-heading {
    font-size: 18px;
    line-height: 22px;
    text-align: center;
  }

  .saved-response {
    padding: 10px;
    margin-bottom: 8px;
    margin-right: 5px;
    border-radius: 4px;
    font-size: 13px;
  }

  #savedResponsesList {
    padding: 0px 12px 12px 8px;
    margin: 0 -8px;
  }

  /* Counter and navigation mobile */
  .counter-nav-div {
    flex-direction: column-reverse;
    gap: 0px;
    align-items: center;
    margin-bottom: 0 !important;
  }

  .word-counter-div {
    order: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .word-count {
    font-size: 12px;
  }

  #char-limit-warning {
    font-size: 12px;
    text-align: center;
    margin-bottom: 4px;
  }

  .response-navigation {
    order: 2;
    justify-content: center;
    display: none;
    /* Usually hidden on mobile */
  }

  /* Voice section mobile */
  .voice-section {
    padding: 8px;
  }

  .voice-card {
    padding: 12px;
    margin-bottom: 10px;
  }

  .voice-card-title {
    font-size: 14px;
  }

  .voice-card-subtitle {
    font-size: 12px;
  }

  .voice-slider-labels {
    font-size: 11px;
    gap: 8px;
  }

  .voice-change-btn {
    padding: 10px 14px;
    font-size: 13px;
  }

  .dk-hamdan-input-container {
    max-width: 100%;
    padding: 0;
    margin-top: 8px;
  }

  .dk-hamdan-custom-input {
    font-size: 12px;
    padding: 8px 10px;
  }

  /* Style options mobile */
  .style-option {
    padding: 8px 10px;
    gap: 8px;
  }

  .style-icon {
    padding: 6px;
    margin-right: 8px;
  }

  .style-title {
    font-size: 12px;
  }

  /* Language dropdown improvements */
  .dk-dropdown-content {
    max-height: 200px;
    overflow-y: auto;
  }

  .dk-custom-language {
    padding: 6px 8px;
    font-size: 12px;
  }

  .dk-custom-input {
    font-size: 12px;
    padding: 4px 6px;
  }

  /* History and modal improvements */
  .history-bottom-controls {
    padding: 12px 0px;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .hClose {
    padding: 10px 10px 0px 3px;
  }

  .delete-all-history {
    font-size: 11px;
    padding: 6px 10px;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
  }

  .delete-all-history svg {
    width: 14px;
    height: 14px;
  }

  .del-history-text {
    font-size: 11px !important;
    white-space: nowrap;
  }

  .auto-save-history {
    transform: none;
    gap: 6px;
    flex-shrink: 1;
    min-width: 0;
  }

  .auto-save-switch-label {
    font-size: 11px;
    white-space: nowrap;
  }

  .copy-btn1,
  .delete-btns {
    padding: 6px !important;
    min-width: 32px;
    min-height: 32px;
  }

  /* Markdown content mobile */
  .markdown-body {
    font-size: 13px !important;
  }

  /* Grammar highlighting mobile */
  .grammar-correction-added,
  .grammar-correction-removed,
  .grammar-correction-punctuation {
    border-bottom-width: 1px;
  }
}

/* ================================= EXTRA SMALL MOBILE (300px - 360px) ================================= */

@media (max-width: 360px) {
  .hamdan-header {
    padding: 12px 8px;
    gap: 10px;
  }

  .hamdan-header-btn {
    font-size: 12px;
    padding: 8px 10px;
  }

  #inputText {
    font-size: 13px;
    padding: 10px;
  }

  .write-applicationDiv {
    padding: 12px 14px;
    font-size: 13px;
  }

  .dk-language-select {
    padding: 10px;
    font-size: 11px;
  }
}

/* ================================= LANDSCAPE ORIENTATION ================================= */
/* 
@media (max-height: 500px) and (orientation: landscape) {


  .text-area-container {
    min-height: 250px;
  }

  .textarea-wrapper {
    min-height: 120px;
  }

  #inputText {
    min-height: 120px;
  }

  .modal-content {
    height: 80vh;
    margin: 2% auto;
  }

  .popup-content {
    height: 90vh;
    margin: 2% auto;
  }

  .correction-sidebar {
    min-height: 250px;
  }
} */

/* ================================= SPECIFIC MOBILE FIXES ================================= */

/* Prevent zoom on input focus */
@media (max-width: 860px) {

  input[type='text'],
  textarea,
  select {
    font-size: 16px !important;
  }

  .dk-custom-input,
  .dk-hamdan-custom-input {
    font-size: 16px !important;
  }
}


/* ── SkrivSikkert Mobile: bottom nav (60px) ── */
@media (max-width: 767px) {
  .robot-container,
  #grammar-bot-container,
  .new-korrektur,
  .text-area-container,
  .inner-textarea-bottom {
    height: calc(100vh - 60px) !important;
    height: calc(100dvh - 60px) !important;
  }

  /* Correction sidebar hidden on mobile */
  .correction-sidebar {
    display: none !important;
  }

  /* Title input: full width */
  .title-input-container,
  .title-input-container input {
    min-width: 0 !important;
    width: 100% !important;
  }

  /* Format toolbar: touch targets */
  .format-toolbar button {
    min-width: 36px;
    min-height: 36px;
  }

  /* Toolbar: hide undo/redo, hide download + compare */
  .format-group.group-1 #revertBack,
  .format-group.group-1 #redoBtn { display: none !important; }
  .format-group.group-2 #downloadBtn,
  .format-group.group-2 #mainSwitcher,
  .format-group.group-2 .format-separator,
  .format-group.group-2 #genderSelector { display: none !important; }
  .format-divider { display: none !important; }
  .format-toolbar { gap: 4px !important; padding: 4px 8px !important; }
}

/* ── SkrivSikkert Tablet ── */
@media (min-width: 768px) and (max-width: 1100px) {
  .correction-sidebar {
    min-width: 280px !important;
    max-width: none !important;
  }
}


/* selectionToolbar.css */
/* Selection Toolbar CSS - Matches the design image */

/* Main toolbar container */
#selection-toolbar {
  position: absolute;
  display: none;
  z-index: 19999;
  background: rgba(173, 181, 189, 0.3);
  align-items: center;
  min-height: 47px;
  pointer-events: auto;
  top: 0;
  left: 0;
  gap: 4px;
  padding: 6px 8px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.05);
  /* transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease; */
}

/* Audio controls container - groups TTS and speed controls */
.audio-controls-container {
  display: flex;
  align-items: center;
  height: 34px;
}

/* TTS Button */
.tts-button {
  display: flex;
  justify-content: center;
  align-items: center;
  background: transparent;
  cursor: pointer;  
  width: 32px;
  height: 32px;
  border-radius: 8px;
  margin-right: 3px;
  transition: background-color 0.2s ease;
}

.tts-button:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #374151;
}

/* TTS Button when playing - with pause icon */
.tts-button svg {
  transition: all 0.2s ease;
}

.speed-display:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #374151;
}

/* Speed Container - contains both display and panel */
.speed-container {
  position: relative;
  display: flex;
  align-items: center;
  height: 34px;
}

/* Speed Display (collapsed state) */
.speed-display {
  display: flex;
  width: 32px;
  height: 32px;
  justify-content: center;
  align-items: center;
  background: transparent;
  cursor: pointer;
  line-height: 22px;
  padding: 0 8px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #6b7280;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
}

/* Speed Panel (expanded state) */
.speed-panel {
  display: none;
  height: 32px;
  padding: 5px 12px;
  align-items: center;
  min-width: 120px;
}

/* Speed Icons */
.speed-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  opacity: 0.8;
  cursor: pointer;
  padding: 2px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.speed-icon:hover {
  transform: scale(1.02);
  opacity: 1;
}

/* Slider Container */
.slider-container {
  flex: 1;
  display: flex;
  align-items: center;
  margin: 0 6px;
  min-width: 60px;
}

/* Speed Slider */
.speed-slider {
  width: 100%;
  height: 3px;
  background: rgba(173, 181, 189, 1);
  border-radius: 2px;
  outline: none;
  border: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

/* Slider Track */
.speed-slider::-webkit-slider-track {
  height: 3px;
  background: #e4e4e4;
  border-radius: 2px;
}

.speed-slider::-moz-range-track {
  height: 3px;
  background: #e4e4e4;
  border-radius: 2px;
  border: none;
}

/* Slider Thumb */
.speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: rgb(206 206 207);
  border-radius: 50%;
  cursor: pointer;
  border: 1px solid rgba(108, 117, 125, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.speed-slider::-moz-range-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: rgb(206 206 207);
  border-radius: 50%;
  cursor: pointer;
  border: 1px solid rgba(108, 117, 125, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* Copy Button */
.copy-button {
  display: flex;
  width: 32px;
  height: 32px;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
}

.copy-button:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #374151;
}
.copy-button .check-icon{
  display: block;
  color: #10b981;
  animation: checkPop 0.2s ease-out;
}
/* Loading Animation Styles */
/* Loading Animation - Matches JS structure exactly */
.tts-button .loader4 {
}

.tts-button .dotted-loader {
}

.tts-button .dotted-loader .dot {
}

.tts-button .dotted-loader .dot:nth-child(1) {
  animation-delay: -0.32s;
}

.tts-button .dotted-loader .dot:nth-child(2) {
  animation-delay: -0.16s;
}

.tts-button .dotted-loader .dot:nth-child(3) {
  animation-delay: 0s;
}

.tts-button .dotted-loader .dot:nth-child(4) {
  animation-delay: 0.16s;
}

.tts-button .dotted-loader .dot:nth-child(5) {
  animation-delay: 0.32s;
}

.tts-button .dotted-loader .dot:nth-child(6) {
  animation-delay: 0.48s;
}

.tts-button .dotted-loader .dot:nth-child(7) {
  animation-delay: 0.64s;
}

.tts-button .dotted-loader .dot:nth-child(8) {
  animation-delay: 0.8s;
}

@keyframes dotPulse {
  0%,
  80%,
  100% {
    opacity: 0.5;
  }

  40% {
    opacity: 1;
  }
}

.selection-toolbar .toolbar-separator {
    width: 1px;
    height: 20px;
    background: rgba(0, 0, 0, 0.08);
    margin: 0 2px;
}


/* sidebarAudioControls.css */
/* Sidebar Audio Controls */
.sidebar-ask-audio-controls {
  display: flex;
  align-items: center;
  gap: 5px;
  border-radius: 8px;
  background: var(--color-bg, #FAFAF8);
  padding: 4px;
  width: 100%;
}

.sidebar-audio-control-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.2s ease;
}

.sidebar-audio-control-btn:hover {
  opacity: 0.7;
}

.sidebar-audio-control-btn svg {
  width: 16px;
  height: 16px;
  fill: #6c757d;
}

.sidebar-audio-progress-container {
  flex: 1;
  margin: 0 4px;
}

.sidebar-audio-progress-track {
  width: 100%;
  height: 4px;
  background-color: #e9ecef;
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.sidebar-audio-progress-fill {
  height: 100%;
  background: #adb5bd;
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s ease;
}

/* Update bubble layout when audio controls are present */
.bubble-text,
.bubble-main-text {
  margin-bottom: 0;
}

.has-ok-button .sidebar-ask-audio-controls {
  margin-top: 8px;
}

/* Volume Slider Styles */
.sidebar-volume-container {
  position: relative;
  display: flex;
  align-items: center;
}

.sidebar-volume-bar {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  background: transparent;
  border-radius: 8px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 1000;
}

.sidebar-volume-bar.show {
  opacity: 1;
  visibility: visible;
}

.sidebar-volume-track {
  display: flex;
  width: 12px;
  height: 119px;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(199, 137, 156, 0.15);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(2px);
  background-clip: padding-box;
}

/* Fallback when backdrop-filter is not supported */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .sidebar-volume-track {
    background: rgba(199, 137, 156, 0.31);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: none;
  }
}

.sidebar-volume-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #c7899c;
  border-radius: 3px;
  height: 100%;
  transition: height 0.1s ease;
}

.sidebar-volume-handle {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  background: #c7899c;
  border-radius: 50%;
  cursor: grab;
  transition: all 0.1s ease;
  z-index: 1;
}

#sidebar-audio-volume svg path {
  stroke: #6c757d;
}

/* Volume button active state when volume bar is open */
#sidebar-audio-volume.volume-bar-open svg,
#sidebar-audio-volume.volume-bar-open svg path {
  fill: #c7899c;
  stroke: #c7899c;
}


/* sidebarRobot.css */
/* ========================================================== */
/* COMPLETE SIDEBAR ROBOT CSS - ALL ELEMENTS FIXED           */
/* ========================================================== */

/* Core Container */
.sidebar-robot-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 10px;
  width: 100%;
}

.sidebar-robot-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* NEW: Glowing background effect */
.sidebar-robot-glow-bg {
  position: absolute;
  bottom: 34%;
  width: 25%;
  height: 25%;
  background: #11e811;
  border-radius: 50%;
  filter: blur(8px);
}

/* Robot GIF */
.sidebar-robot-gif {
  width: 70px;
  height: 70px;
  cursor: pointer;
  transition: transform 0.2s ease;
  display: block;
}

.sidebar-robot-gif:hover {
  transform: scale(1.05);
}

/* ✅ FIXED: Speech Bubble with right-margin priority positioning */
.sidebar-robot-bubble {
  position: absolute;
  bottom: calc(100%);
  /* ✅ NEW: Start with right-aligned positioning instead of center */
  right: 20px;
  /* Default right margin */
  transform: translateY(10px);
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 6px;
  font-size: 12px;
  box-shadow: 0 2px 6px rgba(75, 70, 92, 0.04);
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;

  /* ✅ FIXED: Responsive width with viewport constraints */
  width: var(--bubble-width, fit-content);
  max-width: min(var(--bubble-max-width, 200px), calc(100vw - 40px));
  box-sizing: border-box;

  justify-content: center;
  align-items: center;
  gap: 12px;
}

.sidebar-robot-bubble.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ✅ FIXED: Arrow positioning for right-aligned bubble */
.sidebar-robot-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  /* ✅ CENTERED: Dynamic arrow position always centered on robot */
  left: var(--arrow-position, 50%);
  /* Default to center, overridden by JS for exact centering */
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #ffffff;
}

#sidebar-robot-bubble-tts::after{
  left: 80%;
}

/* Slight right bias only for the loading bubble */
/* Slight bias only for the loading bubble */
.sidebar-robot-bubble.loading {
  width: 105px !important;
}

.sidebar-robot-bubble.loading::after {
  left: calc(50% + 24px);
}

/* ✅ FIXED: Listening state bubble (same overflow protection) */
.sidebar-robot-bubble.listening {
  /* Inherits all the same positioning rules */
  right: 20px;
  transform: translateY(10px);
}

.sidebar-robot-bubble.listening.show {
  transform: translateY(0);
}

/* Bubble content */
.sidebar-robot-bubble .bubble-text {
  color: #374151;
  text-align: center;
  font-family: Poppins;
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  line-height: 16px;
  background: linear-gradient(90deg, var(--color-primary) 0%, #495057 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  /* NEW: align items vertically */
  width: 100%;
}

.sidebar-robot-bubble .keyboard-icon {
  cursor: pointer;
  opacity: 0.7;
  padding: 2px;
  border-radius: 3px;
  transition: opacity 0.2s ease;
}

.sidebar-robot-bubble .bubble-divider {
  display: flex;
  margin-right: -6px;
}

.sidebar-robot-bubble .sidebar-bubble-loader {
  display: flex;
  /* ✅ Standard flex, not inline-flex */
  align-items: center;
  /* ✅ Centers SVG within loader span */
  align-self: center;
  /* ✅ Centers loader span within bubble */
  border-radius: 3px;
  transition: opacity 0.2s ease;
}

/* =========================== Input bubble Styles====================================== */
/* .sidebar-robot-bubble .keyboard-icon:hover {
  opacity: 1;
  background-color: rgba(0, 0, 0, 0.05);
} */

/* ✅ FIXED: Input Field with same right-margin approach */
.sidebar-robot-input {
  position: absolute;
  bottom: calc(100% + -1px);
  /* ✅ FIXED: Use right positioning like bubble */
  right: 7px !important;
  transform: translateY(10px);
  background: #ffffff;
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
  box-shadow: 0 2px 6px rgba(75, 70, 92, 0.04);
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;

  /* ✅ FIXED: Responsive sizing with overflow protection */
  min-width: fit-content;
  width: 200px;
  max-width: min(250px, calc(100vw - 40px));
  min-height: fit-content;
  /* Added: Allow container to grow */
  max-height: 243px;
  /* Added: Maximum container height */
  flex-direction: column;
  box-sizing: border-box;
}

.sidebar-robot-input.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.sidebar-robot-input-top-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
}

span.sidebar-robot-input-top-text {
  font-family: Poppins;
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  background: linear-gradient(90deg, var(--color-primary) 0%, #495057 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-robot-input input {
  display: flex;
  padding: 8px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 120px;
  border-radius: 8px;
  border: 0.5px solid var(--Text-Primary-Dark, #e4e4e4);
  background: var(--Brand-card_grey, #f8f9fa);
  color: var(--Text-Primary, #495057);
  font-family: Poppins;
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: 18px;
  box-sizing: border-box;
}

.sidebar-robot-input input:focus-visible {
  outline: none;
}

.sidebar-input-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  align-self: stretch;
}

.sidebar-mic {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.sidebar-send {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
}

.sidebar-mic svg,
.sidebar-send svg {
  cursor: pointer;
}

.sidebar-robot-input input::placeholder {
  color: #9ca3af;
}

/* ✅ FIXED: Input arrow positioning */
.sidebar-robot-input::after {
  content: '';
  position: absolute;
  top: 100%;
  left: var(--arrow-position, 50%);
  /* Default to center, overridden by JS for exact centering */
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #ffffff;
}

/* Success state */
.sidebar-robot-success {
  animation: successPulse 0.6s ease-in-out;
}

/* ✅ IMPROVED: Mobile adjustments with right-margin approach */
@media (max-width: 768px) {
  .sidebar-robot-bubble {
    right: 15px;
    /* Slightly smaller margin on mobile */
    max-width: min(200px, calc(100vw - 30px));
    min-width: fit-content;
  }

  .sidebar-robot-input {
    right: 15px;
    width: min(200px, calc(100vw - 30px));
    max-width: min(230px, calc(100vw - 30px));
  }

  .sidebar-robot-bubble::after,
  .sidebar-robot-input::after {
    left: var(--arrow-position, 50%);
    /* ✅ CENTERED: Always centered on mobile too */
  }
}

/* ✅ IMPROVED: Small screen fallback to center */
@media (max-width: 320px) {
  .sidebar-robot-bubble,
  .sidebar-robot-input {
    right: auto;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    min-width: fit-content;
  }

  .sidebar-robot-bubble.show,
  .sidebar-robot-input.show {
    transform: translateX(-50%) translateY(0);
  }

  .sidebar-robot-bubble::after,
  .sidebar-robot-input::after {
    left: var(--arrow-position, 50%);
    /* ✅ CENTERED: Always centered on small screens */
  }
}

.sidebar-cross-icon {
  background: rgba(254, 233, 231, 1);
}

.sidebar-cross-icon svg {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  stroke-width: 1.5px;
  stroke: rgba(236, 34, 31, 1);
}

/* ================================ Slider CSS ================================ */

.bubble-slider-container {
  text-align: center;
  padding: 4px 0;
}

.bubble-slide-content {
  transition: opacity 0.15s ease;
  min-height: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.bubble-main-text {
  text-align: center;

  /* UI/Caption */
  font-family: Poppins;
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: 18px;
  /* 128.571% */
  background: linear-gradient(90deg, var(--color-primary) 0%, #495057 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  padding: 9px 0px 9px 0px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
}

.bubble-description {
  color: var(--Text-Secondary, #adb5bd);
  text-align: center;
  /* UI/Meta Text */
  font-family: Poppins;
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  line-height: 16px;
  /* 133.333% */
}

.sidebar-robot-bubble .bubble-description {
  color: #adb5bd !important;
  background: none !important;
  -webkit-text-fill-color: initial !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
}

.bubble-indicators {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  height: 10px;
}

.bubble-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: #ddd;
  transition: all 0.2s ease;
}

.bubble-dot.active {
  background-color: var(--color-primary);
  transform: scale(1.2);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bubble-slide-content {
  animation: slideIn 0.3s ease-out;
}

/* =============================== End of Slider CSS ================================ */

/* =============================== Bubble Loader ================================ */

/* Target the PATH element (not rect) for your specific SVG */
.sidebar-robot-bubble .sidebar-bubble-loader svg.processing-animation path {
  animation: audioPathPulse 1.2s ease-in-out infinite;
  transform-origin: center bottom;
}

/* Additional pulsing effect for the whole SVG container */
.sidebar-robot-bubble .sidebar-bubble-loader svg.processing-animation {
  animation: audioContainerPulse 1.5s ease-in-out infinite;
  transform-origin: center;
}

/* Keyframes for path animation - creates audio bar effect */
@keyframes audioPathPulse {

  0%,
  100% {
    transform: scaleY(0.7) scaleX(0.95);
    opacity: 1;
  }

  25% {
    transform: scaleY(1.1) scaleX(1.02);
    opacity: 1;
  }

  50% {
    transform: scaleY(0.9) scaleX(0.98);
    opacity: 1;
  }

  75% {
    transform: scaleY(1.2) scaleX(1.05);
    opacity: 1;
  }
}

/* Keyframes for container animation - adds subtle movement */
@keyframes audioContainerPulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  33% {
    transform: scale(1.05);
    opacity: 1;
  }

  66% {
    transform: scale(0.98);
    opacity: 1;
  }
}

/* Keep existing successful pulse animation */
@keyframes successPulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
  }
}

/* Alternative: If you want a more subtle animation, use this instead */
.sidebar-robot-bubble .sidebar-bubble-loader svg.processing-animation.subtle path {
  animation: audioPathSubtle 1s ease-in-out infinite;
}

@keyframes audioPathSubtle {

  0%,
  100% {
    transform: scaleY(0.85);
    opacity: 1;
  }

  50% {
    transform: scaleY(1.15);
    opacity: 1;
  }
}



/* Devider and loader */

.bubble-content-row {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
}

.sidebar-bubble-loader-inline svg.processing-animation {
  width: 16px;
  height: 16px;
  /* display: none; */
}

.bubble-keyboard-inline {
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.bubble-keyboard-inline:hover {
  opacity: 1;
}

#sidebar_custom_input {
  /* Auto-resize height with constraints */
  min-height: 80px;
  max-height: 300px;
  /* Limit height before scrolling */
  height: auto;

  /* Disable manual resize handle */
  resize: none;

  /* Text handling */
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  line-height: 1.4;
  /* Overflow behavior - enable scroll when content exceeds max-height */
  overflow-y: auto !important;
  scrollbar-color: #f6f8fa #ffffff;
  scrollbar-width: thin;
  overflow-x: hidden;
  /* Styling */
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
  background: transparent;
  padding: 8px;
  border-radius: 8px;
  border: 0.5px solid var(--Text-Primary-Dark, #e4e4e4);
  background: #fff;
  box-shadow: 0 0 4px 0 var(--color-primary);
  width: 100%;

  /* Smooth transitions */
  transition: height 0.1s ease;
}

/* JavaScript handles auto-resize and scroll behavior for all browsers */

.sidebar-word-limit {
  color: var(--Text-Muted, #6c757d);
  font-size: 11px;
  font-style: normal;
  font-weight: 300;
  line-height: 16px;
  align-self: center;
}

.main-textarea-section {
  position: relative;
}

.progress-bar-container {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  background: rgba(175, 244, 198, 1);
  border-radius: 10px 10px 0 0;
  overflow: hidden;
  height: 6px;
  align-self: stretch;
  width: 100%;
  padding: 6px;
}

.progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: rgba(20, 174, 92, 1);
  border-radius: 20px 20px 0 0;
  /* Match bubble's border-radius */
  /* Animation is now handled by JavaScript */
  z-index: 2;
}

.progress-bar.paused {
  /* Pause state is now handled by JavaScript */
}

@keyframes progressFill {
  from {
    width: 100%;
  }

  to {
    width: 0%;
  }
}


.progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: rgba(20, 174, 92, 1);
  border-radius: 20px 20px 0 0;
  /* Animation is now handled by JavaScript */
  z-index: 2;
}

/* ============ CSS for buttons ============== */

/* Button-based bubble styles */
.bubble-buttons-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 200px;
}

.bubble-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.bubble-title {
  font-family: Poppins;
  font-size: 14px;
  font-weight: 400;
  background: linear-gradient(90deg, var(--color-primary) 0%, #495057 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.bubble-info-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.bubble-info-icon:hover {
  opacity: 1;
  background-color: rgba(0, 0, 0, 0.05);
}

.bubble-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bubble-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  padding: 8px 10px;
  align-items: center;
  gap: 10px;
  align-self: stretch;
  border-radius: 8px;
  background: #f9fafb;
}

.bubble-action-btn:hover {
  background: #e9ecef;
}

.bubble-action-btn span {
  font-size: 14px;
}

.bubble-button-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.button-info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 8px;
  background: #f8f9fa;
  border-radius: 6px;
}

.button-info-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  font-size: 12px;
  color: #495057;
}

.button-info-desc {
  font-size: 11px;
  color: #6c757d;
  line-height: 1.3;
  font-weight: 400;
}

/* FIXED: Make info items clickable buttons */
.button-info-item {
  display: flex;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 8px 10px;
  align-items: center;
  gap: 10px;
  align-self: stretch;
  border-radius: 8px;
  background: #f9fafb;
}

.button-info-item:hover {
  background: #e9ecef;
}

.button-info-item:active {
  transform: translateY(1px);
}

/* Ensure bubble stays visible during hover transitions */
.sidebar-robot-bubble {
  pointer-events: auto !important;
}

.sidebar-robot-bubble *{
  pointer-events: auto !important;
}

.button-info-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.button-info-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  align-items: flex-start;
}

.button-title {
  font-weight: 500;
  font-size: 12px;
  line-height: 13px;
  color: #495057;
}

.button-info-desc {
  font-size: 11px;
  color: #6c757d;
  line-height: 1.3;
  text-align: left;
  /* No margin needed - natural alignment */
}

#sidebar-robot-bubble.sidebar-robot-bubble.error {
  width: max-content !important;
  min-width: max-content !important;
  max-width: none;
}

#sidebar-robot-bubble.sidebar-robot-bubble.error .bubble-text {
  -webkit-text-fill-color: #dc3545 !important;
  /* color: var(--Text-Primary, #495057); */
  text-align: center;
  font-family: Poppins;
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: 18px;
}

/* Ok Button Styles */
.bubble-ok-button-container {
  display: flex;
  justify-content: center;
}

.bubble-ok-button {
  display: flex;
  align-items: center;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 10px;
    box-shadow: inset 0 1px 1px 0 hsla(0, 0%, 100%, .9), 0 1px 3px 0 rgba(0, 0, 0, .04);
    color: #495057;
    cursor: pointer;
    display: inline-flex;
    font-family: Poppins, sans-serif;
  font-size: 14px;
    font-weight: 500;
    justify-content: center;
    min-height: 48px;
    padding: 12px 20px;
    transition: all .15s ease;
    width: 100%;
}

.bubble-ok-button:hover {
  background: rgba(248, 249, 250, 0.8) !important;
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow:
    0 1px 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 2px 4px 0 rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
    color: #495057 !important;
}

.bubble-ok-button svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* Column layout when OK button is present */
#sidebar-robot-bubble-tts,
.sidebar-robot-bubble.has-ok-button {
  flex-direction: column !important;
  align-items: stretch !important;
  /* Allow content to use full width */
  gap: 8px !important;
  /* Adjust gap for vertical layout */
}

/* Ensure OK button content takes full width in column layout */

.sidebar-robot-bubble.has-ok-button .bubble-ok-button-container {
  width: 100%;
}

.sidebar-robot-bubble .markdown-body {
  background-color: #ffffff !important;
  font-size: 14px;
  font-weight: 400;
  overflow-y: auto;
  max-height: 350px;
  scrollbar-color: #f6f8fa #ffffff;
  scrollbar-width: thin;
}

.sidebar-robot-bubble .markdown-body * {
  background-color: #ffffff !important;
  font-size: 14px;
  color: #495057 !important;
  font-family: Poppins !important;
  font-size: 14px !important;
  text-align: left !important;
}

body {
  overflow: hidden !important;
}

.sidebar-robot-blur-effect {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  backdrop-filter: blur(2px);
  z-index: 1;
  display: none;
}

/* Sidebar Character Counter Styles */
.sidebar-counter-nav-div {
  display: none;
}

.sidebar-word-counter-div {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sidebar-char-limit-warning {
  color: #808080;
  font-size: 14px;
  margin: 0;
  text-align: center;
  line-height: 1.3;
}

.sidebar-word-count {
  color: #808080;
  font-size: 14px;
  margin: 0;
}

.sidebar-char-limit-warning-red {
  color: var(--color-primary) !important;
  font-weight: 500 !important;
  font-size: 14px;
}

.link-to-login {
  font-size: 14px;
  color: #808080;
}

.mobile-sidebar-robot {
  width: auto;
}



@media (max-width:480px) {
  .bubble-header {
    display: none !important;
  }

  .bubble-action-btn span {
    font-size: 12px !important;
  }

  #sidebar_custom_input {
    font-size: 12px !important;
  }
  .bubble-buttons-container{
    min-width: 142px !important;
  }
}

#sidebar-robot-bubble-tts{
  width: max-content;
  right: 7px;
}

.bubble-reject-accept-container {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-bottom: 8px;
}

.bubble-reject-btn,
.bubble-accept-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #ffffff;
  color: #495057;
  font-family: Poppins;
  font-size: 11px;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.2s ease;
  gap: 5px;
  padding: 0px;
  line-height: 2;
}

.bubble-reject-btn svg,
.bubble-accept-btn svg {
  width: 16px;
  height: 16px;
}

.bubble-reject-btn {
  background: linear-gradient(90deg, #faaebe 0%, #F9DAE1 100%);
}

.bubble-reject-btn:hover {
  background: linear-gradient(90deg, #F9DAE1 0%, #faaebe 100%);
}

.bubble-accept-btn {
  background: linear-gradient(90deg, #aef884 0%, #daf9e5 100%);
}

.bubble-accept-btn:hover {
  background: linear-gradient(90deg, #daf9e5 0%, #aef884 100%);
}


.secondary-tts.show{
  padding: 10px;
}
.has-ok-button.show{
  padding: 10px;
}


/* ss-sidebar.css */
/* ============================================
   FONTS — Nunito Sans loaded via Google Fonts in HTML head
   Poppins @font-face removed for design consistency
   ============================================ */

/* ============================================
   WRAPPER (prevents document height contribution)
   ============================================ */
#ss.sidebar-wrapper {
  border-left: 1px solid #e5e7eb;
  display: contents;
}

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
  --ss-sidebar-width: 56px;
  --ss-sidebar-bg: var(--color-card, #ffffff);
  --ss-sidebar-border: var(--color-border, #e4e6e8);
  --ss-text-primary: var(--color-text-primary, #384551);
  --ss-text-secondary: var(--color-text-secondary, #646e78);
  --ss-hover-bg: var(--color-primary-light, rgba(var(--color-primary-rgb), 0.08));
  --ss-active-bg: var(--color-primary-light, rgba(var(--color-primary-rgb), 0.16));
  --ss-active-border: var(--color-primary, #696cff);
  --ss-shadow: rgba(34, 48, 62, 0.08);
  --ss-font: 'Nunito Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ============================================
   DARK MODE VARIABLE OVERRIDES
   ============================================ */
[data-theme="dark"] {
  --ss-sidebar-bg: var(--color-card, #1a2035);
  --ss-sidebar-border: var(--color-border, #2a3250);
  --ss-text-primary: var(--color-text-primary, #e8ecf4);
  --ss-text-secondary: var(--color-text-secondary, #8a92a6);
  --ss-hover-bg: rgba(var(--color-primary-rgb), 0.15);
  --ss-active-bg: rgba(var(--color-primary-rgb), 0.15);
  --ss-active-border: var(--color-primary, #696cff);
  --ss-shadow: rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ss-sidebar-bg: var(--color-card, #1a2035);
    --ss-sidebar-border: var(--color-border, #2a3250);
    --ss-text-primary: var(--color-text-primary, #e8ecf4);
    --ss-text-secondary: var(--color-text-secondary, #8a92a6);
    --ss-hover-bg: rgba(var(--color-primary-rgb), 0.15);
    --ss-active-bg: rgba(var(--color-primary-rgb), 0.15);
    --ss-active-border: var(--color-primary, #696cff);
    --ss-shadow: rgba(0, 0, 0, 0.4);
  }
}

/* ============================================
   LAYOUT INTEGRATION (Translator Bot module)
   ============================================ */
/* Only activates when JS mounts the sidebar module */
.new-korrektur.ss-has-sidebar {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.new-korrektur.ss-has-sidebar .ss-app-content {
  flex: 1;
  min-width: 0;
}

@media (max-width: 767px) {
  .new-korrektur.ss-has-sidebar {
    display: block;
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }
}

/* ============================================
   SIDEBAR CONTAINER
   ============================================ */
#ss-sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  width: var(--ss-sidebar-width);
  background-color: var(--ss-sidebar-bg);
  border-right: 1px solid var(--ss-sidebar-border);
  font-family: var(--ss-font);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
  contain: layout style paint;
}

/* ============================================
   SIDEBAR NAV
   ============================================ */
.sidebar__nav {
  flex: 1;
  padding: 12px 6px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar__nav::-webkit-scrollbar {
  width: 4px;
}
.sidebar__nav::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar__nav::-webkit-scrollbar-thumb {
  background: var(--ss-sidebar-border);
  border-radius: 2px;
}

.sidebar__nav {
  scrollbar-width: thin;
  scrollbar-color: var(--ss-sidebar-border) transparent;
}

.ss-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background-color: transparent;
  color: var(--ss-text-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
  user-select: none;
  -webkit-user-select: none;
}

@media (hover: hover) {
  .ss-nav-item:hover {
    background-color: var(--ss-hover-bg);
  }
}

.ss-nav-item:active {
  background-color: var(--ss-sidebar-border);
}

.ss-nav-item:focus-visible {
  outline: 2px solid var(--ss-active-border);
  outline-offset: -2px;
}

.ss-nav-item.is-active {
  background-color: var(--ss-active-bg);
  color: var(--ss-text-primary);
}

.ss-nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: currentColor;
}

.ss-nav-item img.ss-nav-icon {
  width: 20px;
  height: 20px;
  display: block;
  object-fit: contain;
}

.ss-icon-muted {
  filter: grayscale(1) brightness(0) invert(32%) sepia(10%) saturate(500%) hue-rotate(180deg)
    brightness(95%) contrast(90%);
  opacity: 1;
  transition: filter 0.15s ease, opacity 0.15s ease;
}

.ss-nav-item.is-active .ss-icon-muted,
.ss-bottom-nav-item.is-active .ss-icon-muted,
.ss-mobile-menu-item.is-active .ss-icon-muted {
  filter: grayscale(1) brightness(0.2) contrast(1);
  opacity: 1;
}

/* Dark mode icon filter overrides — applied via [data-theme="dark"] */
[data-theme="dark"] .ss-icon-muted {
  filter: grayscale(1) brightness(0) invert(74%) sepia(8%) saturate(280%) hue-rotate(358deg)
    brightness(92%) contrast(90%);
  opacity: 1;
}

[data-theme="dark"] .ss-nav-item.is-active .ss-icon-muted,
[data-theme="dark"] .ss-bottom-nav-item.is-active .ss-icon-muted,
[data-theme="dark"] .ss-mobile-menu-item.is-active .ss-icon-muted {
  filter: grayscale(1) brightness(0) invert(100%);
  opacity: 1;
}

.ss-nav-item.is-active .ss-nav-icon {
  color: var(--ss-text-primary);
}

.ss-nav-divider {
  height: 1px;
  margin: 8px 10px;
  background: var(--ss-sidebar-border);
  opacity: 0.6;
  border-radius: 999px;
  flex-shrink: 0;
}

/* Floating tooltip (created by JS, appended to body) */
.ss-tooltip {
  position: fixed;
  left: calc(var(--ss-sidebar-width) + 8px);
  padding: 8px 14px;
  background-color: var(--ss-sidebar-bg);
  border: 1px solid var(--ss-sidebar-border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  color: var(--ss-text-secondary);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease, visibility 0.12s ease;
  box-shadow: 0 2px 8px var(--ss-shadow);
  z-index: 9999;
  transform: translateY(-50%);
  font-family: var(--ss-font);
}

.ss-tooltip.is-visible {
  opacity: 1;
  visibility: visible;
}

.ss-tooltip.is-active {
  font-weight: 500;
  color: var(--ss-text-primary);
}

/* ============================================
   DARK MODE TOGGLE (shared)
   ============================================ */
.ss-darkmode-icon-dark {
  display: none;
}

[data-theme="dark"] .ss-darkmode-icon-light {
  display: none;
}

[data-theme="dark"] .ss-darkmode-icon-dark {
  display: block;
}

/* ============================================
   SIDEBAR BOTTOM (Profile)
   ============================================ */
.sidebar__bottom {
  border-top: 1px solid var(--ss-sidebar-border);
  padding: 8px 6px;
}

.ss-profile-wrapper {
  position: relative;
}

.ss-profile-btn {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background-color: transparent;
  border: none;
  cursor: pointer;
  color: var(--ss-text-secondary);
  font-family: var(--ss-font);
  transition: background-color 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
}

@media (hover: hover) {
  .ss-profile-btn:hover {
    background-color: var(--ss-hover-bg);
  }
}

.ss-profile-btn:active {
  background-color: var(--ss-sidebar-border);
}

.ss-profile-btn:focus-visible {
  outline: 2px solid var(--ss-active-border);
  outline-offset: -2px;
}

.ss-profile-avatar {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
}

.ss-profile-btn.is-active {
  background-color: var(--ss-active-bg);
}

.ss-profile-avatar svg {
  width: 14px;
  height: 14px;
}

.ss-dropdown-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

.ss-dropdown-backdrop.is-active {
  display: block;
}

.ss-dropdown {
  position: fixed;
  min-width: 160px;
  background-color: var(--ss-sidebar-bg);
  border: 1px solid var(--ss-sidebar-border);
  border-radius: 8px;
  box-shadow: 0 4px 16px var(--ss-shadow);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ss-dropdown.is-active {
  opacity: 1;
  visibility: visible;
}

.ss-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--ss-text-secondary);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  font-family: var(--ss-font);
  transition: background-color 0.15s ease;
  margin: 0;
}

@media (hover: hover) {
  .ss-dropdown-item:hover {
    background-color: var(--ss-hover-bg);
    color: var(--ss-text-primary);
  }
}

.ss-dropdown-item:focus-visible {
  outline: 2px solid var(--ss-active-border);
  outline-offset: -2px;
  background-color: var(--ss-hover-bg);
}

.ss-dropdown-item.is-active {
  background-color: var(--ss-active-bg);
  color: var(--ss-text-primary);
  font-weight: 500;
}

.ss-dropdown-item.is-active svg {
  color: var(--ss-text-primary) !important;
  stroke: var(--ss-text-primary) !important;
}

.ss-dropdown-item span {
  transform: translateY(0.5px);
}

.ss-dropdown-item .ss-darkmode-label {
  transform: translateY(0px);
}

.ss-dropdown-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Language flag icons override */
.ss-lang-flag {
  width: 20px !important;
  height: 20px !important;
  border-radius: 50%;
  flex-shrink: 0;
}

.ss-mobile-menu-item .ss-lang-flag {
  width: 22px !important;
  height: 22px !important;
  border-radius: 50%;
}

.ss-dropdown-item .ss-darkmode-icon-light,
.ss-dropdown-item .ss-darkmode-icon-dark {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.ss-dropdown-separator {
  margin: 4px 12px;
  height: 1px;
  background: var(--ss-sidebar-border);
}

.ss-dropdown-item.is-logout {
  color: #ef4444;
}

@media (hover: hover) {
  .ss-dropdown-item.is-logout:hover {
    background-color: rgba(239, 68, 68, 0.08);
  }
}

[data-theme="dark"] .ss-dropdown-item.is-logout {
  color: #f87171;
}

@media (hover: hover) {
  [data-theme="dark"] .ss-dropdown-item.is-logout:hover {
    background-color: rgba(248, 113, 113, 0.12);
  }
}

/* ============================================
   TABLET (768px - 1024px) - iPad optimizations
   ============================================ */
@media (min-width: 768px) and (max-width: 1024px) and (pointer: coarse) {
  .ss-nav-item {
    width: 48px;
    height: 48px;
  }

  .ss-profile-btn {
    width: 48px;
    height: 48px;
  }

  .sidebar__nav {
    padding: 12px 4px;
  }

  .sidebar__bottom {
    padding: 8px 4px;
  }
}

/* ============================================
   MOBILE BOTTOM NAV & MENU (< 768px)
   ============================================ */
.ss-bottom-nav {
  display: none;
}

.ss-mobile-menu {
  display: none;
  visibility: hidden;
  pointer-events: none;
}

@media (max-width: 767px) {
  #ss-sidebar {
    display: none;
  }

  .ss-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(56px + env(safe-area-inset-bottom, 0px));
    background-color: var(--ss-sidebar-bg);
    border-top: 1px solid var(--ss-sidebar-border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 8px;
    padding-top: 4px;
    padding-bottom: calc(4px + env(safe-area-inset-bottom, 0px));
    z-index: 1000;
    font-family: var(--ss-font);
    touch-action: manipulation;
  }

  .ss-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 48px;
    border-radius: 8px;
    background: none;
    border: none;
    color: var(--ss-text-secondary);
    text-decoration: none;
    font-size: 10px;
    line-height: 1;
    gap: 2px;
    cursor: pointer;
    font-family: var(--ss-font);
    transition: color 0.1s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .ss-bottom-nav-item.is-active {
    color: var(--ss-text-primary);
    background-color: var(--ss-active-bg);
  }

  .ss-bottom-nav-item:active {
    transform: scale(0.95);
  }

  .ss-bottom-nav-item:focus-visible {
    outline: 2px solid var(--ss-active-border);
    outline-offset: -2px;
  }

  .ss-bottom-nav-item svg {
    width: 24px;
    height: 24px;
  }

  .ss-bottom-nav-item img {
    width: 24px;
    height: 24px;
    display: block;
    object-fit: contain;
  }

  .ss-mobile-menu {
    display: flex;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0);
    -webkit-backdrop-filter: blur(0px);
    backdrop-filter: blur(0px);
    z-index: 1100;
    align-items: flex-end;
    overscroll-behavior: none;
    touch-action: none;
    visibility: hidden;
    pointer-events: none;
    transition: background-color 0.3s ease, backdrop-filter 0.3s ease,
      -webkit-backdrop-filter 0.3s ease, visibility 0.3s ease;
  }

  .ss-mobile-menu.is-active {
    visibility: visible;
    pointer-events: auto;
    background-color: rgba(0, 0, 0, 0.4);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
  }

  .ss-mobile-menu-content {
    width: 100%;
    max-height: 70vh;
    background-color: var(--ss-sidebar-bg);
    border-radius: 16px 16px 0 0;
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  }

  .ss-mobile-menu.is-active .ss-mobile-menu-content {
    transform: translateY(0);
  }

  .ss-mobile-menu-content::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background-color: var(--ss-sidebar-border);
    border-radius: 2px;
    margin: 0 auto 12px;
  }

  .ss-mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-radius: 8px;
    color: var(--ss-text-secondary);
    font-size: 15px;
    line-height: 1.4;
    text-decoration: none;
    text-align: left;
    width: 100%;
    background: none;
    border: none;
    font-family: var(--ss-font);
    cursor: pointer;
    transition: background-color 0.1s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .ss-mobile-menu-item:active {
    background-color: var(--ss-hover-bg);
    transform: scale(0.98);
  }

  .ss-mobile-menu-item:focus-visible {
    outline: 2px solid var(--ss-active-border);
    outline-offset: -2px;
    background-color: var(--ss-hover-bg);
  }

  .ss-mobile-menu-item.is-active {
    background-color: var(--ss-active-bg);
    color: var(--ss-text-primary);
    font-weight: 500;
  }

  .ss-mobile-menu-item svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
  }

  .ss-mobile-menu-item img {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: block;
    object-fit: contain;
  }

  .ss-mobile-menu-separator {
    margin: 8px 12px;
    height: 1px;
    background: var(--ss-sidebar-border);
  }

  .ss-mobile-menu-item.is-logout {
    color: #ef4444;
  }

  .ss-mobile-menu-item.is-logout:active {
    background-color: rgba(239, 68, 68, 0.08);
  }

  [data-theme="dark"] .ss-mobile-menu-item.is-logout {
    color: #f87171;
  }

  [data-theme="dark"] .ss-mobile-menu-item.is-logout:active {
    background-color: rgba(248, 113, 113, 0.12);
  }

  #ss-mobile-darkmode-btn {
    justify-content: flex-start;
  }

  #ss-mobile-darkmode-btn svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
  }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .ss-nav-item,
  .ss-profile-btn,
  .ss-dropdown,
  .ss-tooltip,
  .ss-bottom-nav-item,
  .ss-mobile-menu-item,
  .ss-mobile-menu,
  .ss-mobile-menu-content,
  .ss-dropdown-item,
  .ss-icon-muted {
    transition: none !important;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  #ss-sidebar,
  .ss-bottom-nav,
  .ss-mobile-menu,
  .ss-tooltip,
  .ss-dropdown,
  .ss-dropdown-backdrop {
    display: none !important;
  }
}


/* ── SkrivSikkert Platform Integration ── */

/* Flush edges — no platform padding around the editor */
.grammar-page .main-content {
  padding: 0 !important;
  overflow: hidden;
}

/* Protect sidebar from robot bundle CSS bleed */
.sidebar, .sidebar * {
  font-family: 'Nunito Sans', system-ui, -apple-system, sans-serif !important;
}
.sidebar .nav-item {
  font-size: 15px !important;
  font-weight: 500 !important;
  color: #646e78 !important;
}
.sidebar .nav-item.active {
  color: var(--color-primary) !important;
}

/* Robot fills viewport */
.robot-container,
#grammar-bot-container,
.new-korrektur,
.text-area-container {
  height: 100vh;
  height: 100dvh;
}

/* Editor and sidebar: flush with viewport */
.inner-textarea-bottom {
  border-radius: 0 !important;
  box-shadow: none !important;
  border-right: none;
}

.correction-sidebar {
  border-radius: 0 !important;
}

.improv-inner,
.correction-content {
  border-radius: 0 !important;
}

/* Hide speech bubble on Bedre tab */
.demo-inner .hamdan-speech-bubble {
  display: none !important;
}


/* STT.css */
/* =============================== STT ====================== */
.lucide-mic.listening-glow {
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% {
    filter: drop-shadow(0 0 5px #28a745);
  }

  50% {
    filter: drop-shadow(0 0 15px #28a745);
  }

  100% {
    filter: drop-shadow(0 0 5px #28a745);
  }
}


/* textAreaLoader.css */
/* ===================================== Text Area Loaders ================================ */

/* Base loader backdrop for textarea */
.loader-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease-in-out;
  border-radius: 8px;
  pointer-events: auto;
}

/* Specific loader backdrop modifications for textarea */
.textarea-wrapper .loader-backdrop {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.75);
}

/* Bubble loader animation */
.bubble-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60px;
  gap: 8px;
}

.bubble {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #ff9daf;
  animation: bubble-animation 1.8s ease-in-out infinite;
}

.bubble:nth-child(2) {
  animation-delay: 0.2s;
}

.bubble:nth-child(3) {
  animation-delay: 0.4s;
}

.bubble:nth-child(4) {
  animation-delay: 0.6s;
}

/* Bubble animation keyframes */
@keyframes bubble-animation {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.3;
  }

  50% {
    transform: scale(3);
    opacity: 0.8;
  }
}

/* Optional ripple effect for bubbles */
.bubble::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #ff9daf;
  opacity: 0.7;
  animation: ripple 1.8s ease-in-out infinite;
}

@keyframes ripple {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }

  100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* Loader text styling */
.loader-text {
  font-family: Poppins;
  color: #495057;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}

/* Fade in animation for loader */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Loader gif styling (if used) */
.loader-gif {
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

/* Cancel button styles */
.text-area-cancel-btn {
  margin-top: 16px;
  display: inline-flex;
  padding: 6px 12px;
  justify-content: center;
  align-items: center;
  gap: 5px;
  border-radius: 10px;
  border: 1px solid var(--Text-Primary-Dark, #e4e4e4);
  background: linear-gradient(139deg, #fff 71.45%, #f8f9fa 94.3%);
  box-shadow:
    0 1px 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 1px 3px 0 rgba(0, 0, 0, 0.04);
}

.text-area-cancel-btn:hover {
  border-radius: 10px;
  border: 1px solid var(--Text-Primary-Dark, #e4e4e4);
  background: linear-gradient(139deg, #fff 12.36%, #f1f3f4 94.3%);
  box-shadow:
    0 1px 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 1px 3px 0 rgba(0, 0, 0, 0.04),
    0 1px 3px 0 rgba(0, 0, 0, 0.04),
    0 2px 8px 0 rgba(0, 0, 0, 0.06),
    0 1px 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.text-area-cancel-btn:active {
  border-radius: 10px;
  border: 1px solid var(--Text-Primary-Dark, #e4e4e4);
  background: linear-gradient(139deg, #fff 12.36%, #f1f3f4 94.3%);
  box-shadow:
    0 1px 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 1px 3px 0 rgba(0, 0, 0, 0.04),
    0 1px 3px 0 rgba(0, 0, 0, 0.04),
    0 2px 8px 0 rgba(0, 0, 0, 0.06),
    0 1px 1px 0 rgba(255, 255, 255, 0.9) inset;
  transform: translateY(1px);
}


/* toast.css */
/* ===== TOAST NOTIFICATION ===== */
.toast-notification {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #1f2937;
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    border-radius: 10px;
    box-shadow: 
      0 4px 12px rgba(0, 0, 0, 0.15),
      0 2px 4px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
  }

  .toast-notification.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
  }

  .toast-notification .toast-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .toast-notification .toast-icon svg {
    flex-shrink: 0;
  }

  .toast-notification.success .toast-icon svg { color: #10b981; }
  .toast-notification.info .toast-icon svg    { color: #3b82f6; }
  .toast-notification.warning .toast-icon svg { color: #f59e0b; }
  .toast-notification.error .toast-icon svg   { color: #ef4444; }


/* TTS.css */
/* ================================== text to speech ================================ */
.lucide-pause {
  display: none;
}

#stopBtn:focus,
#pausePlayBtn:focus,
#downloadBtn:focus {
  background-color: transparent !important;
}

.loader {
  display: flex;
  align-items: center;
  /* margin-right: 6px; */
}

#downloadBtn .dotted-loader {
  position: relative;
  width: 19px;
  height: 19px;
}

.dotted-loader .dot {
  position: absolute;
  width: 3px;
  height: 3px;
  background-color: #888;
  border-radius: 50%;
  animation: fade 1s linear infinite;
  transform-origin: 10px 10px;
}

/* Create 8 dots positioned in a circle */
.dotted-loader .dot:nth-child(1) {
  transform: rotate(0deg) translateX(8px);
  animation-delay: 0s;
}

.dotted-loader .dot:nth-child(2) {
  transform: rotate(45deg) translateX(8px);
  animation-delay: 0.125s;
}

.dotted-loader .dot:nth-child(3) {
  transform: rotate(90deg) translateX(8px);
  animation-delay: 0.25s;
}

.dotted-loader .dot:nth-child(4) {
  transform: rotate(135deg) translateX(8px);
  animation-delay: 0.375s;
}

.dotted-loader .dot:nth-child(5) {
  transform: rotate(180deg) translateX(8px);
  animation-delay: 0.5s;
}

.dotted-loader .dot:nth-child(6) {
  transform: rotate(225deg) translateX(8px);
  animation-delay: 0.625s;
}

.dotted-loader .dot:nth-child(7) {
  transform: rotate(270deg) translateX(8px);
  animation-delay: 0.75s;
}

.dotted-loader .dot:nth-child(8) {
  transform: rotate(315deg) translateX(8px);
  animation-delay: 0.875s;
}

@keyframes fade {

  0%,
  100% {
    opacity: 0.3;
  }

  50% {
    opacity: 1;
  }
}

/* Spinner loader for TTS */
.loading-spinner {
  display: flex;
      width: 16px;
      height: 16px;
      border: 2px solid #e5e7eb;
      border-top-color: #6b7280;
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------------------------- new styling -------------------------------- */
#genderSelector span {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

#genderSelector {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-114%);
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    padding: 5px;
    display: none;
    flex-direction: column;
    gap: 1px;
    z-index: 1000;
}

#genderSelector::after{
  content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 10px;
    height: 10px;
    background: #ffffff;
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transform: translateX(-50%) rotate(45deg);
}

.gender-option {
      display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px 9px 12px;
    border-radius: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #495057;
    white-space: nowrap;
    position: relative;
}

.gender-option::before {
    content: '';
    width: 3px;
    height: 16px;
    border-radius: 2px;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.gender-option[data-gender="male"]::before {
    background: #93b4d4;
}

.gender-option[data-gender="female"]::before {
    background: #daa5b1;
}

.gender-option:hover {
  background: #f9fafb;
}

.gender-option:active {
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.08),
    inset 0 1px 2px rgba(0, 0, 0, 0.1);
  transform: translateY(0px);
}

#stopBtn,
#pausePlayBtn, #downloadBtn {
  position: relative;
}

/* #downloadBtn::after {
  content: '';
  position: absolute;
  top: 27%;
  right: 0;
  height: 50%;
  width: 0.7px;
  background: rgba(0, 0, 0, 0.06);
} */

/* #stopBtn {
  border-radius: 0 !important;
  padding: 9px 12px !important;
}

#pausePlayBtn {
  border-bottom-left-radius: 7px !important;
  border-top-left-radius: 7px !important;
  border-bottom-right-radius: 0 !important;
  border-top-right-radius: 0 !important;
  padding: 9px 12px !important;
}

#downloadBtn {
  border-bottom-right-radius: 7px !important;
  border-top-right-radius: 7px !important;
  border-bottom-left-radius: 0 !important;
  border-top-left-radius: 0 !important;
  padding: 9px 12px !important;
} */


.audio-controls {
    display: flex;
    align-items: center;
    background: transparent;
    gap: 2px;
    margin: 0;
    padding: 0;
}

.audio-controls[style*="display: none"],
.audio-controls:empty {
    display: none !important;
    width: 0;
    gap: 0;
}

#audioControls .control-btn{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: #9ca3af;
    padding: 0 !important;
}

#audioControls .control-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #6b7280;
}

/* Hide trailing separator in TTS audio controls (no mainSwitcher after it) */
#audioControls > div:last-child:not(.control-btn) {
  display: none !important;
}

/* When TTS is playing (audioControls visible), hide the readBtn completely */
.audio-controls[style*="display: flex"] ~ #readBtn,
.audio-controls[style*="display: flex"] ~ .format-btn#readBtn,
.format-group:has(.audio-controls[style*="display: flex"]) > #readBtn {
  display: none !important;
  width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}


/* voiceSlider.css */
/* |||||||||||||||||||||||||||||||||    Voice-Section Styles |||||||||||||||||||||||||||||||||||||||||||||||*/

/* Voice-Section Styles */
.voice-section {
    flex-wrap: wrap;
    display: grid;
    padding: 20px;
    row-gap: 10px;
    column-gap: 10px;
    flex: 1 0 0;
    align-self: stretch;
    grid-template-rows: repeat(4, minmax(0, 1fr));
    grid-template-columns: repeat(1, minmax(0, 1fr));
    border-radius: 8px;
    background: var(--color-bg, #FAFAF8);
    justify-content: center;
  }
  
  .voice-inner-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center !important;
    flex: 1;
  }
  
  .voice-card {
    background: var(--color-card, #ffffff);
    border-radius: 8px;
    padding: 24px;
    box-shadow: var(--shadow-card, 0 3px 8px rgba(34, 48, 62, 0.1));
    margin-bottom: 16px;
    width: 100%;
  }
  
  .voice-card-title {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 20px !important;
    font-weight: 700 !important;
    color: var(--color-text-primary, #384551);
    margin-bottom: 4px;
    text-align: center;
  }
  
  .voice-card-subtitle {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: var(--color-text-primary, #384551);
    margin-bottom: 20px;
    text-align: center;
  }
  
  .voice-slider-container {
    position: relative;
    height: 12px;
    background: #f1f3f4;
    border-radius: 999px;
    margin: 20px 0;
    margin-bottom: 28px;
    /* Extra space for tick marks below */
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.08);
  }
  
  /* ADD 5 PROFESSIONAL TICK MARKS BELOW THE SLIDER */
  .voice-slider-container::before {
    content: '';
    position: absolute;
    top: 100%;
    /* Position below the slider */
    left: 0;
    right: 0;
    height: 8px;
    margin-top: 4px;
    /* Small gap from slider */
    background-image:
      linear-gradient(to bottom, #d1d1d1 0%, #d1d1d1 100%),
      linear-gradient(to bottom, #d1d1d1 0%, #d1d1d1 100%),
      linear-gradient(to bottom, #d1d1d1 0%, #d1d1d1 100%),
      linear-gradient(to bottom, #d1d1d1 0%, #d1d1d1 100%),
      linear-gradient(to bottom, #d1d1d1 0%, #d1d1d1 100%);
    background-size: 2px 8px;
    /* Thicker lines for wider cards */
    background-position:
      0% center,
      25% center,
      50% center,
      75% center,
      100% center;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 1;
  }
  
  /* Thinner tick marks for sidebar (narrow width) */
  .correction-sidebar .voice-slider-container::before {
    background-size: 1px 6px;
    height: 12px;
  }
  
  .voice-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    /* Override JS-injected inline gradient with brand color spectrum */
    background: linear-gradient(
      90deg,
      rgba(var(--color-primary-rgb), 0.55) 0%,
      rgba(var(--color-primary-rgb), 0.75) 25%,
      var(--color-primary) 50%,
      var(--color-primary-hover) 75%,
      rgba(var(--color-primary-rgb), 0.7) 100%
    ) !important;
    border-radius: 999px;
    width: 100%;
  }

  .voice-handle {
    position: absolute;
    top: 50%;
    width: 20px;
    height: 20px;
    /* Override JS-injected inline color with brand purple */
    background: var(--color-primary, #696cff) !important;
    background-color: var(--color-primary, #696cff) !important;
    border: 3px solid white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: grab;
    z-index: 3;
    box-shadow: 0 2px 6px rgba(var(--color-primary-rgb), 0.3);
  }
  
  .voice-handle:active {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.05);
  }
  
  .voice-slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 14px;
    color: #666666;
    gap: 11px;
  }
  
  .voice-slider-start {
    text-align: left;
    font-size: 12px;
    color: var(--color-text-primary, #384551);
  }
  
  .voice-slider-end {
    text-align: right;
    font-size: 12px;
    color: var(--color-text-primary, #384551);
  }
  
  /* ========== VOICE CHANGE BUTTON ========== */
  .analyze-request-btn,
  .voice-change-btn {
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
    border-radius: 8px;
    border: none;
    background: linear-gradient(180deg, var(--color-primary-hover) 0%, var(--color-primary) 100%);
    color: #fff;
    cursor: pointer;
    padding: 14px 20px;
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 500;
    font-size: 15px;
    letter-spacing: 0.1px;
    box-shadow: -1px -10px 20px 6px white !important;
    position: relative;
  }

  /* Premium gradient effect from top - same as genBtn */
  .analyze-request-btn::before,
  .voice-change-btn::before {
    content: '';
    position: absolute;
    top: -50px;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 100%);
    filter: blur(20px);
    pointer-events: none;
    z-index: -1;
  }
  .analyze-request-btn svg,
  .voice-change-btn svg {
    width: 17px;
    height: 17px;
    stroke: #fff;
    fill: none;
  }
  
  .analyze-request-btn:hover,
  .voice-change-btn:hover {
    background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
    box-shadow: -1px -10px 20px 6px white !important;
    opacity: 1;
  }
  
  .analyze-request-btn:focus,
  .voice-change-btn:focus {
    color: #ffffff !important;
  }
  
  .analyze-request-btn:active,
  .voice-change-btn:active {
    transform: translateY(0);
  }
  
  .analyze-request-btn {
    margin-top: 16px;
  }
  
  .analyze-request-btn:disabled,
  .voice-change-btn:disabled {
    cursor: default !important;
    color: #fff !important;
    
    opacity: .7 !important;
  }


