:root {
  --primary: #1da1f2;
  --primary-rgb: 29 161 242;
  --primary-hover: #168fd5;
  --primary-light: #e8f5fe;
  --secondary: #657786;
  --secondary-light: #aab8c2;
  --secondary-border: #c5d0d9;
  --surface-dark: #15202b;
  --surface-dark-border: #38444d;
}

/* Softer shadows for light mode; dark mode keeps its existing contrast. */
body:not(.dark-mode) .sidebar {
  box-shadow: 8px 0 30px rgb(23 32 42 / 0.025);
}

body:not(.dark-mode) .compose-button {
  box-shadow: 0 8px 18px rgb(var(--primary-rgb) / 0.12);
}

body:not(.dark-mode) .search-submit {
  box-shadow: 0 8px 18px rgb(var(--primary-rgb) / 0.12);
}

body.dark-mode .search-submit {
  box-shadow: 0 8px 18px rgb(var(--primary-rgb) / 0.25);
}

body:not(.dark-mode) .post-container,
body:not(.dark-mode) .post,
body:not(.dark-mode) .profile-header,
body:not(.dark-mode) .profile-stat {
  box-shadow: 0 8px 24px rgb(23 32 42 / 0.05);
}

body:not(.dark-mode) .modal-content {
  box-shadow: 0 22px 60px rgb(14 24 32 / 0.14);
}

body:not(.dark-mode) .app-dropdown-menu,
body:not(.dark-mode) .site-notification {
  box-shadow: 0 10px 26px rgb(14 24 32 / 0.1);
}

body:not(.dark-mode) .site-notification {
  box-shadow: 0 8px 24px rgb(14 24 32 / 0.08);
}

body:not(.dark-mode) .search-input-wrap,
body:not(.dark-mode) .search-results {
  box-shadow: 0 8px 12px rgb(23 32 42 / 0.05);
}

body:not(.dark-mode) .search-input-wrap:focus-within {
  box-shadow: 0 0 0 3px rgb(var(--primary-rgb) / 0.08);
}

/* Landing page */
.landing-page {
  min-height: 100vh;
  padding: 0;
  color: #17202a;
  background: #f7f9fa;
  overflow-x: hidden;
}

.landing-header,
.landing-hero,
.landing-features,
.landing-stats,
.landing-bottom-cta,
.landing-footer {
  width: min(1160px, calc(100% - 48px));
  margin: 0 auto;
}

.landing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 0;
}

.landing-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #17202a;
  font-size: 23px;
  font-weight: 800;
  text-decoration: none;
}

.landing-brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  color: var(--primary);
  background: transparent;
}

.landing-brand-mark i {
  font-size: 29px;
}

.landing-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14px;
  font-weight: 700;
}

.landing-nav a {
  color: var(--secondary);
  text-decoration: none;
}

.landing-nav a:hover {
  color: var(--primary);
}

.landing-nav-cta {
  padding: 12px 18px;
  border-radius: 999px;
  color: #ffffff !important;
  background: var(--primary);
}

.landing-nav-cta:hover {
  background: var(--primary-hover);
}

.landing-nav-cta i {
  margin-left: 7px;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(430px, 1.05fr);
  align-items: center;
  gap: 58px;
  padding: 78px 0 120px;
}

.landing-eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 19px;
  color: var(--primary-hover);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.landing-eyebrow span {
  width: 27px;
  height: 2px;
  border-radius: 4px;
  background: currentColor;
}

.landing-hero h1 {
  max-width: 600px;
  margin: 0;
  color: #17202a;
  font-size: clamp(3.4rem, 6vw, 5.7rem);
  font-weight: 800;
  letter-spacing: -0.075em;
  line-height: 0.95;
}

.landing-hero h1 em {
  color: var(--primary);
  font-style: normal;
}

.landing-lede {
  max-width: 510px;
  margin: 28px 0 30px;
  color: var(--secondary);
  font-size: 18px;
  line-height: 1.65;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.landing-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  box-sizing: border-box;
  padding: 0 21px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.landing-button-primary {
  color: #ffffff;
  background: var(--primary);
}

.landing-button-primary:hover {
  background: var(--primary-hover);
}

.landing-button-quiet {
  color: var(--secondary);
  background: #ffffff;
  border: 1px solid var(--secondary-border);
}

.landing-button-quiet:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.landing-note {
  margin: 21px 0 0;
  color: var(--secondary-light);
  font-size: 12px;
  font-weight: 700;
}

.landing-note i {
  margin-right: 5px;
  color: var(--primary);
}

.landing-visual {
  position: relative;
  display: grid;
  min-height: 475px;
  place-items: center;
}

.landing-orbit {
  position: absolute;
  border: 1px solid rgb(var(--primary-rgb) / 15%);
  border-radius: 50%;
}

.landing-orbit-one {
  width: 550px;
  height: 300px;
}

.landing-orbit-two {
  width: 420px;
  height: 420px;
  border-color: rgb(var(--primary-rgb) / 12%);
}

.landing-feed-card {
  position: relative;
  z-index: 1;
  width: min(100%, 430px);
  box-sizing: border-box;
  padding: 0 22px 14px;
  border: 1px solid var(--secondary-border);
  border-radius: 12px;
  background: #ffffff;
}

.landing-feed-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 17px;
  color: var(--secondary);
  font-size: 13px;
  font-weight: 800;
  border-bottom: 1px solid var(--secondary-border);
}

.landing-window-dots {
  display: flex;
  gap: 5px;
}

.landing-window-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--secondary-light);
}

.landing-window-dots i:nth-child(2) {
  background: var(--primary);
}

.landing-window-dots i:nth-child(3) {
  background: var(--secondary);
}

.landing-post {
  display: flex;
  gap: 12px;
  padding: 23px 0;
  border-bottom: 1px solid var(--secondary-border);
}

.landing-post:last-child {
  padding-bottom: 12px;
  border-bottom: 0;
}

.landing-post-muted {
  opacity: 0.78;
}

.landing-avatar {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--primary);
  font-size: 15px;
  font-weight: 800;
}

.landing-avatar-orange {
  background: var(--secondary);
}

.landing-post-body {
  min-width: 0;
  color: #17202a;
  font-size: 13px;
}

.landing-post-body span {
  color: var(--secondary);
  font-size: 11px;
}

.landing-post-body p {
  margin: 9px 0 16px;
  font-size: 14px;
  line-height: 1.5;
}

.landing-post-actions {
  display: flex;
  justify-content: space-between;
  color: var(--secondary);
  font-size: 11px;
}

.landing-post-actions i {
  margin-right: 4px;
}

.landing-post-actions .is-liked {
  color: var(--primary);
}

