:root {
  --ink: #14213d;
  --muted: #637083;
  --line: #dce4ec;
  --paper: #ffffff;
  --mist: #f4f8fb;
  --teal: #0b7285;
  --green: #3dbb6f;
  --coral: #ff6b57;
  --amber: #f7b731;
  --violet: #6554c0;
  --shadow: 0 18px 42px rgba(20, 33, 61, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(11, 114, 133, 0.08), rgba(255, 107, 87, 0.06)),
    var(--mist);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 22px;
  background: rgba(255, 255, 255, 0.78);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand-lockup,
.profile-hero,
.composer,
.setting-row,
.section-head,
.topbar,
.composer-actions,
.composer-row {
  display: flex;
  align-items: center;
}

.brand-lockup {
  gap: 12px;
}

.brand-lockup strong {
  display: block;
  font-size: 20px;
}

.brand-lockup span,
.eyebrow,
.hero-copy span,
.privacy-card p,
.card-meta,
.profile-card p,
.setting-row span {
  color: var(--muted);
}

.brand-logo {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  object-fit: cover;
  background: white;
  box-shadow: 0 10px 20px rgba(20, 33, 61, 0.12);
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, var(--teal), var(--green));
  font-weight: 850;
  box-shadow: 0 10px 20px rgba(11, 114, 133, 0.18);
}

.rail-nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}

.nav-item.active {
  color: var(--ink);
  background: #eaf7f5;
  font-weight: 800;
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.privacy-card {
  margin-top: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.privacy-card p {
  margin: 8px 0 0;
  line-height: 1.45;
  font-size: 14px;
}

.phone-frame {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 28px 28px 104px;
}

.topbar {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  text-transform: uppercase;
  font-weight: 850;
  font-size: 12px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(27px, 3vw, 38px);
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
}

.create-post-btn,
.outline-btn,
.composer-actions button {
  border: 0;
  border-radius: 8px;
  min-height: 44px;
  padding: 0 16px;
  font-weight: 850;
}

.create-post-btn {
  background: linear-gradient(135deg, #168add, #ff334f);
  color: white;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 22px rgba(255, 51, 79, 0.16);
}

.hero-strip {
  min-height: 240px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow);
  background: var(--ink);
  margin-bottom: 18px;
}

.hero-strip img {
  width: 100%;
  height: 100%;
  min-height: 240px;
  object-fit: cover;
  display: block;
}

.hero-strip::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(20, 33, 61, 0.82), rgba(20, 33, 61, 0.1));
}

.hero-copy {
  position: absolute;
  inset: auto auto 18px 18px;
  z-index: 1;
  color: white;
  max-width: 520px;
  display: grid;
  gap: 6px;
}

.hero-copy strong {
  font-size: 22px;
}

.hero-copy span {
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
}

.composer {
  gap: 12px;
  align-items: flex-start;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 12px 24px rgba(20, 33, 61, 0.07);
  margin-bottom: 18px;
}

.composer form {
  width: 100%;
  display: grid;
  gap: 10px;
}

.composer-row {
  gap: 8px;
}

select,
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  color: var(--ink);
}

select {
  height: 38px;
  padding: 0 10px;
}

textarea {
  resize: none;
  min-height: 62px;
  padding: 12px;
  width: 100%;
}

.composer-actions {
  justify-content: space-between;
  gap: 12px;
}

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

.composer-actions .media-btn {
  min-height: 38px;
  background: #f1f5f9;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  box-shadow: none;
}

.composer-actions > button {
  color: white;
  background: var(--teal);
}

.media-preview {
  display: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #f8fbfd;
}

.media-preview.active {
  display: block;
}

.media-preview img,
.media-preview video,
.post-media img,
.post-media video {
  width: 100%;
  display: block;
  object-fit: cover;
  background: #eef3f7;
}

.media-preview img,
.media-preview video {
  max-height: 320px;
}

.media-preview-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  color: var(--muted);
  font-size: 13px;
}

.media-preview-bar button {
  border: 0;
  background: transparent;
  color: var(--coral);
  font-weight: 900;
  min-height: 32px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.filter-tabs,
.category-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 8px;
}

