:root {
  --brand-logo-width: 125px;
  --bg: #000000;
  --bg-2: #000000;
  --ink: #f4f5f7;
  --muted: #9aa4b5;
  --avito-green: #04e061;
  --avito-red: #ff4053;
  --avito-purple: #965eeb;
  --avito-blue: #00aaff;
  --card: rgba(10, 12, 16, 0.88);
  --stroke: rgba(255, 255, 255, 0.11);
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.62);
  --feed-gutter: clamp(16px, 2.8vw, 42px);
  --overlay-side-offset: max(12px, 6vw);
  --avatar-size: 26px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: #000;
  scrollbar-gutter: stable both-edges;
}

body {
  min-height: 100vh;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background-color: #000;
  overscroll-behavior-y: none;
  background:
    radial-gradient(840px 540px at -10% 15%, rgba(0, 170, 255, 0.13), transparent 64%),
    radial-gradient(760px 500px at 110% 12%, rgba(150, 94, 235, 0.12), transparent 64%),
    radial-gradient(760px 420px at -12% 86%, rgba(4, 224, 97, 0.08), transparent 68%),
    radial-gradient(720px 420px at 112% 84%, rgba(255, 64, 83, 0.08), transparent 70%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.08;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(520px 900px at -8% 50%, rgba(0, 170, 255, 0.09), transparent 72%),
    radial-gradient(520px 900px at 108% 50%, rgba(150, 94, 235, 0.09), transparent 72%);
  pointer-events: none;
}

main {
  position: relative;
  z-index: 1;
}

body.no-scroll {
  overflow: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 6vw 18px;
  min-height: 78px;
  background: rgba(0, 0, 0, 0.96);
  border-bottom: none;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 40px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0;
  color: var(--ink);
  text-decoration: none;
}

.brand-logo {
  width: var(--brand-logo-width);
  height: auto;
  display: block;
  transition: transform 0.18s ease;
}

.brand:hover .brand-logo {
  transform: scale(1.04);
}

body.auth-page {
  overflow: hidden;
  background: #000000;
}

body.auth-page::before,
body.auth-page::after {
  content: none;
}

.auth-main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
}

.auth-shell {
  width: min(420px, 100%);
  display: grid;
  justify-items: center;
  gap: 18px;
}

.auth-logo {
  width: min(calc(var(--brand-logo-width) * 1.5), 72vw);
  height: auto;
  display: block;
  user-select: none;
}

.auth-form {
  width: 100%;
  position: relative;
  padding-bottom: 24px;
}

.auth-password-input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 0;
  background: transparent;
  color: #ffffff;
  -webkit-appearance: none;
  appearance: none;
  caret-color: #ffffff;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  padding: 10px 2px 11px;
  outline: none;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.auth-password-input::placeholder {
  color: #838997;
  opacity: 1;
}

.auth-password-input::-webkit-input-placeholder {
  color: #838997;
}

.auth-password-input::-moz-placeholder {
  color: #838997;
  opacity: 1;
}

.auth-password-input:hover {
  border-bottom-color: rgba(255, 255, 255, 0.55);
}

.auth-password-input:focus-visible {
  border-bottom-color: rgba(255, 255, 255, 1);
}

.auth-password-input:active {
  transform: translateY(1px);
  border-bottom-color: rgba(255, 255, 255, 1);
}

.auth-password-input:disabled {
  color: rgba(255, 255, 255, 0.66);
  border-bottom-color: rgba(255, 255, 255, 0.24);
  cursor: progress;
}

.auth-password-input.is-error {
  border-bottom-color: rgba(255, 64, 83, 0.9);
}

.auth-password-input.is-error:focus-visible {
  border-bottom-color: rgba(255, 112, 129, 1);
}

.auth-password-input:-webkit-autofill,
.auth-password-input:-webkit-autofill:hover,
.auth-password-input:-webkit-autofill:active {
  -webkit-text-fill-color: #ffffff;
  border-bottom-color: rgba(255, 255, 255, 0.35);
  -webkit-box-shadow: 0 0 0 1000px #000000 inset;
  box-shadow: 0 0 0 1000px #000000 inset;
  transition: background-color 9999s ease-out 0s;
}

.auth-password-input:-webkit-autofill:focus {
  -webkit-text-fill-color: #ffffff;
  border-bottom-color: rgba(255, 255, 255, 1);
  -webkit-box-shadow: 0 0 0 1000px #000000 inset;
  box-shadow: 0 0 0 1000px #000000 inset;
}

