:root {
  --ground: #1C1D20;
  --said: #26282C;
  --line: #35383D;
  --fog: #E8E9EB;
  --ash: #A3A7AE;
  --orange: #FF8A45;
  --sky: #9FB4D4;
  --navy: #141E32;
  --good: #3EE08A;
  --warn: #FFD23F;
  --bad: #FF4D5E;
  --voice: Sora, 'DM Sans', system-ui, sans-serif;
  --body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --col: 640px;
  --ease-out-soft: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-pop: cubic-bezier(0.34, 1.4, 0.64, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--ground);
  color: var(--fog);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

a { color: var(--fog); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; border-radius: 8px; }

.top, main {
  width: 100%;
  max-width: calc(var(--col) + 36px);
  margin-left: auto;
  margin-right: auto;
}
.ask-inner, .ask-note {
  width: 100%;
  max-width: var(--col);
  margin-left: auto;
  margin-right: auto;
}

/* ---------- header ---------- */

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px max(18px, env(safe-area-inset-right)) 8px max(18px, env(safe-area-inset-left));
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; min-height: 44px; }
.brand-text { display: flex; align-items: baseline; gap: 8px; }
.brand-name { font-family: var(--voice); font-weight: 700; font-size: 23px; letter-spacing: -0.03em; line-height: 1; }
.brand-by { font-size: 13px; color: var(--ash); }
.top-link { font-size: 14px; color: var(--ash); text-decoration: none; padding: 12px 0; }
.top-link:hover { color: var(--fog); }

.avatar {
  flex: none; width: 34px; height: 34px; border-radius: 11px; background: var(--orange);
  display: flex; align-items: center; justify-content: center;
}
.avatar svg { width: 21px; height: 23px; display: block; }
.avatar-lg { width: 40px; height: 40px; border-radius: 13px; }
.avatar-lg svg { width: 25px; height: 27px; }

