@import url("../css-template.css");

:root {
    --own-bubble: #3d3c39;
    --other-bubble: #3a2520;
    --app-height: 100dvh;
    --radius: 12px;
    --composer-surface: linear-gradient(180deg, rgba(27,27,27,0.96), rgba(20,20,20,0.98));
    --composer-rail: rgba(255,255,255,0.045);
    --composer-border: rgba(255,255,255,0.06);
}

/* ── Chat container ── */
html, body { height: 100%; overscroll-behavior-y: none; }
body.chat-page {
    min-height: var(--app-height);
    height: var(--app-height);
    overflow: hidden;
}
main { padding-top: 56px; height: var(--app-height); display: flex; overflow: hidden; }
.chat-container { flex: 1; display: flex; flex-direction: column; height: calc(var(--app-height) - 56px); min-height: 0; width: 100%; overflow: hidden; position: relative; }

/* ── Chat header ── */
.chat-header { padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); background: var(--surface); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.chat-header-left { display: flex; align-items: center; gap: 0.75rem; min-width: 0; flex: 1; }
.chat-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; color: white; flex-shrink: 0; overflow: hidden; }
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-header h2 { font-size: 1rem; font-weight: 600; }
.chat-status { font-size: 0.75rem; color: var(--text-muted); }
.chat-menu-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.5rem; cursor: pointer; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: var(--radius); transition: all 0.15s; }
.chat-menu-toggle:hover { background: var(--surface-2); }
.chat-header .notification-bell { margin-left: auto; flex-shrink: 0; }

.chat-scroll-bottom-btn {
    position: absolute;
    right: 1rem;
    bottom: calc(var(--chat-composer-height, 5rem) + 0.75rem + env(safe-area-inset-bottom, 0px));
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 999px;
    background: rgba(26,26,26,0.92);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(0,0,0,0.28);
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease, background 0.15s ease;
    z-index: 4;
}

.chat-scroll-bottom-btn.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.chat-scroll-bottom-btn:hover {
    background: rgba(36,36,36,0.96);
}

/* ── Messages area ── */
.chat-messages { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; padding: 1rem 1.5rem; display: flex; flex-direction: column; gap: 0.25rem; overscroll-behavior-y: contain; }
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: var(--radius); }
.chat-loading { text-align: center; color: var(--text-muted); padding: 2rem; font-size: 0.85rem; }
.chat-empty { text-align: center; color: var(--text-muted); padding: 3rem 1rem; }
.chat-empty i { font-size: 2.5rem; margin-bottom: 0.5rem; display: block; }

/* ── Load more ── */
.chat-load-more { text-align: center; padding: 0.5rem; }
.chat-load-more button { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); padding: 0.35rem 1rem; border-radius: var(--radius); font-size: 0.75rem; cursor: pointer; font-family: inherit; }
.chat-load-more button:hover { background: var(--surface-3); color: var(--text); }

/* ── Date separator ── */
.chat-date-sep { text-align: center; padding: 0.75rem 0; font-size: 0.7rem; color: var(--text-muted); letter-spacing: 0.03em; }
.chat-date-sep span { background: var(--surface-2); padding: 0.25rem 0.75rem; border-radius: var(--radius); }

/* ── Message bubble ── */
.msg { display: flex; flex-direction: column; max-width: min(76%, 860px); margin-bottom: 2px; }
.msg.own { align-self: flex-end; }
.msg.other { align-self: flex-start; }
.msg-bubble { padding: 0.5rem 0.75rem; border-radius: var(--radius); font-size: 0.875rem; line-height: 1.5; word-wrap: break-word; overflow-wrap: break-word; }
.msg.own .msg-bubble { background: var(--own-bubble); border-bottom-right-radius: var(--radius); }
.msg.other .msg-bubble { background: var(--other-bubble); border-bottom-left-radius: var(--radius); }
.msg-text { white-space: pre-wrap; }
.msg-time { font-size: 0.65rem; color: var(--text-muted); margin-top: 2px; padding: 0 4px; display: flex; align-items: center; gap: 4px; }
.msg.own .msg-time { justify-content: flex-end; }
.msg-read { color: var(--green); font-size: 0.75rem; }
.msg-pending .msg-bubble { opacity: 0.78; }
.msg-pending .msg-time { opacity: 0.75; }
.msg-pending-indicator { color: var(--text-muted); display: inline-flex; align-items: center; }

