:root {
  --bg: #0d0f17;
  --surface: rgba(25, 29, 44, 0.85);
  --surface-solid: #181c2b;
  --border: rgba(255, 255, 255, 0.09);
  --text: #f3f5fc;
  --muted: #98a2b3;
  --accent: #7c5cff;
  --accent-2: #00cec9;
  --danger: #ff6b6b;
  --ok: #2ecc71;
  --radius: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background: radial-gradient(circle at top right, #1b2140 0%, var(--bg) 55%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

.app-shell {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: 72px;
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(13, 15, 23, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}

.status-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}

.status-pill.online .dot {
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
}

.status-pill.offline .dot {
  background: var(--danger);
}

.top-actions {
  display: flex;
  gap: 8px;
}

.pill-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.pill-btn.accent {
  background: linear-gradient(135deg, var(--accent), #5a42d4);
  border-color: transparent;
}

.notice-banner {
  margin: 10px 14px 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 107, 107, 0.14);
  border: 1px solid rgba(255, 107, 107, 0.35);
  color: #ffd4d4;
  font-size: 12px;
  line-height: 1.45;
}

.main-content {
  flex: 1;
  padding: 14px;
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.tab-panel.active {
  display: flex;
}

.panel-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.panel-intro h2 {
  font-size: 18px;
  margin-bottom: 2px;
}

.muted {
  color: var(--muted);
  font-size: 12px;
}

.small-note {
  margin-top: 6px;
  line-height: 1.45;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
}

/* Lounge Chat */
.chat-stream {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 52dvh;
  max-height: 62dvh;
  overflow-y: auto;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.chat-bubble {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  max-width: 90%;
}

.chat-bubble.user {
  align-self: flex-end;
  background: rgba(124, 92, 255, 0.24);
  border-color: rgba(124, 92, 255, 0.4);
}

.chat-sender {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-2);
  margin-bottom: 4px;
}

.chat-bubble.user .chat-sender {
  color: #cbbcff;
}

.chat-text {
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-media {
  margin-top: 8px;
  max-width: 100%;
  border-radius: 10px;
  cursor: pointer;
}

.chat-composer {
  display: flex;
  gap: 8px;
}

.chat-composer input,
.card-form input[type="text"],
.card-form select,
.api-row input {
  flex: 1;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 14px;
  outline: none;
}

.send-btn,
.primary-btn,
.secondary-btn,
.ghost-btn {
  border: none;
  border-radius: 12px;
  padding: 11px 15px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
}

.send-btn,
.primary-btn {
  background: linear-gradient(135deg, var(--accent), #5239d8);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
}

.ghost-btn {
  background: transparent;
  color: var(--muted);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Moments Feed */
.feed-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feed-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feed-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.feed-author {
  font-weight: 700;
  font-size: 15px;
}

.feed-loc {
  font-size: 11px;
  color: var(--accent-2);
}

.feed-body {
  font-size: 14px;
  line-height: 1.5;
}

.feed-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 6px;
}

.feed-gallery img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
}

.feed-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.feed-comments {
  border-top: 1px solid var(--border);
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #d0d5e2;
}

.feed-comment-form {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.feed-comment-form input {
  flex: 1;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
}

.feed-comment-form button {
  padding: 8px 12px;
  font-size: 12px;
  border-radius: 10px;
}

/* Co-Photo & Wallet Cards */
.card-form,
.wallet-card,
.result-card,
.pass-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.preview-wrap img {
  width: 120px;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.queue-meta-box {
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(0, 206, 201, 0.12);
  border: 1px solid rgba(0, 206, 201, 0.28);
  font-size: 12px;
  color: #a9f9f6;
}

.wallet-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.wallet-btn-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.passes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.pass-badge {
  align-self: flex-start;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(124, 92, 255, 0.22);
  color: #cbbcff;
}

.api-row {
  display: flex;
  gap: 8px;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(13, 15, 23, 0.94);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--border);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  z-index: 30;
}

.nav-btn {
  background: none;
  border: none;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 0;
  cursor: pointer;
}

.nav-btn.active {
  color: var(--text);
}

.nav-btn span {
  font-size: 18px;
}

.nav-btn small {
  font-size: 11px;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.lightbox img {
  max-width: 100%;
  max-height: 90dvh;
  border-radius: 12px;
}
