:root {
  --bg: #0a1020 !important;
  --bg-soft: #121b34 !important;
  --bg-card: #141f38 !important;
  --line: #2a3b62 !important;
  --text: #f3f7ff !important;
  --muted: #9ca9cc !important;
  --primary: #38d6c1 !important;
  --accent: #ff866e !important;
  --accent-2: #57b5ff !important;
  --radius: 18px !important;
  --radius-lg: 24px !important;
  --space-1: 8px !important;
  --space-2: 12px !important;
  --space-3: 16px !important;
  --space-4: 20px !important;
  --space-5: 28px !important;
  --text-sm: 13px !important;
  --text-md: 15px !important;
  --text-lg: clamp(21px, 2.1vw, 28px) !important;
  --text-xl: clamp(26px, 2.8vw, 38px) !important;
  --icon-size: 16px !important;
  --shadow: 0 18px 36px rgba(4, 10, 24, 0.42) !important;
}

html,
body {
  color: var(--text);
  line-height: 1.45;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(1100px 560px at -10% -20%, rgba(56, 214, 193, 0.2), transparent 60%),
    radial-gradient(900px 500px at 120% -10%, rgba(87, 181, 255, 0.18), transparent 58%),
    radial-gradient(1000px 700px at 40% 120%, rgba(255, 134, 110, 0.14), transparent 62%),
    linear-gradient(180deg, #0a1020 0%, #090f1d 100%) !important;
}

body {
  letter-spacing: 0.01em;
}

.rail,
.panel,
.feed-shell,
.side,
.main,
.card,
.panel-card,
.metric,
.post,
.story-card {
  border-color: var(--line) !important;
  box-shadow: var(--shadow) !important;
}

.rail,
.panel,
.feed-shell,
.side,
.main,
.card {
  background: linear-gradient(166deg, rgba(22, 33, 58, 0.92), rgba(12, 20, 38, 0.95)) !important;
  border-radius: var(--radius-lg) !important;
}

.feed-shell,
.main,
.card {
  overflow: clip;
}

.feed-top,
.head {
  padding: var(--space-4) var(--space-4) var(--space-3) !important;
}

.feed,
.content {
  padding: var(--space-4) !important;
  gap: var(--space-3) !important;
}

.stories-strip {
  padding: var(--space-3) var(--space-4) !important;
}

.nav-link,
.side a,
.m-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: var(--text-md) !important;
  font-weight: 700 !important;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-link::before,
.side a::before,
.m-link::before {
  content: "•";
  width: var(--icon-size);
  height: var(--icon-size);
  display: inline-grid;
  place-items: center;
  font-size: calc(var(--icon-size) - 2px);
  line-height: 1;
  border-radius: 6px;
  color: #d5e8ff;
  background: rgba(87, 181, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(87, 181, 255, 0.22);
  flex: 0 0 auto;
  opacity: 0.92;
}

.nav-link[href="/"]::before,
.side a[href="/"]::before,
.m-link[href="/"]::before { content: "⌂"; }

.nav-link[href="/explore"]::before,
.side a[href="/explore"]::before,
.m-link[href="/explore"]::before { content: "◎"; }

.nav-link[href="/stories"]::before,
.side a[href="/stories"]::before,
.m-link[href="/stories"]::before { content: "◉"; }

.nav-link[href="/live"]::before,
.side a[href="/live"]::before,
.m-link[href="/live"]::before { content: "◍"; }

.nav-link[href="/private-chats"]::before,
.side a[href="/private-chats"]::before,
.m-link[href="/private-chats"]::before { content: "✉"; }

.nav-link[href="/notifications"]::before,
.side a[href="/notifications"]::before,
.m-link[href="/notifications"]::before { content: "◌"; }

.nav-link[href="/creator"]::before,
.side a[href="/creator"]::before,
.m-link[href="/creator"]::before { content: "+"; }

.nav-link[href="/dashboard"]::before,
.side a[href="/dashboard"]::before,
.m-link[href="/dashboard"]::before { content: "▦"; }

.nav-link[href="/profile-settings"]::before,
.side a[href="/profile-settings"]::before,
.m-link[href="/profile-settings"]::before { content: "⚙"; }

.nav-link[href="/following"]::before,
.side a[href="/following"]::before,
.m-link[href="/following"]::before { content: "◔"; }

.nav-link[href="/profile"]::before,
.side a[href="/profile"]::before,
.m-link[href="/profile"]::before { content: "◡"; }

.nav-link[href="/guidelines"]::before,
.side a[href="/guidelines"]::before,
.m-link[href="/guidelines"]::before { content: "⛨"; }

.nav-link[href="/report"]::before,
.side a[href="/report"]::before,
.m-link[href="/report"]::before { content: "⚑"; }

.nav-link[href="#"]::before,
.side a[href="#"]::before,
.m-link[href="#"]::before { content: "↗"; }

.nav-link.create::before,
.quick-actions a.primary::before,
button[type="submit"]::before {
  display: none;
}

.nav-link:hover,
.side a:hover,
.m-link:hover {
  color: var(--text) !important;
  border-color: rgba(87, 181, 255, 0.35) !important;
  background: linear-gradient(90deg, rgba(56, 214, 193, 0.14), rgba(87, 181, 255, 0.08)) !important;
  transform: translateY(-1px);
}

.nav-link.active,
.side a.active,
.m-link.active {
  border-color: rgba(56, 214, 193, 0.55) !important;
  background: linear-gradient(92deg, rgba(56, 214, 193, 0.2), rgba(87, 181, 255, 0.12)) !important;
  color: var(--text) !important;
}

.nav-link.active::before,
.side a.active::before,
.m-link.active::before {
  color: #08202b;
  background: linear-gradient(145deg, #3cdac5, #6dbdff);
  box-shadow: none;
}

.nav-link.create,
.quick-actions a.primary,
button,
button[type="submit"] {
  background: linear-gradient(102deg, #38d6c1, #68e2cf) !important;
  color: #071720 !important;
  border-color: transparent !important;
}

button,
.quick-actions a,
.tab,
.act {
  border-radius: 12px !important;
  font-weight: 700 !important;
  transition: transform 0.18s ease, filter 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

button:hover,
.quick-actions a:hover,
.tab:hover,
.act:hover {
  transform: translateY(-1px);
}

.search,
input,
textarea,
select {
  border-radius: 12px !important;
  font-size: var(--text-md) !important;
  border-color: #30466f !important;
  background: rgba(8, 14, 30, 0.82) !important;
  color: var(--text) !important;
}

.feed-top,
.head {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(87, 181, 255, 0.22) !important;
}

.feed-top::before,
.head::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(56, 214, 193, 0.88), rgba(87, 181, 255, 0.7), rgba(255, 134, 110, 0.72));
}

.feed-top::after,
.head::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -120px;
  top: -190px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(87, 181, 255, 0.22), transparent 70%);
  pointer-events: none;
}

.search:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(56, 214, 193, 0.4) !important;
  border-color: rgba(56, 214, 193, 0.55) !important;
}

