/* Automatic itinerary landing page (automatic-itinerary/). Builds on site.css and the app UI kit
   in landing.css. Every illustration's finished state is the default, so the page reads the
   same without JavaScript or with Reduce Motion; assets/js/automatic-itinerary.js only adds
   the movement. Sources (Gmail, ChatGPT, Claude, Muse…) each get a small, recognizable
   treatment, but always as inputs flowing into Tripami's own UI. */

/* Sources ------------------------------------------------------------------------------ */

/* --src is the source's accent, used for its label; every value is at least 4.5:1 on its card. */
.src-gmail { --src: #c5221f; }
.src-airbnb { --src: #c2185b; }
.src-messages { --src: #1a66d6; }
.src-chatgpt { --src: #1f1f1f; }
.src-claude { --src: #a4502e; --src-bg: #faf6ef; }
.src-muse { --src: #6a4fe0; }
.src-shot { --src: #56637a; }
.src-paste { --src: #56637a; }
.src-airline { --src: #0b4f8a; }
.src-resy { --src: #a53a14; }
.src-maps { --src: #137333; }
.src-notes { --src: #7a5a00; --src-bg: #fff8dc; }
.src-cal { --src: #c5221f; }

.src-card,
.ai-frag {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--src-bg, var(--surface));
  box-shadow: var(--shadow-card);
  line-height: 1.3;
}

.src-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--src, var(--ink-muted));
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.src-label svg {
  flex: none;
  width: 14px;
  height: 14px;
}

.src-body {
  display: grid;
}

.src-body strong {
  color: var(--ink);
  font-size: 13px;
}

.src-body span {
  color: var(--ink-muted);
  font-size: 12px;
}

.src-bubble {
  justify-self: start;
  max-width: 100%;
  padding: 5px 10px 6px;
  border-radius: 14px 14px 14px 4px;
  background: var(--tint-neutral);
  color: var(--ink);
  font-size: 12.5px;
}

.src-messages .src-bubble {
  background: var(--src);
  color: #fff;
}

.src-chatgpt .src-bubble {
  border-radius: 14px 14px 4px 14px;
  background: #f0f0f0;
}

.src-quote {
  color: var(--ink);
  font-size: 12.5px;
}

/* 1. Hero ----------------------------------------------------------------------------- */

/* This headline is longer than the other pages', so it's a little smaller, to keep three lines. */
.ai-hero .lp-hero-copy h1 {
  max-width: 16ch;
  font-size: clamp(2.5rem, 1.45rem + 3.6vw, 4rem);
}

.ai-hero-visual {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0;
  width: min(100%, 560px);
  margin-inline: auto;
}

.ai-sources {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ai-sources .src-card {
  padding: 8px 10px;
  border-radius: 14px;
}

.ai-sources .src-body strong,
.ai-sources .src-bubble,
.ai-sources .src-quote {
  font-size: 12px;
}

.ai-sources .src-body span {
  font-size: 11px;
}

.ai-merge {
  position: relative;
  width: 100%;
  height: 64px;
}

.ai-merge svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.ai-merge path {
  fill: none;
  stroke: #b9c3d1;
  stroke-width: 2;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  vector-effect: non-scaling-stroke;
}

.ai-merge-lines {
  display: none;
}

/* The Tripami app icon where every plan comes together. */
.ai-node {
  position: absolute;
  left: 50%;
  top: 81%;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-hero);
  transform: translate(-50%, -50%);
}

.ai-node img {
  width: 28px;
  height: 28px;
}

.ai-phone {
  width: min(100%, 272px);
  margin-top: 14px;
}

.ai-phone .ui-screen {
  padding: 10px 12px 14px;
}

.ai-app-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px;
}

.ai-app-title {
  color: var(--navy);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.1;
}

.ai-app-top .av {
  width: 22px;
  height: 22px;
}

.ai-phone .ui-kicker {
  margin-top: 4px;
}

.ai-day {
  margin: 12px 2px 6px;
  color: var(--ink-muted);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.ai-rows {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ai-phone .ui-row {
  gap: 8px;
  padding: 6px 8px;
  border-radius: 12px;
}

.ai-phone .ui-tile {
  width: 26px;
  height: 26px;
  border-radius: 8px;
}

.ai-phone .ui-tile svg {
  width: 15px;
  height: 15px;
}

.ai-phone .ui-text strong {
  font-size: 12.5px;
}

.ai-phone .ui-text span {
  font-size: 10.5px;
}

.ai-phone .ui-time {
  width: 40px;
  font-size: 11.5px;
}

/* Wider screens: the plans sit in a column beside the phone and flow into it. */
@media (min-width: 600px) {
  .ai-hero-visual {
    grid-template-columns: minmax(0, 200px) 72px 262px;
    align-items: stretch;
    justify-content: center;
  }

  .ai-sources {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(6, 1fr);
    gap: 0;
  }

  .ai-sources .src-card {
    align-self: center;
  }

  .ai-merge {
    height: auto;
  }

  .ai-merge-lines {
    display: block;
  }

  .ai-merge-down {
    display: none;
  }

  .ai-node {
    top: 50%;
    left: 77.5%;
  }

  .ai-phone {
    align-self: center;
    width: 262px;
    margin-top: 0;
  }
}

@media (min-width: 960px) and (max-width: 1139px) {
  .ai-hero-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
}

@media (min-width: 1140px) {
  .ai-hero-grid {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  }
}

/* 2. The problem ---------------------------------------------------------------------- */

.ai-scatter {
  position: relative;
  max-width: 1000px;
  margin-inline: auto;
}

.ai-frags {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ai-frag:nth-child(4n + 1) { transform: rotate(-1.6deg); }
.ai-frag:nth-child(4n + 2) { transform: rotate(1.2deg) translateY(6px); }
.ai-frag:nth-child(4n + 3) { transform: rotate(-0.8deg) translateY(-4px); }
.ai-frag:nth-child(4n + 4) { transform: rotate(1.8deg); }

/* Phones show eight of the twelve. */
@media (max-width: 599px) {
  /* Leave room for the rotated cards at the edge of a phone screen. */
  .ai-frags {
    padding-inline: 12px;
  }

  .ai-frag.src-airline,
  .ai-frag.src-maps,
  .ai-frag.src-notes,
  .ai-frag.src-cal {
    display: none;
  }
}

.ai-question {
  position: relative;
  width: fit-content;
  max-width: 92%;
  margin: 26px auto 0;
  padding: 14px 22px;
  border-radius: 22px 22px 22px 6px;
  background: var(--navy);
  color: var(--on-navy);
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.75rem);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  box-shadow: var(--shadow-hero);
}

.ai-problem .lp-together {
  margin-top: clamp(36px, 5vw, 56px);
}

@media (min-width: 760px) {
  .ai-frags {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px 16px;
  }
}

/* 3. The engine ----------------------------------------------------------------------- */

.ai-stages {
  display: grid;
  gap: 22px;
}

.ai-picker {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.ai-stage-list {
  display: grid;
  gap: 40px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ai-stage {
  position: relative;
  display: grid;
  align-content: start;
  gap: 10px;
}

/* An arrow from each stage to the next: down on phones, across on wide screens. */
.ai-stage:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -32px;
  width: 24px;
  height: 24px;
  background: var(--navy);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M6 13l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M6 13l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  transform: translateX(-50%);
}

.ai-stage-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--navy);
  font-size: 0.9375rem;
  font-weight: 700;
}

.ai-stage-label span {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--on-navy);
  font-size: 13px;
}

.ai-stage-card {
  min-height: 190px;
  padding: 16px;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.ai-stage-source {
  display: grid;
  align-content: start;
  gap: 10px;
  background: var(--src-bg, var(--surface));
}

.ai-stage-text {
  color: var(--ink);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.ai-fields {
  display: grid;
  gap: 6px;
  margin: 0;
}

.ai-fields div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 12px;
  border-radius: 12px;
  background: var(--confirmed);
}

.ai-fields dt {
  color: var(--confirmed-ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ai-fields dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 700;
  text-align: right;
}

.ai-stage-itinerary .ai-day {
  margin-top: 0;
}

.ai-stage-itinerary .ui-row,
.ai-result .ui-row,
.ai-build-trip .ui-row,
.mail-trip .ui-row {
  background: var(--bg);
  box-shadow: none;
}

.ui-row.is-new {
  background: var(--surface);
  box-shadow: 0 0 0 2px var(--aqua), var(--shadow-card);
}

.ai-engine-sources {
  color: var(--ink-muted);
  font-size: 0.9375rem;
  text-align: center;
}

.ai-engine-sources span {
  margin-right: 6px;
  color: var(--navy);
  font-weight: 700;
}

@media (min-width: 900px) {
  .ai-stage-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 48px;
  }

  .ai-stage:not(:last-child)::after {
    left: auto;
    right: -37px;
    top: 50%;
    bottom: auto;
    transform: rotate(-90deg);
  }
}

/* 4–6. AI assistants ------------------------------------------------------------------ */

.ai-how-connects {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  color: var(--ink-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.ai-how-connects svg {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  color: var(--navy);
}

.ai-how-connects strong {
  color: var(--ink);
}

.ai-chat-visual,
.ai-muse-visual {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(100%, 470px);
  margin-inline: auto;
}

.chat-card {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 16px;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  font-size: 0.875rem;
  line-height: 1.45;
}

.chat-head,
.muse-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.chat-head strong,
.muse-head strong {
  color: var(--ink);
  font-size: 0.9375rem;
}

.muse-head > span:last-child {
  margin-left: auto;
  color: var(--ink-muted);
  font-size: 0.8125rem;
}

.chat-mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--src, var(--navy));
  color: #fff;
}

.chat-mark svg {
  width: 15px;
  height: 15px;
}

.chat-msg {
  color: var(--ink);
}

.chat-user {
  justify-self: end;
  max-width: 86%;
  padding: 8px 12px;
  border-radius: 18px 18px 6px 18px;
  background: #f0f0f0;
}

.chat-ai ol {
  display: grid;
  gap: 4px;
  margin: 6px 0 0;
  padding-left: 20px;
}

.chat-tool {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--navy);
}

.chat-tool-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.8125rem;
}

.chat-tool-head img {
  width: 18px;
  height: 18px;
}

.chat-tool-head strong {
  color: var(--navy);
}

.chat-tool-head span {
  color: var(--confirmed-ink);
  font-weight: 700;
}

.chat-tool-body {
  display: grid;
  line-height: 1.3;
}

.chat-tool-body strong {
  color: var(--ink);
}

.chat-tool-body span {
  color: var(--ink-muted);
  font-size: 0.8125rem;
}

/* ChatGPT: neutral, black and white. */
.chat-gpt {
  --src: #1f1f1f;
}

/* Claude: a warm paper tone and a terracotta mark. */
.chat-claude {
  --src: #a4502e;
  background: #faf6ef;
}

.chat-claude .chat-user {
  background: #efe8dc;
}

.ai-into {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--on-navy);
}

.ai-into svg {
  width: 20px;
  height: 20px;
}

.ai-result {
  width: min(100%, 400px);
  padding: 14px;
  box-shadow: var(--shadow-hero);
}

.ai-result .ai-day {
  margin-top: 0;
}

/* Muse: a conversation that turns up ideas, one of which goes to the trip. */
.ai-muse {
  --src: #6a4fe0;
}

.muse-board .chat-user {
  background: #eeeafc;
}

.muse-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.muse-item {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 8px;
  align-items: center;
  padding: 8px;
  border-radius: 14px;
  background: var(--bg);
  line-height: 1.25;
}

.muse-item .ui-tile {
  grid-row: span 2;
  width: 30px;
  height: 30px;
}

.muse-item strong {
  color: var(--ink);
  font-size: 0.8125rem;
}

.muse-item > span:last-child {
  color: var(--ink-muted);
  font-size: 0.75rem;
}

.muse-item.is-picked {
  background: var(--surface);
  box-shadow: 0 0 0 2px var(--src);
}

.ai-dst {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ai-dst li {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  color: var(--navy);
  font-size: 0.875rem;
  font-weight: 700;
}

.ai-dst li svg {
  width: 16px;
  height: 16px;
}

/* The arrow sits in the gap between steps. */
.ai-dst li + li::before {
  content: "→";
  position: absolute;
  left: -21px;
  color: var(--ink-muted);
  font-weight: 700;
}

/* 7. Gmail ---------------------------------------------------------------------------- */

.ai-mail {
  display: grid;
  justify-items: center;
  gap: 16px;
  max-width: 1080px;
  margin-inline: auto;
}

.mail-list {
  display: grid;
  gap: 1px;
  width: min(100%, 420px);
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--border);
  box-shadow: var(--shadow-card);
  list-style: none;
}

.mail-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
}

.mail-row p {
  display: grid;
  min-width: 0;
  line-height: 1.3;
}

.mail-row strong {
  color: var(--ink);
  font-size: 0.875rem;
}

.mail-row span {
  color: var(--ink-muted);
  font-size: 0.8125rem;
}

.mail-found {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px 12px 12px;
  border-radius: var(--radius-pill);
  background: var(--navy);
  color: var(--on-navy);
}

.mail-found-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(32, 199, 207, 0.18);
  color: var(--aqua);
}

.mail-found-icon svg {
  width: 20px;
  height: 20px;
}

.mail-found p {
  display: grid;
  line-height: 1.25;
}

.mail-found strong {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
}

.mail-found span {
  color: var(--on-navy-muted);
  font-size: 0.8125rem;
}

.mail-trip {
  width: min(100%, 380px);
  padding: 14px;
  box-shadow: var(--shadow-hero);
}

.mail-trip .ai-day {
  margin: 0 2px 8px;
  color: var(--navy);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.ai-gmail-foot {
  display: grid;
  justify-items: center;
  gap: 18px;
  max-width: 640px;
  margin: clamp(28px, 4vw, 44px) auto 0;
}

@media (min-width: 1000px) {
  .ai-mail {
    grid-template-columns: minmax(0, 1.1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 24px;
  }
}

/* 8. The trip builds itself ----------------------------------------------------------- */

.ai-build-layout {
  display: grid;
  gap: 40px;
  align-items: center;
}

.ai-build-count {
  color: var(--on-navy-muted);
  font-size: 1.0625rem;
}

.ai-build-count strong {
  color: var(--aqua);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
}

.ai-build-trip {
  width: min(100%, 480px);
  margin-inline: auto;
  padding: 18px;
  color: var(--ink);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.ai-build-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.ai-build-head strong {
  color: var(--navy);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
}

.ai-build-head span {
  color: var(--ink-muted);
  font-size: 0.875rem;
}

.ai-src-tag {
  flex: none;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--tint-neutral);
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

@media (min-width: 960px) {
  .ai-build-layout {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 64px;
  }
}

/* 9. Trip gaps: saved ideas get a second line naming where they came from. -------------- */

.ai-gap-chips li {
  align-items: flex-start;
}

.ai-gap-chips li > span {
  display: grid;
  line-height: 1.25;
}

.ai-gap-chips small {
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 600;
}

/* 10. In control ---------------------------------------------------------------------- */

.ai-control-grid {
  display: grid;
  gap: 18px;
  max-width: 920px;
  margin-inline: auto;
}

.ai-control-card {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 20px;
}

.ai-control-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--navy);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}

.ai-control-title svg {
  width: 22px;
  height: 22px;
}

.ai-steps3 {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ai-steps3 li {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.ai-steps3 li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 30px;
  bottom: -12px;
  width: 2px;
  background: var(--border);
}

.ai-step-num {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--tint-neutral);
  color: var(--navy);
  font-size: 13px;
  font-weight: 800;
}

.ai-step-num.is-done {
  background: var(--aqua);
}

.ai-step-num svg {
  width: 16px;
  height: 16px;
  stroke-width: 3;
}

.ai-steps3 p {
  display: grid;
  line-height: 1.35;
}

.ai-steps3 strong {
  color: var(--ink);
}

.ai-steps3 p span {
  color: var(--ink-muted);
  font-size: 0.875rem;
}

.badge-review {
  background: var(--tentative);
  color: var(--tentative-ink);
}

.ai-change-flag .ui-badge {
  padding: 5px 10px;
  font-size: 10.5px;
}

.ai-change-text {
  color: var(--ink);
  font-size: 1.0625rem;
  line-height: 1.45;
}

.ai-change-q {
  color: var(--ink-muted);
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ai-change-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-btn {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--navy);
  color: var(--navy);
  font: 700 0.9375rem/1 var(--font-body);
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease;
}

.ai-btn:hover {
  background: var(--tint-neutral);
}

.ai-btn-primary {
  background: var(--navy);
  color: var(--on-navy);
}

.ai-btn-primary:hover {
  background: #0d3a7e;
}

.ai-btn:focus-visible {
  outline: 3px solid var(--aqua);
  outline-offset: 2px;
}

.ai-btn[aria-pressed="true"] {
  box-shadow: inset 0 0 0 1.5px var(--navy), 0 0 0 3px var(--aqua);
}

.ai-change-result {
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--tint-neutral);
  color: var(--ink-muted);
  font-size: 0.875rem;
  font-weight: 600;
}

.ai-change-result.is-accepted {
  background: var(--confirmed);
  color: var(--confirmed-ink);
}

.ai-promises {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 22px;
  margin: clamp(28px, 4vw, 40px) 0 0;
  padding: 0;
  list-style: none;
  color: var(--ink);
  font-weight: 600;
}

.ai-promises li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ai-promises svg {
  width: 20px;
  height: 20px;
  padding: 3px;
  border-radius: 50%;
  background: var(--confirmed);
  color: var(--confirmed-ink);
  stroke-width: 3;
}

@media (min-width: 860px) {
  .ai-control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
  }
}

/* 11. The living itinerary ------------------------------------------------------------ */

.ai-living-steps {
  display: grid;
  gap: 28px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.ai-living-step {
  position: relative;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.ai-living-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -24px;
  width: 20px;
  height: 20px;
  background: var(--ink-muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M6 13l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M6 13l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  transform: translateX(-50%);
}

.ai-living-label {
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ai-living-step .ui-row {
  background: var(--bg);
  box-shadow: none;
}

.ai-living-changed {
  position: relative;
  outline: 2px solid var(--sunset);
}

/* On the row's top edge, like a tag, so the plan keeps its full width. */
.ai-living-changed .ui-badge {
  position: absolute;
  top: -9px;
  right: 10px;
}

.ai-leave {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--tint-sunset);
}

.ai-leave span {
  width: 100%;
  color: var(--sunset-ink);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ai-leave strong {
  color: var(--navy);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
}

.ai-leave em {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  color: var(--ink-muted);
  font-size: 0.8125rem;
  font-style: normal;
  font-weight: 600;
}

.ai-leave em svg {
  width: 15px;
  height: 15px;
}

/* A Live Activity in miniature. */
.ai-mini-la {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #0b1730;
  color: #fff;
  line-height: 1.25;
}

.ai-mini-island {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 6px;
  margin-bottom: 6px;
  padding: 3px 10px 3px 6px;
  border-radius: var(--radius-pill);
  background: #000;
  color: var(--aqua);
  font-size: 12px;
  font-weight: 800;
}

.ai-mini-island svg {
  width: 14px;
  height: 14px;
}

.ai-mini-la strong {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
}

.ai-mini-la > span:last-child {
  color: #c7d3e6;
  font-size: 0.8125rem;
}

@media (min-width: 640px) {
  .ai-living-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  .ai-living-step:not(:last-child)::after {
    display: none;
  }
}

@media (min-width: 1000px) {
  .ai-living-steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 36px;
  }

  .ai-living-step:not(:last-child)::after {
    display: block;
    left: auto;
    right: -28px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%) rotate(-90deg);
  }
}

/* 13. Live Activity: two states, stacked in one place. --------------------------------- */

.ai-la-card {
  grid-template-areas: "head" "state";
}

.ai-la-state {
  grid-area: state;
  display: grid;
  gap: 1px;
}

.ai-la-alt {
  visibility: hidden;
}

/* 14. From idea to itinerary ---------------------------------------------------------- */

.ai-flow-steps {
  position: relative;
  display: grid;
  gap: 14px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

/* One lane runs through every step, like a traveler's path in the app. */
.ai-flow-steps::before {
  content: "";
  position: absolute;
  left: 28px;
  top: 20px;
  bottom: 20px;
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(var(--traveler-1), var(--traveler-2), var(--traveler-3), var(--traveler-4));
}

.ai-flow-step {
  position: relative;
  display: grid;
  align-content: start;
  gap: 10px;
  margin-left: 56px;
  padding: 16px 18px;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.ai-flow-name {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--navy);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}

.ai-flow-name svg {
  width: 22px;
  height: 22px;
}

.ai-flow-step ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ai-flow-step ul li {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg);
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 600;
}

.ai-flow-travel {
  background: var(--navy);
}

.ai-flow-travel .ai-flow-name {
  color: var(--on-navy);
}

.ai-flow-one {
  color: var(--on-navy);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.15;
}

.ai-flow-next {
  display: grid;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--on-navy);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
}

.ai-flow-next span {
  color: var(--aqua);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (min-width: 1000px) {
  .ai-flow-steps {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    padding-top: 30px;
  }

  .ai-flow-steps::before {
    left: 8%;
    right: 8%;
    top: 12px;
    bottom: auto;
    width: auto;
    height: 4px;
    background: linear-gradient(90deg, var(--traveler-1), var(--traveler-2), var(--traveler-3), var(--traveler-4));
  }

  .ai-flow-step {
    margin-left: 0;
  }

  /* A dot on the lane above each step. */
  .ai-flow-step::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -26px;
    width: 12px;
    height: 12px;
    border: 3px solid var(--surface);
    border-radius: 50%;
    background: var(--navy);
    box-shadow: 0 0 0 1px var(--border);
    transform: translateX(-50%);
  }
}

/* 15. How it works -------------------------------------------------------------------- */

/* site.css zeroes the heading's spacing for the home page's #how-it-works; restore it here. */
.ai-how-steps {
  display: grid;
  gap: 14px;
  margin: clamp(40px, 5vw, 64px) 0 0;
  padding: 0;
  list-style: none;
}

.ai-how-step {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 20px;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.ai-how-step h3 {
  color: var(--navy);
  font-size: 1.1875rem;
}

.ai-how-step p {
  color: var(--ink-muted);
}

@media (min-width: 700px) {
  .ai-how-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1080px) {
  .ai-how-steps {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* Increase Contrast: solid borders instead of soft shadows (DESIGN.md §8). */
@media (prefers-contrast: more) {
  .src-card,
  .ai-frag,
  .ai-stage-card,
  .chat-card,
  .muse-board,
  .mail-list,
  .ai-living-step,
  .ai-flow-step,
  .ai-how-step,
  .ai-how-connects {
    border: 1.5px solid var(--ink);
    box-shadow: none;
  }
}
