:root {
  --bg: #f8f5f1;
  --surface: #ffffff;
  --card: #ffffff;
  --border: #ede7df;
  --border2: #d8cfc6;
  --accent: #8a6a4a;
  --accent-l: #f5ede3;
  --accent-d: #704f32;
  --red: #c85858;
  --red-l: #fdf0f0;
  --green: #3d9e6e;
  --text: #1a1410;
  --text2: #3a2e26;
  --muted: #8a7e74;
  --muted2: #bdb4ac;
  --shadow: 0 1px 8px rgba(40, 25, 15, 0.06), 0 2px 20px rgba(40, 25, 15, 0.04);
  --shadow2: 0 4px 24px rgba(40, 25, 15, 0.1), 0 1px 4px rgba(40, 25, 15, 0.05);
  --r: 12px;
  --r2: 18px;
}
[data-theme='dark'] {
  --bg: #141210;
  --surface: #1e1c18;
  --card: #242220;
  --border: #332f2a;
  --border2: #443e36;
  --accent: #c4976a;
  --accent-l: #2a2218;
  --accent-d: #daa876;
  --red: #e07070;
  --red-l: #2a1818;
  --green: #5ec090;
  --text: #ede8e2;
  --text2: #c8c0b8;
  --muted: #8a8078;
  --muted2: #5a544e;
  --shadow: 0 1px 8px rgba(0, 0, 0, 0.2), 0 2px 20px rgba(0, 0, 0, 0.15);
  --shadow2: 0 4px 24px rgba(0, 0, 0, 0.3), 0 1px 4px rgba(0, 0, 0, 0.15);
}
[data-theme='dark'] #header {
  background: rgba(20, 18, 16, 0.95);
}
[data-theme='dark'] #sidebar {
  background: #1a1816;
}
[data-theme='dark'] .auth-card {
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.3);
}
[data-theme='dark'] #auth-page {
  background: linear-gradient(160deg, #141210 0%, #1a1816 100%);
}
[data-theme='dark'] .lb-bg {
  background: rgba(0, 0, 0, 0.92);
}
[data-theme='dark'] .cloud {
  display: none;
}
@media (hover: hover) {
  [data-theme='dark'] .p-card:hover .p-thumb img.loaded,
  [data-theme='dark'] .p-card:hover .p-thumb .p-thumb-vid.loaded {
    filter: blur(2px) brightness(0.5);
  }
}
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  /* PWA: safe areas for notch devices */
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
h1,
h2,
h3,
.logo-text {
  font-family: 'Sora', sans-serif;
}
button {
  font-family: 'Plus Jakarta Sans', sans-serif;
  cursor: pointer;
}
input,
select,
textarea {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
}
::-webkit-scrollbar {
  width: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 99px;
}
.hidden {
  display: none !important;
}

/* ── TOAST ── */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  animation:
    fadeUp 0.25s ease,
    fadeOut 0.3s ease 3.2s forwards;
  max-width: 340px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}
.toast-error {
  background: var(--red-l);
  color: var(--red);
  border: 1px solid #e8bcbc;
}
.toast-success {
  background: #edf7f2;
  color: var(--green);
  border: 1px solid #b8deca;
}
.toast-info {
  background: var(--accent-l);
  color: var(--accent);
  border: 1px solid #dcc0a0;
}
@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

/* ── SETUP BANNER ── */
#setup-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #1c1814;
  color: #f7f5f2;
  padding: 11px 22px;
  font-size: 13px;
  text-align: center;
}
#setup-banner code {
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 12px;
}
#setup-banner a {
  color: #e8c090;
  cursor: pointer;
  margin-left: 12px;
  font-weight: 600;
}

/* ── INVITE BANNER ── */
#invite-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9998;
  background: var(--accent-l);
  color: var(--accent);
  border-bottom: 1px solid #dcc0a0;
  padding: 11px 20px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}
#invite-banner.hidden {
  display: none;
}
#invite-banner-msg {
  flex: 1;
  text-align: center;
  font-weight: 500;
}
#invite-banner-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
#invite-banner-btn:hover {
  opacity: 0.88;
}
#invite-banner-dismiss {
  cursor: pointer;
  font-size: 14px;
  color: var(--accent);
  opacity: 0.6;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}
#invite-banner-dismiss:hover {
  opacity: 1;
}

/* ── LOADING ── */
#loading {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
#loading h2 {
  font-size: 38px;
  color: var(--accent);
  font-weight: 500;
  font-style: normal;
}
#loading p {
  color: var(--muted);
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0.8px;
}

/* ── SPINNERS ── */
.spinner {
  width: 32px;
  height: 32px;
  border: 2px solid var(--border2);
  border-top: 2px solid var(--accent);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}
.spin-sm {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

/* ── AUTH ── */
/* CLOUDS */
.clouds {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.cloud {
  position: absolute;
  background: white;
  border-radius: 50px;
  opacity: 0;
  filter: blur(2px);
  animation: cloudDrift linear infinite;
}
.cloud::before,
.cloud::after {
  content: '';
  position: absolute;
  background: white;
  border-radius: 50%;
}
@keyframes cloudDrift {
  0% {
    transform: translateX(-200px);
    opacity: 0;
  }
  5% {
    opacity: 1;
  }
  95% {
    opacity: 0.7;
  }
  100% {
    transform: translateX(calc(100vw + 300px));
    opacity: 0;
  }
}

#auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  z-index: 1;
  background: linear-gradient(160deg, #f8f5f1 0%, #f2ece4 100%);
  overflow: hidden;
}
.auth-wrap {
  width: 100%;
  max-width: 440px;
}
.auth-brand {
  text-align: center;
  margin-bottom: 36px;
}
.auth-brand-icon {
  font-size: 52px;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 12px rgba(176, 116, 72, 0.25));
  animation: floatIcon 4s ease-in-out infinite;
}
@keyframes floatIcon {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}
.auth-brand h1 {
  font-size: 46px;
  color: var(--accent);
  font-style: normal;
  font-weight: 500;
  text-shadow: 0 2px 20px rgba(176, 116, 72, 0.15);
}
.auth-brand p {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  font-weight: 300;
  margin-top: 6px;
}
@keyframes dotPulse {
  0%,
  100% {
    opacity: 0.2;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.3);
  }
}
.auth-card {
  background: var(--surface);
  border-radius: var(--r2);
  padding: 32px 38px 28px;
  box-shadow:
    0 8px 48px rgba(15, 25, 40, 0.09),
    0 1px 2px rgba(15, 25, 40, 0.04);
  border: 1px solid var(--border);
  animation: fadeUp 0.4s ease;
  position: relative;
  overflow: hidden;
}
.auth-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 100% 0%, rgba(138, 106, 74, 0.07) 0%, transparent 65%);
  pointer-events: none;
}
.auth-card-title {
  font-size: 24px;
  color: var(--text);
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}
.auth-card-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 28px;
  line-height: 1.6;
  font-weight: 300;
}
.auth-card-welcome-sub {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  font-weight: 300;
  margin-bottom: 20px;
}
.auth-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 0;
}
.auth-login-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 11px;
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(138, 106, 74, 0.3);
  transition: all 0.18s;
  letter-spacing: 0.1px;
}
.auth-login-btn:hover {
  background: var(--accent-d);
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(138, 106, 74, 0.38);
}
.auth-login-btn:active {
  transform: translateY(0);
}
.auth-register-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 13px 18px;
  border-radius: 11px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text2);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.18s;
  cursor: pointer;
}
.auth-register-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.auth-sep {
  height: 1px;
  background: var(--border);
  margin: 22px 0 18px;
}
.auth-card-features {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.auth-card-feature {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted2);
  font-weight: 400;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px;
  white-space: nowrap;
}
.auth-sso-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted2);
  font-weight: 300;
}
.lock-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--accent-l);
  border: 1px solid rgba(138, 106, 74, 0.2);
  border-radius: 9px;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 16px;
  font-weight: 500;
}

