:root {
  --bg0: #0b1020;
  --bg1: #0f172a;
  --panel: rgba(15, 23, 42, 0.72);
  --panel2: rgba(2, 6, 23, 0.72);
  --stroke: rgba(255, 255, 255, 0.1);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.68);
  --accent: #ff7a1a;
  --accent2: #ff3d00;
  --good: #22c55e;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow-x: hidden;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 600px at 30% 0%, rgba(255, 122, 26, 0.25), transparent 60%),
    radial-gradient(900px 500px at 80% 20%, rgba(59, 130, 246, 0.18), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
}
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.page > .shell,
.page > .auth-wrap { flex: 1; }

.desktop-only { display: block; }
@media (max-width: 768px) {
  .desktop-only { display: none !important; }
}

/* App shell */
.shell {
  display: grid;
  grid-template-columns: 72px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border-right: 1px solid var(--stroke);
  padding: 14px 10px;
  position: sticky;
  top: 0;
  height: 100vh;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  overflow-x: hidden;
}
.side-logo {
  font-weight: 900;
  letter-spacing: 0.5px;
  font-size: 22px;
  margin: 6px 6px 14px;
  opacity: 0.95;
}
.side-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}
.iconbtn {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.18);
  display: grid;
  place-items: center;
  color: var(--text);
  text-decoration: none;
  font-size: 20px;
  line-height: 1;
  padding: 0;
}
.iconbtn:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
}

.notif-icon {
  position: relative;
}
.notif-icon.has-unread {
  filter: drop-shadow(0 0 10px rgba(245, 193, 75, 0.55));
}
.notif-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  background: linear-gradient(180deg, #fff6c5, #f2b441, #e29a2e);
  color: #1a1208;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}

.main { padding: 18px 18px 40px; min-width: 0; }

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.22);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 26px;
  letter-spacing: 0.3px;
}

.logo-text,
.brand span{
  font-weight: 900;
  color: #fff;
}
.brand img {
  height: 26px;
  width: 26px;
  border-radius: 999px;
  object-fit: cover;
  display: block;
}
.brand a { color: inherit; text-decoration: none; }
.search {
  flex: 1;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 8px 12px;
  gap: 10px;
}
.search input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
  font-size: 14px;
}
.search input::placeholder { color: var(--muted); }
.top-actions { display: flex; gap: 10px; }
.pill {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}
.pill:hover { border-color: rgba(255, 255, 255, 0.28); background: rgba(255, 255, 255, 0.1); }
form.inline { display: inline; }

/* Post page: Edit / Delete row alignment */
.post-actions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 24px;
}
.post-actions-row .post-owner-form {
  display: inline-flex;
  align-items: center;
}
.post-actions-row .post-owner-form button.pill {
  margin: 0;
}

/* Hero - image set inline from PHP */
.hero {
  margin-top: 14px;
  height: 240px;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #1a1f2e;
  position: relative;
}
.hero .hero-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(400px 250px at 20% 40%, rgba(255, 122, 26, 0.25), transparent 60%),
    radial-gradient(520px 260px at 70% 30%, rgba(59, 130, 246, 0.25), transparent 60%);
  mix-blend-mode: screen;
  pointer-events: none;
}

/* Sections & cards */
.section {
  margin-top: 16px;
  border: 1px solid var(--stroke);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.2);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  padding: 18px;
}
.section h3 {
  margin: 0 0 14px;
  font-size: 1.1rem;
  letter-spacing: 0.4px;
  color: rgba(255, 255, 255, 0.88);
}
.grid4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.card {
  border: 1px solid var(--stroke);
  border-radius: 16px;
  overflow: hidden;
  background-color: rgba(255, 255, 255, 0.04);
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background-color: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}
.community-card {
  position: relative;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.community-card:hover {
  transform: translateY(-2px);
}
.community-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.05), rgba(0,0,0,.55));
  opacity: 1;
  transition: opacity 0.18s ease, background 0.18s ease;
  pointer-events: none;
}
.community-card:hover::before {
  background: linear-gradient(to bottom, rgba(0,0,0,.02), rgba(0,0,0,.45));
}
.community-card > * {
  position: relative;
  z-index: 1;
}
.community-header {
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  min-height: 100px;
  padding: 20px 16px;
}
.community-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.05), rgba(0,0,0,.55));
  pointer-events: none;
}
.community-header > * {
  position: relative;
  z-index: 1;
}
.card .thumb {
  height: 92px;
  background: rgba(255, 255, 255, 0.05);
}
.card .meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--muted);
}
.card .meta.card-title-row {
  padding-top: 0;
  flex-wrap: wrap;
}
.settings-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
.settings-actions .pill{
  white-space: nowrap;
}
@media (max-width: 520px){
  .settings-actions .pill{
    flex: 1 1 auto;
    text-align: center;
  }
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

/* Auth page - background set inline from PHP */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 16px;
  background-size: cover;
  background-position: center;
  background-color: #0f172a;
}
.auth-card {
  width: min(420px, 92vw);
  padding: 24px;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: rgba(2, 6, 23, 0.62);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.auth-card h1 { margin: 0 0 18px; text-align: center; font-size: 1.75rem; }
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0;
}
.field label { font-size: 14px; font-weight: 600; color: var(--muted); }
.info-text { font-size: 13px; color: var(--muted); margin-top: 6px; text-align: center; }
.error-message { font-size: 13px; color: rgba(239, 68, 68, 0.95); margin-top: 6px; }
.title-char-count { margin-left: 8px; font-weight: 500; color: var(--muted); }
.title-char-count.at-limit { color: var(--accent); }
.check-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 12px;
  color: rgba(255, 255, 255, .74);
  font-size: 13px;
}
.check-row input { margin-top: 3px; }

