/* === CSS Custom Properties — Neon Theme === */

/* Light theme — clean base with neon cyan accents */
:root,
[data-theme='light'] {
  --bg: #f0f4f8;
  --surface: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --accent: #00acc1;
  --accent-rgb: 0, 172, 193;
  --accent-soft: rgba(0, 172, 193, 0.08);
  --accent-text: #0a1628;
  --accent-glow: 0 0 12px rgba(0, 172, 193, 0.25);
  --overlay: rgba(0, 0, 0, 0.8);
  --danger: #ef4444;
  --danger-rgb: 239, 68, 68;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.1);
  --transition: 200ms ease;
  --header-height: 57px;
  --pinned-height: 0px; /* Set to 44px when pinned carousel is visible */
  --sidebar-width: 240px;
  --card-max-width: 470px;
  color-scheme: light;
}

/* Dark theme — deep blue-black with neon cyan glow */
[data-theme='dark'] {
  --bg: #0b0e14;
  --surface: #141922;
  --text: #e2e8f0;
  --text-muted: #64748b;
  --border: #1e293b;
  --accent: #00e5ff;
  --accent-rgb: 0, 229, 255;
  --accent-soft: rgba(0, 229, 255, 0.08);
  --accent-text: #0a0f16;
  --accent-glow: 0 0 16px rgba(0, 229, 255, 0.35);
  --overlay: rgba(0, 0, 0, 0.92);
  --danger: #ff5370;
  --danger-rgb: 255, 83, 112;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

/* === Reset === */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* === Base === */
html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* === Normalized Form Controls (40px height, consistent look) === */
input,
select,
button,
textarea {
  font-family: inherit;
  font-size: 14px;
}

input[type='text'],
input[type='email'],
input[type='password'],
input[type='search'],
input[type='url'],
select,
.input {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}

input:focus,
select:focus,
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.15);
}

textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  outline: none;
  resize: vertical;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.15);
}

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

a:hover {
  text-decoration: underline;
}

/* === Screens === */
.screen {
  min-height: 100vh;
}

/* === Login === */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 400px;
  width: 100%;
}

.login-logo {
  margin-bottom: 32px;
}

.login-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.login-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 32px;
  line-height: 1.5;
}

.btn-login {
  width: 100%;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-sm);
}

.login-note {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 16px;
}

.login-footer {
  position: absolute;
  bottom: 24px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

.login-divider {
  font-size: 12px;
  color: var(--text-muted);
  margin: 24px 0 16px;
  text-align: center;
}

.dev-user-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 240px;
}

.dev-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: background var(--transition);
}

.dev-user-btn:hover {
  background: var(--accent-soft);
}

.dev-user-btn .badge {
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: auto;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  box-shadow: var(--accent-glow);
}

.btn-primary:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.45);
}

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

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

/* === Header === */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.header-logo {
  display: flex;
  align-items: center;
  cursor: pointer;
}

/* === l∞p Brand Logo === */
/*
 * Monospace-style font gives uniform character widths so "l" and "p"
 * look the same weight as each other and as the infinity icon.
 */
.brand-logo {
  display: inline-flex;
  align-items: baseline;
  color: var(--accent);
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Mono', 'Consolas', 'Liberation Mono', monospace;
  font-weight: 600;
  line-height: 1;
}

/* Large brand (login page) */
.brand-logo-lg {
  font-size: 52px;
  text-shadow: var(--accent-glow);
}

/* Small brand (header) */
.brand-logo-sm {
  font-size: 24px;
  text-shadow: var(--accent-glow);
}

/* === Loop Infinity Icon & Neon Animation === */
/*
 * Icon replaces "oo" in "loop". Sized to match monospace metrics:
 *   - height ≈ x-height of the font (≈ 0.55 × font-size for monospace)
 *   - width  ≈ 2 × character advance  (≈ 1.2 × font-size)
 *   - SVG viewBox 72×36, circles y 4→32; we offset with top to
 *     sink the circle bottoms onto the baseline.
 * Stroke-width 5 in viewBox units matches the bold font weight.
 */
.loop-icon {
  overflow: visible;
  flex-shrink: 0;
  vertical-align: baseline;
  position: relative;
}

/* Base path — always visible, dim */
.loop-path-base {
  fill: none;
  stroke: var(--accent);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.3;
}

/* Animated trace — bright segment traveling the path */
.loop-path-trace {
  fill: none;
  stroke: var(--accent);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 30 146;
  animation: neon-trace 4s linear infinite;
}

/* ── Large icon (login page) ── */
/* 52px mono → x-height ≈ 29px, "oo" width ≈ 62px */
.loop-icon-lg {
  width: 62px;
  height: 31px;
  animation: neon-pulse 1s ease-in-out infinite;
}