.landing-float {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 15px;
  border: 1px solid var(--secondary-border);
  border-radius: 999px;
  color: var(--secondary);
  background: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.landing-float i {
  color: var(--primary);
}

.landing-float-top {
  top: 56px;
  right: 0;
}

.landing-float-bottom {
  bottom: 56px;
  left: 0;
}

.landing-features {
  padding: 0 0 112px;
}

.landing-stats {
  padding: 0 0 112px;
  box-sizing: border-box;
}

.landing-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  width: min(1000px, 100%);
  margin: 0 auto;
}

.landing-stat {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 29px 27px;
  border: 1px solid var(--secondary-border);
  border-radius: 12px;
  background: #ffffff;
}

.landing-stat strong {
  color: var(--primary);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.06em;
}

.landing-stat span {
  color: var(--secondary);
  font-size: 14px;
  font-weight: 700;
}

.landing-section-heading {
  max-width: 580px;
  margin-bottom: 42px;
}

.landing-section-heading h2,
.landing-bottom-cta h2 {
  margin: 0;
  color: #17202a;
  font-size: clamp(2.1rem, 4vw, 3.4rem);
  letter-spacing: -0.055em;
  line-height: 1;
}

.landing-section-heading > p:last-child {
  margin: 15px 0 0;
  color: var(--secondary);
  line-height: 1.6;
}

.landing-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.landing-feature {
  padding: 29px 27px;
  border: 1px solid var(--secondary-border);
  border-radius: 12px;
  background: #ffffff;
}

.landing-feature-icon {
  display: grid;
  width: 43px;
  height: 43px;
  margin-bottom: 22px;
  place-items: center;
  border-radius: 8px;
  color: var(--primary);
  background: var(--primary-light);
}

.landing-feature h3 {
  margin: 0 0 9px;
  color: #17202a;
  font-size: 18px;
}

.landing-feature p {
  margin: 0;
  color: var(--secondary);
  font-size: 14px;
  line-height: 1.6;
}

.landing-bottom-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 45px;
  padding: 42px 48px;
  box-sizing: border-box;
  border: 1px solid var(--surface-dark-border);
  border-radius: 12px;
  background: var(--surface-dark);
}

.landing-bottom-cta .landing-eyebrow {
  color: var(--primary);
}

.landing-bottom-cta h2 {
  color: #ffffff;
}

.landing-bottom-cta .landing-button-primary {
  color: var(--surface-dark);
  background: #ffffff;
}

.landing-bottom-cta .landing-button-primary:hover {
  color: var(--primary);
}

.landing-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 25px 0 30px;
  border-top: 1px solid var(--secondary-border);
  color: var(--secondary-light);
  font-size: 12px;
}

.landing-footer .landing-brand {
  font-size: 16px;
}

.landing-footer .landing-brand-mark {
  width: 28px;
  height: 28px;
}

@media (max-width: 800px) {
  .landing-hero {
    grid-template-columns: 1fr;
    padding-top: 55px;
  }

  .landing-hero-copy {
    text-align: center;
  }

  .landing-eyebrow,
  .landing-actions {
    justify-content: center;
  }

  .landing-lede {
    margin-right: auto;
    margin-left: auto;
  }

  .landing-visual {
    min-height: 430px;
  }

  .landing-feature-grid {
    grid-template-columns: 1fr;
  }

  .landing-stat-grid {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 560px) {
  .landing-header,
  .landing-hero,
  .landing-features,
  .landing-stats,
  .landing-bottom-cta,
  .landing-footer {
    width: min(100% - 32px, 1160px);
  }

  .landing-nav a:not(.landing-nav-cta) {
    display: none;
  }

  .landing-nav {
    gap: 8px;
  }

  .landing-hero h1 {
    font-size: 3.35rem;
  }

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

  .landing-button {
    width: 100%;
    justify-content: center;
  }

  .landing-visual {
    min-height: 380px;
    margin: -15px -25px;
    transform: scale(0.88);
  }

  .landing-bottom-cta {
    align-items: flex-start;
    flex-direction: column;
    padding: 32px 25px;
  }

  .landing-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

html[data-theme="matrix"] {
  --primary: #00d957; --primary-rgb: 0 217 87; --primary-hover: #00b848; --primary-light: #d8ffe7;
  --secondary: #5a9b70; --secondary-light: #9fd0ad; --secondary-border: #5e9b70;
  --surface-dark: #07150c; --surface-dark-border: #1e4e2d;
}
html[data-theme="fire"] {
  --primary: #ff5a1f; --primary-rgb: 255 90 31; --primary-hover: #e0440b; --primary-light: #ffe0d2;
  --secondary: #a66a56; --secondary-light: #d8a28f; --secondary-border: #b87862;
  --surface-dark: #1b0b08; --surface-dark-border: #663022;
}
html[data-theme="serika-dark"] {
  --primary: #e2b714; --primary-rgb: 226 183 20; --primary-hover: #caa20b; --primary-light: #fff3bd;
  --secondary: #8b8575; --secondary-light: #bbb5a5; --secondary-border: #8b8575;
  --surface-dark: #323437; --surface-dark-border: #55585d;
}
html[data-theme="aurora"] {
  --primary: #8b5cf6; --primary-rgb: 139 92 246; --primary-hover: #7441df; --primary-light: #eee7ff;
  --secondary: #817b9a; --secondary-light: #b9b2d2; --secondary-border: #817b9a;
  --surface-dark: #111827; --surface-dark-border: #3b3560;
}
html[data-theme="github"] {
  --primary: #0969da; --primary-rgb: 9 105 218; --primary-hover: #0559b8; --primary-light: #ddf4ff;
  --secondary: #57606a; --secondary-light: #6e7781; --secondary-border: #d0d7de;
  --surface-dark: #0d1117; --surface-dark-border: #30363d;
}
html[data-theme="dracula"] {
  --primary: #bd93f9; --primary-rgb: 189 147 249; --primary-hover: #a875ec; --primary-light: #f0e7ff;
  --secondary: #a6a6b8; --secondary-light: #d0d0df; --secondary-border: #a6a6b8;
  --surface-dark: #282a36; --surface-dark-border: #44475a;
}
html[data-theme="ocean"] {
  --primary: #22d3ee; --primary-rgb: 34 211 238; --primary-hover: #0ea5c7; --primary-light: #d8fbff;
  --secondary: #6b9eaa; --secondary-light: #a6d4dc; --secondary-border: #6b9eaa;
  --surface-dark: #071b24; --surface-dark-border: #164654;
}

html:not(.dark-mode)[data-theme="matrix"] {
  --secondary-border: #b5e6c2;
}
html:not(.dark-mode)[data-theme="fire"] {
  --secondary-border: #f2b8a3;
}
html:not(.dark-mode)[data-theme="serika-dark"] {
  --secondary-border: #d7cfb4;
}
html:not(.dark-mode)[data-theme="aurora"] {
  --secondary-border: #c9bcf4;
}
html:not(.dark-mode)[data-theme="dracula"] {
  --secondary-border: #d3b8ff;
}
html:not(.dark-mode)[data-theme="ocean"] {
  --secondary-border: #b1e8ef;
}

body {
  filter: none;
  font-family: "Nunito", sans-serif;
  margin: 0;
  padding: 0;
  padding-left: 260px;
  color: #17202a;
  /* Original background color: #f7f9fa */
  background-color: #f7f9fa;
  background: linear-gradient(135deg, #f7f9fa 0%, var(--primary-light) 100%);
  background-size: 100% 100vh;
  background-attachment: fixed;
  transition: padding-left 180ms ease;
}

.profile-badge {
  padding: 5px;
  border-radius: 999px;
  color: var(--primary);
  background: var(--primary-light);
  font-size: 12px;
  cursor: pointer;
}

body.dark-mode .profile-badge {
  color: var(--primary);
  background: var(--surface-dark);
}

body.dark-mode {
  color: #f5f5f5;
  background: linear-gradient(135deg, var(--surface-dark) 0%, var(--surface-dark-border) 100%);
  background-size: 100% 100vh;
  background-attachment: fixed;
}

body.sidebar-collapsed {
  padding-left: 76px;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--secondary-light);
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary);
  background-clip: padding-box;
}

.site-notifications {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 200;
  width: min(360px, calc(100vw - 40px));
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.site-notification {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 18px;
  border: 1px solid var(--secondary-border);
  border-left: 4px solid var(--primary);
  border-radius: 999px;
  color: #17202a;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(14, 24, 32, 0.16);
  font: inherit;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
  pointer-events: auto;
  animation: modal-enter 160ms ease-out;
}

.site-notification:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.site-notification--success {
  border-color: #a6d8bd;
  border-left-color: #16834a;
}

.site-notification--failure {
  border-color: #efb4b4;
  border-left-color: #c62828;
  background: #fff5f5;
}

.site-notification.is-dismissing {
  animation: modal-exit 160ms ease-in forwards;
}

body.dark-mode .site-notification {
  border-color: var(--surface-dark-border);
  border-left-color: var(--primary);
  color: #f5f5f5;
  background: var(--surface-dark);
}

body.dark-mode .site-notification--success {
  border-color: #315846;
  border-left-color: #4bc887;
}

body.dark-mode .site-notification--failure {
  border-color: #653c40;
  border-left-color: #ff6b70;
  background: #2c1b1e;
}

@media (max-width: 640px) {
  .site-notifications {
    top: 12px;
    right: 12px;
    width: calc(100vw - 24px);
  }
}

html.dark-mode {
  color-scheme: dark;
}

html.dark-mode::-webkit-scrollbar-track {
  background: var(--surface-dark);
}

html.dark-mode::-webkit-scrollbar-thumb {
  background: var(--secondary);
  background-clip: padding-box;
}

html.dark-mode::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-light);
  background-clip: padding-box;
}