.signup-agreement {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
}
.signup-agreement a {
  color: #f5c14b;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}
.signup-agreement a:hover {
  color: #fff3b0;
  text-shadow: 0 0 8px rgba(245, 193, 75, 0.6);
}

.field input,
.field textarea,
.field select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  outline: 0;
  font-size: 16px;
}
input::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, 0.45);
}
.field input:focus,
.field textarea:focus,
.field select:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 0 3px rgba(255, 122, 26, 0.15);
}
.field input:focus-visible,
.field textarea:focus-visible,
.field select:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 0;
}
input:disabled,
textarea:disabled,
select:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.field input[type="checkbox"] { width: auto; cursor: pointer; }
select {
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--text);
}
select option {
  background-color: #0f172a;
  color: #ffffff;
}
.btn {
  width: 100%;
  padding: 12px 16px;
  margin-top: 8px;
  border-radius: 12px;
  border: 0;
  color: white;
  font-weight: 800;
  font-size: 16px;
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }

.pill:disabled, button:disabled { opacity: .55; cursor: not-allowed; }

.toast {
  position: fixed;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(0, 0, 0, .35);
  color: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(2px);
}
.toast-success {
  border-color: rgba(255, 122, 26, .35);
  background: rgba(255, 122, 26, .14);
}

.cookie-banner {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(10, 12, 18, .72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
}
.cookie-banner .cookie-text {
  color: rgba(255, 255, 255, .78);
  font-size: 13px;
  line-height: 1.5;
  max-width: 78ch;
}
.cookie-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.cookie-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cookie-actions .pill { padding: 10px 14px; }
.pill.pill-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.pill.pill-primary:hover { filter: brightness(1.05); }
@media (max-width: 720px) {
  .cookie-banner { flex-direction: column; align-items: flex-start; }
  .cookie-actions { width: 100%; justify-content: flex-start; }
}

@media (max-width: 600px) {
  .cookie-banner {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    padding: 14px 14px;
    border-radius: 18px;
  }
  .cookie-text {
    font-size: 13px;
    line-height: 1.45;
    margin: 0 0 10px 0;
  }
  .cookie-text-secondary {
    font-size: 12.5px;
    opacity: 0.75;
    margin-top: 6px;
  }
  .cookie-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: stretch;
  }
  .cookie-actions form {
    margin: 0;
  }
  .cookie-actions .pill {
    width: 100%;
    justify-content: center;
    white-space: nowrap;
  }
  .cookie-actions a.pill {
    grid-column: 1 / -1;
  }
}

/* Desktop tidy */
@media (min-width: 900px) {
  .cookie-banner {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(1100px, calc(100% - 48px));
    padding: 16px 18px;
    border-radius: 20px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: center;
  }

  .cookie-text-wrap {
    display: block;
    max-width: 78ch;
  }

  .cookie-text {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
  }

  .cookie-text-secondary {
    margin-top: 6px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 12.5px;
  }

  .cookie-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    justify-content: flex-end;
  }

  .cookie-actions .pill {
    white-space: nowrap;
    padding: 10px 14px;
  }
}

