:root {
  --teal: #006879; --teal-lite: #55d6f4; --amber: #8a5d00;
  --bg: #0f1416; --surface: #172227; --surface2: #1f2d33;
  --text: #dee3e6; --muted: #93a3a9; --line: #2b3a40;
  --green: #1e7a50; --red: #c43b3b;
  --maxw: 720px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; } /* beats .field.half's inline-block */
html, body { margin: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 16px; }
a { color: var(--teal-lite); }
h3 { margin: 22px 0 8px; font-size: 15px; }

/* textured backdrop behind the centered app — fills the side gutters on wide screens */
body::before { content: ""; position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(1100px 520px at 50% -8%, rgba(0,104,121,.45), transparent 60%),
    radial-gradient(760px 480px at 8% 100%, rgba(85,214,244,.12), transparent 55%),
    radial-gradient(760px 480px at 92% 30%, rgba(138,93,0,.10), transparent 55%),
    var(--bg); }
body::after { content: ""; position: fixed; inset: 0; z-index: -2;
  background: url(img/worldmap.jpg) center/cover; opacity: .045; filter: grayscale(1) brightness(1.4); }

/* dashed flight-path art in the side gutters (desktop only) */
.sidedeco { position: fixed; top: 0; bottom: 0; width: 240px; z-index: -1; pointer-events: none; display: none;
  opacity: .5; background-repeat: no-repeat; background-position: center; background-size: 200px auto;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='820' viewBox='0 0 200 820'%3E%3Cpath d='M46 24 Q 176 210 66 410 Q -34 610 128 800' fill='none' stroke='%2355d6f4' stroke-width='2.5' stroke-dasharray='1 12' stroke-linecap='round'/%3E%3Ccircle cx='46' cy='24' r='6' fill='%2355d6f4'/%3E%3Ccircle cx='66' cy='410' r='6' fill='%2355d6f4'/%3E%3Ccircle cx='128' cy='800' r='6' fill='%2355d6f4'/%3E%3Ctext x='40' y='230' font-size='30'%3E%E2%9C%88%3C/text%3E%3C/svg%3E"); }
.sidedeco.left { left: 0; }
.sidedeco.right { right: 0; transform: scaleX(-1); }

#app { max-width: var(--maxw); margin: 0 auto; position: relative;
  background: rgba(15,20,22,.55); box-shadow: 0 0 90px rgba(0,0,0,.4); }