body.dark-mode ::-webkit-scrollbar-thumb {
  background: var(--secondary);
  background-clip: padding-box;
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-light);
  background-clip: padding-box;
}

#home-view {
  padding: 0 100px;
}

#search-view {
  padding: 0 100px;
  min-height: 100vh;
}

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

#search-view h1 {
  padding: 5px;
  margin: 20px;
  margin-bottom: 10px;
  font-size: 36px;
}

#search-view hr {
  margin: 0 20px 20px;
  border: none;
  border-top: 1px solid var(--secondary-border);
}

.search-panel {
  width: calc(100% - 40px);
  margin: 36px 20px;
}

.search-panel h2 {
  margin: 0 0 10px;
  font-size: 28px;
}

.search-subtitle {
  margin: 0 0 28px;
  font-size: 16px;
  color: var(--secondary);
}

.search-form {
  display: flex;
  width: 100%;
  gap: 12px;
}

.search-input-wrap {
  display: flex;
  min-height: 52px;
  flex: 1;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--secondary-border);
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 8px 12px rgb(23 32 42 / 0.10);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(var(--primary-rgb) / 0.14);
}

.search-input-wrap > i {
  color: var(--secondary);
}

.search-input-wrap input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: inherit;
  background: transparent;
  font: inherit;
}

.search-input-wrap button {
  padding: 10px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--secondary);
  background: transparent;
  cursor: pointer;
}

.search-input-wrap button:hover {
  background: var(--secondary-border);
}

.search-submit {
  min-width: 92px;
  padding: 0 16px;
  border: 1px solid var(--primary);
  border-radius: 999px;
  color: #ffffff;
  background: var(--primary);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgb(var(--primary-rgb) / 0.12);
}

.search-submit:hover {
  background: var(--primary-hover);
}

.search-tabs {
  display: flex;
  gap: 6px;
  width: 100%;
  margin: 28px 0 0;
  border-bottom: 1px solid var(--secondary-border);
}

.search-tab {
  padding: 10px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--secondary);
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.search-tab:hover,
.search-tab.is-active {
  border-bottom-color: var(--primary);
  color: var(--primary);
}

.search-results {
  display: grid;
  width: 100%;
  min-height: 190px;
  margin-top: 20px;
  place-content: center;
  justify-items: center;
  gap: 8px;
  border: 1px solid var(--secondary-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 12px rgb(23 32 42 / 0.10);

  color: var(--secondary);
  text-align: center;
}

.search-results i {
  margin-bottom: 4px;
  color: var(--primary);
  font-size: 28px;
}

.search-results strong {
  color: #17202a;
}

.search-results > .post {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
}

body.dark-mode .search-subtitle,
body.dark-mode .search-input-wrap > i,
body.dark-mode .search-tab,
body.dark-mode .search-results {
  color: var(--secondary);
}

body.dark-mode .search-input-wrap,
body.dark-mode .search-results {
  border-color: var(--surface-dark-border);
  background: rgba(21, 32, 43, 0.35);
  box-shadow: 0 8px 12px rgb(23 32 42 / 0.10);
}

body.dark-mode .search-input-wrap button:hover {
  background: var(--surface-dark);
}

body.dark-mode .search-tabs {
  border-color: var(--surface-dark-border);
}

body.dark-mode .search-results strong {
  color: #f5f5f5;
}

@media (max-width: 560px) {
  .search-panel {
    width: calc(100% - 28px);
    margin: 24px auto;
  }

  .search-panel h2 {
    font-size: 24px;
  }

  .search-form {
    width: 100%;
    flex-direction: column;
  }

  .search-submit {
    display: block;
    width: 100%;
    flex: 0 0 auto;
    min-height: 44px;
  }

  .search-tabs {
    overflow-x: auto;
  }

  .search-tab {
    flex: 0 0 auto;
  }
}

body.dark-mode #search-view hr {
  border-color: var(--surface-dark-border);
}

