:root {
  --bg: #eef2f5;
  --surface: #ffffff;
  --text: #0b1f27;
  --brand: #0a8f7a;
  --brand-dark: #0a6f62;
  --bot: #e6f6f4;
  --bot-text: #0a4b42;
  --shadow: 0 1px 6px rgba(0, 0, 0, .08);
  --radius: 18px;
}

:root {
  --page-width: 50%;
  --page-max: 980px;
  --page-min: 360px;
  --page-hpad: 20px;
  /* shared horizontal padding */
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
}

/* Header shell (keep your colors/shadow as desired) */
.app-header {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
}

.app-header__inner {
  width: var(--page-width);
  max-width: var(--page-max);
  min-width: var(--page-min);
  margin: 0 auto;
  padding: 16px var(--page-hpad);
}

/* Header layout using grid so title + tagline align (no manual margins) */
.header-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  /* logo | text column */
  column-gap: 10px;
  align-items: center;
}

.logo {
  font-size: 26px;
  line-height: 1;
}

.title-wrap {
  display: flex;
  flex-direction: column;
}

.app-title {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  color: #111827;
}

.app-tagline {
  margin: 4px 0 0 0;
  font-size: 14px;
  color: #6b7280;
}

/* Remove any old rule like: .app-tagline { margin-left:36px } */


/* App container */
/* Chat app container already at 60%; keep it consistent */
.app {
  width: var(--page-width);
  max-width: var(--page-max);
  min-width: var(--page-min);
  margin: 0 auto;
  padding: 14px var(--page-hpad) 22px;
}

/* Keep it comfortable on small screens */
@media (max-width: 900px) {
  .app {
    width: 100%;
    min-width: 0;
  }
}


/* Chat frame */
.chat-frame {
  background: transparent;
  border-radius: 16px;
  height: calc(100vh - 210px);
  /* nice tall window like your target */
  min-height: 460px;
  overflow-y: auto;
  padding: 10px var(--page-hpad) 16px;
}

/* Message rows */
#chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 100%;
}

.message-row.user {
  justify-content: flex-end;
}

.avatar {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  box-shadow: var(--shadow);
  background: #fff;
}

/* Avatars match bubble colors */
.avatar.bot {
  background: #e6f6f4;
  /* same as bot bubble */
  color: #0a4b42;
  /* same as bot text */
}

.avatar.user {
  background: #0a8f7a;
  /* same as user bubble */
  color: #ffffff;
  /* same as user text */
}

.bubble {
  background: var(--bot);
  color: var(--bot-text);
  border-radius: var(--radius);
  border-bottom-left-radius: 8px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
  max-width: 85%;
  width: fit-content;
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.4;
}

.message-row.user .bubble {
  background: var(--brand);
  color: #fff;
  border-bottom-right-radius: 8px;
  border-bottom-left-radius: var(--radius);
  text-align: left;
}

.timestamp {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  opacity: .6;
}

/* Cards inside bot bubbles */
.card {
  background: #fff;
  color: var(--text);
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 14px;
  padding: 10px 12px;
}

/* Chips row container */
.chips {
  display: flex;
  gap: 8px;
  /* adds spacing between chips */
  flex-wrap: wrap;
  /* allows wrapping if too many */
  margin-top: 10px;
  /* space above chips row */
}

/* Each chip button */
.chip {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #111827;
  padding: 6px 14px;
  border-radius: 999px;
  /* pill shape */
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  display: inline-flex;
  /* keep text centered */
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  /* prevent text from breaking */
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: background .2s, border-color .2s;
}

.chip:hover {
  background: #f9fafb;
  border-color: #94a3b8;
}


/* Composer */
/* Composer wrapper */
.composer {
  display: flex;
  gap: 10px;
  align-items: center;
  background: transparent;
  margin-top: 8px;
  padding: 0 var(--page-hpad);
}

/* Input box */
textarea {
  flex: 1;
  resize: none;
  padding: 12px 14px;
  border: 1.8px solid #cbd5e1;
  /* light gray border */
  border-radius: 10px;
  /* subtle rounded corners */
  outline: none;
  font-size: 15px;
  min-height: 42px;
  max-height: 110px;
  background: #fff;
  color: #111827;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color .2s, box-shadow .2s;
}

/* Match focus ring with Send button color */
textarea:focus {
  border-color: #10b981;
  /* same as .btn-send background */
  box-shadow: 0 0 0 2px rgba(16, 185, 129, .30);
}

textarea {
  overflow-y: hidden;
  /* was auto */
  /* keep your existing padding, border, radius, etc. */
}

/* Buttons */
button {
  border: 0;
  cursor: pointer;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  transition: background .2s, transform .1s;
}

/* Override global button sizing so chips & station buttons size naturally */
.btn-send,
.btn-clear {
  width: 42px;
  height: 42px;
}

button:not(.btn-send):not(.btn-clear) {
  width: auto !important;
  height: auto !important;
}

/* Ensure chips render text inside the pill, not outside */
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
  /* keep label inside the pill */
  font-size: 14px;
  font-weight: 500;
}

button:active {
  transform: scale(0.95);
}

/* Send button */
.btn-send {
  background: #10b981;
  /* teal/green */
}

.btn-send:hover {
  background: #059669;
}

/* Clear button */
.btn-clear {
  background: #475569;
  /* slate gray */
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  /* rounded square instead of circle */
  font-size: 18px;
}

.btn-clear:hover {
  background: #334155;
  /* darker on hover */
}


