:root {
  --bg: #eef8fc;
  --bg-elevated: #f8fcff;
  --surface: #ffffff;
  --surface-soft: #f3f9fc;
  --surface-tint: #dff4fb;
  --text: #0f2633;
  --text-muted: #486474;
  --text-subtle: #6f8794;
  --border: #d4e6ee;
  --border-strong: #a9cedc;
  --brand: #0ea5e9;
  --brand-strong: #075985;
  --accent: #f97316;
  --accent-strong: #c2410c;
  --success: #2d8a63;
  --warning: #b7791f;
  --danger: #b42318;
  --radius: 8px;
  --shadow-soft: 0 8px 20px rgba(7, 89, 133, 0.07);
  --shadow-raised: 0 16px 34px rgba(7, 89, 133, 0.12);
  --shadow-sticky: 0 18px 44px rgba(23, 33, 38, 0.2);
  --focus-ring: 0 0 0 3px rgba(14, 165, 233, 0.2);
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 14px;
  --space-4: 18px;
  --space-5: 24px;
  --space-6: 32px;
  --ink: var(--text);
  --muted: var(--text-muted);
  --line: var(--border);
  --panel: var(--surface);
  --soft: var(--surface-soft);
  --sky: var(--brand);
  --leaf: var(--success);
  --orange: var(--accent);
  --orange-dark: var(--accent-strong);
  --shadow: var(--shadow-raised);
  color-scheme: light;
  font-family: "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 50% -12rem, rgba(14, 165, 233, 0.18), transparent 34rem),
    radial-gradient(circle at 88% 6rem, rgba(249, 115, 22, 0.08), transparent 24rem),
    linear-gradient(180deg, #f8fcff 0%, var(--bg) 28rem, #f7fbfb 100%);
  color: var(--ink);
  min-height: 100dvh;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button:disabled {
  cursor: progress;
  opacity: 0.72;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
  padding: 12px clamp(18px, 4vw, 48px);
  background: rgba(248, 252, 255, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.topbar__actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.topbar-link {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-muted);
  font-weight: 800;
}

.topbar-link:hover,
.topbar-link[aria-current="page"] {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--brand-strong);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
}

.nav {
  position: sticky;
  top: 68px;
  z-index: 19;
  display: flex;
  justify-content: center;
  gap: 6px;
  min-height: 56px;
  padding: 8px 18px;
  background: rgba(248, 252, 255, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.nav__item,
.link-button {
  border: 0;
  background: transparent;
  color: var(--muted);
}

.nav__item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 78px;
  min-height: 42px;
  border-radius: 8px;
  font-weight: 700;
}

.nav__item svg {
  width: 18px;
  height: 18px;
}

.nav__item.is-active {
  background: #e0f4fd;
  color: var(--brand-strong);
  box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.2);
}

.nav__item.is-active::after {
  position: absolute;
  right: 14px;
  bottom: 6px;
  left: 14px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
  content: "";
}

.nav__item[data-view="dashboard"] {
  color: #0f766e;
}

.nav__item[data-view="chat"] {
  color: #075985;
}

.nav__item[data-view="translate"] {
  color: #0d9488;
}

.nav__item[data-view="cities"] {
  color: #b45309;
}

.nav__item[data-view="map"] {
  color: #047857;
}

.nav__item[data-view="tools"] {
  color: #7c3aed;
}

.nav__item[data-view="trips"] {
  color: #be123c;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(18px, 4vw, 48px);
  align-items: center;
  min-height: auto;
  padding: clamp(28px, 5vw, 62px) clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.hero__media {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  border: 1px solid rgba(169, 206, 220, 0.82);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-raised);
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__media-note {
  position: absolute;
  right: 16px;
  bottom: 16px;
  left: 16px;
  display: grid;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: var(--radius);
  padding: 14px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.hero__media-note span {
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.hero__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--sky);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 5.6rem;
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 2rem;
  line-height: 1.1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.lead {
  max-width: 620px;
  color: #43545d;
  font-size: 1.12rem;
  line-height: 1.7;
}

.home-snapshot,
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.home-snapshot article,
.dashboard-grid article {
  display: grid;
  gap: 4px;
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-soft);
}

.home-snapshot strong,
.dashboard-grid strong {
  color: var(--brand-strong);
}

.home-snapshot span,
.dashboard-grid span {
  color: var(--text-muted);
  font-size: 0.83rem;
  line-height: 1.35;
}

.dashboard-drive {
  align-items: start;
}

.dashboard-main {
  display: grid;
  gap: 18px;
}

.dashboard-list {
  display: grid;
  gap: 10px;
}

.weather-strip {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  overflow: hidden;
  border: 1px solid rgba(14, 165, 233, 0.22);
  border-radius: var(--radius);
  padding: 16px;
  background:
    linear-gradient(120deg, rgba(14, 165, 233, 0.14), rgba(94, 234, 212, 0.08)),
    var(--surface);
  box-shadow: var(--shadow-soft);
}

.weather-strip::after {
  position: absolute;
  inset: -30% auto -30% -20%;
  width: 48%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  animation: beamSweep 6s ease-in-out infinite;
  content: "";
  pointer-events: none;
}

.weather-strip span {
  position: relative;
  z-index: 1;
  color: var(--brand-strong);
  font-weight: 800;
}

.dashboard-actions,
.mini-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-action,
.mini-card,
.dashboard-module {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.dashboard-action {
  display: grid;
  gap: 6px;
  min-height: 92px;
  padding: 14px;
  color: var(--text);
  text-align: left;
}

.dashboard-action:hover,
.glare-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-raised);
}

.dashboard-action strong {
  color: var(--brand-strong);
  font-size: 1.04rem;
}

.dashboard-action span {
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.dashboard-module {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.module-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.module-head h3 {
  margin: 0;
}

.module-head span {
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.mini-card {
  display: grid;
  gap: 8px;
  min-height: 126px;
  padding: 14px;
}

.mini-card h3 {
  margin: 0;
}

.dashboard-map {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  min-height: 168px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background:
    linear-gradient(90deg, rgba(14, 165, 233, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(14, 165, 233, 0.08) 1px, transparent 1px),
    var(--surface-soft);
  background-size: 42px 42px;
}

.question-card {
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
  line-height: 1.35;
  text-align: left;
}

.question-card:hover {
  border-color: var(--brand);
  background: var(--surface-tint);
}

.prompt-rail,
.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.prompt-rail button,
.quick-chips button {
  min-height: 38px;
  border: 1px solid #cfe0e5;
  border-radius: 999px;
  padding: 0 14px;
  background: #f7fcff;
  color: var(--brand-strong);
  font-weight: 800;
}

.prompt-rail button:hover,
.quick-chips button:hover {
  border-color: var(--sky);
  background: #e4f3f6;
}

.planner,
.trip-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 160px auto;
  gap: 12px;
  align-items: end;
}

.planner {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-soft);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  outline: 0;
}

input,
select {
  height: 46px;
  padding: 0 14px;
}

textarea {
  min-height: 92px;
  padding: 14px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--sky);
  box-shadow: var(--focus-ring);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(31, 154, 199, 0.34);
  outline-offset: 3px;
}

.primary,
.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  border-radius: var(--radius);
  padding: 0 18px;
  font-weight: 800;
}

.primary {
  border: 1px solid var(--orange);
  background: var(--orange);
  color: #fff;
  box-shadow: 0 10px 20px rgba(249, 115, 22, 0.2);
}

.primary:hover {
  background: var(--orange-dark);
  border-color: var(--orange-dark);
}

.secondary {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
}

.secondary:hover,
.icon-button:hover,
.tool-card:hover,
.city-card:hover,
.trip-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-raised);
}

