:root {
  color: #17202a;
  background: #f5f7fb;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.tp-app {
  display: grid;
  grid-template-columns: 72px minmax(300px, 360px) minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
  background: #eef2f7;
}

.rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 14px 10px;
  background: #ffffff;
  border-right: 1px solid #dce3ec;
  z-index: 5;
}

.rail-logo,
.rail-nav button,
.login-button {
  border: 0;
  background: transparent;
  color: #697586;
}

.rail-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #0c835c;
  color: #fff;
  font-weight: 900;
  letter-spacing: 0;
}

.rail-nav {
  display: grid;
  gap: 10px;
  width: 100%;
}

.rail-nav button,
.login-button {
  display: grid;
  justify-items: center;
  gap: 5px;
  width: 52px;
  min-height: 54px;
  padding: 7px 4px;
  border-radius: 12px;
}

.rail-nav button:hover,
.login-button:hover {
  background: #f0f4f8;
  color: #17202a;
}

.rail-nav span,
.login-button span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e7edf5;
  color: #44546a;
  font-size: 13px;
  font-weight: 900;
}

.rail-nav small,
.login-button small {
  font-size: 11px;
  font-weight: 800;
}

.login-button {
  margin-top: auto;
}

.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  background: #ffffff;
  border-right: 1px solid #dce3ec;
  min-width: 0;
}

.chat-head {
  padding: 22px 20px 16px;
  border-bottom: 1px solid #e4eaf1;
}

.eyebrow {
  margin: 0 0 6px;
  color: #0c835c;
  font-size: 12px;
  font-weight: 900;
}

.chat-head h1 {
  margin: 0 0 12px;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0;
}

.status-pill {
  display: inline-flex;
  max-width: 100%;
  padding: 7px 10px;
  border-radius: 999px;
  background: #eef8f4;
  color: #0b6f50;
  font-size: 12px;
  font-weight: 800;
  white-space: normal;
}

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  overflow: auto;
}

.chat-bubble {
  max-width: 92%;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 11px 13px;
  background: #f8fafc;
}

.chat-bubble span {
  display: block;
  margin-bottom: 5px;
  color: #697586;
  font-size: 11px;
  font-weight: 900;
}

.chat-bubble p {
  margin: 0;
  color: #1f2937;
  font-size: 14px;
  line-height: 1.56;
}

.chat-bubble.user {
  align-self: flex-end;
  background: #eaf4ff;
  border-color: #c8def8;
}

.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px 0;
}

.quick-prompts button {
  border: 1px solid #d7e0ea;
  border-radius: 999px;
  padding: 8px 10px;
  background: #fff;
  color: #44546a;
  font-size: 12px;
  font-weight: 800;
}

.chat-form {
  display: grid;
  gap: 10px;
  padding: 14px 16px 18px;
}

.chat-form textarea {
  width: 100%;
  min-height: 88px;
  resize: none;
  border: 1px solid #cfd8e3;
  border-radius: 14px;
  padding: 12px 13px;
  outline: none;
  color: #17202a;
  background: #fbfdff;
}

.chat-form textarea:focus,
.location-search input:focus {
  border-color: #0c835c;
  box-shadow: 0 0 0 3px rgba(12, 131, 92, 0.14);
}

.chat-form button,
.location-search button {
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  background: #0c835c;
  color: #fff;
  font-weight: 900;
}

.chat-form button:disabled,
.quick-prompts button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.map-area {
  position: relative;
  min-width: 0;
  min-height: 0;
  background: #dfe6ef;
}

.map-topbar {
  position: absolute;
  top: 18px;
  left: 20px;
  right: 20px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.map-topbar > * {
  pointer-events: auto;
}

.location-search {
  display: flex;
  align-items: center;
  min-width: 260px;
  width: min(460px, 48vw);
  height: 46px;
  border: 1px solid #d3dce7;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.15);
  overflow: hidden;
}

.location-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: none;
  padding: 0 16px;
  color: #17202a;
}

.location-search button {
  height: 100%;
  border-radius: 0;
  padding: 0 18px;
}

.context-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 42px;
  border: 1px solid #d5dde8;
  border-radius: 999px;
  padding: 0 14px 0 9px;
  background: #fff;
  color: #667085;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
  font-size: 13px;
  font-weight: 900;
}

.context-chip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: #edf1f6;
  color: #7b8794;
  font-size: 12px;
}

