/* =========================================================
   CIRCLES — Design System
   Brand:   Syne (display/logo) + Nunito (body)
   Palette: Navy #1a2744 · Blue #4a90e2 · Warm white #f7f8fc
   ========================================================= */

:root {
  --brand-blue: #4a90e2;
  --brand-blue-dark: #2d6bc4;
  --brand-blue-light: #e8f1fc;
  --navy: #1a2744;
  --navy-light: #2c3e6b;
  --body-bg: #f7f8fc;
  --surface: #ffffff;
  --text-primary: #1a2744;
  --text-secondary: #5a6a85;
  --text-muted-custom: #8896ab;
  --border-color: #e2e8f0;
  --success-color: #28a745;
  --error-color: #dc3545;
}

/* ---------------------------------------------------------
   Base
   --------------------------------------------------------- */
body {
  font-family: 'Nunito', sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--body-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

a {
  color: var(--brand-blue);
}

/* ---------------------------------------------------------
   Navbar
   --------------------------------------------------------- */
.navbar-circles {
  background-color: var(--navy);
  box-shadow: 0 2px 16px rgba(26, 39, 68, 0.18);
  padding: 0.55rem 0;
}

.brand-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.35rem;
  color: #ffffff !important;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  letter-spacing: -0.02em;
}

.brand-icon {
  color: var(--brand-blue);
  font-size: 1.15rem;
  line-height: 1;
}

.navbar-circles .navbar-toggler {
  border-color: rgba(255, 255, 255, 0.25);
}

.navbar-circles .nav-link {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.45rem 0.85rem;
  border-radius: 0.4rem;
  transition: color 0.15s, background-color 0.15s;
}

.navbar-circles .nav-link:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.08);
}

.navbar-circles .nav-link.active {
  color: #ffffff;
  font-weight: 700;
  background-color: rgba(74, 144, 226, 0.18);
}

/* Active dot indicator */
.navbar-circles .nav-link.active::after {
  content: '';
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--brand-blue);
  margin: 3px auto 0;
}

/* User menu pill button */
.user-menu-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  border-radius: 2rem;
  padding: 0.28rem 0.85rem 0.28rem 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Nunito', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.user-menu-btn:hover,
.user-menu-btn:focus,
.user-menu-btn.show {
  background: rgba(255, 255, 255, 0.18);
  color: white;
  border-color: rgba(255, 255, 255, 0.38);
  outline: none;
  box-shadow: none;
}

/* User avatar initials circle */
.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: var(--brand-blue);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 600;
}

/* Admin link */
.nav-link-admin {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.78rem;
  text-decoration: none;
  transition: color 0.15s;
}

.nav-link-admin:hover {
  color: rgba(255, 255, 255, 0.85);
}

/* Logged-out nav buttons */
.btn-nav-ghost {
  color: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 2rem;
  padding: 0.32rem 1rem;
  font-family: 'Nunito', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.btn-nav-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.btn-nav-solid {
  background: var(--brand-blue);
  color: white;
  border: 1px solid var(--brand-blue);
  border-radius: 2rem;
  padding: 0.32rem 1.1rem;
  font-family: 'Nunito', sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.btn-nav-solid:hover {
  background: var(--brand-blue-dark);
  border-color: var(--brand-blue-dark);
  color: white;
}

/* ---------------------------------------------------------
   Footer
   --------------------------------------------------------- */
.site-footer {
  background-color: var(--navy);
  color: rgba(255, 255, 255, 0.55);
  padding: 2rem 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-brand {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.82);
  letter-spacing: -0.02em;
}

.footer-copy {
  margin: 0;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.4);
}

/* ---------------------------------------------------------
   Landing page — Hero
   --------------------------------------------------------- */
.hero-section {
  background: linear-gradient(140deg, #1a2744 0%, #2d4a8a 50%, #3a6bc4 100%);
  padding: 5rem 0 3rem;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(74, 144, 226, 0.25) 0%, transparent 65%);
  pointer-events: none;
}

.hero-row {
  min-height: 380px;
}

.hero-text {
  position: relative;
  z-index: 1;
  padding-bottom: 2rem;
}

.hero-eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-blue-light);
  margin-bottom: 1rem;
  opacity: 0.85;
}

.hero-heading {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.1;
  color: #ffffff;
  margin-bottom: 1.25rem;
  letter-spacing: -0.03em;
}

.hero-sub {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.7;
  max-width: 480px;
  margin-bottom: 2rem;
}