.top-links { display: inline-flex; align-items: center; gap: 16px; }
.top-btn {
  font: inherit; font-size: 14px; font-weight: 600; color: var(--fog); background: none; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; min-height: 40px; max-width: 9.5em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: border-color 0.18s ease, background-color 0.18s ease;
}
.top-btn:hover { border-color: var(--orange); background: rgba(255, 138, 69, 0.07); }
@media (max-width: 480px) { .top.has-acct #news { display: none; } }
.gsi { min-height: 44px; margin-top: 4px; }
.dot-good { background: var(--good); }
.ask-note a { color: inherit; }

/* ---------- plain pages ---------- */
.page { padding-top: 22px; padding-bottom: 60px; }
.page h1 { font-family: var(--voice); font-weight: 700; font-size: 30px; line-height: 1.15; letter-spacing: -0.03em; margin: 0 0 6px; }
.page h2 { font-family: var(--voice); font-weight: 600; font-size: 19px; letter-spacing: -0.02em; margin: 32px 0 8px; }
.page p, .page li { color: #C9CCD1; max-width: 62ch; }
.page p { margin: 0 0 12px; }
.page ul { margin: 0 0 12px; padding-left: 20px; }
.page li { margin-bottom: 6px; }
.page a { color: var(--sky); }

/* ---------- thread ---------- */

main { flex: 1; padding: 14px max(18px, env(safe-area-inset-right)) 28px max(18px, env(safe-area-inset-left)); }

.thread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

.msg { display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: 10px; align-items: start; }
.msg + .msg .avatar { visibility: hidden; }
.msg .avatar { grid-column: 1; }
.msg-body { grid-column: 2; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }


.said {
  max-width: 100%;
  background: var(--said); border-radius: 6px 20px 20px 20px; padding: 14px 16px;
}
.said p { margin: 0; }
.said a { color: var(--sky); overflow-wrap: anywhere; }
.said p + p { margin-top: 8px; }

.voice { font-family: var(--voice); font-weight: 600; font-size: 19px; line-height: 1.3; letter-spacing: -0.02em; }
.quiet { color: var(--ash); font-size: 14px; }

.me { display: flex; justify-content: flex-end; margin: 6px 0 2px; }
.me-said {
  max-width: 80%; background: var(--orange); color: var(--navy);
  font-family: var(--voice); font-weight: 600; font-size: 16px; letter-spacing: -0.01em;
  border-radius: 20px 20px 6px 20px; padding: 10px 16px; overflow-wrap: anywhere;
}

.earlier { display: flex; align-items: center; gap: 12px; margin: 10px 0 6px; color: #8E9299; font-size: 13px; }
.earlier::before, .earlier::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.earlier button { font: inherit; color: var(--ash); background: none; border: 0; padding: 6px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.row-flight { align-items: center; }
.row-flight .airline { width: 34px; height: 34px; border-radius: 10px; }
.row-flight .airline img { width: 26px; height: 26px; }
.reply-more { color: var(--ash); }

.ednote { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 138, 69, 0.09); border-left: 3px solid var(--orange); }
.said > .ednote { margin-bottom: 4px; }
.ednote-label { display: block; font-family: var(--voice); font-weight: 600; font-size: 13px; color: var(--orange); margin-bottom: 4px; }
.ednote p { margin: 0; font-size: 15px; line-height: 1.45; }
.ednote-by { display: block; margin-top: 6px; font-size: 13px; color: var(--ash); }
.promises li { display: flex; gap: 10px; align-items: baseline; }
.promises strong { flex: none; width: 2.2em; font-family: var(--voice); font-weight: 600; font-size: 14px; }
.promises .yes strong { color: var(--good); }
.promises .no strong { color: var(--bad); }
.promises .no { color: var(--ash); }

.more-btn { margin-top: 12px; font: inherit; font-size: 14px; font-weight: 600; color: var(--sky); background: none; border: 0; padding: 6px 0; min-height: 32px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.more-box > .points, .more-box > .facts { margin-top: 8px; }
.more-box > .facts { border-top: 0; padding-top: 0; }
.reply-link { display: inline-flex; align-items: center; text-decoration: none; color: var(--sky); border-color: rgba(159, 180, 212, 0.4); }
.reply-link::after { content: ''; width: 7px; height: 7px; margin-left: 8px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg) translateY(1px); }
.reply-link:hover { border-color: var(--sky); background: rgba(159, 180, 212, 0.08); }

.intro .points { margin-top: 12px; padding-top: 0; border-top: 0; }
.intro .quiet { margin-top: 12px; }

/* ---------- answers ---------- */

.answer { width: 100%; padding: 16px; }
.answer-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; min-height: 40px; }
.answer-code { margin: 0; font-family: var(--voice); font-weight: 700; font-size: 24px; line-height: 1; letter-spacing: -0.03em; }
.msg, .me { scroll-margin-bottom: 140px; }
.answer-code.is-long { font-size: 20px; line-height: 1.15; }
.answer-sub { margin: 8px 0 0; line-height: 1.3; font-size: 14px; color: var(--ash); }
.said.answer .voice { margin-top: 14px; }
.said.answer .answer-meta { margin-top: 6px; }

/* status labels: a word in a tinted capsule, with three bars for risk or a dot for state */
.answer-head .answer-code { flex: 1; white-space: nowrap; }
.answer-head .answer-code.is-long { white-space: normal; min-width: 0; }
.pill {
  flex: none; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  font-size: 13px; font-weight: 600; line-height: 1; padding: 7px 11px; border-radius: 999px;
  color: var(--tone); background: var(--tint);
}
.said > .pill { margin-bottom: 12px; }
.pill-good { --tone: var(--good); --tint: rgba(62, 224, 138, 0.13); }
.pill-warn { --tone: var(--warn); --tint: rgba(255, 210, 63, 0.13); }
.pill-bad { --tone: var(--bad); --tint: rgba(255, 77, 94, 0.15); }
.pill-calm { --tone: var(--sky); --tint: rgba(159, 180, 212, 0.13); }
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tone); }
.pill-bars { display: inline-flex; gap: 3px; }
.pill-bars i { width: 11px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.16); }
.pill-bars-low i:nth-child(1), .pill-bars-medium i:nth-child(-n+2), .pill-bars-high i { background: var(--tone); }