.loop-icon-lg .loop-path-base {
  stroke-width: 10;
  opacity: 0.25;
}

.loop-icon-lg .loop-path-trace {
  stroke-width: 10;
  stroke-dasharray: 35 141;
  animation: neon-trace 1s linear infinite;
}

/* ── Small icon (header) ── */
/* 24px mono → x-height ≈ 13px, "oo" width ≈ 29px */
.loop-icon-sm {
  width: 29px;
  height: 14px;
}

.loop-icon-sm .loop-path-base {
  stroke-width: 10;
  opacity: 0.35;
}

.loop-icon-sm .loop-path-trace {
  stroke-width: 10;
  stroke-dasharray: 25 151;
  animation: neon-trace 2s linear infinite;
}

/* ── Neon keyframes ── */
/* Two circles r=14: perimeter ≈ 2 × 2π×14 ≈ 176 */
@keyframes neon-trace {
  to {
    stroke-dashoffset: -176;
  }
}

@keyframes neon-pulse {
  0%,
  100% {
    filter: drop-shadow(0 0 6px rgba(var(--accent-rgb), 0.3));
  }
  50% {
    filter: drop-shadow(0 0 20px rgba(var(--accent-rgb), 0.7));
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text-muted);
  transition: all var(--transition);
}

.header-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.header-btn.btn-accent {
  background: var(--accent);
  color: var(--accent-text);
  box-shadow: var(--accent-glow);
}

.header-btn.btn-accent:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.45);
}

/* === Pinned Carousel === */
.pinned-carousel {
  position: sticky;
  top: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 90;
}

.pinned-inner {
  display: flex;
  gap: 0;
  max-width: 1200px;
  margin: 0 auto;
  height: 44px; /* Fixed height for pinned carousel */
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.pinned-inner::-webkit-scrollbar {
  display: none;
}

.pinned-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 44px;
  max-width: 480px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}

.pinned-item:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.pinned-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(var(--danger-rgb), 0.4);
}

.pinned-text {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pinned-author {
  font-size: 11px;
  color: var(--text-muted);
}

/* === Main Layout === */
.main-layout {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  min-height: calc(100vh - var(--header-height) - var(--pinned-height));
}

/* === Post Area === */
.post-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  position: relative;
}

/* Post stage: arrow - card - arrow in a row */
.post-stage {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  max-width: calc(var(--card-max-width) + 100px);
  justify-content: center;
}

/* Nav arrow buttons (desktop) */
.nav-arrow {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all var(--transition);
  margin-top: 80px;
}

.nav-arrow:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

.post-container {
  width: 100%;
  max-width: var(--card-max-width);
  flex: 1;
  min-width: 0;
}

.post-slot {
  width: 100%;
}

/* === Empty State === */
.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 15px;
  padding: 24px;
  text-align: center;
}

/* === Sidebar === */
.sidebar {
  width: var(--sidebar-width);
  padding: 16px;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  align-self: flex-start;
  top: calc(var(--header-height) + var(--pinned-height));
  height: calc(100vh - var(--header-height) - var(--pinned-height));
  overflow-y: auto;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.sidebar-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  display: block;
}

.sidebar-section select,
.sidebar-section button {
  margin-bottom: 4px;
}

.unread-indicator {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 8px rgba(var(--danger-rgb), 0.6);
  animation: pulse-dot 2s ease-in-out infinite;
}

.sidebar-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--text);
  transition: all var(--transition);
}

.sidebar-btn svg,
.sidebar-btn .avatar-small {
  flex-shrink: 0;
}

.sidebar-btn:hover {
  background: var(--accent-soft);
}

.sidebar-btn.btn-accent {
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  margin-top: 8px;
  border-color: transparent;
  box-shadow: var(--accent-glow);
}

.sidebar-btn.btn-accent:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.45);
}

