:root {
  --bg: #0f172a;
  --card: #111827;
  --muted: #94a3b8;
  --text: #f8fafc;
  --line: #273449;
  --chip: #1e293b;
  --green: #22c55e;
  --orange: #f59e0b;
  --red: #ef4444;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, system-ui, sans-serif; background: var(--bg); color: var(--text); }
.app-shell { max-width: 540px; margin: 0 auto; padding: 12px; }
.app-header { text-align: center; padding: 10px 8px 14px; }
.app-header h1 { margin: 0; font-size: 26px; }
.app-header p { margin: 6px 0 0; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.search-form { display: grid; grid-template-columns: 1fr; gap: 10px; align-items: end; }
.field-group label { display:block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }

.field-group { position: relative; }
.field-group input { width:100%; padding: 11px 10px; border-radius: 10px; border:1px solid var(--line); background:#0b1220; color:var(--text); font-size: 16px; }
.field-group input:focus { outline: none; border-color: #38bdf8; box-shadow: 0 0 0 2px rgba(56,189,248,.2); }
.suggestion-box { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30; background: #0b1220; border: 1px solid var(--line); border-radius: 12px; max-height: 220px; overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.suggestion-item { width:100%; border:0; border-bottom:1px solid rgba(39,52,73,.6); background:transparent; color:#fff; text-align:left; padding:10px 12px; display:flex; justify-content:space-between; align-items:center; font-size:14px; cursor:pointer; }
.suggestion-item:last-child { border-bottom: 0; }
.suggestion-item:hover, .suggestion-item.active { background: rgba(30,41,59,.9); }
.suggestion-item small { color: var(--muted); margin-left: 8px; }

.field-group select, .hidden-date-input, .filter-row select, .filter-row input { width:100%; padding: 11px 10px; border-radius: 10px; border:1px solid var(--line); background:#0b1220; color:var(--text); font-size: 16px; }
.center-icon-wrap { display:flex; align-items:center; justify-content:center; }
.swap-btn { width: 44px; height: 44px; border-radius: 999px; border: 1px solid #334155; background: var(--chip); color: var(--text); }
.search-btn { grid-column: 1/-1; padding: 12px; font-size: 20px; font-weight: 700; border:0; border-radius: 12px; color: #fff; background: #16a34a; }
.history-wrap { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.section-title { font-size: 15px; margin-bottom: 8px; color: var(--muted); }
.history-item { width:100%; background:#0b1220; border:1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 8px; display:flex; justify-content:space-between; font-size: 14px; color:#fff; appearance:none; text-align:left; }
.filter-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 10px; align-items: center; }
.results-top { border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 8px; }
.route-line { font-weight: 700; font-size: 18px; }
.count-line { color: var(--muted); font-size: 13px; }
.result-item { background:#0b1220; border:1px solid var(--line); border-radius:12px; padding:10px; margin-bottom:8px; }
.item-top { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.bus-name { font-size: 18px; font-weight: 700; }
.bus-time { font-size: 30px; font-weight: 800; }
.meta { color: var(--muted); font-size: 14px; margin: 6px 0; }

.journey-line { display:flex; align-items:center; justify-content:space-between; gap:10px; margin: 8px 0 10px; color:#cbd5e1; font-size:14px; }
.journey-city { font-weight: 600; max-width: 35%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.journey-duration { position: relative; flex:1; text-align:center; color: var(--muted); font-weight:700; }
.journey-duration::before, .journey-duration::after { content:""; position:absolute; top:50%; width:32%; height:1px; background:var(--line); }
.journey-duration::before { left:0; }
.journey-duration::after { right:0; }
.duration-line { display:flex; align-items:center; justify-content:center; color:var(--muted); font-size:14px; margin:10px 0; width:100%; }
.duration-line::before, .duration-line::after { content:\"\"; height:1px; background:var(--line); flex:1; }
.duration-line span { padding: 0 14px; color:#cbd5e1; font-weight:700; text-align:center; }
.badge { display:inline-block; font-size: 12px; border-radius: 999px; padding: 4px 10px; font-weight: 700; }
.badge-upcoming { background: rgba(34,197,94,.18); color: var(--green); }
.badge-soon { background: rgba(245,158,11,.2); color: var(--orange); }
.badge-departure { background: rgba(239,68,68,.2); color: var(--red); }
.placeholder { color: var(--muted); text-align:center; padding: 24px; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.7); display:flex; align-items:center; justify-content:center; padding:16px; }
.modal-box { width: 100%; max-width: 420px; background: #0b1220; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.modal-actions { display:flex; gap:8px; margin-top:14px; }
.btn-light, .btn-dark { flex:1; padding: 10px; border-radius: 10px; text-decoration:none; text-align:center; }
.btn-light { background: #1f2937; color: #fff; border: 0; }
.btn-dark { background: #16a34a; color: #fff; }
.hidden { display: none; }
