/* -----------------------------------------------------------------------
   ASK NAT V2 — FRONT END
   Peachly Consulting
   Brand: Peach #F76C47 | Blue #7584D0
   Fonts: Rubik (UI/headings) | Montserrat (chat/body)
   Square corners. No grey fonts. British English.
   ----------------------------------------------------------------------- */

:root {
  --peach:      #F48F6B;
  --peach-dark: #d9582e;
  --blue:       #7584D0;
  --blue-dark:  #5f6fbe;
  --yellow:     #ffeda8;
  --yellow-dark:#f0dc80;
  --entry-pink:  #e4a3cd;
  --entry-orange:#f48f6b;
  --white:      #ffffff;
  --off-white:  #F8F6F2;
  --dark:       #1C1C1C;
  --body:       #2E2E2E;
  --border:     #D6D2C9;
  --light-bg:   #EEEAE3;
  --error-bg:   #FDE8E4;
  --error-text: #C0381C;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: 'Montserrat', sans-serif;
  background: var(--off-white);
  color: var(--body);
  -webkit-font-smoothing: antialiased;
}

/* -----------------------------------------------------------------------
   VIEW SYSTEM
   ----------------------------------------------------------------------- */
.view {
  display: none;
}
.view.active {
  display: flex;
}

/* -----------------------------------------------------------------------
   ENTRY VIEW
   ----------------------------------------------------------------------- */
#view-entry {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 24px;
  text-align: center;
  background: var(--blue);
  overflow-y: auto;
}

.entry-logo-img {
  display: block;
  width: 170px;
  max-width: 45vw;
  height: auto;
  margin: 0 auto 80px;
}

.entry-heading {
  font-family: 'Rubik', sans-serif;
  font-weight: 800;
  font-size: clamp(42px, 3vw, 32px);
  line-height: 1.15;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 18px;
  max-width: 560px;
}

.entry-heading .nat-name {
  color: var(--entry-pink);
}

.entry-intro {
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.75;
  color: var(--white);
  max-width: 550px;
  margin: 0 auto 28px;
}

.entry-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 340px;
}

/* -----------------------------------------------------------------------
   ENTRY CONTENT ROW
   ----------------------------------------------------------------------- */
.entry-content-row {
  display: flex;
  align-items: center;
  gap: 0px;
  width: 100%;
  max-width: 1050px;
  justify-content: flex-start;
   padding-left: 60px;
}

.entry-left {
  flex: 1;
  min-width: 580px;
  max-width: 640px;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-top: 48px;
  padding-bottom: 8px;
}

.entry-left .entry-heading {
  margin-left: 0;
  margin-right: 0;
}

.entry-left .entry-intro {
  margin-left: 0;
  margin-right: 0;
}

.entry-avatar-wrap {
  flex-shrink: 0;
  width: 480px;
  margin-left: 0px;
}

.entry-avatar-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

/* -----------------------------------------------------------------------
   ONE-FIELD ENTRY VIEW
   ----------------------------------------------------------------------- */
#view-entry-onefield {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--blue);
  padding: 40px 24px;
  overflow-y: auto;
}

.onefield-logo-wrap {
  text-align: center;
  margin-bottom: 36px;
}

.onefield-logo {
  width: 150px;
  height: auto;
  display: inline-block;
}

.onefield-content-row {
  display: flex;
  align-items: center;
  gap: 48px;
  width: 100%;
  max-width: 900px;
}

.onefield-left {
  flex: 1.3;
  min-width: 0;
  text-align: left;
}

.onefield-heading {
  font-family: 'Rubik', sans-serif;
  font-weight: 800;
  font-size: clamp(22px, 2.4vw, 34px);
  line-height: 1.15;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 16px;
  white-space: nowrap;
}

.onefield-heading .onefield-pink {
  color: var(--entry-pink);
}

.onefield-intro {
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.7;
  color: var(--white);
  max-width: 420px;
  margin: 0 0 18px;
}

.onefield-intro-bold {
  font-weight: 700;
}

