.lhk-chat-gate {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2147482900;
  font-family: var(--font-jp);
  color: var(--fg);
}

.lhk-chat-gate.hidden {
  display: none;
}

.lhk-chat-gate button,
.lhk-chat-gate input {
  font: inherit;
}

.lhk-chat-launcher {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: #FFFFFF;
  box-shadow: 0 16px 36px rgba(26, 54, 93, .22);
}

.lhk-chat-launcher svg {
  width: 20px;
  height: 20px;
}

.lhk-chat-panel {
  position: absolute;
  right: 0;
  bottom: 68px;
  width: min(380px, calc(100vw - 32px));
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #FFFFFF;
  box-shadow: 0 24px 64px rgba(26, 54, 93, .18);
  overflow: hidden;
  transform: translateY(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
}

.lhk-chat-gate.open .lhk-chat-panel {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.lhk-chat-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--border);
}

.lhk-chat-title {
  display: block;
  color: var(--fg);
  font-size: 15px;
  line-height: 1.35;
}

.lhk-chat-subtitle {
  display: block;
  margin-top: 2px;
  color: var(--fg-mute);
  font-size: 12px;
  line-height: 1.45;
}

.lhk-chat-close {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #FFFFFF;
  color: var(--fg-soft);
}

.lhk-chat-form {
  display: grid;
  gap: 12px;
  padding: 14px 16px 16px;
}

.lhk-chat-field {
  display: grid;
  gap: 6px;
  color: var(--fg-soft);
  font-size: 12px;
  font-weight: 700;
}

.lhk-chat-field input {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #FFFFFF;
  color: var(--fg);
  outline: none;
}

.lhk-chat-field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26, 54, 93, .10);
}

.lhk-chat-turnstile {
  min-height: 65px;
  overflow: hidden;
}

.lhk-chat-turnstile iframe {
  max-width: 100%;
}

.lhk-chat-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 2px;
}

.lhk-chat-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 800;
}

.lhk-chat-action:disabled {
  cursor: wait;
  opacity: .68;
}

.lhk-chat-submit {
  border: 0;
  background: var(--blue);
  color: #FFFFFF;
}

.lhk-chat-ticket {
  border: 1px solid var(--blue);
  background: #FFFFFF;
  color: var(--blue);
}

.lhk-ticket-overlay[hidden] {
  display: none;
}

.lhk-ticket-overlay {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2147482901;
  display: grid;
  gap: 8px;
  width: min(560px, calc(100vw - 32px));
  font-family: var(--font-jp);
}

.lhk-ticket-toolbar {
  display: flex;
  justify-content: flex-end;
}

.lhk-ticket-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #FFFFFF;
  color: var(--fg-soft);
  font-size: 13px;
  font-weight: 800;
}

.lhk-ticket-form-mount {
  min-height: 360px;
}

.lhk-chat-error {
  display: none;
  border: 1px solid #F0B4B4;
  border-radius: 8px;
  padding: 8px 10px;
  background: #FFF4F4;
  color: #8B1D1D;
  font-size: 12px;
  line-height: 1.45;
}

.lhk-chat-error.visible {
  display: block;
}

@media (max-width: 640px) {
  .lhk-chat-gate {
    right: 16px;
    bottom: 16px;
    left: 16px;
  }

  .lhk-chat-launcher {
    width: 100%;
    justify-content: center;
  }

  .lhk-chat-panel {
    right: 0;
    left: 0;
    width: auto;
    bottom: 68px;
  }

  .lhk-ticket-overlay {
    right: 16px;
    bottom: 16px;
    left: 16px;
    width: auto;
  }
}
