.consult-live-widget,
.consult-review-toast {
  position: fixed;
  z-index: 54;
  font-family: Arial, "Microsoft JhengHei", sans-serif;
}

.consult-live-widget {
  right: 24px;
  top: 31%;
  width: 238px;
  padding: 18px;
  color: #fff;
  background: linear-gradient(145deg, rgba(40, 7, 13, .97), rgba(83, 15, 27, .97));
  border: 1px solid rgba(229, 190, 97, .55);
  border-radius: 14px;
  box-shadow: 0 18px 52px rgba(28, 4, 8, .32);
  backdrop-filter: blur(10px);
}

.consult-live-widget::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 10px;
  pointer-events: none;
}

.consult-live-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, .76);
  font-size: 12px;
}

.consult-live-head small {
  margin-left: auto;
  color: rgba(255, 255, 255, .4);
  font-size: 9px;
}

.consult-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #21d769;
  box-shadow: 0 0 0 0 rgba(33, 215, 105, .55);
  animation: consultDot 1.8s ease-out infinite;
}

.consult-live-count {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 12px 0 11px;
}

.consult-live-count strong {
  color: #f2cb70;
  font-family: Georgia, serif;
  font-size: 35px;
  line-height: 1;
}

.consult-live-count span {
  color: rgba(255, 255, 255, .66);
  font-size: 12px;
}

.consult-live-divider {
  height: 1px;
  margin: 4px 0 12px;
  background: linear-gradient(90deg, rgba(229, 190, 97, .5), transparent);
}

.consult-free-label {
  position: relative;
  display: block;
  color: rgba(255, 255, 255, .58);
  font-size: 11px;
}

.consult-countdown {
  position: relative;
  margin: 2px 0 10px;
  color: #fff2ca;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: .08em;
}

.consult-timer-button {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 14px;
  color: #062513;
  background: #0bcd5b;
  border-radius: 999px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 9px 26px rgba(7, 202, 88, .22);
  animation: consultButtonPulse 2.1s ease-in-out infinite;
}

.consult-timer-button.is-ended {
  color: #32180e;
  background: #e7bd62;
  animation: none;
}

.consult-review-toast {
  left: 24px;
  bottom: 24px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  width: min(390px, calc(100vw - 48px));
  padding: 15px 38px 15px 15px;
  color: #3f2524;
  background: rgba(255, 250, 242, .97);
  border: 1px solid rgba(116, 48, 68, .18);
  border-left: 4px solid #7b2d40;
  border-radius: 12px;
  box-shadow: 0 18px 52px rgba(38, 10, 14, .22);
  backdrop-filter: blur(10px);
  transition: opacity .24s ease, transform .24s ease;
}

.consult-review-toast.is-switching {
  opacity: 0;
  transform: translateY(8px);
}

.consult-review-toast.is-hidden {
  display: none;
}

.consult-review-avatar {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  color: #f2cd78;
  background: #632435;
  border-radius: 50%;
  font-family: serif;
  font-size: 18px;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .08);
}

.consult-review-content {
  min-width: 0;
}

.consult-review-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #8b7470;
  font-size: 10px;
}

.consult-review-meta b {
  color: #d39c32;
  letter-spacing: .04em;
}

.consult-review-content > strong {
  display: block;
  margin: 2px 0 3px;
  color: #682638;
  font-size: 14px;
}

.consult-review-content p {
  margin: 0;
  color: #695653;
  font-size: 12px;
  line-height: 1.55;
}

.consult-review-content small {
  display: block;
  margin-top: 5px;
  color: #aa9690;
  font-size: 9px;
}

.consult-review-close {
  position: absolute;
  right: 7px;
  top: 5px;
  width: 27px;
  height: 27px;
  padding: 0;
  color: #9a8580;
  background: transparent;
  border: 0;
  font-size: 20px;
  line-height: 1;
}

@keyframes consultDot {
  0% { box-shadow: 0 0 0 0 rgba(33, 215, 105, .55); }
  70%, 100% { box-shadow: 0 0 0 9px rgba(33, 215, 105, 0); }
}