/* Profile + Logout combo button */
.sidebar-profile-combo {
  display: flex;
  align-items: center;
  width: 100%;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.sidebar-profile-main {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.sidebar-username {
  font-size: 13px;
  font-weight: 500;
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 40px;
  flex-shrink: 0;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-left: 0;
  transition: all var(--transition);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.sidebar-logout-btn:hover {
  background: rgba(var(--danger-rgb), 0.08);
  color: var(--danger);
}

/* Hide/show sun vs moon icon based on theme */
.theme-icon-sun {
  display: none;
}
.theme-icon-moon {
  display: block;
}

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

.sidebar-copyright {
  font-size: 12px;
  color: var(--text-muted);
  padding-top: 12px;
  text-align: center;
}

/* === Mobile Footer (copyright — hidden when bottom nav present) === */
.mobile-footer {
  text-align: center;
  padding: 16px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  display: none;
}

/* === Avatar === */
.avatar-small {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  overflow: hidden;
}

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

/* === WebSocket Refresh Button === */
.ws-refresh {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 350;
  padding: 10px 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition);
}

.ws-refresh:hover {
  background: var(--accent-soft);
  transform: translateX(-50%) scale(1.05);
}

/* Animated loop icon in refresh button */
.ws-refresh-icon .loop-path-base {
  fill: none;
  stroke: currentColor;
  stroke-width: 10;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.3;
}

.ws-refresh-icon .loop-path-trace {
  fill: none;
  stroke: currentColor;
  stroke-width: 10;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 25 151;
  animation: neon-trace 2s linear infinite;
}

/* === Responsive === */
.mobile-only {
  display: none;
}

.desktop-only {
  display: flex;
}

/* Mobile */
@media (max-width: 767px) {
  .mobile-only {
    display: flex;
  }

  .desktop-only {
    display: none !important;
  }

  .post-area {
    padding: 8px;
    padding-bottom: 72px;
  }

  .nav-arrow {
    position: fixed;
    bottom: 80px;
    z-index: 50;
    margin-top: 0;
    background: rgba(var(--accent-rgb), 0.1);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(var(--accent-rgb), 0.3);
  }

  .nav-arrow-left {
    left: 8px;
  }

  .nav-arrow-right {
    right: 8px;
  }

  .post-stage {
    gap: 0;
    max-width: 100%;
  }

  .post-container {
    max-width: 100%;
  }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
  .mobile-only {
    display: none;
  }

  .sidebar {
    width: 200px;
  }

  .post-container {
    max-width: 600px;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .main-layout {
    padding: 0 16px;
  }
}

/* === Simple Post === */
.simple-post {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.simple-post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.simple-post-author {
  font-size: 14px;
  font-weight: 600;
}

.simple-post-time {
  font-size: 12px;
  color: var(--text-muted);
}

/* Post body — flexible height, text always visible below images */
.simple-post-body {
  min-height: 120px;
  overflow: hidden;
  position: relative;
  padding-top: 1px;
  transition:
    max-height 300ms ease,
    min-height 300ms ease,
    opacity 200ms ease;
}

/* === Scroll Collapse/Expand === */

/* Collapse handle bar */
.collapse-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0 0;
  cursor: pointer;
  color: var(--text-muted);
  transition: color var(--transition);
}

.collapse-handle:hover {
  color: var(--accent);
}

.collapse-handle svg {
  transition: transform 300ms ease;
}

/* Rotate chevron when collapsed (points up → "expand") */
.simple-post.collapsed .collapse-handle svg {
  transform: rotate(180deg);
}

/* Collapsed strip — thumbnail + text preview (hidden by default) */
.collapsed-strip {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.collapsed-strip-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.collapsed-strip-text {
  flex: 1;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.collapsed-strip-link {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--accent);
  font-weight: 500;
}

/* Collapsed state — body hidden, strip shown */
.simple-post.collapsed .simple-post-body {
  max-height: 0 !important;
  min-height: 0 !important;
  opacity: 0;
  padding: 0;
  margin: 0;
}

.simple-post.collapsed .collapsed-strip {
  display: flex;
}

.simple-post.collapsed .post-actions {
  border-top: none;
  margin-top: 0;
  padding-top: 4px;
}

/* Header clickable when collapsed */
.simple-post.collapsed .simple-post-header {
  cursor: pointer;
  margin-bottom: 0;
}

/* Comments grow naturally when post collapsed */
.simple-post.collapsed .comments-list {
  /* No max-height - let comments grow naturally and maintain card background */
}

/* Comments infinite scroll sentinel */
.comments-sentinel {
  height: 1px;
}

.comments-load-more {
  text-align: center;
  padding: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Text-only posts: center the text vertically, allow more room */
.simple-post-body.text-only {
  display: flex;
  align-items: center;
  min-height: 160px;
}

/* Link-only posts: center the link card */
.simple-post-body.link-only {
  display: flex;
  align-items: center;
}

.simple-post-content {
  font-size: 16px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Text-only: bigger type, centered */
.simple-post-body.text-only .simple-post-content {
  font-size: 18px;
  line-height: 1.6;
  width: 100%;
  text-align: center;
}

/* Truncated text when post has media/link + text */
.simple-post-content.truncated {
  max-height: 72px; /* ~3 lines */
  overflow: hidden;
  position: relative;
}

.read-more-btn {
  font-size: 13px;
  color: var(--accent);
  padding: 2px 0;
  display: inline-block;
  margin-top: 4px;
  cursor: pointer;
  transition: opacity var(--transition);
}

.read-more-btn:hover {
  opacity: 0.8;
}

.simple-post-link {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0;
  margin-bottom: 8px;
  width: 100%;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  display: block;
  overflow: hidden;
}

.simple-post-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.link-preview-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--border);
}

.link-content {
  padding: 12px;
}

.link-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
  line-height: 1.4;
}

.link-description {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.link-domain {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
}

.link-domain::before {
  content: '🔗 ';
  opacity: 0.6;
}

/* Image gallery — vertical scroll with left-docked centered indicators */
.simple-post-images {
  position: relative;
  margin-bottom: 8px;
}

.image-indicators {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  padding: 6px 4px;
}

.image-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.35);
  transition: all var(--transition);
  cursor: pointer;
  box-shadow: 0 0 4px rgba(var(--accent-rgb), 0.2);
}

.image-indicator.active {
  background: var(--accent);
  height: 18px;
  border-radius: 3px;
  box-shadow: var(--accent-glow);
}

.image-scroll-area {
  overflow-y: auto;
  overflow-x: hidden;
  height: 438px;
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  border-radius: var(--radius-sm);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.image-scroll-area::-webkit-scrollbar {
  display: none;
}

.image-scroll-item {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 438px;
  padding: 12px;
  scroll-snap-align: start;
  background: var(--surface);
  box-sizing: border-box;
}

.simple-post-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.hidden-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--danger);
  background: rgba(var(--danger-rgb), 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: auto;
}

.hidden-badge svg {
  flex-shrink: 0;
}

/* === Loop Button (like) === */
.loop-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 4px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all var(--transition);
}

.loop-btn:hover {
  color: var(--danger);
  background: rgba(var(--danger-rgb), 0.08);
}

.loop-btn.liked {
  color: var(--danger);
  background: rgba(var(--danger-rgb), 0.08);
}

/* Loop icon animation — matches logo neon-trace style */
.loop-btn .loop-path-base {
  fill: none;
  stroke: currentColor;
  stroke-width: 10;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.3;
}

.loop-btn .loop-path-trace {
  fill: none;
  stroke: currentColor;
  stroke-width: 10;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 25 151;
  animation: neon-trace 3s linear infinite;
}

/* When liked, stop animation and make bolder */
.loop-btn.liked .loop-path-trace {
  stroke-dasharray: none;
  animation: none;
  stroke-width: 12;
  opacity: 1;
}

.loop-btn.liked .loop-path-base {
  opacity: 0.5;
}

/* Pop effect on like */
@keyframes loop-pop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1);
  }
}

