.messages-shell { max-width: 1440px; }
.messages-intro { display:flex; justify-content:space-between; align-items:end; gap:24px; padding:32px 0 16px; }
.messages-intro h1 { margin:10px 0; font-size:clamp(32px,4vw,50px); }
.messages-intro p { max-width:60ch; color:#53605a; }
.messages-surface { color:#17211f; font:14px/1.55 "Manrope",sans-serif; min-width:0; }
.messages-surface [hidden] { display:none !important; }
.messages-privacy { font-size:12px; color:#647066; margin:0; }
.messages-workspace { display:grid; grid-template-columns:minmax(240px,.8fr) minmax(0,2fr); border:1px solid #ded8cb; border-radius:24px; overflow:hidden; background:#fffdf7; min-height:520px; }
.messages-inbox,.messages-thread { padding:22px; min-width:0; }
.messages-inbox { background:linear-gradient(145deg,#f0ecdf,#faf7ef); border-right:1px solid #ded8cb; }
.messages-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.messages-surface h2 { font:28px/1.15 "Cormorant Garamond",Georgia,serif; margin:0 0 8px; overflow-wrap:anywhere; }
.messages-surface #thread-detail { color:#647066; font-size:12px; margin:0 0 18px; }
.conversation-list,.message-list { list-style:none; padding:0; margin:18px 0; }
.conversation-list { display:grid; gap:9px; max-height:55vh; overflow-y:auto; }
.conversation-list button { width:100%; text-align:left; white-space:pre-wrap; overflow-wrap:anywhere; background:#fffdf7; }
.conversation-list button[aria-current="true"] { border-color:#a77b30; box-shadow:inset 3px 0 #a77b30; }
.messages-surface button { cursor:pointer; border:1px solid #d8d0c0; border-radius:12px; padding:10px 14px; background:#fffdf7; color:#17211f; font:inherit; min-height:42px; }
.messages-surface button.btn-primary { background:#172b24; color:#fffdf7; border-color:#172b24; }
.messages-surface button:disabled { opacity:.55; cursor:wait; }
.messages-surface :is(a,button,input,textarea,select,summary):focus-visible { outline:3px solid #b48739; outline-offset:3px; }
.messages-surface #thread-heading:focus { outline:none; }
.message-list { display:grid; gap:12px; max-height:52vh; overflow-y:auto; overscroll-behavior:contain; }
.message-list li { border:1px solid #e5dfd2; background:#f8f5ec; padding:14px 16px; border-radius:4px 16px 16px; overflow-wrap:anywhere; }
.message-list strong { font-size:12px; }
.message-list p { white-space:pre-wrap; margin:8px 0 0; }
.message-list time { display:block; font-size:10px; color:#697369; margin-top:2px; }
.messages-surface form { display:grid; gap:10px; margin:20px 0; }
.messages-surface label { display:block; font-size:11px; text-transform:uppercase; letter-spacing:.08em; font-weight:700; margin-bottom:6px; }
.messages-surface input,.messages-surface textarea,.messages-surface select { width:100%; min-width:0; box-sizing:border-box; border:1px solid #d8d0c0; border-radius:12px; background:#fffefa; color:#17211f; font:inherit; padding:12px; }
.messages-surface textarea { resize:vertical; min-height:96px; }
.messages-surface #message-help { margin:0; font-size:11px; color:#697369; }
.messages-surface #conversation-controls { display:flex; flex-wrap:wrap; align-items:start; gap:12px; border-top:1px solid #e5dfd2; padding-top:14px; }
.messages-surface #conversation-controls>button { font-size:11px; min-height:34px; background:transparent; }
.messages-surface #conversation-controls summary { cursor:pointer; font-size:11px; padding:9px 0; }
.messages-surface #messages-status { min-height:1.5em; font-size:12px; color:#647066; overflow-wrap:anywhere; margin:12px 0; }
.gallery-message-panel { position:fixed; box-sizing:border-box; color:#17211f; background:#fffdf7; border:1px solid #d8d0c0; padding:0; box-shadow:0 24px 90px #17211f35; z-index:5000; font-family:"Manrope",sans-serif; }
.gallery-message-panel:not([open]) { display:none; }
.gallery-message-panel[data-mode="sidebar"] { inset:12px 12px 12px auto; margin:0; width:min(460px,calc(100vw - 24px)); height:calc(100dvh - 24px); max-height:none; border-radius:24px; }
.gallery-message-panel[data-mode="modal"] { inset:0; margin:auto; width:min(920px,calc(100vw - 40px)); height:min(820px,calc(100dvh - 40px)); max-height:none; border-radius:26px; }
.gallery-message-panel::backdrop { background:#172b2466; backdrop-filter:blur(5px); }
.gallery-message-panel[open] { display:flex; flex-direction:column; }
.gallery-message-panel .message-panel-header { padding:20px 22px 14px; background:linear-gradient(120deg,#172b24,#283d32); color:#fffdf7; border-radius:22px 22px 0 0; flex:0 0 auto; }
.message-panel-brand { font-size:10px; text-transform:uppercase; letter-spacing:.13em; color:#dac393; }
.message-panel-title-row { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-top:5px; }
.gallery-message-panel h2.message-panel-title { font:30px/1.1 "Cormorant Garamond",Georgia,serif; margin:0; color:inherit; }
.gallery-message-panel .message-panel-header button { width:36px; height:36px; min-height:36px; border-radius:50%; color:#fffdf7; background:#ffffff0d; border:1px solid #ffffff35; font-size:20px; cursor:pointer; }
.message-panel-tools { display:flex; align-items:center; flex-wrap:wrap; gap:7px; padding:12px 18px; border-bottom:1px solid #e5dfd2; }
.gallery-message-panel .message-panel-tools :is(button,a) { color:#53605a; background:none; border:1px solid #ded8cb; border-radius:999px; padding:7px 11px; min-height:34px; font:11px/1.5 "Manrope",sans-serif; cursor:pointer; text-decoration:none; }
.gallery-message-panel .message-panel-tools [aria-pressed="true"] { color:#fffdf7; background:#243a30; border-color:#243a30; }
.message-panel-tools .message-panel-full { margin-left:auto; }
.gallery-message-panel :is(button,a):focus-visible { outline:3px solid #b48739; outline-offset:2px; }
.message-panel-content { min-height:0; flex:1; overflow-y:auto; overscroll-behavior:contain; padding:0 18px 18px; }
.message-panel-notice { color:#8e6425; font-size:12px; padding:0 18px; margin:8px 0 0; }
.gallery-message-panel .messages-workspace { display:block; min-height:0; border:0; border-radius:0; background:none; }
.gallery-message-panel .messages-inbox { display:none; border:0; border-radius:14px; padding:16px; }
.gallery-message-panel[data-inbox="true"] .messages-inbox { display:block; }
.gallery-message-panel[data-inbox="true"] .messages-thread { display:none; }
.gallery-message-panel .messages-thread { padding:10px 0 0; }
.gallery-message-panel .messages-thread h2 { font-size:24px; }
.gallery-message-panel .message-list { max-height:38dvh; }
.gallery-message-panel .messages-privacy { font-size:10px; margin-top:12px; }
.gallery-message-panel .conversation-list { max-height:none; }
@media (max-width: 680px) {
 .messages-intro { flex-direction:column; align-items:start; padding-top:24px; }
 .messages-workspace { grid-template-columns:minmax(0,1fr); }
 .messages-inbox { border-right:0; border-bottom:1px solid #ded8cb; }
 .conversation-list { max-height:180px; }
 .messages-inbox,.messages-thread { padding:18px; }
 .gallery-message-panel[data-mode="sidebar"] { inset:8px; width:calc(100vw - 16px); height:calc(100dvh - 16px); }
 .gallery-message-panel[data-mode="modal"] { width:calc(100vw - 16px); height:calc(100dvh - 32px); }
 .gallery-message-panel .message-panel-header { padding:16px 18px 12px; }
 .gallery-message-panel .message-panel-tools { gap:5px; padding:10px 14px; }
 .gallery-message-panel .message-panel-tools :is(button,a) { font-size:10px; padding:7px 9px; }
}
@media (prefers-reduced-motion:no-preference) {
 .gallery-message-panel[open] { animation:gallery-message-reveal .18s ease-out; }
 @keyframes gallery-message-reveal { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
}