/* Contact page */
.contact-container {
  display: flex;
  justify-content: center;
  padding: 60px 20px;
}
.contact-card {
  width: 100%;
  max-width: 600px;
  padding: 30px;
}
.contact-card h1 { margin: 0 0 8px; }
.contact-subtext {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 20px;
}
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.contact-form label {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
}
.contact-form input,
.contact-form textarea {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 16px;
}
.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: #f5c14b;
  box-shadow: 0 0 0 2px rgba(245, 193, 75, 0.3);
}

@media (max-width: 600px) {
  .contact-card {
    padding: 20px;
  }
  .contact-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .contact-form label {
    display: block;
    margin: 0 0 6px 0;
  }
  .contact-form input,
  .contact-form textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .contact-form textarea {
    min-height: 140px;
    resize: vertical;
  }
  .contact-form button,
  .contact-form .pill {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}

.form-error {
  background: rgba(255, 0, 0, 0.15);
  border: 1px solid rgba(255, 0, 0, 0.3);
  padding: 10px;
  border-radius: 12px;
  margin-bottom: 15px;
  color: rgba(255, 255, 255, 0.95);
}
.form-success {
  background: rgba(0, 255, 120, 0.15);
  border: 1px solid rgba(0, 255, 120, 0.3);
  padding: 10px;
  border-radius: 12px;
  margin-bottom: 15px;
  color: rgba(255, 255, 255, 0.95);
}

.small { text-align: center; color: var(--muted); margin-top: 14px; font-size: 14px; }
.small a { color: rgba(255, 255, 255, 0.9); }

/* Profile */
.profile-cover {
  height: 200px;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-color: #1a1f2e;
}
.profile-head {
  display: flex;
  gap: 14px;
  margin-top: -36px;
  padding: 0 12px;
  align-items: flex-end;
}
.avatar {
  width: 88px;
  height: 88px;
  border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, 0.9);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='88'%3E%3Ccircle cx='44' cy='44' r='44' fill='%23374151'/%3E%3Ccircle cx='44' cy='34' r='14' fill='%236b7280'/%3E%3Cpath fill='%236b7280' d='M44 56c-12 0-22 8-22 18v2h44v-2c0-10-10-18-22-18z'/%3E%3C/svg%3E") center/cover no-repeat;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.profile-meta { flex: 1; }
.profile-name-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.profile-name { font-weight: 900; font-size: 22px; margin: 0; }
.edit-profile-btn { padding: 7px 12px; font-size: 12px; font-weight: 800; border-radius: 999px; }
.stats {
  display: flex;
  gap: 20px;
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}
.tabs { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
}
.tab:hover { background: rgba(255, 255, 255, 0.08); }
.tab.active { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.2); }

.split {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 18px;
  margin-top: 18px;
}
.panel {
  border: 1px solid var(--stroke);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.2);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  padding: 18px;
}
.panel h3 { margin: 0 0 10px; font-size: 1rem; }

/* Profile About section – link visibility (gold branding, scoped only) */
.profile-about {
  line-height: 1.6;
}
.profile-about a {
  color: #f5c14b;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}
.profile-about a:hover {
  color: #fff3b0;
  text-shadow: 0 0 8px rgba(245, 193, 75, 0.6);
}

.pill[disabled],
.pill.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.follow-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background-color: rgba(255, 255, 255, 0.06);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: inline-block;
  text-decoration: none;
}
.follow-avatar:hover {
  border-color: rgba(255, 255, 255, 0.28);
  filter: brightness(1.05);
}

.post-image {
  width: 100%;
  max-height: 520px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin: 12px 0;
}
.post-image img {
  width: 100%;
  height: 100%;
  max-height: 520px;
  object-fit: cover;
  display: block;
}

.post-body a {
  color: var(--accent);
  text-decoration: underline;
}
.post-body a:hover {
  color: var(--accent2);
}

.iconwrap { position: relative; display: inline-block; }
.badge-count {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 122, 26, 0.85);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  display: grid;
  place-items: center;
}