.loop-btn.liked svg {
  animation: loop-pop 0.3s ease-out;
}

/* === Loop Bar (Engagement) === */
.loop-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-top: 8px;
}

.loop-avatars {
  display: flex;
  align-items: center;
  position: relative;
  min-height: 32px;
}

.loop-avatars-loading {
  font-size: 12px;
  color: var(--text-muted);
}

.loop-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  overflow: hidden;
  transition: all 0.2s ease;
  margin-left: -20px; /* Show 12px of previous avatar */
  border-width: 1px;
  border-style: solid;
  border-color: rgba(var(--accent-rgb), 0.3);
}

.loop-avatar:first-child {
  margin-left: 0;
}

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

/* Hover state: expand avatars */
.loop-avatars:hover .loop-avatar {
  margin-left: 0;
  margin-right: 4px;
  border-color: var(--accent);
  border-style: solid;
}

.loop-avatars:hover .loop-avatar:first-child {
  margin-left: 0;
}

.loop-avatars:hover .loop-avatar:last-child {
  margin-right: 0;
}

/* More button - styled like an avatar */
.loop-avatar-more {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: -20px;
  flex-shrink: 0;
  border-width: 1px;
  border-style: solid;
  border-color: rgba(var(--accent-rgb), 0.3);
}

/* Expand more button on container hover */
.loop-avatars:hover .loop-avatar-more {
  margin-left: 0;
  margin-right: 0;
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
  border-style: solid;
}

/* Loop Likers Popover */
.loop-likers-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  min-width: 160px;
  max-width: 240px;
  height: 185px;
  overflow-y: auto;
  z-index: 1000;
  animation: popover-in 0.15s ease-out;
}

@keyframes popover-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.loop-liker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.loop-liker-item:hover {
  background: var(--bg);
}

.loop-liker-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  overflow: hidden;
  flex-shrink: 0;
}

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

.loop-liker-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  flex: 1;
}

/* === Comments Section === */
.post-comments {
  margin-top: 8px;
}

.comments-list {
  margin-bottom: 12px;
}

.comments-empty,
.comments-loading {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  padding: 12px 0;
}

/* Single comment */
.comment {
  padding: 8px 0;
  position: relative;
}