.status,
.badge,
.warning-chip {
  border-color: rgba(87, 181, 255, 0.28) !important;
}

.status,
.post-text,
.author-meta,
.story-name,
.links a,
.trend,
.suggest,
.activity-item span,
.check-item span,
.metric-label {
  font-size: var(--text-sm) !important;
  color: var(--muted) !important;
}

.brand,
.feed-title,
.head h1,
h1,
h2 {
  font-family: Sora, "Segoe UI", sans-serif !important;
  letter-spacing: -0.02em;
}

.brand {
  font-size: clamp(25px, 2.2vw, 33px) !important;
  text-shadow: 0 6px 22px rgba(87, 181, 255, 0.2);
}

.feed-title,
.head h1,
h1 {
  font-size: var(--text-xl) !important;
  line-height: 1.1 !important;
}

h2,
.panel h2,
.panel-title {
  font-size: var(--text-lg) !important;
  line-height: 1.15 !important;
}

.metric-value {
  font-size: clamp(30px, 3vw, 42px) !important;
  line-height: 1.05 !important;
}

.metric {
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(87, 181, 255, 0.2), transparent 62%),
    linear-gradient(165deg, rgba(15, 24, 43, 0.92), rgba(10, 18, 33, 0.96)) !important;
  border-color: rgba(82, 117, 176, 0.45) !important;
}

.metric .metric-label {
  text-transform: none !important;
  letter-spacing: 0.03em !important;
}

.post {
  background:
    radial-gradient(130% 90% at 100% 0%, rgba(56, 214, 193, 0.09), transparent 65%),
    linear-gradient(170deg, rgba(22, 32, 57, 0.97), rgba(12, 18, 34, 0.98)) !important;
}

.post-head {
  padding-top: 14px !important;
  padding-bottom: 12px !important;
}

.post-body {
  padding-top: 0 !important;
  padding-bottom: 16px !important;
}

.post-media {
  border-radius: 14px !important;
  border-color: rgba(87, 181, 255, 0.28) !important;
}

.post-actions {
  gap: 10px !important;
}

.act {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.01)) !important;
  border-color: rgba(91, 121, 179, 0.42) !important;
}

