:root {
  --blue: #2f80ff;
  --navy: #1e2430;
  --navy-2: #141922;
  --navy-3: #252c3a;
  --text: #f7f8fb;
  --muted: #aeb6c4;
  --line: #313845;
  --soft: #11151d;
  --card: #1e2430;
  --danger: #d93025;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #0c0f14;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.phone-shell {
  width: min(100vw, 430px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--soft);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.45);
}

.hidden {
  display: none !important;
}

.splash-view {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  width: min(100vw, 430px);
  margin: 0 auto;
  place-items: center;
  background: var(--soft);
}

.splash-view img {
  width: 112px;
  height: 112px;
  border-radius: 28px;
  animation: splashPulse 1.05s ease-in-out infinite;
}

.splash-exit {
  pointer-events: none;
  animation: splashExit 0.36s ease forwards;
}

.view-enter {
  animation: viewEnter 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes splashPulse {
  0%,
  100% {
    transform: scale(0.96);
    opacity: 0.86;
  }

  50% {
    transform: scale(1.04);
    opacity: 1;
  }
}

@keyframes splashExit {
  to {
    opacity: 0;
    transform: scale(1.04);
  }
}

@keyframes viewEnter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.auth-view {
  display: grid;
  align-content: center;
  gap: 18px;
  min-height: 100vh;
  padding: 24px;
  background: radial-gradient(circle at top, #263040 0, var(--soft) 48%);
}

.auth-brand {
  text-align: center;
}

.auth-brand img {
  width: 82px;
  height: 82px;
  border-radius: 22px;
}

.auth-brand h1 {
  margin: 10px 0 4px;
  color: var(--text);
  font-size: 36px;
  letter-spacing: -1px;
}

.auth-brand p,
.form-message,
.empty-feed p,
.post-meta,
label,
.profile-summary {
  color: var(--muted);
}

.auth-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.24);
}

.auth-card h2 {
  margin: 0 0 4px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 13px;
  color: var(--text);
  background: var(--navy-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
}

textarea {
  resize: vertical;
}

.password-wrap {
  position: relative;
  display: block;
}

.password-wrap input {
  padding-right: 56px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  min-height: 34px;
  padding: 0 10px;
  color: var(--blue);
  background: transparent;
  border: 0;
  border-radius: 999px;
  translate: 0 -50%;
  font-weight: 800;
}

.primary,
.secondary,
.text-btn {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  font-weight: 800;
}

.primary {
  color: #fff;
  background: var(--blue);
}

.danger {
  background: var(--danger);
}

.secondary {
  color: var(--text);
  background: var(--navy-3);
}

.text-btn {
  color: var(--blue);
  background: transparent;
}

.form-message {
  min-height: 20px;
  margin: 0;
  font-size: 13px;
}

.mobile-top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--navy);
  border-bottom: 1px solid var(--line);
}

.top-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: max(8px, env(safe-area-inset-top)) 14px 8px;
}

.top-logo {
  width: 37px;
  height: 37px;
  border-radius: 0;
  object-fit: contain;
  filter: brightness(0);
  cursor: pointer;
}

.wordmark {
  flex: 1;
  color: var(--text);
  font-size: 29px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.8px;
}

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

