:root {
  --bg-main: #0f0f10;
  --bg-soft: #1d1e22;
  --text-main: #f5f5f5;
  --text-muted: #cbcbcf;
  --panel: rgba(255, 255, 255, 0.05);
  --panel-strong: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.16);
  --accent-red: #b0121b;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  --radius: 18px;
  --space-bump: 4px;
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

.auth-prompt-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: grid;
  place-items: center;
  z-index: 2000;
  padding: 1rem;
}

.auth-prompt-card {
  width: min(460px, 92vw);
  background: rgba(18, 14, 14, 0.95);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1.1rem;
}

.auth-prompt-card h2 {
  margin: 0 0 0.4rem;
}

.auth-prompt-card p {
  margin: 0;
  color: var(--text-muted);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  font-family: "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
  color: var(--text-main);
  background: var(--bg-main);
}

body::before {
  content: "";
  position: fixed;
  inset: -12%;
  background-image:
    radial-gradient(circle at 16% 24%, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.02) 18%, rgba(255, 255, 255, 0) 36%),
    radial-gradient(circle at 78% 20%, rgba(255, 255, 255, 0.11) 0%, rgba(255, 255, 255, 0.03) 20%, rgba(255, 255, 255, 0) 38%),
    radial-gradient(circle at 22% 74%, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.025) 19%, rgba(255, 255, 255, 0) 37%),
    radial-gradient(circle at 85% 78%, rgba(255, 255, 255, 0.085) 0%, rgba(255, 255, 255, 0.02) 16%, rgba(255, 255, 255, 0) 34%),
    radial-gradient(circle at 52% 50%, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.015) 20%, rgba(255, 255, 255, 0) 40%);
  animation: driftSpots 12s ease-in-out infinite alternate;
  will-change: transform;
  pointer-events: none;
  z-index: -2;
}

body::after {
  content: "";
  position: fixed;
  inset: -8%;
  background-image:
    radial-gradient(ellipse at 12% 58%, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 22%, rgba(255, 255, 255, 0) 44%),
    radial-gradient(ellipse at 63% 66%, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.012) 24%, rgba(255, 255, 255, 0) 48%),
    radial-gradient(ellipse at 90% 38%, rgba(255, 255, 255, 0.045) 0%, rgba(255, 255, 255, 0.01) 18%, rgba(255, 255, 255, 0) 40%);
  animation: driftSpotsReverse 18s ease-in-out infinite alternate;
  will-change: transform;
  pointer-events: none;
  z-index: -1;
}

@keyframes driftSpots {
  0% { transform: translate3d(-3%, 1.5%, 0) scale(1); }
  50% { transform: translate3d(2.5%, -2.2%, 0) scale(1.055); }
  100% { transform: translate3d(-2%, 2.8%, 0) scale(1.03); }
}

@keyframes driftSpotsReverse {
  0% { transform: translate3d(2.4%, -1.4%, 0) scale(1.03); }
  50% { transform: translate3d(-2.2%, 2.1%, 0) scale(1.005); }
  100% { transform: translate3d(2%, -2.5%, 0) scale(1.045); }
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1260px, 92vw);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  background: rgba(12, 12, 13, 0.82);
  border-bottom: 1px solid var(--border);
}

.nav {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(1rem + var(--space-bump));
}

.brand {
  display: flex;
  align-items: center;
  gap: calc(0.8rem + var(--space-bump));
  font-weight: 800;
  letter-spacing: 0.4px;
  font-size: 1.08rem;
}

.brand-logo {
  width: clamp(40px, 3.5vw, 52px);
  border-radius: 12px;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 0.35rem 0.65rem;
  font-size: 1.3rem;
  cursor: pointer;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: calc(1.25rem + var(--space-bump));
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-weight: 700;
  opacity: 0.9;
  transition: transform 220ms ease, opacity 220ms ease, color 220ms ease;
}

.nav-links a:hover,
.nav-links a.active {
  opacity: 1;
  color: #ffffff;
  transform: translateY(-1px);
}