.auth-password-input.is-error:-webkit-autofill,
.auth-password-input.is-error:-webkit-autofill:hover,
.auth-password-input.is-error:-webkit-autofill:focus,
.auth-password-input.is-error:-webkit-autofill:active {
  border-bottom-color: rgba(255, 64, 83, 0.9);
}

.auth-error {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  min-height: 16px;
  font-size: 13px;
  line-height: 1.3;
  color: rgba(255, 124, 134, 0.95);
  text-align: left;
}

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

.topnav-link {
  padding: 8px 12px;
  border-radius: 10px;
  border: none;
  color: #ffffff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: transform 0.18s ease, color 0.2s ease, background 0.2s ease;
}

.topnav-link:hover {
  transform: scale(1.04);
}

.topnav-link.is-active {
  color: #ffffff;
  background: linear-gradient(120deg, rgba(0, 170, 255, 0.16), rgba(150, 94, 235, 0.16));
}

.feed {
  padding: 26px var(--feed-gutter) 100px;
}

.feed-filter {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(10, 12, 18, 0.62);
  backdrop-filter: blur(8px);
}

.feed-filter-profile {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.feed-filter-avatar,
.feed-filter-avatar-fallback {
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: 50%;
}

.feed-filter-avatar {
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
}

.feed-filter-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.feed-filter-avatar-fallback.is-project-icon svg {
  width: 16px;
  height: 16px;
  display: block;
  color: #ffffff;
}

.feed-filter-label {
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
}

.feed-filter-clear {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.2s ease;
}

.feed-filter-clear:hover {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.16);
}

.masonry {
  --masonry-columns: 4;
  --masonry-gap: 20px;
  position: relative;
  min-height: 1px;
}

.masonry.is-status {
  min-height: 0;
  height: auto !important;
}

.feed-date-divider {
  position: absolute;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
}

.feed-date-divider::before,
.feed-date-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.24) 50%, transparent 100%);
}

.feed-date-divider-label {
  color: rgba(245, 248, 255, 0.78);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1;
}

.card {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  border-radius: 0;
  overflow: hidden;
  background: var(--card);
  border: none;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.28s ease;
}

.card:hover {
  transform: scale(1.02);
}

.card:focus-visible {
  outline: 2px solid rgba(255, 214, 161, 0.95);
  outline-offset: 2px;
}

.card-media {
  position: relative;
}

.card-media-frame {
  max-height: 852px;
  overflow: hidden;
  border-radius: 40px;
}

.card-media img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 40px;
}

@supports (corner-shape: squircle) {
  .card-media-frame,
  .card-media img {
    corner-shape: squircle;
  }
}

.card-more-count {
  position: absolute;
  right: 12px;
  bottom: -12px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(245, 248, 255, 0.26);
  background: rgba(8, 12, 18, 0.9);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(5px);
  color: #f5f8ff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1;
  pointer-events: none;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px 12px;
  background: rgba(8, 10, 14, 0.92);
}

.card-author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  color: #ffffff;
  text-align: left;
}

.card-author.is-filterable {
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.2s ease;
}

.card-author.is-filterable:hover {
  transform: scale(1.02);
  opacity: 0.92;
}

.card-author.is-filterable:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 4px;
  border-radius: 999px;
}

.card-author-avatar,
.card-author-avatar-fallback {
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: 50%;
  flex-shrink: 0;
}

.card-author-avatar {
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
}

.card-author-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.card-author-name {
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-card {
  width: min(640px, 100%);
  margin: 0 auto;
  padding: 20px 22px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.feed-date-badge {
  position: fixed;
  left: var(--overlay-side-offset);
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 8px);
  z-index: 20;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(10, 11, 14, 0.72);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  border: 0;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, 10px, 0) scale(0.98);
  transition: opacity 0.24s ease, transform 0.24s ease;
  will-change: opacity, transform;
}

.feed-date-badge.has-year {
  width: 208px;
}

.feed-date-badge.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.feed-date-badge.is-changing {
  animation: feed-date-swap 0.2s ease;
}

@keyframes feed-date-swap {
  0% {
    opacity: 0.6;
    transform: translate3d(0, 4px, 0) scale(0.99);
  }

  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

.manifesto-page {
  min-height: calc(100vh - 86px);
  padding: 24px 6vw;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.manifesto-content {
  max-width: 980px;
}

.manifesto-text {
  font-size: clamp(18px, 2.2vw, 22px);
  font-weight: 500;
  color: #d8ddea;
  line-height: 1.5;
}

.manifesto-text + .manifesto-text {
  margin-top: 18px;
}

.history-page {
  min-height: calc(100vh - 86px);
  padding: 24px 6vw 64px;
}

.history-shell {
  width: min(980px, 100%);
  margin: 0 auto;
}

.history-chain {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-chain::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: #ffffff;
}

.history-item {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}

.history-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  margin-left: 6px;
  background: #ffffff;
}

.history-avatar {
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  display: block;
}

.history-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
}