.section {
  padding: clamp(28px, 5vw, 56px) clamp(18px, 4vw, 48px);
}

.chat-hero {
  position: relative;
  min-height: calc(100dvh - 124px);
  display: grid;
  align-items: center;
  padding-block: clamp(22px, 4vw, 42px);
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(3, 14, 24, 0.94), rgba(5, 36, 52, 0.86) 52%, rgba(58, 18, 12, 0.76)),
    url("/static/img/great-wall.jpg") center / cover;
}

.chat-hero::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(125, 211, 252, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(125, 211, 252, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, rgba(3, 14, 24, 0.12), rgba(3, 14, 24, 0.72));
  background-size: 72px 72px, 72px 72px, auto;
  content: "";
}

.chat-hero::after {
  position: absolute;
  inset: auto 0 0;
  height: 34%;
  background:
    repeating-linear-gradient(135deg, rgba(248, 113, 113, 0.12) 0 1px, transparent 1px 22px),
    linear-gradient(180deg, transparent, rgba(2, 8, 18, 0.62));
  content: "";
  pointer-events: none;
}

.chat-hero > * {
  position: relative;
  z-index: 1;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 28px;
}

.section__head {
  margin-bottom: 24px;
}

.section__head.row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.view-status {
  min-height: 24px;
  margin: -10px 0 18px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.view-status[data-tone="error"] {
  color: var(--danger);
}

.view-status[data-tone="success"] {
  color: var(--success);
}

.search {
  max-width: 360px;
}

.city-strip,
.city-grid,
.tool-grid,
.trip-list {
  display: grid;
  gap: 16px;
}

.city-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.city-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.city-card,
.tool-card,
.readiness,
.tool-detail,
.trip-card,
.chat-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.city-card,
.tool-card,
.trip-card,
.nav__item,
.mobile-ask-fab {
  cursor: pointer;
}

.empty-state,
.skeleton-card {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px;
}

.empty-state {
  display: grid;
  gap: 10px;
  min-height: 168px;
  align-content: center;
}

.empty-state h3,
.empty-state p {
  margin-bottom: 0;
}

.empty-state .secondary {
  width: max-content;
}

.skeleton-card {
  display: grid;
  gap: 12px;
}

.skeleton-card span {
  display: block;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #eef5f6, #dfecef, #eef5f6);
  background-size: 220% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}

.skeleton-card span:first-child {
  height: 120px;
  border-radius: var(--radius);
}

.skeleton-card span:last-child {
  width: 62%;
}

.city-card {
  overflow: hidden;
}

.city-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #dce8eb;
}

