:root {
  --bg: #14181c;          /* letterboxd charcoal */
  --bg-2: #1c2228;
  --panel: #1f262d;
  --panel-2: #273039;
  --line: #2c353d;
  --text: #e8edf1;
  --muted: #9ab;
  --muted-2: #6b7a87;
  --yelp: #d32323;        /* yelp red */
  --green: #00e054;       /* letterboxd green */
  --orange: #ff8000;      /* letterboxd orange */
  --blue: #40bcf4;        /* letterboxd blue */
  --radius: 14px;
  --shadow: 0 8px 30px rgba(0,0,0,.35);
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 80% -10%, #20303a 0%, var(--bg) 55%) no-repeat var(--bg);
  color: var(--text);
  font-family: "Helvetica Neue", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: min(960px, 92vw); margin: 0 auto; }

/* ---------- Header ---------- */
.topbar { padding: 28px 0 8px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 2.1rem; letter-spacing: -.5px;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-yelp { color: var(--yelp); }
.brand-boxd { color: var(--text); }
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 13px; height: 13px; border-radius: 50%; display: block; }
.dots i:nth-child(1){ background: var(--green); }
.dots i:nth-child(2){ background: var(--blue); }
.dots i:nth-child(3){ background: var(--orange); }
.tagline { color: var(--muted); margin: 6px 0 0; font-size: 1.02rem; }

/* ---------- Panel / controls ---------- */
.panel {
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-top: 18px;
}
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-2); font-weight: 700; }
.field-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 680px){ .field-row { grid-template-columns: 1fr 1fr; } }

input, select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: .98rem;
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(64,188,244,.18);
}
select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%239ab'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 30px;
}

.location-row { display: flex; gap: 10px; }
.location-row input { flex: 1; }

.suggestions {
  list-style: none; margin: 6px 0 0; padding: 6px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 10px; position: relative; z-index: 5;
}
.suggestions li { padding: 9px 10px; border-radius: 7px; cursor: pointer; font-size: .92rem; color: var(--muted); }
.suggestions li:hover, .suggestions li.active { background: var(--bg); color: var(--text); }

.lb-field .opt { color: var(--muted-2); font-weight: 400; text-transform: none; letter-spacing: 0; }
.lb-row { display: flex; align-items: center; gap: 8px; }
.lb-at { color: var(--orange); font-weight: 800; font-size: 1.05rem; }
.lb-row input { flex: 1; }
.lb-status { font-size: .85rem; color: var(--muted); white-space: nowrap; }
.lb-status.ok { color: var(--green); }
.lb-status.err { color: #ff8b8b; }
.lb-filters { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; }
.lb-filters .chk { display: inline-flex; align-items: center; gap: 7px; font-size: .9rem; color: var(--muted); cursor: pointer; }
.lb-filters .chk input { width: auto; accent-color: var(--orange); cursor: pointer; }

.loc-status { margin: 8px 0 0; font-size: .85rem; color: var(--muted); min-height: 1em; }
.loc-status.ok { color: var(--green); }
.loc-status.err { color: #ff6b6b; }

/* ---------- Buttons ---------- */
.btn {
  font: inherit; font-weight: 700; cursor: pointer;
  border-radius: 10px; padding: 11px 16px; border: 1px solid transparent;
  transition: transform .06s, background .15s, opacity .15s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--panel-2); color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--bg); }
.btn.primary {
  width: 100%; margin-top: 6px; font-size: 1.05rem; padding: 14px;
  background: linear-gradient(90deg, var(--yelp), #ff5252);
  color: #fff; border: none; letter-spacing: .02em;
}
.btn.primary:hover { filter: brightness(1.07); }
.btn.primary:disabled { opacity: .45; cursor: not-allowed; filter: none; }

/* ---------- Status ---------- */
.status { margin: 22px 0 0; }
.status .msg { color: var(--muted); display: flex; align-items: center; gap: 12px; }
.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--green);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.status .err-box {
  background: rgba(211,35,35,.1); border: 1px solid rgba(211,35,35,.4);
  color: #ffb3b3; padding: 14px 16px; border-radius: 10px;
}

