@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600&family=DM+Sans:wght@400;500;600&display=swap');

:root { --ink: #24312d; --muted: #718078; --cream: #f6f3ed; --paper: #fffdf8; --green: #315b4e; --red: #a64032; --line: #dedbd2; }
* { box-sizing: border-box; }
body { min-height: 100vh; margin: 0; color: var(--ink); background: linear-gradient(135deg, #e8eee5, var(--cream) 54%, #eadbd0); font-family: 'DM Sans', sans-serif; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.discussion-page { width: min(920px, 100%); min-height: 100vh; margin: 0 auto; padding: 28px clamp(18px, 5vw, 58px) 42px; }
.discussion-header { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }
.back-link { display: grid; width: 42px; height: 42px; place-items: center; color: var(--green); background: rgba(255,253,248,.8); border: 1px solid var(--line); border-radius: 50%; font-size: 1.5rem; text-decoration: none; }
.eyebrow { margin: 0 0 4px; color: var(--red); font-size: .68rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
h1, h2 { margin: 0; font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 600; }
h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); line-height: .9; }
h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
.logout-button { margin-left: auto; padding: 9px 13px; color: var(--green); background: transparent; border: 1px solid var(--line); border-radius: 5px; cursor: pointer; font-size: .75rem; }
.logout-button:hover { color: #fff; background: var(--green); }
.conversation { display: flex; min-height: 70vh; flex-direction: column; padding: clamp(20px, 4vw, 38px); background: rgba(255,253,248,.9); border: 1px solid rgba(222,219,210,.9); box-shadow: 0 18px 45px rgba(49,91,78,.12); }
.conversation-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.connection-status { margin: 0; color: var(--muted); font-size: .72rem; }
.message-list { display: flex; min-height: 320px; flex: 1; flex-direction: column; gap: 10px; overflow-y: auto; padding: 24px 4px; }
.message { max-width: min(650px, 88%); padding: 11px 14px; background: #eef2eb; border-left: 3px solid var(--green); }
.message.mine { align-self: end; background: #fff0eb; border-left: 0; border-right: 3px solid var(--red); text-align: right; }
.message-author { margin: 0 0 3px; color: var(--green); font-size: .7rem; font-weight: 600; }
.message.mine .message-author { color: var(--red); }
.message-text { margin: 0; line-height: 1.45; overflow-wrap: anywhere; }
.message-time { display: block; margin-top: 6px; color: var(--muted); font-size: .62rem; }
.empty-message { align-self: center; margin: auto; color: var(--muted); font-size: .82rem; }
.message-form { display: flex; gap: 9px; padding-top: 18px; border-top: 1px solid var(--line); }
.message-form input { min-width: 0; flex: 1; padding: 13px 14px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 4px; outline-color: var(--red); }
.message-form button { padding: 0 18px; color: #fff; background: var(--red); border: 0; border-radius: 4px; cursor: pointer; font-weight: 600; }
.message-form button:disabled { cursor: wait; opacity: .6; }
.form-message { min-height: 18px; margin: 9px 0 0; color: var(--red); font-size: .72rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 560px) { .discussion-page { padding-top: 18px; }.discussion-header { margin-bottom: 20px; }.logout-button { padding: 8px 9px; font-size: .68rem; }.conversation { min-height: calc(100vh - 130px); padding: 18px 14px; }.conversation-heading { align-items: start; flex-direction: column; gap: 8px; }.message-form { flex-direction: column; }.message-form button { min-height: 44px; } }
