/* ==========================================================================
   Buxino — design system
   Mode terang (default) & mode gelap, layout terinspirasi Instagram.
   ========================================================================== */

:root {
  color-scheme: light;

  --bg: #fafafa;
  --bg-2: #f5f5f5;
  --panel: #ffffff;
  --panel-2: #f7f7f8;
  --panel-3: #efeff1;

  --line: #dbdbdb;
  --line-strong: #c4c4c4;

  --text: #0f1419;
  --muted: #536471;
  --faint: #8b98a5;

  --brand: #0095f6;
  --brand-strong: #0077cc;
  --brand-soft: rgba(0, 149, 246, 0.1);
  --pink: #ed4956;
  --green: #1a9c62;
  --amber: #c2410c;
  --danger: #ed4956;
  --link: #0077cc;

  --icon: #262626;
  --card: #ffffff;
  --hover: rgba(15, 20, 25, 0.05);
  --active: rgba(15, 20, 25, 0.09);
  --chip: #efefef;
  --media-bg: #f0f0f0;
  --scrim: rgba(0, 0, 0, 0.72);
  --nav-bg: rgba(255, 255, 255, 0.94);
  --avatar-ring: #ffffff;
  --skeleton: linear-gradient(90deg, #ececec 25%, #f6f6f6 37%, #ececec 63%);
  --shadow-sm: 0 1px 2px rgba(15, 20, 25, 0.06);
  --shadow: 0 18px 48px rgba(15, 20, 25, 0.14);
  --ring: 0 0 0 3px rgba(0, 149, 246, 0.28);
}

html[data-theme='dark'] {
  color-scheme: dark;

  --bg: #000000;
  --bg-2: #0a0a0a;
  --panel: #121212;
  --panel-2: #1c1c1c;
  --panel-3: #262626;

  --line: #262626;
  --line-strong: #363636;

  --text: #f5f5f5;
  --muted: #a8a8a8;
  --faint: #7f7f7f;

  --brand: #0095f6;
  --brand-strong: #4cb5f9;
  --brand-soft: rgba(0, 149, 246, 0.12);
  --pink: #ff3040;
  --green: #3fc67f;
  --amber: #f59e0b;
  --danger: #ff5c5c;
  --link: #4cb5f9;

  --icon: #f5f5f5;
  --card: #121212;
  --hover: rgba(255, 255, 255, 0.06);
  --active: rgba(255, 255, 255, 0.1);
  --chip: #262626;
  --media-bg: #050505;
  --scrim: rgba(0, 0, 0, 0.82);
  --nav-bg: rgba(0, 0, 0, 0.92);
  --avatar-ring: #000000;
  --skeleton: linear-gradient(90deg, #1a1a1a 25%, #242424 37%, #1a1a1a 63%);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  --ring: 0 0 0 3px rgba(0, 149, 246, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.2s ease, color 0.2s ease;
}

body.modal-open {
  overflow: hidden;
}

h1,
h2,
h3,
p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
}

img {
  max-width: 100%;
}

input,
textarea,
select {
  font: inherit;
  color: var(--text);
}

input::placeholder,
textarea::placeholder {
  color: var(--faint);
}

::selection {
  background: rgba(0, 149, 246, 0.22);
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: content-box;
}

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

.ico {
  width: 22px;
  height: 22px;
  flex: none;
  display: block;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12.5px;
}

.center {
  text-align: center;
}

.pad {
  padding: 18px;
}

.pad-sm {
  padding: 10px 4px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.noscript {
  padding: 40px;
  text-align: center;
  color: var(--muted);
}

/* -------------------------------------------------------------------- logo */

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(135deg, #f9ce34 0%, #ee2a7b 55%, #6228d7 100%);
  color: #fff;
  font-size: 19px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  box-shadow: 0 6px 16px rgba(238, 42, 123, 0.28);
}

.logo-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.92;
}

.logo-word {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--text);
  line-height: 1;
}

.logo-lg .logo-mark {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  font-size: 26px;
}

.logo-lg .logo-word {
  font-size: 32px;
}

/* ----------------------------------------------------------------- avatars */