.onefield-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 15px 20px;
  border: none;
  border-radius: 8px;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  margin-bottom: 14px;
  background: var(--white);
  color: var(--body);
}

.onefield-btn {
  display: block;
  width: 100%;
  padding: 15px 24px;
  border: none;
  border-radius: 8px;
  background: var(--yellow);
  color: var(--blue);
  font-family: 'Rubik', sans-serif;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.onefield-btn:hover:not(:disabled) {
  background: var(--peach);
  color: var(--white);
}

.onefield-avatar-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
}

.onefield-avatar-wrap img {
  height: auto;
  display: block;
}

@media (max-width: 800px) {
  .onefield-content-row {
    flex-direction: column;
  }
  .onefield-avatar-wrap {
    display: none;
  }
}
/* -----------------------------------------------------------------------
   ENTRY BUTTONS
   ----------------------------------------------------------------------- */
.btn-entry-code {
  background: var(--yellow);
  color: var(--blue);
  border: none;
  padding: 16px 24px;
  width: 100%;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border-radius: 0;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.btn-entry-code:hover {
  background: var(--peach);
  color: var(--white);
}
.btn-entry-code:active {
  transform: translateY(1px);
}

.btn-entry-returning {
  background: transparent;
  color: var(--white);
  border: 2px solid var(--yellow);
  padding: 14px 24px;
  width: 100%;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border-radius: 0;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.btn-entry-returning:hover {
  background: var(--yellow);
  color: var(--blue);
}
.btn-entry-returning:active {
  transform: translateY(1px);
}

/* -----------------------------------------------------------------------
   BUTTONS
   ----------------------------------------------------------------------- */
.btn {
  display: block;
  width: 100%;
  padding: 16px 24px;
  border: none;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  line-height: 1;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-filled {
  background: var(--yellow);
  color: var(--blue);
}

.btn-filled:hover:not(:disabled) {
  background: var(--yellow-dark);
}

.btn-filled.blue {
  background: var(--blue);
}

.btn-filled.blue:hover:not(:disabled) {
  background: var(--blue-dark);
}

.btn-outline {
  background: transparent;
  color: var(--blue);
  border: 2px solid var(--blue);
  padding: 14px 24px;
}

.btn-outline:hover:not(:disabled) {
  background: var(--blue);
  color: var(--white);
}

/* -----------------------------------------------------------------------
   FORM VIEWS (Register + Login — shared base)
   ----------------------------------------------------------------------- */
#view-register,
#view-login {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--blue);
}

/* Register keeps the centred single-column form */
#view-register {
  padding: 48px 24px;
}

/* Login uses the split layout — slightly tighter vertical padding */
#view-login {
  padding: 40px 24px;
}

/* Verifying (magic link) view shares the same branded blue background as
   login and register, so expired/invalid link text is actually readable */
#view-verifying {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--blue);
  padding: 40px 24px;
}

.form-wrap {
  width: 100%;
  max-width: 600px;
}

.form-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  padding: 0;
  margin-bottom: 36px;
  transition: color 0.15s;
}

.form-back:hover {
  color: var(--white);
}

.form-back-arrow {
  font-size: 16px;
  line-height: 1;
}

.form-heading {
  font-family: 'Rubik', sans-serif;
  font-weight: 800;
  font-size: clamp(42px, 3vw, 32px);
  color: var(--white);
  margin-bottom: 10px;
  line-height: 1.15;
}

.form-subtext {
  font-size: 15px;
  line-height: 1.7;
  color: rgba(255,255,255,0.8);
  margin-bottom: 32px;
}

.form-error-box {
  display: none;
  background: var(--error-bg);
  border-left: 3px solid var(--error-text);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--error-text);
  line-height: 1.5;
  margin-bottom: 24px;
}

.form-error-box.show {
  display: block;
}

.form-field {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 8px;
}

.form-input {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--white);
  background: var(--white);
  font-family: 'Rubik', sans-serif;
  font-size: 15px;
  color: var(--dark);
  border-radius: 0;
  outline: none;
  transition: border-color 0.15s;
