.chat-fab {
  position: fixed;
  z-index: 80;
  right: max(1rem, env(safe-area-inset-right));
  bottom: calc(4.75rem + env(safe-area-inset-bottom));
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 999px;
  border: 0;
  background: #1a2744;
  color: #fff;
  box-shadow: 0 12px 28px rgba(26, 39, 68, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-fab:hover { background: #243456; }
.chat-fab svg { width: 1.55rem; height: 1.55rem; }
.chat-fab-badge {
  position: absolute;
  top: -0.2rem;
  right: -0.15rem;
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-fab-badge.hidden { display: none; }
@media (min-width: 768px) {
  .chat-fab {
    right: 1.5rem;
    bottom: 1.5rem;
    width: 3.85rem;
    height: 3.85rem;
  }
}

.chat-backdrop {
  position: fixed;
  inset: 0;
  z-index: 85;
  background: rgba(18, 20, 26, 0.28);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.36s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0s linear 0.36s;
}
.chat-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.chat-panel {
  position: fixed;
  inset: auto;
  left: 1rem;
  right: 1rem;
  top: 50%;
  z-index: 90;
  display: flex;
  flex-direction: column;
  width: auto;
  max-width: 24.5rem;
  margin-inline: auto;
  height: min(36rem, 72dvh);
  max-height: calc(100dvh - 5.5rem);
  background: #f4efe6;
  min-height: 0;
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(26, 39, 68, 0.28);
  border: 1px solid rgba(26, 39, 68, 0.08);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(calc(-50% + 16px)) scale(0.96);
  transform-origin: 50% 50%;
  transition:
    opacity 0.36s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.36s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0s linear 0.36s;
}
.chat-panel.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
  transition-delay: 0s;
}
@media (min-width: 768px) {
  .chat-backdrop { display: none; }
  .chat-panel {
    left: auto;
    top: auto;
    right: 1.5rem;
    bottom: 6.4rem;
    width: 392px;
    height: 640px;
    max-height: calc(100dvh - 7.5rem);
    border-radius: 1.7rem;
    margin-inline: 0;
    transform: translate3d(0, 16px, 0) scale(0.98);
    transform-origin: 100% 100%;
  }
  .chat-panel.is-open {
    transform: translate3d(0, 0, 0) scale(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .chat-backdrop,
  .chat-panel {
    transition: none;
  }
  .chat-panel.is-open {
    transform: none;
  }
}
@media (min-width: 768px) and (prefers-reduced-motion: reduce) {
  .chat-panel,
  .chat-panel.is-open {
    transform: none;
  }
}
.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.85rem 0.75rem 0.85rem 0.55rem;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(232, 184, 74, 0.22), transparent 46%),
    linear-gradient(180deg, #243456 0%, #1a2744 100%);
  color: #fff;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(232, 184, 74, 0.18);
}
.chat-head-main {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}
.chat-avatar {
  position: relative;
  width: 2.85rem;
  height: 2.85rem;
  flex-shrink: 0;
}
.chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.18rem;
  border-radius: 999px;
  border: 1.5px solid rgba(232, 184, 74, 0.7);
  background: #f7f4ee;
  display: block;
}
.chat-avatar-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 999px;
  background: #34d399;
  border: 2px solid #1a2744;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18);
}
.chat-head-copy { min-width: 0; }
.chat-head-title {
  font-size: 1.02rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.15;
}
.chat-honey { color: #e8b84a; }
.chat-head-hours {
  margin-top: 0.22rem;
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.3;
}
.chat-head-note {
  color: #e8b84a;
  font-weight: 800;
}
.chat-head-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}
.chat-panel.is-faq .chat-head {
  padding-left: 0.95rem;
}
.chat-back-btn {
  flex-shrink: 0;
  align-self: center;
  background: transparent;
}
.chat-back-btn:hover {
  background: rgba(255,255,255,0.1);
}
.chat-back-btn svg {
  width: 1.2rem;
  height: 1.2rem;
}
.chat-faq-btn {
  height: 2.55rem;
  min-width: 5.6rem;
  padding: 0 1.05rem;
  border-radius: 999px;
  border: 1px solid rgba(232, 184, 74, 0.45);
  background: rgba(232, 184, 74, 0.12);
  color: #e8b84a;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.chat-faq-btn:hover,
.chat-faq-btn.is-on {
  background: #e8b84a;
  color: #1a2744;
  border-color: #e8b84a;
}
.chat-icon-btn {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  border: 0;
  background: rgba(255,255,255,0.08);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-icon-btn.is-light {
  background: #f4f0ea;
  color: #1a2744;
}
.chat-icon-btn svg { width: 1.05rem; height: 1.05rem; }
.chat-body {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.chat-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 0.9rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(80% 40% at 100% 0%, rgba(232, 184, 74, 0.08), transparent 50%),
    #f4efe6;
}
.chat-intro {
  margin: 0.15rem 0 0.4rem;
  padding: 1.05rem 1rem 1rem;
  border-radius: 1.25rem;
  background: #fff;
  box-shadow: 0 10px 24px rgba(26, 39, 68, 0.06);
}
.chat-intro-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #6d28d9;
}
.chat-intro h2 {
  margin-top: 0.28rem;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}
.chat-intro p {
  margin-top: 0.4rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: rgba(18, 20, 26, 0.55);
}
.chat-intro-chips {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.85rem;
}
.chat-chip {
  width: 100%;
  text-align: left;
  border: 1px solid #ece6dc;
  background: #fbf8f3;
  border-radius: 0.9rem;
  padding: 0.65rem 0.8rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: #1a2744;
}
.chat-chip:hover { border-color: #e8b84a; background: #fff8e8; }
.chat-faq {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: #fbf8f3;
  display: flex;
  flex-direction: column;
}
.chat-faq.hidden { display: none; }
.chat-faq-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.9rem;
  background: #fff;
  border-bottom: 1px solid #ece6dc;
  font-size: 0.92rem;
  font-weight: 900;
}
.chat-faq-list {
  overflow-y: auto;
  padding: 0.7rem 0.85rem 1rem;
}
.chat-faq-list details {
  background: #fff;
  border-radius: 0.95rem;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.45rem;
  border: 1px solid #ece6dc;
}
.chat-faq-list summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
  list-style: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}
.chat-faq-list summary::after {
  content: "+";
  color: #e8b84a;
  font-weight: 900;
  flex-shrink: 0;
}
.chat-faq-list details[open] summary::after { content: "–"; }
.chat-faq-list summary::-webkit-details-marker { display: none; }
.chat-faq-list details p {
  margin-top: 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(18, 20, 26, 0.58);
  line-height: 1.5;
  white-space: pre-line;
}
.chat-faq-empty,
.chat-faq-more {
  display: block;
  text-align: center;
  margin-top: 0.6rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: #6d28d9;
}
.chat-guest-bar {
  flex-shrink: 0;
  padding: 0.75rem 0.85rem max(0.9rem, env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid #ece6dc;
  box-shadow: 0 -10px 24px rgba(26, 39, 68, 0.05);
}
.chat-blocked-bar p {
  color: #be123c;
}
.chat-guest-bar p {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: rgba(18, 20, 26, 0.5);
}
.chat-guest-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.55rem;
  height: 2.85rem;
  border-radius: 0.95rem;
  background: linear-gradient(180deg, #243456 0%, #1a2744 100%);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  box-shadow: 0 8px 18px rgba(26, 39, 68, 0.22);
}
.chat-guest-cta::after {
  content: "→";
  color: #e8b84a;
  font-size: 1rem;
}
.chat-guest-cta:hover { filter: brightness(1.06); }
.chat-bubble {
  max-width: 82%;
  padding: 0.7rem 0.85rem 0.5rem;
  border-radius: 1.1rem;
  font-size: 0.9rem;
  line-height: 1.45;
  word-break: break-word;
}
.chat-bubble.is-customer {
  align-self: flex-end;
  background: #6d28d9;
  color: #fff;
  border-bottom-right-radius: 0.35rem;
}
.chat-bubble.is-agent {
  align-self: flex-start;
  background: #fff;
  color: #12141a;
  border-bottom-left-radius: 0.35rem;
  box-shadow: 0 6px 16px rgba(18, 20, 26, 0.05);
}
.chat-bubble.is-system {
  align-self: center;
  max-width: 92%;
  background: rgba(26, 39, 68, 0.08);
  color: rgba(18, 20, 26, 0.7);
  font-size: 0.8rem;
  text-align: center;
}
.chat-who {
  font-size: 11px;
  font-weight: 800;
  color: #6d28d9;
  margin-bottom: 0.2rem;
}
.chat-log .chat-who {
  display: none !important;
}
.chat-log .chat-receipt,
.chat-log .chat-typing {
  display: none !important;
}
.chat-text { white-space: pre-wrap; }
.chat-bubble time {
  display: block;
  margin-top: 0.28rem;
  font-size: 10px;
  opacity: 0.55;
  font-weight: 700;
}
.chat-bubble.is-customer time { text-align: right; }
.chat-image {
  display: block;
  max-width: 100%;
  border-radius: 0.8rem;
  margin-top: 0.35rem;
}
.chat-file {
  display: inline-flex;
  margin-top: 0.3rem;
  font-size: 0.8rem;
  font-weight: 800;
  text-decoration: underline;
}
.chat-form,
.admin-chat-form {
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
  padding: 0.65rem 0.75rem;
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid #e8e2d8;
  flex-shrink: 0;
}
.chat-panel.is-faq.has-consulted .chat-form {
  display: none;
}
.chat-form textarea,
.admin-chat-form textarea {
  flex: 1;
  resize: none;
  min-height: 2.7rem;
  max-height: 7.5rem;
  border: 1px solid #e8e2d8;
  border-radius: 1rem;
  padding: 0.7rem 0.85rem;
  font-size: 16px;
  line-height: 1.4;
  outline: none;
}
.chat-form textarea:focus,
.admin-chat-form textarea:focus { border-color: #6d28d9; }
.chat-attach {
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 0.9rem;
  background: #f4f0ea;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.chat-attach input { display: none; }
.chat-attach svg { width: 1.2rem; height: 1.2rem; color: #1a2744; }
.chat-send {
  height: 2.7rem;
  min-width: 3.4rem;
  padding: 0 0.9rem;
  border: 0;
  border-radius: 0.9rem;
  background: #1a2744;
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
}
@media (max-width: 767px) {
  html.chat-open,
  body.chat-open {
    overflow: hidden;
    overscroll-behavior: none;
  }
  body.chat-open .chat-fab {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
  .chat-head {
    padding-top: 0.9rem;
  }
  .chat-icon-btn {
    width: 2.45rem;
    height: 2.45rem;
  }
  .chat-send {
    height: 2.85rem;
    min-width: 3.8rem;
  }
  .chat-guest-bar,
  .chat-form {
    padding-bottom: 0.85rem;
  }
}

.admin-chat {
  display: grid;
  grid-template-columns: 1fr;
  height: calc(100dvh - 7.5rem);
  max-height: calc(100dvh - 7.5rem);
  min-height: 0;
  margin: -0.25rem -1rem -1.5rem;
  background: #fff;
  border-radius: 1.4rem;
  overflow: hidden;
  border: 1px solid rgba(18, 20, 26, 0.06);
  position: relative;
}
.admin-chat > * {
  min-width: 0;
  min-height: 0;
}
@media (min-width: 1024px) {
  .admin-chat {
    grid-template-columns: 300px 1fr;
    height: calc(100vh - 8rem);
    max-height: calc(100vh - 8rem);
    margin: 0;
  }
}
@media (min-width: 1280px) {
  .admin-chat {
    grid-template-columns: 16.75rem minmax(16rem, 1fr) minmax(28rem, 36rem);
  }
}
@media (min-width: 1600px) {
  .admin-chat {
    grid-template-columns: 17.5rem minmax(18rem, 1fr) minmax(34rem, 42rem);
  }
}
.admin-chat-nav {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid rgba(18, 20, 26, 0.06);
  background: #fbf8f3;
}
.admin-chat-filters {
  flex-shrink: 0;
  padding: 0.85rem 0.8rem 0.7rem;
  border-bottom: 1px solid rgba(18, 20, 26, 0.06);
}
.admin-chat-filter-label {
  margin: 0 0 0.35rem;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: rgba(18, 20, 26, 0.38);
}
.admin-chat-filter-label:not(:first-child) {
  margin-top: 0.75rem;
}
.admin-chat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.admin-chat-tabs button {
  height: 1.7rem;
  padding: 0 0.55rem;
  border: 0;
  border-radius: 999px;
  background: rgba(18, 20, 26, 0.05);
  color: rgba(18, 20, 26, 0.55);
  font-size: 11px;
  font-weight: 800;
}
.admin-chat-tabs button.is-on {
  background: #1a2744;
  color: #fff;
}
.admin-chat-tabs span {
  font-weight: 700;
  opacity: 0.7;
}
.admin-chat-list {
  flex: 1;
  overflow-y: auto;
  background: transparent;
  border-right: 0;
}
.admin-chat-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.9rem 1rem;
  border: 0;
  border-bottom: 1px solid rgba(18, 20, 26, 0.05);
  background: transparent;
}
.admin-chat-item.is-on { background: #fff; }
.admin-chat-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.9rem;
}
.admin-chat-count {
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.admin-chat-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0.3rem 0 0.15rem;
}
.admin-chat-tag {
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: rgba(18, 20, 26, 0.06);
  color: rgba(18, 20, 26, 0.55);
}
.admin-chat-tag.is-waiting { background: #fef3c7; color: #92400e; }
.admin-chat-tag.is-empty { background: #f3f4f6; color: #6b7280; }
.admin-chat-tag.is-progress { background: #dbeafe; color: #1d4ed8; }
.admin-chat-tag.is-hold { background: #e5e7eb; color: #374151; }
.admin-chat-tag.is-done { background: #d1fae5; color: #047857; }
.admin-chat-tag.is-blocked { background: #ffe4e6; color: #be123c; }
.admin-chat-tag.is-agent { background: #ede9fe; color: #5b21b6; }
.admin-chat-item-preview {
  display: block;
  margin-top: 0.2rem;
  font-size: 13px;
  font-weight: 600;
  color: rgba(18, 20, 26, 0.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-chat-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.28rem;
}
.admin-chat-item-phone,
.admin-chat-item-time {
  display: block;
  font-size: 11px;
  color: rgba(18, 20, 26, 0.38);
  font-weight: 700;
}
.admin-chat-item-time {
  flex-shrink: 0;
  letter-spacing: -0.02em;
}
.admin-chat-empty { padding: 2rem 1rem; text-align: center; color: rgba(18,20,26,0.4); font-size: 0.875rem; }
.admin-chat-thread {
  display: none;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: #f7f4ee;
}
.admin-chat-thread.is-open { display: flex; }
@media (min-width: 1024px) {
  .admin-chat-thread { display: flex; }
}
.admin-chat-thread.is-idle .admin-chat-log { display: flex; align-items: center; justify-content: center; }
.admin-chat-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #fff;
  border-bottom: 1px solid rgba(18, 20, 26, 0.06);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.admin-chat-head-copy {
  min-width: 8rem;
}
.admin-chat-head-tools {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}
.admin-chat-field {
  display: grid;
  gap: 0.15rem;
}
.admin-chat-field span {
  font-size: 10px;
  font-weight: 800;
  color: rgba(18, 20, 26, 0.4);
}
.admin-chat-field select {
  height: 2rem;
  min-width: 6.2rem;
  padding: 0 0.55rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(18, 20, 26, 0.1);
  background: #f7f4ee;
  font-size: 12px;
  font-weight: 800;
  color: #1a2744;
}
.admin-chat-block {
  height: 2rem;
  padding: 0 0.7rem;
  border-radius: 0.7rem;
  border: 0;
  background: #fff1f2;
  color: #be123c;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}
.admin-chat-block.is-on {
  background: #1a2744;
  color: #fff;
}
.admin-chat-done {
  height: 2rem;
  padding: 0 0.75rem;
  border-radius: 0.7rem;
  border: 0;
  background: #1a2744;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.admin-chat-done:disabled {
  background: #d1fae5;
  color: #047857;
  cursor: default;
}
.admin-chat-back {
  height: 2.2rem;
  padding: 0 0.7rem;
  border-radius: 0.7rem;
  border: 0;
  background: #f4f0ea;
  font-weight: 800;
  font-size: 12px;
}
.admin-chat-orders-toggle {
  height: 2rem;
  padding: 0 0.7rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(18, 20, 26, 0.1);
  background: #1a2744;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.admin-chat-orders-toggle.hidden { display: none; }
.admin-chat-orders {
  display: none;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  background: #fff;
  border-left: 1px solid rgba(18, 20, 26, 0.06);
}
.admin-chat-orders-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.9rem 1rem 0.7rem;
  border-bottom: 1px solid rgba(18, 20, 26, 0.06);
  flex-shrink: 0;
}
.admin-chat-orders-title {
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}
.admin-chat-orders-login {
  margin-top: 0.2rem;
  font-size: 11px;
  font-weight: 700;
  color: rgba(18, 20, 26, 0.42);
  word-break: break-all;
}
.admin-chat-orders-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
.admin-chat-orders-back,
.admin-chat-orders-close {
  height: 1.9rem;
  padding: 0 0.6rem;
  border: 0;
  border-radius: 0.6rem;
  background: #f4f0ea;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.admin-chat-orders-back.hidden { display: none; }
.admin-chat-orders-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  background: #1a2744;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}
.admin-chat-orders-summary:empty { display: none; }
.admin-chat-orders-summary strong {
  margin-right: 0.15rem;
  font-size: 1.05rem;
  color: #e8b84a;
}
.admin-chat-orders-list {
  flex: 1 1 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  padding: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.admin-chat-orders-list::-webkit-scrollbar {
  width: 8px;
}
.admin-chat-orders-list::-webkit-scrollbar-thumb {
  background: rgba(18, 20, 26, 0.2);
  border-radius: 999px;
}
.admin-chat-orders-empty {
  padding: 1.4rem 0.6rem;
  text-align: center;
  color: rgba(18, 20, 26, 0.4);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}
.admin-chat-order-wrap {
  flex: 0 0 auto;
  min-height: min-content;
  border-radius: 0.95rem;
  background: #f7f4ee;
  overflow: hidden;
}
.admin-chat-order-wrap.is-open {
  background: #f3ead9;
  box-shadow: inset 0 0 0 1.5px rgba(232, 184, 74, 0.55);
}
.admin-chat-order {
  display: grid;
  gap: 0.22rem;
  width: 100%;
  padding: 0.75rem 0.8rem;
  border: 0;
  border-radius: 0.95rem;
  background: transparent;
  color: #12141a;
  text-align: left;
  cursor: pointer;
}
.admin-chat-order:hover {
  background: rgba(18, 20, 26, 0.04);
}
.admin-chat-order-wrap.is-open .admin-chat-order {
  border-radius: 0.95rem 0.95rem 0 0;
}
.admin-chat-order-panel {
  display: none;
  padding: 0 0.65rem 0.75rem;
  gap: 0.55rem;
}
.admin-chat-order-wrap.is-open .admin-chat-order-panel {
  display: grid;
}
.admin-chat-order-panel .admin-chat-order-detail {
  display: grid;
  gap: 0.55rem;
  padding: 0;
  overflow: visible;
  min-height: 0;
}
.admin-chat-order-panel .admin-chat-detail-card {
  background: #fff;
}
.admin-chat-order-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.admin-chat-order-top strong {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: -0.02em;
}
.admin-chat-order-item {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: rgba(18, 20, 26, 0.62);
  line-height: 1.35;
}
.admin-chat-order-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.15rem;
  font-size: 11px;
  color: rgba(18, 20, 26, 0.42);
}
.admin-chat-order-foot b {
  font-size: 13px;
  font-weight: 900;
  color: #12141a;
}
.admin-chat-order-detail {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.85rem 1rem 1.15rem;
  display: grid;
  align-content: start;
  gap: 0.7rem;
}
.admin-chat-detail-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.admin-chat-order-panel .admin-chat-detail-status time {
  display: none;
}
.admin-chat-detail-card {
  display: grid;
  gap: 0.45rem;
  padding: 0.8rem 0.85rem;
  border-radius: 0.95rem;
  background: #f7f4ee;
}
.admin-chat-detail-card h3 {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: rgba(18, 20, 26, 0.42);
}
.admin-chat-detail-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 13px;
  font-weight: 700;
}
.admin-chat-detail-line span {
  color: rgba(18, 20, 26, 0.5);
  flex-shrink: 0;
}
.admin-chat-detail-line b,
.admin-chat-detail-line strong {
  text-align: right;
  font-weight: 800;
}
.admin-chat-detail-item {
  display: grid;
  gap: 0.12rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(18, 20, 26, 0.06);
}
.admin-chat-detail-item:first-of-type {
  padding-top: 0;
  border-top: 0;
}
.admin-chat-detail-item p {
  font-size: 13px;
  font-weight: 800;
}
.admin-chat-detail-item small {
  font-size: 11px;
  font-weight: 700;
  color: rgba(18, 20, 26, 0.45);
}
.admin-chat-detail-total {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(18, 20, 26, 0.08);
  font-size: 14px;
  font-weight: 900;
}
.admin-chat-detail-note {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-order-status {
  display: inline-flex;
  align-items: center;
  height: 1.35rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  background: #e7e5e4;
  color: #44403c;
}
.chat-order-status.is-pending { background: #ffedd5; color: #9a3412; }
.chat-order-status.is-paid { background: #e0f2fe; color: #075985; }
.chat-order-status.is-processing { background: #fef3c7; color: #92400e; }
.chat-order-status.is-issued { background: #d1fae5; color: #065f46; }
.chat-order-status.is-cancelled { background: #ffe4e6; color: #9f1239; }
.chat-order-status.is-refunded { background: #e7e5e4; color: #44403c; }
.admin-chat-orders-mask {
  display: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.admin-chat.is-orders-open .admin-chat-thread.is-open {
  right: min(32rem, 58vw);
}
.admin-chat.is-orders-open .admin-chat-orders {
  display: flex;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(32rem, 58vw);
  z-index: 5;
  box-shadow: -16px 0 40px rgba(18, 20, 26, 0.16);
}
.admin-chat.is-orders-open .admin-chat-orders-mask {
  display: block;
  position: absolute;
  inset: 0;
  right: min(32rem, 58vw);
  z-index: 4;
  background: rgba(18, 20, 26, 0.18);
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .admin-chat.is-orders-open {
    grid-template-columns: minmax(0, 1fr) minmax(26rem, 32rem);
  }
  .admin-chat.is-orders-open .admin-chat-nav {
    display: none;
  }
  .admin-chat.is-orders-open .admin-chat-thread.is-open {
    right: auto;
  }
  .admin-chat.is-orders-open .admin-chat-orders {
    position: static;
    width: auto;
    box-shadow: none;
  }
  .admin-chat.is-orders-open .admin-chat-orders-mask {
    display: none !important;
  }
}
@media (min-width: 1280px) {
  .admin-chat-orders { display: flex; }
  .admin-chat-orders-toggle,
  .admin-chat-orders-close,
  .admin-chat-orders-mask,
  .admin-chat.is-orders-open .admin-chat-orders-mask { display: none !important; }
  .admin-chat.is-orders-open .admin-chat-orders {
    position: static;
    width: auto;
    box-shadow: none;
  }
}
.admin-chat-log {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.admin-chat-log .chat-bubble {
  flex-shrink: 0;
}
.admin-chat-log .chat-bubble.is-customer {
  align-self: auto;
  background: #fff;
  color: #12141a;
  border-bottom-left-radius: 0.35rem;
  border-bottom-right-radius: 1.1rem;
  box-shadow: 0 6px 16px rgba(18, 20, 26, 0.05);
}
.admin-chat-log .chat-bubble.is-agent {
  align-self: auto;
  background: #1a2744;
  color: #fff;
  border-bottom-right-radius: 0.35rem;
  border-bottom-left-radius: 1.1rem;
}
.admin-chat-log .chat-bubble.is-agent .chat-who {
  display: block;
  color: rgba(255, 255, 255, 0.55);
  text-align: right;
}
.admin-chat-log .chat-bubble.is-agent time {
  text-align: right;
}
.admin-chat-log .chat-bubble.is-customer time {
  text-align: left;
}
.admin-chat-log .chat-bubble.is-agent .chat-receipt {
  display: block;
  margin-top: 0.18rem;
  font-size: 10px;
  font-weight: 800;
  text-align: right;
  color: rgba(255, 255, 255, 0.42);
  letter-spacing: -0.02em;
}
.admin-chat-log .chat-bubble.is-agent .chat-receipt.is-read {
  color: #e8b84a;
}
.admin-chat-log .chat-row {
  display: flex;
  align-items: flex-end;
  gap: 0.4rem;
  max-width: 92%;
  min-width: 0;
  flex-shrink: 0;
}
.admin-chat-log .chat-row.is-agent {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.admin-chat-log .chat-row.is-customer,
.admin-chat-log .chat-row.is-system {
  align-self: flex-start;
  flex-direction: row;
}
.admin-chat-log .chat-row .chat-bubble {
  max-width: 100%;
}
.admin-chat-log .chat-row-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.22rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  flex-shrink: 0;
}
.admin-chat-log .chat-row:hover .chat-row-actions,
.admin-chat-log .chat-row:focus-within .chat-row-actions {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}
.admin-chat-log .chat-row:hover .chat-bubble,
.admin-chat-log .chat-row:focus-within .chat-bubble {
  box-shadow: 0 0 0 2px #e8b84a;
}
.admin-chat-log .chat-copy,
.admin-chat-log .chat-recall {
  height: 1.55rem;
  padding: 0 0.55rem;
  border: 0;
  border-radius: 0.5rem;
  background: #fff;
  color: #1a2744;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(18, 20, 26, 0.1);
  cursor: pointer;
}
.admin-chat-log .chat-recall {
  background: #fff1f2;
  color: #be123c;
}
.admin-chat-log .chat-copy:hover,
.admin-chat-log .chat-recall:hover {
  filter: brightness(0.97);
}
.chat-log .chat-row {
  display: flex;
  align-items: flex-end;
  gap: 0.4rem;
  max-width: 92%;
  min-width: 0;
  flex-shrink: 0;
}
.chat-log .chat-row.is-customer {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.chat-log .chat-row.is-agent,
.chat-log .chat-row.is-system {
  align-self: flex-start;
  flex-direction: row;
}
.chat-log .chat-row .chat-bubble {
  align-self: auto;
  max-width: 100%;
}
.chat-bubble.is-recalled {
  opacity: 0.78;
}
.chat-text.chat-recalled {
  margin: 0;
  font-style: italic;
  font-weight: 700;
  opacity: 0.78;
}
.admin-chat-log .chat-bubble.is-agent.is-recalled .chat-recalled {
  color: rgba(255, 255, 255, 0.72);
  opacity: 1;
}
.chat-log .chat-bubble.is-recalled,
.chat-bubble.is-customer.is-recalled {
  background: rgba(18, 20, 26, 0.06);
  color: rgba(18, 20, 26, 0.55);
  box-shadow: none;
}
.admin-chat-item.is-typing,
.admin-chat-item.is-on.is-typing {
  background: #fff1f2;
  box-shadow: inset 4px 0 0 #e11d48;
}
.admin-chat-tag.is-typing {
  background: #e11d48;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.2;
  padding: 0.32rem 0.7rem;
  animation: admin-typing-pulse 1.1s ease-in-out infinite;
}
@keyframes admin-typing-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.06); opacity: 0.88; }
}
.chat-typing {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 1rem 0.55rem;
  background: #f7f4ee;
  flex-shrink: 0;
}
.chat-typing.hidden { display: none; }
.chat-typing-bubble {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  padding: 0.55rem 0.75rem;
  border-radius: 1.1rem;
  border-bottom-left-radius: 0.35rem;
  background: #fff;
  box-shadow: 0 6px 16px rgba(18, 20, 26, 0.05);
}
.chat-typing-bubble span {
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 999px;
  background: #1a2744;
  opacity: 0.28;
  animation: chat-typing-dot 1.1s ease-in-out infinite;
}
.chat-typing-bubble span:nth-child(2) { animation-delay: 0.16s; }
.chat-typing-bubble span:nth-child(3) { animation-delay: 0.32s; }
.chat-typing p {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  color: rgba(18, 20, 26, 0.42);
}
@keyframes chat-typing-dot {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.28; }
  40% { transform: translateY(-3px); opacity: 0.8; }
}
.admin-nav-badge {
  margin-left: 0.35rem;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}
.admin-nav-badge.hidden { display: none; }

@media (max-width: 1023px) {
  .admin-chat-thread {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: none;
  }
  .admin-chat { position: relative; }
  .admin-chat-thread.is-open { display: flex; }
}

.admin-customer-split {
  margin-top: 1.25rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: stretch;
}
@media (min-width: 1024px) {
  .admin-customer-split {
    grid-template-columns: 1fr 1fr;
  }
}
.admin-customer-chat {
  margin-top: 0;
  width: auto;
  min-width: 0;
  background: #fff;
  border-radius: 1.5rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: max(calc(17rem + 150px), calc(100vh - 14rem - 150px));
  max-height: calc(100vh - 12rem - 150px);
}
.admin-customer-chat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid rgba(18, 20, 26, 0.06);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.admin-customer-chat-head-copy {
  min-width: 7rem;
  flex: 1 1 8rem;
}
.admin-customer-chat-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 0.4rem;
  margin-left: auto;
}
.admin-customer-chat-tools .admin-chat-field select {
  min-width: 5.4rem;
}
.admin-customer-chat-tools .admin-chat-block {
  height: 2rem;
  padding: 0 0.7rem;
  border-radius: 0.7rem;
  cursor: pointer;
}
.admin-customer-chat-tools .admin-chat-done {
  cursor: pointer;
}
.admin-customer-chat-prev {
  flex-shrink: 0;
  height: 2.2rem;
  padding: 0 0.8rem;
  border-radius: 0.7rem;
  border: 0;
  background: #f4f0ea;
  color: #1a2744;
  font-weight: 800;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}
.admin-customer-chat-prev[hidden] {
  display: none;
}
.admin-customer-chat-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 900;
  color: #1a2744;
}
.admin-customer-chat-meta {
  margin: 0.2rem 0 0;
  font-size: 12px;
  font-weight: 700;
  color: rgba(18, 20, 26, 0.4);
}
.admin-customer-chat .admin-chat-log {
  flex: 1 1 auto;
  height: auto;
  max-height: none;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #f7f4ee;
}
.admin-customer-chat .admin-chat-log .chat-bubble {
  flex-shrink: 0;
}
.admin-customer-chat .admin-chat-form,
.admin-customer-chat .chat-typing {
  flex-shrink: 0;
}
.admin-customer-chat-empty {
  margin: 0;
  padding: 2.5rem 1.25rem;
  text-align: center;
  color: rgba(18, 20, 26, 0.4);
  font-size: 0.9rem;
}
.admin-customer-orders {
  min-width: 0;
  background: #fff;
  border-radius: 1.5rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: max(calc(17rem + 150px), calc(100vh - 14rem - 150px));
  max-height: calc(100vh - 12rem - 150px);
}
.admin-customer-orders-head {
  flex-shrink: 0;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(18, 20, 26, 0.06);
}
.admin-customer-orders-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.admin-customer-panel .admin-customer-split {
  margin-top: 0;
}
.admin-customer-panel .admin-customer-orders {
  order: 1;
}
.admin-customer-panel .admin-customer-chat {
  order: 2;
}
.admin-customer-panel .admin-customer-chat,
.admin-customer-panel .admin-customer-orders {
  height: calc(26rem + 300px);
  max-height: calc(26rem + 300px);
  border-radius: 1.1rem;
}
@media (max-width: 1023px) {
  .admin-customer-split {
    grid-template-columns: 1fr;
  }
  .admin-customer-chat,
  .admin-customer-orders {
    height: 32rem;
    max-height: 32rem;
  }
  .admin-customer-panel .admin-customer-chat,
  .admin-customer-panel .admin-customer-orders {
    height: calc(22rem + 300px);
    max-height: calc(22rem + 300px);
  }
}