.nav-links a.active {
  text-shadow: 0 0 12px rgba(176, 18, 27, 0.45);
}

main {
  flex: 1;
  padding: calc(3.5rem + var(--space-bump)) 0 calc(6rem + var(--space-bump));
}

.hero {
  padding: calc(5.25rem + var(--space-bump)) 0 calc(3.5rem + var(--space-bump));
  text-align: center;
}

.heading-gradient,
.section-title,
.page-title {
  margin: 0;
  font-size: clamp(2.5rem, 6.6vw, 5.6rem);
  font-weight: 900;
  line-height: 1.08;
  color: #ffffff;
  letter-spacing: 0.4px;
}

.tagline {
  max-width: 840px;
  margin: calc(1.4rem + var(--space-bump)) auto 0;
  font-size: clamp(1.12rem, 2.2vw, 1.42rem);
  color: var(--text-muted);
}

.hero-actions,
.stack-buttons {
  margin-top: calc(2.1rem + var(--space-bump));
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: calc(1rem + var(--space-bump));
}

.btn,
button {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: transform 240ms ease, box-shadow 240ms ease, filter 240ms ease, border-color 240ms ease;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: calc(0.82rem + 2px) calc(1.38rem + 2px);
  background: #f2f2f2;
  color: #141414;
  box-shadow: var(--shadow);
}

.btn:hover,
button:hover {
  transform: translateY(-3px) scale(1.015);
  filter: brightness(1.03);
  border-color: rgba(176, 18, 27, 0.45);
}

.btn:active,
button:active {
  transform: translateY(0);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: #f4f4f4;
}

.btn-small {
  padding: 0.45rem 0.9rem;
}

.section-title,
.page-title {
  font-size: clamp(2rem, 4.8vw, 3.3rem);
  margin-bottom: calc(1.5rem + var(--space-bump));
}

.grid-cards,
.project-grid,
.feed-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: calc(1.35rem + var(--space-bump));
}

.card,
.panel,
.auth-card,
.profile-head,
.message-layout {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card {
  grid-column: span 3;
  padding: calc(1.4rem + var(--space-bump));
}

.card h3 {
  margin-top: 0;
}

.card[data-feature-link] {
  transition: transform 260ms ease, border-color 260ms ease, background-color 260ms ease;
}

.card[data-feature-link]:hover,
.card[data-feature-link]:focus-visible {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.08);
}

.site-footer {
  border-top: 1px solid var(--border);
  background: rgba(12, 12, 13, 0.88);
  padding: calc(1.2rem + var(--space-bump)) 0;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(1rem + var(--space-bump));
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: calc(0.9rem + var(--space-bump));
}

.floating-cta {
  position: fixed;
  right: 2.2rem;
  bottom: 2.3rem;
  z-index: 1001;
  width: 114px;
  text-align: center;
  color: #fff;
  font-size: 0.86rem;
  font-weight: 800;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  transition: transform 260ms ease;
}

.floating-cta:hover {
  transform: translateY(-6px) scale(1.03);
}

.floating-cta img {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.08);
  padding: 0.35rem;
  object-fit: contain;
  box-shadow: var(--shadow);
  animation: pulse 3.6s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.page-section {
  padding: calc(1.65rem + var(--space-bump)) 0 calc(3rem + var(--space-bump));
}

.auth-wrap {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 170px);
}

.auth-card {
  width: min(620px, 92vw);
  padding: calc(1.65rem + var(--space-bump));
}

.form-grid {
  display: grid;
  gap: calc(1rem + var(--space-bump));
}

input,
textarea,
select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  color: #1d1d1f;
  font: inherit;
  padding: calc(0.65rem + 2px) calc(0.85rem + 2px);
}

.sleek-file-input {
  padding: 0.45rem;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 12px;
}