@keyframes consultButtonPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.045); }
}

@media (max-width: 700px) {
  .consult-live-widget {
    right: 8px;
    top: 76px;
    width: 205px;
    padding: 12px 13px;
    border-radius: 12px;
  }

  .consult-live-head { font-size: 10px; }
  .consult-live-head small { font-size: 8px; }
  .consult-live-count { margin: 7px 0 6px; }
  .consult-live-count strong { font-size: 27px; }
  .consult-live-count span { font-size: 10px; }
  .consult-live-divider { margin: 3px 0 7px; }
  .consult-free-label { font-size: 9px; }
  .consult-countdown {
    display: inline-block;
    margin: 2px 5px 6px 0;
    font-size: 19px;
  }
  .consult-timer-button {
    display: inline-flex;
    width: 100%;
    padding: 8px 11px;
    font-size: 11px;
  }

  .consult-review-toast {
    left: 8px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    width: calc(100vw - 86px);
    padding: 11px 28px 11px 11px;
    gap: 8px;
    border-radius: 10px;
  }
  .consult-review-avatar {
    width: 34px;
    height: 34px;
    font-size: 15px;
  }
  .consult-review-content > strong { font-size: 12px; }
  .consult-review-content p {
    max-height: 38px;
    overflow: hidden;
    font-size: 10px;
    line-height: 1.45;
  }
  .consult-review-content small { font-size: 8px; }
  .consult-review-meta { font-size: 9px; }
}

@media (max-width: 640px) {
  body {
    padding-bottom: 140px;
  }

  .consult-live-widget {
    left: 8px;
    right: 8px;
    top: auto;
    bottom: calc(76px + env(safe-area-inset-bottom));
    width: auto;
    min-height: 58px;
    padding: 8px 9px;
    display: grid;
    grid-template-columns: minmax(75px, 1fr) auto auto;
    grid-template-areas: "count timer action";
    align-items: center;
    gap: 8px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(28, 4, 8, .3);
  }

  .consult-live-widget::before {
    inset: 4px;
    border-radius: 9px;
  }

  .consult-live-head,
  .consult-live-divider,
  .consult-free-label {
    display: none;
  }

  .consult-live-count {
    grid-area: count;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 5px;
    margin: 0;
    min-width: 0;
  }

  .consult-live-count::before {
    content: "今日諮詢";
    grid-column: 1 / -1;
    color: rgba(255, 255, 255, .58);
    font-size: 9px;
    line-height: 1;
  }

  .consult-live-count strong {
    font-size: 23px;
    line-height: 1;
  }

  .consult-live-count span {
    max-width: 44px;
    color: rgba(255, 255, 255, .7);
    font-size: 9px;
    line-height: 1.2;
  }

  .consult-countdown {
    grid-area: timer;
    display: block;
    min-width: 53px;
    margin: 0;
    font-size: 18px;
    letter-spacing: .03em;
    text-align: center;
  }

  .consult-countdown::before {
    content: "剩餘";
    display: block;
    margin-bottom: 2px;
    color: rgba(255, 255, 255, .58);
    font-family: Arial, "Microsoft JhengHei", sans-serif;
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1;
  }

  .consult-timer-button {
    grid-area: action;
    width: auto;
    min-width: 94px;
    padding: 9px 10px;
    justify-content: center;
    gap: 5px;
    font-size: 10px;
    line-height: 1.25;
    text-align: center;
  }

  .consult-review-toast {
    bottom: calc(144px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 360px) {
  .consult-live-widget {
    left: 5px;
    right: 5px;
    grid-template-columns: minmax(68px, 1fr) auto auto;
    gap: 5px;
    padding-inline: 7px;
  }

  .consult-live-count span {
    max-width: 38px;
    font-size: 8px;
  }

  .consult-countdown {
    min-width: 49px;
    font-size: 17px;
  }

  .consult-timer-button {
    min-width: 86px;
    padding-inline: 8px;
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .consult-live-dot,
  .consult-timer-button {
    animation: none;
  }
  .consult-review-toast {
    transition: none;
  }
}