.history-profile-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: #ffffff;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.history-profile-link:hover {
  opacity: 0.88;
}

.history-profile-link.is-disabled {
  cursor: default;
}

.history-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
  line-height: 1.15;
}

.history-actor {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.15;
}

.history-action {
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.15;
}

.history-target-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: #ffffff;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}

.history-target-link:hover {
  opacity: 0.88;
}

.history-target-link.is-disabled {
  cursor: default;
}

.history-target-avatar {
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  display: block;
}

.history-target-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
}

.history-target-name {
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.15;
}

.history-time {
  color: #8f8f8f;
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.15;
}

.history-status {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 16px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.03);
}

.collections-page {
  min-height: calc(100vh - 86px);
  padding: 24px 6vw 72px;
}

.collections-shell,
.collection-detail {
  width: min(1080px, 100%);
  margin: 0 auto;
}

.collections-head {
  margin-bottom: 18px;
}

.collections-title {
  font-size: clamp(24px, 3.6vw, 40px);
  line-height: 1.05;
  font-weight: 700;
  color: #ffffff;
}

.collections-subtitle {
  margin-top: 10px;
  color: #d7deef;
  font-size: 14px;
  line-height: 1.45;
  max-width: 760px;
}

.collection-create {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 12, 16, 0.72);
  backdrop-filter: blur(8px);
}

.collection-field-label {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
}

.collection-input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.4);
  color: #ffffff;
  font: inherit;
  font-size: 14px;
  line-height: 1.2;
  padding: 11px 12px;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.collection-input:focus {
  border-color: rgba(0, 170, 255, 0.75);
  background: rgba(0, 0, 0, 0.55);
}

.collection-textarea {
  min-height: 82px;
  resize: vertical;
}

.collection-create-btn,
.collection-copy-btn,
.picker-secondary-btn,
.picker-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.2s ease, background 0.2s ease;
}

.collection-create-btn {
  justify-self: start;
  padding: 10px 14px;
  background: linear-gradient(140deg, rgba(0, 170, 255, 0.82), rgba(150, 94, 235, 0.88));
}

.collection-create-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.collection-create-btn:hover:not(:disabled),
.collection-copy-btn:hover,
.picker-secondary-btn:hover,
.picker-add-btn:hover {
  transform: translateY(-1px);
}

.collection-create-status {
  min-height: 20px;
  font-size: 13px;
  color: #c9d5ea;
}

.collection-section {
  margin-top: 18px;
}

.collection-section-title {
  font-size: 15px;
  color: #ffffff;
  font-weight: 700;
  margin-bottom: 10px;
}

.collection-links {
  margin-bottom: 16px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.collection-link-row + .collection-link-row {
  margin-top: 10px;
}

.collection-link-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #c7d2e8;
}

.collection-link-control {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.collection-link-input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.45);
  color: #ffffff;
  font: inherit;
  font-size: 12px;
  line-height: 1.25;
  padding: 10px 11px;
}

.collection-copy-btn {
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.1);
}

.collection-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.collection-list-empty {
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 16px;
  color: #d0daec;
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
}

.collection-card {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 11, 15, 0.75);
}

.collection-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  padding: 10px;
}

.collection-card-cover {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
}

.collection-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.collection-card-cover-empty {
  color: #aab4c8;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.collection-card-title {
  margin-top: 10px;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.collection-card-meta {
  margin-top: 6px;
  font-size: 12px;
  color: #a8b2c8;
}

.collection-card-description {
  margin-top: 8px;
  font-size: 13px;
  color: #d4ddf0;
  line-height: 1.35;
}

.collection-back-link {
  display: inline-block;
  margin-bottom: 14px;
  text-decoration: none;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
}

.collection-detail-meta {
  margin-top: 10px;
  color: #a8b2c8;
  font-size: 12px;
}

.collection-items-status {
  margin: 4px 0 12px;
  min-height: 18px;
  color: #d0daec;
  font-size: 13px;
}

.collection-items {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.collection-item-card {
  display: grid;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(8, 10, 14, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.collection-item-link {
  display: block;
  text-decoration: none;
}

.collection-item-card img {
  width: 100%;
  display: block;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.04);
}

.collection-item-title {
  display: block;
  padding: 10px;
  color: #ffffff;
  font-size: 12px;
  line-height: 1.3;
}

.collection-item-remove {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 64, 83, 0.16);
  color: #ffffff;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: lowercase;
  padding: 9px 10px;
  cursor: pointer;
  transition: background 0.18s ease;
}

.collection-item-remove:hover {
  background: rgba(255, 64, 83, 0.24);
}

.viewer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3vh 0;
  background: rgba(0, 0, 0, 0.95);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: none;
}

.viewer.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.viewer-overlay-ui {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: 0;
  right: 0;
  z-index: 56;
  pointer-events: none;
}

.viewer-content {
  position: relative;
  width: 100vw;
  max-width: 100vw;
  max-height: 92vh;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 0 10px;
  -webkit-overflow-scrolling: touch;
}

.viewer-content.is-single {
  overflow-x: hidden;
}

.viewer-content::-webkit-scrollbar {
  height: 9px;
}

.viewer-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}

