/* ==========================================================================
    1. General Page & Typography Styles
    ========================================================================== */

  body.has-modal-open {
    overflow: hidden;
  }

  /* --- ▼▼▼ CRITICAL FIX 1 ▼▼▼ --- */
  /* Make the .mediation-container the full-height flex parent for the chat view ONLY. */
  .mediation-container.chat-page {
    display: flex;
    flex-direction: column;
    height: var(--mediation-container-height, 100vh);
    max-height: var(--mediation-container-max-height, var(--mediation-container-height, 100vh));
    min-height: 0;
    overflow: hidden;
  }

  .mediation-container.chat-page h1 {
    font-size: clamp(1.75rem, 2vw + 1rem, 2.3rem);
    color: #102a4d;
    margin: 0 0 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0; /* Prevents header from shrinking */
    padding: 0 clamp(1rem, 2.5vw, 2rem);
  }

  .mediation-container.chat-page p {
    font-size: 1rem;
    margin: 0 0 0.75rem;
    color: #0b172d;
    flex-shrink: 0; /* Prevents paragraph from shrinking */
  }

  /* ==========================================================================
    2. Main Layout Containers
    ========================================================================== */

  /* --- ▼▼▼ CRITICAL FIX 2 ▼▼▼ --- */
  /* This wrapper must now grow to fill the space left by the header.
    It also needs to be a flex container for its children. */
  .chat-page-wrapper {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 1rem clamp(1.25rem, 2vw, 2rem);
    width: 100%;
    box-sizing: border-box;
    
    /* Add these properties */
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    min-height: clamp(3rem, 6vw, 4.5rem);
    gap: clamp(0.65rem, 1.2vw, 1.1rem);
    overflow-x: hidden;
    overflow-y: visible;
  }

  /* --- ▼▼▼ CRITICAL FIX 3 ▼▼▼ --- */
  /* This container also needs to grow to fill its parent, the chat-page-wrapper. */
  .message-page-container.chat-layout {
    display: flex;
    flex-direction: column;
    gap: clamp(1.5rem, 2vw, 2.5rem);
    box-sizing: border-box;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  .chat-panel-wrapper {
    min-width: 0;
    width: 100%;
    contain: layout;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
  }

  .chat-actions-column {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 0 clamp(0.75rem, 2vw, 1.5rem) clamp(1.25rem, 2vw, 2rem);
    margin-top: clamp(0.75rem, 1.5vw, 1.75rem);
    width: 100%;
    box-sizing: border-box;
  }


  /* ==========================================================================
    3. Conversation Details & Info Panel
    ========================================================================== */

  .conversation-info-trigger {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 0 clamp(0.5rem, 1vw, 1.25rem);
    margin: 0 0 clamp(0.75rem, 1.5vw, 1.25rem);
    flex-shrink: 0;
    box-sizing: border-box;
    min-height: clamp(3.2rem, 7vw, 3.9rem);
    align-items: stretch;
    
  }

  .conversation-info-panel {
    position: fixed;
    inset: 0;
    background: rgba(16, 42, 77, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(2rem, 6vw, 3.5rem) 1.5rem;
    backdrop-filter: blur(4px);
    z-index: 2000;
    overflow-y: auto;
  }

  .conversation-info-panel[hidden] {
    display: none;
  }

  .conversation-info-panel.is-open .conversation-info-card {
    animation: slideDown 220ms ease;
  }

  .conversation-info-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(16, 42, 77, 0.18);
    width: min(520px, 92vw);
    border: 1px solid rgba(16, 42, 77, 0.05);
    max-height: min(80vh, 680px);
    min-height: min(320px, 70vh);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
  }

  .conversation-info-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid rgba(16, 42, 77, 0.06);
  }

  .conversation-info-card__header h3 {
    margin: 0;
    font-size: 1.15rem;
    color: #102a4d;
  }

  .conversation-info-card__body {
    padding: 1.25rem 1.75rem 1.75rem;
    overflow-y: auto;
  }

  .info-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
  }

  .info-table th,
  .info-table td {
    text-align: left;
    padding: 0.65rem 0;
    font-size: 0.95rem;
  }

  .info-table th {
    font-weight: 600;
    color: #102a4d;
    width: 40%;
  }

  .info-table tr+tr th,
  .info-table tr+tr td {
    border-top: 1px solid rgba(16, 42, 77, 0.08);
  }

  .info-close-btn {
    border: none;
    background: transparent;
    color: #0b172d;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 999px;
    transition: background 0.2s ease;
  }

  .info-close-btn:hover {
    background: rgba(16, 42, 77, 0.08);
  }

  /* Info Box Styles */
  .info-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.25rem;
  }

  .info-box h4 {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    color: #102a4d;
    font-weight: 600;
  }

  .info-box p {
    margin: 0;
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.5;
  }

  .info-box--mediator {
    background: #f0fdf4;
    border-color: #bbf7d0;
  }

  .info-box--mediator h4 {
    color: #166534;
  }

  .info-box--mediator p {
    color: #15803d;
  }

  .info-box--info {
    background: #eff6ff;
    border-color: #bfdbfe;
  }

  .info-box--info h4 {
    color: #1e40af;
  }

  .info-box--info p {
    color: #1d4ed8;
  }

  .info-box--disclaimer {
    background: #f8f9fa;
    border-color: #dee2e6;
  }

  .info-box--disclaimer h4 {
    color: #495057;
  }

  .info-box--disclaimer p {
    color: #6c757d;
    font-size: 0.9rem;
  }

  /* ==========================================================================
    4. Chat Panel & Message List
    ========================================================================== */

  .chat-panel {
    display: flex;
    flex-direction: column;
    background: #f7f9fc;
    border-radius: 20px;
    border: 1px solid rgba(16, 42, 77, 0.06);
    box-shadow: 0 14px 30px rgba(16, 42, 77, 0.08);
    overflow: hidden;
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    /* REMOVED fixed min-height and max-height to let flexbox control the size */
  }

  .chat-panel.mediator-chat-box {
    min-height: clamp(400px, 65vh, 680px);
  }

  .message-list-container {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: clamp(1rem, 2vw, 1.5rem);
    scroll-behavior: auto;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(247, 249, 252, 0.85) 70%, rgba(247, 249, 252, 1) 100%);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
  }

  .message-list-container.use-smooth-scroll {
    scroll-behavior: smooth;
  }

  .message-list-container:hover,
  .message-list-container:focus,
  .message-list-container:active,
  .message-list-container:focus-within {
    scrollbar-color: rgba(16, 42, 77, 0.35) rgba(16, 42, 77, 0.08);
  }

  .message-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-height: 100%;
  }

  .no-messages {
    text-align: center;
    color: rgba(16, 42, 77, 0.6);
    font-style: italic;
    padding: 2rem 0;
  }

  /* Scrollbar Styles */
  .message-list-container::-webkit-scrollbar {
    width: 8px;
    background: transparent;
  }

  .message-list-container::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 10px;
    transition: background 0.25s ease;
  }

  .message-list-container::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 10px;
    transition: background-color 0.25s ease;
  }

  .message-list-container:hover::-webkit-scrollbar-track,
  .message-list-container:focus-within::-webkit-scrollbar-track,
  .message-list-container:active::-webkit-scrollbar-track {
    background: rgba(16, 42, 77, 0.04);
  }

  .message-list-container:hover::-webkit-scrollbar-thumb,
  .message-list-container:focus-within::-webkit-scrollbar-thumb,
  .message-list-container:active::-webkit-scrollbar-thumb {
    background: rgba(16, 42, 77, 0.2);
  }

  .message-list-container:hover::-webkit-scrollbar-thumb:hover,
  .message-list-container:focus-within::-webkit-scrollbar-thumb:hover,
  .message-list-container:active::-webkit-scrollbar-thumb:hover {
    background: rgba(16, 42, 77, 0.3);
  }

  /* ==========================================================================
    5. Individual Chat Messages
    ========================================================================== */

  .chat-message {
    max-width: 76%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
  }

  .chat-message.sent {
    align-self: flex-end;
  }

  .chat-message.received {
    align-self: flex-start;
  }

  .message-bubble {
    padding: 0.75rem 1rem 0.65rem;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid rgba(16, 42, 77, 0.08);
    box-shadow: 0 10px 18px rgba(16, 42, 77, 0.08);
    color: #0b172d;
  }

  .message-meta {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
  }

  .message-author {
    font-weight: 600;
  }

  .message-role {
    background: rgba(255, 255, 255, 0.28);
    color: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.4);
  }

  .message-content {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.45;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
  }

  .message-timestamp {
    display: block;
    font-size: 0.7rem;
    margin-top: 0.5rem;
    color: rgba(16, 42, 77, 0.45);
    text-align: right;
  }

  /* Message Role Variants */
  .chat-message[data-sender-role="Tenant"] .message-bubble {
    background: linear-gradient(135deg, #0b5ed7 0%, #1a75ff 100%);
    color: #ffffff;
    border: none;
  }

  .chat-message[data-sender-role="Tenant"] .message-meta,
  .chat-message[data-sender-role="Tenant"] .message-author,
  .chat-message[data-sender-role="Tenant"] .message-content {
    color: rgba(255, 255, 255, 0.95);
  }

  .chat-message[data-sender-role="Tenant"] .message-timestamp {
    color: rgba(255, 255, 255, 0.8);
  }

  .chat-message[data-sender-role="Landlord"] .message-bubble {
    background: #ffffff;
    border: 1px solid rgba(16, 42, 77, 0.12);
    color: #0b172d;
  }

  .chat-message[data-sender-role="Landlord"] .message-role {
    background: rgba(16, 42, 77, 0.08);
    color: #102a4d;
    border: none;
  }

  .chat-message[data-sender-role="Mediator"] .message-bubble {
    background: linear-gradient(135deg, #0f9d58 0%, #34c07a 100%);
    color: #ffffff;
    border: none;
  }

  .chat-message[data-sender-role="Mediator"] .message-meta,
  .chat-message[data-sender-role="Mediator"] .message-author,
  .chat-message[data-sender-role="Mediator"] .message-content {
    color: rgba(255, 255, 255, 0.95);
  }

  .chat-message[data-sender-role="Mediator"] .message-timestamp {
    color: rgba(255, 255, 255, 0.8);
  }

  .chat-message.is-entering {
    animation: messageEnter 220ms ease-out;
  }


  /* ==========================================================================
    6. Message Attachments
    ========================================================================== */

  .message-attachments {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.65rem;
  }

  .message-attachment {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.6rem 0.75rem;
    border-radius: 12px;
    background: rgba(16, 42, 77, 0.05);
    border: 1px solid rgba(16, 42, 77, 0.08);
  }

  .attachment-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    background: rgba(16, 42, 77, 0.1);
    color: #0b5ed7;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
  }

  .attachment-body {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
  }

  .attachment-name {
    font-weight: 600;
    font-size: 0.95rem;
    word-break: break-word;
  }

  .attachment-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
  }

  .attachment-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #102a4d;
    font-weight: 600;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
  }

  .attachment-link:hover {
    text-decoration: underline;
  }

  .attachment-link--primary {
    color: #0f9d58;
  }

  .attachment-dot {
    color: rgba(16, 42, 77, 0.35);
  }

  /* Attachment Role Variants */
  .chat-message[data-sender-role="Tenant"] .message-attachment {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.35);
  }

  .chat-message[data-sender-role="Tenant"] .attachment-icon {
    background: rgba(255, 255, 255, 0.25);
    color: inherit;
  }

  .chat-message[data-sender-role="Tenant"] .attachment-dot {
    color: rgba(255, 255, 255, 0.7);
  }

  .chat-message[data-sender-role="Tenant"] .attachment-link {
    color: rgba(255, 255, 255, 0.95);
  }

  .chat-message[data-sender-role="Tenant"] .attachment-link--primary {
    color: #fffbe6;
  }

  .chat-message[data-sender-role="Mediator"] .message-attachment {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.42);
  }

  .chat-message[data-sender-role="Mediator"] .attachment-icon {
    background: rgba(255, 255, 255, 0.25);
    color: inherit;
  }

  .chat-message[data-sender-role="Mediator"] .attachment-dot {
    color: rgba(255, 255, 255, 0.7);
  }

  .chat-message[data-sender-role="Mediator"] .attachment-link {
    color: rgba(255, 255, 255, 0.95);
  }

  .chat-message[data-sender-role="Mediator"] .attachment-link--primary {
    color: #fffbe6;
  }


  /* ==========================================================================
    7. Message Composer
    ========================================================================== */

  .message-composer {
    padding: 0.5rem 1rem;
    border-top: 1px solid rgba(16, 42, 77, 0.08);
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .composer-field {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
  }

  .composer-input-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: clamp(2.75rem, 5vw, 3.4rem);
  }

  /* In Section 7 */