.avatar {
  --size: 38px;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  flex: none;
  font-weight: 700;
  font-size: calc(var(--size) * 0.36);
  color: hsl(var(--av-h, 220deg) 42% 30%);
  background: linear-gradient(
    140deg,
    hsl(var(--av-h, 220deg) 78% 90%),
    hsl(var(--av-h, 220deg) 62% 78%)
  );
  box-shadow: inset 0 0 0 1px rgba(15, 20, 25, 0.06);
}

html[data-theme='dark'] .avatar {
  color: hsl(var(--av-h, 220deg) 40% 22%);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-xs { --size: 28px; }
.avatar-sm { --size: 34px; }
.avatar-md { --size: 42px; }
.avatar-lg { --size: 64px; }
.avatar-xl { --size: 92px; }

.avatar-link {
  display: inline-flex;
  border-radius: 50%;
}

/* ----------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, filter 0.15s ease;
}

.btn .ico {
  width: 18px;
  height: 18px;
}

.btn:hover {
  filter: brightness(0.97);
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
  filter: none;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: transparent;
}

.btn-primary:hover {
  background: var(--brand-strong);
  filter: none;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--hover);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-small {
  height: 32px;
  padding: 0 12px;
  font-size: 12.5px;
  border-radius: 9px;
}

.btn-block {
  width: 100%;
  height: 44px;
  border-radius: 11px;
  font-size: 14px;
}

.btn-icon {
  width: 42px;
  padding: 0;
}

.btn-follow {
  height: 32px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-weight: 600;
  font-size: 12.5px;
}

.btn-follow:hover {
  background: var(--hover);
}

.btn-follow.is-following {
  color: var(--muted);
  border-color: var(--line);
  background: transparent;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--icon);
  cursor: pointer;
  flex: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: var(--hover);
}

.icon-btn.ghost {
  background: transparent;
}

.icon-btn.xs {
  width: 26px;
  height: 26px;
}

.icon-btn.xs .ico {
  width: 15px;
  height: 15px;
}

.icon-btn.accent {
  color: var(--brand);
}

.tone-danger {
  color: var(--danger);
}

/* ------------------------------------------------------------------ inputs */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field > span {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.field input,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.field textarea {
  resize: vertical;
  min-height: 84px;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--line-strong);
  background: var(--panel);
}

.form-error {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(237, 73, 86, 0.09);
  border: 1px solid rgba(237, 73, 86, 0.24);
  color: var(--danger);
  font-size: 12.5px;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

/* --------------------------------------------------------------- boot/fatal */

.boot,
.fatal {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  background: var(--bg);
  text-align: center;
}

.boot p {
  color: var(--muted);
  font-size: 12.5px;
}

.boot-bar {
  width: 170px;
  height: 3px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
}

.boot-bar span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f9ce34, #ee2a7b, #6228d7);
  animation: bootbar 1.2s ease-in-out infinite;
}

.fatal .empty-ico {
  width: 64px;
  height: 64px;
}

.fatal h1 {
  font-size: 22px;
  font-weight: 800;
}

.fatal p {
  color: var(--muted);
  font-size: 13.5px;
}

/* -------------------------------------------------------------------- auth */

.auth {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
  min-height: 100dvh;
  background: var(--bg);
}

.auth-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 48px;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.28), transparent 42%),
    radial-gradient(circle at 86% 84%, rgba(98, 40, 215, 0.55), transparent 55%),
    linear-gradient(150deg, #f7c948 0%, #ef5468 46%, #9b3bd4 100%);
  color: #fff;
}

.auth-hero::after {
  content: '';
  position: absolute;
  inset: auto -60px -120px auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
}

.brand-static {
  display: inline-flex;
  margin-bottom: 26px;
}

.brand-static .logo-word {
  color: #fff;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  backdrop-filter: blur(6px);
}

.hero-pill .ico {
  width: 15px;
  height: 15px;
}

.auth-hero h1 {
  margin-top: 20px;
  font-size: clamp(34px, 3.6vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 800;
  color: #fff;
}

.grad-text {
  color: #ffe9a3;
}

.hero-sub {
  margin-top: 18px;
  max-width: 430px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
  line-height: 1.6;
}

.hero-points {
  list-style: none;
  margin: 30px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hero-points li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
}

.point-ico {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  flex: none;
}

.point-ico .ico {
  width: 19px;
  height: 19px;
}

.hero-points b {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
}

.hero-points small {
  display: block;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
}

.hero-preview {
  position: relative;
  height: 120px;
  margin-top: 30px;
}

.mini-card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 14px;
  background: #fff;
  color: #0f1419;
  box-shadow: 0 18px 40px rgba(30, 10, 50, 0.25);
  font-size: 11.5px;
}

