.admin-support-inbox-link {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 12000;
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  gap: 9px;
  padding: 0 15px;
  border: 1px solid #064da7;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #1265e8, #087b86);
  box-shadow: 0 9px 24px #0b315433;
  font: 700 13px/1.2 Inter, "Segoe UI", Arial, sans-serif;
  text-decoration: none;
  cursor: pointer;
}

.admin-support-inbox-link:hover,
.admin-support-inbox-link:focus-visible {
  color: #fff;
  background: linear-gradient(135deg, #0756ce, #06686f);
  outline: 3px solid #a9d7ff;
  outline-offset: 2px;
}

.admin-support-inbox-icon { font-size: 17px; }
.admin-support-inbox-count {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  color: #fff;
  background: #bf3d36;
  font-size: 10px;
  white-space: nowrap;
}
.admin-support-inbox-count[hidden] { display: none; }

.admin-support-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 15000;
  display: grid;
  place-items: center;
  padding: clamp(10px, 2vw, 28px);
  background: #10243db3;
  backdrop-filter: blur(4px);
}

.admin-support-modal-backdrop[hidden] { display: none !important; }

.admin-support-modal {
  display: flex;
  width: min(1420px, 100%);
  height: min(900px, calc(100dvh - 56px));
  min-height: 420px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #d5e1ed;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 28px 90px #07172d66;
}

body.admin-support-modal-open { overflow: hidden !important; }

