      /* Temporary Banner Styles */
      .temp-banner {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #0f9d8e 0%, #0d8276 100%);
        color: white;
        padding: 0.75rem 1rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        z-index: 9999;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        font-size: 0.9rem;
        animation: slideDown 0.3s ease-out;
      }

      @keyframes slideDown {
        from {
          transform: translateY(-100%);
          opacity: 0;
        }
        to {
          transform: translateY(0);
          opacity: 1;
        }
      }

      .temp-banner-content {
        display: flex;
        align-items: center;
        flex: 1;
        font-weight: 500;
      }

      .temp-banner-close {
        background: transparent;
        border: none;
        color: white;
        font-size: 1rem;
        padding: 0.25rem 0.5rem;
        cursor: pointer;
        opacity: 0.9;
        transition: opacity 0.2s ease;
        border-radius: 4px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-left: 1rem;
      }

      .temp-banner-close:hover {
        opacity: 1;
        background: rgba(255, 255, 255, 0.1);
      }

      /* Adjust body padding when banner is visible */
      body.has-banner {
        padding-top: 50px;
      }

      body.has-banner .mobile-top-bar {
        top: 50px;
      }

      body.has-banner .content-wrapper {
        margin-top: 50px;
      }

      @media (max-width: 991.98px) {
        body.has-banner .editor-layout {
          margin-top: 106px; /* 50px banner + 56px top bar */
        }
      }

      /* Full-screen layout */
      .main-section-fullscreen {
        min-height: 100vh;
        background-color: #ffffff;
        padding: 0;
        margin: 0;
        background-image: none !important;
      }

      .editor-layout {
        display: flex;
        height: 100vh;
        overflow: hidden;
      }

      .editor-area {
        flex: 1;
        display: flex;
        flex-direction: column;
        padding: 2rem 3rem;
        overflow-y: auto;
      }

      .editor-container {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
      }

      .editor-input {
        flex: 1;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        padding: 1.5rem;
        font-size: 1rem;
        line-height: 1.8;
        outline: none;
        transition: border-color 0.2s ease;
        min-height: 500px;
        overflow-y: auto;
      }

      .editor-input:focus {
        border-color: #8b5cf6;
        box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
      }

      .character-limit {
        margin-top: 0.75rem;
        padding: 0.75rem 1rem;
        border: 1px solid #e5e7eb;
        border-radius: 10px;
        background: #f8fafc;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
      }

      .character-limit .helper-text {
        color: #475569;
      }

      .character-limit .character-limit-count {
        font-weight: 600;
        color: #0f172a;
      }

      .character-limit-bar {
        height: 6px;
        border-radius: 999px;
        background: #e5e7eb;
        overflow: hidden;
      }

      .character-limit-fill {
        height: 100%;
        width: 0%;
        background: linear-gradient(90deg, #0ea5e9, #6366f1);
        transition: width 0.2s ease, background-color 0.2s ease;
      }

      .character-limit.over-limit .character-limit-fill {
        background: #ef4444;
      }

      .character-limit.over-limit .character-limit-count {
        color: #b91c1c;
      }

      /* Font family options */
      .editor-input[data-font="system"],
      .editor-input:not([data-font]) {
        font-family: var(--bs-font-sans-serif);
      }

      .editor-input[data-font="crimson"] {
        font-family: 'Crimson Text', serif;
        font-size: 1.1rem;
      }

      .editor-input[data-font="libre-baskerville"] {
        font-family: 'Libre Baskerville', serif;
        font-size: 1.05rem;
      }

      .editor-actions {
        display: flex;
        gap: 0.75rem;
        margin-top: 1.5rem;
        padding-top: 1.5rem;
        border-top: 1px solid #e5e7eb;
      }

      .editor-actions .btn {
        font-size: 0.9rem;
      }

      /* Contextual action bar */
      .contextual-actions {
        margin-top: 1rem;
        padding: 0.75rem;
        background-color: #f8f9fa;
        border-radius: 8px;
        display: flex;
        justify-content: center;
        gap: 0.75rem;
      }

      .contextual-action-btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
        font-weight: 500;
        transition: all 0.2s ease;
        min-width: 200px;
      }

      .contextual-action-btn.d-none {
        display: none !important;
      }

      .contextual-action-btn.active {
        border-color: #8b5cf6;
        color: #8b5cf6;
        background-color: rgba(139, 92, 246, 0.05);
      }

      /* Mobile contextual actions */
      #mobileContextualActions {
        border-top: 1px solid #e5e7eb;
        padding-top: 1rem;
      }

      /* Right sidebar */
      .right-sidebar {
        width: 320px;
        background-color: #fafafa;
        border-left: 1px solid #e5e7eb;
        padding: 2rem 1.5rem;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        min-height: 0;
      }

      .right-sidebar-content {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
      }

      /* Vertical correction options */
      .correction-options-vertical {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
      }

      .correction-option-vertical {
        display: flex;
        align-items: center;
        gap: 1rem;
        padding: 1rem;
        border: 2px solid #e5e7eb;
        border-radius: 8px;
        background-color: #ffffff;
        cursor: pointer;
        transition: all 0.2s ease;
        font-size: 0.95rem;
      }

      .correction-option-vertical i {
        font-size: 1.5rem;
        flex-shrink: 0;
      }

      .correction-option-vertical .option-text {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        flex: 1;
      }

      .correction-option-vertical .option-text strong {
        font-size: 0.95rem;
      }

      .correction-option-vertical .option-text small {
        font-size: 0.75rem;
      }

      .correction-option-vertical:hover {
        border-color: #d1d5db;
        background-color: #f9fafb;
      }

      .correction-option-fast {
        color: #064e3b;
      }

      .correction-option-thorough {
        color: #1e40af;
      }

      .btn-check:checked + .correction-option-fast {
        border-color: #10b981;
        background-color: #f0fdf4;
      }

      .btn-check:checked + .correction-option-thorough {
        border-color: #3b82f6;
        background-color: #eff6ff;
      }

      /* Primary button improvements */
      .action-button {
        background-color: #0f9d8e;
        color: white;
        font-weight: 600;
        font-size: 1rem;
        border-radius: 8px;
        border: none;
        box-shadow: 0 2px 8px rgba(15, 157, 142, 0.3);
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
      }

      .action-button:hover:not(:disabled) {
        background-color: #0d8276;
        color: white;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(15, 157, 142, 0.4);
      }

      .action-button:active:not(:disabled) {
        transform: translateY(0);
        box-shadow: 0 2px 4px rgba(15, 157, 142, 0.3);
      }

      .action-button:disabled {
        background-color: #d1d5db;
        color: #6b7280;
        opacity: 0.8;
        box-shadow: none;
      }

      .word-count-badge {
        background-color: rgba(255, 255, 255, 0.2);
        padding: 0.25rem 0.5rem;
        border-radius: 4px;
        font-size: 0.85rem;
        font-weight: 500;
      }

      /* Statistics grid */
      .statistics-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
      }

      .stat-item {
        background-color: #ffffff;
        border: 1px solid #e5e7eb;
        border-radius: 6px;
        padding: 0.75rem;
        text-align: center;
        transition: all 0.2s ease;
      }

      .stat-item:hover {
        border-color: #d1d5db;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
      }

      .stat-label {
        font-size: 0.75rem;
        color: #6b7280;
        font-weight: 500;
        margin-bottom: 0.25rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
      }

      .stat-value {
        font-size: 1.25rem;
        color: #1f2937;
        font-weight: 700;
      }

      /* Settings link */
      .settings-link {
        transition: all 0.2s ease;
        padding: 0.5rem;
        border-radius: 6px;
      }

      .settings-link:hover {
        background-color: #f3f4f6;
        color: #6b7280 !important;
      }

      /* Result tabs */
      .result-tab {
        padding: 0.5rem 1rem;
        border-radius: 6px;
        color: #64748b;
        background-color: transparent;
        text-decoration: none;
        margin: 0 0.25rem;
        transition: all 0.2s ease;
        font-weight: 500;
        cursor: pointer;
        border: 1px solid #e5e7eb;
      }

      .result-tab:hover {
        background-color: #f9fafb;
        color: #334155;
        border-color: #d1d5db;
      }

      .result-tab.active {
        font-weight: 600;
        color: #8b5cf6;
        background-color: #f5f3ff;
        border-color: #8b5cf6;
      }

      .result-tab-original.active {
        background-color: #f0fdf4;
        color: #166534;
        border-color: #10b981;
      }

      .result-tab-edits.active {
        background-color: #fef9c3;
        color: #854d0e;
        border-color: #fbbf24;
      }

      .result-tab-final.active {
        background-color: #8b5cf6;
        color: #ffffff;
        border-color: #8b5cf6;
      }

      /* Responsive design */
      @media (max-width: 1200px) {
        .right-sidebar {
          width: 280px;
        }
      }

      /* Mobile Top Bar */
      .mobile-top-bar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 56px;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-bottom: 1px solid #e5e7eb;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        z-index: 999;
        display: flex;
        align-items: center;
        padding: 0 1rem;
      }

      .mobile-sidebar-toggle {
        background: transparent;
        border: none;
        color: #6b7280;
        font-size: 1.5rem;
        padding: 0.5rem;
        margin-right: 0.75rem;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        transition: all 0.2s ease;
      }

      .mobile-sidebar-toggle:active {
        background-color: #f3f4f6;
        transform: scale(0.95);
      }

      .mobile-top-title {
        font-size: 1.1rem;
        font-weight: 600;
        color: #1f2937;
        font-family: "Recoleta", serif;
      }

      .mobile-top-spacer {
        flex: 1;
      }

      /* Mobile optimizations */
      @media (max-width: 991.98px) {
        /* Remove content-wrapper margin on mobile */
        .content-wrapper {
          margin-left: 0 !important;
        }

        /* Full-height editor on mobile with top bar offset */
        .editor-layout {
          height: calc(100vh - 126px); /* 56px top bar + 70px bottom bar */
          flex-direction: column;
          margin-top: 56px;
        }

        .editor-area {
          padding: 1rem;
          height: 100%;
          overflow-y: auto;
        }

        .editor-container {
          height: 100%;
        }

        .editor-input {
          min-height: 300px;
        }

        /* Mobile Bottom Action Bar */
        .mobile-action-bar {
          position: fixed;
          bottom: 0;
          left: 0;
          right: 0;
          background: rgba(255, 255, 255, 0.95);
          backdrop-filter: blur(10px);
          -webkit-backdrop-filter: blur(10px);
          border-top: 1px solid #e5e7eb;
          box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
          z-index: 1000;
          padding: 0.75rem 1rem;
        }

        .mobile-action-content {
          display: flex;
          align-items: center;
          gap: 0.5rem;
          max-width: 100%;
        }

        .mobile-correction-toggle {
          display: flex;
          gap: 0.25rem;
          background-color: #f3f4f6;
          border-radius: 6px;
          padding: 0.25rem;
        }

        .mobile-correction-btn {
          padding: 0.5rem 0.75rem;
          font-size: 0.8rem;
          border-radius: 4px;
          background-color: transparent;
          border: none;
          color: #6b7280;
          font-weight: 500;
          transition: all 0.2s ease;
          display: flex;
          align-items: center;
          gap: 0.25rem;
          white-space: nowrap;
        }

        .mobile-correction-btn i {
          font-size: 0.9rem;
        }

        .mobile-correction-btn.active {
          background-color: #ffffff;
          color: #8b5cf6;
          box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        }

        .mobile-correction-fast.active {
          color: #10b981;
        }

        .mobile-correction-thorough.active {
          color: #3b82f6;
        }

        .mobile-submit-btn {
          flex: 1;
          background: linear-gradient(135deg, #0f9d8e 0%, #0d8276 100%);
          color: white;
          font-weight: 600;
          font-size: 0.9rem;
          border-radius: 6px;
          border: none;
          padding: 0.65rem 1rem;
          box-shadow: 0 2px 8px rgba(15, 157, 142, 0.3);
          display: flex;
          align-items: center;
          justify-content: center;
          gap: 0.4rem;
          transition: all 0.2s ease;
          min-height: 44px;
        }

        .mobile-submit-btn:active {
          transform: scale(0.98);
        }

        .mobile-submit-btn:disabled {
          background: #d1d5db;
          color: #6b7280;
          opacity: 0.8;
        }

        .mobile-word-badge {
          background-color: rgba(255, 255, 255, 0.2);
          padding: 0.2rem 0.4rem;
          border-radius: 3px;
          font-size: 0.75rem;
          font-weight: 600;
        }

        .mobile-settings-btn {
          background-color: #f3f4f6;
          color: #6b7280;
          border: none;
          border-radius: 6px;
          padding: 0.65rem 0.75rem;
          font-size: 1.1rem;
          transition: all 0.2s ease;
          min-width: 44px;
          min-height: 44px;
          display: flex;
          align-items: center;
          justify-content: center;
        }

        .mobile-settings-btn:active {
          background-color: #e5e7eb;
          transform: scale(0.95);
        }

        /* Mobile Offcanvas Customization */
        .offcanvas-bottom {
          height: 85vh;
          border-top-left-radius: 16px;
          border-top-right-radius: 16px;
        }

        .offcanvas-bottom .offcanvas-header {
          padding: 1.25rem 1rem;
          border-bottom: 1px solid #e5e7eb;
        }

        .offcanvas-bottom .offcanvas-body {
          padding: 1.5rem 1rem;
          overflow-y: auto;
        }
      }

      @media (max-width: 767px) {
        .editor-area {
          padding: 0.75rem;
        }

        .mobile-action-bar {
          padding: 0.5rem 0.75rem;
        }

        .mobile-correction-btn span {
          font-size: 0.75rem;
        }

        .mobile-submit-btn {
          font-size: 0.85rem;
          padding: 0.6rem 0.85rem;
        }

        .mobile-submit-btn span {
          display: none;
        }

        .mobile-word-badge {
          font-size: 0.7rem;
        }
      }

      /* Styling for diff view */
      #diffText ins {
        background-color: rgba(220, 252, 231, 0.4); /* Lighter green background */
        text-decoration: none;
        color: #059669;
        padding: 0 2px;
        border-bottom: 2px solid #059669; /* Firm underline */
        position: relative;
        display: inline-block;
      }

      #diffText del {
        background-color: rgba(254, 226, 226, 0.4); /* Lighter red background */
        text-decoration: none; /* Remove line-through */
        color: #dc2626;
        padding: 0 2px;
        border-bottom: 2px solid #dc2626; /* Firm underline */
        position: relative;
        display: inline-block;
      }

      /* Add a subtle line-through effect for deleted text */
      #diffText del::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        top: 50%;
        height: 1px;
        background-color: rgba(220, 38, 38, 0.5); /* Semi-transparent red */
      }

      /* Styling for diff spans */
      .diff-removed {
        background-color: rgba(254, 226, 226, 0.4); /* Lighter red background */
        text-decoration: none; /* Remove line-through */
        color: #dc2626;
        padding: 0 2px;
        border-bottom: 2px solid #dc2626; /* Firm underline */
        position: relative;
        display: inline-block;
      }

      /* Add a subtle line-through effect for removed text */
      .diff-removed::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        top: 50%;
        height: 1px;
        background-color: rgba(220, 38, 38, 0.5); /* Semi-transparent red */
      }

      .diff-added {
        background-color: rgba(220, 252, 231, 0.4); /* Lighter green background */
        text-decoration: none;
        color: #059669;
        padding: 0 2px;
        border-bottom: 2px solid #059669; /* Firm underline */
        position: relative;
        display: inline-block;
      }

      /* Pure insertion marker for Grammarly mode (when comma/punctuation is added) */
      .diff-insertion-marker {
        display: inline-block;
        position: relative;
        width: 0;
        height: 1em;
        vertical-align: text-bottom;
        cursor: pointer;
      }

      /* Vertical line indicator */
      .diff-insertion-marker::before {
        content: '';
        position: absolute;
        left: -1px;
        top: 0;
        bottom: 0;
        width: 2px;
        background-color: #059669;
        border-radius: 1px;
      }

      /* Small caret/triangle at top */
      .diff-insertion-marker::after {
        content: '';
        position: absolute;
        left: -4px;
        top: -2px;
        width: 0;
        height: 0;
        border-left: 4px solid transparent;
        border-right: 4px solid transparent;
        border-top: 5px solid #059669;
      }

      .diff-insertion-marker:hover::before {
        background-color: #047857;
        box-shadow: 0 0 4px rgba(5, 150, 105, 0.5);
      }

      .diff-insertion-marker:hover::after {
        border-top-color: #047857;
      }

      /* When accepted, show the inserted text inline */
      .diff-insertion-marker.correction-accepted {
        width: auto;
        height: auto;
        background-color: rgba(16, 185, 129, 0.15);
        color: #059669;
        padding: 0 2px;
      }

      .diff-insertion-marker.correction-accepted::before,
      .diff-insertion-marker.correction-accepted::after {
        display: none;
      }

      /* Readability highlighting (Hemingway-style) */
      .readability-long {
        background-color: rgba(251, 191, 36, 0.2); /* Yellow highlight for long sentences */
        border-bottom: 2px solid rgba(251, 191, 36, 0.6);
        padding: 2px 0;
        border-radius: 2px;
        cursor: help; /* Show help cursor on hover */
        transition: background-color 0.2s ease;
      }

      .readability-long:hover {
        background-color: rgba(251, 191, 36, 0.3);
      }

      .readability-very-long {
        background-color: rgba(239, 68, 68, 0.15); /* Red highlight for very long sentences */
        border-bottom: 2px solid rgba(239, 68, 68, 0.6);
        padding: 2px 0;
        border-radius: 2px;
        cursor: help; /* Show help cursor on hover */
        transition: background-color 0.2s ease;
      }

      .readability-very-long:hover {
        background-color: rgba(239, 68, 68, 0.25);
      }

      /* Error message styling */
      .error-message {
        background-color: rgba(254, 226, 226, 0.4);
        color: #dc2626;
        padding: 4px 8px;
        border-radius: 4px;
        margin: 8px 0;
        display: block;
        border-left: 3px solid #dc2626;
      }

      /* Shadow hover effect for buttons */
      .shadow-hover {
        transition: all 0.2s ease;
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
      }

      .shadow-hover:hover {
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
        transform: translateY(-2px);
      }

      .shadow-hover:active {
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
        transform: translateY(0);
      }

      /* Reasoning tooltip indicators */
      .has-reasoning {
        position: relative;
        border-radius: 3px;
      }

      .has-reasoning::after {
        content: "?";
        position: absolute;
        top: -8px;
        right: -8px;
        width: 16px;
        height: 16px;
        background-color: #6366f1;
        color: white;
        font-size: 10px;
        font-weight: bold;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0.8;
        z-index: 10;
        pointer-events: none;
      }

      .has-reasoning:hover::after {
        opacity: 1;
      }

      /* Disabled explanations toggle styling */
      #explanationsToggle .form-check-input:disabled ~ .form-check-label {
        opacity: 0.5;
        cursor: not-allowed;
      }

      #explanationsToggle .form-check-input:disabled {
        cursor: not-allowed;
      }