/* ── SSO CARD ─────────────────────────────────────────────── */
.sso-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #1a1f2e 0%, #222a3a 100%);
  border: 1px solid rgba(99, 130, 210, 0.25);
  border-radius: var(--r2);
  padding: 20px 24px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(99, 130, 210, 0.08);
  animation: fadeUp 0.45s ease;
}
[data-theme='light'] .sso-card {
  background: linear-gradient(135deg, #1e2640 0%, #2a3456 100%);
}
.sso-card-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}
.sso-logo-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
}
.sso-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.sso-card-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.sso-card-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: rgba(150, 170, 230, 0.7);
}
.sso-card-desc {
  font-size: 13px;
  color: rgba(220, 225, 240, 0.85);
  font-weight: 400;
  line-height: 1.4;
}
.sso-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #5b7fe8, #7c5dfa);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition:
    opacity 0.18s,
    transform 0.15s;
  box-shadow: 0 3px 14px rgba(91, 127, 232, 0.4);
}
.sso-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}
.sso-btn:active {
  transform: translateY(0);
  opacity: 1;
}
@media (max-width: 480px) {
  .sso-card {
    flex-direction: column;
    align-items: stretch;
  }
  .sso-btn {
    justify-content: center;
  }
  .sso-card-desc {
    white-space: normal;
  }
}
.field {
  margin-bottom: 18px;
}
.field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted2);
  margin-bottom: 7px;
}
.field input,
.field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 15px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  font-weight: 400;
}
.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(138, 106, 74, 0.12);
}
.field .hint {
  font-size: 11px;
  color: var(--muted2);
  margin-top: 5px;
  font-weight: 300;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
  letter-spacing: 0.2px;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  width: 100%;
  padding: 13px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  margin-top: 4px;
  box-shadow: 0 4px 20px rgba(138, 106, 74, 0.28);
  letter-spacing: 0.1px;
}
.btn-primary:hover {
  background: var(--accent-d);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(138, 106, 74, 0.36);
}
.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover {
  border-color: var(--border2);
  color: var(--text2);
}
.btn-danger {
  background: var(--red-l);
  color: var(--red);
  border: 1px solid #e8bcbc;
}
.btn-danger:hover {
  background: #f8dada;
}
.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  font-weight: 600;
}
.btn-link:hover {
  text-decoration: underline;
}
.msg {
  border-radius: 10px;
  padding: 10px 15px;
  font-size: 13px;
  text-align: center;
  margin-bottom: 16px;
  line-height: 1.5;
  font-weight: 400;
}
.msg-error {
  background: var(--red-l);
  color: var(--red);
  border: 1px solid #e8bcbc;
}
.msg-success {
  background: #edf7f2;
  color: var(--green);
  border: 1px solid #b8deca;
}
.msg-info {
  background: var(--accent-l);
  color: var(--accent);
  border: 1px solid #dcc0a0;
}
.slots-row {
  text-align: center;
  margin-bottom: 22px;
}
.slots-pill {
  display: inline-block;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 99px;
  padding: 4px 16px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.slots-pill.warn {
  border-color: #e8c080;
  color: #a07828;
  background: #fdf8ee;
}
.slots-pill.full {
  border-color: #e8a0a0;
  color: var(--red);
  background: var(--red-l);
}
.auth-switch {
  text-align: center;
  margin-top: 22px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 300;
}
.auth-switch a {
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}
.forgot-row {
  text-align: right;
  margin-top: -10px;
  margin-bottom: 16px;
}

/* ── APP ── */
#app {
  display: none;
  min-height: 100vh;
  flex-direction: column;
}
#app.show {
  display: flex;
}

/* ── HEADER ── */
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  min-height: 62px;
  box-sizing: content-box;
  background: rgba(247, 245, 242, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  padding-top: env(safe-area-inset-top);
}
#app.show {
  padding-top: calc(62px + env(safe-area-inset-top));
}
.logo-text {
  font-size: 24px;
  color: var(--accent);
  font-style: normal;
  font-weight: 500;
  flex: 1;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-text small {
  display: block;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 10px;
  color: var(--muted2);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  font-weight: 300;
  font-style: normal;
  margin-top: 1px;
}
.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-l), #f0e8de);
  border: 1.5px solid rgba(138, 106, 74, 0.15);
  box-shadow: 0 2px 8px rgba(138, 106, 74, 0.1);
}
.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── NOTIFICATION BELL ── */
.notif-bell-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    color 0.2s,
    background 0.2s;
}
.notif-bell-btn:hover {
  color: var(--accent);
  background: var(--accent-l, rgba(138, 106, 74, 0.1));
}
.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  background: var(--red, #e05);
  color: #fff;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
  pointer-events: none;
}

/* ── NOTIFICATION PANEL ── */
.notif-panel {
  position: fixed;
  top: 57px;
  right: 16px;
  width: 360px;
  max-height: 480px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.notif-panel-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}
.notif-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.notif-mark-all-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 6px;
  transition: background 0.2s;
}
.notif-mark-all-btn:hover {
  background: var(--accent-l, rgba(138, 106, 74, 0.1));
}
.notif-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
  padding: 3px 6px;
  border-radius: 6px;
  transition: background 0.2s;
}
.notif-close-btn:hover {
  background: var(--border);
}
.notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
}
.notif-item {
  display: flex;
  gap: 8px;
  padding: 11px 14px 11px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
  align-items: flex-start;
}
.notif-item:last-child {
  border-bottom: none;
}
.notif-item:hover {
  background: var(--bg);
}
.notif-item.unread {
  background: rgba(138, 106, 74, 0.05);
}
.notif-item.unread::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 16px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.notif-item-body {
  flex: 1;
  min-width: 0;
}
.notif-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
  line-height: 1.35;
  word-break: break-word;
}
.notif-item.unread .notif-item-title {
  color: var(--accent);
}
.notif-item-text {
  font-size: 12px;
  color: var(--muted);
  white-space: normal;
  line-height: 1.4;
  word-break: break-word;
  margin-bottom: 4px;
}
.notif-item-thumb {
  display: block;
  width: 100%;
  max-height: 120px;
  object-fit: cover;
  border-radius: 7px;
  margin: 6px 0 2px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.notif-item-thumb:hover {
  opacity: 0.88;
}
.notif-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.notif-item-meta .notif-item-time {
  flex: 1;
}
.notif-item-time {
  font-size: 11px;
  color: var(--muted2);
  white-space: nowrap;
}
.notif-item--nav .notif-item-body {
  cursor: pointer;
}
.notif-item-nav-hint {
  font-size: 11px;
  color: var(--accent);
  opacity: 0.7;
  margin-left: 2px;
}
.notif-item-actions {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: -1px;
}
.notif-item-del,
.notif-item-read {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  padding: 2px 5px;
  border-radius: 5px;
  transition: color 0.2s;
  line-height: 1;
}
.notif-item-del {
  color: var(--muted2);
}
.notif-item-del:hover {
  color: var(--red);
}
.notif-item-read {
  color: var(--muted2);
}
.notif-item-read:hover {
  color: var(--accent);
}
.notif-empty {
  padding: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}

/* ── BROADCAST MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}
.broadcast-modal-box {
  background: var(--card);
  border-radius: 14px;
  width: min(420px, 92vw);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.broadcast-modal-box .modal-hdr {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.broadcast-modal-box .modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  color: var(--muted2);
  padding: 2px 6px;
  border-radius: 6px;
}
.broadcast-modal-box .modal-close:hover {
  color: var(--red);
}
.broadcast-modal-box .modal-body {
  padding: 18px 20px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.broadcast-hint {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.broadcast-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.broadcast-req {
  color: var(--accent);
}
.broadcast-input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
  margin-top: 4px;
}
.broadcast-input:focus {
  border-color: var(--accent);
}
.broadcast-textarea {
  resize: vertical;
  min-height: 72px;
  font-family: inherit;
}
.broadcast-modal-box .modal-footer {
  padding: 14px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--border);
}
/* ── END BROADCAST MODAL ── */

/* ── NOTIFICATION PREF HINT ICON ── */
.notif-pref-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--muted2);
  cursor: help;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  transition: color 0.15s;
  flex-shrink: 0;
}
.notif-pref-hint:hover {
  color: var(--accent);
}

/* ── END NOTIFICATION STYLES ── */
.av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.uname {
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
}
.logout-btn {
  color: var(--muted);
  background: none;
  border: none;
  font-size: 12px;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 7px;
  transition: all 0.2s;
  font-weight: 500;
}
.logout-btn:hover {
  color: var(--red);
  background: var(--red-l);
}

/* ── BODY ── */
#body-wrap {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ── SIDEBAR ── */
#sidebar {
  width: 236px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: #fafbfc;
  padding: 20px 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}
.sb-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--muted2);
  padding: 0 20px;
  margin: 10px 0 7px;
  display: block;
}
.fb {
  display: flex;
  align-items: center;
  gap: 10px;
  width: calc(100% - 16px);
  margin: 1px 8px;
  padding: 9px 11px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  transition: all 0.2s;
  cursor: pointer;
}
.fb-alpha-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  background: color-mix(in srgb, var(--accent-l) 75%, transparent);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1;
  flex-shrink: 0;
}
.fb-parent {
  font-weight: 600;
}
.fb-sub {
  width: calc(100% - 32px);
  margin: 1px 16px;
  padding-left: 14px;
}
.fb-chevron {
  font-size: 12px;
  color: var(--muted2);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: rotate(0deg);
  transition: transform 0.22s ease;
}
.fb-parent.expanded .fb-chevron {
  transform: rotate(90deg);
}
.fb:hover {
  background: var(--bg);
  color: var(--text2);
}
.fb.active {
  background: var(--accent-l);
  color: var(--accent);
  font-weight: 600;
}
.fb-parent.module-active {
  border: 1.5px solid var(--accent);
  background: transparent;
  color: var(--accent);
}
.fb-parent.module-active:hover {
  background: transparent;
  color: var(--accent);
}
.fb-parent.module-active .fb-chevron {
  color: var(--accent);
}
.fb .fi {
  font-size: 15px;
  flex-shrink: 0;
  width: 22px;
  text-align: center;
}
.fb .fn {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.fb .fc {
  font-size: 11px;
  background: var(--bg);
  border-radius: 99px;
  padding: 2px 9px;
  color: var(--muted2);
  flex-shrink: 0;
  font-weight: 600;
}
.fb.active .fc {
  background: rgba(176, 116, 72, 0.15);
  color: var(--accent);
}
.sb-div {
  height: 1px;
  background: var(--border);
  margin: 12px 18px;
}
.sb-module-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sb-module-cat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  font-size: 12px;
  color: var(--accent);
}
.sb-context-switch {
  margin: 2px 0 8px;
}
.sb-context-meta {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 20px;
}
.sb-context-name {
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: var(--accent-d);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-version-link {
  margin-top: 2px;
}
.sb-version-link .fn {
  display: flex;
  align-items: center;
  gap: 6px;
}
#sb-version-text {
  font-size: 11px;
  color: var(--muted2);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 1px 8px;
  background: var(--bg);
}

