:root {
  --bg: #0e1016;
  --bg-soft: #161a24;
  --surface: #1b2030;
  --surface-2: #232a3d;
  --text: #eef1f8;
  --muted: #96a0b8;
  --line: #2b3348;
  --brand: #7c5cff;
  --brand-2: #22d3ee;
  --brand-ink: #ffffff;
  --danger: #ff5470;
  --ok: #2fd18a;
  --warn: #ffb020;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.28);
  --grad: linear-gradient(120deg, var(--brand), var(--brand-2));
}

[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-soft: #eef1f8;
  --surface: #ffffff;
  --surface-2: #f2f5fb;
  --text: #141824;
  --muted: #626c85;
  --line: #e2e7f1;
  --shadow: 0 14px 40px rgba(30, 41, 80, 0.12);
  --shadow-sm: 0 6px 18px rgba(30, 41, 80, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", Roboto, system-ui, -apple-system, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand-2);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img,
video {
  max-width: 100%;
  display: block;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 10px 16px;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
  color: var(--text);
  letter-spacing: 0.2px;
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 34px;
  height: 34px;
}

.brand b {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-left: auto;
}

.nav a {
  color: var(--muted);
  font-weight: 600;
  font-size: 15px;
  padding: 8px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.nav a:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

.nav a.active {
  background: var(--grad);
  color: #fff;
}

.nav a.active svg {
  color: #fff;
}

.search-inline {
  position: relative;
  flex: 1 1 150px;
  max-width: 210px;
}

.search-inline input {
  width: 100%;
  padding: 10px 14px 10px 38px;
}

.search-inline svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  background: var(--grad);
  color: #fff;
  font: inherit;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(124, 92, 255, 0.35);
  text-decoration: none;
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

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

.btn.ghost:hover {
  background: var(--surface-2);
  box-shadow: none;
}

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

.btn.sm {
  padding: 6px 12px;
  font-size: 14px;
}

.btn.block {
  width: 100%;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease;
}

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

/* ---------- Inputs ---------- */
input,
textarea,
select {
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 30%, transparent);
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 14px;
}

.field {
  margin-bottom: 16px;
}

.vis-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 2px;
  color: var(--muted);
  font-size: 13px;
}

.vis-switch select {
  width: auto;
  min-width: 150px;
  padding: 7px 10px;
  font-size: 14px;
}

.hint {
  color: var(--muted);
  font-size: 13px;
}

.error-text {
  color: var(--danger);
  font-size: 13px;
  min-height: 18px;
}

/* ---------- Layout ---------- */
.view {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

.page-head {
  margin-bottom: 22px;
}

.page-head h1 {
  margin: 0 0 6px;
  font-size: clamp(24px, 3vw, 34px);
}

.page-head p {
  margin: 0;
  color: var(--muted);
}

.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 20px;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}

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

.chip.active {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
}

/* ---------- Masonry feed ---------- */
.masonry {
  columns: 4 240px;
  column-gap: 18px;
}

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

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

.card {
  break-inside: avoid;
  margin: 0 0 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.4s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.card-media {
  position: relative;
  cursor: zoom-in;
  background: var(--surface-2);
  min-height: 80px;
}

.card-media img,
.card-media video {
  width: 100%;
  height: auto;
  display: block;
}

.card-media .play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.25);
}

.card-media .play svg {
  width: 52px;
  height: 52px;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
}

/* Видеопубликация без превью: показываем значок видеофайла */
.video-file {
  min-height: 190px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  color: var(--muted);
  background:
    radial-gradient(circle at 50% 15%, rgba(34, 211, 238, 0.16), transparent 58%),
    linear-gradient(135deg, var(--surface-2), var(--surface));
}

.video-file-icon {
  width: 74px;
  height: 74px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  color: var(--brand-2);
  background: color-mix(in srgb, var(--brand-2) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand-2) 28%, transparent);
}

.video-file-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

.video-file-name {
  max-width: 100%;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-file-hint {
  font-size: 12px;
  color: var(--muted);
}

.video-file.compact {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 16px;
}

.video-file.compact .video-file-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
}

.post-media.locked .video-file {
  width: 100%;
  min-height: 260px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  backdrop-filter: blur(4px);
}

.badge.public { background: rgba(47, 209, 138, 0.9); }
.badge.community { background: rgba(34, 211, 238, 0.9); color: #06232b; }
.badge.private { background: rgba(255, 84, 112, 0.9); }
.badge.role { background: var(--grad); }

.card-media .badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
}

/* Закрытая публикация: превью под размытием и замок */
.card-media.locked {
  cursor: pointer;
  overflow: hidden;
  min-height: 180px;
}

.card-media.locked img {
  filter: blur(14px) saturate(0.85);
  transform: scale(1.12);
  pointer-events: none;
}

.card-media .lock-overlay,
.post-media .lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  text-align: center;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  background: rgba(8, 12, 24, 0.25);
  pointer-events: none;
}