/* ── Spacing between groups ── */
.msg-gap { margin-top: 0.75rem; }

/* ── File attachment in message ── */
.msg-file { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem; border-radius: var(--radius); background: rgba(255,255,255,0.04); margin-bottom: 0.25rem; cursor: pointer; transition: background 0.15s; text-decoration: none; color: inherit; min-width: 200px; }
.msg-file:hover { background: rgba(255,255,255,0.08); }
.msg-file-icon { width: 42px; height: 42px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.msg-file-icon.img { background: #1e3a5f; color: #64b5f6; }
.msg-file-icon.video { background: #3a1e5f; color: #ba68c8; }
.msg-file-icon.audio { background: #5f1e3a; color: #ef5350; }
.msg-file-icon.pdf { background: #5f1e1e; color: #ef5350; }
.msg-file-icon.doc { background: #1e3a5f; color: #42a5f5; }
.msg-file-icon.sheet { background: #1e5f3a; color: #66bb6a; }
.msg-file-icon.code { background: #2d4a3a; color: #66bb6a; }
.msg-file-icon.archive { background: #5f4a1e; color: #ffa726; }
.msg-file-icon.generic { background: var(--surface-3); color: var(--text-muted); }
.msg-file-info { min-width: 0; flex: 1; }
.msg-file-name { font-size: 0.8rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-file-meta { font-size: 0.68rem; color: var(--text-muted); display: flex; gap: 0.5rem; }

/* ── Inline image preview ── */
.msg-img-wrap { position: relative; display: inline-block; margin-bottom: 0.25rem; }
.msg-img-preview { width: min(360px, 100%); max-width: 360px; max-height: 360px; border-radius: var(--radius); cursor: pointer; display: block; object-fit: contain; background: #111; }
.msg-img-preview:hover { opacity: 0.9; }

/* ── Inline video preview ── */
.msg-video-wrap { position: relative; display: inline-block; margin-bottom: 0.25rem; }
.msg-video-preview { width: min(400px, 100%); max-width: 400px; max-height: 360px; border-radius: var(--radius); display: block; background: #111; }

/* ── Upload preview strip ── */
.chat-upload-preview { padding: 0.5rem 1rem; background: var(--surface); border-top: 1px solid var(--border); display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.upload-preview-inner { flex: 1; display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.upload-preview-inner img { width: 48px; height: 48px; border-radius: var(--radius); object-fit: cover; }
.upload-preview-inner .upload-file-icon { width: 48px; height: 48px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; background: var(--surface-3); color: var(--text-muted); }
.upload-preview-inner .upload-file-info { min-width: 0; }
.upload-preview-inner .upload-file-name { font-size: 0.8rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.upload-preview-inner .upload-file-size { font-size: 0.7rem; color: var(--text-muted); }
.upload-preview-clear { background: none; border: none; color: var(--text-muted); font-size: 1.3rem; cursor: pointer; padding: 0.2rem; border-radius: var(--radius); }
.upload-preview-clear:hover { color: var(--text); background: var(--surface-2); }
.upload-size-warn { color: #ef5350; font-weight: 500; }

/* ── Input bar ── */
.chat-input-bar { padding: 0.85rem 1rem; padding-bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px)); background: var(--composer-surface); border-top: 1px solid rgba(255,255,255,0.05); box-shadow: inset 0 1px 0 rgba(255,255,255,0.025); display: flex; align-items: flex-end; gap: 0.65rem; flex-shrink: 0; }
.chat-proposal-btn { background: rgba(209,91,70,0.12); border: 1px solid rgba(209,91,70,0.24); color: var(--accent); width: 40px; height: 40px; border-radius: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease; flex-shrink: 0; box-shadow: inset 0 1px 0 rgba(255,255,255,0.03); }
.chat-proposal-btn:hover { background: rgba(209,91,70,0.18); border-color: rgba(209,91,70,0.34); color: #ffd7c7; }
.chat-attach-btn { cursor: pointer; font-size: 1.2rem; color: var(--text-muted); width: 40px; height: 40px; background: var(--composer-rail); border: 1px solid var(--composer-border); padding: 0; border-radius: 12px; transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 1px 0 rgba(255,255,255,0.02); }
.chat-attach-btn:hover { color: var(--text); background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.12); }
#chatInput { flex: 1; background: var(--composer-rail); border: 1px solid var(--composer-border); border-radius: 14px; padding: 0.72rem 0.95rem; color: var(--text); font-family: inherit; font-size: 16px; resize: none; max-height: 120px; line-height: 1.45; outline: none; scrollbar-width: none; appearance: none; -webkit-appearance: none; box-shadow: inset 0 1px 0 rgba(255,255,255,0.02); }
#chatInput::-webkit-scrollbar { display: none; }
#chatInput:focus { border-color: rgba(212,96,58,0.5); box-shadow: 0 0 0 3px rgba(212,96,58,0.12); }
#chatInput::placeholder { color: var(--text-muted); }
.chat-send-btn { background: linear-gradient(180deg, var(--accent), var(--accent-hover)); border: 1px solid rgba(255,255,255,0.08); color: white; width: 40px; height: 40px; border-radius: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; transition: filter 0.15s ease, transform 0.15s ease; flex-shrink: 0; box-shadow: 0 8px 18px rgba(196,78,46,0.2); }
.chat-send-btn:hover:not(:disabled) { filter: brightness(1.05); transform: translateY(-1px); }
.chat-send-btn:disabled { opacity: 0.4; cursor: default; }
.chat-send-btn.sending { pointer-events: none; }
.chat-send-btn.sending i:before { content: "\ea35"; }

/* ── Upload progress ── */
.chat-progress { width: 100%; height: 3px; background: var(--surface-3); overflow: hidden; flex-shrink: 0; display: none; }
.chat-progress-fill { height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }

/* ── Image lightbox ── */
.lightbox { position: fixed; inset: 0; z-index: 999; background: rgba(0,0,0,0.92); display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.lightbox img { max-width: 95vw; max-height: 95vh; object-fit: contain; border-radius: var(--radius); }
.lightbox-panel { width: min(960px, 94vw); max-height: 90vh; cursor: default; }
.lightbox-panel iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius); background: #111; display: block; }

/* ── Drag overlay ── */
.chat-drag-overlay { position: absolute; inset: 0; background: rgba(212,96,58,0.1); border: 2px dashed var(--accent); border-radius: var(--radius); z-index: 10; display: flex; align-items: center; justify-content: center; font-size: 1rem; color: var(--accent); pointer-events: none; gap: 0.5rem; }

/* ── Link styles ── */
.msg-text a { color: var(--accent); text-decoration: underline; overflow-wrap: anywhere; word-break: break-word; }
.msg-text a:hover { color: var(--accent-hover); }
.msg-link-embed { margin-top: 0.5rem; }
.msg-link-embed-card { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: inherit; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06); border-radius: var(--radius); padding: 0.7rem 0.8rem; min-width: 220px; }
.msg-link-embed-card:hover { background: rgba(255,255,255,0.07); }
.msg-link-embed-launch { width: 100%; text-align: left; cursor: pointer; font: inherit; }
.msg-link-embed-launch-thumb { width: 112px; height: 64px; }
.msg-link-embed-thumb { width: 64px; height: 64px; border-radius: var(--radius); overflow: hidden; flex-shrink: 0; background: #111; }
.msg-link-embed-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.msg-link-embed-icon { width: 36px; height: 36px; border-radius: var(--radius); background: rgba(209,91,70,0.14); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 1.05rem; flex-shrink: 0; }
.msg-link-embed-body { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 0.14rem; }
.msg-link-embed-domain { font-size: 0.68rem; color: var(--text-muted); text-transform: lowercase; line-height: 1.15; }
.msg-link-embed-title { font-size: 0.78rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.msg-link-embed-desc { font-size: 0.72rem; color: var(--text-muted); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.msg-link-embed-featured { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "thumb" "body"; gap: 0.75rem; width: 100%; max-width: none; min-width: 0; padding: 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.msg-link-embed-featured:hover { background: transparent; }
.msg-link-embed-featured .msg-link-embed-launch-thumb,
.msg-link-embed-featured .msg-link-embed-thumb { grid-area: thumb; width: min(384px, 100%); max-width: 384px; height: auto; aspect-ratio: 16 / 9; border-radius: var(--radius); background: #111; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04); overflow: hidden; }
.msg-link-embed-featured .msg-link-embed-body { grid-area: body; display: block; min-width: 0; }
.msg-link-embed-featured .msg-link-embed-body,
.msg-link-embed-featured .msg-link-embed-title,
.msg-link-embed-featured .msg-link-embed-desc,
.msg-link-embed-featured .msg-link-embed-domain { width: min(384px, 100%); max-width: 384px; }
.msg-link-embed-featured .msg-link-embed-domain { font-size: 0.72rem; }
.msg-link-embed-featured .msg-link-embed-title { font-size: 1rem; white-space: normal; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; margin-top: 0.18rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.msg-link-embed-featured .msg-link-embed-desc { margin-top: 0.38rem; font-size: 0.74rem; }
.msg-link-embed-image-wrap { overflow: hidden; border-radius: var(--radius); }
.msg-link-embed-image { display: block; max-width: min(432px, 86vw); max-height: 288px; border-radius: var(--radius); cursor: pointer; object-fit: cover; }
.msg-link-embed-video video { display: block; max-width: min(432px, 86vw); max-height: 312px; border-radius: var(--radius); background: #111; }
.msg-link-embed-audio audio { width: min(432px, 86vw); }

/* ── Reply quote in bubble ── */
.msg-reply-quote { border-left: 3px solid var(--accent); background: rgba(209, 91, 70, 0.08); padding: 0.35rem 0.6rem; border-radius: var(--radius); margin-bottom: 0.35rem; cursor: pointer; max-height: 3.5em; overflow: hidden; }
.msg-reply-sender { font-size: 0.7rem; font-weight: 600; color: var(--accent); display: block; }
.msg-reply-text { font-size: 0.75rem; color: var(--text-muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Reply button on hover ── */
.msg { position: relative; }
.msg-reply-btn { position: absolute; top: 0; opacity: 0; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); width: 28px; height: 28px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1rem; transition: opacity 0.15s, background 0.15s; z-index: 2; }
.msg.own .msg-reply-btn { left: -36px; }
.msg.other .msg-reply-btn { right: -36px; }
.msg:hover .msg-reply-btn { opacity: 1; }
.msg-reply-btn:hover { background: var(--surface-3); color: var(--text); }

/* ── Reply preview bar ── */
.chat-reply-preview { padding: 0.5rem 1rem; background: var(--surface); border-top: 1px solid var(--border); display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.reply-preview-inner { flex: 1; border-left: 3px solid var(--accent); padding-left: 0.6rem; min-width: 0; }
.reply-preview-sender { font-size: 0.72rem; font-weight: 600; color: var(--accent); display: block; }
.reply-preview-text { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.reply-preview-clear { background: none; border: none; color: var(--text-muted); font-size: 1.3rem; cursor: pointer; padding: 0.2rem; border-radius: var(--radius); }
.reply-preview-clear:hover { color: var(--text); background: var(--surface-2); }

/* ── Message highlight animation ── */
@keyframes msgHighlight {
    0% { filter: brightness(1); }
    60% { filter: brightness(1.35); }
    60.1%, 100% { filter: brightness(1); }
}
.msg-highlight .msg-bubble { animation: msgHighlight 1.4s ease-in; }

/* ── Typing indicator ── */
.typing-indicator { display: flex; align-items: center; gap: 0.4rem; padding: 0 0.3rem; font-size: 0.72rem; color: var(--text-muted); }
.typing-dots { display: flex; gap: 3px; }
.typing-dots span { width: 5px; height: 5px; border-radius: 50%; background: var(--text-muted); animation: typingBounce 1.4s ease-in-out infinite; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-4px); } }

.msg-typing {
    align-self: flex-start;
    max-width: none;
}

.msg-typing .msg-bubble {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    background: linear-gradient(180deg, rgba(58,37,32,0.94), rgba(47,31,27,0.94));
    border: 1px solid rgba(209, 91, 70, 0.18);
    padding: 0.55rem 0.8rem;
}

.typing-bubble-label {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.proposal-card { min-width: min(360px, 78vw); display: flex; flex-direction: column; gap: 0.65rem; }
.proposal-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.proposal-card-eyebrow { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.proposal-card-title { font-size: 0.92rem; font-weight: 700; line-height: 1.3; }
.proposal-card-price { font-size: 0.95rem; font-weight: 700; color: #ffd166; white-space: nowrap; }
.proposal-card-desc { font-size: 0.78rem; color: var(--text-muted); white-space: pre-wrap; }
.proposal-meta { display: flex; flex-wrap: wrap; gap: 0.45rem; font-size: 0.72rem; color: var(--text-muted); }
.proposal-meta span { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.05); border-radius: 999px; padding: 0.2rem 0.5rem; }
.proposal-status-row { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.proposal-pill { border-radius: 999px; padding: 0.18rem 0.5rem; font-size: 0.68rem; font-weight: 600; }
.proposal-pill.pending { background: rgba(255,255,255,0.06); color: var(--text-muted); }
.proposal-pill.accepted { background: rgba(76,175,80,0.14); color: #82d88c; }
.proposal-pill.declined { background: rgba(239,83,80,0.14); color: #ff9f9c; }
.proposal-pill.finalized { background: rgba(255,209,102,0.14); color: #ffd166; }
.proposal-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.proposal-action-btn { border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: var(--radius); padding: 0.45rem 0.7rem; font-size: 0.74rem; font-family: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 0.35rem; }
.proposal-action-btn:hover { background: var(--surface-3); }
.proposal-action-btn.primary { background: rgba(76,175,80,0.18); border-color: rgba(76,175,80,0.28); color: #8be28f; }
.proposal-action-btn.primary:hover { background: rgba(76,175,80,0.24); }
.proposal-action-btn.danger { background: rgba(239,83,80,0.12); border-color: rgba(239,83,80,0.22); color: #ff9f9c; }
.proposal-action-btn.danger:hover { background: rgba(239,83,80,0.18); }
.proposal-card-note { font-size: 0.72rem; color: var(--text-muted); }

.proposal-modal { position: fixed; inset: 0; z-index: 140; background: rgba(0,0,0,0.62); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.proposal-modal-card { width: min(560px, 100%); background: linear-gradient(180deg, rgba(29,29,29,0.98), rgba(20,20,20,0.98)); border: 1px solid rgba(209,91,70,0.18); border-radius: var(--radius); box-shadow: 0 20px 44px rgba(0,0,0,0.42); padding: 1rem; }
.proposal-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.9rem; }
.proposal-modal-head h3 { font-size: 1rem; }
.proposal-modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.4rem; cursor: pointer; }
.proposal-form { display: flex; flex-direction: column; gap: 0.8rem; }
.proposal-form label { display: flex; flex-direction: column; gap: 0.35rem; }
.proposal-form label span { font-size: 0.76rem; color: var(--text-muted); }
.proposal-form input:not(.kfs-date-segment):not(.kfs-date-time-segment),
.proposal-form textarea { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font: inherit; padding: 0.7rem 0.8rem; }
.proposal-form textarea { resize: vertical; min-height: 110px; }
.proposal-form-row { display: grid; grid-template-columns: 1fr 1.3fr; gap: 0.75rem; }
.proposal-form-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 0.25rem; }
.proposal-secondary-btn,
.proposal-primary-btn { border-radius: var(--radius); padding: 0.65rem 0.95rem; font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 0.4rem; }
.proposal-secondary-btn { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.proposal-primary-btn { background: var(--accent); color: white; border: 1px solid transparent; }
.proposal-primary-btn:hover { background: var(--accent-hover); }

/* ── Swipe reply icon ── */
.swipe-reply-icon { position: absolute; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); color: var(--text-muted); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; pointer-events: none; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .msg { max-width: 88%; }
    .header { display: none !important; }
    body.chat-page { position: fixed; inset: 0; width: 100%; }
    main { padding-top: 0 !important; padding-left: 0 !important; height: var(--app-height); }
    .chat-container { height: var(--app-height); }
    .chat-menu-toggle { display: flex; }
    .sidebar { top: 65px; }
    .chat-header { padding: 0.75rem 1rem; }
    .chat-messages { padding: 0.75rem; }
    .msg-img-preview { max-width: 220px; max-height: 200px; }
    .msg-file { min-width: 160px; }
    .msg-reply-btn { display: none; }
    .proposal-card { min-width: 0; width: 100%; }
    .proposal-form-row { grid-template-columns: 1fr; }
}

@media (min-width: 769px) {
    main { padding-left: 220px; }
}