/* ── CHANGELOG MODAL ── */
.changelog-modal {
  max-width: 740px;
}
.changelog-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.changelog-current-version {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-l);
  border: 1px solid #dcc0a0;
  border-radius: 10px;
  padding: 8px 12px;
  width: fit-content;
}
.changelog-admin-form {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.changelog-admin-form h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text2);
}
.changelog-form-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 8px;
}
.changelog-form-actions {
  display: flex;
  justify-content: flex-end;
}
.changelog-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 0;
}
.changelog-empty {
  font-size: 13px;
  color: var(--muted);
  background: var(--bg);
  border: 1px dashed var(--border2);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}
.changelog-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--card);
}
.changelog-item + .changelog-item {
  margin-top: 9px;
}
.changelog-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.changelog-badge {
  font-size: 11px;
  font-weight: 700;
  background: var(--accent-l);
  color: var(--accent);
  border-radius: 99px;
  padding: 3px 8px;
}
.changelog-date {
  font-size: 11px;
  color: var(--muted2);
}
.changelog-item h4 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text2);
}
.changelog-item p {
  margin: 0;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}
.changelog-author {
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted2);
}
.changelog-item-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}
.changelog-item-btn {
  width: auto;
  margin-top: 0;
  padding: 6px 12px;
  font-size: 12px;
}
.changelog-edit-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.changelog-edit-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 8px;
}

/* ── CONTENT ── */
#content {
  flex: 1;
  overflow-y: auto;
  padding: 30px 28px;
}
.gal-hdr {
  margin-bottom: 20px;
}
.gal-row1 {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}
.gal-row2 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.gal-title {
  font-size: 26px;
  color: var(--text);
  font-weight: 600;
  flex: 1;
  font-style: normal;
}
.upload-fab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 9px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
  letter-spacing: 0.1px;
  box-shadow: 0 4px 14px rgba(138, 106, 74, 0.22);
  flex-shrink: 0;
}
.upload-fab:hover {
  background: var(--accent-d);
  transform: translateY(-1px);
}

.upload-shortcut {
  position: fixed;
  right: calc(20px + env(safe-area-inset-right));
  bottom: calc(20px + env(safe-area-inset-bottom));
  width: 58px;
  height: 58px;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  box-shadow:
    0 10px 26px rgba(40, 25, 15, 0.26),
    0 2px 8px rgba(40, 25, 15, 0.22);
  transition:
    transform 0.2s,
    background 0.2s,
    box-shadow 0.2s;
  z-index: 150;
}
.upload-shortcut:hover {
  background: var(--accent-d);
  transform: translateY(-2px);
  box-shadow:
    0 14px 32px rgba(40, 25, 15, 0.32),
    0 3px 10px rgba(40, 25, 15, 0.24);
}
.upload-shortcut:active {
  transform: translateY(0);
}
.upload-shortcut:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px var(--surface),
    0 0 0 6px rgba(138, 106, 74, 0.42),
    0 10px 26px rgba(40, 25, 15, 0.26);
}

/* ── GROUP SWITCHER ── */
.group-sw {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  position: relative;
}
.group-sw:hover {
  border-color: var(--accent);
}
.group-sw .g-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.group-sw svg {
  color: var(--muted2);
  flex-shrink: 0;
}
.group-dd {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow2);
  padding: 6px;
  z-index: 500;
  animation: fadeUp 0.15s ease;
}
.group-dd-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s;
  color: var(--text);
}
.group-dd-item:hover {
  background: var(--bg);
}
.group-dd-item.active {
  background: var(--accent-l);
  color: var(--accent);
  font-weight: 600;
}
.group-dd-item .g-check {
  margin-left: auto;
  font-size: 11px;
  color: var(--accent);
}
.group-dd-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 6px;
}
.group-dd-join {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  transition: background 0.15s;
}
.group-dd-join:hover {
  background: var(--accent-l);
}

/* ── GROUP SWITCHER MOBILE BUTTON ── */
.gsw-mob-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    color 0.2s,
    background 0.2s;
}
.gsw-mob-btn:hover {
  color: var(--accent);
  background: var(--accent-l, rgba(138, 106, 74, 0.1));
}

/* ── GROUP SWITCHER MOBILE SHEET ── */
.gsw-mob-overlay {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: rgba(0, 0, 0, 0);
  transition: background 0.25s;
}
.gsw-mob-overlay.visible {
  background: rgba(0, 0, 0, 0.45);
}
.gsw-mob-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.gsw-mob-overlay.visible .gsw-mob-panel {
  transform: translateY(0);
}
.gsw-mob-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.gsw-mob-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  color: var(--muted2);
  padding: 2px 6px;
  border-radius: 6px;
}
.gsw-mob-close:hover {
  color: var(--red);
}
.gsw-mob-list {
  padding: 6px;
}
.gsw-mob-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s;
  color: var(--text);
}
.gsw-mob-item:hover {
  background: var(--bg);
}
.gsw-mob-item.active {
  background: var(--accent-l);
  color: var(--accent);
  font-weight: 600;
}
.gsw-mob-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gsw-mob-check {
  font-size: 12px;
  color: var(--accent);
}
.gsw-mob-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 6px;
}
.gsw-mob-join {
  color: var(--accent);
}
.gsw-mob-join:hover {
  background: var(--accent-l);
}

/* ── DARK MODE TOGGLE ── */
.theme-btn {
  background: none;
  border: 1.5px solid var(--border);
  color: var(--muted);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.theme-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-l);
}

/* ── FEEDBACK / ADMIN FEEDBACK ── */

/* Sidebar badge for open feedback count */
.fb-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  margin-left: 4px;
}

/* Admin feedback list items */
.af-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.af-status-open {
  border-left: 3px solid var(--accent);
  background: var(--card);
}
.af-status-open-new {
  border-left: 3px solid #16a34a;
  background: rgba(34, 197, 94, 0.1);
}
.af-status-accepted {
  border-left: 3px solid #2563eb;
  background: rgba(59, 130, 246, 0.12);
}
.af-status-rejected {
  border-left: 3px solid #b45309;
  background: rgba(245, 158, 11, 0.13);
}
.af-status-read {
  border-left: 3px solid var(--muted);
  background: var(--card);
}
.af-status-closed {
  border-left: 3px solid #dc2626;
  background: rgba(239, 68, 68, 0.1);
}
.af-item-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.af-cat-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.af-cat-bug {
  border-color: #ef4444;
  color: #ef4444;
}
.af-cat-feature {
  border-color: #a855f7;
  color: #a855f7;
}
.af-cat-help {
  border-color: #3b82f6;
  color: #3b82f6;
}
.af-cat-report_user {
  border-color: #f97316;
  color: #f97316;
}
.af-cat-other {
  border-color: var(--muted);
  color: var(--muted);
}
.af-status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
}
.af-status-badge-open {
  border-color: rgba(176, 116, 72, 0.45);
  background: rgba(176, 116, 72, 0.12);
  color: #8f5a35;
}
.af-status-badge-read {
  border-color: rgba(71, 85, 105, 0.4);
  background: rgba(71, 85, 105, 0.13);
  color: #475569;
}
.af-status-badge-closed {
  border-color: rgba(220, 38, 38, 0.45);
  background: rgba(239, 68, 68, 0.13);
  color: #b91c1c;
}
.af-status-badge-accepted {
  border-color: rgba(37, 99, 235, 0.42);
  background: rgba(59, 130, 246, 0.16);
  color: #1d4ed8;
}
.af-status-badge-rejected {
  border-color: rgba(180, 83, 9, 0.42);
  background: rgba(245, 158, 11, 0.16);
  color: #92400e;
}

.fb-ticket-id {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
}

.fb-unread-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(22, 163, 74, 0.35);
  background: rgba(34, 197, 94, 0.15);
  color: #166534;
  text-transform: uppercase;
}

.af-read-indicator {
  margin-left: 2px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(71, 85, 105, 0.28);
  background: rgba(71, 85, 105, 0.08);
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.af-read-indicator:hover {
  border-color: rgba(71, 85, 105, 0.55);
  background: rgba(71, 85, 105, 0.14);
  color: #334155;
}

.fb-anon-icon {
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(71, 85, 105, 0.25);
  background: rgba(71, 85, 105, 0.1);
}
.af-item-subject {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.af-item-body {
  font-size: 13px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 120px;
  overflow-y: auto;
}
.af-item-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.af-item-actions .af-action-read {
  border-color: rgba(71, 85, 105, 0.35);
  background: rgba(71, 85, 105, 0.08);
  color: #475569;
}

.af-item-actions .af-action-read:hover {
  border-color: rgba(71, 85, 105, 0.55);
  background: rgba(71, 85, 105, 0.14);
}

.af-item-actions .af-action-close {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.1);
  color: #15803d;
}

.af-item-actions .af-action-close:hover {
  border-color: rgba(34, 197, 94, 0.6);
  background: rgba(34, 197, 94, 0.18);
}

.af-item-actions .af-action-reopen {
  border-color: rgba(176, 116, 72, 0.45);
  background: rgba(176, 116, 72, 0.11);
  color: #8f5a35;
}

.af-item-actions .af-action-reopen:hover {
  border-color: rgba(176, 116, 72, 0.65);
  background: rgba(176, 116, 72, 0.18);
}

.af-item-actions .af-action-accept {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.1);
  color: #15803d;
}