.filter-tabs button,
.category-chips button,
.quick-grid button {
  white-space: nowrap;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 8px;
  min-height: 38px;
  padding: 0 12px;
  font-weight: 800;
}

.filter-tabs .active,
.category-chips .active {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

.feed,
.tips-list {
  display: grid;
  gap: 12px;
}

.post-card,
.business-card,
.tip-card,
.profile-card,
.settings-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(20, 33, 61, 0.06);
}

.post-card {
  padding: 16px;
}

.post-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.user-line {
  display: flex;
  gap: 10px;
  align-items: center;
}

.small-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #eaf7f5;
  color: var(--teal);
  display: grid;
  place-items: center;
  font-weight: 850;
}

.pill {
  border-radius: 999px;
  padding: 6px 9px;
  background: rgba(61, 187, 111, 0.14);
  color: #187245;
  font-weight: 850;
  font-size: 12px;
}

.post-card p {
  margin-bottom: 14px;
  line-height: 1.5;
}

.post-media {
  margin: 0 0 14px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f8fbfd;
}

.post-media img,
.post-media video {
  max-height: 520px;
}

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

.card-actions button {
  border: 0;
  background: #f1f5f9;
  color: var(--ink);
  border-radius: 8px;
  min-height: 34px;
  padding: 0 10px;
  font-weight: 800;
}

.quick-grid,
.business-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.quick-grid button {
  min-height: 56px;
}

.alert-map {
  min-height: 240px;
  background:
    linear-gradient(90deg, rgba(20, 33, 61, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(20, 33, 61, 0.06) 1px, transparent 1px),
    #ffffff;
  background-size: 34px 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}

.route-line {
  position: absolute;
  width: 80%;
  height: 120px;
  border: 8px solid rgba(11, 114, 133, 0.28);
  border-left: 0;
  border-bottom: 0;
  border-radius: 0 70px 0 0;
  left: 8%;
  top: 34%;
  transform: rotate(-10deg);
}

.map-pin {
  position: absolute;
  background: var(--paper);
  border: 2px solid var(--coral);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 850;
}

.map-pin.doral { left: 18%; top: 24%; }
.map-pin.hialeah { right: 24%; top: 18%; border-color: var(--amber); }
.map-pin.downtown { right: 13%; bottom: 26%; border-color: var(--teal); }
.map-pin.kendall { left: 30%; bottom: 18%; border-color: var(--green); }

.section-head {
  justify-content: space-between;
  margin-bottom: 14px;
}

.outline-btn {
  background: white;
  color: var(--teal);
  border: 1px solid rgba(11, 114, 133, 0.25);
}

.outline-btn.full {
  width: 100%;
  margin-top: 14px;
}

.business-card {
  overflow: hidden;
}

.business-band {
  height: 78px;
  background: linear-gradient(135deg, var(--teal), var(--green));
  display: flex;
  align-items: flex-end;
  padding: 12px;
  color: white;
  font-weight: 900;
}

.business-card:nth-child(2n) .business-band {
  background: linear-gradient(135deg, var(--coral), var(--amber));
}

.business-card:nth-child(3n) .business-band {
  background: linear-gradient(135deg, var(--violet), var(--teal));
}

.business-body,
.tip-card {
  padding: 14px;
}

.business-body h3,
.tip-card h3,
.settings-panel h3 {
  margin-bottom: 8px;
}

.business-body p,
.tip-card p {
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 12px;
}

.business-tag {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: #fff4dc;
  color: #885a00;
  font-weight: 850;
  font-size: 12px;
}

.tip-card {
  border-left: 5px solid var(--green);
}

.tip-card:nth-child(2n) {
  border-left-color: var(--coral);
}

.tip-card:nth-child(3n) {
  border-left-color: var(--teal);
}

.profile-card,
.settings-panel {
  padding: 18px;
  margin-bottom: 14px;
}

.profile-hero {
  gap: 14px;
  margin-bottom: 16px;
}

.avatar.big {
  width: 72px;
  height: 72px;
  font-size: 23px;
  border-radius: 22px;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.profile-stats span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
}

.profile-stats strong {
  display: block;
  color: var(--ink);
  font-size: 22px;
}

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

.badge-row span {
  border-radius: 999px;
  padding: 8px 10px;
  background: #eaf7f5;
  color: var(--teal);
  font-weight: 850;
}

.settings-panel h3 {
  margin-top: 0;
}

.setting-row {
  justify-content: space-between;
  min-height: 46px;
  border-top: 1px solid var(--line);
}

.setting-row.private strong {
  color: var(--coral);
}

.bottom-nav {
  display: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: 180ms ease;
  z-index: 20;
  max-width: min(90vw, 520px);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.terms-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(20, 33, 61, 0.52);
  backdrop-filter: blur(14px);
}

.profile-gate {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(20, 33, 61, 0.58);
  backdrop-filter: blur(16px);
}

.profile-gate.active {
  display: grid;
}

.profile-gate-card {
  width: min(100%, 520px);
  max-height: min(94vh, 720px);
  overflow: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(20, 33, 61, 0.3);
  padding: 18px;
}

.field-label {
  display: block;
  margin: 10px 0 6px;
  color: var(--ink);
  font-weight: 850;
}

.profile-input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fbfdff;
  color: var(--ink);
}