a.notif-item {
  text-decoration: none;
  color: inherit;
}
.notif-item {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: 10px;
}
.notif-item.unread {
  background: rgba(255, 122, 26, 0.1);
  border-color: rgba(255, 122, 26, 0.25);
}
.notif-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background-color: rgba(255, 255, 255, 0.06);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  flex: 0 0 auto;
}
.notif-meta { color: rgba(255, 255, 255, 0.65); font-size: 12px; }

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.post-tile {
  min-height: 100px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.post-tile:hover {
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}
.post-tile .pt-title {
  padding: 10px 12px 4px;
  font-weight: 800;
  font-size: 13px;
  line-height: 1.3;
}
.post-tile .pt-body {
  padding: 0 12px 12px;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  flex: 1;
}
.post-tile .pt-actions { padding: 8px 12px 12px; display: flex; gap: 8px; align-items: center; }

.notice {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(34, 197, 94, 0.12);
  color: rgba(255, 255, 255, 0.95);
  margin: 12px 0;
}
.notice.error { background: rgba(239, 68, 68, 0.15); }

/* Favorite button */
.fav-form { display: inline; }
.fav-btn {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}
.fav-btn:hover { border-color: rgba(255, 255, 255, 0.2); color: var(--text); }
.fav-btn.is-fav { background: rgba(255, 122, 26, 0.2); border-color: var(--accent); color: var(--accent); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.filters .pill.active { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.25); }
.pill.active { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.22); }

.empty-state { color: rgba(255, 255, 255, 0.65); padding: 8px 0; }

.rules-block { white-space: normal; line-height: 1.7; color: rgba(255, 255, 255, .74); font-size: 14px; }
.desc-muted { color: rgba(255, 255, 255, .72); line-height: 1.7; }

.color-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 220px;
}
.color-stack input[type="color"] {
  width: 56px;
  height: 36px;
  padding: 0;
  border-radius: 10px;
  cursor: pointer;
}
.color-stack input[type="text"] {
  width: 100%;
}

.stats-link { color: inherit; text-decoration: none; }
.stats-link:hover { color: var(--accent); }
.profile-pronouns { font-size: 13px; color: var(--muted); margin-left: 6px; font-weight: 400; }
.pinned-block { position: relative; padding: 14px; }
.pinned-badge { font-size: 12px; color: var(--muted); }
.pinned-link { display: block; color: inherit; text-decoration: none; margin-top: 6px; }
.pinned-link:hover { color: var(--accent); }
.pinned-preview { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }

.follow-list { display: flex; flex-direction: column; gap: 10px; }
.follow-list-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--stroke); }
.follow-list-row:last-child { border-bottom: 0; }
.follow-username { font-weight: 700; color: var(--text); text-decoration: none; }
.follow-username:hover { color: var(--accent); }

/* Following/Followers page: profile name link matches theme */
.panel-profile-link { color: var(--accent); text-decoration: none; }
.panel-profile-link:hover { color: var(--accent2); }

.followers-page .profile-link {
  color: #f5c14b;
  font-weight: 600;
  text-decoration: none;
}
.followers-page .profile-link:hover {
  color: #fff3b0;
  text-decoration: underline;
}

.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.media-tile-wrap { position: relative; }
.media-tile { position: relative; aspect-ratio: 1/1; border-radius: 16px; border: 1px solid var(--stroke); background-size: cover; background-position: center; cursor: pointer; padding: 0; }
.media-tile:hover { border-color: rgba(255, 255, 255, 0.25); }

.highlight-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: 10px;
}
.highlight-item p,
.highlight-item h3 { margin: 0; }
.highlight-item .pill { margin-top: 6px; align-self: flex-start; }

.highlight-community {
  display: block;
  padding: 12px 14px;
}
.highlight-community .highlight-title {
  margin: 0 0 8px;
  font-weight: 900;
}
.highlight-community .pill {
  margin: 0;
  display: inline-flex;
}

.highlight-thumb {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  flex: 0 0 auto;
}
.highlight-title { font-weight: 900; color: rgba(255, 255, 255, 0.92); font-size: 13px; }
.highlight-sub { color: rgba(255, 255, 255, 0.65); font-size: 12px; margin-top: 4px; }

