/* Shared consultation launcher and two-channel contact sheet. */
.cs-root {
  --cs-ink: #112e32;
  --cs-night: #0b2529;
  --cs-accent: #096c5f;
  --cs-accent-hover: #08594e;
  --cs-muted: #52645f;
  --cs-paper: #f7f5ef;
  --cs-surface: #fffdf7;
  --cs-tint: #e9f0eb;
  --cs-line: #d9dfd7;
  --cs-gold: #c58b46;
  --cs-focus: #855922;
  --cs-display: var(--font-display, Georgia, "Noto Serif CJK SC", "Songti SC", SimSun, serif);
}

body.cs-open {
  overflow: hidden;
}

.cs-root * {
  box-sizing: border-box;
}

.cs-root :is(a, button):focus-visible {
  outline: 2px solid var(--cs-focus);
  outline-offset: 3px;
}

.cs-launcher {
  position: fixed;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, calc(env(safe-area-inset-bottom) + 10px));
  z-index: 200;
  display: flex;
  align-items: center;
  min-height: 52px;
  gap: 10px;
  padding: 7px 15px 7px 8px;
  border: 1px solid #ffffff26;
  border-radius: 14px;
  background: var(--cs-night);
  color: var(--cs-surface);
  box-shadow: 0 8px 30px #0b252924;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  transition: background-color .18s ease, transform .18s ease, opacity .18s ease;
}

.cs-launcher-mark,
.cs-mark {
  display: grid;
  place-items: center;
  flex: none;
  background: var(--cs-surface);
}

.cs-launcher-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.cs-launcher-mark img {
  width: 27px;
  height: 27px;
  object-fit: contain;
}

.cs-launcher svg {
  flex: none;
  color: #d8e2dc;
}

.cs-scrim {
  position: fixed;
  z-index: 210;
  inset: 0;
  background: #0b252965;
}

.cs-scrim[hidden],
.cs-dialog[hidden],
.cs-panel[hidden],
.cs-qr-wrap[hidden] {
  display: none !important;
}

.cs-dialog {
  position: fixed;
  z-index: 211;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  width: min(430px, calc(100% - 48px));
  max-height: calc(100vh - 48px);
  max-height: min(760px, calc(100dvh - max(24px, env(safe-area-inset-top)) - max(24px, env(safe-area-inset-bottom))));
  overflow: hidden;
  border: 1px solid var(--cs-line);
  border-radius: 20px;
  background: var(--cs-surface);
  color: var(--cs-ink);
  box-shadow: 0 18px 64px #0b25293b;
  animation: cs-sheet-in .22s cubic-bezier(.22, .75, .3, 1);
}

@keyframes cs-sheet-in {
  from { opacity: .65; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@media screen and (prefers-reduced-motion: no-preference) {
  @supports (transition-behavior: allow-discrete) {
    .cs-dialog, .cs-scrim {
      transition: opacity .2s ease, transform .24s cubic-bezier(.2,.72,.25,1), display .24s allow-discrete;
    }
    .cs-dialog { animation: none; transform-origin: bottom right; }
    .cs-dialog[hidden], .cs-scrim[hidden] { opacity: 0; pointer-events: none; }
    .cs-dialog[hidden] { transform: translateY(26px) scale(.985); }
    @starting-style {
      .cs-dialog:not([hidden]) { opacity: 0; transform: translateY(26px) scale(.985); }
      .cs-scrim:not([hidden]) { opacity: 0; }
    }
  }
  .cs-panel:not([hidden]) { animation: cs-sheet-in .22s ease-out; }
}

.cs-head {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 23px;
  border-top: 2px solid var(--cs-gold);
  background: var(--cs-night);
  color: var(--cs-surface);
}

.cs-head-brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 11px;
}

.cs-head-brand strong,
.cs-head-brand small {
  display: block;
  line-height: 1.45;
}

.cs-head-brand strong {
  font-size: 15px;
  font-weight: 700;
}

.cs-head-brand small {
  margin-top: 3px;
  color: #cadad3;
  font-size: 11px;
}

.cs-mark {
  width: 42px;
  height: 42px;
  border-radius: 9px;
}

.cs-mark img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.cs-close {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid #ffffff36;
  border-radius: 10px;
  background: transparent;
  color: var(--cs-surface);
  transition: background-color .18s ease;
}

.cs-root .cs-close:focus-visible {
  outline-color: var(--cs-gold);
}

.cs-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 26px 14px;
}

.cs-body-head h2 {
  margin: 0 0 8px;
  font-family: var(--cs-display);
  font-size: clamp(26px, 5.5vw, 34px);
  font-weight: 700;
  line-height: 1.27;
  letter-spacing: -.035em;
}

.cs-body-head p {
  margin: 0;
  color: var(--cs-muted);
  font-size: 14px;
  line-height: 1.75;
}