.dot { flex: none; align-self: flex-start; width: 9px; height: 9px; border-radius: 50%; margin: 6px -2px 0 0; }
.dot-bad { background: var(--bad); }
.dot-warn { background: var(--warn); }
.dot-maybe { border: 2px solid var(--warn); }

.airline {
  flex: none; width: 40px; height: 40px; border-radius: 12px; background: #fff; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.airline img { width: 32px; height: 32px; object-fit: contain; display: block; }
.airline-code { background: var(--line); color: var(--fog); font-family: var(--voice); font-weight: 700; font-size: 14px; letter-spacing: -0.02em; }

.points { list-style: none; margin: 14px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.points li { font-size: 15px; line-height: 1.45; }

.answer-label { margin: 16px 0 0; font-family: var(--voice); font-weight: 600; font-size: 14px; letter-spacing: -0.01em; color: var(--sky); }
.points.steps { margin-top: 8px; padding-top: 0; border-top: 0; }
.points.steps li { position: relative; padding-left: 18px; }
.points.steps li::before { content: ''; position: absolute; left: 2px; top: 0.55em; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); }
.points li p { margin: 0; }
.points li a { color: var(--sky); overflow-wrap: anywhere; }

.facts { margin: 14px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.fact { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; font-size: 14px; }
.fact dt { color: var(--ash); }
.fact dd { margin: 0; }

.said.answer .confirm { margin-top: 14px; }

/* tappable rows and quick replies */
.rows { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; }
.rows li + li { border-top: 1px solid var(--line); }
.row {
  width: 100%; display: flex; align-items: baseline; gap: 12px; text-align: left;
  background: none; border: 0; padding: 12px 0; min-height: 44px; color: inherit; font: inherit; cursor: pointer;
}
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-name { font-family: var(--voice); font-weight: 600; font-size: 16px; letter-spacing: -0.01em; color: var(--fog); }
.row-text { font-size: 15px; line-height: 1.4; color: #C9CCD1; }
.row:hover .row-name { text-decoration: underline; text-underline-offset: 3px; }
.said .rows + .quiet { margin-top: 4px; }

.replies { display: flex; flex-wrap: wrap; gap: 8px; }
.reply {
  background: none; border: 1px solid var(--line); color: var(--fog); border-radius: 999px;
  font: inherit; font-size: 14px; padding: 9px 14px; min-height: 40px; cursor: pointer; text-align: left; line-height: 1.3;
}
.reply { transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s var(--ease-out-soft); }
.reply:hover { border-color: var(--orange); background: rgba(255, 138, 69, 0.07); }
.reply:active { transform: scale(0.96); }

.dots { display: inline-flex; gap: 5px; padding: 6px 2px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--ash); animation: wave 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: 0.14s; }
.dots i:nth-child(3) { animation-delay: 0.28s; }
@keyframes wave { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }

.plain { color: var(--ash); }

/* ---------- ask bar ---------- */

.ask {
  position: sticky; bottom: 0; z-index: 2;
  background: linear-gradient(to bottom, rgba(28, 29, 32, 0), var(--ground) 22px);
  padding: 22px max(18px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}
.ask-inner {
  display: flex; align-items: center; gap: 8px;
  background: var(--said); border: 1px solid var(--line); border-radius: 999px; padding: 6px 6px 6px 20px;
}
.ask-inner { transition: border-color 0.2s ease, box-shadow 0.25s ease; }
.ask-inner:focus-within { border-color: var(--orange); box-shadow: 0 0 0 4px rgba(255, 138, 69, 0.14); }
.ask button { transition: transform 0.18s var(--ease-pop), opacity 0.2s ease; }
.ask button:active { transform: scale(0.9); }
.row { transition: transform 0.18s var(--ease-out-soft); }
.row:active { transform: scale(0.985); }
.num { font-variant-numeric: tabular-nums; }
.airline img { opacity: 0; transition: opacity 0.35s ease; }
.airline img.is-loaded { opacity: 1; }
.ask input {
  flex: 1; min-width: 0; height: 44px; border: 0; background: transparent; color: var(--fog);
  font: inherit; font-size: 17px; outline: none;
}
.ask input::placeholder { color: #8E9299; opacity: 1; }
.ask button {
  flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--orange); color: var(--navy); display: flex; align-items: center; justify-content: center;
}
.ask button svg { width: 22px; height: 22px; }
.ask button[disabled] { opacity: 0.5; cursor: default; }
.ask-note { margin-top: 8px; margin-bottom: 0; font-size: 12px; line-height: 1.4; color: #8E9299; text-align: center; }

.follow .said { margin-top: 18px; }
.follow .said p { margin-bottom: 0; max-width: none; }
.follow .said .voice { color: var(--fog); margin-top: 14px; }
.follow .said .answer-sub { margin-top: 8px; color: var(--ash); }
.follow .said .answer-meta { margin-top: 6px; color: var(--ash); }
.follow .said .confirm { margin-top: 14px; color: var(--ash); }
.follow .points { padding-left: 0; margin: 14px 0 0; }
.follow .points li { margin: 0; color: var(--fog); max-width: none; }
.follow-cta { margin: 22px 0 14px; }
.follow-btn { display: inline-block; background: var(--orange); color: var(--navy) !important; font-family: var(--voice); font-weight: 600; font-size: 16px; text-decoration: none; padding: 13px 22px; border-radius: 999px; }
.top .avatar img { width: 100%; height: 100%; display: block; border-radius: inherit; }
.stats { max-width: 900px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stats td:first-child { white-space: nowrap; }
.tile { background: var(--said); border-radius: 18px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.tile-num { font-family: var(--voice); font-weight: 700; font-size: 28px; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile-label { font-size: 14px; color: var(--ash); }
.table-wrap { overflow-x: auto; background: var(--said); border-radius: 18px; padding: 6px 18px; }
.stats table { width: 100%; border-collapse: collapse; font-size: 15px; }
.stats th { text-align: left; font-weight: 600; color: var(--ash); font-size: 13px; padding: 10px 12px 10px 0; white-space: nowrap; }
.stats td { padding: 10px 12px 10px 0; border-top: 1px solid var(--line); }
.stats th.num, .stats td.num { text-align: right; padding-right: 0; padding-left: 12px; font-variant-numeric: tabular-nums; }

@media (min-width: 700px) {
  .top { padding-top: 26px; }
  main { padding-top: 22px; }
  .voice { font-size: 20px; }
  .said.answer { padding: 20px; }
}

/* ---------- motion ----------
   New messages rise and fade in, their contents follow in a short stagger, and status marks settle last.
   Everything here only plays once, on content the traveler just asked for. */

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { 0% { opacity: 0; transform: scale(0.6); } 100% { opacity: 1; transform: scale(1); } }
@keyframes slide-in { from { opacity: 0; transform: translateX(18px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 var(--ring); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }

.msg.is-new .avatar { animation: pop 0.45s var(--ease-pop) both; }
.me.is-new .me-said { animation: slide-in 0.4s var(--ease-out-soft) both; transform-origin: 100% 100%; }

.fresh > * { animation: rise 0.5s var(--ease-out-soft) both; }
.fresh > .replies { animation: none; }
.fresh > .replies .reply { animation: rise 0.45s var(--ease-out-soft) both; }
.fresh > .replies .reply:nth-child(1) { animation-delay: 0.42s; }
.fresh > .replies .reply:nth-child(2) { animation-delay: 0.48s; }
.fresh > .replies .reply:nth-child(3) { animation-delay: 0.54s; }
.fresh > .replies .reply:nth-child(4) { animation-delay: 0.6s; }
.fresh > .replies .reply:nth-child(n+5) { animation-delay: 0.66s; }

.fresh .answer > *, .fresh .said > .pill, .fresh .said > .voice, .fresh .said > .rows, .fresh .said > .quiet { animation: rise 0.5s var(--ease-out-soft) both; }
.fresh .said > *:nth-child(1) { animation-delay: 0.06s; }
.fresh .said > *:nth-child(2) { animation-delay: 0.12s; }
.fresh .said > *:nth-child(3) { animation-delay: 0.18s; }
.fresh .said > *:nth-child(4) { animation-delay: 0.24s; }
.fresh .said > *:nth-child(5) { animation-delay: 0.3s; }
.fresh .said > *:nth-child(6) { animation-delay: 0.36s; }
.fresh .said > *:nth-child(n+7) { animation-delay: 0.42s; }

.fresh .points li, .fresh .rows li, .fresh .fact { animation: rise 0.45s var(--ease-out-soft) both; }
.fresh .points li:nth-child(1), .fresh .rows li:nth-child(1), .fresh .fact:nth-child(1) { animation-delay: 0.3s; }
.fresh .points li:nth-child(2), .fresh .rows li:nth-child(2), .fresh .fact:nth-child(2) { animation-delay: 0.37s; }
.fresh .points li:nth-child(3), .fresh .rows li:nth-child(3), .fresh .fact:nth-child(3) { animation-delay: 0.44s; }
.fresh .points li:nth-child(4), .fresh .rows li:nth-child(4), .fresh .fact:nth-child(4) { animation-delay: 0.51s; }
.fresh .points li:nth-child(n+5), .fresh .rows li:nth-child(n+5), .fresh .fact:nth-child(n+5) { animation-delay: 0.58s; }

.fresh .answer-head .pill, .fresh .airline { animation: pop 0.5s var(--ease-pop) 0.2s both; }
.fresh .pill-bars i { transform-origin: 0 50%; animation: grow 0.4s var(--ease-out-soft) both; }
.fresh .pill-bars i:nth-child(1) { animation-delay: 0.45s; }
.fresh .pill-bars i:nth-child(2) { animation-delay: 0.57s; }
.fresh .pill-bars i:nth-child(3) { animation-delay: 0.69s; }
.fresh .dot { animation: pop 0.4s var(--ease-pop) 0.4s both; }

/* A slow pulse marks the things that are going wrong right now. */
.pill-bad .pill-dot, .dot-bad { --ring: rgba(255, 77, 94, 0.55); animation: ping 2.2s ease-out 1s infinite; }
.fresh .dot-bad { animation: pop 0.4s var(--ease-pop) 0.4s both, ping 2.2s ease-out 1.2s infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .dots i { opacity: 0.7; }
  .airline img { opacity: 1; }
}

/* v1.3: flight phases, track record, desk scripts and claim drafts */
.now { margin-top: 10px; font-size: 15px; line-height: 1.45; color: var(--fog); }
.now strong { font-family: var(--voice); font-weight: 600; color: var(--sky); }
.record { display: flex; gap: 10px; align-items: baseline; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ash); }
.record .dot { align-self: auto; margin: 0; transform: translateY(-1px); }
.flightbar { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.fb-code { font-family: var(--voice); font-weight: 600; font-size: 13px; letter-spacing: 0.02em; color: var(--ash); }
.fb-track { position: relative; flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.fb-track i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 2px; background: var(--sky); transition: width 1.1s var(--ease-out-soft); }
.fb-track i::after { content: ''; position: absolute; right: -5px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 3px var(--said); }
.points.says { gap: 12px; }
.points.says li { padding-left: 14px; border-left: 3px solid var(--orange); font-size: 16px; line-height: 1.45; color: var(--fog); }
.draft { margin-top: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--ground); }
.draft-title { font-family: var(--voice); font-weight: 600; font-size: 15px; line-height: 1.35; }
.said .draft-text { margin-top: 10px; font-size: 14px; line-height: 1.55; color: var(--fog); white-space: pre-wrap; overflow-wrap: anywhere; }
.said.answer .draft + .replies { margin-top: 12px; }
@media (prefers-reduced-motion: reduce) { .fb-track i { transition: none; } }

/* v1.4: the small Milo is a close-up, chest up, filling his tile */
.avatar { overflow: hidden; }
.avatar svg, .avatar-lg svg { width: 100%; height: 100%; }
