* {
  box-sizing: border-box;
}

:root {
  --page-bg: #d9e8f7;
  --topbar: #5f8fc2;
  --topbar-dark: #4779af;
  --card: #ffffff;
  --border: #c8d5e3;
  --text: #2e3338;
  --muted: #6e7a86;
  --link: #2f6ea2;
  --row-a: #e9f3fc;
  --row-b: #dcecf9;
  --tab: #5f93c5;
  --pink: #e44c9a;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background:
    linear-gradient(#cfe2f5 0, #e8f1f8 170px, #d9e8f7 100%);
  color: var(--text);
  font-size: 14px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--link);
}


/* TOPO */

.topbar {
  min-height: 42px;
  background:
    linear-gradient(
      to bottom,
      #80a8d0 0%,
      #5f8fc2 52%,
      #4d7eaf 100%
    );
  border-bottom: 1px solid #376999;
  box-shadow:
    inset 0 1px rgba(255,255,255,.35),
    0 1px 3px rgba(43,77,112,.25);
}

.topbar-inner {
  width: min(1220px, calc(100% - 20px));
  min-height: 42px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  flex: 0 0 auto;
  padding: 3px 13px 4px;
  background: #fff;
  border-radius: 2px;
  color: var(--pink);
  text-decoration: none;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -1.2px;
  box-shadow: 0 1px 2px rgba(0,0,0,.15);
}

.main-nav {
  display: flex;
  align-self: stretch;
  align-items: center;
}

.main-nav a {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 10px;
  color: #fff;
  text-decoration: none;
  text-shadow: 0 1px 1px rgba(0,0,0,.28);
  border-left: 1px solid rgba(255,255,255,.08);
  border-right: 1px solid rgba(37,78,118,.12);
}

.main-nav a:hover,
.main-nav a.active {
  background: rgba(255,255,255,.12);
}

.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.header-email {
  color: #1f456c;
  font-weight: 700;
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.search-box {
  height: 28px;
  display: flex;
  overflow: hidden;
  background: #fff;
  border: 1px solid #5b80a6;
}

.search-box input {
  width: 175px;
  min-width: 0;
  padding: 4px 7px;
  border: 0;
  outline: 0;
}

.search-box button {
  width: 30px;
  border: 0;
  border-left: 1px solid #b9c7d5;
  background: #456f99;
  color: white;
  font-size: 19px;
  cursor: pointer;
}


/* LAYOUT */

.page-shell {
  width: min(1220px, calc(100% - 20px));
  margin: 14px auto 28px;
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) 330px;
  gap: 12px;
  align-items: start;
}

.left-column,
.center-column,
.right-column {
  min-width: 0;
}

.card {
  background: var(--card);
  border: 1px solid rgba(141,165,190,.5);
  border-radius: 9px;
  box-shadow: 0 1px 5px rgba(70,101,132,.14);
}


/* COLUNA ESQUERDA */

.profile-summary-card {
  padding: 12px 10px 10px;
}

.avatar-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid #b5c2cf;
  background: #edf2f7;
}

.profile-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.change-photo-button {
  width: 100%;
  padding: 6px 4px 2px;
  border: 0;
  background: transparent;
  color: var(--link);
  cursor: pointer;
  font-size: 12px;
}

.side-name {
  margin: 8px 0 2px;
  font-size: 13px;
  font-weight: 400;
  color: #3b667e;
  word-break: break-word;
}

.side-summary {
  margin: 0 0 8px;
  color: #66737e;
  font-size: 12px;
  line-height: 1.25;
}

.friend-action {
  width: 100%;
  padding: 6px;
  text-align: left;
  border: 0;
  border-top: 1px solid #d7e1eb;
  background: white;
  color: #2e657d;
}

.more-link {
  display: block;
  padding: 7px 6px;
  border-top: 1px solid #d7e1eb;
  text-decoration: none;
  font-size: 12px;
}

.side-menu {
  margin-top: 10px;
  overflow: hidden;
  border-radius: 5px;
}

.side-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border: 0;
  border-bottom: 1px solid #cbd9e6;
  background: linear-gradient(#f5faff, #e6f0f8);
  color: #426b83;
  text-align: left;
  cursor: pointer;
}