.comment + .comment {
  border-top: 1px solid var(--border);
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.avatar-xs {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  overflow: hidden;
  flex-shrink: 0;
}

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

.comment-author {
  font-size: 13px;
  font-weight: 600;
}

.comment-time {
  font-size: 11px;
  color: var(--text-muted);
}

.comment-body {
  font-size: 14px;
  line-height: 1.4;
  padding-left: 30px;
  word-break: break-word;
}

.comment-emoji-large {
  font-size: 48px;
  line-height: 1;
}

.comment-like-btn {
  position: absolute;
  top: 8px;
  right: 0;
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 4px;
  color: var(--text-muted);
  transition: all var(--transition);
}

.comment-like-btn .loop-path-base {
  /* Show solid base path only */
  fill: none;
  stroke: currentColor;
  stroke-width: 10;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 1;
}

.comment-like-btn .loop-path-trace {
  /* Hide trace path - comment icons are solid single-path */
  display: none;
}

.comment-like-btn:hover {
  color: var(--danger);
  background: rgba(var(--danger-rgb), 0.08);
}

/* Comment link preview (compact version) */
.comment-link {
  display: flex;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  margin-top: 6px;
  text-decoration: none;
  transition: all var(--transition);
}

.comment-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.comment-link-image {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

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

.comment-link-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.comment-link-description {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.comment-link-domain {
  font-size: 10px;
  color: var(--accent);
  font-weight: 500;
}

.comment-like-btn.liked {
  color: var(--danger);
}

/* Ensure no SVG animations on comment like buttons */
.comment-like-btn svg {
  animation: none !important;
}

/* Comment input form — Loop btn + input combo */
.comment-form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.comment-input {
  flex: 1;
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}

.comment-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.15);
}

.comment-send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--accent);
  margin-right: 3px;
  flex-shrink: 0;
  transition: all var(--transition);
}

.comment-send-btn:hover {
  background: var(--accent-soft);
}

/* === Neon Polish (dark-mode specific) === */
[data-theme='dark'] .loop-icon-lg {
  animation: neon-pulse-dark 3s ease-in-out infinite;
}

[data-theme='dark'] .loop-icon-sm {
  filter: drop-shadow(0 0 4px rgba(var(--accent-rgb), 0.4));
}

@keyframes neon-pulse-dark {
  0%,
  100% {
    filter: drop-shadow(0 0 8px rgba(var(--accent-rgb), 0.5));
  }
  50% {
    filter: drop-shadow(0 0 28px rgba(var(--accent-rgb), 0.9));
  }
}

[data-theme='dark'] .login-title {
  color: var(--accent);
  text-shadow: 0 0 20px rgba(var(--accent-rgb), 0.3);
}

[data-theme='dark'] .simple-post {
  border-color: var(--border);
  box-shadow: 0 0 1px rgba(var(--accent-rgb), 0.1);
}

[data-theme='dark'] .filter-select:focus {
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.25);
}

[data-theme='dark'] .avatar-small {
  box-shadow: 0 0 6px rgba(var(--accent-rgb), 0.15);
}

/* === Composer Inline (/new) === */
.composer-inline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.composer-inline-title {
  font-size: 17px;
  font-weight: 600;
}

/* === Mention Mirror Overlay === */
.mention-input-wrap {
  position: relative;
}

.mention-mirror {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  overflow: hidden;
  pointer-events: none;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 15px;
  line-height: 1.5;
  padding: 8px;
  border: none;
  color: var(--text);
  z-index: 0;
}

.mention-badge {
  background: rgba(var(--accent-rgb), 0.15);
  color: var(--accent);
  border-radius: 3px;
}

.mention-input-wrap > .composer-textarea {
  position: relative;
  z-index: 1;
  color: transparent;
  caret-color: var(--text);
  background: transparent;
}

.composer-textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  font-size: 15px;
  line-height: 1.5;
  border: none;
  background: var(--surface);
  color: var(--text);
  outline: none;
  padding: 8px;
}

.composer-textarea::placeholder {
  color: var(--text-muted);
}

/* === Composer Media Row (images + link preview on one line) === */
.composer-media-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  overflow-x: auto;
  padding: 12px 0 4px;
  scroll-behavior: smooth;
}

.composer-media-row::-webkit-scrollbar {
  height: 4px;
}

.composer-media-row::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

/* === Composer Link Preview Card === */
.composer-link-preview {
  flex-shrink: 0;
}

.composer-preview-loading {
  padding: 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.composer-preview-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 72px;
  max-width: 320px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
  padding: 0 28px 0 0;
  box-sizing: border-box;
}

.composer-preview-image {
  width: 72px;
  height: 72px;
  min-width: 72px;
  object-fit: cover;
  display: block;
}

.composer-preview-no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  font-size: 20px;
  border-radius: 0;
}

.composer-preview-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.composer-preview-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.composer-preview-domain {
  font-size: 11px;
  color: var(--accent);
  text-transform: lowercase;
  letter-spacing: 0.3px;
}

.composer-preview-close {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  font-size: 13px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  transition: background var(--transition);
}