#trending-view {
  padding: 0 100px;
  min-height: 100vh;
}

#trending-view h1 {
  margin: 20px;
  margin-bottom: 10px;
  font-size: 36px;
}

#trending-view hr {
  margin: 0 20px 20px;
  border: none;
  border-top: 1px solid var(--secondary-border);
}

body.dark-mode #trending-view hr {
  border-color: var(--surface-dark-border);
}

#leaderboard-view {
  padding: 0 100px;
  min-height: 100vh;
}

#leaderboard-view h1 {
  margin: 20px;
  margin-bottom: 10px;
  font-size: 36px;
}

#leaderboard-view hr {
  margin: 0 20px 20px;
  border: none;
  border-top: 1px solid var(--secondary-border);
}

body.dark-mode #leaderboard-view hr {
  border-color: var(--surface-dark-border);
}

#updatelog-view {
  padding: 0 100px;
  min-height: 100vh;
}

#updatelog-view h1 {
  margin: 20px;
  margin-bottom: 10px;
  font-size: 36px;
}

#updatelog-view hr {
  margin: 0 20px 20px;
  border: none;
  border-top: 1px solid var(--secondary-border);
}

.update-entry {
  margin: 14px 0;
  text-align: left;
}

.update-entry-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.update-entry-avatar {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  box-sizing: border-box;
  border-radius: 50%;
  border: 1px solid var(--secondary-border);
  object-fit: cover;
}

body.dark-mode .update-entry-avatar {
  border-color: var(--surface-dark-border);
}

.update-entry h2 {
  margin: 0;
  font-size: 18px;
}

.update-entry p {
  margin: 8px 0 0;
  color: var(--secondary);
  white-space: pre-wrap;
}

.update-entry-hash {
  flex: 0 0 auto;
  padding: 5px 8px;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 6px;
  font-family: monospace;
  font-size: 12px;
  text-decoration: none;
}

.update-entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 14px;
  color: var(--secondary);
  font-size: 13px;
}

.update-entry-meta span,
.update-entry-meta time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.update-entry-stats {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  font-size: 12px;
}

.update-entry-additions {
  color: #16803c;
}

.update-entry-deletions {
  color: #c53939;
}

body.dark-mode .update-entry p,
body.dark-mode .update-entry-meta {
  color: var(--secondary-border);
}

body.dark-mode #updatelog-view hr {
  border-color: var(--surface-dark-border);
}


#macaque-view {
  padding: 0 100px;
  min-height: 100vh;
}

#macaque-view h1 {
  margin: 20px;
  margin-bottom: 10px;
  font-size: 36px;
}

#macaque-view hr {
  margin: 0 20px 20px;
  border: none;
  border-top: 1px solid var(--secondary-border);
}

body.dark-mode #macaque-view hr {
  border-color: var(--surface-dark-border);
}

@media (max-width: 560px) {

  #macaque-view .macaque-prompt {
    flex-basis: calc(100% - 56px);
  }

}

#profile-view {
  padding: 0 100px;
  min-height: 100vh;
}


@media (max-width: 640px) {
  #updatelog-view {
    padding: 0;
    min-height: 100vh;
  }
  #macaque-view {
    padding: 0;
    min-height: 100vh;
  }
  #profile-view {
    padding: 0;
    min-height: 100vh;
  }
  #leaderboard-view {
    padding: 0;
    min-height: 100vh;
  }
  #trending-view {
    padding: 0;
    min-height: 100vh;
  }
  #search-view {
    padding: 0;
    min-height: 100vh;
  }
  #home-view {
    padding: 0;
    min-height: 100vh;
  }
}

.profile-shell {
  width: min(100%, 900px);
  box-sizing: border-box;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: #ffffff;
  border: 1px solid var(--secondary-border);
  border-radius: 18px;
}

.profile-avatar {
  display: grid;
  width: 76px;
  aspect-ratio: 1;
  flex: 0 0 auto;
  place-items: center;
  color: #ffffff;
  background: var(--primary);
  border-radius: 50%;
  font-size: 30px;
}

.profile-identity h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
}

.profile-follow-mobile {
  display: none;
}

.profile-follow, .profile-follow-mobile {
  position: relative;
  isolation: isolate;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  width: auto;
  min-width: 100px;
  flex: 0 0 auto;
  white-space: nowrap;
  text-align: center;
  background-color: white;
  margin-left: auto;
  padding: 12px 20px;
  border: 2px solid #EFF3F6;
  border-radius: 999px;
  cursor: pointer;
  box-sizing: border-box;
  overflow: visible;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.profile-follow {
  display: inline-flex;
}

.profile-follow::before, .profile-follow::after,
.profile-follow-mobile::before, .profile-follow-mobile::after {
  position: absolute;
  z-index: -1;
  inset: -7px;
  border: 1px solid var(--primary);
  border-radius: inherit;
  opacity: 0;
  content: "";
  pointer-events: none;
}

.profile-follow-icon {
  display: inline-grid;
  width: 16px;
  height: 16px;
  place-items: center;
  font-size: 11px;
  transition: transform 220ms ease;
}

.profile-follow:hover, .profile-follow-mobile:hover,
.profile-follow:focus-visible, .profile-follow-mobile:focus-visible {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.profile-follow:active, .profile-follow-mobile:active {
  transform: translateY(1px) scale(0.97);
}

.profile-follow.is-following, .profile-follow-mobile.is-following {
  color: #ffffff;
  background-color: var(--primary);
  border-color: var(--primary);
}

.profile-follow.is-following .profile-follow-icon, .profile-follow-mobile.is-following .profile-follow-icon {
  transform: scale(1.12) rotate(-8deg);
}

.profile-follow.is-animating, .profile-follow-mobile.is-animating {
  animation: profile-follow-pop 520ms cubic-bezier(.2, .9, .3, 1.25);
}

.profile-follow.is-animating::before, .profile-follow-mobile.is-animating::before {
  animation: profile-follow-ring 600ms ease-out;
}

.profile-follow.is-animating::after, .profile-follow-mobile.is-animating::after {
  animation: profile-follow-ring 600ms 90ms ease-out;
}

@keyframes profile-follow-pop {
  0%, 100% { transform: scale(1); }
  35% { transform: scale(0.94); }
  70% { transform: scale(1.04); }
}

@keyframes profile-follow-ring {
  0% { opacity: 0.65; transform: scale(0.86); }
  100% { opacity: 0; transform: scale(1.18); }
}

@media (prefers-reduced-motion: reduce) {
  .profile-follow, .profile-follow-mobile,
  .profile-follow-icon {
    transition: none;
  }

  .profile-follow.is-animating, .profile-follow-mobile.is-animating,
  .profile-follow.is-animating::before, .profile-follow.is-animating::after,
  .profile-follow-mobile.is-animating::before, .profile-follow-mobile.is-animating::after {
    animation: none;
  }
}

body.dark-mode .profile-follow, .profile-follow-mobile {
  background-color: var(--surface-dark);
  border-color: var(--surface-dark-border);
}

body.dark-mode .profile-follow.is-following,
body.dark-mode .profile-follow-mobile.is-following {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.profile-handle {
  font-weight: lighter;
}

.profile-handle,
.profile-joined {
  margin: 6px 0 0;
  color: var(--secondary);
}

.profile-joined {
  margin-top: 14px;
  font-size: 14px;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 28px;
}

.profile-stat {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 10px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--secondary-border);
  border-radius: 18px;
}

.profile-stat i {
  grid-row: span 2;
  color: var(--primary);
  font-size: 18px;
}

.profile-stat strong {
  font-size: 20px;
}

.profile-stat span {
  color: var(--secondary);
  font-size: 13px;
}

.profile-recent h2 {
  margin: 0 0 12px;
  font-size: 22px;
}

.profile-posts {
  display: grid;
  gap: 12px;
}

.profile-posts .post {
  margin: 0;
}

.profile-post-actions {
  display: flex;
  gap: 24px;
  color: var(--secondary);
  font-size: 14px;
}

.profile-post-actions span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.profile-empty {
  margin: 0;
  padding: 24px;
  color: var(--secondary);
  background: #ffffff;
  border: 1px dashed var(--secondary-border);
  border-radius: 12px;
  text-align: center;
}

body.dark-mode .profile-header,
body.dark-mode .profile-stat,
body.dark-mode .profile-empty {
  color: #f5f5f5;
  background: var(--surface-dark);
  border-color: var(--surface-dark-border);
}

body.dark-mode .profile-header,
body.dark-mode .profile-stat {
  box-shadow: 0 8px 12px rgba(23, 32, 42, 0.25);
}

body.dark-mode .profile-handle,
body.dark-mode .profile-joined,
body.dark-mode .profile-stat span,
body.dark-mode .profile-post-actions,
body.dark-mode .profile-empty {
  color: var(--secondary-border);
}

#profile-view hr {
  margin: 0 20px 20px;
  border: none;
  border-top: 1px solid var(--secondary-border);
}

body.dark-mode #profile-view hr {
  border-color: var(--surface-dark-border);
}