.fav-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.78); display: none; align-items: center; justify-content: center; z-index: 9999; padding: 24px; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 18px; border: 1px solid rgba(255, 255, 255, 0.12); }
.lightbox .close { position: fixed; top: 18px; right: 18px; width: 44px; height: 44px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(0, 0, 0, 0.35); color: #fff; font-size: 22px; display: grid; place-items: center; cursor: pointer; }
.lightbox .close:hover { background: rgba(255, 255, 255, 0.12); }

/* Comments */
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-item {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.comment-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.comment-author { font-weight: 700; color: var(--text); text-decoration: none; }
.comment-author:hover { text-decoration: underline; }
.comment-date { font-size: 12px; color: var(--muted); }
.comment-body { color: rgba(255, 255, 255, 0.88); font-size: 14px; line-height: 1.5; }
.comment-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.comment-actions .pill { padding: 6px 10px; font-size: 12px; }

@media (max-width: 980px) {
  .grid4 { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .media-grid { grid-template-columns: repeat(2, 1fr); }
  .shell { grid-template-columns: 1fr; }
  .sidebar { height: auto; position: relative; flex-direction: row; display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; }
  .side-nav { flex-direction: row; margin-top: 0; }
}
@media (max-width: 640px) {
  .grid4 { grid-template-columns: 1fr; }
  .posts-grid { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
  .search { order: 3; width: 100%; }
}
@media (max-width: 520px) {
  .topbar { flex-wrap: wrap; gap: 10px; }
  .search { width: 100%; order: 3; min-width: 0; }
  .top-actions { width: 100%; justify-content: flex-end; flex-wrap: wrap; }
  .profile-head { flex-direction: column; align-items: flex-start; margin-top: -44px; }
  .profile-name-row { width: 100%; justify-content: space-between; }
  .tabs { flex-wrap: wrap; }
}

/* Mobile only: top icon row + header (max-width 480px) */
@media (max-width: 480px) {
  /* 1) Top icon row (sidebar + side-nav) */
  .sidebar {
    padding: 8px 10px;
    gap: 10px;
    justify-content: space-between;
  }
  .side-logo {
    display: none;
  }
  .side-nav {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 0;
    flex: 1;
    min-width: 0;
  }
  .side-nav .iconbtn {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    flex-shrink: 0;
    font-size: 18px;
  }

  /* 2) Header card (topbar) */
  .topbar {
    padding: 10px 12px 12px;
    gap: 12px;
    flex-wrap: wrap;
  }
  .topbar .brand {
    display: none;
  }
  .topbar .search {
    order: 3;
    width: 100%;
    min-width: 0;
    margin: 0;
  }
  .topbar .search input {
    min-width: 0;
  }
  .top-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    order: 2;
  }
  .top-actions .pill {
    justify-self: stretch;
    text-align: center;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Mobile landscape only: wrap header to prevent horizontal overflow */
@media (max-height: 500px) and (orientation: landscape) {
  .topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    max-width: 100%;
    overflow-x: hidden;
    padding: 8px 10px;
  }
  .topbar .brand {
    flex: 0 1 auto;
    min-width: 0;
    font-size: clamp(1rem, 3.5vw, 1.35rem);
  }
  .topbar .brand span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar .search {
    flex: 1 1 280px;
    min-width: 220px;
    order: 3;
    width: 100%;
  }
  .topbar .search input {
    min-width: 0;
  }
  .top-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    flex: 1 1 100%;
    width: 100%;
    order: 2;
    min-width: 0;
  }
  .top-actions .pill {
    min-width: 0;
    white-space: normal;
    text-align: center;
    padding: 6px 10px;
    font-size: 12px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* Site footer */
.site-footer {
  margin-top: auto;
  padding: 20px 18px;
  border-top: 1px solid var(--stroke);
  background: rgba(15, 23, 42, 0.5);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
}
.footer-brand strong { color: var(--text); }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}
.footer-links a:hover { color: var(--text); }

/* Legal / static info pages */
.legal-wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px 18px 0;
}
.legal-hero {
  padding: 8px 2px 14px;
}
.legal-title {
  margin: 0;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.2px;
}
.legal-sub {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.5;
  max-width: 70ch;
}
.legal-panel {
  padding: 18px;
}
.legal-panel h2 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 900;
}
.legal-panel h3 {
  margin: 14px 0 8px;
  font-size: 14px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.92);
}
.legal-panel p,
.legal-panel li {
  color: rgba(255, 255, 255, 0.74);
  line-height: 1.7;
  font-size: 14px;
}
.legal-panel ul {
  padding-left: 18px;
  margin: 10px 0;
}
.legal-panel a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.legal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}
@media (max-width: 520px) {
  .legal-title { font-size: 22px; }
  .legal-wrap { padding: 14px 14px 0; }
}

/* Follow requests page: row layout, avatar, and link theme */
.follow-requests-page .follow-request-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--stroke);
  flex-wrap: wrap;
}
.follow-requests-page .follow-request-meta {
  flex: 1;
  min-width: 0;
}
.follow-requests-page .follow-request-row .panel-profile-link {
  color: var(--accent);
  text-decoration: none;
}
.follow-requests-page .follow-request-row .panel-profile-link:hover {
  color: var(--accent2);
}
.follow-requests-page .follow-request-row form.inline {
  flex-shrink: 0;
}
@media (max-width: 640px) {
  .follow-requests-page .follow-avatar {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px;
    min-height: 44px;
    flex-shrink: 0;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    border-radius: 999px;
  }
}