.af-item-actions .af-action-accept:hover {
  border-color: rgba(34, 197, 94, 0.62);
  background: rgba(34, 197, 94, 0.2);
}

.af-item-actions .af-action-reject {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
}

.af-item-actions .af-action-reject:hover {
  border-color: rgba(245, 158, 11, 0.65);
  background: rgba(245, 158, 11, 0.2);
}

.af-item-actions .af-action-recateg {
  border-color: rgba(59, 130, 246, 0.42);
  background: rgba(59, 130, 246, 0.11);
  color: #2563eb;
}

.af-item-actions .af-action-recateg:hover {
  border-color: rgba(59, 130, 246, 0.62);
  background: rgba(59, 130, 246, 0.19);
}

.feedback-msg-success {
  border-color: rgba(38, 179, 108, 0.35);
  background: linear-gradient(180deg, rgba(38, 179, 108, 0.14), rgba(38, 179, 108, 0.07));
  color: #1f6e44;
}

.feedback-msg-success strong {
  display: inline-block;
  margin-bottom: 2px;
}

.feedback-msg-success span {
  font-size: 12px;
  color: #255a3b;
}

/* ── Feedback Tabs ── */
.fb-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  gap: 0;
  background: var(--card);
  border-radius: 0;
}

.fb-tab {
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition:
    color 0.15s,
    border-color 0.15s;
  margin-bottom: -1px;
}

.fb-tab:hover {
  color: var(--text);
}

.fb-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── User: My Reports ── */
.my-fb-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
}

.fb-last-msg {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  padding: 6px 10px;
  background: var(--bg);
  border-radius: 7px;
}

.fb-msg-meta-name {
  font-weight: 600;
  color: var(--text);
  margin-right: 4px;
}

/* ── Conversation Thread ── */
.fb-msg {
  border-radius: 10px;
  padding: 10px 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 92%;
}

.fb-msg-admin {
  background: rgba(176, 116, 72, 0.12);
  border: 1px solid rgba(176, 116, 72, 0.25);
  align-self: flex-start;
}

.fb-msg-user {
  background: var(--bg);
  border: 1px solid var(--border);
  align-self: flex-end;
}

.fb-msg-meta {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.fb-msg-meta strong {
  color: var(--text);
  font-size: 12px;
}

.fb-msg-meta span {
  color: var(--muted);
}

.fb-admin-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(176, 116, 72, 0.2);
  color: #8f5a35;
  border: 1px solid rgba(176, 116, 72, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.04em;

  .fb-anon-hint {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(71, 85, 105, 0.12);
    color: #475569;
    border: 1px solid rgba(71, 85, 105, 0.25);
    cursor: help;
  }
}

.fb-msg-body {
  font-size: 13px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
}

/* ── Resolution badge ── */
.fb-resolution-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(71, 85, 105, 0.1);
  border: 1px solid rgba(71, 85, 105, 0.3);
  color: #475569;
}

/* ── Admin: Reply / Resolution buttons ── */
.af-item-actions .af-action-reply {
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.08);
  color: #3b82f6;
}

.af-item-actions .af-action-reply:hover {
  border-color: rgba(59, 130, 246, 0.55);
  background: rgba(59, 130, 246, 0.14);
}

.af-item-actions .af-action-resolve-none {
  border-color: rgba(71, 85, 105, 0.35);
  background: rgba(71, 85, 105, 0.08);
  color: #475569;
}

.af-item-actions .af-action-resolve-none:hover {
  border-color: rgba(71, 85, 105, 0.55);
  background: rgba(71, 85, 105, 0.14);
}

.af-item-actions .af-action-resolve-act {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.1);
  color: #15803d;
}

.af-item-actions .af-action-resolve-act:hover {
  border-color: rgba(34, 197, 94, 0.6);
  background: rgba(34, 197, 94, 0.18);
}

/* ── SORT SELECT ── */
.sort-select {
  padding: 6px 28px 6px 10px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238a7e74' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color 0.2s;
}
.sort-select:focus {
  border-color: var(--accent);
}

/* ── SELECT WRAPPER (mobile label) ── */
.select-wrap {
  position: relative;
  display: inline-flex;
}
@media (max-width: 900px) {
  .select-wrap select {
    color: transparent;
    width: 85px;
  }
  .select-wrap::after {
    content: attr(data-label);
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    font-weight: 500;
    color: var(--muted);
    pointer-events: none;
  }
}

/* ── MULTI-SELECT ── */
.sel-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 10px;
  border: 1.5px solid #dcc0a0;
  background: var(--accent-l);
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.sel-toggle:hover {
  border-color: var(--accent);
  background: var(--accent-l);
}
.sel-toggle.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.p-card .sel-check {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: all 0.2s;
  cursor: pointer;
}
.selecting .p-card .sel-check {
  display: flex;
}
.p-card.selected .sel-check {
  background: var(--accent);
  border-color: var(--accent);
}
.bulk-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 200;
  box-shadow: var(--shadow2);
  animation: fadeUp 0.2s ease;
}
.bulk-bar .bulk-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  min-width: 100px;
}
.bulk-bar .btn {
  padding: 8px 16px;
  font-size: 12px;
  border-radius: 9px;
}

/* ── BLUR PLACEHOLDER ── */
.p-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition:
    transform 0.45s cubic-bezier(0.25, 0.8, 0.25, 1),
    filter 0.4s ease,
    opacity 0.4s ease;
}
.p-thumb img.loading {
  filter: blur(12px) saturate(1.2);
  transform: scale(1.05);
  opacity: 0.6;
}
.p-thumb img.loaded {
  filter: none;
  transform: scale(1);
  opacity: 1;
}

/* ── VIEW SWITCHER ── */
/* ── PHOTO GRID ── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.grid.view-small {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.grid.view-medium {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.grid.view-large {
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 18px;
}
.grid.view-list {
  grid-template-columns: 1fr;
  gap: 6px;
}

/* Feed uses its own compact single-column layout for readability. */
.grid.feed-grid {
  grid-template-columns: 1fr;
  gap: 0;
  max-width: 680px;
  margin: 0 auto;
}

.feed-compose-card {
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 10px;
  margin: 0 0 10px;
}

.feed-compose-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.feed-compose-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.feed-compose-input,
.feed-compose-textarea {
  width: 100%;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
}

.feed-compose-input {
  height: 38px;
  padding: 0 11px;
  font-size: 13px;
  margin-bottom: 8px;
}

.feed-compose-textarea {
  min-height: 42px;
  max-height: 42px;
  resize: none;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
  overflow: hidden;
  transition:
    min-height 0.18s ease,
    max-height 0.18s ease;
}

.feed-compose-input:focus,
.feed-compose-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.feed-compose-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
}

.feed-compose-hint {
  font-size: 11px;
  color: var(--muted2);
}

.feed-compose-submit {
  min-width: 104px;
  height: 36px;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  margin-top: 0;
  box-shadow: none;
}

.feed-compose-submit:hover {
  transform: none;
  box-shadow: none;
}

.feed-compose-head,
.feed-compose-input,
.feed-compose-row {
  display: none;
}

.feed-compose-card.is-active .feed-compose-head,
.feed-compose-card.is-active .feed-compose-row,
.feed-compose-card:focus-within .feed-compose-head,
.feed-compose-card:focus-within .feed-compose-row {
  display: flex;
}

.feed-compose-card.is-active .feed-compose-input,
.feed-compose-card:focus-within .feed-compose-input {
  display: block;
}

.feed-compose-card.is-active .feed-compose-textarea,
.feed-compose-card:focus-within .feed-compose-textarea {
  min-height: 100px;
  max-height: 280px;
  resize: vertical;
  overflow: auto;
}

.feed-compose-locked-note {
  margin-top: 7px;
  font-size: 11px;
  color: var(--muted2);
}

.feed-compose-card.is-locked .feed-compose-head,
.feed-compose-card.is-locked .feed-compose-input,
.feed-compose-card.is-locked .feed-compose-row {
  display: none;
}

.feed-post-card {
  transition:
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.feed-post-card.is-targeted {
  border-color: color-mix(in srgb, var(--accent) 78%, #fff);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent) 10%, var(--card)),
    var(--card) 30%
  );
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--accent) 28%, transparent),
    0 18px 34px rgba(0, 0, 0, 0.12),
    var(--shadow2);
  transform: translateY(-1px);
  animation: feedTargetPulse 1.2s ease 3;
}

.feed-post-menu-anchor {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.feed-post-saved-indicator {
  color: var(--accent);
  font-size: 17px;
  line-height: 1;
  min-width: 18px;
  text-align: center;
}

.feed-post-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted2);
  cursor: pointer;
}