.composer-preview-close:hover {
  background: var(--danger);
}

.composer-images-strip {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.composer-images-strip:empty {
  display: none;
}

.composer-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

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

.composer-thumb-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.composer-thumb-remove:hover {
  background: var(--danger);
}

.composer-attach-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition);
  background-color: var(--surface);
}

.composer-attach-label:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.composer-submit-btn {
  height: 36px;
  padding: 0 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 18px;
}

.composer-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* === Mobile Bottom Navbar === */
.mobile-navbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 300;
  background: var(--surface);
  border-top: 1px solid var(--border);
  justify-content: space-around;
  padding: 6px 0 env(safe-area-inset-bottom, 6px);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  color: var(--text-muted);
  font-size: 10px;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
  background: none;
  border: none;
  cursor: pointer;
  min-width: 56px;
}

.mobile-nav-item:hover,
.mobile-nav-item.mobile-nav-active {
  color: var(--accent);
}

.mobile-nav-item svg {
  flex-shrink: 0;
}

/* === My Page — Profile Card + Actions === */
.mypage-profile {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 0 20px;
  border-bottom: 1px solid var(--border);
}

.mypage-avatar {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
  cursor: pointer;
}

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

.mypage-avatar .avatar-edit-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
  z-index: 2;
}

.mypage-avatar:hover .avatar-edit-overlay {
  opacity: 1;
}

/* Coin-flip avatar (profile_photo front, avatar_url back) */
.avatar-flippable {
  perspective: 200px;
}

.avatar-flip-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transition: transform 0.6s ease;
  transform-style: preserve-3d;
}

.avatar-flippable:hover .avatar-flip-inner {
  transform: rotateY(180deg);
}

.avatar-flip-front,
.avatar-flip-back {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  backface-visibility: hidden;
}

.avatar-flip-front img,
.avatar-flip-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-flip-back {
  transform: rotateY(180deg);
}

.mypage-user-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.mypage-user-email {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

.mypage-user-info {
  flex: 1;
}

.mypage-actions-dropdown {
  position: relative;
  margin-left: auto;
  align-self: flex-start;
}

.mypage-actions-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--accent);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid var(--border);
}

.mypage-actions-btn:hover {
  transform: scale(1.05);
  color: var(--accent);
  border-color: var(--accent);
}

.mypage-actions-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  padding: 4px 0;
  z-index: 100;
}

.mypage-action-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  width: 100%;
  font-size: 14px;
  color: var(--text);
  background: none;
  border: none;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition);
  text-align: left;
}

.mypage-action-item:hover {
  background: var(--accent-soft);
}

.mypage-action-item svg {
  flex-shrink: 0;
  color: var(--text-muted);
}

.mypage-action-item.mypage-action-danger {
  color: var(--danger);
}

.mypage-action-item.mypage-action-danger svg {
  color: var(--danger);
}

.mypage-action-item.mypage-action-danger:hover {
  background: rgba(var(--danger-rgb), 0.08);
}

.mypage-actions {
  display: flex;
  gap: 8px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.mypage-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
}

.mypage-action-btn:hover {
  background: var(--accent-soft);
  color: var(--text);
  border-color: var(--accent-soft);
}

.mypage-action-danger {
  color: var(--danger);
}

.mypage-action-danger:hover {
  background: rgba(var(--danger-rgb), 0.08);
  border-color: rgba(var(--danger-rgb), 0.2);
  color: var(--danger);
}

/* === Page Views (Notifications, My Page) === */
.page-view {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 8px 16px 0;
  box-sizing: border-box;
}

.page-view-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.page-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text-muted);
  transition: all var(--transition);
  flex-shrink: 0;
}

.page-back-btn:hover {
  background: var(--accent-soft);
  color: var(--text);
}

.page-view-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.page-loading,
.page-empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted);
  font-size: 14px;
}

.page-load-more {
  display: flex;
  justify-content: center;
  padding: 16px 0;
}

.page-load-more-btn {
  padding: 8px 24px;
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition);
}

.page-load-more-btn:hover {
  background: var(--accent);
  color: var(--bg);
}

/* Notification items */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}

.notif-item:last-child {
  border-bottom: none;
}

.notif-item:hover {
  background: var(--accent-soft);
}

.notif-item.notif-read {
  opacity: 0.6;
}

.notif-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
}

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

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

.notif-text {
  font-size: 14px;
  line-height: 1.4;
}

.notif-actor {
  font-weight: 600;
  color: var(--text);
}

.notif-label {
  color: var(--text-muted);
}

.notif-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* My Page items */
.mypage-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}

.mypage-item:last-child {
  border-bottom: none;
}

.mypage-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  flex-shrink: 0;
}

