@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800;900&family=Noto+Sans+SC:wght@400;500;700;900&family=Zen+Maru+Gothic:wght@400;500;700&display=swap");

:root {
  color-scheme: light;
  --bg: #f8f8f0;
  --surface: #fff8e7;
  --surface-soft: #f7f3df;
  --text: #725d42;
  --heading: #794f27;
  --muted: #9f927d;
  --border: #d8caa8;
  --border-strong: #9f927d;
  --accent: #19c8b9;
  --accent-strong: #0f8c82;
  --rose: #e05a5a;
  --amber: #dba90e;
  --blue: #889df0;
  --green: #6fba2c;
  --yellow: #ffcc00;
  --peach: #f8a6b2;
  --sand-shadow: #bdaea0;
  --input-shadow: #d4c9b4;
  --shadow: 0 8px 0 rgba(189, 174, 160, 0.55), 0 14px 24px rgba(114, 93, 66, 0.13);
  --soft-shadow: 0 4px 12px rgba(107, 92, 67, 0.18);
  --organic-radius: 34px 28px 38px 30px / 30px 38px 28px 34px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(125, 195, 149, 0.32) 0, rgba(248, 248, 240, 0.72) 190px, var(--bg) 410px),
    radial-gradient(circle at 10% 18%, rgba(255, 204, 0, 0.18), transparent 140px),
    repeating-linear-gradient(135deg, rgba(216, 202, 168, 0.16) 0 2px, transparent 2px 28px),
    var(--bg);
  color: var(--text);
  font-family:
    Nunito, "Noto Sans SC", "Zen Maru Gothic", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: 0.01em;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  margin: 10px clamp(12px, 2vw, 28px) 0;
  padding: 10px 16px;
  background: rgba(255, 248, 231, 0.94);
  border: 2px solid #eadbbd;
  border-radius: 26px;
  box-shadow: 0 5px 0 rgba(189, 174, 160, 0.75), 0 10px 20px rgba(114, 93, 66, 0.12);
  backdrop-filter: blur(10px);
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  line-height: 1.2;
  color: var(--heading);
  font-weight: 900;
}

h2 {
  font-size: 16px;
  line-height: 1.25;
  color: var(--heading);
  font-weight: 900;
}

.topbar-actions,
.control-group,
.filter-group,
.panel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.page-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border: 2px solid #d8caa8;
  border-radius: 20px;
  background: #f7f3df;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.55);
}

.page-tabs a {
  min-width: 64px;
  padding: 8px 12px;
  border-radius: 15px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.page-tabs a:hover {
  background: #eef6f5;
  text-decoration: none;
}

.page-tabs a.active {
  background: var(--accent);
  color: #fffdf4;
  box-shadow: 0 4px 0 #0f8c82;
}

.layout {
  width: min(1600px, 100%);
  margin: 0 auto;
  padding: 18px clamp(14px, 3vw, 34px) 30px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric,
.panel,
.control-strip {
  background: var(--surface);
  border: 2px solid #eadbbd;
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.metric {
  min-height: 112px;
  padding: 18px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  border-radius: 24px 20px 28px 22px / 22px 28px 20px 24px;
}

.metric span,
.metric small,
.panel-header p,
.field span,
td,
.empty-state {
  color: var(--muted);
}

.metric strong {
  min-height: 34px;
  overflow-wrap: anywhere;
  font-size: 28px;
  line-height: 1.15;
  color: #2d2116;
  font-weight: 900;
}

.control-strip {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding: 12px;
}

.requirement-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(280px, 0.65fr);
  gap: 14px;
  margin-top: 14px;
}

.verification-panel {
  margin-top: 14px;
}

.latest-search-panel {
  margin-top: 14px;
}

.requirement-body,
.requirement-spec,
.verification-list,
.latest-search-list,
.config-body {
  padding: 14px 16px 16px;
}

.requirement-results,
.requirement-section {
  display: grid;
  gap: 12px;
}

.requirement-section h3 {
  margin: 0;
  color: #48515d;
  font-size: 13px;
  font-weight: 800;
}

.requirement-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.requirement-card-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.requirement-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 158px;
  padding: 12px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
}

.requirement-card.qualified,
.requirement-card.qualified_signal {
  border-left-color: var(--green);
}

.requirement-card.review {
  border-left-color: var(--amber);
}

.requirement-card.blocked {
  border-left-color: var(--rose);
}

.requirement-card-top,
.requirement-price-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.requirement-card-top strong,
.requirement-price-line strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.requirement-price-line span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.requirement-highlight {
  color: #48515d;
  font-size: 13px;
}

.check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.check-grid.compact {
  gap: 5px;
}

.check-item {
  display: inline-grid;
  grid-template-columns: 1fr;
  gap: 1px;
  min-width: 86px;
  padding: 5px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fbfcfd;
}

.check-grid.compact .check-item {
  min-width: 72px;
  padding: 4px 6px;
}

.check-item strong {
  color: var(--text);
  font-size: 11px;
  line-height: 1.2;
}

.check-item small {
  color: var(--muted);
  font-size: 10px;
}

.check-item.met {
  border-color: rgba(38, 115, 77, 0.35);
  background: rgba(38, 115, 77, 0.08);
}

.check-item.partial,
.check-item.source {
  border-color: rgba(138, 106, 22, 0.35);
  background: rgba(138, 106, 22, 0.09);
}

.check-item.missing {
  opacity: 0.74;
}

.spec-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.spec-row:last-child {
  border-bottom: 0;
}

.spec-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.spec-row strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
}

.small-link {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
}

.section-label {
  justify-self: start;
}

.config-panel {
  margin-top: 14px;
}

.config-body {
  display: grid;
  gap: 16px;
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.toggle-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  color: var(--text);
  font-weight: 700;
}

.toggle-field input {
  width: 18px;
  min-height: 18px;
}

.compact-toggle {
  min-height: 38px;
  white-space: nowrap;
}

.config-section {
  display: grid;
  gap: 10px;
}

.config-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pattern-editor {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pattern-option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fbfcfd;
  font-size: 13px;
  font-weight: 700;
}

.pattern-option input {
  width: 16px;
  min-height: 16px;
}

.destination-editor {
  display: grid;
  gap: 10px;
}

.destination-row {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fbfcfd;
}

.destination-select-line {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto auto;
  gap: 10px;
  align-items: end;
}

.destination-select-line.secondary-line {
  grid-template-columns: minmax(180px, 0.55fr) auto minmax(0, 1fr);
}

.location-match-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.destination-policy-line {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 0.32fr)) minmax(0, 1fr);
  gap: 10px;
  align-items: end;
}

.airport-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 32px;
  align-items: center;
}

.destination-chip-list {
  padding: 4px 0 2px;
}

.airport-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 7px;
  border: 1px solid rgba(22, 106, 104, 0.28);
  border-radius: 6px;
  background: #eef6f5;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.airport-chip button {
  display: inline-grid;
  place-items: center;
  width: 18px;
  min-height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(22, 106, 104, 0.12);
  color: var(--accent-strong);
  font-size: 13px;
  line-height: 1;
}

.config-add-button {
  align-self: end;
}

.config-validation {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fbfcfd;
}

.config-validation.ok {
  border-color: rgba(38, 115, 77, 0.28);
  background: rgba(38, 115, 77, 0.06);
}

.config-validation.warn {
  border-color: rgba(138, 106, 22, 0.3);
  background: rgba(138, 106, 22, 0.07);
}

.config-validation.error {
  border-color: rgba(168, 61, 85, 0.3);
  background: rgba(168, 61, 85, 0.06);
}

.config-validation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.config-validation-header strong {
  color: var(--text);
  font-size: 13px;
}

.config-validation-list {
  display: grid;
  gap: 4px;
}

.config-validation-list span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.config-validation-list span.error {
  color: var(--rose);
}

