@import url("https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=block");
/**
 * inbox.css — /message/inbox
 * SSOT: wh-tokens.css · _wh-bridge.css (chip tabs)
 * v20260703c
 */

#body footer,
#body #ch-plugin {
  display: none !important;
}

html:has(.ib-tabs-wrap),
html:has(.ib-tabs-wrap) body,
html:has(.ib-tabs-wrap) body#body {
  background: var(--wh-bg, #f2f4f6) !important;
}

/* nav가 #content 밖(형제) — travel .tl-page 와 동일한 상단 여백 */
body:has(.wh-page-nav-wrap + #content:has(.ib-tabs-wrap)) .wh-page-nav-wrap {
  margin-bottom: calc(-1 * var(--wh-page-nav-h, 76px));
}

body:has(.wh-page-nav-wrap + #content:has(.ib-tabs-wrap)) .wh-page-nav-wrap .wh-page-nav {
  box-sizing: border-box;
  min-height: var(--wh-page-nav-h, 76px);
  padding-top: 16px;
  padding-bottom: 16px;
}

div#content:has(.ib-tabs-wrap) {
  padding-top: calc(var(--wh-page-nav-h, 76px) + 8px) !important;
  padding-right: 0 !important;
  padding-bottom: calc(var(--bottom-naverbar-height, 66px) + var(--safe-b, env(safe-area-inset-bottom, 0px))) !important;
  padding-left: 0 !important;
  overflow-y: visible !important;
  background: var(--wh-bg, #f2f4f6) !important;
}

/* ── Material Symbols ── */
.ib-ms {
  font-family: 'Material Symbols Rounded';
  font-weight: normal;
  font-style: normal;
  display: inline-block;
  white-space: nowrap;
  font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  line-height: 1;
  vertical-align: middle;
}