.btn-hero-cta {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  color: var(--navy);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.75rem 1.75rem;
  border-radius: 2rem;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.btn-hero-cta:hover {
  background: var(--brand-blue-light);
  color: var(--navy);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

.hero-image {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 0;
}

.hero-illustration {
  max-width: 420px;
  width: 100%;
  filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.25));
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

/* Wave separator */
.hero-wave {
  background: linear-gradient(140deg, #1a2744 0%, #2d4a8a 50%, #3a6bc4 100%);
  line-height: 0;
}

.hero-wave svg {
  display: block;
  width: 100%;
  height: 60px;
}

/* ---------------------------------------------------------
   Landing page — Features
   --------------------------------------------------------- */
.features-section {
  background: #ffffff;
  padding: 5rem 0 4rem;
}

.features-header {
  margin-bottom: 3.5rem;
}

.features-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  color: var(--navy);
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.features-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  margin: 0;
}

.feature-card-new {
  background: var(--body-bg);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 2rem 1.75rem;
  text-align: center;
  transition: transform 0.18s, box-shadow 0.18s;
}

.feature-card-new:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(26, 39, 68, 0.1);
}

.feature-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--brand-blue-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.feature-icon {
  font-size: 1.6rem;
  color: var(--brand-blue);
}

.feature-card-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--navy);
  margin-bottom: 0.75rem;
}

.feature-card-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.65;
  margin: 0;
}

/* ---------------------------------------------------------
   Page header (shared: My Circles, My Albums, etc.)
   --------------------------------------------------------- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.9rem;
  color: var(--navy);
  letter-spacing: -0.02em;
  margin: 0;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0.15rem 0 0;
}

.btn-page-action {
  display: inline-flex;
  align-items: center;
  background: var(--navy);
  color: #ffffff;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.5rem 1.2rem;
  border-radius: 2rem;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
  white-space: nowrap;
}

.btn-page-action:hover {
  background: var(--navy-light);
  color: #ffffff;
  transform: translateY(-1px);
}

/* ---------------------------------------------------------
   Circle cards
   --------------------------------------------------------- */
.circle-card-link {
  text-decoration: none;
  display: block;
  height: 100%;
}

.circle-card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 0.875rem;
  padding: 1.25rem 1.4rem 1.1rem;
  transition: transform 0.16s, box-shadow 0.16s, border-color 0.16s;
  display: flex;
  flex-direction: column;
}

.circle-card-link:hover .circle-card {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(26, 39, 68, 0.1);
  border-color: var(--brand-blue);
}

.circle-card--joinable {
  border-style: dashed;
  border-color: #c8d6e8;
  background: #fafbfc;
}

.circle-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.circle-initial {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--navy);
  color: #ffffff;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.circle-initial--muted {
  background: #c8d6e8;
  color: var(--text-secondary);
}

.circle-badges {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.badge-owner {
  background: var(--brand-blue-light);
  color: var(--brand-blue-dark);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 1rem;
}

.badge-member {
  background: #f0f0f0;
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 1rem;
}

.badge-public {
  background: #dcfce7;
  color: #166534;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 1rem;
}

.badge-private {
  background: #fef9c3;
  color: #854d0e;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 1rem;
}

.circle-card-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--navy);
  margin: 0 0 0.4rem;
}

.circle-card-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0 0 0.6rem;
  flex: 1;
}

.circle-card-date {
  font-size: 0.75rem;
  color: var(--text-muted-custom);
  margin: 0;
}

.circle-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.75rem;
}

.btn-join {
  background: var(--brand-blue);
  color: #ffffff;
  border: none;
  border-radius: 2rem;
  padding: 0.3rem 1rem;
  font-family: 'Nunito', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-join:hover {
  background: var(--brand-blue-dark);
}

/* ---------------------------------------------------------
   Section divider
   --------------------------------------------------------- */
.section-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2.5rem 0 1.5rem;
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.section-divider-label {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted-custom);
  white-space: nowrap;
}

/* ---------------------------------------------------------
   Album cards
   --------------------------------------------------------- */
.album-card-link {
  text-decoration: none;
  display: block;
  height: 100%;
}

.album-card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 0.875rem;
  overflow: hidden;
  transition: transform 0.16s, box-shadow 0.16s, border-color 0.16s;
  display: flex;
  flex-direction: column;
}

.album-card-link:hover .album-card {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(26, 39, 68, 0.1);
  border-color: var(--brand-blue);
}