.sleek-file-input::file-selector-button {
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: linear-gradient(180deg, #ffffff 0%, #ededed 100%);
  color: #121212;
  font: inherit;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.48rem 0.9rem;
  margin-right: 0.65rem;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.sleek-file-input::file-selector-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  background: linear-gradient(180deg, #ffffff 0%, #e4e4e4 100%);
}

.form-message {
  min-height: 1.25rem;
  font-size: 0.9rem;
  font-weight: 700;
}

.success { color: #b8ffbd; }
.error { color: #ffb8b8; }

.profile-head {
  display: flex;
  gap: calc(1.4rem + var(--space-bump));
  padding: calc(1.35rem + var(--space-bump));
  align-items: center;
}

.avatar {
  width: 95px;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.65);
}

.profile-identity {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
}

.profile-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.stat-row {
  display: flex;
  gap: calc(1rem + var(--space-bump));
  flex-wrap: wrap;
  margin-top: calc(0.5rem + var(--space-bump));
}

.stat-chip,
.tag {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 0.88rem;
  font-weight: 700;
}

.project-card,
.feed-card,
.comment,
.message-box,
notification-box {
  background: var(--panel-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: calc(1.2rem + var(--space-bump));
}

.project-card {
  grid-column: span 4;
}

.clickable-card {
  cursor: pointer;
}

.clickable-card:hover {
  transform: translateY(-4px);
}

.feed-card {
  grid-column: span 6;
}

.card-image {
  border-radius: 12px;
  margin-bottom: calc(1rem + var(--space-bump));
  height: 195px;
  object-fit: cover;
  width: 100%;
}

.meta-row {
  display: flex;
  gap: calc(0.45rem + var(--space-bump));
  flex-wrap: wrap;
  margin: calc(0.55rem + 2px) 0;
}

.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(0.5rem + var(--space-bump));
  margin-top: calc(0.75rem + var(--space-bump));
}

.icon-btn {
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid var(--border);
}

.icon-btn:hover {
  background: rgba(176, 18, 27, 0.26);
}

.project-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: calc(1rem + var(--space-bump));
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: calc(0.7rem + var(--space-bump));
}

.media-grid img {
  border-radius: 12px;
  min-height: 120px;
  object-fit: cover;
}

.comment-thread {
  display: grid;
  gap: calc(0.7rem + var(--space-bump));
  margin-top: calc(1rem + var(--space-bump));
}

.project-creator,
.project-analytics {
  margin-bottom: calc(1rem + var(--space-bump));
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: calc(0.7rem + var(--space-bump));
}

.stat-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem;
}

.stat-card h3 {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.stat-card p {
  margin: 0.45rem 0 0;
  font-size: 1.35rem;
  font-weight: 800;
}

.analytics-feed-list {
  margin-top: calc(0.9rem + var(--space-bump));
  display: grid;
  gap: calc(0.55rem + var(--space-bump));
}

.analytics-item {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
  font-size: 0.92rem;
}

.dashboard-head {
  margin-bottom: calc(1.1rem + var(--space-bump));
}

.dashboard-head .page-title {
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.12);
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: calc(1.15rem + var(--space-bump));
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px);
  position: relative;
}

.dashboard-layout::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0) 42%);
  border-radius: 24px;
}

.dashboard-messages {
  border-right: 1px solid rgba(255, 255, 255, 0.15);
  padding-right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
}

.dashboard-messages::after {
  content: "";
  position: absolute;
  right: 0.75rem;
  top: 0.9rem;
  width: 1px;
  height: calc(100% - 1.8rem);
  background: rgba(255, 255, 255, 0.08);
}

.dashboard-side-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.dashboard-side-title-row h2,
.dashboard-center h2 {
  margin: 0;
  font-size: 1.03rem;
  letter-spacing: 0.01em;
}

.dashboard-message-list,
.dashboard-project-list {
  display: grid;
  gap: 0.75rem;
}

.dashboard-mini-item {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.75rem 0.85rem;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.06);
}

.dashboard-mini-item p {
  margin: 0.25rem 0 0;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: calc(0.85rem + var(--space-bump));
}