.mypage-body {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.mypage-body:hover {
  opacity: 0.8;
}

.mypage-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.mypage-type {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.mypage-badge-hidden {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(var(--danger-rgb), 0.1);
  color: var(--danger);
}

.mypage-badge-hidden svg {
  flex-shrink: 0;
}

.mypage-time {
  font-size: 12px;
  color: var(--text-muted);
}

.mypage-content {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mypage-delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all var(--transition);
}

.mypage-delete-btn:hover {
  background: rgba(var(--danger-rgb), 0.1);
  color: var(--danger);
}

/* === Fullscreen Media Viewer === */
.media-viewer {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: var(--overlay);
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-viewer-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.media-viewer-close:hover {
  background: rgba(0, 0, 0, 0.7);
}

.media-viewer-badge {
  position: absolute;
  top: 20px;
  right: 72px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 16px;
}

.media-viewer-badge:empty {
  display: none;
}

.media-viewer-dots {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.media-viewer-dots:empty {
  display: none;
}

.media-viewer-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all var(--transition);
}

.media-viewer-dot.active {
  background: #fff;
  height: 20px;
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.media-viewer-image {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-viewer-image img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  transition: transform 200ms ease;
  touch-action: none; /* allow JS pinch-zoom */
  transform-origin: center center;
}

/* Thumbnail strip — desktop only, hidden on mobile */
.media-viewer-thumbs {
  display: none;
}

.media-viewer-thumbs:empty {
  display: none;
}

@media (min-width: 768px) {
  .media-viewer-thumbs:not(:empty) {
    display: flex;
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    gap: 6px;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    max-width: 80vw;
    overflow-x: auto;
  }
}

.media-viewer-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.5;
  border: 2px solid transparent;
  flex-shrink: 0;
  transition: all var(--transition);
}

.media-viewer-thumb:hover {
  opacity: 0.8;
}

.media-viewer-thumb.active {
  opacity: 1;
  border-color: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

/* === @mention Autocomplete === */
.mention-dropdown {
  position: absolute;
  z-index: 700;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 180px;
  overflow-y: auto;
  min-width: 200px;
}

.mention-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition);
}

.mention-item:hover,
.mention-item.active {
  background: var(--accent-soft);
}

.mention-item .avatar-xs {
  flex-shrink: 0;
}

.mention-item-name {
  font-weight: 500;
}

/* @mention pill — inline tag shown in post/comment text */
.mention-pill {
  display: inline;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
  font-weight: 600;
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 4px;
  white-space: nowrap;
}

[data-theme='dark'] .mention-pill {
  background: rgba(var(--accent-rgb), 0.15);
  text-shadow: 0 0 8px rgba(var(--accent-rgb), 0.3);
}

/* === Emoji Picker === */
.emoji-picker {
  position: fixed;
  z-index: 700;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.emoji-picker-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  padding: 0;
  overflow-y: auto;
}

.emoji-picker-item {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  background: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background var(--transition);
  padding: 0;
}

.emoji-picker-item:hover {
  background: var(--accent-soft);
}

.emoji-picker-item:active {
  transform: scale(0.95);
}

.emoji-picker-active {
  background: var(--accent-soft);
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* === Notification Bell Animation === */
@keyframes bell-ring {
  0%,
  100% {
    transform: rotate(0deg);
  }
  10% {
    transform: rotate(15deg);
  }
  20% {
    transform: rotate(-15deg);
  }
  30% {
    transform: rotate(10deg);
  }
  40% {
    transform: rotate(-10deg);
  }
  50% {
    transform: rotate(5deg);
  }
  60% {
    transform: rotate(-5deg);
  }
  70% {
    transform: rotate(0deg);
  }
}

@keyframes bell-heartbeat {
  0%,
  100% {
    color: var(--text);
  }
  25%,
  75% {
    color: var(--accent);
    filter: drop-shadow(0 0 8px rgba(var(--accent-rgb), 0.6));
  }
  50% {
    color: var(--accent);
    filter: drop-shadow(0 0 16px rgba(var(--accent-rgb), 0.8));
  }
}

/* Active notification state */
.sidebar-btn.has-notification svg,
.mobile-nav-item.has-notification svg {
  animation:
    bell-ring 2s ease-in-out infinite,
    bell-heartbeat 2s ease-in-out infinite;
}

/* Notification indicator dot */
.notification-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 8px rgba(var(--danger-rgb), 0.6);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.8;
  }
}

/* Position indicator on sidebar button */
.sidebar-btn {
  position: relative;
}

.sidebar-btn .notification-indicator {
  top: 12px;
  right: 12px;
}

/* Position indicator on mobile nav item */
.mobile-nav-item {
  position: relative;
}

.mobile-nav-item .notification-indicator {
  top: 6px;
  right: 6px;
}

/* === Utility === */
.hidden {
  display: none !important;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* === Post Type Badges === */
.post-type-badge {
  font-size: 0.65rem;
  padding: 1px 7px;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  vertical-align: middle;
  margin-left: 6px;
}
.post-type-announcement {
  background: var(--accent);
  color: var(--bg);
}
.post-type-birthday {
  background: #f0a500;
  color: #1a1a2e;
}
.post-type-welcome {
  background: #4caf50;
  color: white;
}
.post-type-farewell {
  background: #5c6bc0;
  color: white;
}

.edited-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
  font-style: italic;
}

/* === Composer Type Selector (admin-only) === */
.composer-type-selector {
  display: flex;
  gap: 6px;
  padding: 8px 0;
  flex-wrap: wrap;
}
.type-pill {
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  font-weight: 500;
}
.type-pill:hover {
  border-color: var(--accent);
  color: var(--text);
}
.type-pill.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.type-pill-announcement.active {
  background: var(--accent);
}
.type-pill-birthday.active {
  background: #f0a500;
  color: #1a1a2e;
  border-color: #f0a500;
}
.type-pill-welcome.active {
  background: #4caf50;
  color: white;
  border-color: #4caf50;
}
.type-pill-farewell.active {
  background: #5c6bc0;
  color: white;
  border-color: #5c6bc0;
}

/* === Mark All Read Button === */
.sidebar-btn-small {
  font-size: 0.75rem;
  padding: 4px 12px;
  gap: 4px;
  opacity: 0.7;
}
.sidebar-btn-small:hover {
  opacity: 1;
}

/* === Sidebar Holidays Widget === */

/* When expanded: button loses bottom radius, connects to list */
.sidebar-holidays-section:not(.collapsed) .sidebar-btn {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: transparent;
  margin-bottom: -1px;
}

.sidebar-holidays-section.collapsed .sidebar-holidays-list {
  display: none;
}

.sidebar-holidays-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-top: none;
  border-bottom-left-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
  padding: 4px 0;
}