.side-menu-item:last-child {
  border-bottom: 0;
}

.side-menu-item:hover,
.side-menu-item.active {
  background: linear-gradient(#eef7ff, #d7e9f8);
}


/* PERFIL CENTRAL */

.profile-main-card {
  overflow: hidden;
  border-radius: 0 38px 0 0;
}

.profile-title-row {
  padding: 12px 15px 8px;
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.profile-title-row h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 31px);
  font-weight: 400;
  line-height: 1.08;
  color: #111;
  word-break: break-word;
}

.edit-profile-button {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid #8faec8;
  border-radius: 3px;
  background: linear-gradient(#ffffff, #e1edf7);
  color: #346d98;
  cursor: pointer;
}

.profile-counters {
  padding: 4px 14px 9px;
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  border-bottom: 1px solid #b8c9d9;
}

.counter {
  min-width: 43px;
}

.counter-label {
  display: block;
  color: #66727c;
  font-size: 11px;
}

.counter strong {
  font-size: 16px;
  font-weight: 400;
  color: #555;
}

.rating {
  min-width: 75px;
}

.rating span:last-child {
  white-space: nowrap;
  font-size: 14px;
}

.section-tab {
  display: inline-block;
  margin-top: 5px;
  padding: 5px 22px;
  background: linear-gradient(#78a8d3, #5388bb);
  color: #fff;
  font-weight: 700;
  border-radius: 3px 3px 0 0;
}

.profile-fields {
  border-top: 1px solid #c8d8e7;
}

.profile-field-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  min-height: 28px;
  align-items: center;
}

.profile-field-row:nth-child(odd) {
  background: var(--row-a);
}

.profile-field-row:nth-child(even) {
  background: var(--row-b);
}

.field-label {
  padding: 6px 10px;
  text-align: right;
  color: #74808a;
}

.field-value {
  padding: 6px 12px;
  color: #20252a;
  min-width: 0;
  overflow-wrap: anywhere;
}


/* COLUNA DIREITA */

.right-card {
  margin-bottom: 12px;
  padding: 10px;
}

.right-card-title h3 {
  margin: 0 0 10px;
  color: #111;
  font-size: 17px;
}

.right-card-title span {
  color: #2f6e91;
  font-weight: 400;
}

.friends-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px 7px;
}

.friend-mini {
  min-width: 0;
  text-align: center;
  color: #477388;
  font-size: 11px;
}

.mini-avatar {
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 78px;
  margin: 0 auto 4px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, #d9e8f7, #b9cee1);
  border: 1px solid #bdcbd8;
  color: #5b7a95;
  font-size: 25px;
  overflow: hidden;
}

