:root {
  --bg: #eef4f2;
  --bg-2: #f7fbfa;
  --panel: #ffffff;
  --bubble: #ffffff;
  --bubble-user: linear-gradient(135deg, #0f9d8a, #0b7d6d);
  --accent: #0d9488;
  --accent-2: #0f766e;
  --accent-soft: rgba(13, 148, 136, 0.1);
  --text: #17282b;
  --muted: #5f7176;
  --border: rgba(15, 42, 38, 0.1);
  --shadow: 0 1px 2px rgba(20, 55, 48, 0.05), 0 8px 24px rgba(20, 55, 48, 0.08);
  --shadow-lg: 0 12px 44px rgba(20, 55, 48, 0.18);
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg), var(--bg-2));
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before, body::after {
  content: "";
  position: fixed;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  z-index: 0;
  pointer-events: none;
}
body::before {
  top: -28vmax;
  right: -18vmax;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.28) 0%, transparent 70%);
  animation: drift 26s ease-in-out infinite alternate;
}
body::after {
  bottom: -30vmax;
  left: -16vmax;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.25) 0%, transparent 70%);
  animation: drift 32s ease-in-out infinite alternate-reverse;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(4vmax, 3vmax, 0) scale(1.15); }
}

#bubbles { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
#bubbles span {
  position: absolute;
  bottom: -40px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, rgba(255, 255, 255, 0.95), rgba(13, 148, 136, 0.16));
  border: 1px solid rgba(13, 148, 136, 0.18);
  animation: rise linear infinite;
  opacity: 0;
}
@keyframes rise {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  10%  { opacity: 0.7; }
  50%  { transform: translateY(-55vh) translateX(14px); }
  90%  { opacity: 0.5; }
  100% { transform: translateY(-108vh) translateX(-12px); opacity: 0; }
}

#app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0.25rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(to bottom, rgba(238, 244, 242, 0.92), rgba(247, 251, 250, 0.75));
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.identity { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.avatar-btn {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
  line-height: 0;
  transition: transform 0.15s, box-shadow 0.15s;
}
.avatar-btn:hover { transform: scale(1.05); box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.15); }
.avatar-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(13, 148, 136, 0.4);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}
.idtext h1 { font-size: 1.05rem; margin: 0; letter-spacing: 0.01em; white-space: nowrap; }
.status {
  margin: 0.15rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(13, 148, 136, 0.6);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.actions { display: flex; align-items: center; gap: 0.75rem; }
.socials { position: relative; display: flex; align-items: center; }
#socialsBtn { display: none; }
.links { display: flex; gap: 0.35rem; }
.links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--muted);
  border: 1px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s, transform 0.15s;
}
.links a svg { width: 17px; height: 17px; fill: currentColor; }
.links a .link-label { display: none; }
.links a:hover {
  color: var(--accent-2);
  background: #ffffff;
  border-color: var(--border);
  transform: translateY(-1px);
}
.lang {
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-2);
  background: var(--accent-soft);
  border: 1px solid rgba(13, 148, 136, 0.35);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.lang:hover { background: rgba(13, 148, 136, 0.18); }

.icon-btn {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: none;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s, border-color 0.15s, transform 0.15s;
}
.icon-btn svg { width: 17px; height: 17px; fill: currentColor; }
.icon-btn:hover {
  color: var(--accent-2);
  background: #ffffff;
  border-color: var(--border);
  transform: translateY(-1px);
}
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* segmented language toggle */
.seg {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid rgba(13, 148, 136, 0.35);
  background: #ffffff;
  border-radius: 999px;
  box-shadow: var(--shadow);
  cursor: pointer;
  user-select: none;
  outline: none;
}
.seg:focus-visible { box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.25); }
.seg-opt {
  position: relative;
  z-index: 1;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  color: var(--muted);
  transition: color 0.18s;
}
.seg-opt.active { color: #f0fdf4; }
.seg-thumb {
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: 50%;
  left: 2px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0f9d8a, #0b7d6d);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.seg[aria-checked="true"] .seg-thumb { transform: translateX(calc(100% - 4px)); }

/* layout */
#chat {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 0.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  scroll-behavior: smooth;
}
#chat::-webkit-scrollbar { width: 8px; }
#chat::-webkit-scrollbar-thumb { background: rgba(15, 42, 38, 0.14); border-radius: 4px; }

.msg { display: flex; gap: 0.6rem; width: 100%; max-width: 100%; animation: rise 0.28s ease both; }
.msg.bot { align-self: flex-start; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; justify-content: flex-start; }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.msg .mini {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  margin-top: auto;
}
.bubble {
  background: var(--bubble);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-top-left-radius: 6px;
  padding: 0.7rem 0.95rem;
  font-size: 0.92rem;
  line-height: 1.55;
  width: fit-content;
  max-width: min(78%, 560px);
  min-width: 0;
  overflow-wrap: break-word;
  box-shadow: var(--shadow);
}
.msg.user .bubble {
  background: var(--bubble-user);
  border: none;
  border-radius: var(--radius);
  border-top-right-radius: 6px;
  color: #f0fdf4;
  box-shadow: none;
}

.bubble a { color: var(--accent-2); text-decoration: none; border-bottom: 1px solid rgba(13, 148, 136, 0.35); }
.bubble a:hover { border-bottom-color: currentColor; }
.bubble code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: rgba(13, 148, 136, 0.08);
  padding: 0.1em 0.4em;
  border-radius: 6px;
}
.bubble .li {
  display: block;
  padding-left: 1.1rem;
  position: relative;
}
.bubble .li::before {
  content: "";
  position: absolute;
  left: 0.25rem;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.8;
}

