:root {
  --bg: #0b0b0f;
  --panel: #15151c;
  --panel-2: #1d1d26;
  --line: #2d2d38;
  --text: #f7f7fa;
  --muted: #a9a9b4;
  --accent: #ff3b30;
  --accent-soft: rgba(255, 59, 48, 0.15);
  --good: #4cd964;
  --warn: #ffcc00;
  --radius: 20px;
  --shadow: 0 18px 60px rgba(0,0,0,.35);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 100% -10%, rgba(255,59,48,.16), transparent 35%),
    var(--bg);
  color: var(--text);
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(86px + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(18px + env(safe-area-inset-top)) 18px 14px;
  background: linear-gradient(to bottom, rgba(11,11,15,.98), rgba(11,11,15,.86), transparent);
  backdrop-filter: blur(18px);
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 30px; letter-spacing: -.04em; }
h2 { margin-bottom: 4px; font-size: 24px; letter-spacing: -.03em; }
h3 { margin-bottom: 6px; }

.eyebrow {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .16em;
  font-weight: 800;
  margin-bottom: 4px;
}

.main-content { padding: 4px 16px 24px; }
.section { margin: 18px 0 24px; }
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.section-heading h2 { font-size: 18px; margin: 0; }
.section-heading button { color: var(--muted); }

.card {
  background: linear-gradient(155deg, rgba(29,29,38,.98), rgba(20,20,27,.98));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 20px;
  overflow: hidden;
  position: relative;
}
.hero-card::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  right: -55px;
  top: -60px;
  background: rgba(255,59,48,.18);
  filter: blur(2px);
}
.hero-city { font-size: 28px; font-weight: 800; letter-spacing: -.04em; margin: 2px 0 2px; }
.hero-date { color: var(--muted); margin-bottom: 18px; }
.hero-next {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: end;
}
.hero-next strong { font-size: 17px; display: block; margin-top: 3px; }
.countdown { color: var(--accent); font-weight: 900; font-size: 15px; text-align: right; }

.readiness {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}
.readiness-ring {
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--good) calc(var(--pct) * 1%), var(--panel-2) 0);
  position: relative;
  font-weight: 900;
}
.readiness-ring::before {
  content:"";
  position:absolute;
  inset:6px;
  border-radius:50%;
  background:var(--panel);
}
.readiness-ring span { position:relative; z-index:1; font-size:12px; }

.timeline { display: grid; gap: 10px; }
.timeline-item {
  display: grid;
  grid-template-columns: 58px 14px 1fr;
  gap: 10px;
  align-items: stretch;
}
.timeline-time {
  color: var(--muted);
  font-size: 12px;
  padding-top: 11px;
  text-align: right;
  white-space: nowrap;
}
.timeline-marker { position: relative; }
.timeline-marker::before {
  content:"";
  position:absolute;
  top:17px; left:4px;
  width:8px; height:8px;
  background:var(--accent);
  border-radius:50%;
  box-shadow:0 0 0 4px var(--accent-soft);
}
.timeline-marker::after {
  content:"";
  position:absolute;
  top:30px; bottom:-18px; left:7px;
  width:2px; background:var(--line);
}
.timeline-item:last-child .timeline-marker::after { display:none; }

.timeline-card {
  padding: 12px 13px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.timeline-card.missing { border-color: rgba(255,204,0,.55); }
.timeline-title-row {
  display:flex; align-items:flex-start; justify-content:space-between; gap:10px;
}
.timeline-card h3 { font-size: 15px; margin: 0 0 4px; }
.timeline-meta { color: var(--muted); font-size: 12px; line-height: 1.45; }
.timeline-actions { display:flex; flex-wrap:wrap; gap:7px; margin-top:10px; }

.chip, .action-chip {
  border-radius:999px;
  padding:7px 10px;
  font-size:11px;
  font-weight:800;
  border:1px solid var(--line);
  background:var(--panel-2);
  color:var(--text);
  text-decoration:none;
}
.chip.warn { background: rgba(255,204,0,.12); color: var(--warn); border-color: rgba(255,204,0,.35); }
.chip.good { background: rgba(76,217,100,.12); color: var(--good); border-color: rgba(76,217,100,.35); }

.icon-button {
  width:44px; height:44px; border-radius:50%;
  border:1px solid var(--line);
  background:var(--panel);
  color:var(--text);
  font-size:27px;
  line-height:1;
}
.icon-button.small { width:36px; height:36px; font-size:23px; }

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 760px);
  display:grid;
  grid-template-columns:repeat(5,1fr);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  border-top:1px solid var(--line);
  background:rgba(11,11,15,.94);
  backdrop-filter:blur(22px);
  z-index:20;
}
.nav-item {
  border:0;
  background:transparent;
  color:var(--muted);
  display:grid;
  gap:3px;
  place-items:center;
  font-size:10px;
  padding:4px 2px;
}
.nav-icon { font-size:19px; }
.nav-item.active { color:var(--text); }
.nav-item.active .nav-icon { color:var(--accent); }