.context-chip.is-active.home {
  border-color: #b8e2c8;
  color: #0a7a45;
}

.context-chip.is-active.work {
  border-color: #bdd7ff;
  color: #175cd3;
}

.context-chip.is-active.preference {
  border-color: #ffc9da;
  color: #c11574;
}

.context-chip.is-active.home span {
  background: #dff7e8;
  color: #0a7a45;
}

.context-chip.is-active.work span {
  background: #e7f0ff;
  color: #175cd3;
}

.context-chip.is-active.preference span {
  background: #ffe8f1;
  color: #c11574;
}

.map-caption {
  position: absolute;
  left: 22px;
  bottom: 22px;
  z-index: 4;
  display: grid;
  gap: 4px;
  max-width: min(420px, calc(100% - 44px));
  padding: 13px 15px;
  border: 1px solid rgba(207, 216, 227, 0.96);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.16);
}

.map-caption strong {
  font-size: 15px;
}

.map-caption span {
  color: #667085;
  font-size: 13px;
  line-height: 1.4;
}

.map-shell,
.map-canvas {
  width: 100%;
  height: 100%;
}

.map-shell {
  position: relative;
}

.fallback-map {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(225, 234, 245, 0.86)),
    #e3eaf3;
}

.fallback-map-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.fallback-marker {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 180px;
  padding: 7px 9px 7px 7px;
  border: 1px solid rgba(12, 131, 92, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
  color: #17202a;
  font-size: 12px;
  font-weight: 900;
  transform: translate(-18px, -38px);
}

.fallback-marker span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #0c835c;
  color: #fff;
  flex: none;
}

.fallback-marker strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-error {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: #b42318;
  background: rgba(255, 255, 255, 0.86);
  font-weight: 800;
  text-align: center;
}

.tp-map-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 42px;
  border: 2px solid #ffffff;
  border-radius: 18px 18px 18px 4px;
  background: #0c835c;
  color: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.24);
  font-size: 15px;
  font-weight: 900;
  transform: rotate(-45deg);
}

.tp-map-marker::first-letter {
  transform: rotate(45deg);
}

.tp-info-window {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  width: 330px;
  padding: 12px;
  border: 1px solid #d8e1eb;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.22);
}

.tp-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 92px;
  border-radius: 10px;
  background: #e9f7f1;
  color: #0c835c;
  font-weight: 900;
}

.tp-thumb.cafe {
  background: #fff1df;
  color: #9a5b00;
}

.tp-thumb.tour,
.tp-thumb.activity {
  background: #e7f0ff;
  color: #175cd3;
}

.tp-thumb.shopping {
  background: #ffe8f1;
  color: #c11574;
}

.tp-info-body {
  min-width: 0;
}

.tp-info-kicker,
.tp-info-address {
  color: #697586;
  font-size: 12px;
}

.tp-info-body h3 {
  margin: 2px 0 8px;
  color: #111827;
  font-size: 16px;
  line-height: 1.28;
}

.tp-info-body p {
  margin: 0 0 8px;
  color: #374151;
  font-size: 12px;
  line-height: 1.45;
}

.tp-info-body b {
  display: block;
  margin-bottom: 2px;
  color: #111827;
}

.tp-info-body a {
  color: #0c835c;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 20;
  transform: translateX(-50%);
  max-width: min(460px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 999px;
  background: #17202a;
  color: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.24);
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 900px) {
  .tp-app {
    grid-template-columns: 58px minmax(0, 1fr);
    grid-template-rows: 42vh minmax(0, 1fr);
  }

  .rail {
    grid-row: 1 / 3;
    padding-inline: 6px;
  }

  .rail-nav button,
  .login-button {
    width: 46px;
  }

  .chat-panel {
    grid-column: 2;
    grid-row: 2;
    border-top: 1px solid #dce3ec;
    border-right: 0;
  }

  .map-area {
    grid-column: 2;
    grid-row: 1;
  }

  .map-topbar {
    flex-wrap: wrap;
    top: 10px;
    left: 10px;
    right: 10px;
  }

  .location-search {
    width: 100%;
    min-width: 0;
  }

  .chat-head {
    padding: 14px 16px 12px;
  }

  .chat-head h1 {
    font-size: 20px;
  }

  .chat-thread {
    padding: 14px;
  }

  .tp-info-window {
    width: 290px;
  }
}
