/* Nexli additive styles — extends styles.css, preserves the existing dark gradient design language.
   Loaded after styles.css so tokens (--card, --muted, --line, gradients) stay authoritative. */

/* layout: room for fixed bottom nav */
.shell { padding-bottom: 110px; }
.shell.auth { display: flex; flex-direction: column; gap: 10px; justify-content: center; min-height: 78vh; }

/* topbar with notification bell */
.topbar { max-width: 760px; margin: 0 auto; padding: 16px 16px 0; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.bell { position: relative; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border: 1px solid #35384a; border-radius: 999px; background: #11131c; color: #fff; cursor: pointer; }
.bell svg { width: 20px; height: 20px; }
.badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: linear-gradient(90deg, #ff3f8e, #914eff); color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.badge.static { position: static; }

/* bottom navigation */
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; display: flex; max-width: 760px; margin: 0 auto; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: rgba(9, 10, 16, 0.94); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.bottomnav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; border: none; color: var(--muted); font-size: 10.5px; font-weight: 700; padding: 6px 2px; cursor: pointer; }
.bottomnav button svg { width: 22px; height: 22px; }
.bottomnav button.active { color: #fff; }
.bottomnav button.active svg { stroke: url(#navgrad); }

/* segmented control */
.seg { display: flex; gap: 6px; background: #0b0d14; border: 1px solid var(--line); border-radius: 14px; padding: 5px; }
.seg button { flex: 1; border: none; background: none; color: var(--muted); font-weight: 700; padding: 9px 8px; border-radius: 10px; cursor: pointer; }
.seg button.active { background: linear-gradient(90deg, #ff7135, #ff3f93, #914eff, #3f9dff); color: #fff; }

/* chips (category search) */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; border: 1px solid var(--line); background: #11131c; color: #cdd1dc; border-radius: 999px; padding: 8px 13px; font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap; }
.chip.on { border: none; background: linear-gradient(90deg, #ff7135, #914eff); color: #fff; }
.chip-n { opacity: .7; font-size: 11px; }

/* greeting + weather */
.greeting { font-size: 26px; font-weight: 900; letter-spacing: -1px; margin: 4px 0 12px; }
.weatherbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: linear-gradient(180deg, #131521, #0f1119); border: 1px solid var(--line); border-radius: 16px; padding: 12px 15px; margin-bottom: 12px; }

/* travel control */
.travel { border: 1px solid var(--line); border-radius: 16px; padding: 12px 15px; margin-bottom: 14px; background: #0f1119; }
.travel summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.travel summary::-webkit-details-marker { display: none; }
.travel[open] summary .chev { transform: rotate(180deg); }
.travel.active { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-color: #35406b; background: linear-gradient(180deg, #141a2e, #0f1119); }
.row2 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
 @media (max-width: 479px) {
   .row2 { grid-template-columns: 1fr; }
   .row2 input, .row2 select { width: 100%; min-width: 0; }
 }

/* activity cards */
.act { cursor: pointer; transition: transform .08s ease, border-color .12s ease; }
.act:hover { border-color: #35406b; }
.act:active { transform: scale(.995); }
.act-title { font-size: 17px; font-weight: 800; }
.act-title.lg { font-size: 22px; }
.act-when { margin: 8px 0; font-weight: 600; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.host { display: flex; align-items: center; gap: 9px; }
.pill.sm { padding: 3px 8px; font-size: 11px; }
.pill.md { border: none; background: linear-gradient(90deg, #ff7135, #914eff); color: #fff; }

/* avatars */
.avatar { width: 42px; height: 42px; border-radius: 999px; object-fit: cover; border: 1px solid var(--line); background: #0b0d14; }
.avatar.ph { display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; color: #cdd1dc; background: linear-gradient(135deg, #2a2140, #151826); }
.center-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.center-card .avatar { width: 84px; height: 84px; font-size: 26px; }

/* pager */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }

/* zero / empty state */
.zero { text-align: center; padding: 34px 18px; border: 1px dashed var(--line); border-radius: 20px; background: #0f1119; }
.zero-title { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions.center { justify-content: center; margin-top: 14px; }
.actions.wrap { flex-wrap: wrap; }

/* banners */
.banner { border: 1px solid #6b5327; background: linear-gradient(180deg, #241d10, #14120b); color: #ffd9a3; border-radius: 14px; padding: 12px 15px; margin-bottom: 12px; font-weight: 600; }
.card.warn { border-color: #6b5327; background: linear-gradient(180deg, #1c1810, #12110c); }
.read-only { border: 1px solid var(--line); background: #0f1119; color: var(--muted); border-radius: 14px; padding: 12px 15px; margin-bottom: 12px; }

/* buttons small */
.btn.small { padding: 8px 12px; font-size: 13px; }
.back { background: none; border: none; color: var(--muted); font-weight: 700; padding: 6px 0 12px; cursor: pointer; font-size: 14px; }

/* bring rows */
.bring-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.bring-row:first-child { border-top: none; }

/* user rows */
.user-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; cursor: pointer; }
.invite-cta { display: flex; justify-content: space-between; align-items: center; gap: 14px; }

/* section title small */
.section-title.sm { font-size: 18px; margin: 20px 0 10px; }

/* photo edit */
.photo-edit { display: flex; align-items: center; gap: 14px; }

/* toggles */
.toggle { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 600; }
.toggle input { width: 44px; height: 26px; appearance: none; background: #2a2e3e; border-radius: 999px; position: relative; cursor: pointer; transition: background .15s; }
.toggle input:checked { background: linear-gradient(90deg, #ff3f8e, #914eff); }
.toggle input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 999px; background: #fff; transition: transform .15s; }
.toggle input:checked::after { transform: translateX(18px); }
.toggle input:disabled { opacity: .6; cursor: not-allowed; }
.toggle.locked span { color: var(--muted); }
.divider { height: 1px; background: var(--line); margin: 4px 0; }

/* messaging */
.thread-head { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.thread-head .back { padding: 0; font-size: 20px; }
.thread-head strong { font-size: 16px; }
.msgs { display: flex; flex-direction: column; gap: 8px; min-height: 40vh; max-height: 58vh; overflow-y: auto; padding: 4px 2px 12px; }
.bubble { max-width: 78%; align-self: flex-start; background: #171a26; border: 1px solid var(--line); border-radius: 16px 16px 16px 4px; padding: 9px 13px; }
.bubble.mine { align-self: flex-end; border-radius: 16px 16px 4px 16px; background: linear-gradient(135deg, #3a2350, #23305a); border-color: transparent; }
.bubble-body { white-space: pre-wrap; word-break: break-word; }
.bubble-time { font-size: 10px; color: var(--muted); margin-top: 3px; text-align: right; }
.msg-form { position: sticky; bottom: 96px; display: flex; gap: 8px; background: #08090f; padding-top: 8px; }
.msg-form input { flex: 1; border: 1px solid #303445; background: #0b0d14; color: #fff; border-radius: 999px; padding: 12px 16px; }
.thread { display: flex; justify-content: space-between; align-items: center; cursor: pointer; }

/* notifications */
.notif.unread { border-left: 3px solid #914eff; }
.notif .row { align-items: flex-start; }

/* grids */
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card.mini { padding: 13px; text-align: center; }
.card.mini .metric { font-size: 22px; }
.card.mini.clickable { cursor: pointer; }
.chat-msg { padding: 8px; border-radius: 10px; }
.chat-msg-announcement { background: linear-gradient(180deg, #241d10, #14120b); border: 1px solid #6b5327; }

/* stepper */
.stepper { display: flex; gap: 8px; margin: 6px 0 16px; }
.stepper span { flex: 1; height: 5px; border-radius: 999px; background: #2a2e3e; }
.stepper span.on { background: linear-gradient(90deg, #ff3f8e, #914eff); }

/* spinner */
.spinner-wrap { display: flex; justify-content: center; padding: 48px 0; }
.spinner { width: 30px; height: 30px; border: 3px solid #2a2e3e; border-top-color: #914eff; border-radius: 999px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* modal body scroll */
html.modal-locked, body.modal-locked { overflow: hidden; touch-action: none; }
.modal-backdrop { z-index: 300; }
.modal {
  display: flex;
  flex-direction: column;
  max-height: 86vh;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}
@supports (height: 100dvh) {
  .modal { max-height: 86dvh; }
}
.modal > .close { align-self: flex-end; flex: 0 0 auto; margin: 0 0 4px; }
.modal-body {
  display: block;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
.modal-body form.stack > button:last-child, .modal-body > button:last-child { margin-bottom: 4px; }
.modal-body .actions {
  position: sticky;
  bottom: 0;
  background: #0d0f17;
  margin-top: 10px;
  padding: 10px 0 4px;
  border-top: 1px solid #23263a;
}
.field input, .field select, .field textarea { max-width: 100%; }

.brand.xl { font-size: 56px; text-align: center; }
.tag.center, .center { text-align: center; }

@media (min-width: 620px) {
  .bottomnav button { font-size: 12px; }
}