.city-card__body,
.tool-card,
.trip-card,
.tool-detail,
.readiness {
  padding: 18px;
}

.city-card__body,
.tool-card,
.trip-card {
  display: grid;
  align-content: start;
  gap: 10px;
}

.city-card__body h3,
.tool-card h3,
.trip-card h3 {
  margin-bottom: 0;
}

.city-card__facts,
.trip-card__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.city-card__facts span,
.trip-card__facts span {
  min-height: 26px;
  border: 1px solid #d9e8ec;
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.meta {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
  margin-bottom: 0;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tag {
  border: 1px solid #c9dde4;
  border-radius: 999px;
  padding: 5px 9px;
  background: #eef7f8;
  color: #185b70;
  font-size: 0.78rem;
  font-weight: 700;
}

.readiness ul {
  display: grid;
  gap: 14px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.readiness li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: center;
  color: #43545d;
}

.readiness span {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: var(--leaf);
}

.chat-shell {
  width: min(920px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  min-height: min(680px, calc(100dvh - 176px));
  overflow: hidden;
  border-color: rgba(219, 238, 245, 0.32);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 70px rgba(2, 18, 28, 0.32);
  backdrop-filter: blur(20px);
}

.chat-hero:not(.has-started) .chat-shell {
  width: min(860px, calc(100vw - 36px));
  grid-template-rows: auto auto;
  min-height: auto;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.chat-welcome {
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: clamp(24px, 5vw, 38px) 20px 20px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(14, 165, 233, 0.16), transparent 18rem),
    linear-gradient(180deg, #ffffff 0%, #f3faff 100%);
}

.chat-hero:not(.has-started) .chat-welcome {
  gap: 0;
  padding: 0 24px 24px;
  background: transparent;
}

.chat-hero:not(.has-started) .agent-mark,
.chat-hero:not(.has-started) .quick-chips {
  display: none;
}

.agent-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.agent-mark img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12);
}

.agent-mark strong,
.agent-mark span {
  display: block;
}

.agent-mark strong {
  color: var(--text);
  font-size: 1.05rem;
}

.chat-hero:not(.has-started) .agent-mark strong {
  color: #f8fcff;
}

.agent-mark span {
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.chat-hero:not(.has-started) .agent-mark span {
  color: #a9d8e8;
}

.welcome-copy {
  max-width: 620px;
}

.welcome-copy h1 {
  margin-bottom: 12px;
  font-size: clamp(2.1rem, 3.6rem, 4.2rem);
  line-height: 0.98;
}

.chat-hero:not(.has-started) .welcome-copy h1 {
  margin: 0;
  color: #f8fcff;
  font-size: 3.25rem;
  font-weight: 800;
  letter-spacing: 0;
  text-shadow: 0 18px 46px rgba(0, 0, 0, 0.42);
}

.welcome-copy p {
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.65;
}

.quick-chips {
  justify-content: center;
  max-width: 680px;
}

.chat-hero:not(.has-started) .quick-chips {
  max-width: 620px;
  gap: 8px;
}

.quick-chips button {
  background: #fff;
  box-shadow: 0 6px 14px rgba(7, 89, 133, 0.08);
}

.chat-hero:not(.has-started) .quick-chips button {
  border-color: rgba(180, 220, 232, 0.32);
  background: rgba(255, 255, 255, 0.09);
  color: #dff7ff;
  box-shadow: none;
  backdrop-filter: blur(12px);
}

.fade-in {
  animation: fadeSlideIn 320ms ease-out both;
}

.chat-status {
  display: grid;
  align-items: center;
  min-height: 40px;
  margin: 0;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-elevated);
}

.llm-status {
  margin: 0;
  padding: 9px 16px;
  border-bottom: 1px solid rgba(212, 230, 238, 0.72);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.llm-status[data-tone="success"] {
  color: var(--success);
}

.llm-status[data-tone="warning"] {
  color: var(--warning);
}

.llm-status[data-tone="error"] {
  color: var(--danger);
}

.chat-hero:not(.has-started) .llm-status {
  display: none;
}

.chat-status:empty {
  display: none;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 400px;
  max-height: min(680px, calc(100dvh - 340px));
  overflow: auto;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(239, 248, 252, 0.88)),
    var(--soft);
}

.chat-hero:not(.has-started) .chat-log {
  display: none;
}

.chat-hero:not(.has-started) .chat-shell {
  min-height: auto;
}

.chat-hero:not(.has-started) .chat-status {
  display: none;
}

.message {
  max-width: min(760px, 92%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--surface);
}

.message.is-user {
  align-self: flex-end;
  border-color: #f0c2a7;
  background: #fff5ef;
}

.message span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.message p {
  margin: 0;
  line-height: 1.65;
  white-space: pre-wrap;
}

.followup-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 16px 14px;
  background: var(--soft);
}

.followup-button {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 13px;
  background: var(--surface);
  color: var(--brand-strong);
  font-size: 0.86rem;
  font-weight: 800;
}

.followup-button:hover {
  border-color: var(--brand);
  background: var(--surface-tint);
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.chat-hero:not(.has-started) .chat-form {
  align-items: end;
  gap: 12px;
  margin: 0;
  border: 1px solid rgba(204, 231, 241, 0.58);
  border-radius: 18px;
  padding: 14px;
  background: #f8fcff;
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.32);
}

.chat-hero:not(.has-started) .chat-form textarea {
  min-height: 112px;
  border: 0;
  background: transparent;
  color: #0f2633;
  font-size: 1.05rem;
  resize: none;
  box-shadow: none;
}

.chat-hero:not(.has-started) .chat-form textarea::placeholder {
  color: #668091;
}

.chat-hero:not(.has-started) .chat-form .primary {
  width: 52px;
  min-width: 52px;
  min-height: 52px;
  border-radius: 50%;
  padding: 0;
}

.chat-hero:not(.has-started) .send-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.chat-form textarea:disabled {
  background: #eef5f8;
  color: var(--text-muted);
}

.tool-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.map-board {
  display: grid;
  grid-template-columns: minmax(280px, 1.2fr) repeat(2, minmax(220px, 1fr));
  gap: 16px;
}

.map-canvas,
.map-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.map-canvas {
  grid-row: span 2;
  min-height: 360px;
  display: grid;
  align-content: center;
  gap: 14px;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(14, 165, 233, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(14, 165, 233, 0.08) 1px, transparent 1px),
    radial-gradient(circle at 30% 30%, rgba(249, 115, 22, 0.14), transparent 10rem),
    var(--surface);
  background-size: 46px 46px, 46px 46px, auto, auto;
}

.map-pin {
  width: max-content;
  border: 1px solid rgba(249, 115, 22, 0.32);
  border-radius: 999px;
  padding: 7px 11px;
  background: #fff5ef;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 800;
}

.map-pin:nth-child(even) {
  justify-self: end;
}

.map-card {
  padding: 18px;
}

.translate-shell {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.2fr);
  gap: 16px;
}