.feed-post-menu-toggle:hover {
  background: var(--bg);
  color: var(--text);
}

.feed-post-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 188px;
  max-width: min(248px, calc(100vw - 28px));
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow2);
  z-index: 15;
}

.feed-post-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  background: transparent;
  color: var(--text2);
  border-radius: 10px;
  padding: 9px 10px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  text-align: left;
}

.feed-post-menu-item:hover {
  background: var(--bg);
  color: var(--text);
}

.feed-post-menu-item svg {
  flex: 0 0 auto;
}

.feed-post-menu-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-post-menu-item.danger {
  color: var(--red);
}

.feed-post-menu-item.danger:hover {
  background: color-mix(in srgb, var(--red) 16%, var(--bg));
  color: var(--red);
}

@keyframes feedTargetPulse {
  0% {
    box-shadow:
      0 0 0 0 color-mix(in srgb, var(--accent) 34%, transparent),
      0 18px 34px rgba(0, 0, 0, 0.12),
      var(--shadow2);
  }
  70% {
    box-shadow:
      0 0 0 9px color-mix(in srgb, var(--accent) 0%, transparent),
      0 18px 34px rgba(0, 0, 0, 0.12),
      var(--shadow2);
  }
  100% {
    box-shadow:
      0 0 0 4px color-mix(in srgb, var(--accent) 28%, transparent),
      0 18px 34px rgba(0, 0, 0, 0.12),
      var(--shadow2);
  }
}

.feed-post-edited-btn {
  border: none;
  background: none;
  color: var(--muted2);
  padding: 0;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  line-height: 1;
  text-decoration: none;
}

.feed-post-edited-btn:hover {
  color: var(--accent);
}

.feed-post-single-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--accent) 12%, var(--card)),
    var(--card)
  );
  border-radius: 16px;
  padding: 14px 16px;
  margin: 0 0 12px;
  box-shadow: var(--shadow);
}

.feed-post-single-banner strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}

.feed-post-single-banner p {
  margin: 0;
  font-size: 12px;
  color: var(--muted2);
  line-height: 1.45;
}

.feed-history-entry {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
  padding: 14px 15px;
}

.feed-history-entry p {
  margin: 8px 0 0;
  color: var(--text2);
  font-size: 13px;
  line-height: 1.55;
}

.feed-history-entry-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  color: var(--muted2);
  font-size: 12px;
}

.feed-history-entry-title {
  margin-top: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

/* ── CARD (grid views) ── */
.p-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition:
    transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1),
    box-shadow 0.35s cubic-bezier(0.25, 0.8, 0.25, 1),
    opacity 0.4s ease;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(14px);
}
.p-card.visible {
  opacity: 1;
  transform: translateY(0);
}
@media (hover: hover) {
  .p-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(15, 25, 40, 0.14);
  }
  .p-card.visible:hover {
    transform: translateY(-4px);
  }
}
.p-thumb {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg);
}
/* dark placeholder for video cards in the grid */
.p-thumb-video {
  width: 100%;
  height: 100%;
  background: #111;
}
/* video element used as thumbnail in the grid */
.p-thumb-vid {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  transition:
    transform 0.45s cubic-bezier(0.25, 0.8, 0.25, 1),
    filter 0.4s ease,
    opacity 0.4s ease;
}
.p-thumb-vid.loading {
  opacity: 1;
}
.p-thumb-vid.loaded {
  opacity: 1;
}
/* play icon overlay for video cards */
.p-thumb-play {
  position: absolute;
  left: 8px;
  right: auto;
  bottom: 8px;
  top: auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  pointer-events: none;
  z-index: 2;
}
.p-thumb-play svg {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.9));
}
.media-duration-badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  z-index: 3;
  pointer-events: none;
}
@media (hover: hover) {
  .p-card:hover .p-thumb img.loaded,
  .p-card:hover .p-thumb .p-thumb-vid.loaded {
    transform: scale(1.08);
    filter: blur(2px) brightness(0.72);
  }
  .p-card:hover .p-ov {
    opacity: 1;
  }
}
.p-ov {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.p-ov-stats {
  display: flex;
  align-items: center;
  gap: 14px;
}
.p-ov-stat {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}
.p-ov-desc {
  display: none;
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  text-align: center;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
  max-width: 85%;
  line-height: 1.4;
}
.p-meta {
  display: flex;
  flex-direction: column;
  padding: 10px 12px 8px;
  flex: 1 1 auto;
}
.p-top {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  margin-bottom: 7px;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.p-who {
  font-weight: 600;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.p-dt {
  color: var(--muted2);
  font-size: 11px;
  flex-shrink: 0;
  font-weight: 300;
}
.p-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.p-like-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  padding: 3px 0;
  transition: color 0.2s;
  cursor: pointer;
  line-height: 1;
}
.p-like-btn:hover {
  color: var(--red);
}
.p-like-btn.liked {
  color: var(--red);
  font-weight: 600;
}
.p-like-btn .heart {
  display: flex;
  align-items: center;
  transition: transform 0.15s;
}
.p-like-btn:hover .heart {
  transform: scale(1.2);
}
.p-like-btn.liked .heart {
  transform: scale(1.1);
}
.p-comment-count {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted2);
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
}

/* ── SMALL VIEW: no meta, just thumbnails ── */
.grid.view-small .p-card {
  border-radius: 10px;
}
.grid.view-small .p-meta {
  display: none;
}
.grid.view-small .p-ov-desc {
  display: none;
}
.grid.view-small .p-ov-stat {
  font-size: 12px;
}

/* ── LARGE VIEW: wider aspect ── */
.grid.view-large .p-thumb {
  aspect-ratio: 16/10;
}
.grid.view-large .p-meta {
  padding: 12px 16px 10px;
}

/* ── LIST VIEW ── */
.grid.view-list .p-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  border-radius: 12px;
}
.grid.view-list .p-card:hover {
  transform: none;
  box-shadow: var(--shadow);
  background: var(--accent-l);
}
.grid.view-list .p-card.visible:hover {
  transform: none;
}
.grid.view-list .p-thumb {
  width: 52px;
  height: 52px;
  aspect-ratio: 1;
  border-radius: 10px;
  flex-shrink: 0;
  margin: 8px;
  margin-right: 0;
}
.grid.view-list .p-thumb img {
  border-radius: 10px;
}
.grid.view-list .p-thumb-play {
  inset: 0;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  justify-content: center;
}
.grid.view-list .p-thumb-play svg {
  width: 20px;
  height: 20px;
}
.grid.view-list .media-duration-badge {
  display: none;
}
.grid.view-list .p-card:hover .p-thumb img.loaded,
.grid.view-list .p-card:hover .p-thumb .p-thumb-vid.loaded {
  transform: none;
  filter: none;
}
.grid.view-list .p-ov {
  display: none;
}
.grid.view-list .p-meta {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    'top actions'
    'desc actions';
  align-items: center;
  column-gap: 12px;
  row-gap: 4px;
  padding: 10px 14px;
  min-width: 0;
}
.grid.view-list .p-desc {
  display: -webkit-box;
  grid-area: desc;
  padding: 0;
  margin: 0;
  min-height: 0;
}
.grid.view-list .p-top {
  grid-area: top;
  margin-top: 0;
  margin-bottom: 0;
  min-width: 0;
}
.grid.view-list .p-actions {
  grid-area: actions;
  flex-shrink: 0;
}
.p-del {
  background: none;
  border: none;
  opacity: 0.2;
  padding: 2px;
  margin-left: auto;
  transition: opacity 0.2s;
  cursor: pointer;
  display: flex;
  align-items: center;
  color: var(--muted);
}
.p-del:hover {
  opacity: 1;
  color: var(--red);
}
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 16px;
}
.empty-icon {
  font-size: 56px;
  opacity: 0.6;
}
.empty p {
  color: var(--muted);
  font-size: 16px;
  font-weight: 300;
}
.more-btn {
  width: 100%;
  padding: 12px;
  border-radius: 11px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  margin-top: 18px;
  transition: all 0.2s;
  cursor: pointer;
  font-weight: 500;
}
.more-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-l);
  font-weight: 500;
}