.viewer-content::-webkit-scrollbar-thumb {
  background: rgba(235, 242, 255, 0.42);
  border-radius: 999px;
}

.viewer-strip {
  display: flex;
  align-items: center;
  gap: 18px;
  width: max-content;
  min-height: 88vh;
  padding-left: var(--feed-gutter);
  padding-right: var(--feed-gutter);
}

.viewer-content.is-compact .viewer-strip {
  margin-inline: auto;
  padding-left: 0;
  padding-right: 0;
}

.viewer-content.is-single .viewer-strip {
  width: 100%;
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.viewer-image {
  flex: 0 0 auto;
  width: auto;
  max-width: min(1280px, 90vw);
  max-height: 86vh;
  object-fit: contain;
  border-radius: 0;
  border: none;
  background: transparent;
  display: block;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform;
}

.viewer-author {
  position: fixed;
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 8px);
  left: var(--overlay-side-offset);
  z-index: 57;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 8px 12px 8px 8px;
  border-radius: 999px;
  background: rgba(10, 11, 14, 0.72);
  border: 0;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  pointer-events: auto;
}

.viewer-author-profile {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
}

.viewer-author-profile:disabled {
  opacity: 1;
}

.viewer-author-profile.is-filterable {
  cursor: pointer;
  transition: transform 0.18s ease;
}

.viewer-author-profile.is-filterable:hover {
  transform: scale(1.03);
}

.viewer-author-profile:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 4px;
}

.viewer-author-avatar {
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
}

.viewer-author-nick {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

.viewer-author-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  background: transparent;
  transition: transform 0.18s ease, opacity 0.2s ease;
}

.viewer-author-link:hover {
  transform: scale(1.04);
}

.viewer-author-link:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 4px;
}

.viewer-author-link-icon {
  width: 12px;
  height: 18px;
  display: block;
  color: #fff;
  flex-shrink: 0;
}

.viewer-project {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s ease, opacity 0.2s ease;
}

.viewer-project-icon {
  width: 23px;
  height: 23px;
  display: block;
  color: #fff;
  flex-shrink: 0;
}

.viewer-project:hover {
  transform: scale(1.04);
}

.viewer-project:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 4px;
}

.viewer-delete {
  position: fixed;
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 8px);
  right: var(--overlay-side-offset);
  z-index: 57;
  border: 0;
  border-radius: 12px;
  width: 42px;
  height: 42px;
  padding: 0;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.2s ease;
  pointer-events: auto;
}

.viewer-delete:hover {
  transform: scale(1.05);
}

.viewer-delete-icon {
  width: 23px;
  height: 23px;
  display: block;
  margin: 0 auto;
}

.viewer-close {
  position: fixed;
  top: calc(max(14px, env(safe-area-inset-top)) + 2px);
  right: var(--overlay-side-offset);
  z-index: 57;
  border: 0;
  border-radius: 999px;
  width: 42px;
  height: 42px;
  padding: 0;
  background: rgba(10, 11, 14, 0.72);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.2s ease, background 0.2s ease;
  pointer-events: auto;
}

.viewer-close:hover {
  transform: scale(1.05);
  background: rgba(18, 24, 34, 0.88);
}

.viewer-close-icon {
  width: 23px;
  height: 23px;
  display: block;
  margin: 0 auto;
}

.viewer-collection {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  padding: 0;
  background: transparent;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s ease, opacity 0.2s ease;
}

.viewer-collection:hover {
  transform: scale(1.04);
}

.viewer-collection:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 4px;
}

.viewer-collection-icon {
  width: 23px;
  height: 23px;
  display: block;
  color: #fff;
  flex-shrink: 0;
}

.collection-picker {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.58);
  padding: 16px;
}