.act:hover {
  background: linear-gradient(92deg, rgba(56, 214, 193, 0.18), rgba(87, 181, 255, 0.14)) !important;
  border-color: rgba(88, 170, 226, 0.58) !important;
}

.stories-strip {
  border-bottom-color: rgba(87, 181, 255, 0.22) !important;
}

.story-ring {
  box-shadow: 0 8px 20px rgba(14, 31, 58, 0.5);
}

.card {
  position: relative;
}

.card::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -60px;
  top: -90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 214, 193, 0.2), transparent 72%);
  pointer-events: none;
}

.subhead {
  max-width: 42ch;
}

.post,
.panel-card,
.metric,
.panel,
.activity-item,
.check-item {
  border-radius: 16px !important;
}

.post-head,
.post-body,
.post-stats,
.post-actions,
.panel-card,
.metric,
.activity-item,
.check-item {
  padding-left: var(--space-3) !important;
  padding-right: var(--space-3) !important;
}

.mobile-nav {
  background: rgba(10, 16, 32, 0.88) !important;
  backdrop-filter: blur(10px);
  border-color: #30466f !important;
}

@keyframes felcin-fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.feed-shell,
.main,
.card,
.post,
.panel-card,
.metric,
.story-card,
.side,
.rail,
.panel {
  animation: felcin-fade-up 0.38s ease both;
}

.nav-link,
.side a,
.m-link,
button,
.quick-actions a,
.tab,
.act {
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .feed-shell,
  .main,
  .card,
  .post,
  .panel-card,
  .metric,
  .story-card,
  .side,
  .rail,
  .panel {
    animation: none !important;
  }

  .nav-link,
  .side a,
  .m-link,
  button,
  .quick-actions a,
  .tab,
  .act {
    transition: none !important;
  }
}

@media (max-width: 1024px) {
  .feed-top,
  .head,
  .feed,
  .content,
  .stories-strip {
    padding-left: var(--space-3) !important;
    padding-right: var(--space-3) !important;
  }

  .feed-title,
  .head h1,
  h1 {
    font-size: clamp(24px, 4.2vw, 32px) !important;
  }

  .feed-top::after,
  .head::after {
    width: 200px;
    height: 200px;
    right: -120px;
    top: -140px;
  }
}

@media (max-width: 680px) {
  :root {
    --text-md: 14px !important;
    --text-sm: 12px !important;
  }

  .feed-top,
  .head,
  .feed,
  .content,
  .stories-strip {
    padding-left: var(--space-2) !important;
    padding-right: var(--space-2) !important;
  }

  .nav-link,
  .side a,
  .m-link,
  button,
  .quick-actions a,
  .tab,
  .act {
    min-height: 42px;
  }

  .brand {
    font-size: clamp(22px, 7vw, 28px) !important;
  }
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(56, 214, 193, 0.8), rgba(87, 181, 255, 0.72));
  border-radius: 999px;
}

::-webkit-scrollbar-track {
  background: rgba(8, 14, 30, 0.58);
}

/* Enterprise clean pass: minimalist premium visual language */
:root {
  --bg: #0d121c !important;
  --bg-soft: #131a27 !important;
  --bg-card: #161f2d !important;
  --line: #2a3448 !important;
  --text: #eef3fb !important;
  --muted: #9aa8bd !important;
  --primary: #4fa3ff !important;
  --accent: #7ab8ff !important;
  --accent-2: #91c5ff !important;
  --shadow: 0 10px 24px rgba(5, 10, 20, 0.28) !important;
}