.voice-card,
.translation-card,
.phrase-library,
.translation-history {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.voice-card {
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 18px;
}

.translation-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.translation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.translation-output {
  display: block;
  min-height: 82px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface-soft);
  color: var(--text);
  line-height: 1.6;
}

.phrase-library,
.translation-history {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
  padding: 14px;
}

.phrase-card,
.history-card {
  display: grid;
  gap: 6px;
  min-height: 110px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.phrase-card:hover {
  border-color: var(--brand);
  background: var(--surface-tint);
}

.phrase-card span,
.history-card span {
  color: var(--text-muted);
  line-height: 1.45;
}

.phrase-card small {
  color: var(--text-subtle);
  font-weight: 800;
}

.tool-card {
  text-align: left;
}

.tool-card button {
  margin-top: 12px;
  justify-self: start;
}

.tool-detail {
  margin-top: 18px;
}

.tool-detail ul {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding-left: 20px;
  color: #43545d;
  line-height: 1.55;
}

.trip-form {
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) 150px 150px auto;
  margin-bottom: 18px;
}

.trip-list {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.muted {
  color: var(--muted);
}

.auth-dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  width: min(520px, calc(100vw - 32px));
  padding: 0;
}

.auth-dialog::backdrop {
  background: rgba(23, 33, 38, 0.36);
}

