/* Sensi-bility mobile web shell — mirrors Flutter Home · Feed · Chat · Market · Me */
:root, html[data-theme="dark"] {
  --nv-bg: #050505;
  --nv-phone: #0a0a0a;
  --nv-ink: #f8f9fa;
  --nv-muted: #94a3b8;
  --nv-teal: #2dd4bf;
  --nv-line: rgba(45,212,191,.22);
  --nv-elev: #141414;
  --nv-card: linear-gradient(135deg, #141414, #0d1a20);
  --nv-input: #121212;
  --nv-top: rgba(10,10,10,.96);
  --nv-bottom: rgba(12,12,12,.97);
  --nv-glow: rgba(45,212,191,.12);
  --nv-shadow: 0 0 0 1px rgba(45,212,191,.15), 0 20px 60px rgba(0,0,0,.55);
  --nv-btn-ink: #0a0a0a;
  --nv-msg-bot: #141414;
  --nv-msg-user: rgba(45,212,191,.15);
  --nv-chip-bg: rgba(45,212,191,.1);
  --nv-chip-ink: #e2e8f0;
  --nv-err: #f87171;
}
html[data-theme="light"] {
  --nv-bg: #ecfdf5;
  --nv-phone: #ffffff;
  --nv-ink: #0f172a;
  --nv-muted: #475569;
  --nv-teal: #0f766e;
  --nv-line: rgba(15, 118, 110, .22);
  --nv-elev: #f0fdf4;
  --nv-card: linear-gradient(135deg, #ffffff, #f0fdf4);
  --nv-input: #ffffff;
  --nv-top: rgba(255,255,255,.97);
  --nv-bottom: rgba(255,255,255,.98);
  --nv-glow: rgba(15, 118, 110, .1);
  --nv-shadow: 0 0 0 1px rgba(15, 118, 110, .12), 0 16px 40px rgba(15, 23, 42, .08);
  --nv-btn-ink: #ffffff;
  --nv-msg-bot: #f8fafc;
  --nv-msg-user: rgba(15, 118, 110, .12);
  --nv-chip-bg: rgba(15, 118, 110, .1);
  --nv-chip-ink: #0f172a;
  --nv-err: #b91c1c;
}
html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--nv-bg);
  color: var(--nv-ink);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}
.nv-m-root {
  min-height: 100%;
  display: flex;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 0%, var(--nv-glow), transparent 55%),
    var(--nv-bg);
}
.nv-m-phone {
  width: min(430px, 100vw);
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--nv-phone);
  color: var(--nv-ink);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--nv-shadow);
}
.nv-m-top {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--nv-line);
  background: var(--nv-top);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.nv-m-top img, .nv-m-logo { height: 32px; width: auto; display: block; }
.nv-m-top .actions { display: flex; gap: .35rem; }
.nv-m-icon-btn {
  width: 36px; height: 36px; border-radius: 12px;
  border: 1px solid var(--nv-line);
  background: var(--nv-elev); color: var(--nv-teal);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 1rem;
}
.nv-m-body {
  flex: 1 1 auto;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 88px;
}
.nv-m-pane { display: none; padding: 1rem; }
.nv-m-pane.on { display: block; }
.nv-m-bottom {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(430px, 100vw);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .15rem;
  padding: .45rem .35rem calc(.45rem + env(safe-area-inset-bottom));
  background: var(--nv-bottom);
  border-top: 1px solid var(--nv-line);
  z-index: 30;
}
.nv-m-tab {
  border: 0; background: transparent; color: var(--nv-muted);
  padding: .4rem .2rem; border-radius: 12px;
  font-size: .68rem; font-weight: 700; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: .15rem;
}
.nv-m-tab .ico { font-size: 1.15rem; line-height: 1; }
.nv-m-tab.on { color: var(--nv-teal); background: rgba(45,212,191,.08); }
html[data-theme="light"] .nv-m-tab.on { background: rgba(15, 118, 110, .1); }

.nv-m-hero {
  border-radius: 22px; overflow: hidden; position: relative;
  aspect-ratio: 16/9; margin-bottom: 1rem;
  background: #111 center/cover no-repeat;
}
.nv-m-hero .shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.15), rgba(0,0,0,.82));
}
.nv-m-hero .inner {
  position: absolute; left: 14px; right: 14px; bottom: 14px;
}
.nv-m-pill {
  display: inline-flex; padding: .25rem .7rem; border-radius: 999px;
  border: 1px solid rgba(45,212,191,.55); color: #5eead4;
  background: rgba(45,212,191,.14); font-size: .72rem; font-weight: 800;
}
.nv-m-hero h1 {
  margin: .45rem 0 .2rem; font-size: 1.35rem; font-weight: 900; color: #fff;
}
.nv-m-hero p { margin: 0; color: rgba(255,255,255,.85); font-size: .9rem; }

