/* Fly Guy AI fishing guide - chat page. Layers on top of style.css tokens. */

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.phero.short { min-height: 0; }
.phero.short .wrap { padding-top: 4.5rem; padding-bottom: 2.2rem; }

/* ---- layout ---- */
.chat-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 900px) {
  .chat-wrap { grid-template-columns: 1fr; }
}

/* ---- chat panel ---- */
.chat-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-log {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .8rem;
  padding: 1.2rem;
  min-height: 340px;
  max-height: 60vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}
.chat-chips, .chat-form, .chat-note { flex-shrink: 0; }

.msg {
  max-width: 86%;
  padding: .7rem 1rem;
  border-radius: 15px;
  line-height: 1.5;
  font-size: 1rem;
}
.msg p { margin: 0; }
.msg p + p { margin-top: .5rem; }
.msg ul { margin: .4rem 0 .2rem; padding-left: 1.1rem; }
.msg li { margin: .15rem 0; }

.msg.bot {
  align-self: flex-start;
  background: var(--sand);
  color: var(--ink);
  border-bottom-left-radius: 4px;
}
.msg.user {
  align-self: flex-end;
  background: var(--deep);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.msg.bot a { color: var(--accent-ink); text-decoration: underline; }
.msg.user a { color: #fff; text-decoration: underline; }

/* typing indicator */
.msg.typing { display: inline-flex; gap: .28rem; align-items: center; }
.msg.typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-2); opacity: .5; animation: fgblink 1.2s infinite;
}
.msg.typing span:nth-child(2) { animation-delay: .2s; }
.msg.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes fgblink { 0%,60%,100% { opacity: .25; } 30% { opacity: .9; } }

/* conditions card rendered inside a bot message */
.cond-card {
  margin-top: .6rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  overflow: hidden;
}
.cond-card h5 {
  margin: 0; padding: .5rem .8rem;
  background: var(--ink); color: #fff;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  font-size: .92rem;
}
.cond-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.cond-grid div {
  padding: .5rem .8rem; font-size: .9rem;
  border-top: 1px solid var(--line);
}
.cond-grid div:nth-child(odd) { border-right: 1px solid var(--line); }
.cond-grid b {
  display: block; font-family: "Barlow Condensed", sans-serif;
  text-transform: uppercase; letter-spacing: .04em; font-size: .74rem;
  color: var(--ink-2); font-weight: 600;
}

/* booking + cancel cards rendered inside a bot message (same family as
   .cond-card: dark condensed header, bordered body) */
.book-card {
  margin-top: .6rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  overflow: hidden;
}
.book-card h5 {
  margin: 0; padding: .5rem .8rem;
  background: var(--ink); color: #fff;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  font-size: .92rem;
}
.book-card .bc-inner { padding: .7rem .8rem; }
.book-card .bc-inner p { margin: 0 0 .6rem; font-size: .92rem; }
.bc-policy { color: var(--ink-2); font-size: .84rem !important; }
.bc-form { display: flex; flex-direction: column; gap: .5rem; }
.bc-in {
  font: inherit; font-size: .92rem;
  padding: .55rem .7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
}
.bc-in:focus { outline: 2px solid var(--sea); outline-offset: 1px; border-color: var(--sea); }
textarea.bc-in { resize: vertical; }
.bc-submit, .bc-pay { justify-content: center; }
.bc-submit[disabled] { opacity: .55; cursor: default; transform: none; }
.bc-err { color: #b3261e; font-size: .86rem !important; }
.bc-err[hidden] { display: none; }
.bc-status { color: var(--ink-2); font-size: .86rem !important; }
.bc-contact { display: flex; flex-wrap: wrap; gap: .5rem; }
.bc-contact .btn { flex: 1 1 auto; justify-content: center; font-size: .88rem; }

/* ---- starter chips ---- */
.chat-chips {
  display: flex; flex-wrap: wrap; gap: .5rem;
  padding: .9rem 1.2rem;
  border-top: 1px solid var(--line);
}
.chip {
  font: inherit; font-size: .86rem;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 60px;
  padding: .38rem .85rem;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
}
.chip:hover { border-color: var(--accent); background: #fff; transform: translateY(-1px); }

/* ---- composer ---- */
.chat-form { padding: 1rem 1.2rem; border-top: 1px solid var(--line); }
.chat-inputrow { display: flex; gap: .6rem; align-items: flex-end; }
#chatInput {
  flex: 1;
  resize: none;
  font: inherit;
  line-height: 1.4;
  padding: .7rem .85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  max-height: 140px;
  overflow-y: auto;
}
#chatInput:focus { outline: 2px solid var(--sea); outline-offset: 1px; border-color: var(--sea); }

.geo-btn {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--sea);
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.geo-btn svg { width: 20px; height: 20px; }
.geo-btn:hover { border-color: var(--sea); color: var(--deep); }
.geo-btn.on { background: var(--sea); color: #fff; border-color: var(--sea); }

.send-btn { flex: 0 0 auto; }
.send-btn[disabled] { opacity: .55; cursor: default; transform: none; }

.cf-turnstile { margin-top: .7rem; min-height: 0; }

.chat-note {
  margin: 0;
  padding: .85rem 1.2rem;
  border-top: 1px solid var(--line);
  font-size: .82rem;
  color: var(--ink-2);
}
.chat-note a { color: var(--accent-ink); }

/* ---- aside ---- */
.chat-aside { display: flex; flex-direction: column; gap: 1rem; }
.chat-aside .mini-cta {
  background: var(--deep);
  color: #fff;
  border-radius: var(--r);
  padding: 1.1rem;
  text-align: center;
}
.chat-aside .mini-cta p {
  margin: 0 0 .7rem;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 600; text-transform: uppercase; letter-spacing: .03em;
}
.aside-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow-sm);
}
.aside-card h4 {
  margin: 0 0 .6rem;
  font-family: "Barlow Condensed", sans-serif;
  text-transform: uppercase; letter-spacing: .04em; font-size: 1.05rem;
}
.aside-card ul { margin: 0; padding-left: 1.1rem; }
.aside-card li { margin: .3rem 0; font-size: .94rem; color: var(--ink-2); }
.aside-card a { color: var(--accent-ink); }
.aside-fine { margin: .8rem 0 0; font-size: .82rem; color: var(--ink-2); }