.profile-submit {
  width: 100%;
  margin-top: 12px;
}

body.locked .app-shell {
  pointer-events: none;
  user-select: none;
}

.owner-panel {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.owner-panel p {
  color: var(--muted);
  line-height: 1.45;
}

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

.outline-btn.danger {
  color: var(--coral);
  border-color: rgba(255, 107, 87, 0.35);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 0;
}

.auth-tabs button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-weight: 850;
}

.auth-tabs button.active {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

.auth-form {
  display: none;
  gap: 10px;
}

.auth-form.active {
  display: grid;
}

.admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.terms-modal.active {
  display: grid;
}

.terms-card {
  width: min(100%, 560px);
  max-height: min(94vh, 680px);
  overflow: auto;
  background: white;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: 0 24px 80px rgba(20, 33, 61, 0.28);
  padding: 16px 18px;
}

.terms-logo {
  width: 58px;
  height: 58px;
  border-radius: 22px;
  object-fit: cover;
  display: block;
  margin-bottom: 10px;
  box-shadow: 0 12px 24px rgba(20, 33, 61, 0.12);
}

.terms-intro {
  color: var(--muted);
  line-height: 1.5;
  margin: 6px 0 10px;
}

.terms-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.terms-list div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fbfdff;
}

.terms-list strong,
.terms-list span {
  display: block;
}

.terms-list span {
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.32;
}

.terms-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  background: #eaf7f5;
  color: var(--ink);
  font-weight: 800;
}

.terms-check input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.terms-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.accept-btn {
  border: 0;
  border-radius: 8px;
  min-height: 44px;
  padding: 0 16px;
  background: linear-gradient(135deg, #168add, #ff334f);
  color: white;
  font-weight: 900;
}

.accept-btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

@media (max-width: 860px) {
  .app-shell {
    display: block;
  }

  .rail {
    display: none;
  }

  .phone-frame {
    padding: 18px 14px 98px;
  }

  .topbar {
    align-items: flex-start;
  }

  .create-post-btn span {
    display: none;
  }

  .hero-copy strong {
    font-size: 18px;
  }

  .hero-strip,
  .hero-strip img {
    min-height: 190px;
  }

  .quick-grid,
  .business-grid,
  .profile-stats {
    grid-template-columns: 1fr 1fr;
  }

  .bottom-nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 6px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    z-index: 10;
  }

  .bottom-nav .nav-item {
    justify-content: center;
    gap: 4px;
    padding: 8px 4px;
    min-width: 0;
    flex-direction: column;
    font-size: 11px;
  }

  .bottom-nav .icon {
    width: 18px;
    height: 18px;
  }

  .terms-actions {
    flex-direction: column;
  }

  .terms-actions button {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .composer {
    gap: 10px;
  }

  .composer .avatar {
    display: none;
  }

  .composer-row,
  .composer-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .media-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  select {
    width: 100%;
  }

  .quick-grid,
  .business-grid,
  .profile-stats {
    grid-template-columns: 1fr;
  }
}