.dashboard-stats article {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.dashboard-stats article::after {
  content: "";
  position: absolute;
  top: 0;
  right: -18%;
  width: 220%;
  height: 40%;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 45%);
  pointer-events: none;
}

.dashboard-stats article h3 {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.dashboard-stats article p {
  margin: 0.4rem 0 0;
  font-size: 1.4rem;
  font-weight: 900;
}

.dashboard-center {
  display: grid;
  gap: calc(0.95rem + var(--space-bump));
}

.dashboard-center-block {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.06);
}

.dashboard-center-block h2 {
  margin: 0 0 0.85rem;
  font-size: 1rem;
}

.reply {
  margin-left: calc(1.5rem + var(--space-bump));
  border-left: 2px solid rgba(255, 255, 255, 0.24);
  padding-left: calc(0.8rem + var(--space-bump));
}

.filter-bar {
  display: flex;
  gap: calc(1.1rem + var(--space-bump));
  margin-bottom: calc(1.5rem + var(--space-bump));
  flex-wrap: wrap;
}

.explore-subtitle {
  margin: calc(0.6rem + var(--space-bump)) 0 calc(1.3rem + var(--space-bump));
  color: var(--text-muted);
}

.filter-bar label {
  display: grid;
  gap: calc(0.45rem + var(--space-bump));
  min-width: 180px;
  font-weight: 700;
}

.filter-bar select {
  min-height: 44px;
}

.explore-tabs {
  margin-bottom: calc(0.9rem + var(--space-bump));
}

.feed-author-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.author-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 800;
  padding: 0.28rem 0.7rem;
}

.author-link-btn:hover {
  background: rgba(176, 18, 27, 0.22);
}

.author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.42);
}

.feed-actions-inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.icon-btn.is-active {
  background: rgba(176, 18, 27, 0.35);
  border-color: rgba(255, 255, 255, 0.5);
}

.user-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.user-result-main p {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
}

.message-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: calc(1.3rem + var(--space-bump));
  padding: calc(1.2rem + var(--space-bump));
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.03)),
    radial-gradient(circle at 10% 15%, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0));
}

.message-layout.list-view {
  grid-template-columns: 1fr;
}

.message-layout.list-view .chat-window {
  display: none;
}

.message-layout.focus-chat {
  grid-template-columns: 1fr;
}

.message-layout.focus-chat .chat-list {
  display: none;
}

.messages-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.messages-tab {
  padding: 0.62rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-weight: 800;
}

.messages-tab.active {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.48);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.messages-sidebar-head h2 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
}

.messages-sidebar-head p {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.messages-panel {
  display: none;
  margin-top: 0.7rem;
  gap: 0.7rem;
}

.messages-panel.active {
  display: grid;
}

.messages-subtitle {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  opacity: 0.9;
}

.messages-tools {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  margin-bottom: 0.7rem;
  position: relative;
  top: -3px;
}

.messages-tools input[type="search"] {
  min-height: 40px;
}

.clean-sidebar,
.clean-notifications {
  align-content: start;
}

.conversation-item {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 0.25rem;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.05));
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 0.8rem 0.9rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

.conversation-item:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.4);
}

.contact-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 0.72rem;
}

.contact-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.contact-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.contact-availability {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.contact-availability.is-open {
  background: rgba(102, 255, 170, 0.18);
  border-color: rgba(102, 255, 170, 0.38);
}

.contact-availability.is-locked {
  background: rgba(255, 188, 84, 0.14);
  border-color: rgba(255, 188, 84, 0.34);
}

.contact-profile-link {
  display: inline-grid;
  color: inherit;
  text-decoration: none;
}

.contact-profile-link:hover strong,
.contact-profile-link:hover span {
  text-decoration: underline;
}

.conversation-item.locked {
  opacity: 0.75;
}

.conversation-item.locked .contact-lock {
  font-size: 0.75rem;
  opacity: 0.85;
}

.conversation-item span {
  font-size: 0.86rem;
  opacity: 0.88;
  display: block;
  line-height: 1.28;
  white-space: normal;
  overflow-wrap: anywhere;
}

.contact-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
}