-webkit-appearance: none;
  appearance: none; 
}

.form-input:focus {
  border-color: var(--yellow);
}

.form-input.is-error {
  border-color: var(--error-text);
}

.form-hint {
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  margin-top: 6px;
  line-height: 1.5;
}

.form-submit {
  margin-top: 8px;
}

/* -----------------------------------------------------------------------
   CHAT VIEW
   ----------------------------------------------------------------------- */
#view-chat {
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: #f5e6ef;
  position: relative;
}

/* Header */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 20px;
  background: var(--blue);
  border-bottom: none;
  border-radius: 14px;
  flex-shrink: 0;
  gap: 12px;
}

.chat-header-logo {
  height: 28px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.chat-progress-track {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  justify-content: center;
}

/* RENAMED: progress-module-label → progress-step-label */
.progress-step-label {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--white);
  white-space: nowrap;
}

.progress-pips {
  display: flex;
  gap: 4px;
}

.pip {
  width: 8px;
  height: 8px;
  background: rgba(255,255,255,0.3);
  flex-shrink: 0;
  transition: background 0.25s;
}

.pip.is-done {
  background: var(--peach);
}

.pip.is-active {
  background: var(--white);
}

.chat-header-user {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--white);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
  flex-shrink: 0;
}

/* Notification bell and account avatar, chat header */
.notif-bell-wrap { position: relative; flex-shrink: 0; }
.notif-bell-btn {
  width: 30px; height: 30px; border-radius: 8px;
  background: rgba(255,255,255,0.15); border: none; box-shadow: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative; color: #fff;
  transition: transform 0.15s ease;
}
.notif-bell-btn:hover { transform: scale(1.08); }
.notif-badge {
  position: absolute; top: -2px; right: -2px;
  background: #f48f6b; color: #fff; font-size: 8px; font-weight: 700;
  border-radius: 20px; min-width: 14px; height: 14px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px; font-family: 'Montserrat', sans-serif;
  border: 2px solid var(--blue);
}
.avatar-wrap { position: relative; flex-shrink: 0; }
.avatar-btn {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--peach); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Rubik', sans-serif; font-weight: 800; font-size: 11px;
  cursor: pointer; transition: transform 0.15s ease; flex-shrink: 0;
}
.avatar-btn:hover { transform: scale(1.06); }
.avatar-dropdown {
  display: none; position: absolute; top: 40px; right: 0; z-index: 9500;
  width: 230px; background: #fff; border-radius: 10px; border: 1.5px solid #f0e0e8;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12); overflow: hidden;
}
.avatar-dropdown.open { display: block; }
.avatar-dropdown-header { padding: 14px 16px 12px; }
.avatar-dropdown-name { font-family: 'Rubik', sans-serif; font-weight: 800; font-size: 12px; color: #1C1C1C; }
.avatar-dropdown-plan { font-size: 11px; color: #999; margin-top: 3px; }
.avatar-dropdown-divider { height: 1px; background: #f0e0e8; }
.avatar-dropdown-item {
  display: block; width: 100%; text-align: left; background: none; border: none;
  padding: 11px 16px; font-family: 'Montserrat', sans-serif; font-size: 11px;
  font-weight: 600; color: #2E2E2E; cursor: pointer;
}
.avatar-dropdown-item:hover { background: #f9f0f5; }
.avatar-dropdown-signout { color: #c0392b; }
.notif-dropdown {
  display: none; position: fixed; z-index: 9500;
  width: 320px; max-height: 420px; overflow-y: auto;
  background: #fff; border-radius: 10px; border: 1.5px solid #f0e0e8;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12); padding: 8px;
}
.notif-dropdown.open { display: block; }
.notif-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 12px; border-radius: 8px; cursor: pointer;
  background: #f5e6ef; margin-bottom: 8px;
}
.notif-item:last-child { margin-bottom: 0; }
.notif-item:hover { background: #f0dde9; }
.notif-section-label { font-size: 9px; font-weight: 700; text-transform: uppercase; color: #bbb; padding: 4px 4px 8px; }
.notif-dot { width: 7px; height: 7px; border-radius: 50%; background: #f48f6b; margin-top: 5px; flex-shrink: 0; }
.notif-dot.read-dot { background: transparent; }
.notif-item-title { font-size: 14px; font-weight: 700; color: #1C1C1C; }
.notif-item-time { font-size: 9px; color: #bbb; margin-top: 2px; }
.notif-empty { padding: 24px 10px; text-align: center; font-size: 14px; color: #2E2E2E; }

.notif-modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 9998; align-items: center; justify-content: center; padding: 20px;
}
.notif-modal-overlay.open { display: flex; }
.notif-modal-card {
  background: #fff; width: 100%; max-width: 440px; border-radius: 14px;
  padding: 28px; position: relative;
}
.notif-modal-close {
  position: absolute; top: 14px; right: 14px; width: 30px; height: 30px;
  border-radius: 6px; background: #f5e6ef; border: none; font-size: 14px;
  cursor: pointer; color: #bbb; font-weight: 700;
}
.notif-modal-pill {
  display: inline-block; font-size: 9px; font-weight: 700; text-transform: uppercase;
  padding: 3px 9px; border-radius: 20px; margin-bottom: 12px;
}
.notif-modal-pill.roadmap      { background: rgba(117,132,208,0.12); color: #7584D0; }
.notif-modal-pill.announcement { background: rgba(117,132,208,0.12); color: #7584D0; }
.notif-modal-pill.issue        { background: #fde8d8; color: #993C1D; }
.notif-modal-pill.inactivity_7,
.notif-modal-pill.inactivity_14 { background: rgba(228,163,205,0.2); color: #a0508a; }

/* Completion banner */
@keyframes confetti-fall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0.3; }
}

.completion-banner {
  display: none;
  position: absolute;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(245,240,248,0.7);
  z-index: 100;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  padding: 40px 60px;
  box-sizing: border-box;
}

.completion-banner.show {
  display: flex;
}

.completion-close-btn {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: rgba(255,255,255,0.6);
  font-family: 'Montserrat', sans-serif;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
  transition: color 0.15s;
}

.completion-close-btn:hover {
  color: #fff;
}

.completion-inner {
  background: #7584D0;
  border-radius: 12px;
  overflow-y: auto;
  width: 100%;
  padding: 40px 60px;
  text-align: center;
  position: relative;
  max-height: 80vh;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.completion-inner::-webkit-scrollbar { display: none; }

.confetti-piece {
  position: absolute;
  top: -16px;
  animation: confetti-fall linear infinite;
  border-radius: 2px;
}
.completion-inner {
  text-align: center;
  max-width: 600px;
  position: relative;
  z-index: 2;
}

.completion-banner-heading {
  font-family: 'Rubik', sans-serif;
  font-weight: 800;
  font-size: 32px;
  color: #ffeda8;
  margin-bottom: 16px;
  text-transform: uppercase;
  line-height: 1;
}

.completion-banner-text {
  font-size: 13px;
  color: rgba(255,255,255,0.9);
  line-height: 1.75;
  margin-bottom: 16px;
}

.completion-skip-btn {
  background: none;
  border: none;
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 400;
  color: rgba(255,255,255,0.35);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  display: block;
  margin-top: 12px;
  transition: color 0.15s;
}
.completion-skip-btn:hover { color: rgba(255,255,255,0.7); }

.completion-feedback-note {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  margin-top: 10px;
  margin-bottom: 8px;
  line-height: 1.5;
}

.completion-doc-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-doc {
  padding: 10px 18px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  border-radius: 0;
  transition: background 0.15s;
}

.btn-doc.peach {
  background: var(--peach);
  color: var(--white);
}

.btn-doc.peach:hover:not(:disabled) {
  background: var(--peach-dark);
}

.btn-doc.blue {
  background: var(--blue);
  color: var(--white);
}

.btn-doc.blue:hover:not(:disabled) {
  background: var(--blue-dark);
}

.btn-doc:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Messages area */
.chat-messages {
  flex: 1;
  overflow-y: auto; 
  padding: 24px max(20px, calc((100% - 1100px) / 2)) 8px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background: #f5e6ef;
}
.chat-messages::-webkit-scrollbar { display: none; } 

/* Message avatar */
.message-group.from-nat {
  flex-direction: row !important;
  align-items: flex-start;
  gap: 10px;
}

.message-nat-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.message-nat-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  flex-shrink: 0;
  margin-top: 14px;
  border: 2px solid var(--white);
  box-shadow: 0 2px 6px rgba(117,132,208,0.2);
}

.message-group {
  display: flex;
  flex-direction: column;
  max-width: 74%;
  animation: msg-in 0.18s ease both;
}

@keyframes msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.message-group.from-nat {
  align-self: flex-start;
}

.message-group.from-user {
  align-self: flex-end;
}

.message-sender {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 6px;
}

.message-group.from-user .message-sender {
  text-align: right;
  color: var(--blue);
}

.message-bubble {
  padding: 14px 18px;
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  line-height: 1.7;
}

.from-nat .message-bubble {
  background: var(--white);
  border-radius: 0 16px 16px 16px;
  color: var(--dark);
  box-shadow: 0 2px 8px rgba(117,132,208,0.12);
}

.from-user .message-bubble {
  background: var(--blue);
  color: var(--white);
  border-radius: 16px 0 16px 16px;
  box-shadow: 0 2px 8px rgba(117,132,208,0.2);
}

.message-bubble p {
  margin-bottom: 10px;
}

.message-bubble p:last-child {
  margin-bottom: 0;
}

.message-bubble strong {
  font-weight: 600;
}

/* Option chips */
.option-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  padding: 9px 16px;
  background: transparent;
  border: 2px solid var(--blue);
  color: var(--blue);
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  cursor: pointer;
  border-radius: 0;
  transition: background 0.12s, color 0.12s;
  line-height: 1;
}

.chip:hover:not(:disabled) {
  background: var(--blue);
  color: var(--white);
}

.chip.is-selected {
  background: var(--blue);
  color: var(--white);
}

.chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Typing indicator */
.typing-group {
  align-self: flex-start;
  animation: msg-in 0.18s ease both;
}

.typing-bubble {
  background: var(--white);
  border-radius: 18px;
  padding: 12px 16px;
  display: inline-flex;
  gap: 4px;
  align-items: center;
  box-shadow: 0 2px 8px rgba(117,132,208,0.12);
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: #b0b0b8;
  border-radius: 50%;
  animation: imessage-pulse 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes imessage-pulse {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.85); }
  30%            { opacity: 1;   transform: scale(1.15); }
}

/* Input area */
.chat-footer {
  flex-shrink: 0;
  background: var(--white);
  border-radius: 12px;
  margin: 12px 16px 12px;
  padding: 12px;
}

.chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 14px 16px 10px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.chat-textarea {
  flex: 1;
  padding: 11px 14px;
 border: 1.5px solid var(--blue);
  background: var(--off-white);
  font-family: 'Rubik', sans-serif;
  font-size: 15px;
  color: var(--dark);
  resize: none;
  min-height: 46px;
  max-height: 130px;
  overflow-y: auto;
  outline: none;
  border-radius: 12px;
  line-height: 1.5;
  transition: border-color 0.15s;
  -webkit-appearance: none;
  appearance: none;
  scrollbar-width: none;
}

.chat-textarea::-webkit-scrollbar { display: none; }

.chat-textarea:focus {
  border-color: var(--blue);
}

.chat-textarea::placeholder {
  color: #999;
}

.chat-send-btn {
  width: 46px;
  height: 46px;
  background: var(--peach);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 0;
  transition: background 0.15s;
}

.chat-send-btn:hover:not(:disabled) {
  background: var(--peach-dark);
}

.chat-send-btn:disabled {
  background: var(--border);
  cursor: not-allowed;
}

.send-icon {
  width: 18px;
  height: 18px;
  fill: var(--white);
}

.chat-bar-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 12px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.chat-bar-label {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--body);
}

.btn-foundations-dl {
  padding: 7px 14px;
  background: transparent;
  border: 2px solid var(--border);
  color: var(--body);
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 0;
  transition: border-color 0.15s, color 0.15s;
}

.btn-foundations-dl:hover:not(:disabled) {
  border-color: var(--blue);
  color: var(--blue);
}

.btn-foundations-dl:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.chat-footer-credit {
  text-align: center;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--border);
  padding: 0 16px 10px;
}

/* -----------------------------------------------------------------------
   TOAST
   ----------------------------------------------------------------------- */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--dark);
  color: var(--white);
  padding: 12px 20px;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  white-space: nowrap;
  z-index: 1000;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* -----------------------------------------------------------------------
   HISTORY MESSAGES
   ----------------------------------------------------------------------- */
.is-history {
  opacity: 0.6;
}

.history-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
  color: var(--body);
}

.history-divider::before,
.history-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(117,132,208,0.3);
}

.history-divider span {
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  white-space: nowrap;
}

.history-divider.continuing span {
  color: var(--blue);
}

.history-divider.continuing::before,
.history-divider.continuing::after {
  background: var(--blue);
  opacity: 0.3;
}

/* -----------------------------------------------------------------------
   FEEDBACK OVERLAY
   ----------------------------------------------------------------------- */
.feedback-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
}

.feedback-overlay.show {
  display: flex;
}

.feedback-overlay-inner {
  background: var(--white);
  width: 100%;
  max-width: 640px;
  height: 80vh;
  position: relative;
  display: flex;
  flex-direction: column;
}

.feedback-overlay-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  z-index: 1;
  color: var(--dark);
  line-height: 1;
}

.feedback-overlay-close:hover {
  color: var(--peach);
}

#tally-iframe {
  flex: 1;
  border: none;
}

/* -----------------------------------------------------------------------
   RESPONSIVE
   ----------------------------------------------------------------------- */
@media (max-width: 700px) {
  .entry-content-row {
    flex-direction: column;
    gap: 24px;
    align-items: center;
  }
  .entry-left {
    text-align: center;
    align-items: center;
    max-width: 100%;
    padding-bottom: 0;
  }
  .entry-left .entry-heading,
  .entry-left .entry-intro {
    margin-left: auto;
    margin-right: auto;
  }
  .entry-avatar-wrap {
    width: 160px;
    order: -1;
  }
}

@media (max-width: 580px) {
  .message-group {
    max-width: 90%;
  }
  .progress-pips {
    display: none;
  }
}

/* -----------------------------------------------------------------------
   INTERACTIVE VISUALS
   ----------------------------------------------------------------------- */
.visual-wrap {
  margin-top: 14px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--white);
  box-shadow: 0 2px 12px rgba(117,132,208,0.15);
  max-width: 480px;
}

