.cs-widget {
  --cs-accent: #b95f7a;
  --cs-accent-soft: #fae8ed;
  --cs-accent-strong: #a54866;
  position: fixed;
  z-index: 2147483000;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(22px + env(safe-area-inset-bottom));
  color: #29242a;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.cs-widget[data-theme="face"] {
  --cs-accent: #bd9861;
  --cs-accent-soft: #f4eddf;
  --cs-accent-strong: #967142;
}

.cs-widget[data-theme="wedding-app"] {
  bottom: calc(96px + env(safe-area-inset-bottom));
}

.cs-launcher {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  width: 66px;
  min-height: 72px;
  padding: 7px 4px;
  border: 1px solid rgba(255,255,255,.92);
  border-radius: 999px;
  background: rgba(255,255,255,.97);
  color: #29242a;
  box-shadow: 0 8px 28px rgba(53,34,43,.2), 0 1px 4px rgba(53,34,43,.1);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .18s ease, box-shadow .18s ease;
}

.cs-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 34px rgba(53,34,43,.24), 0 1px 4px rgba(53,34,43,.12);
}

.cs-toggle-input:focus-visible + .cs-launcher {
  outline: 3px solid color-mix(in srgb, var(--cs-accent) 45%, white);
  outline-offset: 3px;
}

.cs-toggle-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.cs-launcher-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, color-mix(in srgb, var(--cs-accent) 76%, white), var(--cs-accent-strong));
  color: #fff;
}

.cs-launcher-icon svg { width: 20px; height: 20px; }
.cs-launcher-copy { display: grid; gap: 0; text-align: center; }
.cs-launcher-copy strong { font-size: 11px; line-height: 1.15; font-weight: 700; white-space: nowrap; }
.cs-launcher-copy small { display: none; }

.cs-backdrop {
  position: fixed;
  z-index: 2147483001;
  inset: 0;
  display: none;
  place-items: center;
  overflow-y: auto;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  background: rgba(28,22,26,.58);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overscroll-behavior: contain;
  touch-action: none;
}

.cs-toggle-input:checked ~ .cs-backdrop { display: grid; animation: cs-fade-in .18s ease both; }
.cs-backdrop-dismiss { position: absolute; inset: 0; cursor: default; }
body:has(.cs-toggle-input:checked) { overflow: hidden; }

.cs-dialog {
  position: relative;
  width: min(100%, 372px);
  max-height: 100%;
  overflow-y: auto;
  padding: 25px 24px 22px;
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 26px;
  background: linear-gradient(160deg, #fff 0%, #fffaf9 58%, var(--cs-accent-soft) 145%);
  box-shadow: 0 24px 90px rgba(12,8,10,.32);
  text-align: center;
  touch-action: pan-y;
  animation: cs-rise-in .22s cubic-bezier(.2,.8,.2,1) both;
}

.cs-close {
  position: absolute;
  top: 13px;
  right: 13px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(42,34,39,.06);
  color: #62575d;
  cursor: pointer;
}

.cs-close svg { width: 17px; height: 17px; }
.cs-eyebrow { margin: 2px 0 7px; color: var(--cs-accent-strong); font-size: 10px; font-weight: 750; letter-spacing: .18em; }
.cs-title { margin: 0; color: #29242a; font-size: 23px; line-height: 1.3; font-weight: 750; }
.cs-description { max-width: 282px; margin: 8px auto 17px; color: #7a7076; font-size: 13px; line-height: 1.6; }

.cs-qr-card {
  width: min(100%, 244px);
  margin: 0 auto;
  padding: 9px;
  border: 1px solid rgba(85,68,77,.08);
  border-radius: 21px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(87,57,71,.1);
}

.cs-qr-card img { display: block; width: 100%; height: auto !important; aspect-ratio: 1; border-radius: 14px; object-fit: contain; }
.cs-contact { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 15px 0 12px; text-align: left; }
.cs-contact-mark { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 13px; background: var(--cs-accent-soft); color: var(--cs-accent-strong); font-size: 17px; font-weight: 800; }
.cs-contact-copy { display: grid; gap: 3px; }
.cs-contact-copy strong { color: #332c31; font-size: 13px; }
.cs-contact-copy span { color: #7a7076; font-size: 12px; font-variant-numeric: tabular-nums; }
.cs-qq-number { color: var(--cs-accent-strong) !important; font-weight: 700; user-select: all; -webkit-user-select: all; }
.cs-note { margin: 11px 0 0; color: #938990; font-size: 11px; line-height: 1.45; }

@keyframes cs-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes cs-rise-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (max-width: 420px) {
  .cs-widget { right: max(12px, env(safe-area-inset-right)); }
  .cs-launcher { width: 60px; min-height: 66px; gap: 3px; padding: 6px 3px; }
  .cs-launcher-icon { width: 32px; height: 32px; flex-basis: 32px; }
  .cs-launcher-copy strong { font-size: 10px; }
  .cs-dialog { padding: 22px 19px 18px; border-radius: 23px; }
  .cs-qr-card { width: min(100%, 216px); }
}

@media (max-height: 720px) {
  .cs-dialog { padding-top: 17px; padding-bottom: 15px; }
  .cs-description { margin: 5px auto 11px; }
  .cs-qr-card { width: min(100%, 205px, 34vh); padding: 7px; }
  .cs-contact { margin: 10px 0 8px; }
  .cs-note { margin-top: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .cs-launcher, .cs-backdrop, .cs-dialog { animation: none; transition: none; }
}
