  /* ==========================================================
   J K STEEL CORPORATION: CHAT WIDGET
   All classes are prefixed jk-chat-. Change the palette below.
   ========================================================== */

.jk-chat-widget {
  --jk-navy: #0B2545;
  --jk-char: #1F2933;
  --jk-accent: #F26B21;
  --jk-accent-dark: #D4560F;
  --jk-bg: #F3F5F7;
  --jk-line: #DDE2E8;
  --jk-error: #B42318;
  --jk-ok: #1A9E55;
  --jk-font: inherit, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--jk-char);
}

.jk-chat-widget *,
.jk-chat-widget *::before,
.jk-chat-widget *::after {
  box-sizing: border-box;
}

/* ---------- Launcher: tab docked to the right wall ---------- */

.jk-chat-toggle {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 99998;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 55px;
  padding: 14px 0 16px;
  border: 0;
  border-left: 3px solid #dd2f1c;
  border-radius: 12px 0 0 12px;
  background: #ffff;
  color: #000;
  font: inherit;
  font-weight: 600;
  letter-spacing: .02em;
  cursor: pointer;
  box-shadow: -4px 4px 18px rgba(11, 37, 69, .28);
  transition: width .2s ease, background-color .2s ease, opacity .2s ease, visibility .2s;
}

.jk-chat-toggle:hover,
.jk-chat-toggle:focus-visible {
  width: 52px;
  background: #fff;
}

.jk-chat-toggle i {
  font-size: 19px;
  color: #dd2f1c;
}

.jk-chat-toggle-label {
  writing-mode: vertical-rl;
  font-size: 13px;
  white-space: nowrap;
}

.jk-chat-toggle-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ---------- Window: slides out from the right wall ---------- */

.jk-chat-window {
  position: fixed;
  right: 0;
  bottom: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  width: 380px;
  max-width: 100vw;
  height: min(640px, calc(100vh - 40px));
  height: min(640px, calc(100dvh - 40px));
  background: #fff;
  border-radius: 14px 0 0 14px;
  box-shadow: -8px 8px 40px rgba(11, 37, 69, .30);
  overflow: hidden;
  transform: translateX(110%);
  opacity: 0;
  visibility: hidden;
  transition: transform .25s ease, opacity .25s ease, visibility 0s linear .25s;
}

.jk-chat-window:focus {
  outline: none;
}

.jk-chat-window.jk-chat-open {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
  transition: transform .25s ease, opacity .25s ease, visibility 0s;
}

/* ---------- Header (rebar-rib texture) ---------- */

.jk-chat-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  color: #fff;
  background-color: var(--jk-navy);
  background-image: repeating-linear-gradient(115deg,
      rgba(255, 255, 255, .07) 0 2px,
      transparent 2px 10px);
  border-bottom: 3px solid var(--jk-accent);
}

.jk-chat-logo {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #fff;
  color: var(--jk-navy);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -.02em;
  overflow: hidden;
}

.jk-chat-logo img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.jk-chat-title {
  flex: 1 1 auto;
  min-width: 0;
}

.jk-chat-title strong {
  display: block;
  font-size: 16px;
  line-height: 1.2;
}

.jk-chat-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, .85);
}

.jk-chat-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3DDC84;
}

.jk-chat-close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.jk-chat-close:hover {
  background: rgba(255, 255, 255, .24);
}

/* ---------- Messages ---------- */

.jk-chat-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 14px 8px;
  background: var(--jk-bg);
  scroll-behavior: smooth;
}

.jk-chat-msg {
  display: flex;
  margin-bottom: 8px;
}

.jk-chat-msg-user {
  justify-content: flex-end;
}

.jk-chat-bubble {
  max-width: 86%;
  padding: 9px 13px;
  border-radius: 12px 12px 12px 3px;
  background: #fff;
  border: 1px solid var(--jk-line);
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.jk-chat-msg-user .jk-chat-bubble {
  border: 0;
  border-radius: 12px 12px 3px 12px;
  background: var(--jk-navy);
  color: #fff;
}

.jk-chat-bubble a {
  color: var(--jk-accent-dark);
  font-weight: 600;
}

.jk-chat-typing {
  display: flex;
  gap: 5px;
  padding: 13px 14px;
}

.jk-chat-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8A97A6;
  animation: jk-chat-blink 1.1s infinite ease-in-out;
}

.jk-chat-typing span:nth-child(2) { animation-delay: .15s; }
.jk-chat-typing span:nth-child(3) { animation-delay: .30s; }