/* Chips */
.chip {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #111827;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: background .2s, border-color .2s;
}

.chip:hover {
  background: #f9fafb;
  border-color: #94a3b8;
}

/* Typing */
#typing-indicator {
  font-style: italic;
  opacity: .8;
  margin: 2px 44px;
}

.hidden {
  display: none
}

/* Narrow screens */
@media (max-width:640px) {
  .chat-frame {
    height: calc(100vh - 190px)
  }

  .app-title {
    font-size: 22px
  }
}

/* Mobile */
@media (max-width:900px) {
  .station-meta {
    grid-template-columns: 1fr 1fr;
  }

  .kv.power {
    text-align: left;
  }
}

/* Equal columns + consistent label→value spacing */
.station-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  /* 3 equal columns */
  column-gap: 24px;
  row-gap: 0;
  align-items: start;
}

.kv {
  display: flex;
  flex-direction: column;
}

.kv .label {
  font-size: 12px;
  color: #64748b;
  margin: 0 0 6px;
}

/* equal gap to value */
.kv .value {
  font-weight: 700;
  color: #0b1f27;
}

/* keep Cost green emphasis */
.kv .value.emphasize {
  color: #10b981;
}

/* remove special right-align so all three values align the same way */
.kv.power {
  text-align: left;
}

/* Center the button horizontally inside the card */
.station-actions {
  margin-top: 12px;
  /* or keep 18px if you prefer the spacing */
  display: flex;
  justify-content: flex-start;
}

/* --- Station-card refinements --- */

/* 1) Bold the labels */
.kv .label {
  font-weight: 700;
  /* was normal */
}

/* 2) Keep title and button exactly the same size via a shared var */
:root {
  --station-title-size: 20px;
  /* adjust once if you want bigger/smaller */
}

.station-name {
  font-size: var(--station-title-size);
}

.station-card .btn-primary {
  font-size: var(--station-title-size);
  /* match station name */
  padding: 12px 18px;
  /* keep proportions with larger text */
  white-space: nowrap;
  /* avoid wrapping */
}

/* Tweak: make "Get Directions" slightly smaller than station title */
:root {
  --station-title-size: 20px;
  /* keep title as-is */
  --station-btn-size: 17px;
  /* slightly smaller button text */
}

.station-name {
  font-size: var(--station-title-size);
}

.station-card .btn-primary {
  font-size: var(--station-btn-size);
  padding: 10px 18px;
  /* reduce padding to match new size */
}

/* Hide all message timestamps */
.timestamp {
  display: none !important;
}

/* Map card inside bot bubble */
.map-card {
  margin: 12px 0;
  text-align: center;
}

.btn-map {
  display: inline-block;
  background: #10b981;
  /* teal */
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  /* pill look */
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: background 0.2s, transform 0.1s;
}

.btn-map:hover {
  background: #059669;
  transform: scale(1.05);
}

/* ===== Station cards: full-width inside chat bubble ===== */
.message-row .bubble.station-wrap {
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
}

/* ===== Card shell (target look) ===== */
.station-card {
  position: relative;
  width: 100%;
  background: #fff;
  border: 1px solid #E5E7EB;
  /* subtle border */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  /* lighter shadow */
  border-radius: 16px;
  /* tighter radius */
  padding: 16px 20px;
  /* compact padding */
  display: grid;
  grid-template-columns: 56px 1fr;
  /* icon | content */
  column-gap: 12px;
  align-items: start;
}

/* Icon tile */
.station-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 22px;
  align-self: top;
  /* NEW: centers icon against name+address */
}

/* Right column (content) */
.station-main {
  display: grid;
  gap: 10px;
}

/* Top row: title (left) + availability badge (right) */
.station-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: flex-start;
  /* NEW: text aligns to top with the icon */
}

.station-top>div {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  /* aligns name+address with logo */
}

/* Typography: left-aligned title & address */
.station-name {
  font-weight: 700;
  font-size: 18px;
  color: #0f172a;
  line-height: 1.05;
  /* tighter */
}

.station-address {
  color: #475569;
  font-size: 14px;
  margin-top: 6px;
  /* pulls closer to name */
  line-height: 1.15;
  /* slightly tighter */
}

.station-badge {
  font-size: 12px;
  padding: 3px 5px;
  border-radius: 999px;
  border: 1px solid;
  line-height: 1;
}

.station-badge.available {
  background: #eafaf3;
  color: #178a53;
  border-color: #b6ebd0;
}

.station-badge.busy {
  background: #fdeaea;
  color: #c2410c;
  border-color: #f5c2c0;
}

.station-badge.unknown {
  background: #f1f5f9;
  color: #334155;
  border-color: #cbd5e1;
}

/* 3-column metrics row (compact like target) */
.station-meta {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  /* equal thirds */
  gap: 16px;
  align-items: center;
  font-size: 14px;
  color: #1e293b;
  text-align: center;
  /* centers text in each column */
}

.kv:first-child {
  text-align: left;
  /* Distance aligns with name/address */
}

.kv .label {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 2px;
}

.kv .value {
  font-weight: 700;
  color: #0b1f27;
}

.kv .value.emphasize {
  color: #10b981;
}

/* green for price */
.kv.power {
  text-align: right;
}

/* Button area */
.station-actions {
  margin-top: 0px;
}

/* Get Directions button (pill look) */
.station-card .btn-primary {
  background: #10b981;
  color: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.20);
  transition: background .2s, transform .1s;
}

.station-card .btn-primary:hover {
  background: #059669;
  transform: translateY(-1px);
}