.support-admin-inbox {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 15px;
  padding: clamp(15px, 2vw, 26px);
  overflow: hidden;
  color: #1b3046;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.support-admin-inbox-heading { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 16px; padding: 0 3px; }
.support-admin-inbox-heading-text { min-width: 0; }
.support-admin-inbox-title { color: #142c46; font-size: clamp(25px, 3vw, 32px); font-weight: 780; letter-spacing: -.025em; }
.support-admin-inbox-heading p { margin: 5px 0 0; color: #60748a; font-size: 14px; }
.admin-support-modal-close { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; padding: 0 0 3px; border: 1px solid #d2dce8; border-radius: 50%; color: #16334f; background: #fff; font: 27px/1 Arial, sans-serif; cursor: pointer; }
.admin-support-modal-close:hover,.admin-support-modal-close:focus-visible { border-color: #9bb9d7; background: #f2f7fc; outline: 3px solid #3279c422; }

.support-inbox-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
  border: 1px solid #d8e2ed;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 6px 22px #1029440b;
}

#root main.admin-support-page .support-inbox-composer { display: flex !important; }

.support-inbox-list-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border-right: 1px solid #e1e8f0;
  background: #fff;
}

.support-inbox-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 18px 17px 12px;
}

.support-inbox-list-heading h2 { margin: 0; color: #1c334c; font-size: 17px; font-weight: 740; }
.support-inbox-list-count { color: #718196; font-size: 12px; }

.support-inbox-search {
  box-sizing: border-box;
  width: calc(100% - 30px);
  min-height: 41px;
  margin: 0 15px 11px;
  padding: 9px 12px;
  border: 1px solid #d5deea;
  border-radius: 10px;
  color: #21364d;
  background: #f8fafc;
  font: 13px Inter, "Segoe UI", Arial, sans-serif;
}

.support-inbox-search:focus { border-color: #2776dd; outline: 3px solid #2776dd22; background: #fff; }

.support-inbox-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0 13px 12px;
}

.support-inbox-filter {
  min-height: 29px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #62758a;
  background: #f3f6f9;
  font: 600 11px Inter, "Segoe UI", Arial, sans-serif;
  cursor: pointer;
}

.support-inbox-filter:hover { color: #155fbb; }
.support-inbox-filter[aria-pressed="true"] { border-color: #c5dcfb; color: #145bb4; background: #eaf3ff; }

.support-inbox-conversation-list {
  display: flex;
  flex: 1 1 auto;
  min-height: 220px;
  flex-direction: column;
  gap: 3px;
  overflow: auto;
  padding: 0 8px 10px;
  overscroll-behavior: contain;
}

.support-inbox-conversation {
  position: relative;
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 12px 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #21364d;
  background: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.support-inbox-conversation:hover { background: #f6f9fd; }
.support-inbox-conversation.is-selected { border-color: #cee1fa; background: #edf5ff; }
.support-inbox-conversation:focus-visible { outline: 3px solid #2776dd55; }

.support-inbox-conversation-top,
.support-inbox-conversation-details { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 8px; }
.support-inbox-requester-name { overflow: hidden; color: #1b3046; font-size: 13px; font-weight: 730; text-overflow: ellipsis; white-space: nowrap; }
.support-inbox-conversation-time { flex: 0 0 auto; color: #7b8a9d; font-size: 10px; }
.support-inbox-role { color: #60748a; font-size: 11px; }
.support-inbox-status { flex: 0 0 auto; padding: 2px 7px; border-radius: 999px; font-size: 9px; font-weight: 750; text-transform: uppercase; }
.support-inbox-status.is-open { color: #125fae; background: #eaf3ff; }
.support-inbox-status.is-resolved { color: #55705f; background: #edf6f0; }
.support-inbox-conversation-preview { display: -webkit-box; overflow: hidden; padding-right: 24px; color: #60748a; font-size: 11px; line-height: 1.4; text-overflow: ellipsis; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.support-inbox-conversation .support-inbox-unread { position: absolute; right: 12px; bottom: 13px; min-width: 19px; height: 19px; font-size: 9px; }
.support-inbox-list-empty { margin: auto; padding: 22px 16px; color: #74859a; font-size: 13px; text-align: center; }

.support-inbox-chat-panel { display: flex; min-width: 0; min-height: 0; flex-direction: column; background: #f7faff; }
.support-inbox-empty-state { display: grid; flex: 1 1 auto; align-content: center; justify-items: center; gap: 10px; padding: 28px; color: #64768c; text-align: center; }
.support-inbox-empty-state[hidden] { display: none !important; }
.support-inbox-empty-icon { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 50%; color: #1766d8; background: #e7f1ff; font-size: 21px; }
.support-inbox-empty-state strong { color: #29425d; font-size: 16px; }
.support-inbox-empty-state p { max-width: 330px; margin: 0; font-size: 13px; line-height: 1.5; }
.support-inbox-chat-content { display: flex; flex: 1 1 auto; min-height: 0; flex-direction: column; }
.support-inbox-chat-content[hidden] { display: none !important; }

.support-inbox-chat-header {
  display: flex;
  min-height: 76px;
  align-items: center;
  gap: 12px;
  padding: 12px 30px 12px 18px;
  border-bottom: 1px solid #e0e7ef;
  background: #fff;
}

.support-inbox-chat-identity { display: flex; min-width: 0; flex: 1 1 auto; flex-wrap: wrap; align-items: center; gap: 5px 9px; }
.support-inbox-chat-title { flex: 0 0 100%; min-width: 0; overflow: hidden; margin: 0; color: #1b3046; font-size: 16px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.support-inbox-chat-role { color: #61748a; font-size: 11px; }
.support-inbox-chat-status { padding: 3px 8px; border-radius: 999px; font-size: 9px; font-weight: 750; text-transform: uppercase; }
.support-inbox-chat-status.is-open { color: #125fae; background: #eaf3ff; }
.support-inbox-chat-status.is-resolved { color: #55705f; background: #edf6f0; }
.support-inbox-status-action { min-width: 104px; min-height: 35px; flex: 0 0 auto; padding: 0 11px; border: 1px solid #cbd8e6; border-radius: 9px; color: #3f5a76; background: #fff; font: 650 11px Inter, "Segoe UI", Arial, sans-serif; white-space: nowrap; cursor: pointer; }
.support-inbox-status-action:hover { border-color: #9abce2; color: #145fae; background: #f5faff; }
.support-inbox-status-action:disabled { opacity: .6; cursor: wait; }
.support-inbox-back { display: none; }

.support-inbox-messages {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
  padding: 20px clamp(13px, 3vw, 30px);
  overscroll-behavior: contain;
}

.support-inbox-messages > .support-inbox-empty { margin: auto; color: #718196; font-size: 13px; }
.support-inbox-message { max-width: min(76%, 620px); padding: 11px 14px; border-radius: 15px; }
.support-inbox-message.is-requester { align-self: flex-start; border-bottom-left-radius: 5px; }
.support-inbox-message.is-admin { align-self: flex-end; border-color: #c9ddfb; border-bottom-right-radius: 5px; background: #eaf3ff; }
.support-inbox-message p { font-size: 13px; }
.support-inbox-feedback { min-height: 22px; margin: 0; padding: 2px 18px; color: #60748a; font-size: 11px; }
.support-inbox-feedback.is-success { color: #087443; }
.support-inbox-feedback.is-error { color: #b42318; }
.support-inbox-composer { padding: 13px 16px; }

@media (max-width: 820px) {
  .admin-support-modal { width: 100%; height: calc(100dvh - 28px); }
  .support-admin-inbox { padding: 18px; }
  .support-inbox-layout { grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .admin-support-modal-backdrop { padding: 7px; }
  .admin-support-modal { height: calc(100dvh - 14px); min-height: 0; border-radius: 15px; }
  .support-admin-inbox { gap: 11px; padding: 13px; }
  .support-admin-inbox-title { font-size: 23px; }
  .support-admin-inbox-heading p { font-size: 12px; }
  .admin-support-modal-close { width: 36px; height: 36px; }
  .support-inbox-layout { position: relative; display: block; height: 100%; min-height: 0; }
  .support-inbox-list-panel,
  .support-inbox-chat-panel { height: 100%; min-height: 0; }
  .support-inbox-chat-panel { display: none; }
  .support-admin-inbox.has-selection .support-inbox-list-panel { display: none; }
  .support-admin-inbox.has-selection .support-inbox-chat-panel { display: flex; }
  .support-inbox-chat-header { min-height: 70px; padding: 10px 16px; gap: 8px; }
  .support-inbox-back { display: inline-flex; min-height: 34px; align-items: center; padding: 0 7px; border: 0; color: #1764c6; background: transparent; font: 650 11px Inter, "Segoe UI", Arial, sans-serif; cursor: pointer; }
  .support-inbox-status-action { min-width: 90px; padding-inline: 8px; font-size: 10px; }
  .support-inbox-message { max-width: 90%; }
  .support-inbox-composer { padding: 10px; }
  .support-inbox-composer textarea { min-height: 43px; }
  .support-inbox-send { padding-inline: 11px; }
}