@media (max-width: 560px) {
  .profile-shell {
    padding: 16px 12px 32px;
  }

  .profile-follow-mobile {
    display: flex;
    width: 100%;
    min-height: 44px;
    margin: 0 0 24px;
    margin-top: 0;
    border-radius: 999px;
  }

  .profile-follow {
    display: none;
  }

  .profile-header {
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 18px;
  }

  .profile-avatar {
    width: 58px;
    font-size: 26px;
  }

  .profile-identity {
    min-width: 0;
    flex: 1;
  }

  .profile-identity h1 {
    font-size: 22px;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .profile-handle {
    font-size: 15px;
    font-weight: 400;
  }

  .profile-joined {
    margin-top: 8px;
    font-size: 13px;
  }

  .profile-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 12px 0 16px;
  }

  .profile-stat {
    min-width: 0;
    min-height: 48px;
    padding: 8px 10px;
    column-gap: 8px;
    border-radius: 18px;
  }

  .profile-stat i {
    font-size: 16px;
  }

  .profile-stat {
    font-size: 14px;
  }

  .profile-stat strong {
    font-size: 18px;
  }

  .profile-stat span {
    font-size: 12px;
    white-space: nowrap;
  }

  .profile-recent h2 {
    margin-bottom: 10px;
    font-size: 20px;
  }

  .profile-posts .post {
    margin: 0;
    padding: 14px;
    border-radius: 22px;
  }

  .profile-posts .post-header {
    display: block;
    overflow-wrap: anywhere;
    line-height: 1.45;
  }

  .profile-posts .post-actions {
    gap: 4px;
  }

  .profile-posts .post-actions button {
    min-width: 0;
    padding: 8px 5px;
    font-size: 13px;
  }
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  display: flex;
  width: 250px;
  min-height: 100vh;
  box-sizing: border-box;
  flex-direction: column;
  padding: 28px 18px;
  background-color: #ffffff;
  border-right: 1px solid var(--secondary-border);
  transition: width 180ms ease;
}

body.dark-mode .sidebar {
  background-color: var(--surface-dark);
  border-right-color: var(--surface-dark-border);
}

.sidebar-toggle {
  position: absolute;
  top: 22px;
  right: -14px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--secondary-border);
  border-radius: 50%;
  color: var(--secondary);
  background: #ffffff;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease;
}

.sidebar-toggle:hover {
  color: #ffffff;
  background-color: var(--primary);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 14px 34px;
  color: var(--primary);
  font-size: 23px;
  font-weight: 800;
}

.logo i {
  font-size: 27px;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-link,
.compose-button {
  display: flex;
  align-items: center;
  gap: 18px;
  border-radius: 999px;
  color: var(--secondary);
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease;
}

.nav-link {
  padding: 14px 18px;
}

.nav-link.user {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  position: absolute;
  z-index: 20;
  left: 18px;
  right: 18px;
  bottom: 44px;
  box-sizing: border-box;
  padding: 11px 13px;
  border: 1px solid var(--secondary-border);
  border-radius: 12px;
  color: var(--secondary);
  background: #ffffff;
  font-size: 14px;
  transition: background-color 160ms ease, border-color 160ms ease,
    color 160ms ease, transform 160ms ease;
}

.nav-link.user:hover {
  color: var(--primary);
  background: var(--primary-light);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.nav-link.user i {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--primary);
}

#macaqueSideBar .loader {
  display: none;
  width: 12px;
  height: 12px;
  margin-left: 8px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  vertical-align: middle;
  animation: macaque-nav-spin 700ms linear infinite;
}

#macaqueSideBar[aria-busy="true"] .loader {
  display: inline-block;
}

@keyframes macaque-nav-spin {
  to {
    transform: rotate(360deg);
  }
}

.compose-button.loader {
  position: relative;
  pointer-events: none;
}

.compose-button.loader > * {
  visibility: hidden;
}

.compose-button.loader::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -10px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: compose-spin 700ms linear infinite;
}

@keyframes compose-spin {
  to {
    transform: rotate(360deg);
  }
}

.nav-link.user span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.dark-mode .nav-link.user {
  color: var(--secondary-border);
  border-color: var(--surface-dark-border);
  background: var(--surface-dark);
}

body.dark-mode .nav-link.user:hover {
  color: #ffffff;
  background: var(--surface-dark);
  border-color: var(--primary);
}

.nav-link i {
  width: 20px;
  text-align: center;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
  background-color: var(--primary-light);
}