.config-validation-list span.warn {
  color: var(--amber);
}

.mini-button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  color: var(--accent-strong);
  font-weight: 800;
}

.mini-button:hover {
  border-color: var(--accent);
  background: #eef6f5;
}

.mini-button.danger {
  color: var(--rose);
}

.icon-button,
.command-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: #ffffff;
  background: var(--accent);
  white-space: nowrap;
}

.icon-button {
  min-width: 92px;
}

.command-button.secondary {
  color: var(--accent-strong);
  background: #eef6f5;
}

.command-button:hover,
.icon-button:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  text-decoration: none;
}

.command-button.secondary:hover {
  color: #ffffff;
}

.status-pill,
.badge,
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.ok,
.badge.ok {
  border-color: rgba(38, 115, 77, 0.35);
  background: rgba(38, 115, 77, 0.1);
  color: var(--green);
}

.status-pill.warn,
.badge.warn {
  border-color: rgba(138, 106, 22, 0.35);
  background: rgba(138, 106, 22, 0.12);
  color: var(--amber);
}

.status-pill.error,
.badge.error {
  border-color: rgba(168, 61, 85, 0.35);
  background: rgba(168, 61, 85, 0.1);
  color: var(--rose);
}

.status-pill.muted,
.badge.muted {
  color: var(--muted);
}

.field {
  display: grid;
  gap: 4px;
  min-width: 138px;
}

.field.compact {
  min-width: 88px;
}

.field.search {
  min-width: 220px;
}

.field span {
  font-size: 12px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  padding: 0 10px;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(22, 106, 104, 0.22);
  outline-offset: 2px;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(330px, 0.9fr);
  gap: 14px;
  margin-top: 14px;
}

.bottom-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.side-stack {
  display: grid;
  align-content: start;
  gap: 14px;
}

.panel {
  min-width: 0;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: #fbfcfd;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

th,
td {
  min-height: 54px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

th {
  color: #48515d;
  font-size: 12px;
  font-weight: 800;
  background: #f8fafb;
}

tbody tr {
  background: #ffffff;
}

tbody tr:hover,
tbody tr.selected {
  background: #eef6f5;
}

td strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.source-cell {
  min-width: 160px;
}

.muted-line {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.priority {
  min-width: 42px;
  border-color: transparent;
  color: #ffffff;
}

.priority.p1 {
  background: var(--rose);
}

.priority.p2 {
  background: var(--blue);
}

.priority.p3 {
  background: var(--amber);
}

.priority.p4 {
  background: #6f7782;
}

.open-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--accent-strong);
  background: #ffffff;
  font-weight: 800;
}

.open-link:hover {
  background: #eef6f5;
  text-decoration: none;
}

.detail-body,
.health-list,
.blocked-list,
.verification-list,
.trend-list,
.email-body {
  padding: 14px 16px 16px;
}

.detail-body {
  min-height: 320px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 128px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  background: #fbfcfd;
}

.empty-state.compact {
  min-height: 58px;
}

.detail-grid {
  display: grid;
  gap: 12px;
}

.detail-row {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.detail-row span:first-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  border-radius: 6px;
  font-weight: 650;
  white-space: normal;
}

.health-item,
.blocked-item,
.verification-item,
.latest-search-item,
.trend-row,
.env-row {
  display: grid;
  gap: 7px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.health-item:last-child,
.blocked-item:last-child,
.verification-item:last-child,
.latest-search-item:last-child,
.trend-row:last-child,
.env-row:last-child {
  border-bottom: 0;
}

.health-line,
.blocked-line,
.verification-line,
.latest-search-line,
.trend-line,
.env-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.health-bar,
.trend-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.health-bar span,
.trend-bar span {
  display: block;
  height: 100%;
  min-width: 8px;
  border-radius: inherit;
  background: var(--accent);
}

.blocked-item strong,
.verification-item strong,
.latest-search-item strong,
.trend-row strong {
  overflow-wrap: anywhere;
}

.latest-search-item {
  border-left: 4px solid var(--border);
  padding-left: 12px;
}

.latest-search-item.confirmed_priced {
  border-left-color: var(--green);
}

.latest-search-item.direct_unpriced {
  border-left-color: var(--amber);
}

.latest-search-item.blocked {
  border-left-color: var(--rose);
}

.latest-search-message {
  color: #48515d;
}

.inline-link {
  width: max-content;
  font-weight: 750;
}

.results-layout {
  width: min(1480px, 100%);
}

.result-hero {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(520px, 0.95fr);
  gap: 12px;
}

.result-decision-card,
.result-hero-stat {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.result-decision-card {
  min-height: 168px;
  align-content: space-between;
  border-color: rgba(22, 106, 104, 0.28);
  background: linear-gradient(135deg, #0f4f4d 0%, #166a68 58%, #2f7660 100%);
  color: #ffffff;
}

.result-decision-card.watching {
  border-color: rgba(138, 106, 22, 0.35);
  background: linear-gradient(135deg, #6f5612 0%, #8a6a16 58%, #9c7b2a 100%);
}

.result-decision-card.empty {
  border-color: var(--border);
  background: #ffffff;
  color: var(--text);
}

.result-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.result-hero-stat {
  min-height: 168px;
  align-content: space-between;
}

.result-decision-card span,
.result-decision-card small,
.result-hero-stat span,
.result-hero-stat small {
  color: var(--muted);
}

.result-decision-card:not(.empty) span,
.result-decision-card:not(.empty) small {
  color: rgba(255, 255, 255, 0.82);
}

.result-decision-card strong {
  overflow-wrap: anywhere;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.05;
}

.result-hero-stat strong {
  align-self: end;
  overflow-wrap: anywhere;
  font-size: 25px;
  line-height: 1.1;
}

.results-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.34fr);
  gap: 14px;
  margin-top: 14px;
}

.result-side {
  display: grid;
  align-content: start;
  gap: 14px;
}

.flight-result-list,
.result-history-list {
  display: grid;
  gap: 12px;
  padding: 14px 16px 16px;
}

.result-flight-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-left: 6px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
}

.result-flight-card.confirmed_priced {
  border-left-color: var(--green);
}

.result-flight-card.direct_unpriced {
  border-left-color: var(--amber);
}

.result-flight-card.blocked {
  border-left-color: var(--rose);
}

.result-flight-top,
.result-flight-summary,
.flight-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.result-flight-top strong {
  display: block;
  font-size: 21px;
  line-height: 1.22;
}

.result-flight-summary {
  display: grid;
  grid-template-columns: minmax(190px, 0.35fr) minmax(0, 1fr);
  align-items: stretch;
  padding: 0;
  border-radius: 6px;
  background: #f8fbfa;
  overflow: hidden;
}

.result-price-box {
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 136px;
  padding: 18px;
  border-right: 1px solid var(--border);
  background: #f2f7f6;
}

.result-price-box span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
  text-align: left;
}

.result-price-box strong {
  overflow-wrap: anywhere;
  font-size: 31px;
  line-height: 1.1;
}

.flight-timeline {
  display: grid;
  grid-template-columns: minmax(92px, 0.22fr) minmax(0, 1fr) minmax(92px, 0.22fr);
  align-items: center;
  gap: 14px;
  padding: 18px;
}

.time-node {
  display: grid;
  gap: 4px;
}

.time-node.right {
  text-align: right;
}

.time-node strong {
  font-size: 24px;
  line-height: 1.05;
}

.time-node span {
  color: var(--muted);
  font-weight: 800;
  text-align: inherit;
}

.timeline-line {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.timeline-line::before {
  content: "";
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--blue));
}

.timeline-line span {
  color: var(--text);
  text-align: center;
}

.timeline-line small {
  color: var(--muted);
}

.result-flight-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.detail-chip {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fbfcfd;
}

.detail-chip span,
.flight-row span,
.result-history-row span {
  color: var(--muted);
  font-size: 12px;
}