.message-textarea {
	width: 100%;
	height: 38px; /* Set a fixed initial height for one line of text */
	max-height: 160px; /* Set a max height (e.g., ~6-7 lines of text) */
	border-radius: 14px;
	border: 1px solid #c5d4ec;
	padding: 0.5rem 0.85rem; /* Adjusted for single line height */
	font-size: 1rem;
	line-height: 1.45;
	resize: none; /* Disable manual resize handle */
	box-shadow: inset 0 2px 6px rgba(16, 42, 77, 0.05);
	transition: border 0.2s ease, box-shadow 0.2s ease, height 0.15s ease;
	box-sizing: border-box;
	overflow-y: auto; /* Show scrollbar when max-height is reached */
}

  .message-textarea:focus {
    outline: none;
    border-color: #1a75ff;
    box-shadow: 0 0 0 4px rgba(26, 117, 255, 0.15);
  }

  .composer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
  }

  .composer-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 999px;
    padding: 0.5rem 1rem;
    border: 1px solid #c5d4ec;
    background: #f4f7fb;
    color: #102a4d;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
  }

  .composer-action:hover,
  .composer-action:focus {
    background: #e6eefb;
    transform: translateY(-1px);
  }

  .composer-action[aria-expanded="true"] {
    background: #1a75ff;
    color: #ffffff;
    border-color: #1a75ff;
  }

  .composer-attach-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border-radius: 14px;
    border: 1px solid #c5d4ec;
    background: #f4f7fb;
    color: #102a4d;
    font-weight: 600;
    padding: 0 clamp(0.85rem, 2vw, 1.1rem);
    min-width: 3rem;
    min-height: clamp(2.75rem, 5vw, 3.4rem);
    transition: background 0.2s ease, transform 0.2s ease;
    min-height: 38px;
  }

  .composer-attach-btn:hover,
  .composer-attach-btn:focus {
    background: #e6eefb;
    transform: translateY(-1px);
  }

  .composer-attach-label {
    display: inline-block;
    font-size: 0.85rem;
  }

  .send-msg-btn {
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, #0f9d58 0%, #34c07a 100%);
    color: #ffffff;
    padding: 0.35rem clamp(1.25rem, 2.4vw, 1.65rem);
    min-width: 120px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    min-height: 38px; /* Match the textarea height */
  }

  .send-msg-btn.is-ready {
    box-shadow: 0 12px 24px rgba(15, 157, 88, 0.2);
  }

  .send-msg-btn:hover,
  .send-msg-btn:focus {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(15, 157, 88, 0.25);
  }

  .send-msg-btn:disabled,
  .send-msg-btn[disabled] {
    background: linear-gradient(135deg, #c5d1e3 0%, #dce3ef 100%);
    color: rgba(16, 42, 77, 0.55);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    opacity: 0.95;
  }

  .send-msg-btn:disabled:hover,
  .send-msg-btn:disabled:focus {
    box-shadow: none;
    transform: none;
  }

  /* Composer Attachments Dropdown */
  .composer-attachments {
    background: #fff;
    border: 1px solid rgba(16, 42, 77, 0.08);
    border-radius: 16px;
    padding: 1rem;
    margin-top: 0.25rem;
    box-shadow: 0 16px 30px rgba(16, 42, 77, 0.12);
  }

  .composer-attachments[hidden] {
    display: none;
  }

  .file-dropdown-wrapper {
    margin-bottom: 0.85rem;
  }

  .file-label {
    font-weight: 600;
    color: #102a4d;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
    display: inline-block;
  }

  .custom-select-wrapper {
    position: relative;
  }

  .custom-select-wrapper select {
    width: 100%;
    padding: 0.65rem 2.5rem 0.65rem 0.85rem;
    border-radius: 10px;
    border: 1px solid #c5d4ec;
    font-size: 0.95rem;
    appearance: none;
    background: #f9fbff;
    color: #0b172d;
  }

  .custom-select-wrapper select:focus {
    outline: none;
    border-color: #1a75ff;
    box-shadow: 0 0 0 3px rgba(26, 117, 255, 0.15);
  }

  .custom-select-wrapper .arrow.down {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 8px;
    height: 8px;
    border: solid #4c5d7a;
    border-width: 0 2px 2px 0;
    pointer-events: none;
  }

  .composer-attachment-links {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
  }


  /* ==========================================================================
    8. CTAs, Action Buttons & Cards
    ========================================================================== */

  .conversation-cta,
  .conversation-action {
    display: flex; /* Changed from inline-flex */
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    width: 100%;
    border-radius: 20px;
    padding: clamp(0.85rem, 1vw + 0.5rem, 1.25rem) clamp(1.1rem, 2vw, 1.6rem);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    box-shadow: 0 8px 16px rgba(16, 42, 77, 0.08);
    background: #ffffff;
    color: #0f2142;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
  }

  .conversation-cta:hover,
  .conversation-cta:focus,
  .conversation-action:hover,
  .conversation-action:focus {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(16, 42, 77, 0.18);
  }

  .conversation-cta__icon {
    font-size: 1.15rem;
    display: inline-flex;
    align-items: center;
  }

  .conversation-cta__label {
    flex: 1 1 auto;
    text-align: left;
  }

  .conversation-cta__chevron {
    font-size: 0.85rem;
    opacity: 0.65;
  }

  /* Button Variants */
  .conversation-cta--info {
    background: linear-gradient(135deg, #ffffff 0%, #eaf2ff 100%);
    border-color: rgba(16, 42, 77, 0.12);
  }

  .conversation-cta--primary,
  .conversation-action--primary {
    background: linear-gradient(135deg, #1a75ff 0%, #4b90ff 100%);
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(16, 42, 77, 0.12);
  }

  .conversation-cta--danger,
  .conversation-action--danger {
    background: linear-gradient(135deg, #c62828 0%, #f44336 100%);
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(16, 42, 77, 0.12);
  }

  .conversation-cta--ghost,
  .conversation-action--ghost {
    background: rgba(16, 42, 77, 0.06);
    color: #0f2142;
    border-color: rgba(16, 42, 77, 0.18);
    box-shadow: none;
  }

  .conversation-cta--ghost:hover,
  .conversation-action--ghost:hover {
    background: rgba(16, 42, 77, 0.1);
    transform: translateY(-1px);
  }

  .conversation-cta.is-disabled,
  .conversation-cta[disabled],
  .conversation-action.is-disabled,
  .conversation-action[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    pointer-events: none;
  }

  /* Action containers */
  .conversation-actions {
    display: flex;
    flex-direction: column;
    gap: clamp(1rem, 1.5vw, 1.5rem);
    width: 100%;
    max-width: none;
    margin: 0;
    box-sizing: border-box;
    align-items: stretch;
  }

  .conversation-actions__button-stack {
    display: flex;
    flex-direction: column;
    gap: clamp(0.65rem, 1.5vw, 1.25rem);
  }

  /* Chat Disclaimer */
  .chat-disclaimer {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-top: 1rem;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #495057;
  }

  .chat-disclaimer p {
    margin: 0.5rem 0;
  }

  .chat-disclaimer p:first-child {
    margin-top: 0;
  }

  .chat-disclaimer p:last-child {
    margin-bottom: 0;
  }

  .chat-disclaimer-modal.is-open .conversation-modal__content {
    animation: slideDown 350ms cubic-bezier(0.4, 0, 0.2, 1);
  }

  .conversation-actions__footer {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
  }

  .conversation-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), #f4f7fb 100%);
    border-radius: 22px;
    border: 1px solid rgba(16, 42, 77, 0.08);
    box-shadow: 0 18px 36px rgba(16, 42, 77, 0.12);
    padding: clamp(1rem, 1.5vw, 1.5rem);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-width: 0;
  }
  @media (max-width: 900px) {
    .chat-layout {
      grid-template-columns: 1fr;
    }

    .chat-actions-column {
      position: static;
      top: auto;
      width: 100%;
      margin-top: clamp(1.25rem, 3vw, 2rem);
    }
  }

  @media (max-width: 520px) {
    .conversation-card {
      padding: clamp(0.85rem, 4vw, 1.1rem);
      border-radius: 18px;
      gap: 0.75rem;
    }

    .conversation-status {
      flex-wrap: wrap;
      gap: 0.5rem;
      font-size: 0.9rem;
    }

    .mediator-card__header {
      align-items: flex-start;
    }

    .mediator-card__icon {
      border-radius: 12px;
    }
  }

  .conversation-card--mediator {
    background: linear-gradient(135deg, rgba(223, 249, 237, 0.95), rgba(207, 244, 227, 0.98));
    border-color: rgba(15, 157, 88, 0.32);
    color: #0b2f1d;
    gap: 0.5rem;
  }

  .conversation-card--mediator .conversation-status--success {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(210, 244, 226, 0.85));
    color: #0b2f1d;
  }

  .conversation-card--mediator .conversation-card__details {
    padding: 0.35rem 0 0;
  }

  .mediator-inline-details {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
    color: rgba(11, 47, 29, 0.95);
    font-size: 0.98rem;
  }

  .mediator-inline-details__label {
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.72rem;
    color: rgba(11, 47, 29, 0.65);
  }

  .mediator-inline-details__value {
    overflow-wrap: anywhere;
  }

  .conversation-card--warning {
    background: linear-gradient(135deg, #fff7e8 0%, #ffe9cd 100%);
  }

  .conversation-card__details {
    display: block;
    padding-top: 0.25rem;
  }

  @media (max-width: 640px) {
    .mediator-inline-details {
      flex-wrap: wrap;
      gap: 0.25rem;
    }
  }

  .conversation-action__icon {
    font-size: 1.1rem;
  }

  /* Other Links & Buttons */
  .chatview-link {
    color: #102a4d;
    font-weight: 600;
    text-decoration: none;
  }

  .chatview-link:hover {
    text-decoration: underline;
  }

  .sign-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    background: #0b5ed7;
    color: #fff;
    border: none;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-top: 0.6rem;
  }

  .sign-btn:hover {
    background: #094fb3;
  }

  /* ==========================================================================
    9. Status & Alerts
    ========================================================================== */

  .conversation-status {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: rgba(16, 42, 77, 0.08);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    font-weight: 600;
    color: #0f2142;
  }

  .conversation-status i {
    font-size: 1.05rem;
  }

  .conversation-status--info {
    background: linear-gradient(135deg, rgba(26, 117, 255, 0.18), rgba(75, 144, 255, 0.25));
  }

  .conversation-status--success {
    background: linear-gradient(135deg, rgba(15, 157, 88, 0.18), rgba(52, 192, 122, 0.24));
  }

  .conversation-status--warning {
    background: linear-gradient(135deg, rgba(255, 179, 0, 0.22), rgba(255, 214, 102, 0.32));
  }

  .conversation-alert {
    margin-top: 0.5rem;
    background: rgba(255, 255, 255, 0.65);
    border-radius: 16px;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(16, 42, 77, 0.12);
  }

  .conversation-alert h3 {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    color: #0f2142;
  }

  .conversation-link {
    color: #1a75ff;
    font-weight: 600;
    text-decoration: underline;
  }

  /* ==========================================================================
    10. Modals & Overlays
    ========================================================================== */

  .conversation-modal {
    position: fixed;
    inset: 0;
    background: rgba(16, 42, 77, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 2500;
    backdrop-filter: blur(3px);
  }

  .conversation-modal[hidden] {
    display: none;
  }

  .conversation-modal__content {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 24px 48px rgba(16, 42, 77, 0.2);
    width: min(480px, 92vw);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
  }

  .conversation-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .conversation-modal__header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #102a4d;
  }

  .conversation-modal__close {
    border: none;
    background: transparent;
    color: #0b172d;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 999px;
    transition: background 0.2s ease;
  }

  .conversation-modal__close:hover {
    background: rgba(16, 42, 77, 0.08);
  }

  .conversation-modal__body {
    font-size: 0.95rem;
    color: #0b172d;
    line-height: 1.5;
  }

  .conversation-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
  }

  .conversation-modal__actions .conversation-cta,
  .conversation-modal__actions .conversation-action {
    width: auto;
    min-width: 140px;
    justify-content: center;
  }

  /* Document Preview Overlay */
  .document-preview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(16, 42, 77, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.25rem, 5vw, 3rem);
    backdrop-filter: blur(4px);
    z-index: 3000;
  }

  .document-preview-overlay[hidden] {
    display: none;
  }

  .document-preview-overlay.is-open .document-preview-dialog {
    animation: fadeIn 180ms ease;
  }

  .document-preview-dialog {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 24px 48px rgba(16, 42, 77, 0.25);
    width: min(1040px, 96vw);
    height: min(90vh, 960px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .document-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(16, 42, 77, 0.08);
  }

  .document-preview-title {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: #102a4d;
  }

  .document-preview-title i {
    font-size: 1.25rem;
    color: #0b5ed7;
  }

  .document-preview-close {
    border: none;
    background: transparent;
    color: #0b172d;
    font-size: 1.35rem;
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 999px;
    transition: background 0.2s ease;
  }

  .document-preview-close:hover,
  .document-preview-close:focus {
    background: rgba(16, 42, 77, 0.1);
  }

  .document-preview-body {
    flex: 1 1 auto;
    display: flex;
    background: rgba(16, 42, 77, 0.04);
    padding: 0.75rem;
  }

  .document-preview-body iframe {
    flex: 1 1 auto;
    height: 100%;
    border: none;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: inset 0 0 0 1px rgba(16, 42, 77, 0.08);
  }

  /* ==========================================================================
    11. Accessibility & Animations
    ========================================================================== */

  .composer-action:focus-visible,
  .conversation-action:focus-visible,
  .info-toggle-btn:focus-visible,
  .send-msg-btn:focus-visible,
  button:focus-visible {
    outline: 3px solid #1a75ff;
    outline-offset: 2px;
  }

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

  @keyframes fadeIn {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes messageEnter {
    from {
      opacity: 0;
      transform: translateY(18px) scale(0.98);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }


  /* ==========================================================================
    12. Responsive Adjustments
    ========================================================================== */

  /* Extra Large Desktops - No changes needed here, wrapper handles it */
  @media (min-width: 1400px) {
    /* All max-width rules were removed from here */
  }

  /* Standard Desktops & Laptops */
  @media (min-width: 1101px) {
    .message-page-container.chat-layout {
      flex-direction: row;
      align-items: stretch;
      gap: clamp(0.9rem, 1.4vw, 1.6rem);
      max-width: calc(900px + clamp(220px, 18vw, 260px) + clamp(1.5rem, 2vw, 2.5rem));
      width: 100%;
      margin: 0 auto;
      max-height: 950px;
    }

    .chat-panel-wrapper {
      flex: 1 1 0;
      min-width: 0;
      max-width: 900px;
    }

    .chat-actions-column {
      flex: 0 0 clamp(220px, 18vw, 260px);
      padding: clamp(0.5rem, 1vw, 1.25rem) 0 clamp(1.75rem, 2.5vw, 3rem);
      margin-top: 0;
      align-self: flex-start;
    }

    .conversation-info-trigger {
      max-width: calc(900px + clamp(220px, 18vw, 260px) + clamp(1.5rem, 2vw, 2.5rem));
      width: 100%;
      margin: 0 auto clamp(0.6rem, 1.3vw, 1.1rem);
      padding-left: clamp(0.75rem, 1.4vw, 1.5rem);
      padding-right: clamp(0.75rem, 1.4vw, 1.5rem);
      
    }

    .mediation-container.chat-page {
      max-height: 90vh;
    }
  }

  /* Tablets & Small Desktops */
  @media (max-width: 1100px) {
    .message-page-container.chat-layout {
      /* max-width rule removed from here */
      flex-direction: column;
      gap: clamp(0.6rem, 1.2vw, 1.1rem);
      flex: 1 1 auto;
      min-height: 0;
      width: 100%;
      max-height: 100%;
      overflow: hidden;
    }

    .chat-panel-wrapper {
      width: 100%;
      max-width: 100%;
      padding: 0 clamp(0.75rem, 2vw, 1.25rem);
      box-sizing: border-box;
      display: flex;
      flex-direction: column;
      flex: 1 1 auto;
      min-height: 0;
      max-height: 100%;
      overflow: hidden;
    }

    .chat-actions-column {
      width: 100%;
      padding: 0 clamp(0.75rem, 2vw, 1.25rem) clamp(1.25rem, 2vw, 2rem);
      margin-top: clamp(0.25rem, 0.8vw, 0.6rem);
      order: 2;
      align-items: stretch;
      background: transparent;
      flex: 0 0 auto;
    }

    .chat-actions-column .conversation-actions {
      gap: clamp(0.35rem, 1vw, 0.6rem);
    }

    .chat-actions-column .conversation-actions__button-stack {
      gap: clamp(0.35rem, 1vw, 0.6rem);
    }

    .chat-actions-column .conversation-banner {
      margin: clamp(0.2rem, 0.6vw, 0.4rem) 0 clamp(0.25rem, 0.7vw, 0.45rem);
    }

    .conversation-info-trigger {
      margin: 0 0 clamp(0.4rem, 0.8vw, 0.6rem);
    }

    .message-textarea {
      scrollbar-width: none;
    }

    .message-textarea::-webkit-scrollbar {
      display: none;
    }

    .chat-page-wrapper {
      padding: 0 clamp(0.75rem, 2vw, 1.75rem) clamp(1rem, 2vw, 1.75rem);
      max-width: 100%;
      flex: 1 1 auto;
      min-height: 0;
      max-height: 100%;
    }

    .mediation-container.chat-page {
      padding: 0 clamp(0.75rem, 2vw, 1.75rem) clamp(1rem, 2vw, 1.75rem);
      max-width: 100%;
      overflow-x: hidden;
      height: 94vh;
      height: 94dvh;
      max-height: 94vh;
      max-height: 94dvh;
    }

    .mediation-container.chat-page h1 {
      padding: 0 clamp(0.75rem, 2vw, 1.5rem);
      font-size: clamp(1.4rem, 2vw, 1.75rem);
      margin-bottom: 0.35rem;
    }

    .mediation-container.chat-page p {
      font-size: 1rem;
      margin-bottom: 0.5rem;
    }

    .chat-panel {
      border-radius: 18px;
      max-width: 100%;
      min-height: 0;
      height: auto;
      max-height: 100%;
      box-shadow: 0 16px 32px rgba(16, 42, 77, 0.12);
    }

    .message-list-container {
      padding: clamp(0.9rem, 2vw, 1.25rem);
      overflow-x: hidden;
    }

    .message-list {
      max-width: 100%;
    }

    .chat-message {
      max-width: 84%;
      word-break: break-word;
    }

    .message-bubble {
      padding: 0.7rem 0.95rem 0.65rem;
      font-size: 0.95rem;
    }

    .message-composer,
    .composer-input-row {
      max-width: 100%;
      box-sizing: border-box;
    }

    .composer-input-row {
      gap: clamp(0.5rem, 1.5vw, 0.85rem);
    }

    .composer-attach-btn {
      min-height: clamp(3rem, 7vw, 3.75rem);
      padding: 0 0.85rem;
    }

    .message-textarea {
      min-height: clamp(3rem, 8vw, 4.2rem);
      font-size: 1rem;
    }

    .send-msg-btn {
      min-height: clamp(3rem, 8vw, 4.2rem);
      padding: clamp(0.5rem, 1.5vw, 0.75rem) clamp(1.25rem, 3vw, 1.75rem);
      font-size: 1rem;
    }

    .conversation-actions,
    .conversation-actions__button-stack {
      gap: clamp(0.6rem, 1.8vw, 0.9rem);
    }

    .conversation-card {
      border-radius: 18px;
      padding: clamp(0.85rem, 2vw, 1.1rem);
      box-shadow: 0 14px 32px rgba(16, 42, 77, 0.14);
    }

    .conversation-cta,
    .conversation-action {
      border-radius: 16px;
      padding: clamp(0.75rem, 2vw, 1rem) clamp(0.9rem, 2vw, 1.1rem);
      font-size: 1rem;
    }

    .conversation-cta__label {
      font-size: 1rem;
    }

    .conversation-info-card {
      width: min(640px, 94vw);
      border-radius: 20px;
    }

    .conversation-info-card__header {
      padding: 1rem 1.5rem 0.9rem;
    }

    .conversation-info-card__body {
      padding: 1rem 1.5rem 1.35rem;
    }

    .document-preview-dialog {
      width: min(760px, 94vw);
      height: min(88vh, 820px);
    }

    .document-preview-body iframe {
      min-height: 65vh;
    }

    .info-toggle-btn {
      min-height: 46px;
      font-size: 0.95rem;
      padding: 0.6rem 1.1rem;
    }

    .chat-panel-wrapper {
      order: 1;
    }
  }

  /* Tablet sizes (768-1024px) - constrain width to prevent full-screen stretch */
  @media (min-width: 768px) and (max-width: 1024px) {
    .message-page-container.chat-layout {
      max-width: 850px;
      margin: 0 auto;
    }

    .conversation-info-trigger {
      max-width: 850px;
      margin: 0 auto clamp(0.6rem, 1.3vw, 1.1rem);
    }

    .chat-page-wrapper {
      max-width: 850px;
      margin: 0 auto;
    }
  }

  /* Mobile and Tablet Devices (Portrait) */
  @media (max-width: 1024px) {
    /* Adding responsive padding to the master wrapper */
    .chat-page-wrapper {
      padding: 0;
      max-width: 100vw;
      overflow-x: hidden;
      flex: 1 1 auto;
      min-height: 0;
      display: flex;
      flex-direction: column;
    }
    
    .mediation-container.chat-page {
      padding: 0 12px 0.5rem;
      max-width: 100vw;
      overflow-x: hidden;
      height: 94vh;
      height: 94dvh;
    }

    .mediation-container.chat-page h1 {
      font-size: 1.5rem;
      padding: 0;
      flex: 0 0 auto;
      margin-bottom: 0.25rem;
    }

    .mediation-container.chat-page p {
      margin-bottom: 0.5rem;
      font-size: 0.95rem;
      flex: 0 0 auto;
    }

    .conversation-info-trigger {
      padding: 0;
      margin-bottom: 0.65rem;
    }

    .message-page-container.chat-layout {
      gap: 0.5rem;
      max-width: 100%;
      overflow-x: hidden;
      padding-bottom: 0.5rem;
      flex: 1 1 auto;
      min-height: 0;
      display: flex;
      flex-direction: column;
      height: 100%;
    }

    .chat-panel-wrapper {
      max-width: 100%;
      overflow-x: hidden;
      padding: 0;
      box-sizing: border-box;
      flex: 1 1 auto;
      min-height: 0;
      display: flex;
      flex-direction: column;
    }

    .chat-panel {
      border-radius: 16px;
      max-width: 100%;
      overflow-x: hidden;
      /* Resetting height constraints for mobile to let flexbox work */
      min-height: 0;
      height: auto !important;
      max-height: none !important;
      flex: 1 1 auto;
    }

    .message-list-container {
      padding: 0.85rem 0.75rem 1rem;
      overflow-x: hidden;
    }

    .message-list {
      max-width: 100%;
    }

    .chat-message {
      max-width: 88%;
      overflow-wrap: break-word;
      word-break: break-word;
    }

    .message-bubble {
      padding: 0.65rem 0.85rem 0.6rem;
      font-size: 0.9rem;
      max-width: 100%;
      box-sizing: border-box;
    }

    .composer-input-row {
      gap: 0.5rem;
    }

    .composer-attach-btn {
      padding: 0 0.75rem;
      min-width: 2.5rem;
      min-height: clamp(3rem, 12vw, 4.5rem);
    }

    .composer-attach-label {
      display: none;
    }

    .message-textarea {
      min-height: clamp(3rem, 14vw, 4.6rem);
      font-size: 0.95rem;
      max-width: 100%;
      box-sizing: border-box;
    }

    .send-msg-btn {
      padding: clamp(0.4rem, 2vw, 0.6rem) clamp(1.25rem, 4vw, 1.75rem);
      min-width: 100px;
      font-size: 0.95rem;
      flex-shrink: 0;
      min-height: clamp(3rem, 12vw, 4.5rem);
      line-height: 1;
    }

    .message-composer {
      max-width: 100%;
      box-sizing: border-box;
    }

    .composer-input-row {
      max-width: 100%;
      box-sizing: border-box;
    }

    .chat-panel-wrapper {
      order: 1;
    }

    .chat-actions-column {
      order: 2;
      padding: 0;
      margin-top: 0;
      width: 100%;
      align-items: stretch;
      background: transparent;
      flex: 0 0 auto;
    }

    .conversation-actions {
      gap: 0.65rem;
    }

    .conversation-actions__button-stack {
      gap: 0.65rem;
    }

    .conversation-card {
      border-radius: 18px;
      box-shadow: 0 12px 28px rgba(16, 42, 77, 0.16);
      padding: 0.8rem;
    }

    .conversation-cta,
    .conversation-action {
      padding: 0.8rem 0.9rem;
      font-size: 0.95rem;
      border-radius: 16px;
    }

    .conversation-cta__label {
      font-size: 0.95rem;
    }

    .conversation-info-card {
      width: min(540px, 96vw);
      border-radius: 18px;
    }

    .conversation-info-card__header {
      padding: 1rem 1.25rem 0.85rem;
    }

    .conversation-info-card__body {
      padding: 1rem 1.25rem 1.25rem;
    }

    .document-preview-dialog {
      width: min(540px, 94vw);
      height: min(88vh, 720px);
    }

    .document-preview-body iframe {
      min-height: 60vh;
    }

    .info-toggle-btn {
      padding: 0.55rem 1rem;
      font-size: 0.9rem;
      min-height: 44px;
    }

    .composer-toolbar {
      gap: 0.5rem;
    }

    .chat-actions-column .conversation-actions {
      width: 100%;
      max-width: 100%;
      margin: 0;
      padding: 0;
      background: transparent;
      border: none;
      border-radius: 0;
      box-shadow: none;
      box-sizing: border-box;
      gap: clamp(0.85rem, 3vw, 1.25rem);
    }

    .chat-actions-column .conversation-card {
      border-radius: clamp(16px, 4vw, 20px);
      box-shadow: 0 12px 28px rgba(16, 42, 77, 0.12);
    }

    .chat-actions-column .conversation-actions__button-stack {
      gap: clamp(0.6rem, 3vw, 0.9rem);
    }

    .chat-actions-column .conversation-cta,
    .chat-actions-column .conversation-action {
      max-width: 100%;
    }

    .mediation-container h1 {
      padding: 0 clamp(0.75rem, 3vw, 1.35rem);
    }
  }

  /* Mobile Devices (Landscape) */
  @media (max-width: 768px) and (max-height: 500px) and (orientation: landscape) {
    .chat-panel {
      min-height: 50vh;
      max-height: 80vh;
    }

    .message-list-container {
      max-height: 50vh; /* This might need adjustment delete */
      padding: 0.75rem;
    }

    .message-composer {
      padding: 0.75rem;
    }

    .message-textarea {
      min-height: clamp(2.75rem, 10vw, 3.75rem);
    }

    .conversation-actions__card {
      padding: 0.85rem 1rem;
    }

    .conversation-info-panel {
      padding: 1rem;
    }
  }

  /* Small Mobile Devices */
  @media (max-width: 540px) {
    .conversation-info-panel {
      align-items: center;
      padding: 1.25rem 0.5rem;
    }

    .conversation-info-card {
      border-radius: 16px;
      max-height: 88vh;
      width: 98vw;
      max-width: 98vw;
    }

    .conversation-info-card__header {
      padding: 0.9rem 1rem 0.75rem;
    }

    .conversation-info-card__header h3 {
      font-size: 1rem;
    }

    .conversation-info-card__body {
      padding: 0.9rem 1rem 1rem;
    }

    .chat-message {
      max-width: 92%;
    }

    .message-bubble {
      border-radius: 14px;
      padding: 0.6rem 0.8rem 0.55rem;
    }

    .message-meta {
      font-size: 0.8rem;
      gap: 0.4rem;
    }

    .message-content {
      font-size: 0.9rem;
    }

    .message-timestamp {
      font-size: 0.7rem;
    }

    .message-attachment {
      flex-direction: column;
      align-items: stretch;
      padding: 0.5rem 0.65rem;
    }

    .attachment-icon {
      font-size: 1.25rem;
    }

    .attachment-name {
      font-size: 0.85rem;
    }

    .attachment-actions {
      gap: 0.35rem;
      font-size: 0.8rem;
    }

    .composer-input-row {
      gap: 0.4rem;
    }

    .composer-attach-btn {
      padding: 0 0.6rem;
      min-width: 2.25rem;
      min-height: 2.75rem;
    }

    .composer-attach-btn i {
      font-size: 0.9rem;
    }

    .message-textarea {
      min-height: 2.75rem;
      padding: 0.7rem 0.85rem;
      font-size: 0.9rem;
    }

    .send-msg-btn {
      padding: 0.35rem 1rem;
      min-width: 85px;
      font-size: 0.9rem;
      min-height: 2.75rem;
      line-height: 1;
    }

    .message-composer {
      padding: 0.85rem;
    }

    .chat-panel {
      /* Resetting height constraints for mobile to let flexbox work */
      min-height: 0;
      height: auto !important;
      max-height: none !important;
      border-radius: 14px;
      flex: 1 1 auto;
    }

    .chat-panel-wrapper {
      flex: 1 1 auto;
    }

    .message-list-container {
      padding: 0.75rem 0.6rem 0.85rem;
       /* This might need adjustment */
    }

    .conversation-actions__card {
      padding: 1rem;
    }

    .conversation-action {
      padding: 0.7rem 1.1rem;
      font-size: 0.88rem;
      min-height: 44px;
      gap: 0.5rem;
    }

    .conversation-action__icon {
      font-size: 1rem;
    }

    .conversation-actions__footer {
      margin-top: 1rem;
    }

    .conversation-status {
      padding: 0.65rem 0.85rem;
      font-size: 0.85rem;
    }

    .conversation-alert {
      padding: 0.8rem 0.9rem;
    }

    .conversation-alert h3 {
      font-size: 0.95rem;
    }

    .conversation-modal__content {
      padding: 1.25rem;
      width: min(440px, 96vw);
    }

    .conversation-modal__header h3 {
      font-size: 1.05rem;
    }

    .conversation-modal__body {
      font-size: 0.88rem;
    }

    .conversation-modal__actions {
      gap: 0.6rem;
    }

    .document-preview-dialog {
      width: min(460px, 96vw);
      height: min(84vh, 600px);
      border-radius: 16px;
    }

    .document-preview-header {
      padding: 0.85rem 1rem;
    }

    .document-preview-title h3 {
      font-size: 0.95rem;
    }

    .conversation-banner {
      font-size: 0.85rem;
      padding: 0.75rem 1rem;
      margin-bottom: clamp(0.6rem, 3vw, 0.9rem);
    }

    .conversation-info-trigger {
      margin-top: 0.15rem;
    }
  }

  /* Very Small Mobile Devices */
  @media (max-width: 480px) {
    .chat-page-wrapper {
      padding: 0 0.35rem;
    }

    .conversation-info-trigger {
      /* padding rule removed, margin-bottom is all it needs */
      margin-bottom: 0.65rem;
    }

    .conversation-cta,
    .conversation-action {
      flex-wrap: nowrap;
      gap: 0.65rem;
      padding: 0.75rem 0.85rem;
    }

    .conversation-cta__icon {
      font-size: 1rem;
      flex-shrink: 0;
    }

    .conversation-cta__label {
      flex: 1 1 auto;
      text-align: left;
      font-size: 0.9rem;
    }

    .conversation-cta__chevron {
      flex-shrink: 0;
    }
  }

    .conversation-banner {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      padding: 0.7rem 1.1rem;
      border-radius: 12px;
      font-size: 0.95rem;
      line-height: 1.4;
      font-weight: 500;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
      margin: clamp(0.4rem, 1vw, 0.6rem) 0 clamp(0.5rem, 1.2vw, 0.75rem);
    }

  .conversation-banner--success {
    background: linear-gradient(135deg, #e6fcf5, #d1fae5);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #065f46;
  }

  .conversation-banner i {
    font-size: 1.1rem;
    color: #059669;
  }

  /* Mobile overrides for conversation banner - Must be after base styles */
  @media (max-width: 540px) {
    .conversation-banner {
      font-size: 0.8rem;
      padding: 0.55rem 0.75rem;
      margin: 0.3rem 0 0.4rem;
      gap: 0.5rem;
      line-height: 1.35;
    }

    .conversation-banner i {
      font-size: 0.95rem;
    }
  }