body.dark-mode .nav-link {
  color: var(--secondary-border);
}

body.dark-mode .nav-link:hover,
body.dark-mode .nav-link.active {
  color: var(--primary);
  background-color: var(--surface-dark);
}

@media (max-width: 640px) {
  .nav-link:hover,
  .nav-link.active,
  body.dark-mode .nav-link:hover,
  body.dark-mode .nav-link.active {
    background-color: transparent;
  }
}

.compose-button {
  justify-content: center;
  margin-top: 32px;
  padding: 14px 20px;
  color: #ffffff;
  background-color: var(--primary);
  box-shadow: 0 8px 12px rgb(var(--primary-rgb) / 0.25);
  margin: 12px 20px;
}

.compose-button:hover {
  background-color: var(--primary-hover);
}

.version {
  position: absolute;
  right: 18px;
  bottom: 12px;
  margin: 0;
  color: var(--secondary);
  font-size: 12px;
}

body.dark-mode .version {
  color: var(--secondary);
}

.settingsButton {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: absolute;
  z-index: 20;
  left: 18px;
  bottom: 12px;
  padding: 8px 12px;
  border: 1px solid var(--secondary-border);
  border-radius: 999px;
  color: var(--secondary);
  font-size: 12px;
  font-family: inherit;
  font-weight: 700;
  background: #ffffff;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}
.settingsButton {
  left: 19px;
}

.profile-menu {
  position: absolute;
  right: 18px;
  bottom: 108px;
  z-index: 30;
  display: grid;
  min-width: 190px;
  padding: 8px;
  border: 1px solid var(--secondary-border);
  border-radius: 14px;
  background: #ffffff;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform-origin: bottom right;
  animation: modal-exit 160ms ease-in forwards;
  transition: opacity 160ms ease-out, visibility 0s linear 160ms;
}

.profile-menu.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  gap: 4px;
  animation: modal-enter 160ms ease-out;
  transition: opacity 160ms ease;
}

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  border: 0;
  border-radius: 9px;
  color: var(--secondary);
  background: transparent;
  font-family: 'Nunito', sans-serif;
  font-weight: bolder;
  font-size: 15px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.mobile-only-menu-item {
  display: none;
}

.profile-menu-item:hover,
.profile-menu-item:focus-visible {
  background: #f1f3f4;
  outline: none;
}

body.dark-mode .profile-menu {
  border-color: var(--surface-dark-border);
  background: var(--surface-dark);
}

body.dark-mode .profile-menu-item {
  color: #C5D0D9;
}

body.dark-mode .profile-menu-item:hover,
body.dark-mode .profile-menu-item:focus-visible {
  background: var(--surface-dark);
}

.modal[aria-hidden="true"] {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease-out, visibility 0s linear 200ms;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(14, 24, 32, 0.58);
  backdrop-filter: blur(3px);
  visibility: visible;
  opacity: 1;
  transition: opacity 160ms ease, visibility 0s;
}

.modal-content {
  width: min(100%, 660px);
  box-sizing: border-box;
  padding: 22px 24px 10px;
  border: 1px solid var(--secondary-border);
  border-radius: 18px;
  color: #17202a;
  background: #ffffff;
  box-shadow: 0 22px 60px rgba(14, 24, 32, 0.26);
}

.modal[aria-hidden="false"] .modal-content {
  animation: modal-enter 160ms ease-out;
}

.modal[aria-hidden="true"] .modal-content {
  animation: modal-exit 160ms ease-in forwards;
}

.modal-header,
.modal-title-group {
  display: flex;
  align-items: center;
}

.modal-header {
  justify-content: space-between;
  margin-bottom: 12px;
}

.modal-title-group {
  gap: 12px;
}

.modal-content h2 {
  margin: 0;
  font-size: 20px;
}

.modal-title-icon,
.setting-icon {
  display: grid;
  flex: 0 0 auto;
  width: 20px;
  height: 24px;
  place-items: center;
  color: var(--primary);
  background: transparent;
}

.modal-title-icon {
  font-size: 18px;
}

.modal-dismiss {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: var(--secondary);
  background: transparent;
  font-size: 16px;
  cursor: pointer;
}

.modal-dismiss:hover {
  color: #17202a;
  background: var(--secondary-border);
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 12px 0;
  border-bottom: 1px solid var(--secondary-border);
}

.setting-copy {
  display: grid;
  flex: 1;
  gap: 4px;
}

.setting-copy span {
  color: var(--secondary);
  font-size: 13px;
}

#theme-setting {
  display: grid;
  flex: 0 0 40px;
  width: 40px;
  height: 38px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--secondary-border);
  border-radius: 50%;
  color: var(--primary);
  background: transparent;
  font: inherit;
  cursor: pointer;
}

#theme-setting[aria-pressed="true"] {
  color: var(--primary);
  border-color: var(--primary);
}

#theme-setting i {
  margin: 0;
  font-size: 15px;
}

.app-dropdown {
  position: relative;
  flex: 0 0 auto;
}

.app-dropdown-trigger {
  display: inline-flex;
  min-width: 128px;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 11px;
  border: 1px solid var(--secondary-border);
  border-radius: 8px;
  color: inherit;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.app-dropdown-trigger i {
  font-size: 11px;
  transition: transform 160ms ease;
}

.app-dropdown-trigger[aria-expanded="true"] i {
  transform: rotate(180deg);
}

.app-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  display: grid;
  min-width: 170px;
  max-height: 280px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--secondary-border);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(14, 24, 32, 0.18);
}

.app-dropdown-menu[hidden] {
  display: none;
}

.app-dropdown-option {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.app-dropdown-option:hover,
.app-dropdown-option[aria-selected="true"] {
  background: var(--primary-light);
}

.app-dropdown-trigger:focus-visible,
.app-dropdown-option:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

body.dark-mode .app-dropdown-trigger,
body.dark-mode .app-dropdown-menu {
  border-color: var(--surface-dark-border);
}

body.dark-mode .app-dropdown-menu {
  background: var(--surface-dark);
}

body.dark-mode .app-dropdown-option:hover,
body.dark-mode .app-dropdown-option[aria-selected="true"] {
  background: var(--surface-dark-border);
}

.account-logout {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  border: 1px solid #d17f7f;
  border-radius: 999px;
  color: #b42332;
  background: #fff0f1;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.account-logout:hover {
  color: #ffffff;
  border-color: #b42332;
  background: #b42332;
}

.google-account-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  color: #ffffff;
  border: 1px solid var(--primary);
  border-radius: 999px;
  background: var(--primary);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.google-account-button:hover:not(:disabled) {
  border-color: var(--primary-hover);
  background: var(--primary-hover);
}

.google-account-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.google-account-button.is-loading {
  cursor: wait;
}

.modal-content button:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

@keyframes modal-enter {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes modal-exit {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(4px) scale(0.99);
  }
}

@media (max-width: 480px) {
  .modal-content {
    padding: 18px 18px 8px;
  }

  .setting-row {
    flex-wrap: wrap;
  }

  #theme-setting {
    margin-left: 50px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .modal-content {
    animation: none;
  }
}

body.dark-mode .modal-content {
  color: #f5f5f5;
  border-color: var(--surface-dark-border);
  background: var(--surface-dark);
}

body.dark-mode .setting-row {
  border-color: var(--surface-dark-border);
}

body.dark-mode .modal-dismiss {
  color: var(--secondary-light);
}

body.dark-mode .modal-dismiss:hover {
  color: #ffffff;
  background: var(--surface-dark);
}

body.dark-mode .setting-icon {
  color: var(--primary-light);
}

body.dark-mode .modal-title-icon {
  color: var(--primary-light);
}

body.dark-mode .setting-copy span {
  color: var(--secondary-light);
}

body.dark-mode #theme-setting {
  color: var(--secondary-border);
  border-color: var(--secondary);
  background: transparent;
}

