.bag-welcome {
  position: fixed;
  z-index: 46;
  right: 18px;
  bottom: calc(88px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  column-gap: 20px;
  row-gap: 4px;
  width: min(326px, calc(100% - 32px));
  box-sizing: border-box;
  padding: 16px 16px 8px;
  border: 1px solid #c9d8e4;
  border-radius: 16px;
  color: #183b57;
  background: #ffffff;
  box-shadow: 0 8px 30px rgba(19, 48, 72, 0.18);
  font-family: "Noto Sans TC", "Microsoft JhengHei", Arial, sans-serif;
}

.bag-welcome[hidden],
.bag-welcome-trigger[hidden],
body.is-locked .bag-welcome,
body.is-locked .bag-welcome-trigger,
body.content-editor-mode .bag-welcome,
body.content-editor-mode .bag-welcome-trigger {
  display: none;
}

.bag-welcome-close {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0 16px 0 16px;
  color: #45627a;
  background: transparent;
  font: 400 26px/1 Arial, sans-serif;
  cursor: pointer;
}

.bag-welcome-trigger {
  position: fixed;
  z-index: 46;
  right: 18px;
  bottom: calc(88px + env(safe-area-inset-bottom));
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 7px;
  border: 1px solid #c9d8e4;
  border-radius: 13px;
  color: #185b85;
  background: #ffffff;
  box-shadow: 0 5px 18px rgba(19, 48, 72, 0.15);
  font: 700 12px/1.3 "Noto Sans TC", "Microsoft JhengHei", Arial, sans-serif;
  cursor: pointer;
}

.bag-welcome-trigger img {
  display: block;
  width: 28px;
  height: auto;
  border-radius: 5px;
}

.bag-welcome-trigger:focus-visible {
  outline: 3px solid #187aad;
  outline-offset: 3px;
}

.bag-welcome-portrait {
  position: relative;
  align-self: end;
  margin-bottom: 3px;
}

.bag-welcome-portrait img {
  display: block;
  width: 76px;
  height: auto;
  border-radius: 10px;
}

.bag-welcome-arrow {
  position: absolute;
  right: -18px;
  bottom: 6px;
  color: #24709f;
  font: 700 25px/1 Arial, sans-serif;
}

.bag-welcome-copy {
  min-width: 0;
}

.bag-welcome .bag-welcome-title {
  margin: 0 24px 6px 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0;
}

.bag-welcome .bag-welcome-body {
  margin: 0 0 8px;
  color: #45627a;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
}

.bag-welcome .bag-welcome-primary {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #185b85;
  border-radius: 10px;
  color: #ffffff;
  background: #185b85;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0;
  text-align: center;
  text-decoration: none;
}

.bag-welcome-secondary {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 6px;
  margin-top: 0;
}

.bag-welcome .bag-welcome-secondary :is(a, button) {
  display: inline-flex;
  min-width: 0;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 6px 4px;
  border: 1px solid #d8e4ed;
  border-radius: 8px;
  color: #185b85;
  background: #f5f9fc;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.bag-welcome .bag-welcome-secondary button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.bag-welcome a:hover,
.bag-welcome .bag-welcome-secondary button:not(:disabled):hover,
.bag-welcome-close:hover {
  filter: brightness(0.9);
}

.bag-welcome a:focus-visible,
.bag-welcome .bag-welcome-secondary button:focus-visible,
.bag-welcome-close:focus-visible {
  outline: 3px solid #187aad;
  outline-offset: 3px;
}

/* Separate, user-opened phone details: the welcome card's dimensions stay unchanged. */
.bag-phone-dialog {
  box-sizing: border-box;
  position: fixed;
  width: min(350px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  padding: 20px;
  border: 1px solid #c9d8e4;
  border-radius: 16px;
  color: #183b57;
  background: #fff;
  box-shadow: 0 12px 38px rgba(19, 48, 72, .22);
  overflow: auto;
  font: 400 13px/1.5 "Noto Sans TC", "Microsoft JhengHei", Arial, sans-serif;
}

.bag-phone-dialog::backdrop { background: rgba(19, 48, 72, .28); }
.bag-phone-dialog h2 { margin: 0 32px 12px 0; font-size: 18px; line-height: 1.3; }
.bag-phone-close {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 0 16px 0 10px;
  background: transparent;
  color: #45627a;
  font: 400 26px/1 Arial, sans-serif;
  cursor: pointer;
}
.bag-phone-dialog .bag-phone-number {
  display: block;
  box-sizing: border-box;
  width: 100%;
  padding: 10px 8px;
  border: 1px solid #d8e4ed;
  border-radius: 9px;
  background: #f5f9fc;
  color: #183b57;
  font: 700 23px/1.35 Arial, sans-serif;
  text-align: center;
}
.bag-phone-help { margin: 12px 0; color: #45627a; font-size: 12px; line-height: 1.55; }
.bag-phone-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bag-phone-actions :is(button, a) {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  box-sizing: border-box;
  padding: 8px 6px;
  border: 1px solid #185b85;
  border-radius: 9px;
  color: #185b85;
  background: #f5f9fc;
  font: 700 12px/1.4 "Noto Sans TC", "Microsoft JhengHei", Arial, sans-serif;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.bag-phone-actions button { color: #fff; background: #185b85; }
.bag-phone-actions button:disabled { opacity: .6; cursor: wait; }
.bag-phone-dialog :is(button, a, input):focus-visible { outline: 3px solid #187aad; outline-offset: 3px; }
.bag-phone-status { min-height: 2.8em; margin: 10px 0 0; font-size: 12px; line-height: 1.4; }

@media print { .bag-phone-dialog { display: none; } }

@media (max-width: 760px) {
  .bag-welcome-trigger {
    right: 10px;
    bottom: calc(124px + env(safe-area-inset-bottom));
  }

  .bag-welcome {
    right: 10px;
    bottom: calc(124px + env(safe-area-inset-bottom));
    width: min(306px, calc(100% - 20px));
    grid-template-columns: 60px minmax(0, 1fr);
    column-gap: 20px;
    padding: 14px 14px 6px;
  }

  .bag-welcome-portrait img {
    width: 60px;
  }

  .bag-welcome .bag-welcome-title {
    font-size: 17px;
  }

  .bag-welcome .bag-welcome-body {
    font-size: 12px;
  }
}

@media (max-height: 430px) {
  .bag-welcome {
    bottom: calc(76px + env(safe-area-inset-bottom));
    padding-block: 10px 4px;
  }

  .bag-welcome .bag-welcome-body {
    display: none;
  }

}

@media print {
  .bag-welcome,
  .bag-welcome-trigger {
    display: none;
  }
}

.enquiry-wave-text {
  display: inline-block;
  white-space: pre;
}

.enquiry-wave-letter {
  display: inline-block;
  animation: enquiry-letter-wave 8s ease-in-out infinite;
  animation-delay: var(--enquiry-letter-delay, 0s);
}

@keyframes enquiry-letter-wave {
  0%, 9%, 100% { transform: translateY(0); }
  4.5% { transform: translateY(-2px); }
}

.enquiry-wave:hover .enquiry-wave-letter,
.enquiry-wave:focus-visible .enquiry-wave-letter,
body.content-editor-mode .enquiry-wave-letter {
  animation: none;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .enquiry-wave-letter {
    animation: none;
    transform: none;
  }
}

@media print {
  .enquiry-wave-letter {
    animation: none;
    transform: none;
  }
}