.collection-picker-dialog {
  width: min(560px, 100%);
  max-height: min(78vh, 720px);
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(7, 10, 14, 0.96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  padding: 14px;
}

.collection-picker-title {
  color: #ffffff;
  font-size: 17px;
  font-weight: 700;
}

.collection-picker-subtitle {
  margin-top: 6px;
  color: #c7d3e8;
  font-size: 13px;
}

.collection-picker-search {
  margin-top: 12px;
}

.collection-picker-search input {
  width: 100%;
}

.collection-picker-status {
  min-height: 18px;
  margin-top: 10px;
  color: #d0daec;
  font-size: 13px;
}

.collection-picker-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.collection-picker-group {
  margin-top: 2px;
  color: #aeb8cf;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.collection-picker-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 9px;
}

.collection-picker-name {
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.collection-picker-meta {
  margin-top: 3px;
  color: #aeb8cf;
  font-size: 11px;
}

.collection-picker-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.picker-pin-btn {
  border: 0;
  border-radius: 8px;
  padding: 8px 9px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  text-transform: lowercase;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.2s ease;
}

.picker-pin-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.2);
}

.picker-add-btn {
  padding: 8px 10px;
  background: rgba(0, 170, 255, 0.24);
}

.collection-picker-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.picker-secondary-btn {
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.12);
}

.undo-toast {
  position: fixed;
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + 8px);
  right: var(--overlay-side-offset);
  z-index: 80;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 0;
  background: rgba(10, 12, 18, 0.84);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(10px);
  padding: 0;
  opacity: 0;
  transform: translate3d(0, -10px, 0) scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s ease;
  cursor: pointer;
  pointer-events: none;
  overflow: hidden;
  appearance: none;
}

.undo-toast.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  pointer-events: auto;
}

.undo-toast:hover {
  transform: translate3d(0, 0, 0) scale(1.05);
}

.undo-toast-icon-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.undo-toast-icon {
  width: 20px;
  height: 20px;
  display: block;
  color: #f2f7ff;
  overflow: visible;
}

.undo-toast-progress {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 5px;
  height: 3px;
  border-radius: 99px;
  transform-origin: left center;
  transform: scaleX(1);
  background: linear-gradient(90deg, #78cfff 0%, #aec2ff 55%, #d8dcff 100%);
}

.undo-toast-progress.is-running {
  animation: undo-progress 5s linear forwards;
}

@keyframes undo-progress {
  from {
    transform: scaleX(1);
  }

  to {
    transform: scaleX(0);
  }
}

@media (max-width: 1080px) {
  .masonry {
    --masonry-columns: 3;
  }

  .collection-items {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .masonry {
    --masonry-columns: 2;
  }

  .collection-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .collection-items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-height: 0;
  }

  .topbar-left {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .topnav {
    width: 100%;
    flex-wrap: wrap;
  }

  .feed {
    padding-top: 22px;
  }

  .manifesto-page {
    min-height: calc(100vh - 110px);
    padding-top: 24px;
  }

  .history-page {
    min-height: calc(100vh - 110px);
    padding-top: 22px;
  }

  .collections-page {
    min-height: calc(100vh - 110px);
    padding-top: 22px;
  }

  .history-item {
    grid-template-columns: 20px 1fr;
    gap: 10px;
  }

  .masonry {
    --masonry-columns: 1;
  }

  .feed-date-badge {
    bottom: calc(max(12px, env(safe-area-inset-bottom)) + 6px);
  }

  .viewer {
    padding: 2vh 0;
  }

  .viewer-content {
    max-height: 90vh;
    padding-bottom: 8px;
  }

  .viewer-strip {
    gap: 12px;
    min-height: 84vh;
  }

  .viewer-image {
    max-width: min(940px, 88vw);
    max-height: 74vh;
  }

  .viewer-delete {
    bottom: calc(max(12px, env(safe-area-inset-bottom)) + 6px);
    right: var(--overlay-side-offset);
  }

  .viewer-close {
    top: calc(max(10px, env(safe-area-inset-top)) + 2px);
    right: var(--overlay-side-offset);
  }

  .viewer-author {
    bottom: calc(max(12px, env(safe-area-inset-bottom)) + 6px);
    left: var(--overlay-side-offset);
    padding: 7px 10px 7px 7px;
  }

  .undo-toast {
    right: var(--overlay-side-offset);
    bottom: calc(max(12px, env(safe-area-inset-bottom)) + 6px);
  }

  .collection-link-control {
    grid-template-columns: 1fr;
  }

  .collection-list,
  .collection-items {
    grid-template-columns: 1fr;
  }

  .collection-picker-dialog {
    width: 100%;
  }
}