.mini-card b {
  display: block;
  font-size: 12px;
}

.mini-card span {
  color: #667085;
  font-size: 10.5px;
}

.mini-card p {
  margin-top: 3px;
  font-size: 11.5px;
  color: #0f1419;
}

.mini-a {
  left: 0;
  top: 0;
  width: 250px;
  transform: rotate(-2deg);
}

.mini-b {
  right: 4px;
  top: 52px;
  width: 210px;
  transform: rotate(2.5deg);
}

.mini-av {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex: none;
  background: linear-gradient(140deg, hsl(var(--av-h) 78% 90%), hsl(var(--av-h) 62% 78%));
  color: hsl(var(--av-h) 42% 30%);
  font-weight: 800;
  font-size: 11px;
}

.mini-like {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  color: #ed4956;
  font-weight: 700;
}

.mini-like .ico {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

.auth-panel {
  display: grid;
  place-items: center;
  padding: 48px 28px;
}

.auth-card {
  width: min(404px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 34px 32px 26px;
  box-shadow: var(--shadow-sm);
}

.auth-head h2 {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.auth-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 22px 0 20px;
  padding: 4px;
  border-radius: 12px;
  background: var(--panel-3);
}

.auth-tab {
  height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.auth-tab.active {
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.auth-form .btn {
  margin-top: 4px;
}

.auth-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 18px;
  color: var(--faint);
  font-size: 11px;
  text-align: center;
}

.auth-note .ico {
  width: 13px;
  height: 13px;
}

.auth-browse {
  display: block;
  width: 100%;
  margin-top: 14px;
  border: 0;
  background: none;
  color: var(--link);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.auth-browse:hover {
  text-decoration: underline;
}

/* ------------------------------------------------------------------- shell */

.mobile-top {
  display: none;
}

.shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 640px) 300px;
  justify-content: center;
  gap: 24px;
  max-width: 1230px;
  margin: 0 auto;
  padding: 0 20px 64px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding: 26px 12px 18px;
}

.sidebar .brand {
  margin: 2px 10px 26px;
}

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

.nav a {
  display: flex;
  align-items: center;
  gap: 13px;
  height: 46px;
  padding: 0 12px;
  border-radius: 11px;
  color: var(--text);
  font-size: 14.5px;
  font-weight: 500;
  transition: background-color 0.15s ease;
}

.nav a:hover {
  background: var(--hover);
}

.nav a.active {
  font-weight: 700;
}

.nav a.active .nav-ico .ico {
  stroke-width: 2.2;
}

.nav-ico {
  display: inline-flex;
}

.nav-ico .ico {
  width: 24px;
  height: 24px;
  color: var(--icon);
}

.badge {
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: auto;
  border-radius: 99px;
  background: var(--pink);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
}

.side-me {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: auto;
  padding: 8px;
  border-radius: 12px;
}

.side-me:hover {
  background: var(--hover);
}

.side-me-link {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  padding: 2px;
  border-radius: 10px;
}

.side-me-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.side-me-info b {
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-me-info small {
  color: var(--muted);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main {
  min-width: 0;
  padding: 24px 0 20px;
  animation: fadeUp 0.3s ease both;
}

.rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px 0;
}

.rail-card {
  padding: 16px;
}

.rail-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.rail-head .ico {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.rail-head h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.rail-users {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rail-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rail-user-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.rail-user-info b {
  font-size: 12.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-user-info small {
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--link);
  font-size: 12.5px;
  font-weight: 600;
}

.rail-link:hover {
  text-decoration: underline;
}

.rail-status {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 11.5px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.chips span {
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--chip);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
}

.mobile-nav {
  display: none;
}

/* -------------------------------------------------------------- guest shell */

.guest-shell {
  max-width: 1010px;
  margin: 0 auto;
  padding: 0 20px 64px;
}

.guest-top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 2px;
  margin-bottom: 8px;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.guest-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.guest-layout {
  display: grid;
  grid-template-columns: minmax(0, 620px) 300px;
  justify-content: center;
  gap: 30px;
  align-items: start;
}

.guest-layout .main {
  max-width: 620px;
  width: 100%;
}

.guest-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  margin-bottom: 18px;
}

.guest-cta b {
  display: block;
  font-size: 14px;
  font-weight: 700;
}

.guest-cta span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12.5px;
}

/* ----------------------------------------------------------------- topbar */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 0 4px;
}

.topbar h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.topbar-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12.5px;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 99px;
  background: rgba(26, 156, 98, 0.12);
  color: var(--green);
  font-size: 11.5px;
  font-weight: 700;
  flex: none;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.8s ease-in-out infinite;
}

.page-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.page-head h1 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-head p {
  color: var(--muted);
  font-size: 12.5px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 4px 10px;
}

.section-head h2 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.page-loading {
  display: grid;
  place-items: center;
  padding: 80px 0;
}

/* -------------------------------------------------------------- segmented */

.segmented {
  display: flex;
  gap: 4px;
  margin: 6px 0 16px;
  border-bottom: 1px solid var(--line);
}

.seg {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.seg .ico {
  width: 17px;
  height: 17px;
}

.seg:hover {
  color: var(--text);
}

.seg.active {
  color: var(--text);
  border-color: var(--text);
  font-weight: 700;
}

/* --------------------------------------------------------------- composer */

.composer {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
}

.composer-main {
  flex: 1;
  min-width: 0;
}

.composer textarea {
  display: block;
  width: 100%;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  resize: none;
  outline: none;
  max-height: 220px;
}

.composer-hint {
  margin-top: 4px;
  color: var(--faint);
  font-size: 11.5px;
}

.composer-hint b {
  color: var(--muted);
  font-weight: 600;
}

.composer-preview {
  position: relative;
  margin-top: 10px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--media-bg);
  border: 1px solid var(--line);
}

.composer-preview img {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: cover;
}

.preview-x {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--scrim);
  color: #fff;
}

