/* ============================================================
   THE FLIGHT — homepage watchlist
   Coffee & Trades · scoped to #ct-watchlist
   ============================================================ */

#ct-watchlist {
  font-family: 'DM Sans', sans-serif;
  color: var(--ink);
  margin: 36px 0 0;
}

#ct-watchlist * { box-sizing: border-box; }

#ct-watchlist .wl-sr {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

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

#ct-watchlist .wl-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 9px; margin-bottom: 0;
}

#ct-watchlist .wl-title {
  font-family: 'DM Mono', monospace;
  font-size: 9.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink);
}

#ct-watchlist .wl-status {
  font-family: 'DM Mono', monospace;
  font-size: 9.5px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink3);
  margin-left: auto;
}

#ct-watchlist .wl-status::before {
  content: ''; display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--rule2); margin-right: 5px; vertical-align: 1px;
}

#ct-watchlist .wl-status.live::before {
  background: var(--green);
  box-shadow: 0 0 0 2px rgba(26,92,52,.15);
  animation: wlPulse 2s infinite;
}

@keyframes wlPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(26,92,52,.15); }
  50% { box-shadow: 0 0 0 5px rgba(26,92,52,0); }
}

/* ---------- flight picker ---------- */

#ct-watchlist .wl-pick { position: relative; }

#ct-watchlist .wl-pick-btn {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--white); border: 1px solid var(--rule);
  border-radius: 5px; padding: 6px 11px; cursor: pointer;
  font-family: 'DM Sans', sans-serif; font-size: 12.5px;
  color: var(--ink); transition: border-color .14s;
}

#ct-watchlist .wl-pick-btn:hover { border-color: var(--ink2); }
#ct-watchlist .wl-pick-btn .wl-caret { font-size: 9px; color: var(--ink3); }
#ct-watchlist .wl-pick-count {
  font-family: 'DM Mono', monospace; font-size: 9.5px; color: var(--ink3);
}

#ct-watchlist .wl-menu {
  position: absolute; top: calc(100% + 5px); left: 0;
  background: var(--white); border: 1px solid var(--rule);
  border-radius: 6px; box-shadow: 0 12px 34px rgba(20,18,16,.13);
  min-width: 220px; z-index: 60; padding: 5px; display: none;
}

#ct-watchlist .wl-pick.open .wl-menu { display: block; }

#ct-watchlist .wl-menu-item {
  display: flex; align-items: baseline; gap: 9px;
  padding: 8px 10px; border-radius: 4px; cursor: pointer;
  font-size: 12.5px; color: var(--ink); transition: background .1s;
}

#ct-watchlist .wl-menu-item:hover { background: var(--paper2); }
#ct-watchlist .wl-menu-item[aria-selected="true"] { background: var(--paper2); }
#ct-watchlist .wl-menu-item[aria-selected="true"] .wl-menu-name::after {
  content: ' \2713'; color: var(--gold);
}
#ct-watchlist .wl-menu-name { flex: 1; }
#ct-watchlist .wl-menu-n {
  font-family: 'DM Mono', monospace; font-size: 9.5px; color: var(--ink3);
}
#ct-watchlist .wl-menu-note {
  font-family: 'DM Mono', monospace;
  font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--amber);
}

/* ---------- table ---------- */

#ct-watchlist .wl-table { width: 100%; border-collapse: collapse; }

#ct-watchlist .wl-table th {
  font-family: 'DM Mono', monospace;
  font-size: 9px; font-weight: 500; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink3);
  padding: 10px 10px; text-align: left;
  border-bottom: 1px solid var(--rule2);
  cursor: pointer; user-select: none; white-space: nowrap;
}

#ct-watchlist .wl-table th:hover { color: var(--ink); }
#ct-watchlist .wl-table th.num { text-align: right; }
#ct-watchlist .wl-table th.sorted { color: var(--ink); }
#ct-watchlist .wl-table th .wl-arrow { color: var(--gold); margin-left: 3px; font-size: 8px; }

#ct-watchlist .wl-table td {
  padding: 9px 10px; font-size: 13px;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}

#ct-watchlist .wl-table tbody tr { cursor: pointer; transition: background .1s; }
#ct-watchlist .wl-table tbody tr:hover td { background: var(--paper2); }
#ct-watchlist .wl-table tbody tr:last-child td { border-bottom: none; }

#ct-watchlist .wl-sym {
  font-family: 'DM Mono', monospace; font-size: 12.5px;
  font-weight: 500; color: var(--ink); white-space: nowrap;
}

#ct-watchlist .wl-name {
  font-size: 12px; color: var(--ink3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 260px;
}

#ct-watchlist .wl-num {
  font-family: 'DM Mono', monospace; font-size: 12.5px;
  text-align: right; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

#ct-watchlist .wl-num.up { color: var(--green); }
#ct-watchlist .wl-num.dn { color: var(--red); }
#ct-watchlist .wl-num.flat { color: var(--ink3); }
#ct-watchlist .wl-pct { font-weight: 500; }
#ct-watchlist .wl-trace { width: 74px; text-align: right; }
#ct-watchlist .wl-trace svg { display: inline-block; vertical-align: middle; }

#ct-watchlist tr.flash-up td { animation: wlFlashUp .8s ease-out; }
#ct-watchlist tr.flash-dn td { animation: wlFlashDn .8s ease-out; }
@keyframes wlFlashUp { 0%,28% { background: rgba(26,92,52,.11); } 100% { background: transparent; } }
@keyframes wlFlashDn { 0%,28% { background: rgba(158,32,32,.11); } 100% { background: transparent; } }

/* ---------- footer + empty ---------- */

#ct-watchlist .wl-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding-top: 11px; margin-top: 2px;
  border-top: 1px solid var(--rule2);
  font-family: 'DM Mono', monospace; font-size: 9.5px;
  letter-spacing: .06em; color: var(--ink3);
}

#ct-watchlist .wl-breadth b { color: var(--ink); font-weight: 400; }

#ct-watchlist .wl-empty {
  padding: 34px 10px; text-align: center;
  font-size: 13px; font-style: italic; color: var(--ink3);
}

/* ---------- locked flight ---------- */

#ct-watchlist .wl-locked {
  position: relative; padding: 40px 20px; text-align: center;
  border: 1px dashed var(--rule); border-radius: 6px; margin-top: 14px;
}

#ct-watchlist .wl-locked-tag {
  font-family: 'DM Mono', monospace; font-size: 9px;
  letter-spacing: .14em; color: var(--amber); margin-bottom: 8px;
}

#ct-watchlist .wl-locked-copy {
  font-size: 13px; color: var(--ink2); margin-bottom: 14px;
}

#ct-watchlist .wl-locked-btn {
  background: var(--gold); color: var(--ink); border: 0;
  font-family: 'DM Sans', sans-serif; font-size: 12.5px; font-weight: 500;
  padding: 8px 18px; border-radius: 5px; cursor: pointer;
}

#ct-watchlist .wl-locked-btn:hover { filter: brightness(1.06); }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  #ct-watchlist .wl-name, #ct-watchlist th.col-name { display: none; }
  #ct-watchlist .wl-trace, #ct-watchlist th.col-trace { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  #ct-watchlist * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