html,
body {
  background: linear-gradient(180deg, #0d121c, #0b1018) !important;
}

.rail,
.panel,
.feed-shell,
.side,
.main,
.card,
.post,
.panel-card,
.metric,
.story-card {
  background: #131b29 !important;
  border-color: #293445 !important;
  box-shadow: var(--shadow) !important;
}

.feed-top::after,
.head::after,
.card::after {
  display: none !important;
}

.feed-top::before,
.head::before {
  height: 1px !important;
  background: rgba(122, 184, 255, 0.45) !important;
}

.nav-link,
.side a,
.m-link {
  gap: 8px !important;
  border-radius: 10px !important;
  color: #c8d4e6 !important;
  background: transparent !important;
}

.nav-link::before,
.side a::before,
.m-link::before {
  content: "" !important;
  width: 3px !important;
  height: 14px !important;
  border-radius: 2px !important;
  background: rgba(145, 197, 255, 0.3) !important;
  box-shadow: none !important;
}

.nav-link:hover,
.side a:hover,
.m-link:hover {
  background: rgba(122, 184, 255, 0.08) !important;
  border-color: rgba(122, 184, 255, 0.22) !important;
  transform: none !important;
}

.nav-link.active,
.side a.active,
.m-link.active {
  background: rgba(122, 184, 255, 0.14) !important;
  border-color: rgba(122, 184, 255, 0.35) !important;
}

.nav-link.active::before,
.side a.active::before,
.m-link.active::before {
  background: #7ab8ff !important;
}

.nav-link.create,
.quick-actions a.primary,
button,
button[type="submit"] {
  background: #7ab8ff !important;
  color: #0d1726 !important;
}

button,
.quick-actions a,
.tab,
.act {
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease !important;
}

button:hover,
.quick-actions a:hover,
.tab:hover,
.act:hover {
  transform: none !important;
}

.post,
.metric,
.panel-card,
.activity-item,
.check-item {
  border-radius: 12px !important;
}

.metric {
  background: #121a27 !important;
  border-color: #2c384d !important;
}

.metric-value {
  font-size: clamp(28px, 2.6vw, 36px) !important;
}

.act {
  background: #182233 !important;
  border-color: #2d3a4f !important;
}

.act:hover {
  background: #1d2a3f !important;
  border-color: #3d5376 !important;
}

.status,
.badge,
.warning-chip {
  background: rgba(122, 184, 255, 0.08) !important;
  border-color: rgba(122, 184, 255, 0.22) !important;
}

.feed-shell,
.main,
.card,
.post,
.panel-card,
.metric,
.story-card,
.side,
.rail,
.panel {
  animation: none !important;
}

.nav-link,
.side a,
.m-link,
button,
.quick-actions a,
.tab,
.act {
  will-change: auto !important;
}

/* Mobile rescue pass: improve readability, spacing, and bottom-nav behavior */
@media (max-width: 860px) {
  html,
  body {
    overflow-x: hidden !important;
  }

  body {
    display: block !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    padding: 10px 10px calc(92px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .rail,
  aside.panel,
  .side {
    display: none !important;
    min-height: 0 !important;
  }

  .feed-shell,
  .main,
  .card,
  .post,
  .panel-card,
  .metric,
  .story-card {
    min-width: 0 !important;
    min-height: auto !important;
    border-radius: 14px !important;
  }

  .feed-top,
  .head {
    display: grid !important;
    gap: 10px !important;
    align-items: start !important;
    padding: 12px !important;
  }

  .feed,
  .content,
  .stories-strip {
    padding: 12px !important;
  }

  .stories-strip {
    gap: 10px !important;
  }

  .search,
  #feed-search,
  input,
  textarea,
  select {
    width: 100% !important;
    font-size: 16px !important;
  }

  .post-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .post-media,
  video,
  img {
    max-width: 100% !important;
  }

  .post-media {
    max-height: 62vh !important;
  }

  .mobile-nav {
    display: grid !important;
    position: fixed !important;
    left: 8px !important;
    right: 8px !important;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 80 !important;
    padding: 8px !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    border-radius: 14px !important;
  }

  .m-link {
    min-height: 44px !important;
    display: grid !important;
    place-items: center !important;
    font-size: 11px !important;
    padding: 8px 2px !important;
  }

  .story-viewer {
    padding: 10px !important;
  }

  .story-card {
    width: min(100%, 390px) !important;
  }
}

@media (max-width: 420px) {
  :root {
    --text-md: 14px !important;
    --text-sm: 12px !important;
  }

  .feed-title,
  .head h1,
  h1 {
    font-size: clamp(20px, 7vw, 26px) !important;
  }

  .stories-strip,
  .feed,
  .content,
  .feed-top,
  .head {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .story-ring {
    width: 56px !important;
    height: 56px !important;
  }

  .story-plus-badge {
    width: 20px !important;
    height: 20px !important;
    right: -5px !important;
    bottom: -3px !important;
    font-size: 14px !important;
  }
}

/* ── Accessibility & Focus Indicators ── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.nav-link:focus-visible,
.m-link:focus-visible,
.act:focus-visible,
.tab:focus-visible {
  outline: 2px solid var(--primary) !important;
  outline-offset: 2px !important;
}

/* Screen-reader only utility */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Skip to content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: #000;
  padding: 8px 16px;
  z-index: 99999;
  font-weight: 700;
  border-radius: 0 0 8px 0;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
}

/* Touch target minimum 44px */
@media (pointer: coarse) {
  button,
  .act,
  .tab,
  .nav-link,
  .m-link,
  a[role="button"] {
    min-height: 44px !important;
    min-width: 44px !important;
  }
}

/* High contrast mode support */
@media (forced-colors: active) {
  .nav-link.active {
    border: 2px solid LinkText !important;
  }
  button {
    border: 1px solid ButtonText !important;
  }
}