/* ── 헤더 검색 버튼 ── */
.ib-header-btn {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--wh-tx, #191f28);
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.ib-header-btn:active {
  background: var(--wh-brand-tint, #F3EEFA);
}

/* ── 탭 칩 — layout.css 이후 재적용 (SSOT: _wh-bridge.css .ib-tab) ── */
.ib-tabs-wrap {
  display: flex;
  gap: 8px;
  padding: 8px 16px 12px;
  margin-top: 0;
  padding-top: 8px;
  padding-bottom: 4px;
  background: var(--wh-bg, #f2f4f6);
  border-bottom: none;
  position: relative;
  top: auto;
  z-index: 1;
  flex-shrink: 0;
}

.ib-tab {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--wh-tx3, #8b95a1);
  border: 1px solid var(--wh-bd, rgba(0, 0, 0, 0.06));
  border-radius: var(--wh-radius-pill, 999px);
  background: var(--wh-card, #fff);
  cursor: pointer;
  font-family: 'Pretendard', -apple-system, sans-serif;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
}

.ib-tab.active {
  background: var(--wh-brand-tint, #F3EEFA);
  color: var(--wh-brand, #681DC7);
  border-color: var(--wh-info-bd, #D9CCF0);
  font-weight: 600;
}

html.wh-wehome-app .ib-tabs-wrap {
  margin-top: 0 !important;
  position: relative !important;
  top: auto !important;
  background: var(--wh-bg, #f2f4f6) !important;
}

/* ── 검색 패널 ── */
#ib-search-panel {
  display: none;
}

#ib-search-panel.open {
  display: block;
  position: fixed;
  background: var(--wh-bg, #f2f4f6);
  top: calc(var(--safe-t, env(safe-area-inset-top, 0px)) + var(--wh-page-nav-h, 76px));
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 720px;
  border-bottom: 1px solid var(--wh-bd, rgba(0, 0, 0, 0.06));
  z-index: 95;
  box-shadow: var(--wh-shadow-hover, 0 4px 12px rgba(0, 0, 0, 0.06));
}

.ib-search-wrap {
  padding: 10px 16px 12px;
}

.ib-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--wh-card, #fff);
  border: 1px solid var(--wh-bd, rgba(0, 0, 0, 0.06));
  border-radius: var(--wh-radius-btn, 18px);
  height: 44px;
  padding: 0 14px;
}

.ib-search-box input {
  flex: 1;
  border: none;
  background: none;
  font-size: 14px;
  color: var(--wh-tx, #191f28);
  outline: none;
  font-family: 'Pretendard', -apple-system, sans-serif;
}

.ib-search-box input::placeholder {
  color: var(--wh-tx3, #8b95a1);
}

/* ── 목록 (카드형) ── */
.ib-list {
  margin: 0;
  padding: 4px 16px 60px;
}

.ib-item-wrap {
  display: flex;
  align-items: stretch;
  position: relative;
  margin-bottom: 8px;
  background: var(--wh-card, #fff);
  border-radius: var(--wh-radius-md, 20px);
  box-shadow: var(--wh-shadow, 0 1px 3px rgba(0, 0, 0, 0.04));
  overflow: hidden;
}

.ib-item-wrap:last-child {
  margin-bottom: 0;
}

.ib-item-wrap[data-unread="1"]::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: var(--wh-brand, #681DC7);
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
}

.ib-item {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  gap: 14px;
  padding: 14px 8px 14px 18px;
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  background: transparent;
}

.ib-item:active {
  background: var(--wh-brand-tint, #F3EEFA);
}

.ib-menu-btn {
  flex-shrink: 0;
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--wh-tx3, #8b95a1);
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.ib-menu-btn:active {
  color: var(--wh-tx2, #4e5968);
}

.ib-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.ib-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--wh-surface, #f4f5f7);
  display: block;
}

.ib-content {
  flex: 1;
  min-width: 0;
}

.ib-row1 {
  margin-bottom: 3px;
}

.ib-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--wh-tx, #191f28);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.ib-item.unread .ib-name {
  font-weight: 800;
}

.ib-time-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
  align-self: center;
}

.ib-time {
  font-size: 12px;
  color: var(--wh-tx3, #8b95a1);
  line-height: 1;
  white-space: nowrap;
}

.ib-item.unread .ib-time {
  color: var(--wh-tx2, #4e5968);
  font-weight: 500;
}

.ib-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--wh-brand-tint, #F3EEFA);
  color: var(--wh-brand, #681DC7);
  border: 1px solid var(--wh-info-bd, #D9CCF0);
  border-radius: var(--wh-radius-pill, 999px);
  font-size: 10px;
  font-weight: 700;
}

.ib-preview {
  font-size: 13px;
  color: var(--wh-tx2, #4e5968);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.ib-item.unread .ib-preview {
  color: var(--wh-tx, #191f28);
  font-weight: 500;
}

.ib-prop {
  font-size: 11px;
  color: var(--wh-tx3, #8b95a1);
  display: flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#ib-no-result {
  display: none;
  text-align: center;
  padding: 60px 24px;
  color: var(--wh-tx2, #4e5968);
}

/* ── 바텀시트 ── */
.ib-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, .4);
  align-items: flex-end;
  justify-content: center;
}

.ib-modal-overlay.open {
  display: flex;
}

.ib-sheet {
  background: var(--wh-card, #fff);
  width: 100%;
  max-width: 520px;
  border-radius: var(--wh-radius-md, 20px) var(--wh-radius-md, 20px) 0 0;
  overflow: hidden;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  animation: ib-slide-up .25s ease;
}

@keyframes ib-slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.ib-sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--wh-bd, rgba(0, 0, 0, 0.06));
  border-radius: 2px;
  margin: 12px auto 4px;
}

.ib-sheet-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 20px;
  text-decoration: none;
  color: var(--wh-tx, #191f28);
  font-size: 15px;
  font-weight: 500;
  font-family: 'Pretendard', -apple-system, sans-serif;
  border: none;
  background: none;
  cursor: pointer;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
}

.ib-sheet-item--danger {
  color: var(--wh-err-tx, #b91c1c);
}

.ib-sheet-item--danger .ib-sheet-icon {
  color: var(--wh-err-tx, #b91c1c);
}

.ib-sheet-icon {
  font-size: 22px;
  color: var(--wh-tx2, #4e5968);
}

/* ── Agoda 미리보기 ── */
.ib-agoda-section {
  margin: 0 16px 8px;
  background: var(--wh-card, #fff);
  border-radius: var(--wh-radius-md, 20px);
  box-shadow: var(--wh-shadow, 0 1px 3px rgba(0, 0, 0, 0.04));
  overflow: hidden;
}

.ib-agoda-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px 4px;
}

.ib-agoda-section-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--wh-tx2, #4e5968);
}

.ib-agoda-section-head a,
.ib-agoda-section-head a:hover,
.ib-agoda-section-head a:focus,
.ib-agoda-section-head a:active {
  font-size: 12px;
  font-weight: 500;
  color: var(--wh-link, #0071e3);
  text-decoration: none !important;
  white-space: nowrap;
}

.ib-agoda-item-wrap .ib-item {
  padding-left: 12px;
}

.ib-agoda-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #003580;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  object-fit: unset;
}

.ib-agoda-empty-note {
  padding: 4px 16px 14px;
  font-size: 13px;
  color: var(--wh-tx2, #4e5968);
  line-height: 1.45;
}

/* ── PC: 더보기/로그인 시트 → 중앙 다이얼로그 ── */
@media (min-width: 1024px) {
  html.sp-force-desktop-ui .ib-modal-overlay {
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(25, 31, 40, 0.45);
  }

  html.sp-force-desktop-ui .ib-sheet {
    width: 100%;
    max-width: 400px;
    border-radius: var(--wh-radius-lg, 24px);
    padding: 8px 0 12px;
    box-shadow: 0 16px 48px rgba(25, 31, 40, 0.18);
    animation: ib-modal-in 0.2s ease;
  }

  html.sp-force-desktop-ui .ib-sheet-handle {
    display: none;
  }

  html.sp-force-desktop-ui .ib-sheet-item {
    padding: 14px 20px;
    border-radius: 12px;
    margin: 0 8px;
    width: calc(100% - 16px);
  }

  html.sp-force-desktop-ui .ib-sheet-item:hover {
    background: var(--wh-bg, #f2f4f6);
    text-decoration: none;
  }

  html.sp-force-desktop-ui a.ib-sheet-item:hover,
  html.sp-force-desktop-ui a.ib-sheet-item:focus {
    text-decoration: none;
  }
}

@keyframes ib-modal-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