.album-card-cover {
  position: relative;
  height: 160px;
  background: #e9eef5;
  overflow: hidden;
}

.album-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.album-card-link:hover .album-card-cover img {
  transform: scale(1.04);
}

.album-card-no-cover {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #adb5bd;
  font-size: 3rem;
}

.album-img-count {
  position: absolute;
  bottom: 0.5rem;
  right: 0.6rem;
  background: rgba(26, 39, 68, 0.72);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 1rem;
  backdrop-filter: blur(4px);
}

.album-card-body {
  padding: 1rem 1.25rem 1.1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.album-card-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--navy);
  margin: 0 0 0.35rem;
}

.album-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 0.5rem;
  flex: 1;
}

.album-card-date {
  font-size: 0.75rem;
  color: var(--text-muted-custom);
  margin: 0;
}

/* ---------------------------------------------------------
   Empty states
   --------------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: 3.5rem 1rem;
  color: var(--text-secondary);
}

.empty-state--small {
  padding: 2rem 1rem;
}

.empty-state-icon {
  font-size: 3rem;
  color: #c8d6e8;
  display: block;
  margin-bottom: 1rem;
}

.empty-state-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--navy);
  margin-bottom: 0.5rem;
}

.empty-state-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 360px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ---------------------------------------------------------
   Chat layout
   --------------------------------------------------------- */

/* --- Sidebar --- */
.chat-sidebar-col {
  border-right: 1px solid var(--border-color);
}

.chat-sidebar {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  padding: 0;
}

.chat-sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.chat-circle-initial {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-circle-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-circle-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-circle-desc {
  font-size: 0.72rem;
  color: var(--text-muted-custom);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-sidebar-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted-custom);
  padding: 0.85rem 1rem 0.3rem;
  margin: 0;
}

.chat-channel-list {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  padding: 0 0.5rem;
}

.chat-channel-item {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.42rem 0.6rem;
  border-radius: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background 0.13s, color 0.13s;
}

.chat-channel-item:hover {
  background: var(--body-bg);
  color: var(--navy);
}

.chat-channel-item--active {
  background: var(--brand-blue-light);
  color: var(--brand-blue-dark);
}

.chat-channel-hash {
  font-size: 0.95rem;
  opacity: 0.55;
  margin-right: 0.1rem;
}

.chat-channel-empty {
  font-size: 0.82rem;
  color: var(--text-muted-custom);
  padding: 0.5rem 0.6rem;
}

.chat-sidebar-footer {
  border-top: 1px solid var(--border-color);
  padding: 0.65rem 1rem;
}

.chat-settings-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.13s;
}

.chat-settings-link:hover {
  color: var(--navy);
}

/* --- Main panel --- */
.chat-panel {
  background: var(--surface);
}

.chat-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.chat-channel-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--navy);
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 0.1rem;
}

.chat-channel-hash-lg {
  color: var(--text-muted-custom);
  font-weight: 400;
  font-size: 1rem;
}

.chat-channel-subtitle {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin: 0.1rem 0 0;
}

/* Messages scroll pane */
#messages-scroll-pane {
  /* navbar ~60px + panel-header ~65px + panel-footer ~72px + site-footer ~72px + mt-2 + margins */
  height: calc(100vh - 350px);
  min-height: 300px;
  overflow-y: auto;
  padding: 1rem 1.25rem;
}

.chat-panel-body {
  padding: 1rem 1.25rem;
}

/* --- Chat input --- */
.chat-panel-footer {
  border-top: 1px solid var(--border-color);
  padding: 0.75rem 1.25rem;
  flex-shrink: 0;
  background: var(--surface);
}

.chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  background: var(--body-bg);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 0.4rem 0.5rem;
  transition: border-color 0.15s;
}

.chat-input-row:focus-within {
  border-color: var(--brand-blue);
}

.chat-attach-btn {
  background: none;
  border: none;
  color: var(--text-muted-custom);
  font-size: 1.05rem;
  padding: 0.2rem 0.4rem;
  border-radius: 0.4rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.13s, background 0.13s;
  line-height: 1;
}

.chat-attach-btn:hover {
  color: var(--brand-blue);
  background: var(--brand-blue-light);
}

.chat-input-field {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 0.3rem 0.2rem;
}

.chat-send-btn {
  background: var(--brand-blue);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.13s;
}

.chat-send-btn:hover {
  background: var(--brand-blue-dark);
}