body.dark-mode #theme-setting[aria-pressed="true"] {
  color: var(--primary-light);
  border-color: var(--surface-dark-border);
}

body.dark-mode .account-logout {
  color: #ff9ca5;
  background: #40272c;
}

body.dark-mode .account-logout:hover {
  color: #ffffff;
  border-color: #c44754;
  background: #a6323f;
}

.settingsButton:hover,
.settingsButton[aria-pressed="true"] {
  color: var(--primary);
  background-color: var(--primary-light);
  border-color: var(--primary);
}

body.dark-mode .settingsButton {
  color: #f5f5f5;
  background-color: var(--surface-dark);
  border-color: #f5f5f5;
}

.sidebar.collapsed {
  width: 76px;
  align-items: center;
  padding-right: 10px;
  padding-left: 10px;
}

.sidebar.collapsed .logo {
  padding-right: 0;
  padding-left: 0;
}

.sidebar.collapsed .logo span,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .compose-button span {
  display: none;
}

.sidebar.collapsed .nav-link,
.sidebar.collapsed .compose-button {
  justify-content: center;
  width: 56px;
  box-sizing: border-box;
  padding: 16px;
}

.sidebar.collapsed .nav-link {
  gap: 0;
}

.sidebar.collapsed .nav-link.user {
  left: 10px;
  right: 10px;
  bottom: 52px;
  width: auto;
  padding: 8px;
  justify-content: center;
}

.sidebar.collapsed .compose-button {
  margin-top: 24px;
}

.sidebar.collapsed .sidebar-toggle i {
  transform: rotate(180deg);
}

.sidebar.collapsed .version {
  right: 10px;
}

.post-container {
  display: block;
  width: calc(100% - 40px);
  min-height: 140px;
  box-sizing: border-box;
  margin: 20px;
  padding: 20px;
  text-align: left;
  overflow-wrap: anywhere;
  resize: none;
  font: inherit;
  background-color: white;
  border-radius: 20px;
  border: 1px solid var(--secondary-border);
  box-shadow: 0 8px 12px rgba(23, 32, 42, 0.25);
}

body.dark-mode .post-container,
body.dark-mode .post {
  color: #f5f5f5;
  background-color: var(--surface-dark);
  border-color: var(--surface-dark-border);
}

.post {
  margin: 20px;
  background-color: white;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid var(--secondary-border);
  box-shadow: 0 8px 12px rgba(23, 32, 42, 0.25);
}

.post-header {
  text-decoration: none;
  color: #17202A;
}

.search-person-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-person-header .post-header {
  min-width: 0;
}

.search-follow-button {
  min-width: 92px;
  margin-left: auto;
  padding: 8px 14px;
  font-size: 13px;
}

body.dark-mode .post-header {
  text-decoration: none;
  color: #F5F5F5;
}

.leaderboard-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 14px;
  color: var(--secondary);
  font-size: 14px;
}

.leaderboard-stats span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.leaderboard-stats i {
  color: var(--primary);
}

body.dark-mode .leaderboard-stats {
  color: var(--secondary-border);
}

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

.post-actions button {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border: 0;
  border-radius: 20px;
  color: var(--secondary);
  background-color: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease;
}

.post-actions button:hover {
  color: var(--primary);
  background-color: var(--primary-light);
}

.post-actions button[aria-pressed="true"],
.profile-post-actions button[aria-pressed="true"] {
  color: var(--primary);
  background-color: var(--primary-light);
}

.reply-form {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: 12px;
}

.reply-form[hidden] {
  display: none;
}

.reply-form textarea {
  flex: 1;
  height: 42px;
  min-height: 42px;
  box-sizing: border-box;
  padding: 10px 12px;
  resize: none;
  border: 1px solid var(--secondary-border);
  border-radius: 12px;
  font: inherit;
}