.lock-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(8, 12, 24, 0.6);
  backdrop-filter: blur(3px);
}

.card-body {
  padding: 12px 14px 14px;
}

.card-title {
  font-weight: 700;
  font-size: 15px;
  margin: 0 0 4px;
  display: block;
  color: var(--text);
}

.card-title:hover {
  text-decoration: none;
  color: var(--brand-2);
}

.card-desc {
  color: var(--muted);
  font-size: 13.5px;
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.tag {
  font-size: 12px;
  color: var(--brand-2);
  background: color-mix(in srgb, var(--brand-2) 14%, transparent);
  padding: 2px 9px;
  border-radius: 999px;
}

.tag:hover {
  text-decoration: none;
}

.card-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12.5px;
  min-width: 0;
}

.card-foot > a {
  min-width: max-content;
  flex: 1 1 auto;
}

.card-foot > a span {
  white-space: nowrap;
}

.card-foot > span {
  flex: none;
  white-space: nowrap;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex: none;
  overflow: hidden;
}

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

.avatar.lg { width: 84px; height: 84px; font-size: 30px; }
.avatar.sm { width: 24px; height: 24px; font-size: 11px; }

.card-actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
}

/* ---------- Архив публикации ---------- */
.archive-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin: 12px 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  min-width: 0;
}

.archive-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: none;
  color: var(--brand-2);
  background: color-mix(in srgb, var(--brand-2) 16%, transparent);
}

.archive-info {
  min-width: 0;
}

.archive-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
}

.archive-badge {
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 6px;
  border-radius: 999px;
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 16%, transparent);
}

.archive-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}

.archive-actions .btn {
  padding: 5px 9px;
  font-size: 12px;
}

.archive-actions .btn span {
  display: inline-flex;
}

.archive-actions .archive-icon-btn {
  padding: 5px 7px;
}

.act {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
}

.act:hover {
  background: var(--surface-2);
  color: var(--text);
}

.act.liked {
  color: var(--danger);
}

.act.liked svg {
  fill: var(--danger);
}

.act svg {
  width: 17px;
  height: 17px;
}

/* ---------- Empty / skeleton ---------- */
.empty {
  text-align: center;
  padding: 70px 20px;
  color: var(--muted);
}

.empty svg {
  width: 54px;
  height: 54px;
  margin-bottom: 12px;
  opacity: 0.6;
}

.empty .btn svg {
  width: 17px;
  height: 17px;
  margin-bottom: 0;
  opacity: 1;
}

.auth-actions .btn {
  min-width: 8.5em;
}

.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 37%, var(--surface) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius);
}

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