/* ---------------------------------------------------------
   Chat message bubbles
   --------------------------------------------------------- */
.chat-message {
  display: flex;
  margin-bottom: 0.75rem;
}

.chat-message--mine {
  justify-content: flex-end;
}

.chat-message--other {
  justify-content: flex-start;
}

.chat-bubble {
  max-width: min(75%, 700px);
  padding: 0.6rem 0.8rem;
  border-radius: 1rem;
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  background-color: #fff;
  word-break: break-word;
}

.chat-message--mine .chat-bubble {
  background-color: #dbeafe;
  border-color: #bfdbfe;
}

.chat-message--other .chat-bubble {
  background-color: #fff;
}

.chat-bubble-meta {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
}

.chat-bubble-sender {
  font-weight: 700;
  font-size: 0.92rem;
}

.chat-bubble-time {
  color: #6c757d;
  font-size: 0.78rem;
}

.chat-bubble-delete {
  margin-left: auto;
  opacity: 0;
  color: var(--text-muted-custom);
  font-size: 0.78rem;
  line-height: 1;
  transition: opacity 0.15s ease, color 0.15s ease;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}

.chat-bubble:hover .chat-bubble-delete {
  opacity: 1;
}

.chat-bubble-delete:hover {
  color: var(--error-color);
}

.chat-bubble-content {
  white-space: pre-wrap;
}

.chat-bubble-image {
  max-height: 110px;
  max-width: 160px;
  width: 100%;
  object-fit: contain;
  border-radius: 0.5rem;
  display: block;
  margin-bottom: 0.25rem;
  cursor: zoom-in;
}

/* ---------------------------------------------------------
   Chat input editor
   --------------------------------------------------------- */
.chat-editor {
  flex: 1;
  min-height: 38px;
  max-height: 150px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  cursor: text;
  line-height: 1.5;
}

.chat-editor:empty::before {
  content: attr(data-placeholder);
  color: #6c757d;
  pointer-events: none;
}

.chat-input-thumb {
  max-height: 80px;
  max-width: 120px;
  border-radius: 4px;
  vertical-align: middle;
  margin: 2px 4px;
}

/* ---------------------------------------------------------
   Lightbox
   --------------------------------------------------------- */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  cursor: zoom-out;
}

.lightbox-overlay img {
  max-width: min(90vw, 1400px);
  max-height: 90vh;
  object-fit: contain;
  border-radius: 0.5rem;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
  cursor: default;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  color: #fff;
  font-size: 2.25rem;
  line-height: 1;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  opacity: 0.75;
}

.lightbox-close:hover {
  opacity: 1;
}

/* ---------------------------------------------------------
   Album preview card (in chat timeline)
   --------------------------------------------------------- */
.album-preview {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 0.5rem;
  padding: 0.5rem;
  margin-top: 0.25rem;
  min-width: 200px;
  max-width: 280px;
}

.album-preview-link:hover .album-preview {
  background: rgba(0, 0, 0, 0.08);
}

.album-preview-thumb {
  width: 64px;
  height: 64px;
  border-radius: 0.375rem;
  overflow: hidden;
  flex-shrink: 0;
  background: #dee2e6;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.album-preview-no-cover {
  font-size: 1.5rem;
  color: #adb5bd;
}

.album-preview-info {
  overflow: hidden;
}

.album-preview-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: #212529;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album-preview-desc {
  font-size: 0.78rem;
  color: #6c757d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album-preview-count {
  font-size: 0.75rem;
  color: #6c757d;
}

.album-preview--unavailable {
  opacity: 0.6;
}

/* ---------------------------------------------------------
   Album detail — back link & action buttons
   --------------------------------------------------------- */
.album-back-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.13s;
}

.album-back-link:hover {
  color: var(--navy);
}

.btn-album-action {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.38rem 0.9rem;
  border-radius: 2rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.13s, color 0.13s, border-color 0.13s, transform 0.13s;
}

.btn-album-action--secondary {
  background: var(--body-bg);
  color: var(--text-secondary);
  border-color: var(--border-color);
}

.btn-album-action--secondary:hover {
  background: var(--brand-blue-light);
  color: var(--brand-blue-dark);
  border-color: var(--brand-blue);
}

.btn-album-action--danger {
  background: var(--body-bg);
  color: #dc3545;
  border-color: #f5c6cb;
}

.btn-album-action--danger:hover {
  background: #fff0f0;
  border-color: #dc3545;
}