.reply-form button {
  height: 42px;
  padding: 9px 14px;
  border: 0;
  border-radius: 18px;
  color: white;
  background: var(--primary);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.reply-form button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.post-replies-toggle {
  margin-top: 8px;
  padding: 6px 0;
  border: 0;
  color: var(--primary);
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.post-replies-toggle:hover {
  text-decoration: underline;
}

.post-replies {
  margin-top: 12px;
  padding-left: 16px;
  border-left: 2px solid var(--secondary-border);
}

.post-reply {
  padding: 8px 0;
  font-size: 13px;
}

.post-reply span {
  margin-left: 6px;
  color: var(--secondary);
}

.post-reply p {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

body.dark-mode .reply-form textarea {
  color: #f5f5f5;
  background: var(--surface-dark);
  border-color: var(--surface-dark-border);
}

body.dark-mode .post-replies {
  border-color: var(--surface-dark-border);
}

body.dark-mode .post-actions button {
  color: var(--secondary-border);
}

body.dark-mode .post-actions button:hover {
  color: var(--primary);
  background-color: var(--surface-dark);
}

body.dark-mode .post-actions button[aria-pressed="true"],
body.dark-mode .profile-post-actions button[aria-pressed="true"] {
  color: var(--primary);
  background-color: var(--surface-dark);
}

.login-page {
  padding: 0;
  padding-left: 0;
  background: linear-gradient(135deg, #f7f9fa 0%, var(--primary-light) 100%);
}

.login-shell {
  display: grid;
  min-height: 100vh;
  box-sizing: border-box;
  padding: 12px 20px;
  place-items: center;
}

.login-card {
  width: min(100%, 730px);
  box-sizing: border-box;
  padding: 42px;
  margin: 0;
  background: #ffffff;
  border: 1px solid var(--secondary-border);
  border-radius: 24px;
  /*box-shadow: 0 20px 50px rgba(23, 32, 42, 0.12);*/
}

.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--primary);
  font-size: 24px;
  font-weight: 800;
  text-decoration: none;
}

.login-brand i {
  font-size: 28px;
}

.login-heading {
  margin: 34px 0 26px;
}

.login-heading h1 {
  margin: 0 0 8px;
  color: #17202a;
  font-size: 30px;
}

.login-heading p,
.signup-prompt {
  margin: 0;
  color: var(--secondary);
}

.google-login,
.login-submit {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-sizing: border-box;
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.google-login.loader,
.login-submit.loader {
  position: relative;
  pointer-events: none;
}

.google-login.loader > *,
.login-submit.loader {
  color: transparent;
}

.google-login.loader > * {
  visibility: hidden;
}

.google-login.loader::before,
.login-submit.loader::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -10px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: compose-spin 700ms linear infinite;
}

.google-login.loader::before {
  border-color: rgb(var(--primary-rgb) / 0.25);
  border-top-color: var(--primary);
}

.google-login {
  color: #17202a;
  background: #ffffff;
  border: 1px solid var(--secondary-border);
}

.google-login:disabled {
  cursor: wait;
}

.google-login:hover {
  background: #f7f9fa;
  border-color: var(--primary);
}

.google-login i {
  color: var(--primary);
  font-size: 17px;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--secondary);
  font-size: 12px;
  white-space: nowrap;
}

.login-divider::before,
.login-divider::after {
  height: 1px;
  flex: 1;
  content: "";
  background: var(--secondary-border);
}

.login-form {
  display: grid;
  gap: 9px;
}

.login-form label,
.password-label-row a {
  color: var(--secondary);
  font-size: 13px;
  font-weight: 800;
}

.password-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.password-label-row a,
.signup-prompt a {
  color: var(--primary);
  text-decoration: none;
}

.password-label-row a:hover,
.signup-prompt a:hover {
  text-decoration: underline;
}

.login-form input {
  width: 100%;
  box-sizing: border-box;
  padding: 13px 15px;
  color: #17202a;
  background: #ffffff;
  border: 1px solid var(--secondary-border);
  border-radius: 12px;
  font: inherit;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.login-form input:focus {
  border-color: var(--primary);
  /*box-shadow: 0 0 0 3px rgb(var(--primary-rgb) / 0.16);*/
}

.login-submit {
  margin-top: 14px;
  color: #ffffff;
  background: var(--primary);
  border: 1px solid var(--primary);
}

.login-submit:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.login-message {
  min-height: 18px;
  margin: 2px 0 0;
  color: var(--secondary);
  font-size: 12px;
  text-align: center;
}

.signup-prompt {
  margin-top: 28px;
  text-align: center;
  font-size: 14px;
}

@media (max-width: 520px) {
  .login-card {
    padding: 34px 26px;
    border-radius: 20px;
  }

  .login-heading h1 {
    font-size: 32px;
  }

  .login-heading p,
  .login-form label,
  .password-label-row a,
  .signup-prompt {
    font-size: 16px;
  }

  .login-divider,
  .login-message {
    font-size: 14px;
  }
}

@media (max-width: 640px) {
  body,
  body.sidebar-collapsed {
    padding-left: 0;
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
    font-size: 18px;
  }

  body:has(#macaque-view:not([hidden])) {
    overflow: hidden;
    padding-bottom: 0;
  }

  #leaderboardButton {
    display: none;
  }

  #macaqueButton {
    display: none;
  }

  #macaque-view, .macaque-shell {
    overflow: hidden;
  }

  body #macaque-view .macaque-shell {
    height: calc(100vh - 96px - env(safe-area-inset-bottom));
    height: calc(100dvh - 96px - env(safe-area-inset-bottom));
    min-height: 0;
  }

  body:has(#macaque-view:not([hidden])) #macaque-view {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  body:has(#macaque-view:not([hidden])) #macaque-view .macaque-shell {
    height: 100dvh;
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  body #macaque-view .macaque-prompt {
    min-height: 58px;
  }

  .sidebar {
    inset: auto 0 0;
    display: grid;
    width: 100%;
    box-sizing: border-box;
    min-height: auto;
    align-items: center;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    font-size: 50px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--secondary-border);
    border-right: 0;
  }

  .sidebar.collapsed {
    width: 100%;
    padding-right: 10px;
    padding-left: 10px;
  }

  .logo,
  .nav-link.user,
  .version {
    display: none;
  }

  .settingsButton {
    display: none;
  }

  .profile-menu {
    position: absolute;
    right: 10px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    z-index: 30;
    display: grid;
    min-width: 190px;
    padding: 8px;
    border: 2px solid var(--secondary);
    border-radius: 14px;
    background: #ffffff;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform-origin: bottom right;
    animation: modal-exit 160ms ease-in forwards;
    transition: opacity 160ms ease-out, visibility 0s linear 160ms;
  }

  .profile-menu.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    gap: 4px;
    animation: modal-enter 160ms ease-out;
    transition: opacity 160ms ease;
  }

  .profile-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    padding: 11px 12px;
    border: 0;
    border-radius: 9px;
    color: #14171a;
    background: transparent;
    font: inherit;
    font-size: 15px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
  }

  .mobile-only-menu-item {
    display: flex;
  }

  .profile-menu-item:hover,
  .profile-menu-item:focus-visible {
    background: #f1f3f4;
    outline: none;
  }

  body.dark-mode .profile-menu {
    border-color: var(--surface-dark-border);
    background: var(--surface-dark);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  }

  body.dark-mode .profile-menu-item {
    color: #ffffff;
  }

  body.dark-mode .profile-menu-item:hover,
  body.dark-mode .profile-menu-item:focus-visible {
    background: var(--surface-dark);
  }

  .nav-links {
    display: contents;
    font-size: 50px;
  }

  #searchButton {
    display: flex;
    visibility: visible;
    opacity: 1;
  }

  .sidebar-toggle {
    display: none;
  }

  .nav-link span,
  .compose-button span {
    display: inline;
  }

  .nav-link {
    justify-content: center;
    width: 100%;
    height: 58px;
    min-height: 0;
    box-sizing: border-box;
    flex: none;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 8px 2px;
    border-radius: 8px;
    font-size: 12px;
  }

  .nav-link #macaqueSideBar {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    white-space: nowrap;
  }

  #macaqueSideBar .loader {
    width: 8px;
    height: 8px;
    margin: 0;
    border-width: 1px;
  }

  .nav-link i {
    font-size: 24px;
  }

  .sidebar.collapsed .nav-link {
    width: 100%;
    padding: 8px 2px;
  }

  .compose-button {
    position: fixed;
    right: 20px;
    bottom: calc(108px + env(safe-area-inset-bottom));
    z-index: 9;
    width: 64px;
    height: 64px;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-size: 22px;
  }

  .compose-button span {
    display: none;
  }
}