.icon-btn,
.profile-btn {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.profile-btn {
  padding: 0;
}

.message-icon svg,
.profile-btn svg {
  width: 34px;
  height: 34px;
  stroke: #050505;
  stroke-width: 4.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-btn svg circle {
  fill: #fff;
}

.composer-strip img,
.mini-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-bar {
  padding: 0 14px 10px;
}

.composer-strip {
  display: grid;
  grid-template-columns: 48px 1fr 42px;
  gap: 10px;
  align-items: center;
  padding: 8px 14px 12px;
}

.mobile-top.compact-top .composer-strip {
  display: none;
}

.composer-strip img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

.composer-strip button:not(.photo-btn) {
  height: 42px;
  padding: 0 18px;
  color: var(--text);
  text-align: left;
  background: var(--navy-2);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.photo-btn {
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 900;
}

.feed-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 54px;
  background: var(--navy);
  border-bottom: 1px solid var(--line);
}

.feed-tabs button {
  color: var(--muted);
  background: transparent;
  border: 0;
  font-weight: 900;
}

.feed-tabs button.active {
  color: var(--blue);
  box-shadow: inset 0 -4px 0 var(--blue);
}

.stories-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 8px 10px;
  background: var(--navy);
  border-bottom: 8px solid var(--soft);
}

.story-card {
  position: relative;
  flex: 0 0 126px;
  height: 214px;
  overflow: hidden;
  background: var(--navy-3);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.story-image {
  height: 142px;
  background: url("Recursos/ICOON%20APP.png") center/cover no-repeat;
}

.story-card span {
  position: absolute;
  top: 120px;
  left: 50%;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  color: #fff;
  background: var(--blue);
  border: 4px solid var(--navy);
  border-radius: 50%;
  translate: -50% 0;
  font-size: 38px;
  line-height: 1;
}

.story-card strong {
  position: absolute;
  right: 10px;
  bottom: 12px;
  left: 10px;
  text-align: center;
  font-size: 15px;
}

.empty-story {
  display: grid;
  place-items: end start;
  padding: 12px;
  background: linear-gradient(160deg, #3b414b, #0d1016);
}

.empty-story strong {
  position: static;
  text-align: left;
}

.notice {
  margin: 0;
  padding: 14px;
  color: #ffd479;
  background: #32280d;
  border-bottom: 1px solid #6b5313;
}

.feed-list {
  display: grid;
  gap: 8px;
  min-height: 360px;
  padding-bottom: 86px;
  background: var(--soft);
}

.post,
.empty-feed {
  background: var(--navy);
}

.post {
  padding: 12px 14px 0;
}

.post-head {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 10px;
  align-items: center;
}

.avatar {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: #fff;
  background: var(--blue);
  border-radius: 50%;
  font-weight: 900;
}

.post-meta {
  font-size: 13px;
}

.post-menu {
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 24px;
}

.post p {
  margin: 12px 0 14px;
  font-size: 18px;
  line-height: 1.28;
}

.post-category {
  display: inline-flex;
  margin-top: 8px;
  padding: 5px 9px;
  color: #dceaff;
  background: #223b63;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.post-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.post-actions button {
  min-height: 44px;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-weight: 800;
  -webkit-touch-callout: none;
  user-select: none;
}

.empty-feed {
  padding: 34px 24px;
  text-align: center;
}

.empty-feed h2 {
  margin: 0 0 8px;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 12;
  display: flex;
  gap: 6px;
  width: min(100vw, 430px);
  height: 74px;
  margin: 0 auto;
  padding: 7px 8px max(7px, env(safe-area-inset-bottom));
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  background: var(--navy);
  border-top: 1px solid var(--line);
  transform: translateZ(0);
}

.bottom-nav::-webkit-scrollbar {
  display: none;
}

.bottom-nav button {
  display: grid;
  flex: 0 0 62px;
  grid-template-rows: 1fr;
  gap: 0;
  place-items: center;
  min-width: 62px;
  height: 58px;
  color: #606875;
  background: transparent;
  border: 0;
  border-radius: 14px;
  scroll-snap-align: center;
}

.bottom-nav button.active {
  color: #1e2430;
  background: #eef2f7;
}

.bottom-nav svg {
  width: 38px;
  height: 38px;
  stroke: currentColor;
  stroke-width: 3.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-nav svg.solid-icon {
  fill: currentColor;
  stroke: none;
}

.bottom-nav .home-solid {
  width: 42px;
  height: 42px;
  transform: scale(1.08);
  transform-origin: center;
}

.bottom-nav .nav-solid {
  width: 40px;
  height: 40px;
}

.bottom-nav .car-solid {
  width: 41px;
  height: 41px;
  transform: translateY(-2px);
}

.bottom-nav .utensils-solid {
  width: 39px;
  height: 39px;
}

.bottom-nav button.active svg {
  stroke-width: 4.2;
}

.bottom-nav svg circle,
.bottom-nav svg rect,
.bottom-nav svg polygon {
  vector-effect: non-scaling-stroke;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.section-base {
  display: grid;
  gap: 14px;
  padding: 16px 14px 92px;
  background: var(--soft);
}

.section-hero {
  padding: 18px;
  background: var(--navy);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.section-hero svg {
  display: block;
  width: 74px;
  height: 74px;
  margin: 0 auto 12px;
  color: var(--blue);
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.section-hero h2 {
  margin: 0 0 8px;
  text-align: center;
}

.section-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.42;
  text-align: center;
}

.feature-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  padding: 12px;
  color: var(--muted);
  background: var(--navy);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.mini-avatar img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.modal {
  width: min(398px, calc(100vw - 24px));
  padding: 0;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

.modal form {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.modal h2 {
  margin: 0;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.profile-summary {
  margin: 0;
  line-height: 1.4;
}

.profile-page {
  display: grid;
  gap: 14px;
  min-height: calc(100vh - 139px);
  padding: 14px 14px 112px;
  background: var(--soft);
}

.profile-card {
  position: relative;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.cover-picker {
  position: relative;
  display: block;
  height: 154px;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(30, 36, 48, 0.92), rgba(30, 36, 48, 0.55)),
    radial-gradient(circle at 30% 10%, #dce6f7, #aeb8c6);
  background-position: center;
  background-size: cover;
  cursor: pointer;
}

.cover-picker input,
.avatar-picker input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cover-picker .media-edit,
.avatar-picker .media-edit {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 7px 10px;
  color: #050505;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  border: 0;
}

.avatar-picker .avatar-edit {
  right: -6px;
  bottom: 2px;
  padding: 6px 9px;
  font-size: 12px;
}

.avatar-picker {
  position: relative;
  display: grid;
  width: 104px;
  height: 104px;
  margin: -52px auto 0;
  place-items: center;
  color: #fff;
  background: #1e2430;
  background-position: center;
  background-size: cover;
  border: 6px solid var(--card);
  border-radius: 50%;
  cursor: pointer;
}

.avatar-picker svg {
  width: 58px;
  height: 58px;
  fill: currentColor;
}

.profile-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px 0;
  text-align: center;
}

.profile-title h2 {
  margin: 0;
  font-size: 25px;
  line-height: 1.05;
}

.verify-mark {
  display: grid;
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
}

.verify-mark svg {
  width: 17px;
  height: 17px;
  fill: #fff;
}

.verify-mark.verified {
  background: #1e2430;
}

.verify-mark.unverified {
  background: #9aa1ad;
}

.subtle-edit {
  display: block;
  margin: 12px auto 4px;
  padding: 7px 13px;
  color: #1e2430;
  background: #eef2f7;
  border: 0;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 900;
}

.profile-facts {
  display: grid;
  gap: 8px;
  margin: 14px 14px 16px;
}

.profile-facts div {
  padding: 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.profile-facts dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-facts dd {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
}

.profile-editor {
  display: grid;
  gap: 12px;
  padding: 0 14px 16px;
}

.profile-editor textarea {
  resize: vertical;
}

.privacy-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
}

.privacy-toggle input {
  width: 18px;
  height: 18px;
}

.profile-dialog form {
  gap: 12px;
}

.profile-dialog input:disabled {
  color: var(--muted);
  background: #eef2f7;
  border-style: dashed;
}

.image-viewer-dialog {
  width: min(100vw, 430px);
  max-width: 430px;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
  color: var(--text);
  background: #050505;
  border: 0;
}

.image-viewer-dialog::backdrop {
  background: rgba(0, 0, 0, 0.8);
}

.viewer-close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: 12px;
  z-index: 2;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.48);
  border: 0;
  border-radius: 50%;
  font-size: 22px;
  font-weight: 900;
}

.viewer-figure {
  display: grid;
  min-height: 48dvh;
  margin: 0;
  padding: max(62px, env(safe-area-inset-top)) 12px 14px;
  place-items: center;
  background: #050505;
}

.viewer-canvas {
  display: grid;
  width: 100%;
  aspect-ratio: 16 / 9;
  place-items: center;
  overflow: hidden;
  background: #000;
}

.viewer-canvas img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.viewer-post {
  min-height: 52dvh;
  overflow-y: auto;
  background: var(--card);
  border-radius: 18px 18px 0 0;
}

.viewer-post .post-head {
  grid-template-columns: 54px minmax(0, 1fr) 46px;
  gap: 12px;
  align-items: center;
  padding: 14px 18px 12px;
}

.viewer-avatar {
  width: 54px;
  height: 54px;
  background-position: center;
  background-size: cover;
}

.inline-check {
  display: inline-grid;
  width: 0.92em;
  height: 0.92em;
  margin-left: 5px;
  place-items: center;
  vertical-align: middle;
  background: #1e2430;
  border-radius: 50%;
}

.inline-check svg {
  width: 0.62em;
  height: 0.62em;
  fill: #fff;
}

.viewer-edit {
  display: grid;
  width: 34px;
  height: 34px;
  margin: 0 0 0 auto;
  place-items: center;
  color: #1e2430;
  background: #eef2f7;
  border: 0;
  border-radius: 50%;
}

.viewer-edit svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.viewer-actions {
  position: relative;
  overflow: visible;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.reaction-host {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.reaction-host *,
.reaction-tray *,
#viewerLikeBtn {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.reaction-host > button {
  width: 100%;
}

.reaction-tray {
  position: absolute;
  bottom: 42px;
  left: calc(16.666% - 27px);
  z-index: 4;
  display: flex;
  gap: 5px;
  padding: 8px 9px;
  pointer-events: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transform: translateY(14px) scale(0.82);
  transform-origin: 27px bottom;
  transition: opacity 0.18s ease, transform 0.2s cubic-bezier(0.18, 0.9, 0.22, 1.28);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.reaction-host.show-reactions .reaction-tray {
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.reaction-tray button {
  display: grid;
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  place-items: center;
  background: transparent;
  border: 0;
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
  transform: translateY(0) scale(1);
  transition: transform 0.14s cubic-bezier(0.2, 0.9, 0.2, 1.35), filter 0.13s ease;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.reaction-host ::selection,
.reaction-tray ::selection,
#viewerLikeBtn::selection {
  color: inherit;
  background: transparent;
}

.reaction-tray button:hover,
.reaction-tray button.active {
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.22));
  transform: translateY(-11px) scale(1.34);
}

.viewer-post p {
  margin: 0;
  padding: 0 18px 14px;
  color: var(--text);
  line-height: 1.4;
}

.viewer-comment {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}

.viewer-comment input {
  border-radius: 999px;
}

.viewer-comment button {
  min-height: 42px;
  padding: 0 12px;
  color: #fff;
  background: #1e2430;
  border: 0;
  border-radius: 999px;
  font-weight: 900;
}

.crop-dialog form {
  gap: 14px;
}

.crop-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  touch-action: none;
  background: #111722;
  border: 1px solid var(--line);
}

.crop-frame.cover-crop {
  aspect-ratio: 8 / 3;
  border-radius: 16px;
}

.crop-frame.avatar-crop {
  width: min(270px, 76vw);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
}

.crop-frame img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  user-select: none;
  -webkit-user-drag: none;
}

.crop-control {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-weight: 900;
}

.crop-control input {
  width: 100%;
}

/* Light theme override */
:root {
  --blue: #1877f2;
  --navy: #ffffff;
  --navy-2: #f0f2f5;
  --navy-3: #e9edf3;
  --text: #050505;
  --muted: #65676b;
  --line: #dddfe2;
  --soft: #f0f2f5;
  --card: #ffffff;
}

html,
body {
  background: #d9dbe1;
}

.phone-shell {
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.18);
}

.auth-view {
  background: var(--soft);
}

.auth-card {
  border: 0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.auth-brand h1,
.wordmark {
  color: #050505;
}

.composer-strip button:not(.photo-btn) {
  color: #111;
}

.story-card span {
  border-color: #fff;
}

.empty-story {
  color: #fff;
  background: linear-gradient(160deg, #444, #111);
}

.notice {
  color: #5f4300;
  background: #fff6d7;
  border-bottom-color: #f1d47a;
}

.post-category {
  color: var(--blue);
  background: #e7f0ff;
}

.bottom-nav button.active {
  color: #1e2430;
  background: #eef2f7;
}

.modal {
  border: 0;
}