.detail-chip strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.result-message {
  color: #34414c;
  font-size: 15px;
}

.direct-flight-list {
  display: grid;
  gap: 8px;
}

.direct-flight-list h3 {
  margin: 2px 0 0;
  color: #48515d;
  font-size: 13px;
  font-weight: 840;
}

.flight-row {
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
}

.flight-row.best {
  border-color: rgba(38, 115, 77, 0.45);
  background: #f2faf5;
}

.flight-row-main {
  display: grid;
  gap: 3px;
}

.flight-row-price {
  white-space: nowrap;
}

.result-action {
  width: max-content;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(22, 106, 104, 0.28);
  border-radius: 6px;
  background: #eef8f6;
  color: var(--accent-strong);
  font-weight: 800;
}

.condition-row {
  display: grid;
  grid-template-columns: 26px minmax(86px, 0.42fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

.condition-row:last-child {
  border-bottom: 0;
}

.condition-mark {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #e9f6ef;
  color: var(--green);
  font-weight: 900;
}

.condition-row strong {
  font-size: 13px;
}

.condition-row small {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.35;
}

.result-history-row {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.result-history-row:last-child {
  border-bottom: 0;
}

.log-panel {
  margin-top: 14px;
}

pre {
  min-height: 120px;
  max-height: 320px;
  margin: 0;
  overflow: auto;
  padding: 14px 16px 18px;
  background: #111820;
  color: #e8f1f2;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

@media (max-width: 1180px) {
  .metric-grid,
  .bottom-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-hero,
  .result-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .requirement-grid {
    grid-template-columns: 1fr;
  }

  .config-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .destination-row {
    grid-template-columns: 1fr;
  }

  .destination-select-line {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .destination-select-line.secondary-line,
  .destination-policy-line,
  .location-match-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .requirement-card-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .main-grid {
    grid-template-columns: 1fr;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .result-flight-details {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions,
  .control-strip,
  .control-group,
  .filter-group,
  .panel-actions {
    width: 100%;
  }

  .metric-grid,
  .config-grid,
  .requirement-card-grid,
  .requirement-card-grid.compact,
  .bottom-grid {
    grid-template-columns: 1fr;
  }

  .result-hero,
  .result-stat-grid,
  .result-flight-summary {
    grid-template-columns: 1fr;
  }

  .destination-row,
  .destination-select-line,
  .destination-select-line.secondary-line,
  .destination-policy-line,
  .location-match-row {
    grid-template-columns: 1fr;
  }

  .control-strip {
    flex-direction: column;
  }

  .command-button,
  .icon-button {
    flex: 1 1 150px;
  }

  .field,
  .field.search,
  .field.compact {
    min-width: min(100%, 180px);
    flex: 1 1 150px;
  }

  .metric strong {
    font-size: 24px;
  }

  .result-flight-top,
  .flight-row {
    display: grid;
  }

  .result-price-box {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .flight-timeline {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .time-node.right {
    text-align: left;
  }

  .result-flight-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* Animal Island inspired operational theme */
:root {
  --bg: #f8f8f0;
  --surface: #fff8e7;
  --surface-soft: #f7f3df;
  --text: #725d42;
  --heading: #794f27;
  --muted: #9f927d;
  --border: #d8caa8;
  --border-strong: #9f927d;
  --accent: #19c8b9;
  --accent-strong: #11a89b;
  --accent-deep: #0f8c82;
  --rose: #e05a5a;
  --amber: #dba90e;
  --blue: #889df0;
  --green: #6fba2c;
  --yellow: #ffcc00;
  --peach: #f8a6b2;
  --sand-shadow: #bdaea0;
  --input-shadow: #d4c9b4;
  --shadow: 0 7px 0 var(--input-shadow), 0 18px 30px rgba(114, 93, 66, 0.16);
  --soft-shadow: 0 4px 10px rgba(107, 92, 67, 0.22);
  --organic-radius: 36px 30px 40px 32px / 32px 40px 30px 36px;
}

body {
  background:
    radial-gradient(circle at 14px 14px, rgba(255, 255, 255, 0.58) 2px, transparent 2.8px) 0 0 / 34px 34px,
    repeating-linear-gradient(0deg, rgba(121, 79, 39, 0.035) 0 1px, transparent 1px 24px),
    linear-gradient(180deg, #dff2df 0, #eef8e6 170px, #f8f8f0 360px, #f7f3df 100%);
  color: var(--text);
  font-family:
    Nunito, "Noto Sans SC", "Zen Maru Gothic", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  font-weight: 500;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  z-index: -1;
  height: 210px;
  background:
    linear-gradient(180deg, rgba(125, 195, 149, 0.9), rgba(188, 228, 197, 0.55) 62%, rgba(248, 248, 240, 0));
  pointer-events: none;
}

a {
  color: var(--accent-deep);
  font-weight: 800;
}

.topbar {
  min-height: 82px;
  margin: 14px clamp(12px, 2vw, 30px) 0;
  padding: 12px 18px;
  background: rgba(255, 248, 231, 0.96);
  border: 3px solid var(--border);
  border-radius: var(--organic-radius);
  box-shadow: 0 7px 0 var(--sand-shadow), 0 18px 28px rgba(114, 93, 66, 0.14);
}

.eyebrow {
  display: inline-flex;
  width: max-content;
  min-height: 25px;
  align-items: center;
  margin-bottom: 5px;
  padding: 0 12px;
  border: 2px solid rgba(17, 168, 155, 0.32);
  border-radius: 999px;
  background: #e6f9f6;
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 900;
}

h1,
h2,
.config-section-header strong {
  color: var(--heading);
  font-weight: 900;
}

h1 {
  font-size: clamp(24px, 2.2vw, 32px);
}

h2 {
  font-size: 18px;
}

.layout {
  padding-top: 22px;
}

.page-tabs {
  gap: 7px;
  padding: 6px;
  border: 2.5px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.68), 0 3px 0 rgba(189, 174, 160, 0.6);
}

.page-tabs a {
  min-width: 76px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 900;
}

.page-tabs a.active {
  background: var(--accent);
  color: #fffdf4;
  box-shadow: 0 4px 0 var(--accent-deep);
}

.page-tabs a:hover {
  background: #e6f9f6;
  color: var(--heading);
  text-decoration: none;
  transform: translateY(-1px);
}

.metric,
.panel,
.control-strip,
.result-decision-card,
.result-hero-stat,
.result-flight-card {
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: var(--organic-radius);
  box-shadow: var(--shadow);
}

.panel {
  overflow: visible;
}

.panel-header {
  min-height: 70px;
  padding: 16px 20px;
  border-bottom: 2px dashed var(--border);
  border-radius: 30px 26px 0 0 / 26px 32px 0 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(247, 243, 223, 0.55)),
    var(--surface);
}

.panel-header p,
.metric span,
.metric small,
.field span,
td,
.empty-state,
.muted-line {
  color: var(--muted);
}

.metric {
  min-height: 126px;
  padding: 18px 20px;
  border-radius: 30px 24px 34px 26px / 26px 34px 24px 30px;
}

.metric:nth-child(1) {
  background: #e6f9f6;
}

.metric:nth-child(2) {
  background: #fff6cb;
}

.metric:nth-child(3) {
  background: #ffe8e8;
}

.metric:nth-child(4) {
  background: #edf0ff;
}

.metric strong {
  color: #4e321d;
  font-size: 32px;
}

.control-strip {
  padding: 16px;
  border-radius: 28px 24px 32px 26px / 26px 32px 24px 28px;
}

.icon-button,
.command-button,
.mini-button,
.open-link,
.result-action {
  min-height: 45px;
  border: 2px solid var(--accent-deep);
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 5px 0 var(--accent-deep);
  color: #fffdf4;
  font-weight: 900;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.icon-button:hover,
.command-button:hover,
.mini-button:hover,
.open-link:hover,
.result-action:hover {
  border-color: var(--accent-deep);
  background: #3dd4c6;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 6px 0 var(--accent-deep);
}

.icon-button:active,
.command-button:active,
.mini-button:active,
.open-link:active,
.result-action:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--accent-deep);
}

.command-button.secondary,
.mini-button,
.open-link {
  border-color: var(--border-strong);
  background: #f8f8f0;
  color: var(--heading);
  box-shadow: 0 5px 0 var(--sand-shadow);
}

.command-button.secondary:hover,
.mini-button:hover,
.open-link:hover {
  background: #fff8e7;
  color: var(--heading);
  box-shadow: 0 6px 0 var(--sand-shadow);
}

.mini-button.danger {
  border-color: rgba(224, 90, 90, 0.7);
  background: #fff1f1;
  color: var(--rose);
  box-shadow: 0 4px 0 rgba(224, 90, 90, 0.32);
}

button:disabled {
  transform: none;
  box-shadow: 0 3px 0 var(--sand-shadow);
}

input,
select {
  min-height: 44px;
  border: 2.5px solid #c4b89e;
  border-radius: 999px;
  background: #f8f8f0;
  box-shadow: 0 3px 0 var(--input-shadow);
  color: var(--text);
  font-weight: 700;
  padding: 0 16px;
}

input[type="number"],
input[type="text"],
input[type="search"] {
  appearance: textfield;
}

input:focus,
select:focus {
  border-color: var(--yellow);
  box-shadow: 0 3px 0 #e0b800, 0 0 0 4px rgba(255, 204, 0, 0.16);
  outline: 0;
}

button:focus-visible,
a:focus-visible,
.page-tabs a:focus-visible {
  outline: 3px solid rgba(25, 200, 185, 0.38);
  outline-offset: 3px;
}

input[type="checkbox"] {
  width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  accent-color: var(--accent);
  box-shadow: none;
}

.toggle-field,
.pattern-option {
  color: var(--heading);
  font-weight: 900;
}

.pattern-option {
  min-height: 44px;
  padding: 0 14px;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 4px 0 var(--input-shadow);
}

.destination-row,
.config-validation,
.detail-chip,
.check-item,
.requirement-card,
.empty-state,
.health-item,
.blocked-item,
.verification-item,
.latest-search-item,
.trend-row,
.env-row {
  border: 2px solid var(--border);
  border-radius: 22px;
  background: rgba(255, 248, 231, 0.78);
  box-shadow: 0 3px 0 rgba(212, 201, 180, 0.7);
}

.destination-row,
.requirement-card {
  padding: 14px;
}

.empty-state {
  border-style: dashed;
  background: rgba(247, 243, 223, 0.74);
}

.airport-chip,
.tag,
.status-pill,
.badge {
  min-height: 29px;
  padding: 4px 10px;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  box-shadow: 0 2px 0 rgba(212, 201, 180, 0.65);
  color: var(--heading);
  font-weight: 900;
}

.status-pill.ok,
.badge.ok,
.check-item.met {
  border-color: rgba(111, 186, 44, 0.62);
  background: #eef9e8;
  color: #4f8f1d;
}

.status-pill.warn,
.badge.warn,
.check-item.partial,
.check-item.source {
  border-color: rgba(255, 204, 0, 0.82);
  background: #fff5c4;
  color: #8a6a16;
}

.status-pill.error,
.badge.error {
  border-color: rgba(224, 90, 90, 0.62);
  background: #ffe8e8;
  color: var(--rose);
}

.status-pill.muted,
.badge.muted {
  background: #f7f3df;
  color: var(--muted);
}

.priority {
  border-color: rgba(121, 79, 39, 0.16);
  color: #fffdf4;
}

.priority.p1 {
  background: var(--rose);
}

.priority.p2 {
  background: var(--accent);
}

.priority.p3 {
  background: var(--yellow);
  color: var(--heading);
}

.priority.p4 {
  background: var(--border-strong);
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

th {
  background: #f0e5c7;
  color: var(--heading);
  font-weight: 900;
  border-bottom: 2px solid var(--border);
}

td {
  border-bottom: 2px dashed rgba(216, 202, 168, 0.8);
}

tbody tr {
  background: rgba(255, 248, 231, 0.86);
}

tbody tr:hover,
tbody tr.selected {
  background: #e6f9f6;
}

td strong,
.requirement-card-top strong,
.requirement-price-line strong {
  color: var(--heading);
}

.health-item,
.blocked-item,
.verification-item,
.latest-search-item,
.trend-row,
.env-row {
  padding: 12px 14px;
  border-bottom: 2px solid var(--border);
}

.health-item:last-child,
.blocked-item:last-child,
.verification-item:last-child,
.latest-search-item:last-child,
.trend-row:last-child,
.env-row:last-child {
  border-bottom: 2px solid var(--border);
}

.health-bar,
.trend-bar {
  height: 11px;
  border: 2px solid rgba(159, 146, 125, 0.32);
  background: #f8f8f0;
}

.health-bar span,
.trend-bar span {
  background: var(--accent);
}

.results-layout {
  width: min(1520px, 100%);
}

.result-hero {
  grid-template-columns: minmax(370px, 0.92fr) minmax(560px, 1.08fr);
  gap: 18px;
  align-items: stretch;
}

.result-decision-card {
  position: relative;
  min-height: 212px;
  overflow: hidden;
  padding: 24px 28px;
  border-color: #dba90e;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0 12px, transparent 12px 26px),
    linear-gradient(180deg, #ffe983 0, var(--yellow) 100%);
  box-shadow: 0 9px 0 #dba90e, 0 20px 32px rgba(114, 93, 66, 0.18);
  color: var(--heading);
}

.result-decision-card::after {
  content: "";
  position: absolute;
  right: 26px;
  bottom: 22px;
  width: 92px;
  height: 18px;
  border-radius: 999px;
  background: rgba(121, 79, 39, 0.12);
}

.result-decision-card.watching {
  border-color: rgba(224, 90, 90, 0.48);
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.22) 0 12px, transparent 12px 26px),
    linear-gradient(180deg, #ffe1b8 0, #f8a6b2 100%);
  box-shadow: 0 9px 0 rgba(224, 90, 90, 0.3), 0 20px 32px rgba(114, 93, 66, 0.18);
}

.result-decision-card.empty {
  border-color: var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.result-decision-card span,
.result-decision-card small,
.result-decision-card:not(.empty) span,
.result-decision-card:not(.empty) small {
  color: rgba(114, 93, 66, 0.84);
  font-weight: 900;
}

.result-decision-card strong {
  position: relative;
  z-index: 1;
  color: #4e321d;
  font-size: clamp(46px, 4.6vw, 72px);
  font-weight: 900;
  letter-spacing: 0;
}

.result-stat-grid {
  gap: 14px;
}

.result-hero-stat {
  position: relative;
  min-height: 212px;
  padding: 20px;
  overflow: hidden;
  border-radius: 28px 24px 32px 26px / 26px 32px 24px 28px;
  background: var(--surface);
}

.result-hero-stat::before {
  content: "";
  width: 52px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 3px 0 rgba(15, 140, 130, 0.35);
}

.result-hero-stat:nth-child(1)::before {
  background: var(--green);
}

.result-hero-stat:nth-child(2)::before {
  background: var(--yellow);
}

.result-hero-stat:nth-child(3)::before {
  background: var(--peach);
}

.result-hero-stat:nth-child(4)::before {
  background: var(--blue);
}

.result-hero-stat span,
.result-hero-stat small {
  color: var(--muted);
  font-weight: 800;
}

.result-hero-stat strong {
  color: #4e321d;
  font-size: clamp(26px, 2.2vw, 36px);
  font-weight: 900;
}

.results-grid {
  gap: 18px;
  margin-top: 20px;
}

.flight-result-list,
.result-history-list,
.requirement-spec {
  gap: 14px;
  padding: 18px;
}

.result-flight-card {
  position: relative;
  gap: 18px;
  padding: 22px;
  overflow: hidden;
  border-left: 3px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(247, 243, 223, 0.22)),
    var(--surface);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.result-flight-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 9px 0 var(--input-shadow), 0 22px 34px rgba(114, 93, 66, 0.18);
}

.result-flight-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 12px;
  background: var(--border);
}

.result-flight-card.confirmed_priced::before {
  background: var(--green);
}

.result-flight-card.direct_unpriced::before {
  background: var(--yellow);
}

.result-flight-card.blocked::before {
  background: var(--rose);
}

.result-flight-top {
  align-items: center;
  padding: 14px 16px;
  border: 2px dashed var(--border);
  border-radius: 24px;
  background: rgba(247, 243, 223, 0.85);
}

.result-flight-top strong {
  color: var(--heading);
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 900;
}

.result-flight-summary {
  grid-template-columns: minmax(230px, 0.33fr) minmax(0, 1fr);
  border: 3px solid var(--border);
  border-radius: 30px;
  background: #f8f8f0;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.72), 0 4px 0 rgba(212, 201, 180, 0.7);
}

.result-price-box {
  min-height: 160px;
  padding: 22px;
  border-right: 2px dashed var(--border);
  background: #e6f9f6;
}

.result-price-box span {
  color: var(--accent-deep);
  font-weight: 900;
}

.result-price-box strong {
  color: #4e321d;
  font-size: clamp(34px, 3.2vw, 48px);
  font-weight: 900;
}

.flight-timeline {
  padding: 24px;
}

.time-node {
  align-content: center;
  min-height: 86px;
  padding: 14px;
  border: 2px solid rgba(216, 202, 168, 0.8);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 4px 0 rgba(212, 201, 180, 0.72);
}

.time-node strong {
  color: var(--heading);
  font-size: clamp(26px, 2.2vw, 36px);
  font-weight: 900;
}

.time-node span {
  color: var(--muted);
  font-weight: 900;
}

.timeline-line {
  position: relative;
  min-height: 82px;
  justify-content: center;
}

.timeline-line::before {
  width: 100%;
  height: 9px;
  border: 2px solid rgba(15, 140, 130, 0.35);
  border-radius: 999px;
  background:
    radial-gradient(circle at 7px center, #0f8c82 0 5px, transparent 6px),
    repeating-linear-gradient(90deg, var(--accent) 0 18px, #82d5bb 18px 30px);
  box-shadow: 0 4px 0 rgba(15, 140, 130, 0.18);
}

.timeline-line::after {
  content: "";
  position: absolute;
  top: calc(50% - 22px);
  left: calc(50% - 12px);
  width: 24px;
  height: 24px;
  border: 4px solid var(--surface);
  border-radius: 999px;
  background: var(--yellow);
  box-shadow: 0 3px 0 rgba(219, 169, 14, 0.45);
}

.timeline-line span {
  z-index: 1;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--heading);
  font-weight: 900;
}

.timeline-line small {
  z-index: 1;
  color: var(--muted);
  font-weight: 900;
}

.result-flight-details {
  gap: 10px;
}

.detail-chip {
  min-height: 72px;
  padding: 10px 12px;
  background: rgba(247, 243, 223, 0.9);
}

.detail-chip span,
.flight-row span,
.result-history-row span {
  color: var(--muted);
  font-weight: 800;
}

.detail-chip strong {
  color: var(--heading);
  font-size: 15px;
  font-weight: 900;
}

.result-message {
  padding: 14px 16px;
  border: 2px solid rgba(255, 204, 0, 0.62);
  border-left-width: 8px;
  border-radius: 22px;
  background: #fff5c4;
  color: var(--heading);
  font-weight: 800;
}

.direct-flight-list {
  gap: 10px;
}

.direct-flight-list h3 {
  width: max-content;
  max-width: 100%;
  padding: 5px 12px;
  border-radius: 999px;
  background: #f0e5c7;
  color: var(--heading);
  font-size: 13px;
  font-weight: 900;
}

.flight-row {
  align-items: center;
  padding: 13px 14px;
  border: 2px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 4px 0 rgba(212, 201, 180, 0.72);
}

.flight-row.best {
  border-color: rgba(111, 186, 44, 0.75);
  background: #eef9e8;
}

.flight-row-main strong,
.flight-row-price {
  color: var(--heading);
  font-size: 17px;
  font-weight: 900;
}

.result-action {
  width: max-content;
  padding: 0 18px;
}

.condition-row {
  grid-template-columns: 30px minmax(96px, 0.36fr) minmax(0, 1fr);
  gap: 12px;
  min-height: 64px;
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 3px 0 rgba(212, 201, 180, 0.72);
}

.condition-row:last-child {
  margin-bottom: 0;
  border-bottom: 2px solid var(--border);
}

.condition-mark {
  width: 26px;
  height: 26px;
  background: var(--accent);
  box-shadow: 0 3px 0 var(--accent-deep);
  color: #fffdf4;
}

.condition-row strong {
  color: var(--heading);
  font-size: 14px;
  font-weight: 900;
}

.condition-row small {
  color: var(--text);
  font-weight: 800;
}

.result-history-row {
  padding: 13px 14px;
  border: 2px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 3px 0 rgba(212, 201, 180, 0.72);
}

.result-history-row:last-child {
  border-bottom: 2px solid var(--border);
}

.result-history-row strong {
  color: var(--heading);
  font-weight: 900;
}

pre {
  border-radius: 0 0 30px 30px;
  background: #2b2118;
  color: #e8d5bc;
}

@media (max-width: 1180px) {
  .result-hero {
    grid-template-columns: 1fr;
  }

  .result-stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .result-stat-grid,
  .metric-grid,
  .bottom-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-flight-summary {
    grid-template-columns: 1fr;
  }

  .result-price-box {
    border-right: 0;
    border-bottom: 2px dashed var(--border);
  }
}

@media (max-width: 760px) {
  .topbar {
    margin: 8px 8px 0;
    border-radius: 26px;
  }

  .result-stat-grid,
  .metric-grid,
  .config-grid,
  .requirement-card-grid,
  .requirement-card-grid.compact,
  .bottom-grid,
  .result-flight-details {
    grid-template-columns: 1fr;
  }

  .result-decision-card,
  .result-hero-stat {
    min-height: 0;
  }

  .condition-row {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .condition-row small {
    grid-column: 2;
  }

  .flight-timeline {
    grid-template-columns: 1fr;
  }

  .timeline-line {
    width: 100%;
  }
}

/* Ticket-detail refinement: clearer airline, endpoints, and route semantics */
.result-flight-summary {
  grid-template-columns: minmax(220px, 0.28fr) minmax(150px, 0.18fr) minmax(0, 1fr);
  min-height: 168px;
}

.result-airline-block {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 18px 14px;
  border-right: 2px dashed var(--border);
  background: rgba(255, 248, 231, 0.82);
}

.result-airline-block strong {
  color: var(--heading);
  font-size: 15px;
  font-weight: 900;
  text-align: center;
}

.result-airline-block small {
  color: var(--muted);
  font-weight: 900;
}

.airline-logo {
  display: inline-grid;
  grid-template-columns: 52px minmax(0, max-content);
  align-items: center;
  gap: 8px;
  max-width: 100%;
  color: var(--heading);
  font-weight: 900;
}

.result-airline-block .airline-logo {
  grid-template-columns: 64px;
  justify-items: center;
}

.airline-logo-mark {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 3px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px 14px 20px 16px / 16px 20px 14px 18px;
  background: var(--accent);
  box-shadow: 0 4px 0 rgba(121, 79, 39, 0.18);
  color: #fffdf4;
  font-size: 18px;
  letter-spacing: 0;
}

.airline-logo.has-official-logo .airline-logo-mark {
  width: 76px;
  border-color: rgba(216, 202, 168, 0.82);
  background: #fffdf4;
  overflow: hidden;
}

.result-airline-block .airline-logo-mark {
  width: 64px;
  height: 64px;
  border-radius: 22px 18px 24px 20px / 20px 24px 18px 22px;
  font-size: 21px;
}

.result-airline-block .airline-logo.has-official-logo .airline-logo-mark {
  width: 112px;
  height: 68px;
  background: #fffdf4;
}

.airline-logo-image {
  display: block;
  max-width: 88%;
  max-height: 76%;
  object-fit: contain;
}

.airline-logo.has-official-logo .airline-logo-fallback {
  display: none;
}

.airline-logo.logo-failed .airline-logo-image {
  display: none;
}

.airline-logo.logo-failed .airline-logo-fallback {
  display: inline;
}

.airline-logo-text {
  overflow: hidden;
  color: var(--heading);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-airline-block .airline-logo-text {
  display: none;
}

.airline-logo.hainan .airline-logo-mark {
  background: linear-gradient(145deg, #e93c2d, #c82020);
}

.airline-logo.airchina .airline-logo-mark {
  background: linear-gradient(145deg, #d71920, #a80e14);
}

.airline-logo.thai .airline-logo-mark {
  background: linear-gradient(145deg, #5f2aa0, #c79425);
}

.airline-logo.eastern .airline-logo-mark {
  background: linear-gradient(145deg, #d71920, #1f57a4);
}

.airline-logo.generic .airline-logo-mark {
  background: linear-gradient(145deg, var(--accent), var(--blue));
}

.flight-timeline {
  grid-template-columns: minmax(128px, 0.24fr) minmax(210px, 1fr) minmax(128px, 0.24fr);
  gap: 18px;
}

.time-node {
  min-height: 112px;
  justify-items: start;
}

.time-node.right {
  justify-items: end;
}

.time-label {
  width: max-content;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f0e5c7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.time-node small {
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.timeline-line {
  align-self: stretch;
  min-height: 112px;
}

.timeline-line::before {
  position: absolute;
  top: 42px;
  left: 0;
  width: 100%;
}

.timeline-line::after {
  top: 30px;
  left: calc(100% - 25px);
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--accent-deep);
  content: "➜";
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}

.timeline-line span {
  margin-top: 44px;
  border: 2px solid rgba(216, 202, 168, 0.9);
  box-shadow: 0 3px 0 rgba(212, 201, 180, 0.72);
}

.timeline-line small {
  margin-top: 2px;
}

.flight-row {
  display: grid;
  grid-template-columns: minmax(126px, 0.22fr) minmax(0, 1fr) minmax(128px, max-content);
  gap: 12px;
}

.flight-row-main {
  min-width: 0;
}

.flight-row-price {
  justify-self: end;
}

@media (max-width: 1180px) {
  .result-flight-summary {
    grid-template-columns: minmax(190px, 0.28fr) minmax(130px, 0.18fr) minmax(0, 1fr);
  }

  .flight-timeline {
    grid-template-columns: minmax(110px, 0.28fr) minmax(170px, 1fr) minmax(110px, 0.28fr);
  }
}

@media (max-width: 900px) {
  .result-flight-summary {
    grid-template-columns: 1fr;
  }

  .result-airline-block {
    justify-items: start;
    border-right: 0;
    border-bottom: 2px dashed var(--border);
  }

  .result-airline-block .airline-logo {
    grid-template-columns: 52px minmax(0, max-content);
  }

  .result-airline-block .airline-logo-mark {
    width: 52px;
    height: 52px;
    border-radius: 18px 14px 20px 16px / 16px 20px 14px 18px;
    font-size: 18px;
  }

  .result-airline-block .airline-logo.has-official-logo .airline-logo-mark {
    width: 88px;
    height: 56px;
  }

  .result-airline-block .airline-logo-text {
    display: inline;
  }
}

@media (max-width: 760px) {
  .flight-timeline {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .time-node,
  .time-node.right {
    justify-items: start;
    text-align: left;
  }

  .timeline-line {
    min-height: 74px;
    justify-items: start;
    padding-left: 16px;
  }

  .timeline-line::before {
    top: 0;
    left: 22px;
    width: 9px;
    height: 100%;
    background:
      radial-gradient(circle at center 7px, #0f8c82 0 5px, transparent 6px),
      repeating-linear-gradient(180deg, var(--accent) 0 18px, #82d5bb 18px 30px);
  }

  .timeline-line::after {
    top: auto;
    right: auto;
    bottom: -8px;
    left: 10px;
    transform: rotate(90deg);
  }

  .timeline-line span {
    margin-top: 6px;
    margin-left: 28px;
  }

  .timeline-line small {
    margin-left: 38px;
  }

  .flight-row {
    grid-template-columns: 1fr;
  }

  .flight-row-price {
    justify-self: start;
  }
}

/* Result card readability refinements */
.timeline-line {
  display: grid;
  place-items: center;
  align-self: stretch;
  min-height: 112px;
  padding: 0 8px;
}

.timeline-line::before {
  top: 42px;
  left: 8px;
  right: 30px;
  width: auto;
}

.timeline-line::after {
  top: 29px;
  right: -2px;
  left: auto;
}

.timeline-route-meta {
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 5px;
  margin-top: 50px;
  padding: 7px 14px 8px;
  border: 2px solid rgba(216, 202, 168, 0.9);
  border-radius: 21px 18px 23px 19px / 18px 23px 19px 21px;
  background: rgba(255, 252, 239, 0.96);
  box-shadow: 0 4px 0 rgba(212, 201, 180, 0.72);
  text-align: center;
}

.timeline-line .timeline-route-kind {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  margin: 0;
  padding: 2px 11px 3px;
  border: 0;
  border-radius: 999px;
  background: #f3e3bd;
  box-shadow: none;
  color: var(--heading);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.timeline-route-meta small {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.15;
}

.flight-row {
  grid-template-columns: 78px minmax(0, 1fr) minmax(126px, max-content);
  align-items: center;
  gap: 14px;
  overflow: hidden;
}

.flight-row-logo {
  display: grid;
  justify-items: center;
  width: 70px;
  min-width: 0;
}

.flight-row-logo .airline-logo {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 0;
  width: 100%;
  min-width: 0;
}

.flight-row-logo .airline-logo-mark,
.flight-row-logo .airline-logo.has-official-logo .airline-logo-mark {
  width: 70px;
  height: 46px;
  border-radius: 17px 14px 19px 15px / 15px 19px 14px 17px;
}

.flight-row-logo .airline-logo-image {
  max-width: 90%;
  max-height: 76%;
}

.flight-row-logo .airline-logo-text {
  display: none;
  max-width: 86px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.12;
  text-align: center;
}

.flight-row-main {
  display: grid;
  gap: 4px;
}

.flight-row-main strong {
  overflow: hidden;
  color: var(--heading);
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flight-row-time,
.flight-row-route {
  display: block;
  overflow: hidden;
  line-height: 1.32;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flight-row-time {
  color: var(--heading);
  font-size: 13px;
  font-weight: 900;
}

.flight-row-route {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.flight-row-price {
  align-self: center;
  min-width: 116px;
  text-align: right;
}

@media (max-width: 760px) {
  .timeline-line {
    min-height: 86px;
    place-items: center start;
    padding-left: 16px;
  }

  .timeline-line::before {
    top: 0;
    left: 22px;
    right: auto;
    width: 9px;
    height: 100%;
  }

  .timeline-line::after {
    top: auto;
    right: auto;
    bottom: -8px;
    left: 10px;
  }

  .timeline-route-meta {
    justify-items: start;
    margin-top: 0;
    margin-left: 34px;
    padding: 7px 12px 8px;
    text-align: left;
  }

  .timeline-line .timeline-route-kind,
  .timeline-route-meta small {
    margin: 0;
  }

  .flight-row {
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 10px;
  }

  .flight-row-logo {
    justify-self: start;
    width: 66px;
  }

  .flight-row-logo .airline-logo-mark,
  .flight-row-logo .airline-logo.has-official-logo .airline-logo-mark {
    width: 60px;
    height: 40px;
  }

  .flight-row-logo .airline-logo-text {
    display: none;
  }

  .flight-row-price {
    grid-column: 2;
    justify-self: start;
    min-width: 0;
    text-align: left;
  }
}

/* Roundtrip segment display */
.result-flight-summary.roundtrip-summary {
  grid-template-columns: minmax(220px, 0.24fr) minmax(0, 1fr);
  min-height: 0;
}

.roundtrip-itinerary {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.trip-segment {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 2px solid rgba(216, 202, 168, 0.88);
  border-radius: 26px 22px 28px 24px / 24px 28px 22px 26px;
  background: rgba(255, 252, 239, 0.92);
  box-shadow: 0 4px 0 rgba(212, 201, 180, 0.68);
}

.trip-segment:nth-child(1) {
  border-top: 7px solid var(--green);
}

.trip-segment:nth-child(2) {
  border-top: 7px solid var(--blue);
}

.trip-segment.missing {
  border-style: dashed;
  border-top-color: var(--amber);
  background: rgba(255, 245, 196, 0.72);
}

.trip-segment-head {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 2px dashed rgba(216, 202, 168, 0.8);
  border-radius: 20px;
}

.trip-segment-head strong {
  overflow: hidden;
  color: var(--heading);
  font-size: clamp(19px, 1.55vw, 25px);
  font-weight: 900;
  line-height: 1.16;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trip-segment-head small {
  color: var(--muted);
  font-weight: 900;
  white-space: nowrap;
}

.trip-segment-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 12px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 3px 0 rgba(15, 140, 130, 0.25);
  color: #fffdf4;
  font-size: 13px;
  font-weight: 900;
}

.trip-segment:nth-child(2) .trip-segment-label {
  background: #4899d6;
}

.trip-segment-body {
  display: grid;
  grid-template-columns: minmax(118px, 0.18fr) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.segment-airline-block {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  min-height: 104px;
  padding: 10px;
  border-right: 2px dashed rgba(216, 202, 168, 0.82);
}

.segment-airline-block .airline-logo {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
}

.segment-airline-block .airline-logo-mark,
.segment-airline-block .airline-logo.has-official-logo .airline-logo-mark {
  width: 86px;
  height: 54px;
  border-radius: 18px 15px 20px 16px / 16px 20px 15px 18px;
}

.segment-airline-block .airline-logo-text {
  display: none;
}

.segment-airline-block strong {
  color: var(--heading);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.18;
  text-align: center;
}

.segment-airline-block small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.segment-timeline {
  padding: 0;
}

.segment-timeline .time-node {
  min-height: 98px;
  padding: 12px;
}

.segment-timeline .time-node strong {
  font-size: clamp(24px, 2vw, 32px);
}

.segment-timeline .timeline-line {
  min-height: 98px;
}

.segment-timeline .timeline-line::before {
  top: 37px;
}

.segment-timeline .timeline-line::after {
  top: 24px;
}

.segment-timeline .timeline-route-meta {
  margin-top: 43px;
  padding: 6px 12px 7px;
}

.trip-segment-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.trip-segment-foot strong {
  color: var(--heading);
  white-space: nowrap;
}

.segment-missing-note {
  margin: 0;
  padding: 12px 14px;
  border: 2px solid rgba(255, 204, 0, 0.62);
  border-radius: 18px;
  background: #fff5c4;
  color: var(--heading);
  font-weight: 900;
}

.source-coverage {
  display: grid;
  gap: 10px;
}

.source-coverage h3 {
  width: max-content;
  max-width: 100%;
  margin: 0;
  padding: 5px 12px;
  border-radius: 999px;
  background: #e5f5ef;
  color: var(--heading);
  font-size: 13px;
  font-weight: 900;
}

.source-attempt-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.source-attempt {
  display: grid;
  gap: 5px;
  min-height: 86px;
  padding: 11px 12px;
  border: 2px solid rgba(216, 202, 168, 0.88);
  border-radius: 20px;
  background: rgba(247, 243, 223, 0.86);
  box-shadow: 0 3px 0 rgba(212, 201, 180, 0.66);
  color: inherit;
  text-decoration: none;
}

.source-attempt strong {
  overflow: hidden;
  color: var(--heading);
  font-size: 14px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-attempt span {
  width: max-content;
  max-width: 100%;
  padding: 2px 9px;
  border-radius: 999px;
  background: #fff5c4;
  color: var(--heading);
  font-size: 12px;
  font-weight: 900;
}

.source-attempt small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.28;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.result-flight-details {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1180px) {
  .result-flight-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .result-flight-summary.roundtrip-summary,
  .trip-segment-body,
  .source-attempt-grid {
    grid-template-columns: 1fr;
  }

  .segment-airline-block {
    justify-items: start;
    border-right: 0;
    border-bottom: 2px dashed rgba(216, 202, 168, 0.82);
  }
}

@media (max-width: 760px) {
  .trip-segment-head {
    grid-template-columns: 1fr;
  }

  .trip-segment-head strong {
    white-space: normal;
  }

  .trip-segment-foot {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-flight-details {
    grid-template-columns: 1fr;
  }
}

/* Compact result density pass */
body {
  letter-spacing: 0;
}

.topbar {
  min-height: 64px;
  margin: 8px clamp(10px, 1.6vw, 24px) 0;
  padding: 8px 14px;
  border-width: 2px;
  box-shadow: 0 5px 0 var(--sand-shadow), 0 12px 22px rgba(114, 93, 66, 0.12);
}

.eyebrow {
  min-height: 21px;
  margin-bottom: 2px;
  padding: 0 10px;
  font-size: 11px;
}

h1 {
  font-size: 26px;
  line-height: 1.1;
}

h2 {
  font-size: 17px;
}

.layout {
  width: min(1440px, 100%);
  padding: 14px clamp(12px, 2vw, 26px) 24px;
}

.results-layout {
  width: min(1380px, 100%);
}

.page-tabs {
  padding: 4px;
}

.page-tabs a {
  min-width: 68px;
  min-height: 32px;
  padding: 6px 10px;
}

.icon-button,
.command-button,
.mini-button,
.open-link,
.result-action {
  min-height: 38px;
  padding: 0 14px;
  box-shadow: 0 4px 0 var(--accent-deep);
}

.command-button.secondary,
.mini-button,
.open-link {
  box-shadow: 0 4px 0 var(--sand-shadow);
}

.status-pill,
.badge,
.tag {
  min-height: 25px;
  padding: 3px 9px;
  font-size: 12px;
}

.result-hero {
  grid-template-columns: minmax(320px, 0.92fr) minmax(480px, 1.08fr);
  gap: 12px;
}

.result-decision-card {
  min-height: 158px;
  padding: 18px 22px;
  box-shadow: 0 6px 0 #dba90e, 0 14px 24px rgba(114, 93, 66, 0.15);
}

.result-decision-card::after {
  right: 20px;
  bottom: 18px;
  width: 72px;
  height: 14px;
}

.result-decision-card strong {
  font-size: 50px;
  line-height: 1.02;
}

.result-stat-grid {
  gap: 10px;
}

.result-hero-stat {
  min-height: 158px;
  padding: 15px;
  border-radius: 24px 20px 27px 22px / 22px 27px 20px 24px;
}

.result-hero-stat::before {
  width: 42px;
  height: 9px;
}

.result-hero-stat strong {
  font-size: 29px;
  line-height: 1.08;
}

.results-grid {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.31fr);
  gap: 14px;
  margin-top: 14px;
}

.result-side {
  gap: 12px;
}

.flight-result-list,
.result-history-list,
.requirement-spec {
  gap: 12px;
  padding: 14px;
}

.result-flight-card {
  gap: 14px;
  padding: 18px;
}

.result-flight-card::before {
  height: 9px;
}

.result-flight-top {
  padding: 10px 12px;
  border-radius: 20px;
}

.result-flight-top strong {
  font-size: 23px;
  line-height: 1.12;
}

.result-flight-summary.roundtrip-summary {
  grid-template-columns: minmax(168px, 0.2fr) minmax(0, 1fr);
  border-width: 2px;
  border-radius: 24px;
}

.result-price-box {
  min-height: 0;
  padding: 16px 18px;
}

.result-price-box strong {
  font-size: 38px;
  line-height: 1.05;
}

.roundtrip-itinerary {
  gap: 10px;
  padding: 12px;
}

.trip-segment {
  gap: 8px;
  padding: 10px;
  border-radius: 22px 18px 24px 20px / 20px 24px 18px 22px;
  box-shadow: 0 3px 0 rgba(212, 201, 180, 0.68);
}

.trip-segment:nth-child(1),
.trip-segment:nth-child(2) {
  border-top-width: 5px;
}

.trip-segment-head {
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 16px;
}

.trip-segment-head strong {
  font-size: 22px;
  line-height: 1.12;
}

.trip-segment-head small {
  font-size: 12px;
}

.trip-segment-label {
  min-height: 24px;
  padding: 2px 10px;
  font-size: 12px;
}

.trip-segment-body {
  grid-template-columns: minmax(112px, 0.16fr) minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}

.segment-airline-block {
  gap: 4px;
  min-height: 84px;
  padding: 8px;
}

.segment-airline-block .airline-logo-mark,
.segment-airline-block .airline-logo.has-official-logo .airline-logo-mark {
  width: 72px;
  height: 44px;
  border-radius: 16px 13px 18px 14px / 14px 18px 13px 16px;
}

.segment-airline-block strong {
  font-size: 13px;
  white-space: nowrap;
}

.segment-airline-block small {
  font-size: 11px;
}

.segment-timeline {
  grid-template-columns: minmax(104px, 0.22fr) minmax(130px, 1fr) minmax(104px, 0.22fr);
  gap: 10px;
  min-width: 0;
}

.segment-timeline .time-node {
  min-width: 0;
  min-height: 82px;
  padding: 9px 10px;
  border-radius: 18px;
}

.segment-timeline .time-node.right {
  justify-items: center;
  text-align: center;
}

.time-value,
.segment-timeline .time-node strong {
  font-size: 26px;
  line-height: 1;
  white-space: nowrap;
}

.time-value .day-offset {
  display: inline-block;
  margin-left: 1px;
  color: var(--heading);
  font-size: 0.54em;
  transform: translateY(-0.28em);
}

.time-node span,
.time-node small {
  line-height: 1.18;
}

.segment-timeline .timeline-line {
  min-height: 82px;
  padding: 0 4px;
}

.segment-timeline .timeline-line::before {
  top: 30px;
  left: 4px;
  right: 24px;
  height: 8px;
}

.segment-timeline .timeline-line::after {
  top: 18px;
  right: -1px;
  font-size: 24px;
}

.segment-timeline .timeline-route-meta {
  margin-top: 34px;
  padding: 5px 10px 6px;
  border-radius: 17px 14px 19px 15px / 15px 19px 14px 17px;
}

.timeline-line .timeline-route-kind {
  min-height: 20px;
  padding: 2px 9px;
  font-size: 12px;
}

.timeline-route-meta small {
  font-size: 12px;
}

.trip-segment-foot {
  gap: 8px;
  padding: 5px 8px 0;
  font-size: 12px;
}

.result-flight-details {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.detail-chip {
  min-height: 54px;
  padding: 8px 10px;
  border-radius: 16px;
}

.detail-chip strong {
  font-size: 13px;
  line-height: 1.25;
}

.source-coverage {
  gap: 8px;
}

.source-attempt-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.source-attempt {
  gap: 4px;
  min-height: 72px;
  padding: 9px 10px;
  border-radius: 16px;
  box-shadow: 0 3px 0 rgba(212, 201, 180, 0.66);
}

.source-attempt strong {
  font-size: 13px;
}

.source-attempt span {
  padding: 2px 8px;
  font-size: 11px;
}

.source-attempt small {
  font-size: 11px;
  line-height: 1.24;
}

.result-message {
  padding: 10px 12px;
  border-left-width: 6px;
  border-radius: 18px;
  font-size: 14px;
}

.direct-flight-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.flight-group {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.direct-flight-list h3 {
  padding: 4px 10px;
  font-size: 12px;
}

.flight-row {
  grid-template-columns: 64px minmax(0, 1fr) minmax(104px, max-content);
  gap: 10px;
  padding: 10px 12px;
  border-radius: 18px;
}

.flight-row-logo {
  width: 64px;
}

.flight-row-logo .airline-logo-mark,
.flight-row-logo .airline-logo.has-official-logo .airline-logo-mark {
  width: 56px;
  height: 38px;
  border-radius: 15px 12px 17px 13px / 13px 17px 12px 15px;
}

.flight-row-main strong,
.flight-row-price {
  font-size: 15px;
  line-height: 1.16;
}

.flight-row-time {
  font-size: 12px;
}

.flight-row-route {
  font-size: 11px;
}

.condition-row {
  grid-template-columns: 26px minmax(86px, 0.34fr) minmax(0, 1fr);
  gap: 10px;
  min-height: 56px;
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 18px;
}

.condition-mark {
  width: 24px;
  height: 24px;
}

.condition-row strong {
  font-size: 13px;
}

.condition-row small {
  font-size: 12px;
  line-height: 1.28;
}

.result-history-row {
  padding: 10px 12px;
  border-radius: 18px;
}

@media (max-width: 1180px) {
  .result-hero,
  .results-grid {
    grid-template-columns: 1fr;
  }

  .source-attempt-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .result-flight-summary.roundtrip-summary,
  .trip-segment-body,
  .direct-flight-list {
    grid-template-columns: 1fr;
  }

  .result-price-box {
    border-right: 0;
    border-bottom: 2px dashed var(--border);
  }
}

/* Flight mark fixes: lightweight route arrows and official logos */
.timeline-line::after {
  content: "";
  width: 13px;
  height: 13px;
  border: solid var(--accent-deep);
  border-width: 4px 4px 0 0;
  border-radius: 1px;
  background: transparent;
  box-shadow: none;
  color: transparent;
  font-size: 0;
  line-height: 0;
  transform: rotate(45deg);
}

.segment-timeline .timeline-line::before {
  right: 16px;
}

.segment-timeline .timeline-line::after {
  top: 27px;
  right: 7px;
}

.airline-logo.airchina.has-official-logo .airline-logo-mark,
.airline-logo.airline-ca.has-official-logo .airline-logo-mark {
  aspect-ratio: auto;
  width: 84px;
  height: 40px;
}

.airline-logo.airchina .airline-logo-image,
.airline-logo.airline-ca .airline-logo-image {
  max-width: 94%;
  max-height: 86%;
}

.segment-airline-block .airline-logo.airchina.has-official-logo .airline-logo-mark,
.segment-airline-block .airline-logo.airline-ca.has-official-logo .airline-logo-mark {
  width: 84px;
  height: 40px;
}

.flight-row-logo .airline-logo.airchina.has-official-logo .airline-logo-mark,
.flight-row-logo .airline-logo.airline-ca.has-official-logo .airline-logo-mark {
  width: 64px;
  height: 36px;
}