.unread-badge {
  min-width: 24px;
  padding: 0.14rem 0.42rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(176, 18, 27, 0.9);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
}

.conversation-item.active {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.13));
  border-color: rgba(255, 255, 255, 0.58);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.26);
}

.clean-chat-window {
  display: grid;
  gap: 0.85rem;
  align-content: start;
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border-radius: 16px;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  padding: 0.2rem 0 0.8rem;
}

.chat-header-pro {
  justify-content: flex-start;
}

.back-arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1;
}

.chat-contact-photo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.chat-contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
  text-decoration: none;
}

.chat-contact-meta {
  display: grid;
  gap: 0.1rem;
}

.chat-status {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  opacity: 0.85;
}

.thread-list {
  display: grid;
  gap: 0.65rem;
  height: clamp(320px, 58vh, 640px);
  overflow-y: auto;
  overflow-x: hidden;
  align-content: start;
  padding-right: 0.25rem;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.thread-list::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.notifications-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.chat-block-btn {
  min-width: 88px;
  border-color: rgba(255, 120, 120, 0.55);
  color: #ffd8d8;
}

.chat-block-btn.is-unblock {
  border-color: rgba(102, 255, 170, 0.5);
  color: #cdf9df;
}

.message-form-inline {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.message-form-inline input[type="text"] {
  background: transparent;
  border: 0;
  color: #fff;
}

.message-form-inline input[type="text"]:focus {
  outline: none;
}

.message-image-dialog {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 12px;
  padding: 0.5rem 0.6rem;
  background: rgba(255, 255, 255, 0.08);
}

.message-image-preview {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.message-image-meta {
  display: grid;
  gap: 0.1rem;
}

.message-image-meta strong {
  font-size: 0.86rem;
}

.message-image-meta p {
  margin: 0;
  font-size: 0.8rem;
  opacity: 0.88;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.image-upload-btn input {
  display: none;
}

.chat-image {
  max-width: 220px;
  border-radius: 12px;
  margin-top: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.empty-thread {
  opacity: 0.85;
  font-size: 0.92rem;
}

.inline-loading {
  display: grid;
  gap: 0.45rem;
  width: 100%;
}

.inline-loading-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.inline-loading-track {
  position: relative;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.inline-loading-fill {
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(242, 242, 242, 0.95), rgba(255, 255, 255, 0));
  animation: inlineLoadingSweep 1.1s ease-in-out infinite;
}

@keyframes inlineLoadingSweep {
  0% { left: -40%; }
  100% { left: 100%; }
}

.notification-item {
  text-align: left;
  width: 100%;
  display: grid;
  gap: 0.2rem;
}

.notification-item strong {
  font-size: 0.9rem;
}

.notification-item p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.empty-conversations {
  border: 1px dashed rgba(255, 255, 255, 0.28);
  border-radius: 12px;
  padding: 0.9rem;
}

.empty-conversations p {
  margin: 0.25rem 0;
}

.chat-list,
.chat-window,
.notifications {
  display: grid;
  gap: calc(0.65rem + var(--space-bump));
}

.thread-list .message-box {
  position: relative;
  width: fit-content;
  max-width: min(74%, 560px);
  min-width: 0;
  padding: 0.58rem 0.75rem;
  border-radius: 14px 14px 14px 6px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.thread-list .message-box > div {
  margin: 0;
  line-height: 1.32;
  font-size: 0.92rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.thread-list .message-time {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  opacity: 0.75;
}

.thread-list .message-box.me {
  margin-left: auto;
  text-align: left;
  border-radius: 14px 14px 6px 14px;
  border-color: rgba(255, 214, 214, 0.38);
  background: linear-gradient(145deg, rgba(176, 18, 27, 0.9), rgba(125, 10, 17, 0.88));
  color: #fff;
  box-shadow: 0 12px 26px rgba(125, 10, 17, 0.35);
}

.thread-list .message-box .chat-image {
  border-radius: 10px;
}

.thread-list .message-box.me .chat-image {
  border-color: rgba(255, 255, 255, 0.45);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: calc(1.2rem + var(--space-bump));
}

.settings-card {
  grid-column: span 6;
  padding: 1.1rem;
}

.settings-card h2 {
  margin-top: 0;
}

.settings-toggles {
  display: grid;
  gap: 0.65rem;
}

.settings-toggles label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.15rem;
}

.settings-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.display-name-row {
  position: relative;
  top: -3px;
}

:is(.settings-toggles input[type="checkbox"], .settings-toggle-row input[type="checkbox"]) {
  appearance: none;
  -webkit-appearance: none;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  position: relative;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

:is(.settings-toggles input[type="checkbox"], .settings-toggle-row input[type="checkbox"])::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 180ms ease;
}

:is(.settings-toggles input[type="checkbox"], .settings-toggle-row input[type="checkbox"]):checked {
  background: rgba(176, 18, 27, 0.9);
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(176, 18, 27, 0.18);
}

:is(.settings-toggles input[type="checkbox"], .settings-toggle-row input[type="checkbox"]):checked::before {
  transform: translateX(20px);
}

:is(.settings-toggles input[type="checkbox"], .settings-toggle-row input[type="checkbox"]):focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
}

body.sf-compact {
  --space-bump: 1px;
}

body.sf-border-mode {
  --text-main: #ffffff;
  --text-muted: #f2f2f2;
  --border: rgba(255, 255, 255, 0.55);
}

body.sf-reduced-motion *,
body.sf-reduced-motion *::before,
body.sf-reduced-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

.animate-on-scroll {
  opacity: 0;
  transform: translate3d(0, 26px, 0) scale(0.975) rotateX(6deg);
  filter: blur(8px) saturate(0.82);
  position: relative;
  z-index: 1;
  transition:
    opacity 760ms cubic-bezier(0.2, 0.9, 0.22, 1),
    transform 760ms cubic-bezier(0.2, 0.9, 0.22, 1),
    filter 680ms ease;
  transition-delay: var(--reveal-delay, 0ms);
  will-change: transform, opacity, filter;
}

.animate-on-scroll.in-view {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1) rotateX(0deg);
  filter: blur(0) saturate(1);
}

.btn,
.conversation-item,
.message-box,
.panel,
.card,
.project-card,
.feed-card {
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    border-color 220ms ease,
    background-color 220ms ease,
    filter 220ms ease;
}

.hero[data-tilt] {
  transition: transform 260ms ease;
}

@media (max-width: 980px) {
  .card { grid-column: span 6; }
  .project-card { grid-column: span 6; }
  .feed-card { grid-column: span 12; }
  .analytics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-layout { grid-template-columns: 1fr; }
  .dashboard-messages {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-right: 0;
    padding-bottom: 0.8rem;
  }
  .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-layout { grid-template-columns: 1fr; }
  .message-layout { grid-template-columns: 1fr; }
  .clean-chat-window { padding: 0.7rem; }
  .settings-card { grid-column: span 12; }
}

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }

  .nav-links {
    position: absolute;
    top: 72px;
    right: 4vw;
    background: rgba(18, 12, 12, 0.94);
    padding: 0.8rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    display: none;
  }

  .nav-links.open { display: flex; }
  .card,
  .project-card { grid-column: span 12; }
  .dashboard-stats { grid-template-columns: 1fr; }
  .dashboard-layout { gap: 0.75rem; }
  .analytics-grid { grid-template-columns: 1fr; }
  .media-grid { grid-template-columns: 1fr 1fr; }
  .profile-head { flex-direction: column; align-items: flex-start; }
  .message-form-inline {
    grid-template-columns: 1fr;
    border-radius: 16px;
  }
  .thread-list {
    max-height: 48vh;
    min-height: 240px;
  }
  .floating-cta {
    right: 1rem;
    bottom: 1rem;
    width: 94px;
  }
}