/* ---------------------------------------------------------
   Photo tiles (album detail grid)
   --------------------------------------------------------- */
.photo-tile {
  position: relative;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #e9eef5;
  aspect-ratio: 1 / 1;
}

.photo-tile-link {
  display: block;
  width: 100%;
  height: 100%;
}

.photo-tile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s;
}

.photo-tile:hover .photo-tile-img {
  transform: scale(1.04);
}

.photo-tile-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26, 39, 68, 0.72) 0%, transparent 55%);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0.5rem 0.6rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.photo-tile:hover .photo-tile-overlay {
  opacity: 1;
}

.photo-tile-caption {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 70%;
}

.photo-tile-remove {
  background: rgba(220, 53, 69, 0.85);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.13s, transform 0.13s;
}

.photo-tile-remove:hover {
  background: #dc3545;
  transform: scale(1.1);
}

.photo-tile-info {
  background: color-mix(in srgb, var(--brand-blue) 85%, transparent);
  border: none;
  color: var(--surface);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.13s, transform 0.13s;
}

.photo-tile-info:hover {
  background: var(--brand-blue-dark);
  transform: scale(1.1);
}

/* ---------------------------------------------------------
   Album detail — action panels (Share / Upload)
   --------------------------------------------------------- */
.album-panel {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 0.875rem;
  padding: 1.4rem 1.5rem;
  height: 100%;
}

.album-panel-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--navy);
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
}

.album-panel-empty {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
}

/* ---------------------------------------------------------
   Album share view — master/detail layout
   --------------------------------------------------------- */
.share-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Two-column container */
.share-layout {
  display: flex;
  gap: 0;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  overflow: hidden;
  min-height: 520px;
}

/* Left: thumbnail strip */
.share-thumb-col {
  width: 180px;
  flex-shrink: 0;
  border-right: 1px solid var(--border-color);
  background: var(--body-bg);
  align-self: stretch;
}

.share-thumb-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  overflow-y: auto;
  max-height: 680px;
}

.share-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #e9eef5;
  border: none;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  border-radius: 3px;
  outline: 3px solid transparent;
  outline-offset: -3px;
  transition: outline-color 0.15s, transform 0.15s;
}

.share-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}

.share-thumb:hover img {
  transform: scale(1.06);
}

.share-thumb--active {
  outline-color: var(--brand-blue);
}

.share-thumb-badge {
  position: absolute;
  bottom: 3px;
  right: 3px;
  background: rgba(26, 39, 68, 0.75);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.38rem;
  border-radius: 1rem;
  backdrop-filter: blur(4px);
  line-height: 1.4;
}

/* Right: detail panel */
.share-detail-col {
  flex: 1;
  min-width: 0;
}

.share-detail-panel {
  display: flex;
  flex-direction: column;
}

.share-detail-image-wrap {
  position: relative;
  background: #f0f3f7;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  max-height: 480px;
  overflow: hidden;
}

.share-detail-image-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.share-detail-image {
  display: block;
  max-width: 100%;
  max-height: 480px;
  object-fit: contain;
  cursor: zoom-in;
}

/* Zoom hint on hover */
.share-detail-zoom-hint {
  position: absolute;
  top: 0.6rem;
  right: 0.75rem;
  background: rgba(26, 39, 68, 0.55);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
}

.share-detail-image-wrap:hover .share-detail-zoom-hint {
  opacity: 1;
}

.share-image-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(26, 39, 68, 0.65), transparent);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.75rem 1rem 0.5rem;
}

/* Responsive: stack on mobile */
@media (max-width: 767px) {
  .share-layout {
    flex-direction: column;
  }

  .share-thumb-col {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .share-thumb-grid {
    grid-template-columns: repeat(4, 1fr);
    max-height: 180px;
  }

  .share-detail-image-wrap {
    max-height: 280px;
  }
}

/* ---------------------------------------------------------
   Comment thread
   --------------------------------------------------------- */
.comment-section {
  padding: 1rem 1.25rem 1.1rem;
}

.comment-count {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted-custom);
  margin-bottom: 0.75rem;
}