/* ── UPLOAD MODAL ── */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(28, 24, 20, 0.6);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.18s ease;
  backdrop-filter: blur(4px);
}
.modal-bg--top {
  z-index: 9100;
}
.modal {
  background: var(--surface);
  border-radius: var(--r2);
  width: 100%;
  max-width: 500px;
  animation: fadeUp 0.22s ease;
  overflow: hidden;
  box-shadow: var(--shadow2);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 40px);
}
.modal-hdr {
  padding: 24px 28px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-hdr h3 {
  font-size: 22px;
  font-weight: 500;
  font-style: normal;
}
.modal-x {
  background: none;
  border: none;
  color: var(--muted2);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  border-radius: 6px;
  transition: color 0.2s;
}
.modal-x:hover {
  color: var(--text);
}
.modal-body {
  padding: 22px 28px 28px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.dz {
  border: 2px dashed var(--border2);
  border-radius: 14px;
  padding: 48px 28px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.dz.dz--compact {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}
.dz.dz--compact .dz-ico {
  font-size: 22px;
  margin: 0;
}
.dz.dz--compact .dz-ttl {
  font-size: 13px;
  margin: 0;
}
.dz.dz--compact .dz-sub {
  display: none;
}
.dz:hover,
.dz.drag {
  border-color: var(--accent);
  background: var(--accent-l);
}
.dz-ico {
  font-size: 42px;
  margin-bottom: 10px;
}
.dz-ttl {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 5px;
}
.dz-sub {
  font-size: 12px;
  color: var(--muted);
  font-weight: 300;
}

/* ── UPLOAD PREVIEW GRID ── */
.dz-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.dz-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 9px;
  overflow: hidden;
  background: var(--border);
  flex-shrink: 0;
}
.dz-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.dz-thumb-del {
  position: absolute;
  top: 3px;
  right: 3px;
  background: rgba(0, 0, 0, 0.55);
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  transition: background 0.15s;
}
.dz-thumb-del:hover {
  background: rgba(200, 40, 40, 0.85);
}
/* play icon overlay – staged video previews */
.dz-thumb-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.dz-thumb-play svg {
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.8));
}
.dz-thumb .media-duration-badge {
  font-size: 10px;
  right: 4px;
  bottom: 4px;
  padding: 2px 5px;
}
.dz-thumb-overflow {
  background: var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
}
.dz-thumb-overflow span {
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}
.dz-add-more {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1.5px dashed var(--border2);
  color: var(--muted);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  padding: 7px 14px;
  border-radius: 9px;
  margin-top: 8px;
  width: 100%;
  justify-content: center;
  transition: all 0.2s;
}
.dz-add-more:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.up-prog {
  text-align: center;
  padding: 32px 0;
}
.up-prog p {
  color: var(--muted);
  font-size: 14px;
  margin-top: 14px;
  font-weight: 300;
}
.prog-track {
  height: 3px;
  background: var(--border);
  border-radius: 99px;
  margin-top: 16px;
  overflow: hidden;
}
.prog-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #d4904a);
  border-radius: 99px;
  transition: width 0.3s;
}
.modal-sel {
  width: 100%;
  padding: 10px 13px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  outline: none;
  margin-top: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.modal-sel:focus {
  border-color: var(--accent);
}

/* ── LIGHTBOX ── */
.lb-bg {
  position: fixed;
  inset: 0;
  background: rgba(28, 24, 20, 0.88);
  z-index: 300;
  display: flex;
  align-items: stretch;
  justify-content: center;
  animation: fadeIn 0.2s ease;
  padding-top: env(safe-area-inset-top);
  touch-action: pan-x pan-y;
}
.lb-layout {
  display: flex;
  width: 100%;
  max-width: 1100px;
  margin: auto;
  max-height: 100vh;
  animation: fadeUp 0.22s ease;
}
.lb-img-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  min-width: 0;
}
.lb-img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 10px;
  display: block;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  touch-action: none;
  transform-origin: 0 0;
}
#lb-video {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 10px;
  display: none;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  background: #000;
}
.lb-x {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top));
  right: 16px;
  background: rgba(40, 30, 20, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 350;
  backdrop-filter: blur(8px);
}
.lb-x:hover {
  background: rgba(255, 255, 255, 0.28);
}
.lb-arr {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-arr:hover {
  background: rgba(255, 255, 255, 0.24);
}
#lb-prv {
  left: 12px;
}
#lb-nxt {
  right: 12px;
}

/* LIGHTBOX PANEL */
.lb-panel {
  width: 320px;
  flex-shrink: 0;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.lb-panel-top {
  padding: 22px 22px 16px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.lb-who-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 6px;
}
.lb-av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
}
.lb-who {
  font-weight: 600;
  font-size: 15px;
}
.lb-dt {
  font-size: 12px;
  color: var(--muted);
  font-weight: 300;
}
.lb-cnt {
  font-size: 12px;
  color: var(--muted2);
  margin-top: 4px;
  font-weight: 300;
}

/* LIKE BUTTON IN PANEL */
.lb-like-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 9px 16px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  width: 100%;
  line-height: 1;
}
.lb-like-btn:hover {
  border-color: rgba(224, 82, 82, 0.3);
  color: var(--red);
  background: var(--red-l);
}
.lb-like-btn.liked {
  border-color: rgba(224, 82, 82, 0.3);
  color: var(--red);
  background: var(--red-l);
  font-weight: 600;
}
.lb-like-btn .lheart {
  display: flex;
  align-items: center;
  transition: transform 0.15s;
}
.lb-like-btn:hover .lheart,
.lb-like-btn.liked .lheart {
  transform: scale(1.2);
}

/* COMMENTS */
.lb-comments {
  flex: 1;
  overflow-y: auto;
  padding: 16px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.comment-item {
  display: flex;
  gap: 9px;
  animation: fadeUp 0.2s ease;
}
.c-av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  flex-shrink: 0;
  margin-top: 1px;
  overflow: hidden;
}
.c-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.c-body {
  flex: 1;
  min-width: 0;
}
.c-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
}
.c-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  word-break: break-word;
  font-weight: 300;
}
.c-time {
  font-size: 11px;
  color: var(--muted2);
  margin-top: 2px;
  font-weight: 300;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition:
    opacity 0.2s,
    max-height 0.2s;
}
.comment-item:hover .c-time {
  max-height: 20px;
  opacity: 1;
}
.c-del {
  background: none;
  border: none;
  color: var(--muted2);
  cursor: pointer;
  padding: 0 3px;
  float: right;
  opacity: 0;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
}
.comment-item:hover .c-del {
  opacity: 0.4;
}
.c-del:hover {
  opacity: 1 !important;
  color: var(--red);
}
/* Touch devices: immer sichtbar */
@media (hover: none) {
  .c-del {
    opacity: 0.35;
  }
}
.no-comments {
  text-align: center;
  color: var(--muted2);
  font-size: 13px;
  font-weight: 300;
  padding: 20px 0;
  font-style: normal;
}

/* COMMENT INPUT */
.lb-input-row {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 9px;
  align-items: flex-end;
}
.lb-input-row textarea {
  flex: 1;
  resize: none;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  outline: none;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  max-height: 90px;
  transition: border-color 0.2s;
  font-weight: 400;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.lb-input-row textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(138, 106, 74, 0.12);
}
.lb-input-row textarea::placeholder {
  color: var(--muted2);
}
.send-btn {
  background: var(--accent);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
  font-size: 16px;
}
.send-btn:hover {
  background: var(--accent-d);
}
.send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* LB ACTION BTNS */
.lb-act-btn {
  background: none;
  border: none;
  color: var(--muted2);
  font-size: 12px;
  cursor: pointer;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
  font-weight: 500;
  font-family: 'Plus Jakarta Sans', sans-serif;
  flex: 1;
  justify-content: center;
  border-radius: 8px;
}
.lb-act-btn.del:hover {
  color: var(--red);
  background: var(--red-l);
}
.lb-act-btn.down:hover {
  color: var(--accent);
  background: var(--accent-l);
}
.lb-act-btn.album:hover {
  color: var(--green);
  background: #edf7f2;
}
/* LB ACTION BUTTONS */
.lb-action-btns {
  display: flex;
  gap: 4px;
  margin-top: 10px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.lb-act-btn {
  background: none;
  border: none;
  color: var(--muted2);
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  border-radius: 8px;
  flex-shrink: 0;
}
.lb-act-btn:hover {
  background: var(--bg);
  color: var(--text);
}
.lb-act-btn.del:hover {
  color: var(--red, #e05555);
  background: var(--red-l, #fdf0f0);
}
.lb-act-btn.lb-copy-id {
  margin-left: auto;
  font-size: 10px;
  font-family: monospace;
  letter-spacing: 0.5px;
  opacity: 0.35;
}
.lb-act-btn.lb-copy-id:hover {
  opacity: 1;
}

.album-picker {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow2);
  padding: 8px;
  z-index: 9000;
  min-width: 180px;
  animation: fadeUp 0.15s ease;
}
.album-picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s;
}
.album-picker-item:hover {
  background: var(--bg);
}
.album-picker-item.selected {
  color: var(--accent);
  background: var(--accent-l);
}
.album-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--accent-l);
  color: var(--accent);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
}
.album-tag-chip button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--accent);
  font-size: 13px;
  padding: 0;
  line-height: 1;
  opacity: 0.6;
}
.album-tag-chip button:hover {
  opacity: 1;
}