.nv-m-chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1rem; }
.nv-m-chip {
  padding: .45rem .75rem; border-radius: 999px; font-size: .78rem; font-weight: 700;
  border: 1px solid var(--nv-line); background: var(--nv-chip-bg); color: var(--nv-chip-ink);
}
.nv-m-section { font-weight: 900; font-size: 1.05rem; margin: 1rem 0 .65rem; color: var(--nv-ink); }
.nv-m-card {
  background: var(--nv-card);
  border: 1px solid var(--nv-line);
  border-radius: 18px; padding: .85rem;
  margin-bottom: .7rem;
}
.nv-m-card h3 { margin: 0 0 .25rem; font-size: 1rem; color: var(--nv-ink); }
.nv-m-card .meta { color: var(--nv-muted); font-size: .82rem; margin: 0; }
.nv-m-link { color: var(--nv-teal); }
.nv-m-err { color: var(--nv-err); }
.nv-m-row {
  display: flex; gap: .75rem; align-items: center; cursor: pointer;
}
.nv-m-row .emoji {
  width: 46px; height: 46px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(45,212,191,.14); font-size: 1.35rem; flex: 0 0 auto;
}
html[data-theme="light"] .nv-m-row .emoji { background: rgba(15, 118, 110, .12); }
.nv-m-roles {
  display: flex; gap: .65rem; overflow-x: auto; padding-bottom: .35rem;
  -webkit-overflow-scrolling: touch;
}
.nv-m-role {
  flex: 0 0 132px; height: 160px; border-radius: 18px; overflow: hidden;
  position: relative; background: #111 center/cover no-repeat;
}
.nv-m-role .shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.88));
}
.nv-m-role .txt {
  position: absolute; left: 10px; right: 10px; bottom: 10px;
  font-size: .85rem; font-weight: 800;
}
.nv-m-role .txt small { display: block; font-weight: 600; opacity: .8; font-size: .72rem; }

.nv-m-feed-item { padding: .9rem; }
.nv-m-feed-item .who { font-weight: 800; color: var(--nv-teal); }
.nv-m-actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .55rem; }
.nv-m-btn {
  border: 0; border-radius: 999px; padding: .55rem .9rem;
  font-weight: 800; font-size: .82rem; cursor: pointer;
  background: linear-gradient(135deg, #2dd4bf, #0f766e); color: var(--nv-btn-ink);
}
html[data-theme="light"] .nv-m-btn {
  background: linear-gradient(135deg, #14b8a6, #0f766e);
}
.nv-m-btn.ghost {
  background: transparent; color: var(--nv-ink);
  border: 1px solid var(--nv-line);
}
.nv-m-input, .nv-m-textarea, .nv-m-select, select.nv-m-input, textarea.nv-m-input {
  width: 100%; border-radius: 12px; border: 1px solid var(--nv-line);
  background: var(--nv-input); color: var(--nv-ink); padding: .7rem .85rem;
  font: inherit; margin: .35rem 0 .75rem;
}
.nv-m-textarea { min-height: 88px; resize: vertical; }
.nv-m-composer {
  display: flex; gap: .4rem; align-items: flex-end;
  position: sticky; bottom: 78px; background: var(--nv-top);
  padding: .55rem 0 .2rem; margin-top: .5rem;
}
.nv-m-composer input { flex: 1; margin: 0; }
.nv-m-msg {
  border-radius: 14px; padding: .7rem .85rem; margin-bottom: .55rem;
  max-width: 92%;
}
.nv-m-msg.bot { background: var(--nv-msg-bot); border: 1px solid var(--nv-line); }
.nv-m-msg.user {
  background: var(--nv-msg-user); border: 1px solid var(--nv-line);
  margin-left: auto;
}
.nv-m-msg .txt { white-space: pre-wrap; font-size: .9rem; }
.nv-m-empty { color: var(--nv-muted); text-align: center; padding: 2rem .5rem; }
.nv-m-gate {
  padding: 2rem 1.25rem; text-align: center;
}
.nv-m-gate h2 { margin: 0 0 .5rem; color: var(--nv-ink); }
.nv-m-gate .meta { color: var(--nv-muted); }
.hidden { display: none !important; }

/* Farm onboard */
.sf-progress {
  margin: .35rem 0 .5rem;
  background: rgba(148,163,184,.18);
  border-radius: 999px;
  height: 8px;
  position: relative;
  overflow: hidden;
}
html[data-theme="light"] .sf-progress { background: rgba(15, 23, 42, .08); }
.sf-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #14b8a6, #84cc16);
  border-radius: 999px;
}
.sf-progress .meta {
  display: block;
  margin-top: .35rem;
  font-size: .75rem;
  color: var(--nv-muted);
}
.sf-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .5rem;
  padding: 0 .15rem;
}
.sf-step-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-bottom: .65rem;
}
.sf-step-tab {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  border: 1px solid var(--nv-line);
  background: var(--nv-input);
  color: var(--nv-muted);
  font-size: .7rem;
  font-weight: 700;
  cursor: pointer;
}
.sf-step-tab.on {
  background: rgba(45,212,191,.25);
  color: var(--nv-ink);
  border-color: var(--nv-teal);
}
.sf-step-tab.done {
  border-color: #84cc16;
  color: #65a30d;
}
html[data-theme="dark"] .sf-step-tab.done { color: #bef264; }
.sf-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: .4rem 0 .8rem;
}
.sf-chip {
  border-radius: 999px;
  border: 1px solid var(--nv-line);
  background: transparent;
  color: var(--nv-ink);
  padding: .35rem .7rem;
  font: inherit;
  font-size: .8rem;
  cursor: pointer;
}
.sf-chip.on {
  background: rgba(45,212,191,.2);
  border-color: var(--nv-teal);
  color: var(--nv-ink);
}
.sf-zone {
  border: 1px solid var(--nv-line);
  border-radius: 12px;
  padding: .55rem .65rem;
  margin-bottom: .5rem;
}
.sf-zone.on {
  border-color: var(--nv-teal);
  background: rgba(45,212,191,.06);
}
.sf-map {
  width: 100%;
  height: min(52vh, 360px);
  min-height: 240px;
  border-radius: 14px;
  border: 1px solid var(--nv-line);
  margin: .45rem 0 .55rem;
  z-index: 1;
  background: #0b1a2e;
}
html[data-theme="light"] .sf-map { background: #e2e8f0; }
.sf-map-tools {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-bottom: .65rem;
}
.sf-map .leaflet-container {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  font: inherit;
}
.nv-m-card label.meta {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: .35rem 0;
}