.friend-mini span {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.view-all {
  display: block;
  margin-top: 10px;
  padding-top: 7px;
  border-top: 1px solid #d7e0e8;
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
}

.communities-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.community-mini {
  min-width: 0;
  text-align: center;
  color: #477388;
  font-size: 11px;
}

.community-thumb {
  width: 100%;
  aspect-ratio: 1.1 / 1;
  display: grid;
  place-items: center;
  background: #eef4f9;
  border: 1px solid #c0ccd8;
  font-size: 25px;
}

.community-mini span {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* MODAL */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  padding: 20px;
  align-items: center;
  justify-content: center;
  background: rgba(25, 45, 65, .62);
  overflow-y: auto;
}

.modal-backdrop.show {
  display: flex;
}

.modal-card {
  width: min(760px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid #9fb5c9;
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(0,0,0,.28);
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 12px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(#f7fbff, #e2eef8);
  border-bottom: 1px solid #c5d4e2;
}

.modal-header h2 {
  margin: 0;
  color: #416f91;
  font-size: 20px;
}

.modal-close {
  border: 0;
  background: transparent;
  color: #55748e;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

#editProfileForm {
  padding: 15px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-group {
  min-width: 0;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  color: #526b7d;
  font-size: 12px;
  font-weight: 700;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #b9c9d7;
  border-radius: 3px;
  outline: none;
  background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #6d9cc4;
  box-shadow: 0 0 0 2px rgba(87,145,194,.12);
}

.form-group textarea {
  resize: vertical;
}

.edit-message {
  min-height: 20px;
  margin-top: 12px;
  font-size: 13px;
}

.edit-message.error {
  color: #b22b2b;
}

.edit-message.success {
  color: #247342;
}

.modal-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.secondary-button,
.save-button {
  padding: 9px 14px;
  border-radius: 3px;
  cursor: pointer;
}

.secondary-button {
  border: 1px solid #aebdca;
  background: #f6f8fa;
  color: #516777;
}

.save-button {
  border: 1px solid #4f7da4;
  background: linear-gradient(#73a2cc, #507fa9);
  color: white;
}


/* TABLET */

@media (max-width: 1000px) {

  .topbar-inner {
    flex-wrap: wrap;
    gap: 8px 14px;
    padding: 6px 0;
  }

  .main-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    border-top: 1px solid rgba(255,255,255,.13);
  }

  .main-nav a {
    min-height: 34px;
    white-space: nowrap;
  }

  .page-shell {
    grid-template-columns: 155px minmax(0, 1fr);
  }

  .right-column {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .right-card {
    margin: 0;
  }
}


/* MOBILE */

@media (max-width: 700px) {

  body {
    background: #dbe9f6;
  }

  .topbar-inner,
  .page-shell {
    width: calc(100% - 12px);
  }

  .topbar-inner {
    align-items: center;
  }

  .brand {
    font-size: 21px;
  }

  .top-actions {
    flex: 1;
    justify-content: flex-end;
  }

  .header-email {
    display: none;
  }

  .search-box {
    flex: 1;
    max-width: 220px;
  }

  .search-box input {
    width: 100%;
  }

  .page-shell {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
  }

  .left-column,
  .center-column,
  .right-column {
    width: 100%;
  }

  .left-column {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 8px;
  }

  .profile-summary-card {
    padding: 8px;
  }

  .side-summary,
  .more-link,
  .friend-action {
    display: none;
  }

  .side-menu {
    margin: 0;
  }

  .side-menu-item {
    min-height: 38px;
  }

  .profile-main-card {
    border-radius: 7px;
  }

  .profile-title-row {
    padding: 10px 11px 6px;
  }

  .profile-title-row h1 {
    font-size: 23px;
  }

  .profile-counters {
    gap: 10px;
    padding-inline: 10px;
  }

  .profile-field-row {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 8px 10px;
  }

  .field-label {
    padding: 0 0 3px;
    text-align: left;
    font-size: 11px;
  }

  .field-value {
    padding: 0;
    font-size: 14px;
  }

  .right-column {
    display: block;
  }

  .right-card {
    margin-top: 8px;
  }

  .friends-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-group.full {
    grid-column: auto;
  }

  .modal-backdrop {
    padding: 8px;
  }

  .modal-card {
    max-height: calc(100vh - 16px);
  }
}


@media (max-width: 420px) {

  .left-column {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .profile-title-row {
    flex-direction: column;
    align-items: stretch;
  }

  .edit-profile-button {
    align-self: flex-start;
  }

  .main-nav a {
    padding: 0 8px;
    font-size: 12px;
  }

  .logout-button {
    font-size: 12px;
  }
}


.photo-upload-status {
  min-height: 16px;
  margin: 2px 0 4px;
  text-align: center;
  font-size: 11px;
  line-height: 1.25;
  color: #5f7282;
}

.photo-upload-status.error {
  color: #b52d2d;
}

.photo-upload-status.success {
  color: #257044;
}

.change-photo-button:disabled {
  opacity: .6;
  cursor: wait;
}


.side-menu a.side-menu-item {
  text-decoration: none;
}

.friend-action.scraps-profile-link {
  text-decoration: none;
}


/* GALERIA REAL DE AMIGOS */

.friend-mini-link {
  display: block;
  color: #477388;
  text-decoration: none;
}

.friend-mini-link:hover .friend-mini-name {
  text-decoration: underline;
}

.friend-mini-photo {
  width: 100%;
  max-width: 78px;
  aspect-ratio: 1 / 1;
  margin: 0 auto 4px;
  display: block;
  object-fit: cover;
  border: 1px solid #bdcbd8;
  background: #edf2f7;
}

.friend-mini-name {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #477388;
  font-size: 11px;
  text-align: center;
}

.friends-gallery-loading,
.friends-gallery-empty {
  grid-column: 1 / -1;
  padding: 18px 6px;
  color: #74818b;
  font-size: 11px;
  text-align: center;
}


/* PERFIL VISITADO / AMIZADE */

.friend-action.profile-add-friend {
  cursor: pointer;
  color: #2e657d;
  background: linear-gradient(#ffffff, #edf5fb);
}

.friend-action.profile-add-friend:hover {
  background: linear-gradient(#f8fcff, #dcecf8);
}

.friend-action.profile-friend-pending {
  color: #7c681d;
  background: #fff7d7;
}

.friend-action.profile-friend-accepted {
  color: #317044;
  background: #e8f4eb;
}


/* BLOQUEIO DE USUÁRIOS */

.block-user-action {
  color: #9b3e3e;
  cursor: pointer;
  background: #fff7f7;
}

.block-user-action:hover {
  background: #fbe8e8;
}

.block-user-action:disabled {
  opacity: .6;
  cursor: wait;
}

.profile-blocked-state {
  padding: 32px 18px;
  text-align: center;
  color: #66737f;
}

.profile-blocked-state strong {
  display: block;
  margin-bottom: 6px;
  color: #3b4853;
  font-size: 16px;
}


/* SISTEMA DE FÃS */

.fan-user-action {
  color: #775b16;
  background: #fffdf2;
  cursor: pointer;
}

.fan-user-action:hover {
  background: #fff6cf;
}

.fan-user-action.is-fan {
  color: #406f4b;
  background: #f1fbf3;
}

.fan-user-action:disabled {
  opacity: .6;
  cursor: wait;
}


/* =========================================================
   VISITANTES RECENTES
   ========================================================= */

.recent-visitors-card[hidden] {
  display: none !important;
}

.visitors-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px 7px;
}

.visitor-mini-link {
  min-width: 0;
  color: #477388;
  text-align: center;
  text-decoration: none;
  font-size: 11px;
}

.visitor-mini-photo {
  width: 100%;
  max-width: 78px;
  aspect-ratio: 1 / 1;
  margin: 0 auto 4px;
  display: block;
  object-fit: cover;
  background: #eef4f9;
  border: 1px solid #bdcbd8;
}

.visitor-mini-name {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.visitors-loading,
.visitors-empty {
  grid-column: 1 / -1;
  padding: 12px 4px;
  color: #7b8790;
  text-align: center;
  font-size: 11px;
}

.visitors-empty[hidden] {
  display: none !important;
}

.visitors-privacy-note {
  margin-top: 10px;
  padding-top: 7px;
  border-top: 1px solid #d7e0e8;
  color: #89949c;
  font-size: 10px;
  line-height: 1.35;
}

@media (max-width: 760px) {
  .visitors-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .visitors-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}


/* =========================================================
   AVALIAÇÃO DO PERFIL: CONFIÁVEL / LEGAL / SEXY
   ========================================================= */

.profile-rating-button {
  border: 0;
  background: transparent;
  font: inherit;
  cursor: default;
}

.profile-rating-button.can-vote {
  cursor: pointer;
}

.profile-rating-button.can-vote:hover {
  background: #f2f8fc;
}

.profile-rating-button.selected {
  background: #eaf4fc;
  outline: 1px solid #adc5d7;
}

.rating-icons {
  display: inline-flex;
  align-items: center;
  gap: 1px;
}

.rating-icon {
  display: inline-block;
  filter: grayscale(1);
  opacity: .23;
  transition:
    filter .18s ease,
    opacity .18s ease,
    transform .18s ease;
}

.rating-icon.filled {
  filter: grayscale(0);
  opacity: 1;
}

.profile-rating-button.selected .rating-icon.filled {
  transform: translateY(-1px);
}

.rating-count {
  display: block;
  margin-top: 2px;
  color: #577286;
  font-size: 10px;
  line-height: 1;
}

.profile-rating-button:disabled {
  cursor: wait;
  opacity: .7;
}

/*
  Progressão visual:
  0 votos     = todos apagados
  1 a 4       = 1 ícone preenchido
  5 a 9       = 2 ícones preenchidos
  10 ou mais  = 3 ícones preenchidos
*/


/* =========================================================
   COMUNIDADES REAIS NO PERFIL
   ========================================================= */

.profile-communities-grid,
#profileCommunitiesGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 6px;
}

.profile-community-item {
  min-width: 0;
  color: #47738f;
  text-align: center;
  text-decoration: none;
  font-size: 10px;
}

.profile-community-photo {
  width: 100%;
  max-width: 76px;
  aspect-ratio: 1 / 1;
  margin: 0 auto 4px;
  display: block;
  object-fit: cover;
  border: 1px solid #b8c8d4;
  background: #edf3f8;
}

.profile-community-name {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.profile-communities-empty {
  padding: 12px 4px;
  color: #7c8992;
  text-align: center;
  font-size: 10px;
}

.profile-communities-empty[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .profile-communities-grid,
  #profileCommunitiesGrid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .profile-communities-grid,
  #profileCommunitiesGrid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}


/* =========================================================
   MOBILE - CONTADORES + AVALIAÇÕES EM DUAS LINHAS
   Recados / Fotos / Fãs
   Confiável / Legal / Sexy
   ========================================================= */

@media (max-width: 700px) {

  .profile-counters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    padding: 0;
    border-bottom: 1px solid #b8c9d9;
    background: #fff;
  }

  .profile-counters > .counter {
    min-width: 0;
    margin: 0;
    padding: 10px 4px;
    text-align: center;
    border-right: 1px solid #d6e1ea;
  }

  .profile-counters > .counter:nth-child(3),
  .profile-counters > .profile-rating-button:last-child {
    border-right: 0;
  }

  /* Primeira linha: recados / fotos / fãs */
  .profile-counters > .counter:nth-child(-n + 3) {
    grid-row: 1;
    background: #fff;
  }

  /* Segunda linha: confiável / legal / sexy */
  .profile-counters > .profile-rating-button {
    grid-row: 2;
    width: 100%;
    min-width: 0;
    min-height: 72px;
    padding: 9px 3px 10px;
    border-top: 1px solid #d3e0ea;
    background: #f7fbfe;
    border-radius: 0;
  }

  .profile-counters > .profile-rating-button.can-vote {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .profile-counters > .profile-rating-button.can-vote:active {
    background: #eaf4fc;
  }

  .profile-counters > .profile-rating-button.selected {
    background: #e7f2fb;
    outline: none;
    box-shadow: inset 0 0 0 1px #adc5d7;
  }

  .profile-counters .counter-label {
    margin-bottom: 3px;
    font-size: 11px;
    line-height: 1.15;
    text-align: center;
  }

  .profile-counters > .counter:nth-child(-n + 3) strong {
    display: block;
    font-size: 18px;
    line-height: 1.15;
  }

  .profile-rating-button .rating-icons {
    display: flex;
    justify-content: center;
    gap: 2px;
    min-height: 25px;
  }

  .profile-rating-button .rating-icon {
    font-size: 19px;
    line-height: 1.2;
  }

  .profile-rating-button .rating-count {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    line-height: 1;
    text-align: center;
  }
}


@media (max-width: 380px) {

  .profile-counters > .counter {
    padding-inline: 2px;
  }

  .profile-counters .counter-label {
    font-size: 10px;
  }

  .profile-rating-button .rating-icon {
    font-size: 17px;
  }

  .profile-counters > .profile-rating-button {
    min-height: 68px;
  }
}


/* =========================================================
   MOBILE - BLOQUEIO DE ZOOM
   ========================================================= */

html,
body {
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

input,
textarea,
select,
button {
  font-size: 16px;
}

@media (min-width: 701px) {
  input,
  textarea,
  select,
  button {
    font-size: inherit;
  }
}


/* =========================================================
   MOBILE - MANTER LAYOUT ORIGINAL + EXIBIR AÇÕES DO PERFIL
   ========================================================= */

@media (max-width: 700px) {

  /*
   * Mantém intacta a estrutura mobile original do profile.
   * Apenas torna visíveis os botões que o JavaScript não marcou
   * com o atributo hidden.
   */
  .profile-summary-card .friend-action:not([hidden]),
  .profile-summary-card #profilePrimaryAction:not([hidden]),
  .profile-summary-card #blockUserButton:not([hidden]),
  .profile-summary-card #fanUserButton:not([hidden]),
  .profile-summary-card #blockedUsersLink:not([hidden]) {
    display: block;
  }

  .profile-summary-card #profilePrimaryAction:not([hidden]),
  .profile-summary-card #blockUserButton:not([hidden]),
  .profile-summary-card #fanUserButton:not([hidden]),
  .profile-summary-card #blockedUsersLink:not([hidden]) {
    width: 100%;
    min-height: 38px;
    margin-top: 5px;
    padding: 8px 9px;
    box-sizing: border-box;
    border: 1px solid #d0dce6;
    border-radius: 3px;
    background: linear-gradient(#ffffff, #edf4f9);
    color: #356b8b;
    font-size: 11px;
    line-height: 1.25;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .profile-summary-card #profilePrimaryAction:not([hidden]):active,
  .profile-summary-card #blockUserButton:not([hidden]):active,
  .profile-summary-card #fanUserButton:not([hidden]):active,
  .profile-summary-card #blockedUsersLink:not([hidden]):active {
    background: #e6f1f8;
  }

  .profile-summary-card #fanUserButton.is-fan:not([hidden]) {
    background: #fff7d8;
    border-color: #decf88;
  }

  /*
   * Usuários bloqueados é uma ação da própria conta.
   * Continua aparecendo apenas quando o HTML/JS não o ocultar.
   */
  .profile-summary-card #blockedUsersLink:not([hidden]) {
    color: #5d6e7c;
  }
}


@media (max-width: 420px) {

  .profile-summary-card #profilePrimaryAction:not([hidden]),
  .profile-summary-card #blockUserButton:not([hidden]),
  .profile-summary-card #fanUserButton:not([hidden]),
  .profile-summary-card #blockedUsersLink:not([hidden]) {
    min-height: 40px;
    padding: 9px 8px;
    font-size: 11px;
  }
}




/* =========================================================
   PERFIL - COLUNA LATERAL MAIS PARA A ESQUERDA
   ========================================================= */

@media (min-width: 701px) {
  .profile-layout .left-column,
  .profile-page .left-column,
  .left-column {
    transform: translateX(-8px) !important;
  }
}

@media (max-width: 700px) {
  .left-column {
    transform: translateX(0px) !important;
    position: static !important;
    left: auto !important;
    padding-left: 0 !important;
    box-sizing: border-box;
  }
}

@media (max-width: 420px) {
  .left-column {
    transform: translateX(-1px) !important;
  }
}


/* =========================================================
   PERFIL - FONTE MENOR NOS BOTÕES ABAIXO DA FOTO
   ========================================================= */

.profile-summary-card .friend-action,
.profile-summary-card #profilePrimaryAction,
.profile-summary-card #blockUserButton,
.profile-summary-card #fanUserButton,
.profile-summary-card #blockedUsersLink,
.profile-summary-card #reportProfileButton,
.profile-summary-card #changePhotoButton {
  font-size: 10px !important;
}

@media (max-width: 700px) {
  .profile-summary-card .friend-action,
  .profile-summary-card #profilePrimaryAction,
  .profile-summary-card #blockUserButton,
  .profile-summary-card #fanUserButton,
  .profile-summary-card #blockedUsersLink,
  .profile-summary-card #reportProfileButton,
  .profile-summary-card #changePhotoButton {
    font-size: 9px !important;
  }
}

/* Atividade: visível somente no próprio perfil */
#profileActivityLink[hidden] {
  display: none !important;
}

/* =========================================================
   PERFIL - VISITANTES RECENTES ACIMA DE SOCIAL (V18)
   ========================================================= */
.profile-visitors-panel {
  margin: 18px 0 16px;
  border: 1px solid #c8d7e4;
  background: linear-gradient(180deg, #f9fcff 0%, #f2f7fb 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
}

.profile-visitors-panel[hidden] {
  display: none !important;
}

.profile-visitors-heading {
  min-height: 44px;
  padding: 8px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #d4e0ea;
  background: #e9f2f8;
}

.profile-visitors-kicker {
  display: block;
  margin-bottom: 1px;
  color: #8094a5;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.profile-visitors-heading h2 {
  margin: 0;
  color: #355d78;
  font-size: 14px;
  line-height: 1.15;
  font-weight: 700;
}

.profile-visitors-eye {
  font-size: 20px;
  opacity: .68;
}

.profile-visitors-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-bottom: 1px solid #dbe5ed;
  background: rgba(255, 255, 255, .78);
}

.profile-visitor-stat {
  min-width: 0;
  padding: 10px 11px;
  border-right: 1px solid #e1e9ef;
}

.profile-visitor-stat:last-child {
  border-right: 0;
}

.profile-visitor-stat-label {
  display: block;
  margin-bottom: 4px;
  color: #7e8d98;
  font-size: 10px;
  line-height: 1.2;
}

.profile-visitor-stat strong {
  display: block;
  color: #3e5f75;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.profile-recent-visitors-row {
  padding: 10px 11px 12px;
  color: #657786;
  font-size: 11px;
  line-height: 1.4;
}

.profile-recent-visitors-label {
  display: block;
  margin-bottom: 8px;
  color: #526c7e;
  font-weight: 700;
}

.profile-recent-visitors-list {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px 8px;
  align-items: start;
}

.profile-recent-visitor-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  color: #2f72a4;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.profile-recent-visitor-avatar {
  width: 54px;
  height: 54px;
  display: block;
  object-fit: cover;
  border: 1px solid #c8d8e3;
  border-radius: 3px;
  background: #eef4f8;
}

.profile-recent-visitor-username {
  width: 100%;
  margin-top: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  line-height: 1.2;
}

.profile-recent-visitor-link:hover,
.profile-recent-visitor-link:focus {
  color: #174e78;
  text-decoration: none;
}

.profile-recent-visitor-link:hover .profile-recent-visitor-username,
.profile-recent-visitor-link:focus .profile-recent-visitor-username {
  text-decoration: underline;
}

.profile-recent-visitor-separator {
  display: none;
}

.profile-visitors-panel .visitors-loading,
.profile-visitors-panel .visitors-empty {
  padding: 0;
  color: #8b98a2;
  text-align: left;
  font-size: 10px;
}

.profile-visitors-panel > .visitors-empty {
  margin: -4px 11px 11px;
}

@media (max-width: 620px) {
  .profile-visitors-stats {
    grid-template-columns: 1fr;
  }

  .profile-visitor-stat {
    border-right: 0;
    border-bottom: 1px solid #e1e9ef;
  }

  .profile-visitor-stat:last-child {
    border-bottom: 0;
  }

  .profile-recent-visitors-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .profile-recent-visitor-avatar {
    width: 52px;
    height: 52px;
  }
}

/* Promova: disponível apenas no próprio perfil */
#profilePromoteLink[hidden]{display:none !important;}
#profileEventsLink[hidden]{display:none !important;}


/* =========================================================
   PERFIL - SORTE DE HOJE (V25)
   Módulo integrado ao mesmo padrão visual do perfil.
   ========================================================= */
.profile-fortune-panel {
  margin: 0 0 16px;
  border: 1px solid #c8d7e4;
  background: linear-gradient(180deg, #f9fcff 0%, #f2f7fb 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
  overflow: hidden;
  box-sizing: border-box;
}

.profile-fortune-heading {
  min-height: 44px;
  padding: 8px 11px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #d4e0ea;
  background: #e9f2f8;
  box-sizing: border-box;
}

.profile-fortune-kicker {
  display: block;
  margin-bottom: 1px;
  color: #8094a5;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.profile-fortune-heading h2 {
  margin: 0;
  color: #355d78;
  font-size: 14px;
  line-height: 1.15;
  font-weight: 700;
}

.profile-fortune-body {
  min-height: 48px;
  padding: 11px 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(255, 255, 255, .78);
  color: #536b7c;
  box-sizing: border-box;
}

.profile-fortune-symbol {
  flex: 0 0 auto;
  margin-top: 1px;
  color: #d34f91;
  font-size: 13px;
  line-height: 1.4;
}

.profile-fortune-text {
  min-width: 0;
  color: #4f6473;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 400;
  overflow-wrap: anywhere;
}

@media (max-width: 620px) {
  .profile-fortune-panel {
    margin-bottom: 14px;
  }

  .profile-fortune-heading {
    min-height: 42px;
    padding: 8px 10px;
  }

  .profile-fortune-body {
    padding: 10px;
    gap: 7px;
  }
}


/* =========================================================
   PERFIL - PRÓXIMOS ANIVERSÁRIOS (V26)
   Inspirado no módulo clássico da página inicial do Orkut.
   ========================================================= */
.profile-birthdays-panel {
  margin: 0 0 16px;
  border: 1px solid #c8d7e4;
  background: #fff;
  box-sizing: border-box;
  overflow: hidden;
}

.profile-birthdays-panel[hidden] {
  display: none !important;
}

.profile-birthdays-heading {
  min-height: 36px;
  padding: 8px 11px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #d4e0ea;
  background: #e9f2f8;
  box-sizing: border-box;
}

.profile-birthdays-heading h2 {
  margin: 0;
  color: #355d78;
  font-size: 14px;
  line-height: 1.15;
  font-weight: 700;
  text-transform: lowercase;
}

.profile-birthdays-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px 8px;
  padding: 12px 10px 13px;
  background: #fff;
  box-sizing: border-box;
}

.profile-birthday-item {
  min-width: 0;
  text-align: center;
}

.profile-birthday-avatar-link {
  width: 58px;
  height: 58px;
  display: block;
  margin: 0 auto 5px;
  border: 1px solid #c8d3dc;
  background: #f2f5f7;
  overflow: hidden;
  box-sizing: border-box;
  text-decoration: none;
}

.profile-birthday-avatar {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.profile-birthday-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #91a2af;
  font-size: 24px;
}

.profile-birthday-copy {
  min-width: 0;
  line-height: 1.2;
}

.profile-birthday-name {
  display: block;
  color: #2f6f9f;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-birthday-name:hover,
.profile-birthday-scrap:hover {
  text-decoration: underline;
}

.profile-birthday-date {
  display: block;
  margin-top: 2px;
  color: #697d8b;
  font-size: 10px;
}

.profile-birthday-scrap {
  display: block;
  margin-top: 1px;
  color: #d34f91;
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
}

.profile-birthdays-loading,
.profile-birthdays-empty {
  display: block;
  padding: 12px;
  color: #7a8d9b;
  font-size: 11px;
}

.profile-birthdays-empty {
  background: #fff;
}

@media (max-width: 760px) {
  .profile-birthdays-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .profile-birthdays-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 11px 6px;
    padding: 10px 8px 12px;
  }

  .profile-birthday-avatar-link {
    width: 54px;
    height: 54px;
  }
}


/* =========================================================
   PERFIL - TEXTOS EM CAIXA BAIXA (V29)
   Visitantes recentes + Sorte de hoje
   ========================================================= */
.profile-visitors-panel,
.profile-fortune-panel {
  text-transform: lowercase;
}

.profile-visitors-kicker {
  display: none !important;
}

/* =========================================================
   PERFIL - VISITANTES RECENTES: @username completo (V26)
   Evita corte de usernames longos e mantém o selo visível.
   ========================================================= */
.profile-recent-visitor-username {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: center;
}

.profile-recent-visitor-username.orkutis-verified-inline {
  display: inline-flex !important;
  width: 100%;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  column-gap: 3px;
  row-gap: 1px;
}

.profile-recent-visitor-username > .orkutis-verified-badge {
  margin-left: 0 !important;
  flex: 0 0 auto;
}

@media (max-width: 620px) {
  .profile-recent-visitor-link {
    min-width: 0;
    overflow: visible;
  }

  .profile-recent-visitor-username {
    font-size: 9px;
    line-height: 1.15;
    min-height: 21px;
  }
}