.sidebar-holidays-list:empty {
  display: none;
}

.sidebar-holiday-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  font-size: 12px;
  transition: background var(--transition);
  cursor: default;
}

.sidebar-holiday-item:hover {
  background: var(--accent-soft);
}

.sidebar-holiday-item.past {
  opacity: 0.4;
}

.sidebar-holiday-date {
  font-weight: 600;
  color: var(--accent);
  min-width: 48px;
  font-size: 11px;
  flex-shrink: 0;
}

.sidebar-holiday-name {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.sidebar-holiday-empty {
  padding: 12px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.sidebar-holiday-showall {
  padding: 4px 12px;
  font-size: 11px;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: color var(--transition);
}

.sidebar-holiday-showall:hover {
  text-decoration: underline;
}

/* === Notice Board === */
.noticeboard-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 0;
  overflow-y: auto;
}

/* Top row: holidays + birthdays side by side */
.nb-top-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 600px) {
  .nb-top-row {
    grid-template-columns: 1fr;
  }
}

.nb-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.nb-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border);
}

.nb-card-holiday .nb-card-header {
  color: #4caf50;
}

.nb-card-birthday .nb-card-header {
  color: #f0a500;
}

.nb-card-body {
  padding: 6px 0;
}

.nb-event-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  font-size: 13px;
  transition: background var(--transition);
}

.nb-event-row:hover {
  background: var(--accent-soft);
}

.nb-event-date {
  font-weight: 600;
  color: var(--accent);
  font-size: 12px;
  min-width: 48px;
  flex-shrink: 0;
}

.nb-event-name {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

.nb-empty {
  padding: 12px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.nb-bday-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.nb-bday-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
}

/* Post cards — full view without comments */
.nb-post {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition);
}

.nb-post:hover {
  border-color: var(--accent);
}

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

.nb-post-header .avatar-small {
  flex-shrink: 0;
}

.nb-post-header > div:nth-child(2) {
  flex: 1;
  min-width: 0;
}

.nb-post-author {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.nb-post-time {
  font-size: 12px;
  color: var(--text-muted);
}

.nb-post-goto {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.nb-post-goto:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.nb-post-content {
  padding: 0 14px 14px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

.nb-post-images {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 0 14px 10px;
}

.nb-post-img {
  max-height: 200px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.nb-post-link {
  display: flex;
  margin: 0 14px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  text-decoration: none;
  transition: border-color var(--transition);
}

.nb-post-link:hover {
  border-color: var(--accent);
}

.nb-post-link-img {
  width: 120px;
  min-height: 80px;
  object-fit: cover;
  flex-shrink: 0;
}

.nb-post-link-info {
  padding: 10px 12px;
  min-width: 0;
}

.nb-post-link-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.nb-post-link-domain {
  font-size: 11px;
  color: var(--accent);
  text-transform: lowercase;
}
