:root {
  --bg: #f7f4ee;
  --ink: #171716;
  --muted: #6d685f;
  --panel: #fffdf8;
  --line: #ded7ca;
  --accent: #0c7a67;
  --accent-strong: #075d4c;
  --wait: #6650a8;
  --shadow: 0 24px 70px rgba(31, 27, 20, 0.13);
  --top-note-height: 52px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 400;
  color: var(--ink);
  background:
    linear-gradient(115deg, rgba(12, 122, 103, 0.16), transparent 35%),
    linear-gradient(255deg, rgba(189, 85, 38, 0.12), transparent 34%),
    var(--bg);
}

strong,
b {
  font-weight: 400;
}

body.has-results {
  overflow-y: auto;
}

button,
input {
  font: inherit;
}

.top-note {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: var(--top-note-height);
  padding: 21px 0 0;
  text-align: center;
}

.top-note p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.25;
}

.top-note p + p {
  margin-top: 10px;
}

.top-note a {
  color: var(--accent-strong);
  font-weight: 400;
  overflow-wrap: anywhere;
}

.app-shell {
  width: min(980px, calc(100% - 32px));
  height: calc(100vh - var(--top-note-height));
  min-height: 0;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(300px, 520px);
  justify-content: center;
  align-items: center;
  padding: 0 0 12px;
}

body.has-results .app-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: calc(100vh - 62px);
  grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding-top: 12px;
}

.search-panel,
.results-panel {
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.search-panel {
  width: min(100%, 460px);
  justify-self: center;
  padding: 14px;
  transform: translateY(-15px);
}

.results-panel {
  display: none;
  min-height: calc(100vh - 110px);
  padding: 24px;
}

body.has-results .search-panel {
  position: sticky;
  top: 30px;
  transform: none;
}

body.has-results .results-panel {
  display: block;
  margin-top: 0;
}

.brand-row,
.results-head,
.flight-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-row {
  justify-content: center;
  margin-bottom: 8px;
  text-align: left;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
  font-weight: 400;
  letter-spacing: 0;
}

.pre-logo {
  margin: 0 0 5px;
  color: var(--accent-strong);
  text-align: center;
  font-size: 0.82rem;
  font-weight: 400;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 400;
  text-transform: uppercase;
}

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

h1,
h2 {
  margin-bottom: 0;
  line-height: 1;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.55rem, 3.6vw, 2.55rem);
  font-weight: 400;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 3.6rem);
  font-weight: 400;
}

.flight-form {
  display: grid;
  gap: 7px;
}

label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 400;
}

input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(12, 122, 103, 0.14);
}

button {
  min-height: 39px;
  border: 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  font-weight: 400;
}

button:hover {
  background: var(--accent-strong);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.price-pill,
.decision-badge {
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.78rem;
  font-weight: 400;
}

.price-pill {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.38);
}

.status {
  min-height: 18px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.progress-panel {
  margin-top: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.progress-track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #ece6db;
}

.progress-track span {
  display: block;
  width: 25%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 320ms ease;
}

.progress-steps {
  display: grid;
  gap: 4px;
  margin: 7px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.82rem;
}

.progress-steps li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-steps li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
}

.progress-steps li.is-active {
  color: var(--ink);
}

.progress-steps li.is-active::before,
.progress-steps li.is-complete::before {
  border-color: var(--accent);
  background: var(--accent);
}

.decision-badge {
  min-width: 102px;
  text-align: center;
  color: #fff;
  background: var(--accent);
}

.decision-badge.is-wait {
  background: var(--wait);
}

.decision-badge.is-empty {
  color: var(--muted);
  background: #efe8db;
}

.empty-state {
  margin-top: 42px;
  max-width: 620px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.summary,
.probability-grid,
.insight-grid {
  display: grid;
  gap: 0;
}

.summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.probability-grid,
.insight-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.summary-item,
.probability-item,
.insight {
  background: #fff;
}

.summary-item {
  padding: 18px;
  border-right: 1px solid var(--line);
}

.summary-item:last-child {
  border-right: 0;
}

.probability-item,
.insight {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.summary-item span,
.probability-item span,
.insight span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 400;
  text-transform: uppercase;
}

.summary-item b,
.probability-item b,
.insight b {
  display: block;
  margin-top: 7px;
}

.insight small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.flight-list {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.flight-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
}

.flight-top h3 {
  margin-bottom: 6px;
  font-size: 1.05rem;
}

.flight-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.detail-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #faf8f3;
}

.detail-item span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.detail-item b {
  display: block;
  margin-top: 6px;
}

.fare {
  white-space: nowrap;
  font-size: 1.2rem;
  font-weight: 400;
}

.meta {
  color: var(--muted);
  line-height: 1.5;
}

.decision-reason {
  margin: 12px 0 0;
  color: var(--ink);
  line-height: 1.5;
}

.flight-card a,
.sources a {
  color: var(--accent-strong);
  font-weight: 400;
  overflow-wrap: anywhere;
}

.fare-link {
  display: inline-block;
  margin-top: 8px;
}

.source-title {
  margin: 8px 0 0;
  font-size: 0.86rem;
}

.sources {
  margin-top: 30px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.sources h3 {
  margin-bottom: 14px;
}

.source-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.source-list li {
  margin-bottom: 10px;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 0 0 12px;
  }

  body.has-results .app-shell {
    height: auto;
    min-height: auto;
  }

  body.has-results .app-shell {
    grid-template-columns: 1fr;
  }

  .search-panel {
    position: static;
    transform: none;
  }

  body.has-results .search-panel {
    position: static;
    transform: none;
  }

  .results-panel {
    min-height: auto;
  }

  .summary,
  .probability-grid,
  .insight-grid,
  .flight-details {
    grid-template-columns: 1fr;
  }

  .summary-item {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .summary-item:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 560px) {
  :root {
    --top-note-height: 74px;
  }

  .app-shell {
    width: min(100% - 20px, 1180px);
    height: auto;
    min-height: 0;
    align-items: start;
    padding: 8px 0 10px;
  }

  .top-note {
    width: min(100% - 20px, 1180px);
    padding-top: 19px;
  }

  .top-note p {
    font-size: 0.73rem;
  }

  .search-panel,
  .results-panel {
    padding: 12px;
  }

  .search-panel {
    transform: none;
  }

  .brand-row {
    justify-content: flex-start;
    gap: 10px;
    margin-bottom: 8px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
  }

  h1 {
    font-size: clamp(1.55rem, 8vw, 2.15rem);
  }

  h2 {
    font-size: clamp(1.65rem, 10vw, 2.35rem);
  }

  input,
  button {
    min-height: 36px;
  }

  .results-head,
  .flight-top {
    align-items: flex-start;
    flex-direction: column;
  }

  button {
    align-items: center;
    flex-direction: row;
    justify-content: center;
    padding: 10px 12px;
    width: 100%;
    flex-wrap: wrap;
    text-align: center;
  }

  .fare {
    white-space: normal;
  }

  .summary-item,
  .flight-card,
  .probability-item,
  .insight,
  .detail-item {
    padding: 12px;
  }
}