.dialog-close {
  display: flex;
  justify-content: flex-end;
  padding: 12px;
}

.sheet-handle {
  display: none;
}

.auth-layout {
  display: grid;
  gap: 18px;
  padding: 0 24px 24px;
}

.auth-form,
.profile-form {
  display: grid;
  gap: 12px;
}

.google-login {
  text-decoration: none;
}

.mobile-ask-fab {
  display: none;
}

.link-button {
  min-height: 40px;
  font-weight: 800;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  max-width: min(360px, calc(100vw - 36px));
  min-height: 46px;
  display: grid;
  align-items: center;
  border: 1px solid #bdd7de;
  border-radius: var(--radius);
  padding: 10px 14px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast[data-tone="error"] {
  border-color: #f3b7b0;
  color: #8f1f17;
}

.is-hidden {
  display: none !important;
}

@media (min-width: 1440px) {
  .chat-shell {
    width: min(1120px, calc(100vw - 180px));
  }

  .message {
    max-width: min(880px, 92%);
  }

  .city-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

@media (min-width: 761px) {
  body {
    padding-left: 76px;
  }

  .topbar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 31;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    width: 76px;
    min-height: 100dvh;
    padding: 14px 10px;
    border-right: 1px solid rgba(180, 220, 232, 0.18);
    border-bottom: 0;
    background: rgba(3, 14, 24, 0.94);
    backdrop-filter: none;
  }

  .brand {
    justify-content: center;
    width: 54px;
    height: 54px;
  }

  .brand span,
  .nav__item span,
  .topbar-link span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .brand img {
    width: 38px;
    height: 38px;
  }

  .topbar__actions {
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
  }

  .topbar-link,
  .icon-button {
    width: 48px;
    height: 48px;
    min-height: 48px;
    border-color: rgba(180, 220, 232, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: #dff7ff;
  }

  .topbar-link {
    display: inline-grid;
    place-items: center;
    padding: 0;
  }

  .nav {
    position: fixed;
    top: 86px;
    bottom: 130px;
    left: 0;
    z-index: 30;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 76px;
    min-height: 0;
    padding: 8px 10px;
    border-right: 1px solid rgba(180, 220, 232, 0.18);
    border-bottom: 0;
    background: rgba(3, 14, 24, 0.94);
    backdrop-filter: none;
  }

  .nav__item {
    width: 48px;
    min-width: 48px;
    min-height: 48px;
    padding: 0;
    color: #a9d8e8;
  }

  .nav__item[data-view="dashboard"] {
    color: #5eead4;
  }

  .nav__item[data-view="chat"] {
    color: #7dd3fc;
  }

  .nav__item[data-view="translate"] {
    color: #5eead4;
  }

  .nav__item[data-view="cities"] {
    color: #fdba74;
  }

  .nav__item[data-view="map"] {
    color: #86efac;
  }

  .nav__item[data-view="tools"] {
    color: #c4b5fd;
  }

  .nav__item[data-view="trips"] {
    color: #fda4af;
  }

  .nav__item svg,
  .topbar-link svg {
    width: 22px;
    height: 22px;
  }

  .nav__item.is-active {
    background: rgba(14, 165, 233, 0.18);
    color: #f8fcff;
    box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.28);
  }

  .nav__item.is-active::after {
    top: 12px;
    right: auto;
    bottom: 12px;
    left: -10px;
    width: 3px;
    height: auto;
    background: var(--accent);
  }

  .chat-hero {
    min-height: 100dvh;
    padding: 64px 32px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #071721;
    --bg-elevated: #0d2431;
    --surface: #102a38;
    --surface-soft: #0b1f2b;
    --surface-tint: #123447;
    --text: #ecf8ff;
    --text-muted: #b7cfda;
    --text-subtle: #8caab8;
    --border: #244657;
    --border-strong: #3d6f84;
    --brand: #38bdf8;
    --brand-strong: #7dd3fc;
    --focus-ring: 0 0 0 3px rgba(56, 189, 248, 0.24);
    color-scheme: dark;
  }

  body {
    background:
      radial-gradient(circle at 50% -12rem, rgba(14, 165, 233, 0.16), transparent 34rem),
      linear-gradient(180deg, #06141d 0%, #071721 100%);
  }

  .topbar,
  .nav {
    background: rgba(7, 23, 33, 0.88);
  }

  .topbar-link {
    background: rgba(16, 42, 56, 0.88);
    color: var(--text-muted);
  }

  .topbar-link:hover,
  .topbar-link[aria-current="page"] {
    background: #16384a;
    color: var(--text);
  }

  .chat-shell,
  .chat-welcome,
  .chat-status,
  .chat-form,
  .city-card,
  .tool-card,
  .trip-card,
  .readiness,
  .tool-detail,
  .planner,
  .auth-dialog,
  .toast,
  input,
  select,
  textarea {
    background-color: var(--surface);
    color: var(--text);
  }

  .chat-welcome {
    background:
      radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.16), transparent 18rem),
      linear-gradient(180deg, #102a38 0%, #0b1f2b 100%);
  }

  .message {
    background: #123242;
  }

  .message.is-user {
    border-color: rgba(249, 115, 22, 0.44);
    background: #3a2418;
  }
}

@media (max-width: 920px) {
  .topbar {
    grid-template-columns: auto auto;
  }

  .nav {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .hero,
  .dashboard {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .hero__media {
    min-height: 320px;
  }

  .planner,
  .trip-form,
  .chat-form {
    grid-template-columns: 1fr;
  }

  .city-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  body {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  main {
    overflow-x: hidden;
  }

  .topbar {
    min-height: 58px;
    padding: 9px 14px;
    border-bottom-color: rgba(212, 230, 238, 0.72);
  }

  .brand span {
    display: inline;
    font-size: 0.98rem;
  }

  .brand img {
    width: 36px;
    height: 36px;
  }

  .nav {
    position: fixed;
    top: auto;
    right: 12px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    left: 12px;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px;
    min-height: 60px;
    padding: 6px;
    overflow: visible;
    border: 1px solid rgba(185, 213, 221, 0.92);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-sticky);
    backdrop-filter: blur(18px);
  }

  .nav__item {
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    min-height: 48px;
    border-radius: var(--radius);
    font-size: 0.72rem;
  }

  .nav__item span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .nav__item svg {
    width: 20px;
    height: 20px;
  }

  .nav__item.is-active::after {
    right: 50%;
    bottom: 5px;
    left: auto;
    width: 18px;
    transform: translateX(50%);
  }

  .icon-button {
    width: 40px;
    height: 40px;
  }

  .hero {
    display: grid;
    min-height: auto;
    padding: 16px 14px 20px;
    gap: 14px;
  }

  .topbar-link {
    min-height: 36px;
    padding: 0 10px;
    font-size: 0.82rem;
  }

  .hero__media {
    min-height: 0;
    height: 112px;
  }

  .hero__content {
    gap: 12px;
    padding: 0;
  }

  h1 {
    font-size: 2.42rem;
  }

  h2 {
    font-size: 1.55rem;
  }

  .lead {
    font-size: 1rem;
    line-height: 1.45;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .hero__media-note {
    right: 10px;
    bottom: 10px;
    left: 10px;
    padding: 10px;
  }

  .hero__media-note span {
    display: none;
  }

  .prompt-rail,
  .quick-chips {
    display: flex;
    flex-wrap: nowrap;
    margin-right: -14px;
    margin-left: -14px;
    padding-right: 14px;
    padding-left: 14px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .prompt-rail::-webkit-scrollbar,
  .quick-chips::-webkit-scrollbar {
    display: none;
  }

  .prompt-rail button,
  .quick-chips button {
    flex: 0 0 auto;
    min-height: 38px;
    white-space: nowrap;
  }

  .chat-hero {
    min-height: calc(100dvh - 58px);
    align-items: start;
    padding: 14px 12px 102px;
  }

  .chat-shell {
    min-height: calc(100dvh - 174px);
    border-radius: 10px;
  }

  .chat-welcome {
    gap: 14px;
    padding: 22px 12px 14px;
  }

  .welcome-copy h1 {
    font-size: 2.15rem;
  }

  .chat-hero:not(.has-started) .welcome-copy h1 {
    font-size: 2.35rem;
  }

  .welcome-copy p {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .quick-chips {
    justify-content: flex-start;
    max-width: none;
    width: auto;
    margin-right: 0;
    margin-left: 0;
    padding-right: 0;
    padding-left: 0;
    flex-wrap: wrap;
    overflow: visible;
  }

  .quick-chips button {
    flex: 1 1 calc(50% - 8px);
    min-width: 132px;
  }

  .planner {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
  }

  .planner label:first-child {
    grid-column: 1 / -1;
  }

  .planner .primary {
    min-width: 0;
    padding: 0 12px;
    width: 100%;
  }

  .home-snapshot,
  .dashboard-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .home-snapshot article,
  .dashboard-grid article {
    min-height: 68px;
    padding: 10px;
  }

  .home-snapshot span,
  .dashboard-grid span {
    font-size: 0.74rem;
  }

  input,
  select {
    height: 44px;
  }

  .section {
    padding: 26px 14px;
  }

  .section__head.row {
    display: grid;
    align-items: start;
  }

  .search {
    max-width: none;
  }

  .city-strip {
    display: flex;
    margin-right: -14px;
    overflow-x: auto;
    padding: 0 14px 8px 0;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .city-strip::-webkit-scrollbar {
    display: none;
  }

  .city-strip .city-card {
    flex: 0 0 84%;
    scroll-snap-align: start;
  }

  .city-grid,
  .tool-grid,
  .trip-list,
  .dashboard-actions,
  .mini-card-grid,
  .map-board,
  .translate-shell,
  .phrase-library,
  .translation-history {
    grid-template-columns: 1fr;
  }

  .city-card img {
    aspect-ratio: 16 / 10;
  }

  .city-card__body,
  .tool-card,
  .trip-card,
  .tool-detail,
  .readiness {
    padding: 15px;
  }

  .tags {
    gap: 6px;
  }

  .tag {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .chat-log {
    min-height: 220px;
    max-height: none;
    padding: 14px;
  }

  .message {
    max-width: 94%;
    padding: 12px 13px;
  }

  .chat-form {
    position: sticky;
    bottom: calc(90px + env(safe-area-inset-bottom));
    grid-template-columns: 1fr;
    padding: 12px;
    box-shadow: 0 -10px 26px rgba(23, 33, 38, 0.08);
  }

  .chat-form textarea {
    min-height: 76px;
  }

  body[data-view="chat"] {
    overflow: auto;
  }

  body[data-view="chat"] main {
    height: auto;
    overflow: visible;
  }

  body[data-view="chat"] .workspace[data-view-panel="chat"] {
    display: grid !important;
    height: auto;
    min-height: calc(100dvh - 58px);
    overflow: visible;
  }

  body[data-view="chat"] .chat-shell {
    min-height: 0;
    height: calc(100dvh - 174px);
    overflow: hidden;
  }

  body[data-view="chat"] .chat-log {
    min-height: 0;
    height: auto;
    overflow: auto;
  }

  body[data-view="chat"] .chat-form {
    min-height: 148px;
    position: static;
  }

  body[data-view="chat"] .chat-hero:not(.has-started) .chat-shell {
    height: auto;
    min-height: auto;
    overflow: visible;
  }

  body[data-view="chat"] .chat-hero:not(.has-started) .chat-form {
    grid-template-columns: 1fr auto;
    min-height: auto;
  }

  body[data-view="chat"].is-chat-composing .nav {
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(100% + 24px));
  }

  .trip-form {
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
  }

  .auth-dialog {
    position: fixed;
    inset: auto 8px calc(8px + env(safe-area-inset-bottom)) 8px;
    width: auto;
    max-width: none;
    max-height: calc(100dvh - 34px);
    margin: 0;
    border-radius: var(--radius);
    overflow: auto;
  }

  .sheet-handle {
    display: block;
    width: 44px;
    height: 5px;
    margin: 10px auto 0;
    border-radius: 999px;
    background: #c9d9de;
  }

  .dialog-close {
    padding: 6px 10px 0;
  }

  .auth-layout {
    padding: 0 16px 18px;
  }

  .toast {
    right: 14px;
    bottom: calc(102px + env(safe-area-inset-bottom));
    left: 14px;
    max-width: none;
  }

  .mobile-ask-fab {
    position: fixed;
    right: 18px;
    bottom: calc(92px + env(safe-area-inset-bottom));
    z-index: 29;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    border: 1px solid rgba(249, 115, 22, 0.86);
    border-radius: 999px;
    padding: 0 16px;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 14px 28px rgba(194, 65, 12, 0.22);
  }

  body[data-view="chat"] .mobile-ask-fab {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@keyframes shimmer {
  0% {
    background-position: 120% 0;
  }

  100% {
    background-position: -120% 0;
  }
}

@keyframes beamSweep {
  0%,
  35% {
    transform: translateX(-120%) skewX(-14deg);
  }

  70%,
  100% {
    transform: translateX(320%) skewX(-14deg);
  }
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