@media (min-width: 1040px) { .sidedeco { display: block; } }
.screen { animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.pad { padding: 16px; }

/* hero */
.hero { position: relative; height: 168px; max-width: var(--maxw); margin: 0 auto;
  background: linear-gradient(180deg, rgba(0,40,50,.15), rgba(0,20,28,.75)), url(img/hero.jpg) center/cover;
  border-radius: 0 0 24px 24px; display: flex; align-items: flex-end; }
.hero-inner { padding: 20px; }
.hero h1 { margin: 0; font-size: 30px; font-weight: 800; color: #fff; }
.hero p { margin: 2px 0 0; font-size: 13px; color: #e3f2f5; }

/* fields */
.field { margin-top: 12px; }
.field.half { display: inline-block; width: calc(50% - 5px); }
.datefields .field.half:first-child { margin-right: 8px; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
input, .paxbtn { width: 100%; background: var(--surface); border: 1px solid var(--line);
  color: var(--text); padding: 12px; border-radius: 12px; font-size: 15px; }
input[type=date] { min-height: 46px; }
.hint { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* autocomplete */
.ac { position: relative; }
.ac-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px);
  background: var(--surface2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  max-height: 320px; overflow-y: auto; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.ac-list:empty { display: none; }
.ac-item { padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--line); }
.ac-item:last-child { border-bottom: 0; }
.ac-item:hover, .ac-item.sel { background: rgba(85,214,244,.12); }
.ac-item b { font-size: 15px; } .ac-item small { display: block; color: var(--muted); font-size: 11px; }

/* boards */
.boards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.board { position: relative; height: 92px; border: 0; border-radius: 16px; cursor: pointer;
  background-size: cover; background-position: center; overflow: hidden; }
.board::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(0,0,0,.8)); }
.board span { position: absolute; left: 10px; bottom: 8px; z-index: 2; color: #fff; font-weight: 700; font-size: 13px; }

/* chips */
.chips, .cabins { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: transparent; border: 1px solid var(--line); color: var(--text);
  padding: 8px 12px; border-radius: 999px; font-size: 13px; cursor: pointer; }
.chip.on { background: rgba(85,214,244,.16); border-color: var(--teal-lite); color: #fff; }

/* pax */
.paxbtn { text-align: left; cursor: pointer; }
.paxpanel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-top: 6px; }
.step { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; }
.step > div { display: flex; align-items: center; gap: 12px; }
.step button { width: 38px; height: 38px; border-radius: 10px; background: var(--surface2);
  border: 1px solid var(--line); color: var(--text); font-size: 18px; cursor: pointer; }
.step b { min-width: 18px; text-align: center; }
.cabins { margin-top: 10px; }

/* buttons */
.primary { width: 100%; margin-top: 18px; padding: 14px; border: 0; border-radius: 14px;
  background: var(--teal-lite); color: #003641; font-size: 16px; font-weight: 700; cursor: pointer; }
.primary.sm { width: auto; margin: 0; padding: 12px 18px; }
.ghost { background: transparent; border: 1px solid var(--line); color: var(--text);
  padding: 8px 12px; border-radius: 999px; font-size: 13px; cursor: pointer; }
.ghost.wide { width: 100%; margin-top: 12px; padding: 12px; }
code { background: rgba(85,214,244,.14); padding: 1px 5px; border-radius: 5px; font-size: 12px; }
.error { color: #ff9a9a; font-size: 13px; margin-top: 10px; }
.foot { font-size: 11px; color: var(--muted); margin-top: 18px; line-height: 1.5; }

/* bar */
.bar { position: relative; display: flex; align-items: center; gap: 8px; padding: 12px 10px;
  background: linear-gradient(180deg, rgba(0,40,50,.2), rgba(0,20,28,.7)), url(img/hero.jpg) center/cover; }
.bar b { color: #fff; font-size: 17px; } .bar .spacer { flex: 1; }
.back, [data-back-results] { background: transparent; border: 0; color: #fff; font-size: 15px; cursor: pointer; }

/* result cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 16px; margin: 12px 0; box-shadow: 0 3px 10px rgba(0,0,0,.25); }
.card .top { display: flex; align-items: center; gap: 10px; }
.price { font-size: 22px; font-weight: 800; color: var(--teal-lite); flex: 1; }
.route { font-size: 17px; font-weight: 600; margin-top: 4px; white-space: pre-line; }
.infochips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.badge { font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 8px; }
.badge.g { background: var(--green); color: #fff; } .badge.a { background: var(--amber); color: #fff; }
.badge.r { background: var(--red); color: #fff; }
.badge.chip2 { background: var(--surface2); color: var(--muted); }
.badge.self { background: #7a3b00; color: #ffd9b0; cursor: help; }
.deal { font-size: 12px; margin-top: 8px; font-weight: 600; }
.sub { font-size: 12px; color: var(--muted); margin-top: 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.actions button, .actions a { font-size: 14px; padding: 10px 14px; border-radius: 12px; text-decoration: none;
  cursor: pointer; border: 1px solid var(--line); background: transparent; color: var(--text); }
.actions .book { background: var(--teal-lite); color: #003641; border: 0; font-weight: 700; }
.actions .tonal { background: rgba(85,214,244,.16); border-color: var(--teal-lite); }
.linkrow { font-size: 12px; margin-top: 10px; color: var(--muted); }
.linkrow a { margin-right: 10px; }

/* watchlist */
.watchlist { margin-top: 18px; }
.watchrow { display: flex; align-items: center; gap: 10px; background: var(--surface2);
  border-radius: 12px; padding: 10px 12px; margin: 6px 0; }
.watchrow .grow { flex: 1; } .watchrow small { color: var(--muted); }
.watchrow .x { background: transparent; border: 0; color: var(--muted); cursor: pointer; font-size: 16px; }

/* guide */
.gsec { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin: 12px 0; }
.gsec h4 { margin: 0 0 8px; font-size: 15px; } .gsec li { margin: 3px 0; font-size: 14px; }
.gsec ul { margin: 0; padding-left: 18px; }
.wx { font-size: 14px; margin: 2px 0; }

/* map */
.mapwrap { position: relative; width: 100%; overflow: auto; background: #03121c; }
.mapwrap img { width: 100%; display: block; }
#mapPins { position: absolute; inset: 0; }
.pin { position: absolute; transform: translate(-50%, -100%); font-size: 11px; font-weight: 700;
  color: #fff; background: rgba(0,0,0,.55); padding: 2px 5px; border-radius: 8px; white-space: nowrap; cursor: pointer; }

/* chat */
.chatinput { display: flex; gap: 8px; padding: 12px; position: sticky; bottom: 0; background: var(--bg); }
.chatinput input { flex: 1; }
.msg { border-radius: 14px; padding: 12px; margin: 8px 0; font-size: 14px; }
.msg.you { background: rgba(0,104,121,.35); } .msg.bot { background: var(--surface2); }
.msg .who { font-size: 11px; color: var(--muted); font-weight: 700; }

/* toast + spinner */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #000d; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 50; font-size: 14px; }
.loading { text-align: center; color: var(--muted); padding: 30px 0; }
.spin { width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--teal-lite);
  border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 560px) { .boards { grid-template-columns: repeat(3, 1fr); } }
@media (prefers-color-scheme: light) {
  :root { --bg: #f6fafc; --surface: #fff; --surface2: #eef4f6; --text: #172227; --muted: #5a6b71; --line: #d6e2e6; }
  #app { background: rgba(246,250,252,.72); box-shadow: 0 0 90px rgba(0,60,72,.18); }
  body::after { opacity: .05; filter: grayscale(1) brightness(.9); }
}