.comment-empty {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.comment-thread {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.comment-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.comment-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 0.72rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.comment-header {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  margin-bottom: 0.15rem;
}

.comment-author {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--navy);
}

.comment-date {
  font-size: 0.75rem;
  color: var(--text-muted-custom);
}

.comment-body {
  font-size: 0.875rem;
  color: var(--text-primary);
  line-height: 1.55;
  word-break: break-word;
}

.comment-delete-form {
  flex-shrink: 0;
}

.comment-delete-btn {
  background: none;
  border: none;
  color: var(--text-muted-custom);
  font-size: 0.72rem;
  padding: 0.2rem;
  cursor: pointer;
  border-radius: 0.3rem;
  transition: color 0.13s, background 0.13s;
}

.comment-delete-btn:hover {
  color: #dc3545;
  background: #fff0f0;
}

/* Comment input row (pill-shaped, like chat input) */
.comment-form {
  margin-top: 0.5rem;
}

.comment-input-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--body-bg);
  border: 1px solid var(--border-color);
  border-radius: 2rem;
  padding: 0.3rem 0.3rem 0.3rem 0.85rem;
  transition: border-color 0.15s;
}

.comment-input-row:focus-within {
  border-color: var(--brand-blue);
}

.comment-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: 'Nunito', sans-serif;
  font-size: 0.875rem;
  color: var(--text-primary);
  padding: 0;
}

.comment-input::placeholder {
  color: var(--text-muted-custom);
}

.comment-post-btn {
  background: var(--brand-blue);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.13s;
}

.comment-post-btn:hover {
  background: var(--brand-blue-dark);
}

/* ---------------------------------------------------------
   Auth pages (login, signup)
   --------------------------------------------------------- */
.auth-page {
  min-height: calc(100vh - 130px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
  background: linear-gradient(160deg, var(--body-bg) 0%, #dce9f8 100%);
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 1.25rem;
  padding: 2.25rem 2rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 32px rgba(26, 39, 68, 0.08);
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.auth-brand-icon {
  color: var(--brand-blue);
  font-size: 1.3rem;
  line-height: 1;
}

.auth-brand-name {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--navy);
  letter-spacing: -0.02em;
}

.auth-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.55rem;
  color: var(--navy);
  letter-spacing: -0.02em;
  margin: 0 0 0.3rem;
  text-align: center;
}

.auth-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-align: center;
  margin: 0 0 1.5rem;
  line-height: 1.5;
}

.auth-alert {
  background: #fff0f0;
  border: 1px solid #f5c6cb;
  color: #842029;
  border-radius: 0.6rem;
  padding: 0.65rem 0.9rem;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.auth-field {
  margin-bottom: 1rem;
}

.auth-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.35rem;
}

.auth-optional {
  font-weight: 400;
  color: var(--text-muted-custom);
}

.auth-input {
  display: block;
  width: 100%;
  background: var(--body-bg);
  border: 1px solid var(--border-color);
  border-radius: 0.6rem;
  padding: 0.55rem 0.75rem;
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.auth-input:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15);
}

.auth-input::placeholder {
  color: var(--text-muted-custom);
}

.auth-field-error {
  font-size: 0.78rem;
  color: #dc3545;
  margin-top: 0.3rem;
}

.auth-hint {
  font-size: 0.75rem;
  color: var(--text-muted-custom);
  margin: 0.35rem 0 0;
}

.btn-auth-submit {
  display: block;
  width: 100%;
  background: var(--navy);
  color: #ffffff;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.65rem 1rem;
  border: none;
  border-radius: 0.6rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
  margin-top: 0.5rem;
}

.btn-auth-submit:hover {
  background: var(--navy-light);
  transform: translateY(-1px);
}

.auth-footer-text {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 1.25rem 0 0;
}

.auth-link {
  color: var(--brand-blue);
  font-weight: 700;
  text-decoration: none;
}

.auth-link:hover {
  color: var(--brand-blue-dark);
  text-decoration: underline;
}

/* ---------------------------------------------------------
   Profile edit — avatar header
   --------------------------------------------------------- */
.profile-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--navy);
  color: #ffffff;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */
@media (max-width: 991px) {
  .hero-section {
    padding: 3.5rem 0 2rem;
    text-align: center;
  }

  .hero-sub {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-image {
    margin-top: 2rem;
  }

  .hero-illustration {
    max-width: 280px;
  }
}

@media (max-width: 768px) {
  .chat-bubble {
    max-width: 92%;
  }

  /* On mobile the sidebar stacks above the chat column, adding ~150px of
     extra height that the desktop calc doesn't subtract. Override so the
     pane keeps internal scrolling instead of letting the page scroll. */
  #messages-scroll-pane {
    height: calc(100vh - 500px);
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}