/* ---------- Auth ---------- */
.auth-wrap {
  max-width: 440px;
  margin: 40px auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

.auth-wrap h1 {
  margin: 0 0 6px;
  font-size: 26px;
}

.auth-wrap p.sub {
  margin: 0 0 22px;
  color: var(--muted);
}

.switch-line {
  text-align: center;
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- Profile ---------- */
.profile-head {
  display: flex;
  gap: 22px;
  align-items: center;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.profile-meta {
  flex: 1;
  min-width: 220px;
}

.profile-meta h1 {
  margin: 0 0 4px;
  font-size: 26px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-meta .handle {
  color: var(--muted);
}

.profile-stats {
  display: flex;
  gap: 22px;
  margin-top: 12px;
}

.profile-stats b {
  display: block;
  font-size: 20px;
}

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

/* ---------- Post detail ---------- */
.post-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: 24px;
  align-items: start;
}

@media (max-width: 860px) {
  .post-detail {
    grid-template-columns: 1fr;
  }
}

.post-media {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.post-media.locked {
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
}

.post-media.locked img {
  filter: blur(24px) saturate(0.85);
  transform: scale(1.08);
  cursor: default;
  pointer-events: none;
}

.post-media img,
.post-media video {
  width: 100%;
  cursor: zoom-in;
}

.post-side {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.comment {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.comment .body {
  flex: 1;
}

.comment .who {
  font-weight: 700;
  font-size: 14px;
}

.comment .when {
  color: var(--muted);
  font-size: 12px;
  margin-left: 8px;
  font-weight: 400;
}

.comment .text {
  color: var(--text);
  font-size: 14.5px;
  margin-top: 2px;
  word-wrap: break-word;
}

.comment-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.comment-actions .btn {
  padding: 4px 9px;
  font-size: 12px;
}

.comment-form {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.comment-form input {
  flex: 1;
}

/* ---------- Upload ---------- */
.drop {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 44px 20px;
  text-align: center;
  background: var(--surface);
  transition: border-color 0.2s ease, background 0.2s ease;
  cursor: pointer;
}

.drop:hover,
.drop.over {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
}

.drop svg {
  width: 48px;
  height: 48px;
  color: var(--brand);
  margin-bottom: 10px;
}

.preview {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  margin-bottom: 18px;
  background: var(--surface);
}

.preview img,
.preview video {
  max-height: 380px;
  width: auto;
  margin: 0 auto;
}

.progress {
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}

.progress > i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--grad);
  transition: width 0.2s ease;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 620px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ---------- Modal ---------- */
.modal-root,
.lightbox-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(4, 6, 12, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 460px;
  padding: 26px;
  animation: pop 0.2s ease;
}

.modal h3 {
  margin: 0 0 10px;
}

@keyframes pop {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* ---------- Lightbox ---------- */
.lightbox-root {
  flex-direction: column;
}

.lightbox-media {
  max-width: 92vw;
  max-height: 82vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-media img,
.lightbox-media video {
  max-width: 92vw;
  max-height: 82vh;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.lightbox-bar {
  color: #fff;
  margin-top: 14px;
  display: flex;
  gap: 16px;
  align-items: center;
}

.lb-close {
  position: absolute;
  top: 18px;
  right: 20px;
}

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  font-size: 22px;
}

.lb-nav:hover { background: rgba(255, 255, 255, 0.28); }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }

/* ---------- Toasts ---------- */
.toast-root {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: var(--shadow);
  animation: slideIn 0.25s ease;
  max-width: 320px;
}

.toast.ok { border-left-color: var(--ok); }
.toast.error { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ---------- Table (admin) ---------- */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.table th,
.table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.table th {
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 700;
}

.table tr:last-child td {
  border-bottom: none;
}

.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 13px;
}

.section {
  margin-bottom: 34px;
}

.section > h2 {
  font-size: 20px;
  margin: 0 0 14px;
}

.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.album-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.album-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.album-cover {
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
  overflow: hidden;
}

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

.album-body {
  padding: 12px 14px;
  color: var(--text);
}

.album-card > .album-link {
  display: block;
  color: inherit;
}

.album-card > .album-link:hover {
  text-decoration: none;
}

.album-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 14px 14px;
}

.album-actions .btn {
  padding: 5px 10px;
  font-size: 13px;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 26px 20px;
  text-align: center;
  font-size: 14px;
}

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

/* ---------- misc ---------- */
.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.spread {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.muted { color: var(--muted); }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.center { text-align: center; }
.hidden { display: none !important; }

/* ---------- Feed hero ---------- */
.feed-hero {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background-size: cover;
  background-position: center;
  min-height: 320px;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow);
}

.feed-hero-inner {
  padding: 44px 38px;
  max-width: 720px;
  color: #fff;
}

.feed-hero h1 {
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.1;
  margin: 0 0 12px;
  text-shadow: 0 2px 22px rgba(0, 0, 0, 0.5);
}

.feed-hero p {
  color: #e7edfb;
  margin: 0 0 18px;
  font-size: 16px;
}

.hero-stats {
  display: flex;
  gap: 28px;
  margin: 20px 0 24px;
  flex-wrap: wrap;
}

.hero-stat b {
  display: block;
  font-size: 26px;
  line-height: 1.1;
}

.hero-stat span {
  color: #c9d5f0;
  font-size: 13px;
}

@media (max-width: 560px) {
  .feed-hero-inner { padding: 30px 22px; }
  .hero-stats { gap: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- PHP app additions ---------- */
.flash-stack {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 180;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(420px, calc(100vw - 40px));
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 14px;
  line-height: 1.45;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.alert > svg {
  flex: 0 0 auto;
  margin-top: 1px;
}

.alert a {
  color: inherit;
  text-decoration: underline;
}

.alert.success { border-left-color: var(--ok); }
.alert.error { border-left-color: var(--danger); }
.alert.warn { border-left-color: var(--warn); }

.alert.is-hiding {
  opacity: 0;
  transform: translateX(20px);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 9px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.user-chip:hover {
  background: var(--surface-2);
  text-decoration: none;
}

.user-chip > span:last-child {
  white-space: nowrap;
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

.manage-details {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.manage-details > summary {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  list-style: none;
}

.manage-details > summary::-webkit-details-marker {
  display: none;
}

.manage-details[open] > summary {
  margin-bottom: 10px;
}

.archive-badge.real {
  color: var(--ok);
  background: color-mix(in srgb, var(--ok) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--ok) 34%, transparent);
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
}

.stat-card b {
  display: block;
  font-size: 22px;
  line-height: 1.1;
}

.stat-card span {
  color: var(--muted);
  font-size: 12px;
}

.theme-icon-sun,
.theme-icon-moon {
  display: flex;
}

[data-theme="dark"] .theme-icon-moon { display: none; }
[data-theme="light"] .theme-icon-sun { display: none; }

.drop.is-dragging {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
}

.preview img {
  display: block;
  max-width: 100%;
  border-radius: 12px;
}

.album-cover .video-file.compact {
  min-height: 100%;
  height: 100%;
}

.comment-actions details {
  display: inline-block;
}

.comment-actions details > summary {
  list-style: none;
}

.comment-actions details > summary::-webkit-details-marker {
  display: none;
}

@media (max-width: 700px) {
  .flash-stack {
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
  }
}
