/* Messenger: right-side panel, vertical handle and the emoji composer (documentation 19). */
.mk-m {
  --mk-w: 380px;
  --mk-top: 0px;
  position: fixed;
  top: var(--mk-top);
  bottom: 0;
  right: 0;
  width: var(--mk-w);
  max-width: 90vw;
  z-index: 35;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.16, 1, .3, 1);
  pointer-events: none;
}
.mk-m[data-open="true"] { transform: translateX(0); }
.mk-m.mk-m-instant { transition: none; }
.mk-m-panel, .mk-m-handle { pointer-events: auto; }

.mk-m-panel {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #faf8f2;
  border-left: 1px solid #dfe7de;
  box-shadow: -10px 0 28px rgba(16, 63, 54, .14);
}
.mk-m[data-open="false"] .mk-m-panel { box-shadow: none; }
.mk-m-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.mk-m-close {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 32px; height: 32px; border: 0; border-radius: 8px;
  background: transparent; color: #244f43; font-size: 24px; line-height: 1; cursor: pointer;
}
.mk-m-close:hover { background: #edf3ef; }

.mk-m-handle {
  position: absolute; left: -34px; top: 50%; transform: translateY(-50%);
  width: 34px; min-height: 132px; padding: 12px 0; border: 0; border-radius: 10px 0 0 10px;
  background: #145447; color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: -3px 2px 10px rgba(16, 63, 54, .25);
}
.mk-m-handle:hover { background: #103f36; }
.mk-m-handle:focus-visible, .mk-m-close:focus-visible { outline: 3px solid #f4b544; outline-offset: 2px; }
.mk-m-handle-label { writing-mode: vertical-rl; font-size: 13px; font-weight: 600; letter-spacing: .08em; }
.mk-m-badge {
  position: absolute; top: -8px; left: -8px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: #f4b544; color: #103f36;
  font-size: 11px; font-weight: 700; line-height: 20px; text-align: center;
}
.mk-m-badge[hidden], .mk-m-badge-inline[hidden] { display: none; }
.mk-m-pulse { animation: mk-m-pulse 1.1s cubic-bezier(.2, .8, .2, 1) 2; }
@keyframes mk-m-pulse { 0%, 100% { transform: translateY(-50%) translateX(0); } 40% { transform: translateY(-50%) translateX(-6px); } }

.mk-m-view { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.mk-m-head { display: flex; align-items: center; gap: 10px; padding: 14px 52px 12px 16px; border-bottom: 1px solid #e5e9e1; }
.mk-m-head h2 { margin: 0; font-size: 16px; color: #153e35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.mk-m-back { color: #244f43; text-decoration: none; font-size: 18px; padding: 2px 6px; border-radius: 8px; }
.mk-m-back:hover { background: #edf3ef; }
.mk-m-tools { flex: none; }
.mk-m-tools .ms-btn { font-size: 12px; padding: 4px 10px; }
.mk-m-avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #dcebe5; color: #145447; font-weight: 700; }

.mk-m-search { padding: 10px 14px 4px; }
.mk-m-search input { width: 100%; border: 1px solid #d6dfd5; border-radius: 10px; padding: 8px 12px; font: inherit; background: #fff; }
.mk-m-tabs { display: flex; gap: 6px; padding: 8px 14px; }
.mk-m-tabs a { padding: 6px 12px; border-radius: 999px; font-size: 13px; color: #244f43; text-decoration: none; border: 1px solid transparent; }
.mk-m-tabs a:hover { background: #edf3ef; }
.mk-m-tabs a.is-active { background: #145447; color: #fff; }
.mk-m-tabs em { font-style: normal; opacity: .75; margin-left: 2px; }

.mk-m-rows { list-style: none; margin: 0; padding: 0 8px; flex: 1; min-height: 0; overflow-y: auto; }
.mk-m-rows li[hidden] { display: none; }
.mk-m-row { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-radius: 12px; text-decoration: none; color: inherit; }
.mk-m-row:hover { background: #edf3ef; }
.mk-m-row.is-unread { background: #f1f8f4; }
.mk-m-rowbody { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mk-m-peer { color: #153e35; font-size: 14px; }
.mk-m-snip { color: #64706c; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-m-meta { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 11px; color: #64706c; }
.mk-m-badge-inline { font-style: normal; background: #145447; color: #fff; border-radius: 999px; padding: 0 7px; font-weight: 700; font-size: 11px; }
.mk-m-empty { padding: 18px 10px; color: #64706c; font-size: 13px; text-align: center; }
.mk-m-foot { padding: 10px 14px; border-top: 1px solid #e5e9e1; font-size: 13px; }
.mk-m-foot a { color: #244f43; }

.mk-m-conv { overflow-y: auto; }
.mk-m-older { align-self: center; flex: none; font-size: 12px; padding: 4px 12px; }
.mk-m-thread { flex: 1 1 auto; min-height: 160px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; }
.mk-m-conv .dm-request { margin: 8px 12px 0; }
.mk-m-error, .mk-m-notice { margin: 8px 12px 0; padding: 8px 12px; border-radius: 10px; font-size: 13px; }
.mk-m-error { background: #fdecea; color: #8a2c20; }
.mk-m-notice { background: #edf3ef; color: #244f43; }
.mk-m .dm-note { margin: 8px 14px 12px; }
.mk-m .mk-m-safety { margin: 0 12px 10px; font-size: 12px; line-height: 1.35; }
.mk-m-form { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid #e5e9e1; background: #fff; }
.mk-m-form textarea { resize: none; }

.mk-composer-tools { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.mk-m-form .mk-composer-tools { flex-direction: row; justify-content: space-between; align-items: center; }
.mk-emoji { position: relative; }
.mk-emoji summary { list-style: none; cursor: pointer; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid #d6dfd5; border-radius: 10px; background: #fff; font-size: 18px; }
.mk-emoji summary::-webkit-details-marker { display: none; }
.mk-emoji summary:hover { background: #edf3ef; }
.mk-emoji-grid {
  position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 5;
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px;
  width: 296px; max-width: 80vw; padding: 8px;
  background: #fff; border: 1px solid #dfe7de; border-radius: 12px; box-shadow: 0 10px 30px rgba(16, 63, 54, .18);
}
.dm-form .mk-emoji-grid { left: auto; right: 0; }
.mk-m-form .mk-emoji-grid { left: 0; right: auto; }
.mk-emoji-grid button { border: 0; background: transparent; font-size: 20px; line-height: 1; padding: 5px 0; border-radius: 8px; cursor: pointer; }
.mk-emoji-grid button:hover { background: #edf3ef; }

@media (max-width: 768px) {
  .mk-m { width: 100vw; max-width: none; top: 0 !important; z-index: 60; }
  .mk-m-handle { display: none; }
  .mk-m-panel { border-left: 0; }
  body.mk-m-is-open { overflow: hidden; }
  body.mk-m-is-open .concierge-widget { display: none; }
}
@media (min-width: 769px) {
  body.mk-m-is-open .concierge-widget { right: calc(min(380px, 90vw) + 24px) !important; transition: right .3s cubic-bezier(.16, 1, .3, 1); }
}
@media (prefers-reduced-motion: reduce) {
  .mk-m, body.mk-m-is-open .concierge-widget { transition: none; }
  .mk-m-pulse { animation: none; }
}

/* Buttons keep their own look inside the panel: the cabinet styles are scoped to its pages. */
.mk-m .ms-btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 16px; border: 1px solid #d6dfd5; border-radius: 10px; background: #fff; color: #244f43; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.mk-m .ms-btn:hover { background: #edf3ef; }
.mk-m .ms-btn-pri { background: #145447; border-color: #145447; color: #fff; }
.mk-m .ms-btn-pri:hover { background: #103f36; }
.mk-m-tools .ms-btn { font-size: 12px; padding: 4px 10px; }

/* Links inside messages and cards for linked platform pages. */
.dm-bubble .mk-link { color: #145447; text-decoration: underline; word-break: break-all; }
.dm-bubble.is-mine .mk-link { color: #103f36; }
.mk-card { display: block; margin-top: 6px; overflow: hidden; border: 1px solid #cfe0d7; border-radius: 10px; background: #fff; text-decoration: none; color: inherit; }
.mk-card:first-child { margin-top: 0; }
.mk-card:hover { background: #f1f8f4; }
.mk-card-photo { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #e6efe9; }
.mk-card-text { display: block; padding: 8px 10px; }
.mk-card-text strong { display: block; color: #153e35; font-size: 13.5px; line-height: 1.25; }
.mk-card-text span { display: block; margin-top: 2px; color: #64706c; font-size: 12px; }

/* Header messenger icon: opens the panel on desktop, links to the messages page on a phone. */
.header-messenger { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: none; border: 1px solid #d6dfd5; border-radius: 10px; background: #fff; color: #153e35; text-decoration: none; }
.header-messenger:hover { background: #edf3ef; color: #153e35; text-decoration: none; }
.header-messenger:focus-visible { outline: 3px solid #f4b544; outline-offset: 2px; }
.header-messenger.has-unread { background: #145447; border-color: #145447; color: #fff; }
.header-messenger.has-unread:hover { background: #103f36; color: #fff; }
.header-messenger-badge { position: absolute; top: -7px; right: -7px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: #d92d20; color: #fff; border: 2px solid #fff; box-sizing: content-box; font-size: 11px; font-style: normal; font-weight: 700; line-height: 19px; text-align: center; font-variant-numeric: tabular-nums; }
.header-messenger-badge[hidden] { display: none; }
.header-messenger.mk-m-pulse { animation: mk-hd-pulse 1.1s ease-out 2; }
@keyframes mk-hd-pulse { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.18); } }
@media (max-width: 600px) { .header-messenger { width: 32px; height: 32px; } }
@media (prefers-reduced-motion: reduce) { .header-messenger.mk-m-pulse { animation: none; } }
.mk-m-preview { padding: 0 14px 8px; }
.mk-m-preview .mk-card { margin-top: 0; }
.mk-m-lock { display: inline-block; vertical-align: -2px; color: #8a6d1f; margin-left: 4px; }
.mk-m-confirm { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(16, 40, 33, .45); }
.mk-m-confirm-box { width: 100%; max-width: 320px; background: #fff; border-radius: 14px; padding: 20px; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); }
.mk-m-confirm-box h3 { margin: 0 0 8px; font-size: 17px; color: #153e35; }
.mk-m-confirm-box p { margin: 0 0 16px; font-size: 14px; line-height: 1.45; color: #3d5a50; }
.mk-m-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }
.mk-m .ms-btn.mk-m-danger { background: #b3261e; border-color: #b3261e; color: #fff; }
.mk-m .ms-btn.mk-m-danger:hover { background: #8f1d17; }
.ld-btn--message { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 16px; border: 0; border-radius: 10px; background: #145447; color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.ld-btn--message:hover { background: #103f36; color: #fff; }