/* ── DIALOG ── */
.dlg-bg {
  position: fixed;
  inset: 0;
  background: rgba(28, 24, 20, 0.6);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.dlg {
  background: var(--surface);
  border-radius: 18px;
  padding: 34px 36px;
  max-width: 320px;
  width: 100%;
  text-align: center;
  animation: fadeUp 0.2s ease;
  box-shadow: var(--shadow2);
  border: 1px solid var(--border);
}
.dlg-ico {
  font-size: 36px;
  margin-bottom: 12px;
}
.dlg p {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 24px;
  line-height: 1.6;
  font-weight: 300;
}
.dlg-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.dlg-btns.stacked {
  flex-direction: column;
  gap: 8px;
}
.dlg-btns.stacked .btn {
  width: 100%;
}
.dlg-btns--feed-edit {
  justify-content: flex-end;
  margin-top: 2px;
  flex-wrap: nowrap;
}
.dlg-btns--feed-edit .btn {
  width: auto;
  min-width: 122px;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .lb-panel {
    width: 260px;
  }

  .feed-post-single-banner {
    flex-direction: column;
    align-items: stretch;
  }

  .dlg-btns--feed-edit {
    flex-direction: column;
    align-items: stretch;
  }

  .dlg-btns--feed-edit .btn {
    width: 100%;
    min-width: 0;
  }
}
/* ── HAMBURGER BUTTON (mobile only) ── */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  padding: 7px;
  border-radius: 9px;
  transition: background 0.2s;
  align-items: center;
  justify-content: center;
}
.hamburger-btn:hover {
  background: var(--bg);
}
.mob-only {
  display: none;
}
.sb-profile-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
}
.sb-profile-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  padding: 6px 8px;
  border-radius: 10px;
  transition: background 0.2s;
  text-align: left;
  width: 100%;
}
.sb-profile-btn:hover {
  background: var(--bg);
}
.sb-logout-btn {
  background: none;
  border: 1.5px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  width: 100%;
  text-align: center;
}
.sb-logout-btn:hover {
  border-color: var(--red);
  color: var(--red);
}
.sb-footer {
  position: sticky;
  bottom: 0;
  background: #fafbfc;
  padding: 0 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
[data-theme='dark'] .sb-footer {
  background: #1a1816;
}

/* ── MOBILE OVERLAY ── */
#mob-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 20, 16, 0.45);
  z-index: 240;
  backdrop-filter: blur(2px);
}

/* ── BOTTOM NAV GONE ── */
#bottom-nav {
  display: none !important;
}

@media (max-width: 900px) {
  .hamburger-btn {
    display: flex;
  }

  body.mobile-sidebar-open #header .notif-bell-btn,
  body.mobile-sidebar-open #header .gsw-mob-btn,
  body.mobile-sidebar-open #header .profile-btn {
    pointer-events: none;
    opacity: 0.55;
  }

  /* HEADER */
  #header {
    padding: 0 14px;
    gap: 8px;
    min-height: 54px;
    padding-top: env(safe-area-inset-top);
  }
  #app.show {
    padding-top: calc(54px + env(safe-area-inset-top));
  }
  .logo-text {
    font-size: 16px;
    gap: 8px;
    min-width: 0;
    flex-shrink: 1;
    overflow: hidden;
  }
  .logo-text small {
    display: none;
  }
  .logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }
  .logo-icon svg {
    width: 24px;
    height: 24px;
  }
  /* Header right side — compact on mobile */
  .user-pill {
    display: flex;
    gap: 6px;
  }
  .user-pill .profile-btn {
    padding: 3px;
  }
  #group-switcher-wrap {
    flex-shrink: 1;
    min-width: 0;
  }
  #group-switcher-wrap .group-sw {
    padding: 4px 8px;
    font-size: 11px;
    gap: 4px;
    border-radius: 8px;
    max-width: 140px;
  }
  #group-switcher-wrap .group-sw span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 90px;
  }
  #group-switcher-wrap .group-sw .g-dot {
    width: 6px;
    height: 6px;
  }
  #group-switcher-wrap .group-sw svg {
    width: 10px;
    height: 10px;
  }

  /* LAYOUT */
  #body-wrap {
    position: relative;
    overflow: visible;
  }
  #content {
    padding: 16px 14px;
    overflow-x: hidden;
  }
  .mob-only {
    display: block !important;
  }

  /* SIDEBAR AS SLIDE-OUT DRAWER */
  #sidebar {
    position: fixed;
    top: calc(54px + env(safe-area-inset-top));
    left: 0;
    bottom: 0;
    z-index: 241;
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(26, 20, 16, 0.12);
    overflow-y: auto;
  }
  #sidebar.open {
    transform: translateX(0);
  }

  .fb-parent {
    min-height: 42px;
  }
  .fb-sub {
    min-height: 40px;
    padding-left: 18px;
  }
  .fb-chevron {
    margin-right: 2px;
  }

  #mob-overlay {
    top: calc(54px + env(safe-area-inset-top));
  }

  /* GRID */
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .grid.view-small {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .grid.view-large {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .grid.view-list {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .gal-hdr {
    margin-bottom: 12px;
  }
  .gal-row1 {
    gap: 10px;
    margin-bottom: 6px;
  }
  .gal-title {
    font-size: 17px;
    font-weight: 600;
  }
  .upload-fab {
    padding: 8px 14px;
    font-size: 12px;
  }
  .upload-shortcut {
    width: 54px;
    height: 54px;
    right: calc(14px + env(safe-area-inset-right));
    bottom: calc(14px + env(safe-area-inset-bottom));
  }
  .gal-row2 {
    gap: 6px;
  }
  .sort-select {
    font-size: 11px;
    padding: 5px 24px 5px 8px;
  }
  .sel-toggle {
    padding: 6px 10px;
    font-size: 11px;
  }
  .bulk-bar {
    bottom: 14px;
    padding: 12px 16px;
    gap: 8px;
    border-radius: 14px;
    flex-direction: column;
    width: calc(100% - 32px);
    left: 16px;
    transform: none;
  }
  .bulk-bar .bulk-count {
    font-size: 13px;
    min-width: auto;
    text-align: center;
  }
  .bulk-bar .btn {
    width: 100%;
    text-align: center;
    padding: 10px;
    font-size: 13px;
  }

  /* LIGHTBOX MOBILE — full scroll, no fixed bottom nav interference */
  .lb-bg {
    overflow-y: auto;
    align-items: flex-start;
  }
  .lb-layout {
    flex-direction: column;
    width: 100%;
    max-width: 100vw;
    min-height: 100vh;
  }
  .lb-img-side {
    padding: calc(12px + env(safe-area-inset-top)) 6px 8px;
    flex: 0 0 auto;
  }
  .lb-img {
    max-height: 58vh;
    border-radius: 8px;
    width: 100%;
    object-fit: contain;
  }
  .lb-arr {
    width: 36px;
    height: 36px;
  }
  #lb-prv {
    left: 4px;
  }
  #lb-nxt {
    right: 4px;
  }
  .lb-panel {
    width: 100%;
    flex: 0 0 auto;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .lb-panel-top {
    padding: 14px 16px 12px;
  }
  .lb-who {
    font-size: 14px;
  }
  .lb-comments {
    flex: 1;
    overflow-y: visible;
    padding: 10px 16px;
    max-height: none;
  }
  .lb-input-row {
    padding: 12px 14px;
    position: sticky;
    bottom: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
  }
  .lb-x {
    top: calc(10px + env(safe-area-inset-top));
    right: 10px;
    width: 38px;
    height: 38px;
  }
  .ss-bar {
    bottom: 16px;
  }

  /* AUTH */
  .auth-card {
    padding: 28px 20px;
  }
  .auth-brand h1 {
    font-size: 32px;
  }

  /* MODAL */
  .modal {
    margin: 8px;
    border-radius: 16px;
    max-height: calc(100vh - 16px);
  }
  .modal-bg {
    align-items: flex-start;
    padding: 8px;
    overflow-y: auto;
  }
  .changelog-form-grid {
    grid-template-columns: 1fr;
  }
  .changelog-edit-grid {
    grid-template-columns: 1fr;
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── AVATAR ── */
.av-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.profile-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px;
  border-radius: 99px;
  transition: background 0.2s;
}
.profile-btn:hover {
  background: var(--bg);
}

/* ── ALBUM BADGE ── */
.album-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--accent-l);
  color: var(--accent);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 8px;
}

/* ── DESCRIPTION ── */
.p-desc {
  font-size: 12px;
  color: var(--muted);
  padding: 0 12px;
  margin: 0 0 9px;
  line-height: 1.5;
  font-weight: 300;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lb-desc {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
  margin-top: 6px;
  font-weight: 300;
  font-style: normal;
}

/* ── SLIDESHOW ── */
.ss-bar {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(26, 20, 16, 0.82);
  backdrop-filter: blur(12px);
  border-radius: 99px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 310;
  border: 1px solid rgba(255, 255, 255, 0.12);
  animation: fadeUp 0.2s ease;
}
/* Slideshow fullscreen mode */
.lb-bg.ss-fullscreen .lb-layout {
  max-width: 100vw;
}
.lb-bg.ss-fullscreen .lb-panel {
  display: none;
}
.lb-bg.ss-fullscreen .lb-img-side {
  padding: 20px;
  padding-top: calc(20px + env(safe-area-inset-top));
}
.lb-bg.ss-fullscreen .lb-img {
  max-height: calc(95vh - env(safe-area-inset-top));
  max-width: 95vw;
}
.lb-bg.ss-fullscreen .lb-x {
  display: none;
}

/* Fullview mode (just image, tap to exit) */
.lb-bg.lb-fullview .lb-panel {
  display: none;
}
.lb-bg.lb-fullview .lb-layout {
  max-width: 100vw;
}
.lb-bg.lb-fullview .lb-img-side {
  padding: 20px;
}
.lb-bg.lb-fullview .lb-img {
  max-height: 95vh;
  max-width: 95vw;
  cursor: zoom-out;
}
.lb-bg.lb-fullview .lb-x {
  top: 16px;
  right: 16px;
  display: flex;
}
.lb-bg.lb-fullview .lb-arr {
  background: rgba(255, 255, 255, 0.15);
}
.lb-fullview-hint {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(26, 20, 16, 0.7);
  color: rgba(255, 255, 255, 0.8);
  padding: 8px 18px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  backdrop-filter: blur(8px);
  z-index: 360;
  pointer-events: none;
  animation:
    fadeIn 0.3s ease,
    fadeOut 0.3s ease 2s forwards;
}
@media (max-width: 900px) {
  .lb-bg.lb-fullview .lb-img-side {
    padding: calc(12px + env(safe-area-inset-top)) 8px 12px;
  }
  .lb-bg.lb-fullview .lb-img {
    max-height: 90vh;
    max-width: 100vw;
    border-radius: 0;
  }
  .lb-bg.lb-fullview .lb-x {
    top: calc(10px + env(safe-area-inset-top));
  }
}
.ss-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}
.ss-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}
.ss-speed {
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  font-weight: 500;
}
.ss-counter {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  min-width: 60px;
  text-align: center;
  font-weight: 500;
}

