:root {
  --bg: #f6f3fc;
  --panel: #ffffff;
  --primary: #7e57c2;
  --primary-dark: #5e35b1;
  --lavender: #ede7f6;
  --violet-soft: #f1e5fc;
  --text: #2e2147;
  --muted: #7a6f96;
  --crisis: #b3261e;
  --border: #e3dcf2;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background: linear-gradient(160deg, #f6f3fc 0%, #efe8fb 100%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden; /* the full-bleed journey panel uses 100vw; avoid a stray h-scrollbar */
}

.app {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.header { text-align: center; position: relative; }
.reset {
  position: absolute; top: 0; right: 0; background: #fff; border: 1px solid var(--border);
  color: var(--primary-dark); padding: 6px 12px; border-radius: 999px; font-size: .78rem;
  cursor: pointer;
}
.reset:hover { background: var(--violet-soft); }
.brand { display: flex; align-items: center; justify-content: center; gap: 10px; }
.brand h1 { margin: 0; font-size: 1.8rem; color: var(--primary-dark); letter-spacing: .5px; }
.dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #b39ddb, var(--primary));
  box-shadow: 0 0 0 4px rgba(126, 87, 194, .15);
}
.disclosure { margin: 8px auto 0; max-width: 560px; font-size: .82rem; color: var(--muted); }

.notice {
  background: #fff4d6; border: 1px solid #e0a93b; color: #6b4a10;
  padding: 8px 12px; border-radius: 10px; font-size: .82rem; text-align: center;
}

.chat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  min-height: 340px;
  max-height: 56vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 8px 30px rgba(94, 53, 177, .08);
}

.msg { max-width: 86%; padding: 11px 14px; border-radius: 14px; line-height: 1.45; font-size: .95rem; white-space: pre-wrap; }
.msg.lou { align-self: flex-start; background: var(--lavender); border-bottom-left-radius: 4px; }
.msg.user { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.msg.crisis { align-self: stretch; max-width: 100%; background: #fdecea; border: 1px solid var(--crisis); color: #5c1a16; }
.msg.typing { color: var(--muted); font-style: italic; }

.resources { margin-top: 10px; align-self: flex-start; max-width: 86%; }
.resources h3 { margin: 0 0 6px; font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.resources ul { margin: 0; padding-left: 18px; }
.resources li { font-size: .9rem; margin-bottom: 3px; }
.resources a { color: var(--primary-dark); }

.quick { display: flex; flex-wrap: wrap; gap: 8px; }
.quick button {
  background: var(--violet-soft); border: 1px solid var(--border); color: var(--primary-dark);
  padding: 8px 12px; border-radius: 999px; font-size: .85rem; cursor: pointer;
}
.quick button:hover { background: #e7d6fb; }

.composer { display: flex; gap: 8px; }
.composer input {
  flex: 1; padding: 13px 16px; border: 1px solid var(--border); border-radius: 999px;
  font-size: .95rem; outline: none; background: #fff;
}
.composer input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(126,87,194,.15); }
.composer button {
  background: var(--primary); color: #fff; border: none; border-radius: 999px;
  padding: 0 22px; font-size: .95rem; cursor: pointer;
}
.composer button:hover { background: var(--primary-dark); }
.composer button:disabled { opacity: .5; cursor: default; }

/* Full-bleed: the map is a wide landscape graphic, so let it use the whole window width
   instead of being squeezed into the centered chat column. */
.journey {
  position: relative; width: 100vw; left: 50%; margin-left: -50vw;
  background: var(--panel); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 20px 24px;
}
/* Focused view: drop the full-bleed and sit within the chat column instead. */
.journey.focused {
  width: auto; left: auto; margin-left: 0;
  border: 1px solid var(--border); border-radius: 18px; padding: 18px;
}
.journey.focused .road-svg { min-width: 0; max-width: 100%; }
.journey-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.journey h2 { margin: 0 0 8px; font-size: 1rem; color: var(--primary-dark); }
.journey-head h2 { margin: 0; }
.journey-toggle {
  background: #fff; border: 1px solid var(--border); color: var(--primary-dark);
  padding: 7px 14px; border-radius: 999px; font-size: .8rem; font-family: inherit; cursor: pointer;
  white-space: nowrap; transition: background .12s ease;
}
.journey-toggle:hover { background: var(--violet-soft); }

/* 2D "road-trip" journey map: scattered, phase-colored pins on a connected dashed road. */
.journey-map {
  margin-top: 6px; overflow-x: auto; border-radius: 14px; text-align: center;
  background: linear-gradient(160deg, #f3eefc 0%, #efe9fb 100%);
}
/* Fills the full-bleed panel (capped on huge screens); scrolls only on narrow ones. */
.road-svg { display: block; width: 100%; max-width: 1700px; min-width: 900px; height: auto; margin: 0 auto; }
.road-svg .rdstop { transition: opacity .12s ease; }
.road-svg .rdstop:hover { opacity: 1 !important; }
.road-svg .rdstop:hover .rdlabel { stroke: var(--primary); }
.road-svg .rdstop:focus-visible { outline: none; }
.road-svg .rdstop:focus-visible .rdlabel { stroke: var(--primary); stroke-width: 2; }
.road-svg .rdlabel { filter: drop-shadow(0 2px 4px rgba(60, 40, 110, .14)); }
.road-svg .rdlabel.current { filter: drop-shadow(0 3px 8px rgba(47, 111, 237, .35)); }

.journey-legend {
  display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: .76rem; color: var(--muted);
}
.journey-legend span { display: inline-flex; align-items: center; gap: 6px; }
.journey-legend .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.journey-legend .dot.early { background: #2f6fed; }
.journey-legend .dot.skills { background: #34a853; }
.journey-legend .dot.advanced { background: #ea4335; }
.journey-legend .dot.ongoing { background: #f9ab00; }

.journey-note { margin: 10px 0 0; font-size: .76rem; color: var(--muted); }