/* typing indicator */
.bubble.typing { display: inline-flex; align-items: center; gap: 5px; padding: 0.95rem 1.05rem; }
.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1.2s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: 0.18s; }
.typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes blink {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

/* meta divider (e.g. language switch) */
.meta {
  align-self: center;
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  padding: 0.2rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
}

/* rich attachments */
.attach-card { min-width: 230px; max-width: 320px; }
.photo-card { min-width: 230px; max-width: 360px; }
.attach-head { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: baseline; font-size: 0.88rem; margin-bottom: 0.55rem; }
.attach-head strong { color: var(--text); }
.attach-head span { color: var(--muted); font-size: 0.8rem; }
.attach-sub { margin-top: 0.5rem; font-size: 0.7rem; color: var(--muted); }
.photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.3rem; }
.photo-grid-single { grid-template-columns: 1fr; }
.photo-grid figure { aspect-ratio: 4 / 3; margin: 0; overflow: hidden; border-radius: 11px; background: var(--accent-soft); }
.photo-grid-single figure { aspect-ratio: 3 / 2; }
.photo-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-empty { padding: 1.25rem 0.75rem; text-align: center; color: var(--muted); background: var(--accent-soft); border: 1px dashed rgba(13, 148, 136, 0.3); border-radius: 11px; font-size: 0.78rem; }
.pads { display: flex; gap: 0.5rem; }
.pad {
  flex: 1;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: #0f766e;
  background: rgba(13, 148, 136, 0.07);
  border: 1px solid rgba(13, 148, 136, 0.35);
  border-radius: 12px;
  padding: 0.7rem 0.4rem;
  cursor: pointer;
  transition: transform 0.08s, background 0.15s;
  touch-action: manipulation;
}
.pad:active { transform: scale(0.94); background: rgba(13, 148, 136, 0.2); }
.pad.k { color: #b45309; border-color: rgba(180, 83, 9, 0.4); background: rgba(180, 83, 9, 0.06); }
.pad.s { color: #0f766e; }
.pad.h { color: #4f46e5; border-color: rgba(79, 70, 229, 0.4); background: rgba(79, 70, 229, 0.06); }

.routes { width: 100%; height: auto; display: block; }
.map-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(13, 148, 136, 0.18);
  margin-bottom: 0.4rem;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.map-wrap.grabbing { cursor: grabbing; }
.map-wrap .routes { margin: 0; pointer-events: none; }
.map-btns {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.map-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent-2);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow);
  touch-action: manipulation;
  transition: transform 0.12s ease, background 0.12s;
}
.map-btn:hover { background: #ffffff; }
.map-btn:active { transform: scale(0.94); }
.map-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.routes-ocean { fill: rgba(13, 148, 136, 0.07); stroke: rgba(13, 148, 136, 0.18); stroke-width: 1; }
.routes-land { fill: #d8e3e0; stroke: #c0d3cf; stroke-width: 0.7; }
.routes .gr-a, .routes .gr-b, .routes .gr-c, .routes .gr-d,
.routes .gr-e, .routes .gr-f, .routes .gr-g, .routes .gr-h {
  fill: none;
  stroke-linecap: round;
  stroke-width: 1.5;
  stroke-dasharray: 6 8;
  animation: dashmove 14s linear infinite;
}
.routes .gr-a { stroke: var(--accent); }
.routes .gr-b { stroke: #0ea5e9; animation-duration: 18s; animation-delay: -6s; }
.routes .gr-c { stroke: #7c3aed; animation-duration: 12s; }
.routes .gr-d { stroke: #2563eb; animation-duration: 12s; }
.routes .gr-e { stroke: #ea580c; animation-duration: 12s; }
.routes .gr-f { stroke: #db2777; animation-duration: 12s; }
.routes .gr-g { stroke: #06b6d4; animation-duration: 12s; }
.routes .gr-h { stroke: #d97706; animation-duration: 12s; }
@keyframes dashmove { to { stroke-dashoffset: -84; } }
.routes .pt { fill: var(--accent-2); }
.routes .pt-b { fill: #0284c7; }
.routes .pt-c { fill: #6d28d9; }
.routes .pt-d { fill: #1d4ed8; }
.routes .pt-e { fill: #c2410c; }
.routes .pt-f { fill: #be185d; }
.routes .pt-g { fill: #0891b2; }
.routes .pt-h { fill: #b45309; }
.route-meta { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.78rem; }
.route-meta .sw { display: inline-block; width: 15px; height: 2.5px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.route-meta .rm-a { color: var(--accent); }
.route-meta .rm-b { color: #0ea5e9; }
.route-meta .rm-c { color: #7c3aed; }
.route-meta .rm-d { color: #2563eb; }
.route-meta .rm-e { color: #ea580c; }
.route-meta .rm-f { color: #db2777; }
.route-meta .rm-g { color: #06b6d4; }
.route-meta .rm-h { color: #d97706; }
.route-meta .rm-a .sw { background: var(--accent); }
.route-meta .rm-b .sw { background: #0ea5e9; }
.route-meta .rm-c .sw { background: #7c3aed; }
.route-meta .rm-d .sw { background: #2563eb; }
.route-meta .rm-e .sw { background: #ea580c; }
.route-meta .rm-f .sw { background: #db2777; }
.route-meta .rm-g .sw { background: #06b6d4; }
.route-meta .rm-h .sw { background: #d97706; }

.flow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.78rem;
}
.flow i { color: var(--accent); font-style: normal; }
.stage {
  background: rgba(13, 148, 136, 0.07);
  border: 1px solid rgba(13, 148, 136, 0.28);
  border-radius: 9px;
  padding: 0.35rem 0.55rem;
  white-space: nowrap;
  position: relative;
}
.stage.aer { overflow: hidden; }
.bub2 {
  position: absolute;
  bottom: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  animation: bub2 2.4s ease-in infinite;
}
.bub2:nth-child(2) { left: 25%; animation-delay: 0.6s; }
.bub2:nth-child(3) { left: 50%; animation-delay: 1.2s; }
.bub2:nth-child(4) { left: 75%; animation-delay: 1.8s; }
@keyframes bub2 {
  0% { transform: translateY(0); opacity: 0; }
  20% { opacity: 0.8; }
  100% { transform: translateY(-14px); opacity: 0; }
}
.rag {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  column-gap: 0.3rem;
  row-gap: 0.24rem;
  align-items: center;
}
.rag-head { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.65; }
.rag-node {
  background: rgba(13, 148, 136, 0.07);
  border: 1px solid rgba(13, 148, 136, 0.28);
  border-radius: 8px;
  padding: 0.3rem 0.5rem;
  font-size: 0.74rem;
  line-height: 1.25;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}
.rag-node.rag-vdb { border-style: dashed; }
.rag-node.rag-llm { font-weight: 600; }
.rag-node.rag-ans { background: var(--accent); border-color: var(--accent); color: #fff; }
.rag-tag { font-size: 0.62rem; font-weight: 400; opacity: 0.72; }
.rag-ans .rag-tag { opacity: 0.85; }
.rag-conn { color: var(--accent); font-style: normal; text-align: center; line-height: 1; font-size: 0.85rem; white-space: nowrap; }
.rag-write {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--accent);
  font-size: 0.66rem;
  line-height: 1.2;
}
.rag-write .rag-arr { font-size: 0.85rem; line-height: 1; }

.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag {
  font: inherit;
  font-size: 0.76rem;
  color: var(--accent-2);
  background: rgba(13, 148, 136, 0.07);
  border: 1px solid rgba(13, 148, 136, 0.3);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.tag:hover { background: rgba(13, 148, 136, 0.16); transform: translateY(-1px); }
.attach-links { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.al {
  font-size: 0.8rem;
  color: var(--accent-2);
  background: rgba(13, 148, 136, 0.07);
  border: 1px solid rgba(13, 148, 136, 0.3);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  text-decoration: none;
  transition: background 0.15s;
}
.al:hover { background: rgba(13, 148, 136, 0.16); }

/* honeypot (hidden from humans, trap for bots) */
.hp {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* contact form + booking card */
.attach-card.ct, .attach-card.bk { min-width: 240px; max-width: 340px; }
.ct-form { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.6rem; }
.ct-form label, .bk-form label {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  font-size: 0.72rem;
  color: var(--muted);
}
.ct-form input:not(.hp), .ct-form textarea,
.bk-form input:not(.hp), .bk-form textarea {
  font: inherit;
  font-size: 0.84rem;
  color: var(--text);
  background: #fbfdfc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.45rem 0.6rem;
  outline: none;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ct-form input:focus, .ct-form textarea:focus,
.bk-form input:focus, .bk-form textarea:focus {
  border-color: rgba(13, 148, 136, 0.55);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}
.ct-form textarea, .bk-form textarea { resize: vertical; min-height: 3.2rem; }
.bk-actions { display: flex; gap: 0.5rem; margin-top: 0.15rem; }
.ct-send, .bk-back, .bk-confirm, .bk-retry {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.42rem 0.95rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s, opacity 0.15s;
}
.ct-send, .bk-confirm {
  color: #f0fdf4;
  background: linear-gradient(135deg, #0f9d8a, #0b7d6d);
  border: none;
}
.ct-send:hover, .bk-confirm:hover { filter: brightness(1.08); transform: translateY(-1px); }
.ct-send:disabled, .bk-confirm:disabled { opacity: 0.5; cursor: default; transform: none; }
.bk-back, .bk-retry {
  color: var(--accent-2);
  background: rgba(13, 148, 136, 0.08);
  border: 1px solid rgba(13, 148, 136, 0.32);
}
.bk-back:hover, .bk-retry:hover { background: rgba(13, 148, 136, 0.16); }
.bk-status {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
  margin-top: 0.55rem;
}
.bk-status.loading { color: var(--accent-2); }
.bk-status.error { color: #b45309; }
.bk-status.ok { color: #0f766e; }
.bk-status.none { color: var(--muted); }
.bk-status .bk-retry { margin-left: 0.5rem; padding: 0.3rem 0.7rem; }
.bk-list { display: flex; flex-direction: column; gap: 0.55rem; max-height: 260px; overflow-y: auto; }
.bk-day { display: flex; flex-direction: column; gap: 0.35rem; }
.bk-day-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.bk-slots { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.bk-slot {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-2);
  background: rgba(13, 148, 136, 0.07);
  border: 1px solid rgba(13, 148, 136, 0.32);
  border-radius: 10px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  touch-action: manipulation;
}
.bk-slot:hover { background: rgba(13, 148, 136, 0.16); transform: translateY(-1px); }
.bk-sel { font-size: 0.8rem; color: var(--text); margin-bottom: 0.3rem; }
.bk-form { display: flex; flex-direction: column; gap: 0.5rem; }

/* composer */
.composer {
  padding: 0.5rem 0 0.6rem;
  border-top: 1px solid var(--border);
  background: linear-gradient(to top, rgba(238, 244, 242, 0.95), rgba(247, 251, 250, 0.8));
  backdrop-filter: blur(8px);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding-bottom: 0.6rem;
  max-height: 7.2rem;
  overflow-y: auto;
}
.chip {
  font: inherit;
  font-size: 0.82rem;
  color: var(--accent-2);
  background: #ffffff;
  border: 1px solid rgba(13, 148, 136, 0.32);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(20, 55, 48, 0.06);
  transition: background 0.15s, transform 0.15s;
}
.chip:hover { background: rgba(13, 148, 136, 0.1); transform: translateY(-1px); }

#form { display: flex; gap: 0.55rem; align-items: center; }
#input {
  flex: 1;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.8rem 1.15rem;
  outline: none;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
}
#input:focus { border-color: rgba(13, 148, 136, 0.55); box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.14); }
#input::placeholder { color: var(--muted); }

#send {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f9d8a, #0b7d6d);
  color: #f0fdf4;
  box-shadow: var(--shadow);
  transition: transform 0.15s, filter 0.15s, opacity 0.15s;
}
#send svg { width: 20px; height: 20px; fill: currentColor; }
#send:hover { filter: brightness(1.1); transform: translateY(-1px); }
#send:disabled { opacity: 0.4; cursor: default; transform: none; }

.hint {
  margin: 0.45rem 0 0;
  text-align: center;
  font-size: 0.68rem;
  color: var(--muted);
}

/* profile overlay */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(23, 42, 45, 0.35);
  backdrop-filter: blur(3px);
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.overlay.open { opacity: 1; pointer-events: auto; }
.sheet {
  background: var(--bg-2);
  width: min(420px, 100%);
  height: 100%;
  padding: 1.5rem;
  overflow-y: auto;
  transform: translateX(40px);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: var(--shadow-lg);
  border-left: 1px solid var(--border);
  position: relative;
}
.overlay.open .sheet { transform: none; }
.overlay-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s;
}
.overlay-close svg { width: 16px; height: 16px; fill: currentColor; }
.overlay-close:hover { color: var(--text); border-color: rgba(13, 148, 136, 0.4); }
.overlay-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0.4rem auto 0.8rem;
  border: 3px solid rgba(13, 148, 136, 0.4);
  box-shadow: 0 0 0 5px rgba(13, 148, 136, 0.12);
  cursor: zoom-in;
  outline-offset: 3px;
}
.overlay-avatar:focus-visible { outline: 2px solid var(--accent); }
.overlay.zoom .sheet {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 1.5rem;
  width: 100%;
}
.overlay.zoom .overlay-avatar {
  width: auto;
  height: min(84vh, 700px);
  max-width: 92vw;
  object-fit: contain;
  margin: 0 auto;
  border-radius: 12px;
  cursor: zoom-out;
}
.overlay.zoom .overlay-close { position: fixed; }
.overlay.zoom h2,
.overlay.zoom .overlay-status,
.overlay.zoom .card-title,
.overlay.zoom .telemetry,
.overlay.zoom .profiles,
.overlay.zoom .now-text { display: none; }
.sheet h2 { margin: 0; text-align: center; font-size: 1.35rem; }
.overlay-status {
  margin: 0.3rem 0 1.4rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.card-title {
  margin: 1.2rem 0 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.telemetry { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.telm-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 0.8rem;
}
.telm-label { display: block; font-size: 0.7rem; color: var(--muted); margin-bottom: 0.35rem; }
.telm-value { display: block; font-size: 1.45rem; font-weight: 700; color: var(--accent-2); font-variant-numeric: tabular-nums; }
.telm-value.oo { font-size: 1.6rem; }
.profiles { display: flex; flex-direction: column; gap: 0.45rem; }
.profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.7rem 0.9rem;
  text-decoration: none;
  color: var(--text);
  font-size: 0.85rem;
  transition: border-color 0.15s, transform 0.15s;
}
.profile-row:hover { border-color: rgba(13, 148, 136, 0.45); transform: translateX(-2px); }
.profile-row svg { width: 16px; height: 16px; fill: var(--muted); flex: none; }
.now-text { font-size: 0.9rem; line-height: 1.6; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 0.9rem 1rem; }

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  body::before, body::after, .dot, .typing span, #bubbles span,
  .routes .gr-a, .routes .gr-b, .routes .gr-c, .routes .gr-d,
  .routes .gr-e, .routes .gr-f, .routes .gr-g, .routes .gr-h,
  .bub2 { animation: none; }
  #bubbles span { display: none; }
  #chat { scroll-behavior: auto; }
  .msg { animation: none; }
  .sheet, .overlay { transition: none; }
}

/* mobile */
@media (max-width: 560px) {
  #app { padding: 0 0.6rem; }
  .bubble { max-width: 88%; }
  .topbar { flex-wrap: wrap; row-gap: 0.4rem; }
  .actions { margin-left: auto; gap: 0.5rem; }
  #socialsBtn { display: inline-flex; }
  .links {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    flex-direction: column;
    min-width: 190px;
    padding: 0.4rem;
    gap: 0.15rem;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    z-index: 40;
  }
  .socials.open .links { display: flex; }
  .links a {
    width: 100%;
    height: auto;
    justify-content: flex-start;
    gap: 0.7rem;
    padding: 0.5rem 0.7rem;
    border-radius: 8px;
  }
  .links a .link-label { display: inline; font-size: 0.85rem; font-weight: 500; }
  .icon-btn { width: 30px; height: 30px; }
  .seg-opt { padding: 0.3rem 0.7rem; }
}