/* ── ALBUM MANAGE MODAL ── */
.album-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  max-height: 220px;
  overflow-y: auto;
}
.add-photo-thumb {
  position: relative;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1;
  border: 2px solid transparent;
  transition: border-color 0.15s;
}
.add-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.add-photo-vid {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.add-thumb-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.add-thumb-play svg {
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.85));
}
.add-photo-thumb .media-duration-badge {
  font-size: 10px;
  right: 5px;
  bottom: 5px;
  padding: 2px 5px;
}
.add-photo-thumb.selected {
  border-color: var(--accent);
}
.add-photo-thumb .check {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  display: none;
  align-items: center;
  justify-content: center;
}
.add-photo-thumb.selected .check {
  display: flex;
}
.album-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.album-row-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}
.album-row-count {
  font-size: 12px;
  color: var(--muted2);
}
.album-row-del {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted2);
  display: flex;
  align-items: center;
  transition: color 0.2s;
  padding: 2px;
}
.album-row-del:hover {
  color: var(--red);
}
.new-album-row {
  display: flex;
  gap: 8px;
}
.new-album-row input {
  flex: 1;
  padding: 10px 13px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.new-album-row input:focus {
  border-color: var(--accent);
}
.new-album-row button {
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
.new-album-row button:hover {
  background: var(--accent-d);
}
.new-album-row button:disabled {
  background: var(--border2);
  color: var(--muted);
  cursor: not-allowed;
}
.new-album-row button:disabled:hover {
  background: var(--border2);
}

/* ── PROFILE MODAL ── */
.avatar-upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px 0 0;
}
.avatar-preview {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  transition: border-color 0.2s;
}
.avatar-preview:hover {
  border-color: var(--accent);
}
.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-color-section {
  width: 100%;
  padding: 16px 0 4px;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}
.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2.5px solid transparent;
  transition:
    transform 0.15s,
    border-color 0.15s;
  flex-shrink: 0;
}
.color-swatch:hover {
  transform: scale(1.15);
}
.color-swatch.active {
  border-color: var(--text);
  transform: scale(1.1);
}
.color-swatch-custom {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: border-color 0.15s;
  overflow: hidden;
  padding: 0;
  background: none;
  flex-shrink: 0;
}
.color-swatch-custom:hover {
  border-color: var(--accent);
}
.color-swatch-custom input[type='color'] {
  width: 150%;
  height: 150%;
  border: none;
  padding: 0;
  cursor: pointer;
  opacity: 0;
  position: absolute;
}

/* ── ADMIN USER ACCORDION ── */
.au-row {
  border-bottom: 1px solid var(--border);
}
.au-row:last-child {
  border-bottom: none;
}
.au-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}
.au-summary:hover {
  background: var(--bg);
}
.au-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
}
.au-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.au-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.au-email {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.au-migration-note {
  font-size: 11px;
  color: var(--muted2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.au-role-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
  flex-shrink: 0;
  letter-spacing: 0.3px;
}
.au-role-admin {
  background: rgba(var(--accent-rgb, 0.6, 0.4, 0.3), 0.15);
  color: var(--accent);
}
.au-role-user {
  background: var(--bg);
  color: var(--muted);
}
.au-since {
  font-size: 11px;
  color: var(--muted2);
  flex-shrink: 0;
}
.au-chevron {
  font-size: 18px;
  color: var(--muted2);
  flex-shrink: 0;
  transition: transform 0.2s;
  line-height: 1;
}
.au-chev-open {
  transform: rotate(90deg);
}

.au-detail {
  background: var(--bg);
  padding: 16px 20px 20px;
  border-top: 1px solid var(--border);
}
.au-detail-loading {
  display: flex;
  justify-content: center;
  padding: 16px;
}
.au-err {
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.au-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.au-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.au-stat-val {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}
.au-stat-lbl {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

.au-card {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.au-card-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.au-card-count {
  font-size: 11px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 1px 7px;
  color: var(--muted2);
  font-weight: 600;
  letter-spacing: 0;
}

.au-info-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.au-info-key {
  font-size: 12px;
  color: var(--muted);
  min-width: 100px;
  flex-shrink: 0;
}
.au-info-val {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.au-mono {
  font-family: monospace;
  font-size: 12px;
}

.au-groups-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.au-group-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.au-group-name {
  font-size: 13px;
  color: var(--text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.au-grole-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
  flex-shrink: 0;
}
.au-grole-owner {
  background: rgba(196, 148, 72, 0.15);
  color: #c49448;
}
.au-grole-deputy {
  background: rgba(100, 130, 200, 0.15);
  color: #6482c8;
}
.au-grole-member {
  background: var(--border);
  color: var(--muted);
}
.au-mini-btn {
  border: 1px solid rgba(200, 70, 70, 0.35);
  background: rgba(200, 70, 70, 0.04);
  color: #c84646;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
}
.au-mini-btn:hover {
  background: rgba(200, 70, 70, 0.1);
}
.au-mini-btn-disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.au-group-manage-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.au-group-manage-row .au-role-select {
  flex: 1;
}

.au-action-block {
  display: flex;
  align-items: center;
  gap: 10px;
}
.au-role-select {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}

.profile-delete-warning {
  font-size: 12px;
  color: var(--text2);
  margin: 0 0 10px;
  font-weight: 500;
  line-height: 1.45;
  padding: 10px 11px;
  border: 1px solid rgba(200, 70, 70, 0.35);
  border-left: 4px solid #c84646;
  border-radius: 10px;
  background: rgba(200, 70, 70, 0.07);
}

.profile-delete-warning ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.profile-delete-warning li {
  line-height: 1.45;
}

[data-theme='dark'] .profile-delete-warning {
  border-color: rgba(224, 112, 112, 0.4);
  border-left-color: #e07070;
  background: rgba(224, 112, 112, 0.15);
}

.profile-delete-keep-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin: 0;
}

.profile-delete-code-request {
  margin-top: 12px;
  margin-bottom: 10px;
}

.inline-help-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid var(--border2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  user-select: none;
}

.inline-help-tip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.inline-help-pop {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  width: 260px;
  padding: 8px 9px;
  border-radius: 8px;
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
  box-shadow: var(--shadow2);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.14s ease;
  z-index: 20;
}

.inline-help-tip:hover .inline-help-pop,
.inline-help-tip:focus-visible .inline-help-pop {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 640px) {
  .grid.feed-grid {
    max-width: 100%;
  }

  .feed-compose-card {
    padding: 10px;
    margin-bottom: 8px;
  }

  .feed-compose-row {
    flex-direction: column;
    align-items: stretch;
  }

  .feed-compose-submit {
    width: 100%;
  }

  .feed-compose-card.is-active .feed-compose-textarea,
  .feed-compose-card:focus-within .feed-compose-textarea {
    min-height: 90px;
    max-height: 220px;
  }

  .feed-post-menu-anchor {
    gap: 6px;
  }

  .feed-post-saved-indicator {
    font-size: 18px;
    min-width: 20px;
  }

  .feed-post-menu-toggle {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .feed-post-menu {
    top: calc(100% + 8px);
    right: -2px;
    min-width: min(220px, calc(100vw - 24px));
    max-width: min(280px, calc(100vw - 24px));
    padding: 7px;
    border-radius: 16px;
  }

  .feed-post-menu-item {
    min-height: 44px;
    gap: 12px;
    padding: 11px 12px;
    font-size: 14px;
  }

  .feed-post-edited-btn {
    min-height: 24px;
    line-height: 1.2;
  }

  .inline-help-pop {
    left: auto;
    right: 0;
    top: 22px;
    transform: none;
    width: min(240px, 74vw);
  }
}
.au-role-select:focus {
  outline: none;
  border-color: var(--accent);
}

.au-btns-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.au-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 15px;
  border-radius: 9px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.au-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.au-btn-danger {
  border-color: rgba(200, 70, 70, 0.35);
  color: #c84646;
  background: rgba(200, 70, 70, 0.04);
}
.au-btn-danger:hover {
  border-color: #c84646;
  background: rgba(200, 70, 70, 0.1);
  color: #c84646;
}

.au-notify-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.au-notify-input {
  padding: 8px 11px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  resize: none;
}
.au-notify-input:focus {
  outline: none;
  border-color: var(--accent);
}
.au-notify-textarea {
  resize: vertical;
  min-height: 54px;
}