.preview-x:hover {
  background: rgba(0, 0, 0, 0.85);
}

.composer-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.attach-btn:hover {
  background: var(--hover);
  color: var(--text);
}

.attach-btn .ico {
  width: 20px;
  height: 20px;
}

.char-count {
  margin-left: auto;
  color: var(--faint);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------------------------- feed */

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.feed-sentinel {
  height: 1px;
}

.feed-foot {
  padding: 20px 0 8px;
  text-align: center;
  color: var(--faint);
  font-size: 12px;
}

.foot-loading,
.foot-done {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.new-posts {
  position: sticky;
  top: 10px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 auto 14px;
  padding: 9px 16px;
  border: 0;
  border-radius: 99px;
  background: var(--brand);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.new-posts .ico {
  width: 15px;
  height: 15px;
}

/* -------------------------------------------------------------------- post */

.post {
  overflow: hidden;
  border-radius: 14px;
  animation: fadeUp 0.25s ease both;
}

.post-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 10px;
}

.post-who {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.post-name {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-name:hover {
  text-decoration: underline;
}

.post-sub {
  color: var(--muted);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-media {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--media-bg);
  cursor: zoom-in;
}

.post-media img {
  display: block;
  width: 100%;
  max-height: min(74vh, 680px);
  object-fit: cover;
}

.post-info {
  padding: 8px 14px 12px;
}

.post-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0 -6px 2px;
}

.action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 8px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.action:hover {
  background: var(--hover);
}

.action .ico {
  width: 23px;
  height: 23px;
}

.action .count {
  min-width: 10px;
  font-variant-numeric: tabular-nums;
}

.action.liked {
  color: var(--pink);
}

.action.active {
  background: var(--hover);
}

.action.liked .ico {
  fill: currentColor;
  stroke: currentColor;
}

.action.pop .ico {
  animation: pop 0.32s ease;
}

.post-body {
  margin-top: 2px;
  font-size: 13.8px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.post-body .post-caption-name {
  font-weight: 700;
  margin-right: 5px;
}

.post-body .post-caption-name:hover {
  text-decoration: underline;
}

.post-time {
  display: block;
  margin-top: 7px;
  color: var(--faint);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.post-body .hashtag,
.post-body .mention,
.comment-body .hashtag,
.comment-body .mention {
  color: var(--link);
  font-weight: 600;
}

.post-body .hashtag:hover,
.post-body .mention:hover,
.comment-body .hashtag:hover,
.comment-body .mention:hover {
  text-decoration: underline;
}

.post.removing {
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.single-post .post {
  margin-bottom: 0;
}

/* ---------------------------------------------------------------- comments */

.comments {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.comments-empty {
  color: var(--faint);
  font-size: 12.5px;
  padding: 6px 0;
}

.comments-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
  padding: 8px 0;
}

.comment {
  display: flex;
  gap: 9px;
  padding: 5px 0;
}

.comment-main {
  flex: 1;
  min-width: 0;
}

.comment-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-name {
  font-size: 12.5px;
  font-weight: 700;
}

.comment-name:hover {
  text-decoration: underline;
}

.comment-time {
  color: var(--faint);
  font-size: 10.5px;
}

.comment-head .icon-btn {
  margin-left: auto;
}

.comment-body {
  margin-top: 1px;
  font-size: 13.2px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.comment-form {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.comment-form input {
  flex: 1;
  min-width: 0;
  padding: 8px 0;
  border: 0;
  background: transparent;
  font-size: 13.2px;
  outline: none;
}

.comment-login {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
}

/* ----------------------------------------------------------------- profile */

.profile {
  padding: 24px;
  margin-bottom: 18px;
  border-radius: 16px;
}

.profile-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.profile-avatar-col {
  display: flex;
}

.profile-meta {
  min-width: 0;
}

.profile-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.profile-id {
  min-width: 0;
}

.profile-name {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.profile-handle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.profile-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-stats {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.profile-stats b {
  color: var(--text);
  font-weight: 700;
  margin-right: 3px;
}

.profile-stats button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.profile-stats button:hover {
  color: var(--text);
}

.profile-bio {
  margin-top: 10px;
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.joined {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  color: var(--faint);
  font-size: 11.5px;
}

.joined .ico {
  width: 13px;
  height: 13px;
}

.profile-more {
  display: flex;
  justify-content: center;
  padding: 14px 0 4px;
}

/* ----------------------------------------------------------- notifications */

.notif-list {
  overflow: hidden;
}

.notif-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  transition: background-color 0.15s ease;
}

.notif-row:last-child {
  border-bottom: 0;
}

.notif-row:hover {
  background: var(--hover);
}

.notif-row.unread {
  background: var(--brand-soft);
}

.notif-ico {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex: none;
}

.notif-ico .ico {
  width: 18px;
  height: 18px;
}

.tone-pink {
  background: rgba(237, 73, 86, 0.12);
  color: #d92639;
}

.tone-cyan {
  background: rgba(0, 149, 246, 0.12);
  color: #0077cc;
}

.tone-green {
  background: rgba(26, 156, 98, 0.13);
  color: #14804f;
}

.tone-violet {
  background: rgba(98, 40, 215, 0.12);
  color: #6d3bd1;
}

html[data-theme='dark'] .tone-pink { color: #ff7d88; }
html[data-theme='dark'] .tone-cyan { color: #6cc4fa; }
html[data-theme='dark'] .tone-green { color: #57d59a; }
html[data-theme='dark'] .tone-violet { color: #a98af8; }

.notif-main {
  flex: 1;
  min-width: 0;
}

.notif-text {
  font-size: 13.2px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.notif-text b {
  font-weight: 700;
}

.notif-time {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: 11px;
}

.notif-thumb {
  width: 46px;
  height: 46px;
  border-radius: 9px;
  object-fit: cover;
  flex: none;
  border: 1px solid var(--line);
}

.unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  flex: none;
}

/* ------------------------------------------------------------------ search */

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 6px 5px 15px;
  margin-bottom: 16px;
  color: var(--muted);
}

.search-box .ico {
  width: 18px;
  height: 18px;
  flex: none;
}

.search-box input {
  flex: 1;
  min-width: 0;
  padding: 11px 0;
  border: 0;
  background: transparent;
  font-size: 14px;
  outline: none;
}

.user-list {
  overflow: hidden;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.user-row:last-child {
  border-bottom: 0;
}

.user-row-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.user-row-name {
  font-size: 13.5px;
  font-weight: 700;
}

.user-row-name:hover {
  text-decoration: underline;
}

.user-row-handle {
  color: var(--muted);
  font-size: 12px;
}

.user-row-bio {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12.5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.user-row-meta {
  margin-top: 2px;
  color: var(--faint);
  font-size: 11.5px;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border-radius: 99px;
  background: var(--chip);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
}

.tag-chip:hover {
  background: var(--active);
}

.tag-chip span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.tag-list {
  display: flex;
  flex-direction: column;
}

.tag-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.tag-row:last-of-type {
  border-bottom: 0;
}

.tag-name {
  font-size: 13px;
  font-weight: 700;
}

.tag-name:hover {
  text-decoration: underline;
}

/* -------------------------------------------------------------------- chat */

.chat-layout {
  display: grid;
  grid-template-columns: 296px minmax(0, 1fr);
  height: calc(100dvh - 150px);
  min-height: 480px;
  overflow: hidden;
  border-radius: 16px;
}

.chat-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
}

.chat-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--bg-2);
  color: var(--muted);
}

.chat-search .ico {
  width: 16px;
  height: 16px;
}

.chat-search input {
  flex: 1;
  min-width: 0;
  padding: 3px 0;
  border: 0;
  background: transparent;
  font-size: 13px;
  outline: none;
}

.chat-results {
  max-height: 240px;
  overflow-y: auto;
  border-bottom: 1px solid var(--line);
}

.chat-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
}

.chat-result:hover {
  background: var(--hover);
}

.chat-result-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-result-main b {
  font-size: 12.5px;
  font-weight: 700;
}

.chat-result-main small {
  color: var(--muted);
  font-size: 11.5px;
}

.conv-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.conv {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
}

.conv:hover {
  background: var(--hover);
}

.conv.active {
  background: var(--panel-3);
}

.conv-main {
  flex: 1;
  min-width: 0;
}

.conv-top,
.conv-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.conv-name {
  font-size: 13.2px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conv-time {
  color: var(--faint);
  font-size: 10.5px;
  flex: none;
}

.conv-preview {
  color: var(--muted);
  font-size: 12.2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conv-unread {
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--brand);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  flex: none;
}

.conv-unread.hidden {
  display: none;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.chat-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 30px;
  text-align: center;
  color: var(--muted);
}

.chat-placeholder .ico {
  width: 46px;
  height: 46px;
  color: var(--faint);
  margin-bottom: 4px;
}

.chat-placeholder h3 {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.chat-placeholder p {
  font-size: 12.5px;
  max-width: 240px;
}

.thread-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
}

.thread-who {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.thread-who b {
  display: block;
  font-size: 13.2px;
  font-weight: 700;
}

.thread-who small {
  color: var(--muted);
  font-size: 11px;
}

.thread-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10.5px;
  flex: none;
}

.back-chat {
  display: none;
}

.thread {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 16px;
}

.thread-empty {
  margin: auto;
  color: var(--faint);
  font-size: 12.5px;
  text-align: center;
}

.load-older {
  align-self: center;
  margin-bottom: 4px;
}

.msg {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 78%;
}

.msg-me {
  align-self: flex-end;
  align-items: flex-end;
}

.msg-peer {
  align-self: flex-start;
}

.bubble {
  padding: 9px 13px;
  border-radius: 18px;
  font-size: 13.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.msg-me .bubble {
  background: var(--brand);
  color: #fff;
  border-bottom-right-radius: 6px;
}

.msg-peer .bubble {
  background: var(--panel-3);
  color: var(--text);
  border-bottom-left-radius: 6px;
}

.msg time {
  padding: 0 4px;
  color: var(--faint);
  font-size: 9.5px;
}

.typing {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 18px 0;
  color: var(--muted);
  font-size: 11px;
}

.typing-dots {
  display: inline-flex;
  gap: 3px;
}

.typing-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--muted);
  animation: blink 1.2s infinite;
}

.typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.typing-dots i:nth-child(3) { animation-delay: 0.3s; }

.dm-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}

.dm-form input {
  flex: 1;
  min-width: 0;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--panel-2);
  font-size: 13.5px;
  outline: none;
}

.dm-form input:focus {
  border-color: var(--line-strong);
  background: var(--panel);
}

.dm-form .btn-icon {
  border-radius: 50%;
  height: 40px;
  width: 40px;
  padding: 0;
}

/* ------------------------------------------------------------------- modal */

#modal-root {
  display: none;
}

#modal-root.open {
  display: block;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

.modal {
  position: relative;
  width: min(440px, 100%);
  max-height: min(88vh, 760px);
  overflow-y: auto;
  padding: 24px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  animation: popIn 0.18s ease;
}

.modal-wide {
  width: min(900px, 100%);
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.modal-wide .modal-x {
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
}

.modal-wide .modal-x:hover {
  background: rgba(0, 0, 0, 0.7);
}

.modal-x {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
}

.modal-title {
  padding-right: 30px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.modal-text {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.modal-list {
  margin-top: 12px;
  max-height: 55vh;
  overflow-y: auto;
}

.lightbox {
  display: grid;
  place-items: center;
}

.lightbox img {
  max-width: 100%;
  max-height: 82vh;
  border-radius: 10px;
  object-fit: contain;
}

.edit-avatar-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ------------------------------------------------------------------ toasts */

.toasts {
  position: fixed;
  bottom: 22px;
  left: 50%;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(380px, calc(100vw - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-ico {
  display: inline-flex;
  flex: none;
}

.toast-ico .ico {
  width: 17px;
  height: 17px;
}

.toast-error {
  background: var(--danger);
  color: #fff;
}

.toast-success {
  background: var(--green);
  color: #fff;
}

html[data-theme='dark'] .toast-success {
  color: #06231a;
}

.toast-notif {
  background: var(--brand);
  color: #fff;
}

/* ------------------------------------------------------- empty & skeletons */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 46px 20px;
  text-align: center;
}

.empty-ico {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 4px;
  border-radius: 50%;
  background: var(--chip);
  color: var(--muted);
}

.empty-ico .ico {
  width: 26px;
  height: 26px;
}

.empty-state h3 {
  font-size: 15.5px;
  font-weight: 700;
}

.empty-state p {
  max-width: 300px;
  color: var(--muted);
  font-size: 12.8px;
  line-height: 1.55;
}

.sk {
  display: block;
  border-radius: 8px;
  background: var(--skeleton);
  background-size: 300% 100%;
  animation: shimmer 1.4s linear infinite;
}

.sk-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.sk-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex: none;
}

.sk-lines {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.sk-line {
  height: 9px;
  border-radius: 99px;
}

.sk-line.w25 { width: 25%; }
.sk-line.w30 { width: 30%; }
.sk-line.w40 { width: 40%; }
.sk-line.w60 { width: 60%; }
.sk-line.w80 { width: 80%; }
.sk-line.w100 { width: 100%; }

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

.sk-pill {
  width: 52px;
  height: 22px;
  border-radius: 99px;
}

.skeleton-post {
  padding: 16px;
  border-radius: 14px;
}

.sk-profile {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  margin-bottom: 18px;
}

.sk-avatar-lg {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  flex: none;
}

.sk-profile-body {
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
}

.sk-banner {
  display: none;
}

/* ----------------------------------------------------------------- spinner */

.spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--brand);
  animation: spin 0.7s linear infinite;
}

.spinner.sm {
  width: 15px;
  height: 15px;
  border-width: 2px;
}

/* --------------------------------------------------------------- responsive */

@media (max-width: 1160px) {
  .shell {
    grid-template-columns: 236px minmax(0, 640px);
  }

  .rail {
    display: none;
  }

  .guest-layout {
    grid-template-columns: minmax(0, 640px);
  }

  .guest-layout .rail {
    display: none;
  }
}

@media (max-width: 900px) {
  body {
    font-size: 14px;
  }

  .mobile-top {
    position: sticky;
    top: 0;
    z-index: 45;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 16px;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
  }

  .mobile-top .logo-word {
    font-size: 21px;
  }

  .mobile-top .logo-mark {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    font-size: 17px;
  }

  .mobile-top-actions {
    display: flex;
    align-items: center;
    gap: 2px;
  }

  .shell {
    display: block;
    max-width: 700px;
    padding: 0 0 88px;
  }

  .sidebar {
    display: none;
  }

  .main {
    padding: 18px 14px 0;
  }

  .topbar h1 {
    font-size: 21px;
  }

  .topbar-sub {
    font-size: 12px;
  }

  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
  }

  .mobile-nav a {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 5px 0;
    color: var(--muted);
    font-size: 9.5px;
    font-weight: 500;
  }

  .mobile-nav a.active {
    color: var(--text);
    font-weight: 700;
  }

  .mobile-nav .ico {
    width: 24px;
    height: 24px;
  }

  .mobile-nav .badge {
    position: absolute;
    top: 0;
    right: calc(50% - 18px);
    margin: 0;
    min-width: 15px;
    height: 15px;
    font-size: 9px;
  }

  .post {
    border-radius: 14px;
  }

  .feed-list {
    gap: 12px;
  }

  .post-media img {
    max-height: 68vh;
  }

  .profile {
    border-radius: 14px;
    padding: 18px;
  }

  .profile-inner {
    gap: 16px;
  }

  .avatar-xl {
    --size: 76px;
  }

  .profile-name {
    font-size: 18px;
  }

  .profile-title-row {
    align-items: flex-start;
  }

  .profile-actions {
    width: 100%;
  }

  .chat-layout {
    grid-template-columns: 1fr;
    height: calc(100dvh - 215px);
    min-height: 380px;
  }

  .chat-layout.has-thread .chat-side {
    display: none;
  }

  .chat-layout:not(.has-thread) .chat-panel {
    display: none;
  }

  .back-chat {
    display: inline-grid;
  }

  body.in-thread .mobile-top,
  body.in-thread .mobile-nav,
  body.in-thread .topbar {
    display: none;
  }

  body.in-thread .main {
    padding: 0;
  }

  body.in-thread .chat-layout {
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .toasts {
    bottom: calc(82px + env(safe-area-inset-bottom));
  }

  .auth {
    grid-template-columns: 1fr;
  }

  .auth-hero {
    display: none;
  }

  .auth-panel {
    min-height: 100dvh;
    padding: 28px 18px;
  }

  .auth-card {
    border: 0;
    box-shadow: none;
    background: transparent;
    padding: 10px 6px;
  }

  .guest-shell {
    padding: 0 14px 60px;
  }

  .guest-top {
    padding: 10px 0;
  }

  .guest-cta {
    padding: 14px;
  }

  .guest-cta .btn {
    flex: none;
  }
}

@media (max-width: 560px) {
  .main {
    padding: 14px 12px 0;
  }

  .post-head {
    padding: 11px 12px 9px;
  }

  .post-info {
    padding: 7px 12px 11px;
  }

  .topbar {
    margin-bottom: 12px;
  }

  .topbar-sub {
    max-width: 70%;
  }

  .profile {
    padding: 16px 14px;
  }

  .profile-inner {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .profile-title-row {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .profile-actions {
    justify-content: center;
  }

  .profile-stats {
    justify-content: center;
    gap: 14px;
  }

  .joined {
    justify-content: center;
    display: flex;
  }

  .composer {
    padding: 12px;
  }

  .composer .avatar-md {
    --size: 36px;
  }

  .attach-btn span {
    display: none;
  }

  .guest-top .logo-word {
    font-size: 20px;
  }

  .guest-actions .btn {
    height: 34px;
    padding: 0 12px;
    font-size: 12.5px;
  }

  .notif-thumb {
    display: none;
  }

  .modal {
    padding: 20px;
    border-radius: 16px;
  }

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 90vh;
    border-radius: 18px 18px 0 0;
  }

  .modal-wide {
    border-radius: 0;
    max-height: 100vh;
  }
}

@media (max-width: 380px) {
  .guest-actions .btn-ghost {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------------------- keyframes */

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

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.82); }
}

@keyframes pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.22); }
  100% { transform: scale(1); }
}

@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes blink {
  0%, 80%, 100% { opacity: 0.25; }
  40% { opacity: 1; }
}

@keyframes bootbar {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(340%); }
}