.visual-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--border);
}

/* -----------------------------------------------------------------------
   MARKETING FUNNEL
   ----------------------------------------------------------------------- */
.funnel {
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.funnel-stage {
  width: 100%;
  overflow: hidden;
  transition: transform 0.2s;
}

.funnel-stage:nth-child(1) { max-width: 100%; clip-path: polygon(0 0, 100% 0, 92% 100%, 8% 100%); }
.funnel-stage:nth-child(2) { max-width: 84%;  clip-path: polygon(0 0, 100% 0, 90% 100%, 10% 100%); }
.funnel-stage:nth-child(3) { max-width: 68%;  clip-path: polygon(0 0, 100% 0, 85% 100%, 15% 100%); }
.funnel-stage:nth-child(4) { max-width: 52%;  border-radius: 4px; }

.funnel-stage-inner {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
}

.funnel-awareness    { background: #fbeaf0; }
.funnel-consideration { background: #e4a3cd; }
.funnel-conversion   { background: var(--blue); }
.funnel-retention    { background: var(--peach); }

.funnel-stage-name {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.funnel-awareness .funnel-stage-name { color: #993556; }
.funnel-consideration .funnel-stage-name { color: #4B1528; }

.funnel-conversion .funnel-stage-name {
  color: var(--white);
}

.funnel-retention .funnel-stage-name {
  color: #4A1B0C;
}

.funnel-stage-desc {
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 400;
}

.funnel-awareness .funnel-stage-desc,
.funnel-consideration .funnel-stage-desc {
  color: #4B1528;
  opacity: 0.75;
}

.funnel-conversion .funnel-stage-desc {
  color: rgba(255,255,255,0.8);
}

.funnel-retention .funnel-stage-desc {
  color: rgba(74,27,12,0.75);
}

.funnel-content-items {
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 600;
  margin-top: 2px;
}

.funnel-awareness .funnel-content-items,
.funnel-consideration .funnel-content-items {
  color: #4B1528;
}

.funnel-conversion .funnel-content-items {
  color: rgba(255,255,255,0.95);
}

.funnel-retention .funnel-content-items {
  color: #4A1B0C;
}

.funnel-empty {
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-style: italic;
  opacity: 0.5;
}

/* -----------------------------------------------------------------------
   SWOT GRID
   ----------------------------------------------------------------------- */
.swot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.swot-quadrant {
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,0.4);
  transition: background 0.3s;
}

.swot-strength    { background: rgba(247,108,71,0.12);  }
.swot-weakness    { background: rgba(117,132,208,0.12); }
.swot-opportunity { background: rgba(255,237,168,0.5);  }
.swot-threat      { background: rgba(228,163,205,0.25); }

.swot-quadrant-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.swot-icon {
  font-size: 14px;
  line-height: 1;
}

.swot-quadrant-name {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.swot-strength .swot-quadrant-name    { color: var(--peach-dark); }
.swot-weakness .swot-quadrant-name    { color: var(--blue-dark);  }
.swot-opportunity .swot-quadrant-name { color: #8a7200;           }
.swot-threat .swot-quadrant-name      { color: #a0507a;           }

.swot-quadrant-body p {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  line-height: 1.6;
  color: var(--dark);
  margin: 0;
}

.swot-placeholder {
  font-style: italic;
  color: var(--border) !important;
  font-size: 11px !important;
}

/* Pulse animation when SWOT updates in place */
@keyframes swot-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(117,132,208,0.4); }
  70%  { box-shadow: 0 0 0 8px rgba(117,132,208,0); }
  100% { box-shadow: 0 0 0 0 rgba(117,132,208,0);   }
}

.swot-updated {
  animation: swot-pulse 0.6s ease;
}

/* -----------------------------------------------------------------------
   CONTENT PILLARS
   ----------------------------------------------------------------------- */
.pillars-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.pillar-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid rgba(255,255,255,0.3);
  transition: background 0.3s;
}

.pillar-number {
  font-family: 'Montserrat', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pillar-icon {
  font-size: 20px;
  line-height: 1;
  margin: 4px 0;
}

.pillar-name {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 13px;
  line-height: 1.3;
}

.pillar-placeholder {
  font-style: italic;
  font-weight: 400;
  font-size: 11px;
  opacity: 0.6;
}

/* -----------------------------------------------------------------------
   RESPONSIVE — VISUALS
   ----------------------------------------------------------------------- */
@media (max-width: 580px) {
  .visual-wrap {
    max-width: 100%;
  }
  .funnel-stage:nth-child(2) { max-width: 90%; }
  .funnel-stage:nth-child(3) { max-width: 78%; }
  .funnel-stage:nth-child(4) { max-width: 64%; }
}

/* -----------------------------------------------------------------------
   FORM SCREEN LOGO + AVATAR
   ----------------------------------------------------------------------- */
.form-logo {
  display: block;
  width: 130px;
  height: auto;
  margin: 0 auto 28px;
}

.form-avatar-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.form-nat-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--white);
  border: 3px solid var(--yellow);
  box-shadow: 0 4px 16px rgba(117,132,208,0.25);
}

/* -----------------------------------------------------------------------
   LOGIN VIEW — SPLIT LAYOUT
   ----------------------------------------------------------------------- */

/* Hidden avatar placeholder (kept so app.js getElementById doesn't error) */
.login-avatar-hidden {
  display: none;
}

/* Logo above the card — generous margin so it sits clearly apart from the content */
.login-page-logo {
  display: block;
  width: 130px;
  height: auto;
  margin: 0 auto 56px;
  flex-shrink: 0;
}

/* Two-column row: form left, image right */
.login-split {
  display: flex;
  align-items: stretch;
  gap: 40px;
  width: 100%;
  max-width: 780px;
}

/* Left panel — form content */
.login-form-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Right panel — Nat character canvas, fills full height of the form */
.login-image-panel {
  flex: 0 0 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

/* Canvas fills the available panel height proportionally */
#login-nat-canvas {
  display: block;
  width: auto;
  height: 100%;
  max-width: 260px;
  min-height: 260px;
}

/* Responsive — stack on mobile */
@media (max-width: 680px) {
  .login-split {
    flex-direction: column;
    gap: 0;
    align-items: center;
  }
  .login-image-panel {
    flex: 0 0 auto;
    width: 160px;
    order: -1;
    justify-content: center;
    margin-bottom: 12px;
  }
  #login-nat-canvas {
    height: auto;
    width: 160px;
    min-height: 0;
  }
}

/* -----------------------------------------------------------------------
   CONTENT IDEAS GRID — Module 7
   ----------------------------------------------------------------------- */
.content-ideas-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.content-idea-card {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  border: 1px solid rgba(255,255,255,0.18);
  transition: background 0.3s;
}

.content-idea-num {
  font-family: 'Montserrat', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.65;
}

.content-idea-text {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.45;
}

.content-idea-format {
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.72;
}

/* -----------------------------------------------------------------------
   CONTENT PILLARS — new card layout (pc-* classes)
   ----------------------------------------------------------------------- */
.pc-wrap {
  background: #F8F5F0;
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(117,132,208,0.12);
}

.pc-header {
  padding: 20px 24px 16px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}

.pc-title {
  font-family: 'Rubik', sans-serif;
  font-weight: 800;
  font-size: 17px;
  color: var(--dark);
  letter-spacing: 0.01em;
}

.pc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 16px;
}

.pc-card {
  background: #ffffff;
  padding: 16px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.pc-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  flex-shrink: 0;
}

.pc-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pc-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.pc-number {
  font-family: 'Montserrat', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.pc-name {
  font-family: 'Rubik', sans-serif;
  font-weight: 800;
  font-size: 14px;
  color: var(--dark);
  line-height: 1.2;
}

.pc-stage-row { margin-top: 4px; }

.pc-stage {
  display: inline-block;
  font-family: 'Montserrat', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
}

@media (max-width: 600px) {
  .pc-grid { grid-template-columns: repeat(2, 1fr); }
}

/* -----------------------------------------------------------------------
   BADGE DROP-IN (inline in chat on step completion)
   ----------------------------------------------------------------------- */
.badge-drop-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(117,132,208,0.15);
  max-width: 220px;
  text-align: center;
  animation: badge-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes badge-pop {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: scale(1); }
}

.badge-drop-img {
  width: 110px;
  height: 110px;
  object-fit: contain;
  margin-bottom: 10px;
}

.badge-drop-name {
  font-family: 'Montserrat', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f48f6b;
  margin-bottom: 4px;
}

.badge-drop-title {
  font-family: 'Rubik', sans-serif;
  font-weight: 800;
  font-size: 16px;
  text-transform: uppercase;
  color: var(--dark);
  margin-bottom: 8px;
  line-height: 1.1;
}

.badge-drop-share {
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  color: #999;
  line-height: 1.5;
}

/* Hide header when embedded in dashboard */
.embedded .chat-header-logo { display: none !important; }