/* ---------- Results ---------- */
.results { margin: 20px 0 60px; display: grid; gap: 18px; }
.results-head { margin: 26px 0 2px; font-size: 1.35rem; font-weight: 800; }
.results-head small { color: var(--muted); font-weight: 500; font-size: .95rem; display: block; margin-top: 2px; }

.plan {
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  animation: rise .35s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

.plan-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  background: rgba(0,0,0,.15);
}
.plan-title { font-weight: 800; font-size: 1.08rem; }
.plan-badge {
  font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  padding: 4px 9px; border-radius: 999px;
}
.badge-best { background: rgba(0,224,84,.15); color: var(--green); border: 1px solid rgba(0,224,84,.4); }
.badge-walk { background: rgba(64,188,244,.13); color: var(--blue); border: 1px solid rgba(64,188,244,.35); }
.badge-soon { background: rgba(255,128,0,.13); color: var(--orange); border: 1px solid rgba(255,128,0,.35); }

.timeline { display: grid; grid-template-columns: 1fr; }
.leg { display: grid; grid-template-columns: 64px 1fr; gap: 14px; padding: 16px 18px; }
.leg + .leg { border-top: 1px dashed var(--line); }
.leg.transit { padding: 8px 18px; color: var(--muted); font-size: .9rem; grid-template-columns: 64px 1fr; align-items: center; }
.leg-time { font-weight: 800; font-size: 1rem; color: var(--text); text-align: right; }
.leg-time small { display: block; color: var(--muted-2); font-weight: 600; font-size: .72rem; }

.poster {
  width: 56px; height: 84px; border-radius: 8px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 1.7rem;
  box-shadow: 0 4px 12px rgba(0,0,0,.35);
}
.spot-icon {
  width: 56px; height: 56px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
  background: var(--panel-2); border: 1px solid var(--line);
  background-size: cover; background-position: center;
  transition: box-shadow .2s;
}
.spot-icon.has-photo { border-color: transparent; box-shadow: 0 4px 12px rgba(0,0,0,.35); }
.leg-body { min-width: 0; }
.leg-where { display: flex; gap: 12px; align-items: flex-start; }
.leg-name { font-weight: 700; font-size: 1.04rem; }
.leg-name a { color: var(--text); }
.leg-meta { color: var(--muted); font-size: .9rem; margin-top: 2px; }
.leg-tags { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: .76rem; color: var(--muted); background: var(--bg); border: 1px solid var(--line); padding: 3px 8px; border-radius: 999px; }
.tag.open { color: var(--green); border-color: rgba(0,224,84,.35); }
.tag.closed { color: #ff8b8b; border-color: rgba(255,107,107,.35); }
.tag.live { color: var(--green); border-color: rgba(0,224,84,.4); font-weight: 700; }
.tag.fmt { color: var(--blue); border-color: rgba(64,188,244,.35); font-weight: 700; letter-spacing: .03em; }
.tag.taste { color: var(--orange); border-color: rgba(255,128,0,.4); font-weight: 700; }
.tag.watchlist { color: #14181c; background: var(--orange); border-color: var(--orange); font-weight: 800; }
.tag.seen { color: var(--muted-2); border-color: var(--line); }
.tag a { color: inherit; }
.poster.poster-img { overflow: hidden; padding: 0; }
.poster.poster-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.stars { color: var(--orange); letter-spacing: 1px; }

.transit-line { display: flex; align-items: center; gap: 8px; }
.transit-line .rule { flex: 1; height: 1px; background: repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 12px); }

.plan-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: .9rem; background: rgba(0,0,0,.12); }
.plan-foot b { color: var(--text); }

.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.empty h3 { color: var(--text); margin: 0 0 6px; }

.footer { color: var(--muted-2); font-size: .82rem; padding: 30px 0; border-top: 1px solid var(--line); margin-top: 20px; }
.footer a { color: var(--muted); }