@media (max-width: 900px) {
  .chat-aside { flex-direction: row; flex-wrap: wrap; }
  .chat-aside > * { flex: 1 1 260px; }
}

/* Full-screen mobile chat: the bar and intro overlay are hidden on desktop. */
.chat-bar { display: none; }
.chat-intro {
  display: none;
  position: fixed; inset: 0; z-index: 400;
  place-items: center; padding: 1.2rem;
  background: rgba(10, 25, 33, .78);
}
.chat-intro-card {
  background: var(--card); border-radius: var(--r);
  padding: 1.6rem 1.4rem; max-width: 440px; box-shadow: var(--shadow);
}
.chat-intro-card h2 { margin: .35rem 0 .6rem; }
.chat-intro-card > p { color: var(--ink-2); }
.chat-intro-card ul { margin: .8rem 0 1.1rem; padding-left: 1.1rem; }
.chat-intro-card li { margin: .35rem 0; color: var(--ink-2); font-size: .96rem; }
.chat-intro-card .btn.big { width: 100%; justify-content: center; }
.chat-intro-fine { margin: .9rem 0 0; font-size: .78rem; color: var(--ink-2); }

/* Phone: a clean, full-screen text-message view. Hide the site chrome, let the
   chat own the screen; the message log scrolls internally, the composer stays
   pinned so new replies land in view. */
@media (max-width: 720px) {
  .site-header, .nav-scrim, .phero, .chat-aside, .site-footer, .chat-note { display: none !important; }
  .band.tight { padding: 0; }
  .chat-wrap { display: block; gap: 0; }

  .chat-panel {
    position: fixed; inset: 0;
    max-height: none; z-index: 300;
    border: 0; border-radius: 0; box-shadow: none;
  }
  .chat-bar {
    display: flex; align-items: center; justify-content: space-between; gap: .6rem;
    background: var(--ink); color: #fff; flex-shrink: 0;
    padding: .55rem .9rem;
    padding-top: max(.55rem, env(safe-area-inset-top));
  }
  .chat-bar a { color: #fff; }
  .chat-bar-exit { display: inline-flex; align-items: center; gap: .2rem;
    font-family: "Barlow Condensed", sans-serif; text-transform: uppercase;
    letter-spacing: .04em; font-weight: 600; font-size: .92rem; }
  .chat-bar-exit svg { width: 20px; height: 20px; }
  .chat-bar-title { font-family: "Barlow Condensed", sans-serif; text-transform: uppercase;
    letter-spacing: .05em; font-weight: 700; font-size: 1rem; }
  .chat-bar a.chat-bar-book { color: var(--accent); font-family: "Barlow Condensed", sans-serif;
    text-transform: uppercase; letter-spacing: .04em; font-weight: 700; font-size: .92rem; }

  .chat-log { max-height: none; flex: 1 1 auto; min-height: 0; }
  .chat-chips { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; }
  .chat-chips .chip { flex-shrink: 0; white-space: nowrap; }
  .chat-chips::-webkit-scrollbar { display: none; }
  .chat-form { padding-bottom: max(1rem, env(safe-area-inset-bottom)); }

  .chat-intro.show { display: grid; }
}
