:root {
  color-scheme: dark;
  --bg: #07111f;
  --bg-soft: #0e1729;
  --card: rgba(9, 16, 29, 0.86);
  --card-strong: rgba(14, 24, 39, 0.96);
  --line: rgba(255,255,255,0.09);
  --text: #f4f7fb;
  --muted: #8fa3bc;
  --accent: #30b3ff;
  --accent-2: #7c4dff;
  --success: #39d98a;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #07111f 0%, #111d2f 100%);
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }

.app-shell {
  min-height: 100vh;
  padding: 18px 18px 90px;
  background: linear-gradient(135deg, #07111f 0%, #111d2f 100%);
}

.topbar {
  max-width: 1220px;
  margin: 0 auto 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(9, 16, 29, 0.8);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.topbar h1 { margin: 0; font-size: 1.1rem; }
.topbar .sub { color: var(--muted); font-size: 0.9rem; }

.top-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn, .pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  padding: 9px 12px;
  cursor: pointer;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
}

.grid {
  max-width: 1220px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.grid-2 { grid-template-columns: 1.3fr 0.7fr; }
.grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 45px rgba(1, 8, 20, 0.25);
}

.hero, .story-row, .post, .list-item, .map-card, .tile, .preview-panel {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 18px;
}

.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.story-row { padding: 12px; display: flex; gap: 10px; overflow-x: auto; }
.story-pill {
  min-width: 70px; text-align: center; color: var(--muted); font-size: 0.82rem;
}
.story-pill .avatar { width: 56px; height: 56px; margin-bottom: 6px; }

.post { padding: 14px; display: grid; gap: 10px; }
.post-head { display: flex; gap: 10px; align-items: center; }
.post-meta { display: flex; flex-direction: column; }
.post-media {
  border-radius: 16px;
  height: 180px;
  background: linear-gradient(135deg, rgba(48,179,255,0.25), rgba(124,77,255,0.35));
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700;
}
.post-actions { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); }

.list-item { padding: 12px; display: flex; justify-content: space-between; gap: 10px; align-items: center; }

.input, .textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,0.06); color: var(--text); padding: 10px 12px;
}
.textarea { min-height: 100px; resize: vertical; }

.switch {
  width: 42px; height: 24px; border-radius: 999px; background: rgba(255,255,255,0.16); position: relative; cursor: pointer;
}
.switch::after {
  content: ""; position: absolute; width: 18px; height: 18px; top: 3px; left: 3px; border-radius: 50%; background: white; transition: transform 0.2s ease;
}
.switch.active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.switch.active::after { transform: translateX(18px); }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 10px; padding: 12px 14px 16px; background: rgba(5, 10, 22, 0.9); backdrop-filter: blur(16px); border-top: 1px solid var(--line);
}
.bottom-nav a {
  min-width: 72px; text-align: center; padding: 8px 10px; border-radius: 14px; color: var(--muted); font-size: 0.9rem;
}
.bottom-nav a.active { color: var(--text); background: rgba(255,255,255,0.08); }

.tile { padding: 14px; min-height: 110px; display: flex; flex-direction: column; justify-content: space-between; }
.tile strong { font-size: 1rem; }

@media (max-width: 860px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