.cs-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 17px 0 19px;
  border-bottom: 1px solid var(--cs-line);
}

.cs-tabs button {
  min-height: 46px;
  margin-bottom: -1px;
  padding: 7px 4px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 6px 6px 0 0;
  background: transparent;
  color: var(--cs-muted);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
  transition: background-color .18s ease, color .18s ease;
}

.cs-tabs button[aria-selected="true"] {
  border-bottom-color: var(--cs-accent);
  color: var(--cs-accent);
  font-weight: 750;
}

.cs-panel {
  animation: cs-panel-in .16s ease-out;
}

@keyframes cs-panel-in {
  from { opacity: .68; }
  to { opacity: 1; }
}

.cs-contact-heading {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.cs-contact-heading h3,
.cs-mail-intro h3 {
  margin: 0 0 4px;
  font-size: 17px;
  line-height: 1.4;
  letter-spacing: 0;
}

.cs-contact-heading p,
.cs-mail-intro p {
  margin: 0;
  color: var(--cs-muted);
  font-size: 13px;
  line-height: 1.6;
}

.cs-contact-icon,
.cs-mail-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 39px;
  height: 39px;
  border-radius: 8px;
  background: var(--cs-tint);
  color: var(--cs-accent);
}

.cs-contact-icon {
  font-size: 17px;
  font-weight: 750;
}

.cs-qr-wrap {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin: 14px 0;
}

.cs-qr {
  display: block;
  width: clamp(148px, 45vw, 166px);
  height: auto;
  aspect-ratio: 1;
  padding: 7px;
  border: 1px solid var(--cs-line);
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}

.cs-qr-wrap p,
.cs-help {
  margin: 0;
  color: var(--cs-muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.cs-help {
  margin-top: 8px;
}

.cs-go {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 49px;
  gap: 12px;
  padding: 9px 15px;
  border-radius: 9px;
  background: var(--cs-accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  transition: background-color .18s ease;
}

.cs-go svg {
  flex: none;
}

.cs-mail-intro {
  padding: 12px 0 14px;
  text-align: center;
}

.cs-mail-icon {
  width: 50px;
  height: 50px;
  margin: 0 auto 12px;
}

.cs-mail-address {
  margin: 0 0 16px;
  color: var(--cs-ink);
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  overflow-wrap: anywhere;
}

.cs-bottom {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  min-height: 67px;
  gap: 10px;
  padding: 8px 25px;
  border-top: 1px solid var(--cs-line);
  background: var(--cs-paper);
}

.cs-bottom a {
  display: flex;
  justify-content: center;
  min-width: 0;
  min-height: 44px;
  text-decoration: none;
}

.cs-bottom .cs-call {
  flex-direction: column;
  gap: 3px;
  color: var(--cs-ink);
  line-height: 1.3;
}

.cs-call span {
  color: var(--cs-muted);
  font-size: 12px;
  font-weight: 550;
}

.cs-call strong {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}

.cs-bottom .cs-more {
  align-items: center;
  gap: 3px;
  color: var(--cs-accent);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
}

@media (hover: hover) {
  .cs-launcher:hover {
    background: var(--cs-ink);
    transform: translateY(-2px);
  }

  .cs-close:hover {
    background: #ffffff17;
  }

  .cs-tabs button:hover {
    background: var(--cs-tint);
    color: var(--cs-accent);
  }

  .cs-go:hover {
    background: var(--cs-accent-hover);
  }

  .cs-bottom a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
  }
}

@media (max-width: 600px) {
  .cs-launcher {
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, calc(env(safe-area-inset-bottom) + 8px));
    min-height: 48px;
    gap: 8px;
    padding: 6px 12px 6px 7px;
  }

  .cs-launcher-mark {
    width: 32px;
    height: 32px;
  }

  .cs-dialog {
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: calc(100vh - 10px);
    max-height: calc(100dvh - max(10px, env(safe-area-inset-top)));
    border-inline: 0;
    border-bottom: 0;
    border-radius: 20px 20px 0 0;
  }

  .cs-head,
  .cs-body,
  .cs-bottom {
    padding-left: max(18px, env(safe-area-inset-left));
    padding-right: max(18px, env(safe-area-inset-right));
  }

  .cs-head {
    padding-block: 10px;
  }

  .cs-body {
    padding-block: 18px 12px;
  }

  .cs-tabs {
    margin-top: 12px;
    margin-bottom: 15px;
  }

  .cs-bottom {
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 350px) {
  .cs-bottom {
    gap: 8px;
  }

  .cs-call strong {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cs-root * {
    animation: none !important;
    transition: none !important;
  }

  .cs-launcher:hover {
    transform: none;
  }
}

/* The contact page already provides full consultation channels in the page. */
body.page-contact .cs-launcher {
  display: none;
}

@media print {
  .cs-root {
    display: none;
  }
}