.trip-card { display:grid; gap:12px; margin-bottom:12px; }
.trip-card-top { display:flex; justify-content:space-between; gap:12px; }
.trip-route { font-size:21px; font-weight:900; letter-spacing:-.03em; }
.trip-dates { color:var(--muted); font-size:12px; margin-top:4px; }
.trip-stats { display:flex; gap:8px; flex-wrap:wrap; }

.list-card { display:grid; gap:10px; }
.row {
  display:flex; justify-content:space-between; gap:16px; align-items:center;
  padding:12px 0; border-bottom:1px solid var(--line);
}
.row:last-child { border-bottom:0; }
.row-title { font-weight:800; }
.row-sub { color:var(--muted); font-size:12px; margin-top:3px; }

.venue-card { margin-bottom:12px; }
.venue-head { display:flex; justify-content:space-between; gap:14px; }
.venue-title { font-size:19px; font-weight:900; }
.venue-history { margin-top:13px; border-top:1px solid var(--line); padding-top:12px; display:grid; gap:10px; }
.history-item { display:grid; grid-template-columns:82px 1fr; gap:10px; font-size:12px; }
.history-date { color:var(--muted); }

.file-grid { display:grid; gap:10px; }
.file-card {
  display:flex; justify-content:space-between; gap:12px; align-items:center;
  text-decoration:none; color:var(--text);
}
.file-icon { font-size:26px; }
.file-meta { flex:1; }
.file-meta strong { display:block; }
.file-meta span { color:var(--muted); font-size:12px; }

.button {
  border-radius:14px;
  border:1px solid var(--line);
  padding:12px 15px;
  font-weight:850;
}
.button.primary { background:var(--accent); border-color:var(--accent); color:white; }
.button.secondary { background:var(--panel-2); color:var(--text); }
.button.ghost { background:transparent; color:var(--text); }
.button.danger { color:#ff7068; border-color:rgba(255,59,48,.3); }
.button.full { width:100%; }

.settings-grid { display:grid; gap:10px; }
.note-card { background: rgba(255,255,255,.03); }
.muted { color:var(--muted); line-height:1.55; }
.small-text { font-size:12px; }

.sheet-dialog {
  width:min(100% - 16px, 620px);
  max-height:92vh;
  margin:auto auto 8px;
  border:1px solid var(--line);
  border-radius:24px 24px 18px 18px;
  background:var(--panel);
  color:var(--text);
  padding:0;
  box-shadow:0 30px 100px rgba(0,0,0,.6);
}
.sheet-dialog::backdrop { background:rgba(0,0,0,.72); backdrop-filter:blur(5px); }
.sheet-dialog form { padding:10px 16px 18px; }
.sheet-handle { width:42px; height:5px; border-radius:999px; background:var(--line); margin:2px auto 14px; }
.sheet-header { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; margin-bottom:14px; }
.form-grid { display:grid; gap:12px; max-height:62vh; overflow:auto; padding-right:2px; }
label { display:grid; gap:6px; color:var(--muted); font-size:12px; font-weight:750; }
input, select, textarea {
  width:100%;
  border:1px solid var(--line);
  background:#101016;
  color:var(--text);
  border-radius:12px;
  padding:11px 12px;
  outline:none;
}
input:focus, select:focus, textarea:focus { border-color:var(--accent); }
.two-col { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.check-row { display:flex; align-items:center; gap:10px; }
.check-row input { width:auto; }
.sheet-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:16px; }
.hidden { display:none !important; }
.file-picker input { display:none; }
.file-picker span { display:block; padding:18px; border:1px dashed var(--line); border-radius:14px; text-align:center; }

.toast {
  position:fixed;
  left:50%;
  bottom:100px;
  transform:translate(-50%, 18px);
  background:#f5f5f7;
  color:#111;
  border-radius:999px;
  padding:10px 14px;
  font-size:12px;
  font-weight:850;
  opacity:0;
  pointer-events:none;
  transition:.2s ease;
  z-index:50;
}
.toast.show { opacity:1; transform:translate(-50%, 0); }

.empty {
  border:1px dashed var(--line);
  border-radius:var(--radius);
  padding:24px;
  text-align:center;
  color:var(--muted);
}

@media (min-width: 700px) {
  .main-content { padding-left:24px; padding-right:24px; }
  .dashboard-grid { display:grid; grid-template-columns:1.1fr .9fr; gap:14px; align-items:start; }
  .timeline-item { grid-template-columns:66px 14px 1fr; }
}