@keyframes jk-chat-blink {
  0%, 80%, 100% { opacity: .25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

/* ---------- Quick replies ---------- */

.jk-chat-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 4px 0 12px;
}

.jk-chat-quick-btn {
  display: inline-block;
  padding: 7px 12px;
  border: 1.5px solid var(--jk-navy);
  border-radius: 8px;
  background: #fff;
  color: var(--jk-navy);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s, color .15s;
}

.jk-chat-quick-btn:hover,
.jk-chat-quick-btn:focus-visible {
  background: var(--jk-navy);
  color: #fff;
}

/* ---------- Enquiry form ---------- */

.jk-chat-form-wrap {
  margin: 4px 0 12px;
}

.jk-chat-form {
  padding: 14px;
  border: 1px solid var(--jk-line);
  border-top: 3px solid var(--jk-accent);
  border-radius: 10px;
  background: #fff;
}

.jk-chat-form-title {
  margin: 0 0 2px;
  font-size: 16px;
  font-weight: 700;
  color: var(--jk-navy);
}

.jk-chat-form-note {
  margin: 0 0 12px;
  font-size: 12.5px;
  color: #5B6672;
}

.jk-chat-field {
  margin-bottom: 11px;
}

.jk-chat-field label {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 600;
}

.jk-chat-req {
  color: var(--jk-error);
}

.jk-chat-field input,
.jk-chat-field select,
.jk-chat-field textarea {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border: 1.5px solid #C3CBD4;
  border-radius: 8px;
  background: #fff;
  color: var(--jk-char);
  font: inherit;
  font-size: 15px;
}

.jk-chat-field textarea {
  resize: vertical;
  min-height: 70px;
}

.jk-chat-field input:focus,
.jk-chat-field select:focus,
.jk-chat-field textarea:focus {
  outline: none;
  border-color: var(--jk-navy);
  box-shadow: 0 0 0 3px rgba(11, 37, 69, .15);
}

.jk-chat-invalid input,
.jk-chat-invalid select,
.jk-chat-invalid textarea {
  border-color: var(--jk-error);
}

.jk-chat-error {
  margin: 4px 0 0;
  min-height: 0;
  font-size: 12.5px;
  color: var(--jk-error);
}

.jk-chat-error:empty {
  display: none;
}

.jk-chat-turnstile-field {
  overflow-x: auto;
}

.jk-chat-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

.jk-chat-submit {
  width: 100%;
  padding: 11px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--jk-accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .15s;
}

.jk-chat-submit:hover:not(:disabled) {
  background: var(--jk-accent-dark);
}

.jk-chat-submit:disabled {
  opacity: .65;
  cursor: wait;
}

/* ---------- Composer ---------- */

.jk-chat-composer {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--jk-line);
  background: #fff;
}

.jk-chat-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 12px;
  border: 1.5px solid #C3CBD4;
  border-radius: 8px;
  font: inherit;
  font-size: 15px;
}

.jk-chat-input:focus {
  outline: none;
  border-color: var(--jk-navy);
  box-shadow: 0 0 0 3px rgba(11, 37, 69, .15);
}

.jk-chat-send {
  flex: 0 0 auto;
  width: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--jk-navy);
  color: #fff;
  font-size: 17px;
  cursor: pointer;
}

.jk-chat-send:hover {
  background: var(--jk-accent);
}

.jk-chat-footnote {
  padding: 0 12px calc(8px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  text-align: center;
  font-size: 11.5px;
  color: #7A8591;
}

/* ---------- Focus rings ---------- */

.jk-chat-widget button:focus-visible,
.jk-chat-widget a:focus-visible {
  outline: 3px solid var(--jk-accent);
  outline-offset: 2px;
}

/* ---------- Mobile: full screen ---------- */

@media (max-width: 480px) {
  .jk-chat-window {
    top: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
  }
    .jk-chat-toggle {


  top: 52%;
  }

  .jk-chat-toggle {
    width: 35px;
    padding: 11px 0 13px;
  }

  .jk-chat-toggle:hover,
  .jk-chat-toggle:focus-visible {
    width: 40px;
  }

  .jk-chat-header {
    padding-top: calc(14px + env(safe-area-inset-top, 0px));
  }

  .jk-chat-input,
  .jk-chat-field input,
  .jk-chat-field select,
  .jk-chat-field textarea {
    font-size: 16px; /* stops iOS zoom on focus */
  }
}

@media (max-height: 480px) and (orientation: landscape) {
  .jk-chat-window {
    height: 100vh;
    height: 100dvh;
    bottom: 0;
  }

}

@media (prefers-reduced-motion: reduce) {
  .jk-chat-window,
  .jk-chat-toggle,
  .jk-chat-body {
    transition: none !important;
    scroll-behavior: auto;
  }

  .jk-chat-typing span {
    animation: none;
    opacity: .6;
  }
}