/* =========================================================
   AR Tech messanger - Stylesheet
   ========================================================= */

:root {
  --primary: #123d6b;
  --primary-dark: #0d2d4d;
  --primary-light: #eaf4ff;
  --secondary: #2f6ee8;
  --secondary-soft: #ebf3ff;
  --teal: #14b8a6;
  --teal-deep: #0f766e;
  --accent: #2e9e5b;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg: #eaf3ff;
  --bg-deep: #0b1d34;
  --card: rgba(255, 255, 255, 0.9);
  --card-strong: #ffffff;
  --text: #10233f;
  --text-muted: #5c718b;
  --border: rgba(101, 135, 180, 0.18);
  --radius: 18px;
  --shadow: 0 18px 42px rgba(8, 21, 38, 0.12);
  --shadow-strong: 0 28px 65px rgba(7, 18, 33, 0.18);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(98, 155, 255, 0.26), transparent 28%),
    radial-gradient(circle at bottom right, rgba(20, 184, 166, 0.18), transparent 24%),
    linear-gradient(135deg, #eaf3ff 0%, #dfeeff 38%, #d8eaff 100%);
  color: var(--text);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

button {
  font-family: inherit;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s ease;
}
.btn-primary {
  background: linear-gradient(135deg, #1b5bb7, #0f2d51);
  color: #fff;
  box-shadow: 0 12px 22px rgba(32, 87, 173, 0.22);
}
.btn-primary:hover { background: linear-gradient(135deg, #1f68d8, #0d2540); }
.btn-outline { background: rgba(255,255,255,0.82); border: 1px solid rgba(18, 61, 107, 0.25); color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 6px; }
.btn-block { width: 100%; }
.btn-danger { background: var(--danger); color: #fff; }

/* ---------- Top nav ---------- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 12px 30px;
  background: linear-gradient(135deg, #0b1d34 0%, #0e2a4d 36%, #123d6b 100%);
  color: #fff;
  box-shadow: 0 18px 40px rgba(9, 19, 34, 0.24), inset 0 1px 0 rgba(255,255,255,0.08);
}
.topnav .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  min-width: 190px;
  white-space: nowrap;
}
.topnav .brand small {
  display: block;
  font-weight: 500;
  font-size: 11px;
  color: rgba(255,255,255,0.65);
  margin-top: 2px;
}
.topnav .brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #103d42;
  background: #bce8d9;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
}
.topnav .search {
  flex: 1;
  max-width: 380px;
  margin: 0 auto 0 0;
}
.topnav .search input {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 8px;
  background: rgba(255,255,255,0.07);
  color: #fff;
  padding: 10px 13px;
  font-size: 13px;
  outline: none;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.topnav .search input:focus { border-color: rgba(188,232,217,0.72); background: rgba(255,255,255,0.11); }
.topnav .search input::placeholder { color: rgba(255,255,255,0.62); }
.topnav .nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.topnav .nav-links a {
  color: rgba(255,255,255,0.72);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  display: flex;
  align-items: center;
  position: relative;
  padding: 10px 12px;
  border-radius: 7px;
  transition: color 0.18s ease, background 0.18s ease;
}
.topnav .nav-links a.active,
.topnav .nav-links a:hover { color: #fff; background: rgba(255,255,255,0.1); text-decoration: none; }
.topnav .nav-links a.active { color: #fff; background: rgba(188,232,217,0.14); }
.badge {
  position: absolute;
  top: -4px; right: -8px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  border-radius: 999px;
  padding: 2px 5px;
  font-weight: 700;
}
.topnav .user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
}
.topnav .user-menu img,
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
}
.topnav .user-menu .dropdown { position: relative; }
.topnav .user-menu .dropdown-content {
  display: none;
  position: absolute;
  right: 0; top: 50px;
  background: #fff;
  color: var(--text);
  border-radius: 12px;
  box-shadow: var(--shadow-strong);
  min-width: 170px;
  overflow: hidden;
  z-index: 60;
}
.topnav .user-menu .dropdown:hover .dropdown-content,
.topnav .user-menu .dropdown.open .dropdown-content { display: block; }
.topnav .user-menu .dropdown-content a {
  display: block;
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
}
.topnav .user-menu .dropdown-content a:hover { background: var(--bg); text-decoration: none; }
.topnav .topbar-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 12px;
  border-left: 1px solid rgba(255,255,255,0.18);
}
.topnav .notification { position: relative; }
.topnav .notification .bell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  font-size: 15px;
}
.topnav .user-menu .profile-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px 7px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
}
.topnav .avatar.small {
  width: 32px;
  height: 32px;
}
.topnav .datetime-pill {
  display: inline-flex;
  align-items: center;
  padding: 0 12px 0 0;
  border-right: 1px solid rgba(255,255,255,0.16);
  color: rgba(255,255,255,0.75);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 300px;
  gap: 20px;
  max-width: 1300px;
  margin: 20px auto;
  padding: 0 20px;
  align-items: start;
}
.layout.no-right { grid-template-columns: 250px minmax(0, 1fr); }
.layout.narrow { grid-template-columns: minmax(0, 1fr); max-width: 700px; }

@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar-left, .sidebar-right { display: none; }
}

.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(246,250,255,0.94));
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 16px 18px;
  backdrop-filter: blur(10px);
}

/* ---------- Left sidebar ---------- */
.sidebar-left { position: sticky; top: 74px; }
.side-menu { padding: 8px; }
.side-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
}
.side-menu a:hover, .side-menu a.active { background: var(--primary-light); text-decoration: none; color: var(--primary); }
.side-menu .icon { width: 20px; text-align: center; }

.promo-card { margin-top: 16px; overflow: hidden; padding: 0; }
.promo-card img { height: 110px; width: 100%; object-fit: cover; }
.promo-card .promo-body { padding: 14px; }
.promo-card h4 { margin: 0 0 6px; font-size: 15px; }
.promo-card p { margin: 0; font-size: 13px; color: var(--text-muted); }

.notice-card { margin-top: 16px; font-size: 13px; }
.notice-card h4 { margin: 0 0 6px; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.notice-card p { color: var(--text-muted); margin: 0; }

/* ---------- Feed / center column ---------- */
.hero-banner {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  height: 200px;
  color: #fff;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  background: linear-gradient(135deg, #12294f, #1f4c85);
}
.hero-banner img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0.75;
}
.hero-banner .hero-text {
  position: absolute; left: 24px; bottom: 20px; z-index: 2;
}
.hero-banner h1 { margin: 0 0 6px; font-size: 26px; }
.hero-banner .tags { font-size: 13px; opacity: 0.9; }

.composer { margin-bottom: 20px; }
.composer .row1 { display: flex; gap: 12px; align-items: center; }
.composer textarea {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 20px;
  padding: 12px 16px;
  font-size: 14px;
  resize: none;
  font-family: inherit;
}
.composer .row2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.composer .attach-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-muted); font-weight: 600;
  padding: 6px 10px; border-radius: 6px; cursor: pointer;
}
.composer .attach-label:hover { background: var(--bg); }
.composer .attach-options { display: flex; gap: 6px; }
.file-preview { margin-top: 10px; font-size: 13px; color: var(--accent); font-weight: 600; }

.post-card { margin-bottom: 18px; }
.post-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.post-header .who { flex: 1; }
.post-header .name { font-weight: 700; font-size: 14.5px; }
.post-header .meta { font-size: 12px; color: var(--text-muted); }
.post-header .badge-admin {
  background: var(--primary-light); color: var(--primary);
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 10px;
  margin-left: 6px; vertical-align: middle;
}
.post-content { font-size: 14.5px; line-height: 1.5; margin-bottom: 10px; white-space: pre-wrap; word-wrap: break-word; }
.post-media {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  max-height: min(70vh, 680px);
  overflow: hidden;
  border-radius: 12px;
  background: #edf1f2;
}
.post-media img, .post-media video {
  display: block;
  width: 100%;
  max-height: min(70vh, 680px);
  object-fit: contain;
  background: #101719;
}

.post-stats {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--text-muted);
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.post-actions { display: flex; padding-top: 6px; }
.post-actions button {
  flex: 1; background: none; border: none; padding: 8px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 6px; font-weight: 600; font-size: 13.5px; color: var(--text-muted);
}
.post-actions button:hover { background: var(--bg); }
.post-actions button.liked { color: var(--primary); }

/* ---------- Comment thread (private per user) ---------- */
.comment-section { margin-top: 10px; padding-top: 10px; }
.comment-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.comment-item { display: flex; gap: 8px; }
.comment-bubble {
  background: var(--bg); border-radius: 14px; padding: 8px 12px; font-size: 13.5px;
  max-width: 100%;
}
.comment-bubble.from-admin { background: var(--primary-light); }
.comment-name { font-weight: 700; font-size: 12.5px; margin-bottom: 2px; }
.comment-name .tag { font-size: 10px; color: var(--primary); font-weight: 700; margin-left: 4px; }
.comment-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.comment-form { display: flex; gap: 8px; align-items: center; }
.comment-form input {
  flex: 1; border: 1px solid var(--border); background: var(--bg);
  border-radius: 20px; padding: 8px 14px; font-size: 13.5px; font-family: inherit;
}
.private-note {
  font-size: 11.5px; color: var(--text-muted); margin: 6px 0 8px;
  display: flex; align-items: center; gap: 5px;
}

/* ---------- Right sidebar / chat ---------- */
.sidebar-right { position: sticky; top: 74px; display: flex; flex-direction: column; gap: 16px; }
.panel-title { font-size: 15px; font-weight: 700; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.trend-item, .online-item, .group-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.trend-item .tag { font-weight: 700; font-size: 13.5px; color: var(--primary); }
.trend-item .count { font-size: 12px; color: var(--text-muted); }
.group-item .info { flex: 1; }
.group-item .gname { font-weight: 600; font-size: 13.5px; }
.group-item .gmeta { font-size: 11.5px; color: var(--text-muted); }
.online-item .status-dot { width: 9px; height: 9px; border-radius: 50%; background: #2e9e5b; border: 2px solid #fff; margin-left: -14px; margin-top: 20px; }
.online-item .uname { font-weight: 600; font-size: 13.5px; }
.online-item .umeta { font-size: 11.5px; color: var(--text-muted); }

.chat-widget { display: flex; flex-direction: column; height: 460px; padding: 0; overflow: hidden; }
.chat-header {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  border-bottom: 1px solid var(--border); font-weight: 700; font-size: 14.5px;
}
.chat-header .status { font-size: 11.5px; font-weight: 400; color: var(--accent); }
.chat-body { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; background: #fbfcfd; }
.chat-msg { max-width: 78%; padding: 9px 13px; border-radius: 16px; font-size: 13.5px; line-height: 1.4; }
.chat-msg .chat-time { display:block; font-size: 10.5px; opacity: 0.7; margin-top: 3px;}
.chat-msg.mine { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.theirs { align-self: flex-start; background: var(--bg); color: var(--text); border-bottom-left-radius: 4px; }
.chat-empty { color: var(--text-muted); font-size: 13px; text-align: center; margin-top: 40px; }
.chat-footer { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); }
.chat-footer input {
  flex: 1; border: 1px solid var(--border); border-radius: 20px; padding: 9px 14px;
  font-size: 13.5px; font-family: inherit;
}
.chat-footer button {
  background: var(--primary); color: #fff; border: none; width: 36px; height: 36px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px;
}

.chat-launcher-wrap {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 999;
}

.chat-launcher {
  width: 58px;
  height: 58px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #0f5fe0, #4ec5f9);
  color: #fff;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 18px 40px rgba(15, 95, 224, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 48px rgba(15, 95, 224, 0.35);
}

.chat-popup {
  position: absolute;
  right: 0;
  bottom: 72px;
  width: min(360px, calc(100vw - 32px));
  height: min(500px, calc(100vh - 130px));
  min-height: 280px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 24px 50px rgba(18, 35, 70, 0.22);
  overflow: hidden;
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.chat-launcher-wrap.open .chat-popup {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.chat-popup .chat-header {
  flex-shrink: 0;
  padding-right: 12px;
}

.chat-popup-heading {
  min-width: 0;
  flex: 1;
}

.chat-popup-heading strong {
  display: block;
  font-size: 15px;
  color: var(--text);
}

.chat-popup .chat-close {
  flex-shrink: 0;
}

.chat-popup .chat-body {
  min-height: 0;
  flex: 1;
}

.chat-popup .chat-footer {
  flex-shrink: 0;
}

.chat-popup-notice {
  margin: auto 16px;
  padding: 14px;
  border-radius: 12px;
  background: #edf4ff;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.chat-popup-notice a {
  color: var(--primary);
  font-weight: 700;
}

body.member-app .chat-launcher-wrap .chat-popup {
  height: min(500px, calc(100vh - 130px));
}

@media (max-width: 480px) {
  .chat-launcher-wrap {
    right: 16px;
    bottom: 16px;
  }

  .chat-launcher {
    width: 54px;
    height: 54px;
  }

  .chat-popup {
    bottom: 66px;
  }
}

/* ---------- Admin dashboard redesign ---------- */
body {
  background:
    radial-gradient(circle at top left, rgba(118, 166, 255, 0.12), transparent 28%),
    linear-gradient(180deg, #eff4fa 0%, #edf3f8 100%);
}

.admin-shell {
  display: flex;
  min-height: calc(100vh - 78px);
  max-width: 1600px;
  margin: 0 auto;
  padding: 18px 20px 28px;
  gap: 20px;
}

.admin-sidebar {
  position: sticky;
  top: 92px;
  align-self: flex-start;
  width: 250px;
  min-width: 250px;
  background: linear-gradient(180deg, rgba(10, 21, 35, 0.96), rgba(11, 36, 61, 0.94));
  border: 1px solid rgba(160, 197, 255, 0.1);
  border-radius: 26px;
  box-shadow: 0 26px 55px rgba(8, 18, 33, 0.22), inset 0 1px 0 rgba(255,255,255,0.07);
  padding: 22px 16px 18px;
  color: #eaf3ff;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  margin-bottom: 18px;
}

.admin-brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(69, 132, 255, 0.35), rgba(20, 184, 166, 0.28));
  font-size: 22px;
}

.admin-brand strong {
  display: block;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.admin-brand span {
  display: block;
  color: rgba(219, 233, 255, 0.72);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  color: rgba(227, 236, 248, 0.82);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.admin-nav-item:hover,
.admin-nav-item.active {
  background: linear-gradient(135deg, rgba(58, 122, 232, 0.32), rgba(20, 184, 166, 0.18));
  color: #fff;
  text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(166, 200, 255, 0.2), 0 10px 22px rgba(20, 84, 166, 0.12);
}

.admin-nav-item .icon {
  width: 18px;
  text-align: center;
  font-size: 16px;
}

.admin-sidebar-footer {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.12);
}

.system-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  color: rgba(227, 236, 248, 0.8);
  font-size: 12px;
  font-weight: 700;
}

.system-badge .indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 5px rgba(52, 211, 153, 0.15);
}

.admin-main {
  flex: 1;
  min-width: 0;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 22px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  margin-bottom: 22px;
}

.admin-topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.admin-search {
  position: relative;
  flex: 1;
  max-width: 520px;
}

.admin-search input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f7f9fc;
  color: var(--text);
  padding: 11px 16px 11px 42px;
  font-size: 14px;
  outline: none;
}

.admin-search .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}

.admin-topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
}

.icon-btn .badge {
  position: absolute;
  right: -2px;
  top: -2px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.admin-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 8px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.admin-profile .avatar {
  width: 34px;
  height: 34px;
}

.admin-profile strong {
  display: block;
  font-size: 13px;
  color: var(--text);
}

.admin-profile span {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

.topbar-date {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 170px;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #edf5ff, #eafaf9);
  border: 1px solid rgba(18, 90, 155, 0.12);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding: 8px 4px;
}

.dashboard-header h1 {
  margin: 0;
  font-size: clamp(1.9rem, 2.8vw, 2.6rem);
  line-height: 1.1;
  color: var(--text);
  letter-spacing: -0.04em;
}

.dashboard-header p {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

.header-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.soft-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.12);
  font-size: 12px;
  font-weight: 700;
}

.soft-pill.success { background: rgba(16, 185, 129, 0.08); color: var(--teal-deep); }
.soft-pill.warning { background: rgba(245, 158, 11, 0.08); color: #a16207; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.stats-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 16px;
  border-radius: 20px;
  min-height: 118px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.stats-card.small-card {
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.stats-card .stats-text {
  min-width: 0;
}

.stats-card small {
  display: block;
  color: rgba(17, 24, 39, 0.62);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.stats-card strong {
  display: block;
  font-size: clamp(1.4rem, 1.8vw, 2rem);
  color: #0E213C;
  line-height: 1.1;
}

.stats-card .trend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--teal-deep);
}

.stats-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3);
}

.accent-blue .stats-icon { background: linear-gradient(135deg, #dbeafe, #bfdbfe); }
.accent-green .stats-icon { background: linear-gradient(135deg, #d1fae5, #a7f3d0); }
.accent-violet .stats-icon { background: linear-gradient(135deg, #e9d5ff, #ddd6fe); }
.accent-teal .stats-icon { background: linear-gradient(135deg, #ccfbf1, #99f6e4); }
.accent-amber .stats-icon { background: linear-gradient(135deg, #fef3c7, #fde68a); }
.accent-navy .stats-icon { background: linear-gradient(135deg, #dbeafe, #c7d2fe); }

.accent-blue { background: linear-gradient(135deg, #eff6ff, #ffffff); }
.accent-green { background: linear-gradient(135deg, #f0fdf4, #ffffff); }
.accent-violet { background: linear-gradient(135deg, #f5f3ff, #ffffff); }
.accent-teal { background: linear-gradient(135deg, #ecfeff, #ffffff); }
.accent-amber { background: linear-gradient(135deg, #fff7ed, #ffffff); }
.accent-navy { background: linear-gradient(135deg, #eef6ff, #ffffff); }

.overview-grid,
.info-grid {
  display: grid;
  grid-template-columns: 1.5fr 0.9fr;
  gap: 18px;
  margin-bottom: 20px;
}

.panel {
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(246,250,255,0.94));
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 20px 20px 18px;
  backdrop-filter: blur(10px);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-header h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text);
}

.panel-header .panel-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #edf5ff;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
}

.chart-wrap {
  height: 260px;
  position: relative;
}

.donut-wrap {
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.legend-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
}

.legend-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-value {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

.data-table th,
.data-table td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.data-table th {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: #f8fafc;
}

.data-table td {
  color: var(--text);
}

.customer-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.customer-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.status-badge.pending { background: rgba(245, 158, 11, 0.1); color: #b45309; }
.status-badge.shipped { background: rgba(59, 130, 246, 0.1); color: var(--secondary); }
.status-badge.completed { background: rgba(16, 185, 129, 0.1); color: var(--teal-deep); }
.status-badge.danger { background: rgba(239, 68, 68, 0.12); color: #b91c1c; }

.activity-list-modern {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-item-modern {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 10px;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fafc, #f2f7ff);
  border: 1px solid var(--border);
}

.activity-item-modern .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #14b8a6);
  margin-top: 5px;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.activity-copy strong {
  display: block;
  font-size: 13px;
  color: var(--text);
}

.activity-copy p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.low-stock-table td:last-child,
.low-stock-table th:last-child { text-align: right; }

.warning-text {
  color: #b45309;
  font-weight: 700;
}

.alert-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.alert-pill.warning {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
}

.feed-panel {
  margin-top: 20px;
}

.posts-wrap {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

@media (max-width: 1360px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1120px) {
  .topnav { gap: 12px; padding-right: 20px; padding-left: 20px; }
  .topnav .brand { min-width: auto; }
  .topnav .search { max-width: 260px; }
  .topnav .nav-links { gap: 0; }
  .topnav .nav-links a { padding-right: 9px; padding-left: 9px; }
  .topnav .topbar-meta { gap: 8px; }

  .admin-shell {
    flex-direction: column;
    padding-top: 14px;
  }

  .admin-sidebar {
    position: static;
    width: 100%;
    min-width: 100%;
  }

  .admin-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-grid,
  .info-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topnav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 12px 16px;
  }

  .topnav .brand {
    grid-column: 1;
    grid-row: 1;
    min-width: auto;
  }

  .topnav .search {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    max-width: none;
    margin: 0;
  }

  .topnav .nav-links {
    grid-column: 1 / -1;
    grid-row: 3;
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
  }

  .topnav .topbar-meta {
    grid-column: 2;
    grid-row: 1;
    border-left: none;
    padding-left: 0;
    margin-left: 0;
  }

  .topnav .datetime-pill {
    display: none;
  }

  .topnav .notification .bell {
    width: 32px;
    height: 32px;
  }

  .admin-topbar {
    flex-wrap: wrap;
    padding: 14px 16px;
  }

  .admin-topbar-right {
    width: 100%;
    justify-content: space-between;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-badges {
    justify-content: flex-start;
  }


@media (max-width: 400px) {
  .topnav { padding-right: 12px; padding-left: 12px; }
  .topnav .brand { gap: 8px; font-size: 14px; }
  .topnav .brand-icon { width: 36px; height: 36px; }
  .topnav .notification { display: none; }
  .topnav .user-menu .profile-box { padding: 5px; }
  .topnav .user-menu .profile-box > div,
  .topnav .user-menu .profile-box > span { display: none !important; }
}
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-nav {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .admin-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .panel,
  .admin-topbar,
  .admin-sidebar {
    border-radius: 18px;
  }
}

/* ---------- Auth pages ---------- */
.auth-wrap {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at top left, rgba(160, 220, 255, 0.38), transparent 28%),
    radial-gradient(circle at bottom right, rgba(67, 147, 255, 0.25), transparent 30%),
    linear-gradient(135deg, #061a35 0%, #0c2d57 20%, #0d3d79 45%, #1467b7 100%);
  padding: 24px;
  overflow: hidden;
}
.auth-wrap::before {
  content: "";
  position: absolute;
  inset: -18% -10% auto auto;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: rgba(118, 206, 255, 0.15);
  filter: blur(18px);
  transform: rotate(18deg);
}
.auth-wrap::after {
  content: "";
  position: absolute;
  inset: auto auto -22% -14%;
  width: 480px; height: 480px;
  border-radius: 50%;
  background: rgba(54, 112, 255, 0.12);
  filter: blur(24px);
}
.auth-scene {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.shape {
  position: absolute;
  border-radius: 38% 62% 64% 36% / 46% 43% 57% 54%;
  background: linear-gradient(135deg, rgba(130, 201, 255, 0.45), rgba(27, 83, 181, 0.18));
  box-shadow: inset -12px -10px 24px rgba(11, 29, 54, 0.15), 0 18px 35px rgba(10, 39, 82, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(4px);
  animation: floatShape 13s ease-in-out infinite;
}
.shape-one {
  width: 240px; height: 240px; top: 10%; right: 12%;
}
.shape-two {
  width: 220px; height: 220px; bottom: 12%; left: 8%;
  animation-delay: 2.5s;
}
.shape-three {
  width: 180px; height: 180px; top: 42%; left: 20%;
  animation-delay: 5s;
}
@keyframes floatShape {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(0, -18px, 20px) rotate(8deg); }
}
.auth-card {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3), 0 12px 22px rgba(12, 55, 112, 0.14);
  width: 100%; max-width: 430px; padding: 34px 32px;
}
.auth-card::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto 1px;
  height: 32%;
  border-radius: 24px 24px 18px 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.76), rgba(255,255,255,0));
  pointer-events: none;
}
.auth-card .brand-row { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 6px; position: relative; z-index: 1; text-align: center; }
.auth-card .brand-row .brand-icon {
  width: 42px; height: 42px; background: linear-gradient(135deg, #dfeeff, #bfd9ff); border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 8px 18px rgba(27, 87, 171, 0.2);
}
.auth-card h1 { font-size: 20px; margin: 0; }
.auth-card p.sub { color: var(--text-muted); font-size: 13.5px; margin: 4px 0 22px; position: relative; z-index: 1; }
.form-group { margin-bottom: 16px; position: relative; z-index: 1; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-group input, .form-group textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; font-family: inherit; background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 2px 4px rgba(9, 28, 58, 0.04);
}
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(31, 108, 202, 0.12); }
.auth-switch { text-align: center; margin-top: 18px; font-size: 13.5px; color: var(--text-muted); position: relative; z-index: 1; }
.alert { padding: 10px 14px; border-radius: 8px; font-size: 13.5px; margin-bottom: 16px; position: relative; z-index: 1; }
.alert-error { background: #fdeaea; color: var(--danger); }
.alert-success { background: #e8f7ee; color: var(--accent); }
.demo-creds { margin-top: 18px; background: var(--bg); border-radius: 8px; padding: 10px 14px; font-size: 12px; color: var(--text-muted); position: relative; z-index: 1; }
.demo-creds strong { color: var(--text); }

/* ---------- Admin dashboard extras ---------- */
.page-title { font-size: 20px; font-weight: 700; margin: 4px 0 18px; }
.members-panel {
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(247,250,255,0.96));
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 20px;
}
.member-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}
.user-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f6fbff 100%);
  border: 1px solid rgba(148,163,184,0.16);
  box-shadow: 0 10px 20px rgba(15,23,42,0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.user-list-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(15,23,42,0.06);
  border-color: rgba(37,99,235,0.2);
}
.user-list-item .info { flex: 1; min-width: 0; }
.user-list-item .uname {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
.user-list-item .uemail {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}
.user-list-item .member-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.user-list-item .badge-admin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: rgba(34, 197, 94, 0.12);
  color: var(--accent);
}
.user-list-item .badge-admin.blocked {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs a {
  padding: 10px 16px; font-size: 13.5px; font-weight: 600; color: var(--text-muted);
  border-bottom: 2px solid transparent;
}
.tabs a.active { color: var(--primary); border-color: var(--primary); }
.thread-user-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border-radius: 16px; background: var(--bg); font-size: 12.5px; font-weight: 600;
  margin: 3px 4px 3px 0; cursor: pointer; border: 1px solid transparent;
}
.thread-user-pill.active { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 38px; margin-bottom: 10px; }

@media (max-width: 980px) {
  .admin-shell {
    flex-direction: column;
    padding: 16px;
  }

  .admin-sidebar {
    width: 100%;
    min-width: 100%;
    position: static;
  }

  .user-list-item {
    flex-wrap: wrap;
  }

  .user-list-item .member-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

.grid-media {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px;
}
.grid-media .thumb { border-radius: 8px; overflow: hidden; aspect-ratio: 1; background: #eee; }
.grid-media .thumb img, .grid-media .thumb video { width: 100%; height: 100%; object-fit: cover; }

.social-shell {
  max-width: 1320px;
  margin: 26px auto 40px;
  padding: 0 18px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 280px;
  gap: 20px;
  align-items: start;
}

.social-sidebar,
.social-rail,
.social-feed {
  min-width: 0;
}

.profile-card-modern,
.menu-card-modern,
.mini-card-modern,
.post-card-modern,
.feed-hero-modern,
.notice-modern,
.empty-feed-state {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.profile-card-modern {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
}

.profile-cover {
  height: 80px;
  background: linear-gradient(135deg, #0d223d 0%, #1d4e89 38%, #1ea6a3 100%);
  background-position: center;
  background-size: cover;
}

.profile-body {
  position: relative;
  padding: 0 18px 18px;
  margin-top: -26px;
}

.avatar-xl {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
  display: block;
}

.profile-body h2 {
  margin: 14px 0 4px;
  font-size: 20px;
  color: var(--text);
}

.profile-role {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  background: #edf5ff;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
}

.profile-photo-form {
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
}

.profile-photo-form label,
.profile-photo-form button {
  border: 0;
  border-radius: 6px;
  padding: 6px 8px;
  background: rgba(15, 35, 48, 0.82);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.profile-photo-form label:hover,
.profile-photo-form button:hover {
  background: #e46f4f;
}

.profile-photo-form input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.profile-photo-form:focus-within label {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.profile-cover-form {
  position: absolute;
  top: 10px;
  right: 10px;
}

.profile-body .avatar-xl {
  object-fit: cover;
}

.profile-avatar-form {
  position: absolute;
  top: 48px;
  left: 92px;
}

.profile-photo-form button {
  background: #176b76;
}

.photo-adjust-dialog {
  width: min(460px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100% - 32px);
  padding: 22px;
  border: 1px solid #dbe5e7;
  border-radius: 16px;
  color: #20363d;
  box-shadow: 0 18px 60px rgba(15, 35, 48, 0.28);
}

.photo-adjust-dialog::backdrop {
  background: rgba(12, 29, 39, 0.65);
}

.photo-adjust-dialog h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.photo-adjust-dialog > p:not(.photo-adjust-error) {
  margin: 0 0 16px;
  color: #647a80;
  font-size: 13px;
}

.photo-adjust-dialog canvas {
  display: block;
  width: 100%;
  max-height: 260px;
  margin-bottom: 16px;
  border-radius: 8px;
  background: #eaf0f1;
  object-fit: contain;
}

.photo-adjust-control {
  display: grid;
  gap: 5px;
  margin: 12px 0;
  font-size: 12px;
  font-weight: 700;
}

.photo-adjust-control input {
  width: 100%;
  accent-color: #176b76;
}

.photo-adjust-error {
  margin: 10px 0;
  color: #b42318;
  font-size: 13px;
}

.photo-adjust-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.photo-adjust-actions button {
  border: 0;
  border-radius: 7px;
  padding: 9px 12px;
  background: #edf2f3;
  color: #20363d;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.photo-adjust-actions .photo-adjust-apply {
  background: #176b76;
  color: #fff;
}

.photo-adjust-actions button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.menu-card-modern,
.mini-card-modern {
  border-radius: 18px;
  padding: 12px;
  margin-top: 18px;
}

.nav-link-modern {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  border-radius: 12px;
  color: var(--text);
  font-weight: 600;
  transition: all 0.2s ease;
}

.nav-link-modern:hover,
.nav-link-modern.active {
  background: var(--primary-light);
  color: var(--primary);
  text-decoration: none;
}

.feed-hero-modern {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-radius: 20px;
  padding: 22px 24px;
  margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(13, 34, 61, 0.96), rgba(28, 78, 143, 0.9));
  color: #fff;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.16);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.feed-hero-modern h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.privacy-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  font-size: 12px;
  font-weight: 700;
}

.notice-modern {
  margin-bottom: 18px;
  border-radius: 18px;
  padding: 16px 18px;
}

.notice-modern h4 {
  margin: 0 0 8px;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.notice-modern p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.post-card-modern {
  border-radius: 22px;
  padding: 18px 20px 14px;
  margin-bottom: 18px;
}

.post-header-modern {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.who-modern { flex: 1; }

.name-modern {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

.meta-modern {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

.meta-modern span {
  color: var(--primary);
  font-weight: 600;
}

.privacy-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.08);
  color: var(--teal-deep);
  font-size: 11px;
  font-weight: 700;
}

.post-content-modern {
  margin: 8px 0 14px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  word-wrap: break-word;
}

.post-media-modern {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  overflow: hidden;
  background: #edf1f2;
  border: 1px solid var(--border);
}

.post-media-modern img,
.post-media-modern video {
  display: block;
  width: 100%;
  max-height: min(70vh, 680px);
  object-fit: contain;
  background: #101719;
}

.empty-feed-state {
  border-radius: 22px;
  padding: 38px 26px;
  text-align: center;
}

.empty-feed-state .icon {
  font-size: 42px;
  margin-bottom: 12px;
}

.empty-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.empty-feed-state p {
  margin: 0;
  color: var(--text-muted);
}

.mini-card-modern h3 {
  margin: 0 0 12px;
  font-size: 15px;
}

.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

.stat-row:first-of-type {
  border-top: none;
}

.stat-row strong {
  color: var(--text);
}

.mini-card-modern p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 13px;
}

@media (max-width: 1100px) {
  .social-shell {
    grid-template-columns: 1fr;
  }

  .social-sidebar,
  .social-rail {
    order: 2;
  }

  .social-feed {
    order: 1;
  }
}

@media (max-width: 640px) {
  .feed-hero-modern {
    flex-direction: column;
    align-items: flex-start;
  }

  .post-card-modern {
    padding: 16px 14px 12px;
  }
}

.community-layout {
  max-width: 1420px;
  grid-template-columns: 230px minmax(0, 1fr) 310px;
  gap: 22px;
  margin-top: 24px;
  margin-bottom: 40px;
}

.community-layout .sidebar-left,
.community-layout .sidebar-right {
  position: sticky;
  top: 88px;
}

.member-panel {
  overflow: hidden;
  padding: 0;
}

.member-panel-profile {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
}

.member-panel-profile .avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
}

.member-panel-profile strong,
.member-panel-profile span {
  display: block;
  overflow-wrap: anywhere;
}

.member-panel-profile strong {
  font-size: 13px;
}

.member-panel-profile span {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 11px;
}

.member-panel .side-menu {
  padding: 10px;
  box-shadow: none;
}

.community-layout .notice-card {
  padding: 16px;
  line-height: 1.55;
}

.community-layout .notice-card h4 {
  margin-bottom: 8px;
}

.member-composer {
  border: 1px solid var(--border);
}

.member-composer .row2 {
  gap: 10px;
  flex-wrap: wrap;
}

.audience-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.audience-select {
  min-height: 36px;
  max-width: 180px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.community-info-count {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 28px;
  font-weight: 750;
}

.community-info-count span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.community-info p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
}

@media (max-width: 1080px) {
  .community-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  .community-layout .sidebar-left {
    display: block;
    position: static;
    grid-column: 1 / -1;
  }

  .community-layout .sidebar-right {
    display: block;
    position: static;
  }

  .member-panel {
    display: flex;
    align-items: center;
  }

  .member-panel-profile {
    border-right: 1px solid var(--border);
    border-bottom: 0;
  }

  .member-panel .side-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
  }
}

@media (max-width: 760px) {
  .community-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    margin-top: 14px;
    padding: 0 12px;
  }

  .community-layout .sidebar-left {
    grid-column: auto;
  }

  .community-layout .sidebar-right {
    grid-column: auto;
  }

  .member-panel {
    display: block;
  }

  .member-panel-profile {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .member-panel .side-menu {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }

  .member-panel .side-menu a {
    justify-content: center;
    gap: 6px;
    padding: 10px 6px;
    font-size: 12px;
  }

  .audience-control {
    margin-left: 0;
  }
}

footer.site-footer { text-align: center; padding: 20px; color: var(--text-muted); font-size: 12.5px; }

/* ---------- Member workspace theme ---------- */
body.member-app {
  --primary: #12d8f2;
  --primary-dark: #00b8d5;
  --primary-light: rgba(18, 216, 242, 0.12);
  --secondary: #23c8ec;
  --secondary-soft: rgba(35, 200, 236, 0.12);
  --teal: #19d7cc;
  --teal-deep: #55e5db;
  --accent: #38dba4;
  --bg: #04172d;
  --card: #082543;
  --text: #e4f2ff;
  --text-muted: #9bb2cc;
  --border: rgba(93, 176, 222, 0.2);
  --radius: 12px;
  --shadow: 0 12px 28px rgba(0, 7, 20, 0.24);
  --shadow-strong: 0 18px 48px rgba(0, 7, 20, 0.42);
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 52% -20%, rgba(0, 140, 202, 0.2), transparent 42%),
    #04172d;
  color: var(--text);
}

body.member-app a { color: var(--primary); }
body.member-app .topnav {
  min-height: 58px;
  padding: 7px 26px;
  gap: 20px;
  background: rgba(3, 22, 43, 0.97);
  border-bottom: 1px solid rgba(18, 216, 242, 0.24);
  box-shadow: 0 8px 24px rgba(0, 8, 22, 0.3);
}
body.member-app .topnav .brand { min-width: 215px; font-size: 15px; }
body.member-app .topnav .brand-icon {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(18, 216, 242, 0.45);
  border-radius: 10px;
  color: #b8f8ff;
  background: rgba(5, 131, 177, 0.18);
  box-shadow: 0 0 18px rgba(18, 216, 242, 0.14), inset 0 0 12px rgba(18, 216, 242, 0.08);
}
body.member-app .topnav .brand small { color: #9bb2cc; }
body.member-app .topnav .search { max-width: 370px; }
body.member-app .topnav .search input {
  border-color: rgba(87, 167, 222, 0.24);
  border-radius: 18px;
  background: #0a2d52;
  color: #e4f2ff;
}
body.member-app .topnav .search input:focus {
  border-color: rgba(18, 216, 242, 0.7);
  background: #0b345d;
}
body.member-app .topnav .search input::placeholder { color: #93acc7; }
body.member-app .topnav .nav-links { gap: 8px; }
body.member-app .topnav .nav-links a {
  min-height: 38px;
  gap: 7px;
  color: #b3c5db;
  border-radius: 8px;
}
body.member-app .topnav .nav-links a.active,
body.member-app .topnav .nav-links a:hover {
  color: var(--primary);
  background: rgba(18, 216, 242, 0.08);
}
body.member-app .topnav .nav-links a.active::after {
  content: "";
  position: absolute;
  height: 2px;
  left: 12px;
  right: 12px;
  bottom: 0;
  background: var(--primary);
  box-shadow: 0 0 10px rgba(18, 216, 242, 0.8);
}
body.member-app .topnav .nav-icon { font-size: 17px; line-height: 1; }
body.member-app .topnav .topbar-meta { border-color: var(--border); }
body.member-app .topnav .user-menu .profile-box {
  border-color: transparent;
  background: transparent;
}
body.member-app .topnav .user-menu .profile-box:hover { background: rgba(255,255,255,0.06); }
body.member-app .topnav .user-menu .dropdown-content {
  border: 1px solid var(--border);
  background: #092746;
}
body.member-app .topnav .user-menu .dropdown-content a { color: var(--text); }
body.member-app .topnav .user-menu .dropdown-content a:hover { background: #103758; }

body.member-app .community-layout {
  grid-template-columns: 232px minmax(0, 1fr) 310px;
  gap: 18px;
  max-width: 1420px;
  margin-top: 16px;
  padding-right: 24px;
  padding-left: 24px;
}
body.member-app .community-layout .card,
body.member-app .post-card,
body.member-app .empty-state {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(150deg, rgba(9, 43, 75, 0.98), rgba(5, 31, 57, 0.98));
  box-shadow: 0 10px 24px rgba(0, 7, 20, 0.22);
}
body.member-app .member-panel-profile {
  min-height: 72px;
  padding: 12px;
  background:
    radial-gradient(circle at 90% 40%, rgba(18, 216, 242, 0.14), transparent 35%),
    #082543;
  border-bottom-color: var(--border);
}
body.member-app .member-panel-profile .avatar,
body.member-app .composer .avatar,
body.member-app .post-header .avatar,
body.member-app .chat-header .avatar {
  border: 1px solid rgba(18, 216, 242, 0.42);
  background: #0a4a78;
}
body.member-app .member-panel-profile strong { color: #eef8ff; }
body.member-app .member-panel .side-menu { background: transparent; }
body.member-app .side-menu a {
  color: #b7cbe0;
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
}
body.member-app .side-menu a:hover,
body.member-app .side-menu a.active {
  color: var(--primary);
  background: rgba(18, 216, 242, 0.13);
  box-shadow: inset 3px 0 #12d8f2;
}
body.member-app .community-layout .notice-card {
  border-color: rgba(18, 216, 242, 0.16);
  background: #07213d;
}
body.member-app .community-layout .notice-card h4 { color: #dffaff; }
body.member-app .community-layout .notice-card p { color: #a9bfd5; }
body.member-app .hero-banner {
  height: 128px;
  margin-bottom: 12px;
  border: 1px solid rgba(18, 216, 242, 0.28);
  border-radius: 12px;
  box-shadow: 0 0 26px rgba(0, 194, 233, 0.08);
}
body.member-app .hero-banner img { opacity: 0.58; }
body.member-app .hero-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 24, 48, 0.92), rgba(3, 50, 83, 0.44) 66%, rgba(0, 206, 224, 0.12));
}
body.member-app .hero-banner .hero-text { left: 20px; bottom: 16px; }
body.member-app .hero-banner h1 {
  max-width: 450px;
  margin-bottom: 5px;
  font-size: 21px;
  line-height: 1.12;
}
body.member-app .hero-banner .tags { font-size: 11px; color: #c7e3f7; }
body.member-app .hero-banner .tags span { color: var(--primary); padding: 0 3px; }
body.member-app .member-composer { margin-bottom: 12px; padding: 12px 14px; }
body.member-app .composer textarea {
  min-height: 40px;
  border: 1px solid rgba(99, 171, 217, 0.24);
  border-radius: 18px;
  background: #0a2d52;
  color: var(--text);
}
body.member-app .composer textarea::placeholder { color: #8faac5; }
body.member-app .composer .row2 {
  margin-top: 8px;
  padding-top: 8px;
  border-top-color: rgba(99, 171, 217, 0.18);
}
body.member-app .composer .attach-label { color: #a9c4dc; }
body.member-app .composer .attach-label:hover { background: rgba(18, 216, 242, 0.08); }
body.member-app .audience-control { color: #b5cbe0; }
body.member-app .audience-select {
  border-color: rgba(99, 171, 217, 0.28);
  background: #0a2d52;
  color: #e2f2ff;
}
body.member-app .member-composer .btn-primary,
body.member-app .comment-form .btn-primary {
  border-radius: 8px;
  background: #12d8f2;
  color: #03233a;
  font-weight: 750;
}
body.member-app .member-composer .btn-primary:hover,
body.member-app .comment-form .btn-primary:hover { background: #64edfa; }
body.member-app .private-note { color: #9cb5ce; }
body.member-app .post-card { margin-bottom: 12px; padding: 14px; }
body.member-app .post-header { margin-bottom: 10px; }
body.member-app .post-header .name { color: #f1f8ff; }
body.member-app .post-header .meta { color: #92adc8; }
body.member-app .post-header .badge-admin {
  border: 1px solid rgba(18, 216, 242, 0.3);
  background: rgba(18, 216, 242, 0.1);
  color: #4be7f4;
}
body.member-app .post-content { color: #d7e7f6; }
body.member-app .post-media { border: 1px solid var(--border); border-radius: 8px; }
body.member-app .post-stats { border-bottom-color: var(--border); color: #acc1d7; }
body.member-app .post-actions button { color: #a9bfd6; }
body.member-app .post-actions button:hover { background: rgba(18, 216, 242, 0.08); color: var(--primary); }
body.member-app .post-actions button.liked { color: var(--primary); }
body.member-app .comment-section { border-top: 1px solid rgba(99, 171, 217, 0.15); }
body.member-app .comment-bubble,
body.member-app .comment-bubble.from-admin { background: #0a2d52; color: #d5e8f7; }
body.member-app .comment-name { color: #ecf7ff; }
body.member-app .comment-time { color: #8faac5; }
body.member-app .comment-form input {
  border-color: rgba(99, 171, 217, 0.25);
  background: #0a2d52;
  color: var(--text);
}
body.member-app .comment-form input::placeholder { color: #8faac5; }
body.member-app .chat-widget { height: 260px; }
body.member-app .chat-header {
  border-bottom-color: var(--border);
  background: #092746;
  color: #e9f5ff;
}
body.member-app .chat-body { background: #061d37; }
body.member-app .chat-msg.theirs { background: #0c3459; color: #dceeff; }
body.member-app .chat-msg.mine { background: #0c7195; color: #f0fdff; }
body.member-app .chat-empty { color: #a0bad2; }
body.member-app .chat-footer { border-top-color: var(--border); background: #082543; }
body.member-app .chat-footer input {
  border-color: rgba(99, 171, 217, 0.24);
  background: #0a2d52;
  color: var(--text);
}
body.member-app .chat-footer input::placeholder { color: #8faac5; }
body.member-app .chat-footer button {
  background: #12d8f2;
  color: #03233a;
  box-shadow: 0 0 14px rgba(18, 216, 242, 0.28);
}
body.member-app .community-info {
  border-color: rgba(18, 216, 242, 0.2);
  background: linear-gradient(145deg, #092b4b, #061d37);
}
body.member-app .community-info .panel-title { color: #e7f6ff; }
body.member-app .community-info-count { color: #e8f4ff; }
body.member-app .community-info-count span,
body.member-app .community-info p { color: #9db6cf; }
body.member-app .site-footer { color: #809ab5; }
body.member-app .social-shell .profile-card-modern,
body.member-app .social-shell .menu-card-modern,
body.member-app .social-shell .mini-card-modern,
body.member-app .social-shell .post-card-modern,
body.member-app .social-shell .notice-modern,
body.member-app .social-shell .empty-feed-state {
  border-color: var(--border);
  background: linear-gradient(150deg, #092b4b, #061d37);
  color: var(--text);
}
body.member-app .social-shell .profile-body h2,
body.member-app .social-shell .name-modern,
body.member-app .social-shell .empty-title,
body.member-app .social-shell .mini-card-modern h3 { color: #eaf6ff; }
body.member-app .social-shell .post-content-modern { color: #d1e1f0; }
body.member-app .social-shell .nav-link-modern { color: #b5cbe0; }
body.member-app .social-shell .nav-link-modern:hover,
body.member-app .social-shell .nav-link-modern.active {
  background: rgba(18, 216, 242, 0.12);
  color: var(--primary);
}
body.member-app .social-shell .stat-row { border-top-color: var(--border); color: #a8bfd5; }
body.member-app .social-shell .stat-row strong { color: #e5f3ff; }
body.member-app .social-shell .notice-modern p,
body.member-app .social-shell .mini-card-modern p,
body.member-app .social-shell .empty-feed-state p { color: #a8bfd5; }
body.member-app .social-shell .privacy-tag,
body.member-app .social-shell .privacy-badge {
  border-color: rgba(18, 216, 242, 0.24);
  background: rgba(18, 216, 242, 0.1);
  color: #79e9f4;
}

@media (max-width: 1080px) {
  body.member-app .community-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}

@media (max-width: 760px) {
  body.member-app .topnav {
    flex-wrap: wrap;
    padding: 8px 12px;
    gap: 8px;
  }
  body.member-app .topnav .brand { min-width: auto; }
  body.member-app .topnav .search { order: 4; flex: 1 0 100%; max-width: none; }
  body.member-app .topnav .search input { padding: 8px 12px; }
  body.member-app .topnav .nav-links { margin-left: auto; gap: 0; }
  body.member-app .topnav .nav-links a { padding: 8px; font-size: 12px; }
  body.member-app .topnav .topbar-meta { padding-left: 6px; gap: 4px; }
  body.member-app .topnav .datetime-pill { display: none; }
  body.member-app .topnav .user-menu .profile-box > div,
  body.member-app .topnav .user-menu .profile-box > span { display: none !important; }
  body.member-app .topnav .user-menu .profile-box .profile-copy { display: block !important; }
  body.member-app .topnav .user-menu .profile-box .profile-copy span + span { display: none !important; }
  body.member-app .community-layout { grid-template-columns: minmax(0, 1fr); }
  body.member-app .hero-banner { height: 145px; }
  body.member-app .hero-banner h1 { max-width: 330px; font-size: 19px; }
}

/* ---------- Field journal visual system ---------- */
:root {
  --primary: #174f43;
  --primary-dark: #103b33;
  --primary-light: #e4eee5;
  --secondary: #d66a3d;
  --secondary-soft: #f8e9dc;
  --teal: #247d78;
  --teal-deep: #1d5e5a;
  --accent: #63844c;
  --bg: #f1f2e9;
  --bg-deep: #142c28;
  --card: #fffef9;
  --card-strong: #ffffff;
  --text: #1b302c;
  --text-muted: #697a70;
  --border: #dce2d6;
  --radius: 8px;
  --shadow: 0 8px 24px rgba(25, 49, 39, 0.07);
  --shadow-strong: 0 18px 44px rgba(19, 43, 34, 0.18);
}

body {
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background-color: #f1f2e9;
  background-image:
    linear-gradient(rgba(47, 85, 66, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 85, 66, 0.035) 1px, transparent 1px),
    radial-gradient(ellipse at 15% 0%, rgba(223, 230, 207, 0.7), transparent 38%);
  background-size: 28px 28px, 28px 28px, auto;
  color: var(--text);
}

h1, h2, h3, h4, .hero-banner h1, .dashboard-header h1 {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0;
}

a { color: var(--primary); }

.btn-primary {
  background: var(--primary);
  box-shadow: none;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { border-color: #c9d4c8; color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }

.topnav {
  min-height: 68px;
  padding: 10px clamp(16px, 3vw, 42px);
  background: #173a32;
  box-shadow: 0 4px 18px rgba(20, 45, 37, 0.16);
}
.topnav .brand { font-family: Georgia, "Times New Roman", serif; font-size: 17px; }
.topnav .brand small {
  color: #b4c9b4;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.topnav .brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: #e7a259;
  color: #193a31;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  box-shadow: none;
}
.topnav .search input {
  border-color: rgba(227, 239, 221, 0.18);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
}
.topnav .search input:focus { border-color: #e7a259; background: rgba(255, 255, 255, 0.12); }
.topnav .search input::placeholder { color: #b4c9b4; }
.topnav .nav-links a { border-radius: 4px; }
.topnav .nav-links a.active,
.topnav .nav-links a:hover { background: rgba(255, 255, 255, 0.09); }
.topnav .nav-links a.active { box-shadow: inset 0 -2px #e7a259; }
.topnav .user-menu .dropdown-content { border: 1px solid var(--border); border-radius: 6px; }

body.member-app {
  --primary: #174f43;
  --primary-dark: #103b33;
  --primary-light: #e4eee5;
  --secondary: #d66a3d;
  --secondary-soft: #f8e9dc;
  --teal: #247d78;
  --teal-deep: #1d5e5a;
  --accent: #63844c;
  --bg: #f1f2e9;
  --card: #fffef9;
  --text: #1b302c;
  --text-muted: #697a70;
  --border: #dce2d6;
  --shadow: 0 8px 24px rgba(25, 49, 39, 0.07);
  --shadow-strong: 0 18px 44px rgba(19, 43, 34, 0.18);
  min-height: 100vh;
  background-color: #f1f2e9;
  background-image:
    linear-gradient(rgba(47, 85, 66, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 85, 66, 0.035) 1px, transparent 1px),
    radial-gradient(ellipse at 15% 0%, rgba(223, 230, 207, 0.7), transparent 38%);
  background-size: 28px 28px, 28px 28px, auto;
  color: var(--text);
}
body.member-app a { color: var(--primary); }
body.member-app .topnav {
  background: #173a32;
  border-bottom: 3px solid #d66a3d;
  box-shadow: 0 4px 18px rgba(20, 45, 37, 0.16);
}
body.member-app .topnav .brand-icon {
  border: 0;
  border-radius: 6px;
  background: #e7a259;
  color: #193a31;
  box-shadow: none;
}
body.member-app .topnav .brand small { color: #b4c9b4; }
body.member-app .topnav .search input {
  border-color: rgba(227, 239, 221, 0.18);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
  color: #f6f6e9;
}
body.member-app .topnav .search input:focus { border-color: #e7a259; background: rgba(255, 255, 255, 0.12); }
body.member-app .topnav .search input::placeholder { color: #b4c9b4; }
body.member-app .topnav .nav-links a { border-radius: 4px; color: #d5e0d2; }
body.member-app .topnav .nav-links a.active,
body.member-app .topnav .nav-links a:hover { color: #fffef9; background: rgba(255, 255, 255, 0.08); }
body.member-app .topnav .nav-links a.active { box-shadow: inset 0 -2px #e7a259; }
body.member-app .topnav .nav-links a.active::after { display: none; }
body.member-app .topnav .topbar-meta { border-color: rgba(227, 239, 221, 0.2); }
body.member-app .topnav .user-menu .dropdown-content { border: 1px solid var(--border); background: #fffef9; }
body.member-app .topnav .user-menu .dropdown-content a { color: var(--text); }
body.member-app .topnav .user-menu .dropdown-content a:hover { background: #edf1e8; }

body.member-app .community-layout {
  grid-template-columns: 220px minmax(0, 1fr) 270px;
  gap: 22px;
  max-width: 1370px;
  margin-top: 26px;
  padding-right: 28px;
  padding-left: 28px;
}
body.member-app .community-layout .card,
body.member-app .post-card,
body.member-app .empty-state {
  border: 1px solid #dce2d6;
  border-radius: 6px;
  background: #fffef9;
  box-shadow: 0 5px 18px rgba(25, 49, 39, 0.055);
}
body.member-app .member-panel-profile {
  min-height: 76px;
  background: #e8eee3;
  border-bottom: 1px solid #dce2d6;
}
body.member-app .member-panel-profile .avatar,
body.member-app .composer .avatar,
body.member-app .post-header .avatar,
body.member-app .chat-header .avatar {
  border: 2px solid #f0c28c;
  background: #d9e4d6;
}
body.member-app .member-panel-profile strong { color: #1b302c; }
body.member-app .side-menu a { color: #52675c; border-radius: 4px; }
body.member-app .side-menu a:hover,
body.member-app .side-menu a.active {
  color: #174f43;
  background: #e7eee4;
  box-shadow: inset 3px 0 #d66a3d;
}
body.member-app .community-layout .notice-card {
  border-color: #e5d8c6;
  background: #f7f0e4;
}
body.member-app .community-layout .notice-card h4 { color: #573f2e; }
body.member-app .community-layout .notice-card p { color: #766351; }
body.member-app .hero-banner {
  height: 178px;
  margin-bottom: 18px;
  border: 0;
  border-radius: 6px;
  background-color: #173a32;
  background-image:
    linear-gradient(rgba(227, 239, 221, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(227, 239, 221, 0.07) 1px, transparent 1px),
    linear-gradient(112deg, #173a32 0%, #28594a 68%, #a45b37 100%);
  background-size: 26px 26px, 26px 26px, auto;
  box-shadow: 0 8px 24px rgba(22, 45, 35, 0.13);
}
body.member-app .hero-banner img { display: none; }
body.member-app .hero-banner::after {
  background: linear-gradient(90deg, rgba(18, 48, 40, 0.9), rgba(27, 62, 48, 0.55) 58%, rgba(192, 119, 57, 0.16));
}
body.member-app .hero-banner .hero-text { left: 24px; bottom: 22px; }
body.member-app .hero-banner h1 {
  max-width: 520px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 27px;
  line-height: 1.1;
}
body.member-app .hero-banner .tags { color: #e4e8d7; font-size: 12px; }
body.member-app .hero-banner .tags span { color: #f0b36b; }
body.member-app .member-composer { margin-bottom: 18px; padding: 16px; }
body.member-app .composer textarea {
  min-height: 48px;
  border: 1px solid #dce2d6;
  border-radius: 4px;
  background: #f8f8f1;
  color: var(--text);
}
body.member-app .composer textarea::placeholder { color: #78877b; }
body.member-app .composer .row2 { border-top-color: #e7e9df; }
body.member-app .composer .attach-label { color: #486458; }
body.member-app .composer .attach-label:hover { background: #edf1e8; }
body.member-app .audience-control { color: #78877b; }
body.member-app .audience-select {
  border-color: #dce2d6;
  border-radius: 4px;
  background: #f8f8f1;
  color: var(--text);
}
body.member-app .member-composer .btn-primary,
body.member-app .comment-form .btn-primary {
  border-radius: 4px;
  background: #174f43;
  color: #fffef9;
}
body.member-app .member-composer .btn-primary:hover,
body.member-app .comment-form .btn-primary:hover { background: #103b33; }
body.member-app .private-note { color: #79877b; }
body.member-app .post-card { margin-bottom: 18px; padding: 18px; }
body.member-app .post-header { margin-bottom: 14px; }
body.member-app .post-header .name { color: #1b302c; }
body.member-app .post-header .meta { color: #77867a; }
body.member-app .post-header .badge-admin {
  border: 1px solid #e8d3bc;
  background: #fbf1e4;
  color: #a2542f;
}
body.member-app .post-content { color: #30473e; line-height: 1.65; }
body.member-app .post-media { border: 1px solid #dce2d6; border-radius: 4px; }
body.member-app .post-stats { border-bottom-color: #e7e9df; color: #718176; }
body.member-app .post-actions button { color: #62756a; }
body.member-app .post-actions button:hover { background: #edf1e8; color: #174f43; }
body.member-app .post-actions button.liked { color: #d66a3d; }
body.member-app .comment-section { border-top: 1px solid #e7e9df; }
body.member-app .comment-bubble,
body.member-app .comment-bubble.from-admin { background: #eef1e9; color: #30473e; }
body.member-app .comment-name { color: #1b302c; }
body.member-app .comment-time { color: #849087; }
body.member-app .comment-form input {
  border-color: #dce2d6;
  border-radius: 4px;
  background: #fffef9;
  color: var(--text);
}
body.member-app .comment-form input::placeholder { color: #849087; }
body.member-app .chat-header { border-bottom-color: #dce2d6; background: #e8eee3; color: #1b302c; }
body.member-app .chat-body { background: #f7f7ef; }
body.member-app .chat-msg.theirs { background: #e7eee4; color: #30473e; }
body.member-app .chat-msg.mine { background: #1d6557; color: #fffef9; }
body.member-app .chat-empty { color: #79877b; }
body.member-app .chat-footer { border-top-color: #dce2d6; background: #fffef9; }
body.member-app .chat-footer input { border-color: #dce2d6; background: #f8f8f1; color: var(--text); }
body.member-app .chat-footer input::placeholder { color: #849087; }
body.member-app .chat-footer button { background: #d66a3d; color: #fff; box-shadow: none; }
body.member-app .community-info { border-color: #dce2d6; background: #fffef9; }
body.member-app .community-info .panel-title { color: #1b302c; }
body.member-app .community-info-count { color: #174f43; font-family: Georgia, "Times New Roman", serif; }
body.member-app .community-info-count span,
body.member-app .community-info p { color: #697a70; }
body.member-app .site-footer { color: #78877b; }

body.member-app .social-shell .profile-card-modern,
body.member-app .social-shell .menu-card-modern,
body.member-app .social-shell .mini-card-modern,
body.member-app .social-shell .post-card-modern,
body.member-app .social-shell .notice-modern,
body.member-app .social-shell .empty-feed-state {
  border-color: #dce2d6;
  border-radius: 6px;
  background: #fffef9;
  color: var(--text);
  box-shadow: 0 5px 18px rgba(25, 49, 39, 0.055);
}
body.member-app .social-shell .profile-cover { background: #1d6557; }
body.member-app .social-shell .profile-body h2,
body.member-app .social-shell .name-modern,
body.member-app .social-shell .empty-title,
body.member-app .social-shell .mini-card-modern h3 { color: #1b302c; }
body.member-app .social-shell .post-content-modern { color: #30473e; }
body.member-app .social-shell .nav-link-modern { color: #52675c; }
body.member-app .social-shell .nav-link-modern:hover,
body.member-app .social-shell .nav-link-modern.active { background: #e7eee4; color: #174f43; }
body.member-app .social-shell .stat-row { border-top-color: #e7e9df; color: #697a70; }
body.member-app .social-shell .stat-row strong { color: #1b302c; }
body.member-app .social-shell .notice-modern p,
body.member-app .social-shell .mini-card-modern p,
body.member-app .social-shell .empty-feed-state p { color: #697a70; }
body.member-app .social-shell .privacy-tag,
body.member-app .social-shell .privacy-badge {
  border-color: #ead3ba;
  background: #fbf1e4;
  color: #a2542f;
}

.auth-wrap {
  min-height: 100vh;
  background-color: #173a32;
  background-image:
    linear-gradient(125deg, rgba(22, 64, 52, 0.97), rgba(22, 64, 52, 0.86)),
    linear-gradient(rgba(232, 239, 222, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 239, 222, 0.08) 1px, transparent 1px);
  background-size: auto, 30px 30px, 30px 30px;
}
.auth-wrap::before,
.auth-wrap::after { display: none; }
.auth-scene { display: none; }
.auth-card {
  max-width: 440px;
  border: 1px solid rgba(255, 254, 249, 0.7);
  border-top: 4px solid #d66a3d;
  border-radius: 6px;
  background: #fffef9;
  box-shadow: 0 24px 70px rgba(9, 28, 22, 0.3);
}
.auth-card::before { display: none; }
.auth-card .brand-row .brand-icon {
  border-radius: 6px;
  background: #e7eee4;
  color: #174f43;
  box-shadow: none;
}
.auth-card h1 { color: #1b302c; font-family: Georgia, "Times New Roman", serif; font-size: 24px; }
.auth-card p.sub { color: #697a70; }
.form-group label { color: #344c41; }
.form-group input, .form-group textarea {
  border-radius: 4px;
  background: #f8f8f1;
  box-shadow: none;
}
.form-group input:focus, .form-group textarea:focus { border-color: #247d78; box-shadow: 0 0 0 3px rgba(36, 125, 120, 0.13); }
.auth-card .btn-primary { min-height: 44px; border-radius: 4px; background: #174f43; }
.auth-card .btn-primary:hover { background: #103b33; }

.admin-shell { max-width: 1500px; gap: 24px; padding: 24px 28px 34px; }
.admin-sidebar {
  width: 228px;
  min-width: 228px;
  border: 1px solid #294a40;
  border-radius: 6px;
  background: #173a32;
  box-shadow: 0 12px 30px rgba(20, 45, 37, 0.14);
}
.admin-brand-icon { border-radius: 5px; background: #e7a259; color: #193a31; }
.admin-nav { gap: 4px; }
.admin-nav-item { border-radius: 4px; }
.admin-nav-item:hover,
.admin-nav-item.active {
  background: rgba(255, 255, 255, 0.09);
  color: #fffef9;
  box-shadow: inset 3px 0 #e7a259;
}
.admin-main .panel,
.admin-main .stats-card,
.admin-main .members-panel,
.admin-main .admin-topbar {
  border: 1px solid #dce2d6;
  border-radius: 6px;
  background: #fffef9;
  box-shadow: 0 5px 18px rgba(25, 49, 39, 0.055);
}
.dashboard-header h1 { color: #1b302c; }
.dashboard-header p { color: #697a70; }
.admin-main .panel-header h3 { font-family: Georgia, "Times New Roman", serif; color: #1b302c; }

@media (max-width: 1080px) {
  body.member-app .community-layout { grid-template-columns: minmax(0, 1fr) 270px; }
}

@media (max-width: 760px) {
  .topnav { border-bottom-width: 2px; }
  body.member-app .community-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    margin-top: 14px;
    padding-right: 14px;
    padding-left: 14px;
  }
  body.member-app .hero-banner { height: 158px; }
  body.member-app .hero-banner .hero-text { left: 16px; bottom: 15px; }
  body.member-app .hero-banner h1 { max-width: 330px; font-size: 22px; }
  body.member-app .post-card { padding: 14px; }
  .admin-shell { padding: 12px; gap: 12px; }
  .admin-sidebar { border-radius: 5px; }
  .auth-card { margin: 20px; padding: 28px 22px; }
}

@media (prefers-reduced-motion: no-preference) {
  body.member-app .community-feed > *,
  body.member-app .social-feed > * {
    animation: journal-arrive 420ms ease both;
  }
  body.member-app .community-feed > *:nth-child(2),
  body.member-app .social-feed > *:nth-child(2) { animation-delay: 70ms; }
  body.member-app .community-feed > *:nth-child(3),
  body.member-app .social-feed > *:nth-child(3) { animation-delay: 130ms; }
  @keyframes journal-arrive {
    from { opacity: 0; transform: translateY(7px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

/* ---------- Navigation and chat icon treatment ---------- */
.side-menu .icon,
.admin-nav-item .icon,
.nav-link-modern .icon {
  display: inline-flex;
  flex: 0 0 20px;
  align-items: center;
  justify-content: center;
  color: #d66a3d;
}
.admin-nav-item .icon { flex-basis: 18px; }
.nav-link-modern .icon { flex-basis: 18px; }
.side-menu .icon svg,
.admin-nav-item .icon svg,
.nav-link-modern .icon svg,
.chat-launcher svg,
.chat-popup .chat-close svg,
.chat-footer button svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.side-menu .icon svg,
.admin-nav-item .icon svg,
.nav-link-modern .icon svg { width: 17px; height: 17px; }
.chat-launcher {
  width: 54px;
  height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  background: #d66a3d;
  box-shadow: 0 10px 24px rgba(112, 57, 35, 0.24);
}
.chat-launcher svg { width: 23px; height: 23px; }
.chat-launcher:hover {
  background: #bf5734;
  box-shadow: 0 12px 28px rgba(112, 57, 35, 0.3);
}
.chat-popup .chat-close {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #52675c;
  cursor: pointer;
}
.chat-popup .chat-close:hover { background: #edf1e8; color: #a2542f; }
.chat-popup .chat-close svg { width: 17px; height: 17px; }
.chat-footer button {
  border-radius: 5px;
  font-size: 0;
}
.chat-footer button svg { width: 17px; height: 17px; }
body.member-app .chat-footer button { background: #d66a3d; color: #fff; }

@media (max-width: 480px) {
  .chat-launcher { width: 50px; height: 50px; }
}

/* ---------- Mineral glass member palette ---------- */
body.member-app {
  --primary: #176b76;
  --primary-dark: #124f5b;
  --primary-light: #dff2f1;
  --secondary: #e46f4f;
  --secondary-soft: #fff0e9;
  --teal: #158b87;
  --teal-deep: #126763;
  --accent: #c68c28;
  --bg: #eff4f5;
  --bg-deep: #17313a;
  --card: #ffffff;
  --card-strong: #ffffff;
  --text: #20363d;
  --text-muted: #647a80;
  --border: #dbe5e7;
  --shadow: 0 8px 24px rgba(28, 62, 70, 0.08);
  --shadow-strong: 0 18px 44px rgba(23, 49, 58, 0.18);
  background-color: #eff4f5;
  background-image:
    linear-gradient(rgba(38, 111, 119, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(38, 111, 119, 0.04) 1px, transparent 1px),
    radial-gradient(ellipse at 15% 0%, rgba(205, 237, 232, 0.72), transparent 40%);
  background-size: 28px 28px, 28px 28px, auto;
  color: #20363d;
}
body.member-app a { color: #176b76; }
body.member-app .community-layout {
  grid-template-columns: 210px minmax(0, 1fr) 250px;
  max-width: 1400px;
}
body.member-app .community-layout .card,
body.member-app .post-card,
body.member-app .empty-state {
  border-color: #dbe5e7;
  background: #ffffff;
  box-shadow: 0 7px 22px rgba(28, 62, 70, 0.07);
}
body.member-app .member-panel-profile { background: #e5f1f0; border-bottom-color: #dbe5e7; }
body.member-app .member-panel-profile strong,
body.member-app .post-header .name,
body.member-app .comment-name { color: #20363d; }
body.member-app .side-menu a { color: #536d73; }
body.member-app .side-menu a:hover,
body.member-app .side-menu a.active {
  color: #124f5b;
  background: #dff2f1;
  box-shadow: inset 3px 0 #e46f4f;
}
body.member-app .side-menu .icon { color: #e46f4f; }
body.member-app .hero-banner {
  background-color: #163e49;
  background-image:
    linear-gradient(rgba(222, 247, 241, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(222, 247, 241, 0.08) 1px, transparent 1px),
    linear-gradient(112deg, #163e49 0%, #167a7e 68%, #df8050 100%);
  box-shadow: 0 10px 28px rgba(23, 67, 74, 0.18);
}
body.member-app .hero-banner::after {
  background: linear-gradient(90deg, rgba(17, 48, 58, 0.84), rgba(22, 91, 92, 0.44) 64%, rgba(223, 128, 80, 0.12));
}
body.member-app .hero-banner .tags { color: #e0efea; }
body.member-app .hero-banner .tags span { color: #ffd176; }
body.member-app .composer textarea {
  border-color: #dbe5e7;
  background: #f7fafb;
  color: #20363d;
}
body.member-app .composer textarea::placeholder,
body.member-app .comment-form input::placeholder { color: #71868c; }
body.member-app .composer .attach-label { color: #176b76; }
body.member-app .composer .attach-label:hover { background: #eaf5f4; }
body.member-app .audience-control,
body.member-app .private-note { color: #687f85; }
body.member-app .member-composer .btn-primary,
body.member-app .comment-form .btn-primary {
  background: #176b76;
  color: #fff;
}
body.member-app .member-composer .btn-primary:hover,
body.member-app .comment-form .btn-primary:hover { background: #124f5b; }
body.member-app .post-header .meta,
body.member-app .comment-time { color: #71868c; }
body.member-app .post-header .badge-admin,
body.member-app .social-shell .privacy-tag,
body.member-app .social-shell .privacy-badge {
  border-color: #f2d5c9;
  background: #fff0e9;
  color: #b55237;
}
body.member-app .post-content,
body.member-app .social-shell .post-content-modern { color: #354d54; }
body.member-app .post-stats,
body.member-app .comment-section { border-color: #e2eaec; }
body.member-app .post-stats { color: #687f85; }
body.member-app .post-actions button { color: #5c747a; }
body.member-app .post-actions button:hover { background: #eaf5f4; color: #176b76; }
body.member-app .post-actions button.liked { color: #e46f4f; }
body.member-app .comment-bubble,
body.member-app .comment-bubble.from-admin { background: #edf4f5; color: #354d54; }
body.member-app .comment-form input,
body.member-app .chat-footer input { border-color: #dbe5e7; background: #fff; color: #20363d; }
body.member-app .chat-header { border-color: #dbe5e7; background: #e5f1f0; color: #20363d; }
body.member-app .chat-body { background: #f6f9fa; }
body.member-app .chat-msg.theirs { background: #e5f1f0; color: #354d54; }
body.member-app .chat-msg.mine { background: #176b76; color: #fff; }
body.member-app .chat-footer { border-color: #dbe5e7; background: #fff; }
body.member-app .chat-footer button,
body.member-app .chat-launcher { background: #e46f4f; }
body.member-app .chat-footer button:hover,
body.member-app .chat-launcher:hover { background: #cc5d40; }
body.member-app .social-shell .profile-card-modern,
body.member-app .social-shell .menu-card-modern,
body.member-app .social-shell .mini-card-modern,
body.member-app .social-shell .post-card-modern,
body.member-app .social-shell .notice-modern,
body.member-app .social-shell .empty-feed-state {
  border-color: #dbe5e7;
  background: #fff;
  color: #20363d;
}
body.member-app .social-shell .profile-cover { background: #176b76; }
body.member-app .social-shell .profile-body h2,
body.member-app .social-shell .name-modern,
body.member-app .social-shell .empty-title,
body.member-app .social-shell .mini-card-modern h3 { color: #20363d; }
body.member-app .social-shell .nav-link-modern { color: #536d73; }
body.member-app .social-shell .nav-link-modern:hover,
body.member-app .social-shell .nav-link-modern.active { background: #dff2f1; color: #124f5b; }
body.member-app .social-shell .nav-link-modern .icon { color: #e46f4f; }
body.member-app .social-shell .stat-row { border-color: #e2eaec; color: #647a80; }
body.member-app .social-shell .stat-row strong { color: #20363d; }
body.member-app .social-shell .notice-modern p,
body.member-app .social-shell .mini-card-modern p,
body.member-app .social-shell .empty-feed-state p { color: #647a80; }
body.member-app .chat-popup .chat-close:hover { background: #eaf5f4; color: #b55237; }

@media (max-width: 1080px) {
  body.member-app .community-layout { grid-template-columns: minmax(0, 1fr) 240px; }
}

@media (max-width: 760px) {
  body.member-app .community-layout { grid-template-columns: minmax(0, 1fr); }
}

body.member-app .product-rail {
  display: flex;
  flex-direction: column;
  align-self: start;
  gap: 12px;
  min-width: 0;
}
body.member-app .product-rail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 2px 4px;
}
body.member-app .product-rail-kicker {
  color: #e46f4f;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}
body.member-app .product-rail-heading h2 {
  margin: 4px 0 0;
  color: #20363d;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
}
body.member-app .product-rail-count {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid #c8e5e2;
  border-radius: 50%;
  background: #dff2f1;
  color: #176b76;
  font-size: 12px;
  font-weight: 800;
}
body.member-app .product-card-list { display: grid; gap: 12px; }
body.member-app .product-card {
  display: block;
  overflow: hidden;
  border: 1px solid #dbe5e7;
  border-radius: 7px;
  background: #fff;
  color: #20363d;
  box-shadow: 0 7px 22px rgba(28, 62, 70, 0.07);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
body.member-app .product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(28, 62, 70, 0.13);
  color: #20363d;
  text-decoration: none;
}
body.member-app .product-card-media {
  position: relative;
  aspect-ratio: 1.55 / 1;
  overflow: hidden;
  background: linear-gradient(135deg, #dff2f1, #fce8df);
}
body.member-app .product-card-media img,
body.member-app .product-card-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
body.member-app .product-media-type {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 4px 6px;
  border-radius: 3px;
  background: rgba(23, 49, 58, 0.82);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
body.member-app .product-card-copy { display: grid; gap: 5px; padding: 11px 12px 13px; }
body.member-app .product-card-date { color: #e46f4f; font-size: 10px; font-weight: 700; }
body.member-app .product-card-copy strong {
  display: -webkit-box;
  overflow: hidden;
  color: #20363d;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
body.member-app .product-card-copy p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: #647a80;
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
body.member-app .product-rail-empty {
  margin: 0;
  padding: 16px;
  border: 1px dashed #b9d3d6;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  color: #647a80;
  font-size: 13px;
  line-height: 1.5;
}

.product-admin-main { max-width: 1100px; }

/* ---------- Dynamic login ---------- */
.admin-shell { transition: gap 180ms ease; }
.admin-sidebar-toggle {
  display: inline-grid;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid #d6ded9;
  border-radius: 5px;
  background: #fff;
  color: #24584c;
}
.admin-sidebar-toggle:hover { background: #edf4ef; }
.admin-sidebar-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.admin-sidebar-close { display: none; }
.admin-sidebar-scrim { display: none; }
.dashboard-header { gap: 14px; }
.dashboard-header > div:first-of-type { flex: 1; }
.admin-sidebar-collapsed .admin-sidebar { width: 66px; min-width: 66px; padding-right: 8px; padding-left: 8px; }
.admin-sidebar-collapsed .admin-brand { justify-content: center; padding: 8px 0 18px; }
.admin-sidebar-collapsed .admin-brand > div,
.admin-sidebar-collapsed .admin-nav-item > span:not(.icon) { display: none; }
.admin-sidebar-collapsed .admin-nav-item { justify-content: center; padding-right: 8px; padding-left: 8px; }
.admin-sidebar-collapsed .admin-nav-item .icon { flex: 0 0 20px; }
.admin-logout { margin-top: auto; }
.admin-settings-panel,
.admin-bulk-email-panel { max-width: 900px; padding: 20px; }
.admin-settings-panel .panel-header h2,
.admin-bulk-email-panel .panel-header h2 { margin: 0; color: #20363d; font-size: 16px; }
.admin-settings-form,
.admin-bulk-email-form { display: grid; gap: 20px; }
.admin-profile-photo-field { display: flex; align-items: center; gap: 18px; padding-bottom: 20px; border-bottom: 1px solid #e2eaec; }
.admin-settings-avatar { width: 88px; height: 88px; flex: 0 0 88px; border: 1px solid #dbe5e7; border-radius: 50%; object-fit: cover; }
.admin-settings-file,
.admin-settings-fields label,
.admin-password-fields label,
.admin-bulk-email-form label { display: grid; gap: 7px; color: #344c41; font-size: 12px; font-weight: 700; }
.admin-settings-file input,
.admin-settings-fields input,
.admin-password-fields input,
.admin-bulk-email-form input,
.admin-bulk-email-form textarea { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid #d8ded5; border-radius: 4px; background: #fff; color: #20362d; font: inherit; font-weight: 400; }
.admin-settings-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.admin-settings-file small,
.admin-bulk-email-form small { color: #71868c; font-size: 11px; font-weight: 400; }
.admin-password-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 18px 0 2px; border-top: 1px solid #e2eaec; }
.admin-password-fields h3 { grid-column: 1 / -1; margin: 0; color: #20363d; font-size: 14px; }
.admin-password-fields p { grid-column: 1 / -1; margin: -9px 0 0; color: #647a80; font-size: 12px; }
.admin-settings-form > .btn { justify-self: start; min-height: 42px; }
.bulk-email-notice { margin: -4px 0 0; padding: 10px 12px; border-left: 3px solid #e46f4f; background: #fff5ef; color: #6e4939; font-size: 12px; line-height: 1.5; }
.admin-bulk-email-form { gap: 16px; }
.admin-bulk-email-form textarea { min-height: 240px; resize: vertical; line-height: 1.55; }
.admin-bulk-email-form > .btn { justify-self: start; min-height: 42px; }
.admin-bulk-email-form > .btn:disabled { cursor: not-allowed; opacity: 0.55; }
.admin-messages-layout {
  display: grid;
  grid-template-columns: minmax(230px, 290px) minmax(0, 1fr);
  min-height: min(72vh, 760px);
  max-height: 820px;
  gap: 14px;
}
.admin-conversations,
.admin-message-widget {
  min-width: 0;
  border: 1px solid #dbe5e7;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 7px 22px rgba(28, 62, 70, 0.07);
}
.admin-conversations { display: flex; flex-direction: column; overflow: hidden; }
.admin-conversations-heading { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid #e2eaec; }
.admin-conversations-heading h2 { margin: 0; color: #20363d; font-size: 15px; }
.admin-conversations-heading > span { color: #647a80; font-size: 12px; font-weight: 700; }
.admin-conversation-list { min-height: 0; overflow-y: auto; padding: 6px; }
.admin-conversation {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 66px;
  padding: 10px;
  border-radius: 5px;
  color: #20363d;
}
.admin-conversation:hover,
.admin-conversation.active { background: #eaf5f4; color: #124f5b; text-decoration: none; }
.admin-conversation-info { display: grid; flex: 1; min-width: 0; gap: 4px; }
.admin-conversation-info strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.admin-conversation-info small { color: #71868c; font-size: 11px; }
.admin-unread-count { display: grid; min-width: 22px; height: 22px; padding: 0 5px; place-items: center; border-radius: 50%; background: #e46f4f; color: #fff; font-size: 10px; font-weight: 800; }
.admin-conversations-empty { padding: 8px 10px; color: #71868c; font-size: 13px; }
.admin-message-widget { height: 100%; min-height: 0; overflow: hidden; }
.admin-message-widget .chat-header { flex: 0 0 auto; min-height: 72px; background: #fff; }
.admin-message-heading strong { color: #20363d; font-size: 14px; }
.admin-message-widget .chat-body { background: #f6f9fa; }
.admin-message-widget .chat-footer { min-height: 64px; background: #fff; }
.admin-message-widget .chat-footer input { min-height: 42px; border-radius: 5px; }
.admin-message-widget .chat-footer button { flex: 0 0 42px; width: 42px; height: 42px; border-radius: 5px; background: #176b76; }
.admin-message-placeholder { display: grid; align-content: center; justify-items: center; gap: 8px; height: 100%; padding: 24px; text-align: center; }
.admin-message-placeholder strong { color: #20363d; font-size: 16px; }
.admin-message-placeholder span { max-width: 310px; color: #647a80; font-size: 13px; line-height: 1.5; }
body.admin-messages-page .chat-launcher-wrap { display: none !important; }
@media (max-width: 1120px) {
  .admin-messages-layout { min-height: 68vh; }
}
@media (max-width: 760px) {
  body.admin-sidebar-open { overflow: hidden; }
  .admin-sidebar {
    position: fixed;
    z-index: 111;
    inset: 0 auto 0 0;
    width: min(300px, calc(100vw - 48px));
    min-width: 0;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    overflow-y: auto;
    border-radius: 0 8px 8px 0;
    transform: translateX(-105%);
    transition: transform 220ms ease;
    will-change: transform;
  }
  .admin-shell.admin-sidebar-open .admin-sidebar { transform: translateX(0); }
  .admin-sidebar-close {
    display: inline-grid;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
  }
  .admin-sidebar-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
  .admin-sidebar-scrim {
    position: fixed;
    z-index: 110;
    inset: 0;
    display: block;
    border: 0;
    background: rgba(14, 31, 28, 0.48);
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease, visibility 220ms ease;
    visibility: hidden;
  }
  .admin-shell.admin-sidebar-open .admin-sidebar-scrim { opacity: 1; pointer-events: auto; visibility: visible; }
  .admin-sidebar-collapsed .admin-sidebar { width: min(300px, calc(100vw - 48px)); min-width: 0; padding-right: 16px; padding-left: 16px; }
  .admin-sidebar-collapsed .admin-brand { justify-content: space-between; padding: 8px 10px 18px; }
  .admin-sidebar-collapsed .admin-brand > div,
  .admin-sidebar-collapsed .admin-nav-item > span:not(.icon) { display: block; }
  .admin-sidebar-collapsed .admin-nav-item { justify-content: flex-start; padding-right: 12px; padding-left: 12px; }
  .admin-nav { display: flex; grid-template-columns: none; flex-direction: column; }
  .admin-settings-fields,
  .admin-password-fields { grid-template-columns: minmax(0, 1fr); }
  .admin-profile-photo-field { align-items: flex-start; }
  .admin-messages-layout { grid-template-columns: minmax(0, 1fr); min-height: 0; max-height: none; }
  .admin-conversations { max-height: 260px; }
  .admin-message-widget { height: 65vh; min-height: 420px; }
}
@media (prefers-reduced-motion: reduce) {
  .admin-sidebar { transition-duration: 1ms; }
  .admin-sidebar-scrim { transition-duration: 1ms; }
}

body.login-page { margin: 0; background: #193a32; }
.login-wrap {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 440px);
  align-items: center;
  gap: clamp(44px, 8vw, 120px);
  padding: clamp(28px, 6vw, 88px);
  background-color: #193a32;
  background-image:
    linear-gradient(rgba(232, 239, 222, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 239, 222, 0.055) 1px, transparent 1px),
    linear-gradient(125deg, #173a32 0%, #20564b 58%, #28675c 100%);
  background-size: 32px 32px, 32px 32px, auto;
}
.login-wrap::before,
.login-wrap::after,
.login-wrap .auth-scene { display: none; }
.login-intro {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 540px;
  flex-direction: column;
  justify-content: space-between;
  color: #fffef9;
}
.login-brand { display: inline-flex; align-items: center; gap: 12px; width: fit-content; color: #fffef9; font-size: 15px; font-weight: 700; }
.login-brand:hover { color: #fffef9; text-decoration: none; }
.login-brand .brand-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 254, 249, 0.34);
  border-radius: 6px;
  background: rgba(255, 254, 249, 0.1);
  font-size: 20px;
}
.login-intro-copy { max-width: 620px; padding: 72px 0; }
.login-eyebrow { margin: 0 0 12px; color: #f0a56d; font-size: 11px; font-weight: 800; letter-spacing: 0.12em; }
.login-intro-copy h1 { margin: 0; color: #fffef9; font-family: Georgia, "Times New Roman", serif; font-size: clamp(44px, 5vw, 68px); font-weight: 500; line-height: 1.05; }
.login-intro-copy > p:last-child { max-width: 390px; margin: 22px 0 0; color: rgba(255, 254, 249, 0.76); font-size: 16px; line-height: 1.65; }
.login-note { display: flex; align-items: center; gap: 12px; color: rgba(255, 254, 249, 0.7); font-size: 12px; }
.login-note-mark { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid rgba(240, 165, 109, 0.62); color: #f0a56d; font-size: 10px; font-weight: 800; }
.login-card {
  width: 100%;
  max-width: 440px;
  margin: 0;
  padding: 38px 36px 30px;
  border: 1px solid #e0e4d8;
  border-top: 4px solid #e47b4e;
  border-radius: 6px;
  background: #fffef9;
  box-shadow: 0 28px 76px rgba(7, 27, 22, 0.28);
  animation: login-arrive 420ms ease both;
}
.login-card .brand-row { align-items: flex-start; margin-bottom: 26px; text-align: left; }
.login-card .brand-row .login-eyebrow { margin-bottom: 9px; }
.login-card h2 { margin: 0; color: #1b302c; font-family: Georgia, "Times New Roman", serif; font-size: 27px; font-weight: 500; line-height: 1.2; }
.login-subtitle { margin: 8px 0 0; color: #697a70; font-size: 13px; }
.login-card .alert { border-radius: 4px; }
.login-feedback { margin-bottom: 16px; padding: 11px 13px; border: 1px solid transparent; border-radius: 4px; font-size: 13px; line-height: 1.45; }
.login-feedback[hidden] { display: none; }
.login-feedback.is-error { border-color: #efc8bd; background: #fff0eb; color: #983d2b; }
.login-feedback.is-success { border-color: #c5dfcb; background: #edf7ee; color: #28623d; }
.login-card .form-group { margin-bottom: 19px; }
.login-card .form-group label { margin-bottom: 7px; color: #344c41; font-size: 12px; }
.login-card .form-group input { min-height: 46px; padding: 11px 13px; border-color: #d8ded5; border-radius: 4px; background: #fff; color: #20362d; }
.login-card .form-group input[aria-invalid="true"] { border-color: #c6533f; }
.login-card .form-group input:focus { border-color: #247d78; box-shadow: 0 0 0 3px rgba(36, 125, 120, 0.13); }
.field-hint { display: block; margin-top: 6px; color: #78877d; font-size: 11px; }
.password-control { position: relative; }
.password-control input { padding-right: 64px !important; }
.password-toggle { position: absolute; top: 50%; right: 8px; min-width: 44px; padding: 6px 4px; transform: translateY(-50%); border: 0; border-radius: 3px; background: transparent; color: #176b76; font-size: 12px; font-weight: 700; }
.password-toggle:hover { background: #eaf5f4; }
.login-submit { position: relative; min-height: 46px; margin-top: 3px; border-radius: 4px; background: #174f43; }
.login-submit:hover { background: #103b33; }
.login-submit:disabled { cursor: wait; opacity: 0.82; }
.button-spinner { display: none; width: 15px; height: 15px; border: 2px solid rgba(255, 255, 255, 0.42); border-top-color: #fff; border-radius: 50%; animation: login-spin 700ms linear infinite; }
.login-submit.is-loading .button-spinner { display: inline-block; }
.login-card .auth-switch { margin-top: 23px; color: #697a70; }
.login-card .auth-switch a { color: #176b76; font-weight: 700; }
.login-forgot { display: block; margin-top: 9px; color: #176b76; font-size: 12px; font-weight: 700; text-align: right; }
.login-privacy { margin: 23px 0 0; padding-top: 15px; border-top: 1px solid #e6e8df; color: #7b887e; font-size: 11px; text-align: center; }
.password-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 24px;
  background-color: #193a32;
  background-image:
    linear-gradient(rgba(232, 239, 222, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 239, 222, 0.055) 1px, transparent 1px),
    linear-gradient(125deg, #173a32 0%, #20564b 58%, #28675c 100%);
  background-size: 32px 32px, 32px 32px, auto;
}
.password-wrap .login-card { width: 100%; max-width: 440px; margin: 0; }
@keyframes login-spin { to { transform: rotate(360deg); } }
@keyframes login-arrive { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 800px) {
  .login-wrap { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 30px; padding: 28px 20px 40px; }
  .login-intro { min-height: auto; width: min(100%, 440px); }
  .login-intro-copy { padding: 48px 0 28px; }
  .login-intro-copy h1 { font-size: 44px; }
  .login-intro-copy > p:last-child { margin-top: 14px; font-size: 14px; }
  .login-note { display: none; }
  .login-card { padding: 30px 26px 24px; }
}
@media (max-width: 420px) {
  .login-wrap { padding-right: 14px; padding-left: 14px; }
  .login-intro-copy h1 { font-size: 38px; }
  .login-card { padding: 26px 20px 22px; }
  .login-card h2 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .login-card { animation: none; }
  .button-spinner { animation-duration: 1.4s; }
}
.product-upload-panel,
.product-library { margin-bottom: 26px; }
.product-upload-panel {
  border: 1px solid #dce2d6;
  border-radius: 6px;
  background: #fffef9;
  box-shadow: 0 5px 18px rgba(25, 49, 39, 0.055);
  padding: 20px;
}
.product-admin-heading { margin-bottom: 16px; }
.product-admin-heading h2 {
  margin: 4px 0 0;
  color: #1b302c;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
}
.product-upload-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.product-upload-form > label { display: grid; align-content: start; gap: 7px; color: #344c41; font-size: 13px; font-weight: 700; }
.product-upload-form > label:first-of-type,
.product-upload-form > label:nth-of-type(2) { grid-column: 1 / -1; }
.product-upload-form label > span small { color: #7b8980; font-size: 11px; font-weight: 500; }
.product-upload-form input[type="text"],
.product-upload-form textarea {
  width: 100%;
  border: 1px solid #dce2d6;
  border-radius: 4px;
  background: #f8f8f1;
  color: #20363d;
  font: inherit;
  padding: 11px 12px;
}
.product-upload-form textarea { min-height: 80px; resize: vertical; }
.product-upload-form input[type="file"] {
  width: 100%;
  border: 1px dashed #a9c8c8;
  border-radius: 4px;
  background: #f4f9f9;
  color: #536d73;
  font: inherit;
  padding: 9px;
}
.product-upload-form label > small { color: #647a80; font-size: 11px; font-weight: 500; line-height: 1.5; }
.product-upload-form .file-preview { align-self: center; color: #647a80; font-size: 12px; overflow-wrap: anywhere; }
.product-upload-form .btn { justify-self: end; border-radius: 4px; }
.admin-product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.admin-product-card {
  overflow: hidden;
  border: 1px solid #dbe5e7;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(28, 62, 70, 0.06);
}
.admin-product-card .product-card-media {
  position: relative;
  aspect-ratio: 1.55 / 1;
  overflow: hidden;
  background: linear-gradient(135deg, #dff2f1, #fce8df);
}
.admin-product-card .product-card-media img,
.admin-product-card .product-card-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.admin-product-card .product-media-type {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 4px 6px;
  border-radius: 3px;
  background: rgba(23, 49, 58, 0.82);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.admin-product-card .product-card-copy { display: grid; gap: 5px; padding: 11px 12px 13px; }
.admin-product-card .product-card-date { color: #e46f4f; font-size: 10px; font-weight: 700; }
.admin-product-card .product-card-copy strong {
  display: -webkit-box;
  overflow: hidden;
  color: #20363d;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.admin-product-card .product-card-copy p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: #647a80;
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

@media (max-width: 860px) {
  .admin-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .product-upload-form { grid-template-columns: minmax(0, 1fr); }
  .product-upload-form > label:first-of-type,
  .product-upload-form > label:nth-of-type(2) { grid-column: auto; }
  .admin-product-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Reference-style compact app bar ---------- */
.topnav {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-columns: minmax(250px, 1fr) minmax(220px, 540px) minmax(150px, 1fr);
  align-items: center;
  gap: 20px;
  min-height: 62px;
  padding: 0 16px;
  border-bottom: 1px solid #3c4240;
  background: #242827;
  color: #f2f4f1;
  box-shadow: 0 2px 10px rgba(12, 24, 20, 0.16);
}
.header-left {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}
.topnav .brand {
  display: flex;
  flex: 0 0 40px;
  min-width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  background: #d66a3d;
  color: #fffef9;
}
.brand-mark svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.header-left input {
  width: min(100%, 300px);
  height: 40px;
  border: 0;
  border-radius: 22px;
  outline: 0;
  padding: 0 16px;
  background: #3a3f3d;
  color: #f5f5f1;
  font: inherit;
  font-size: 14px;
}
.header-left input::placeholder { color: #c0c6c1; }
.header-left input:focus { box-shadow: 0 0 0 2px #7aa18e; }
.topnav .nav-links {
  display: flex;
  height: 62px;
  align-items: stretch;
  justify-content: center;
  gap: 8px;
  margin: 0;
}
.topnav .nav-links a {
  position: relative;
  display: grid;
  width: min(100%, 92px);
  min-width: 58px;
  height: 100%;
  place-items: center;
  padding: 0 16px;
  border-radius: 0;
  color: #b9bfbb;
  transition: color 150ms ease, background 150ms ease;
}
.topnav .nav-links a svg,
.header-action svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.topnav .nav-links a:hover,
.topnav .nav-links a.active {
  color: #f7f8f5;
  background: transparent;
}
.topnav .nav-links a.active::after {
  content: "";
  position: absolute;
  right: 6px;
  bottom: 0;
  left: 6px;
  height: 3px;
  background: #80ad91;
}
.header-tools {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}
.header-dropdown,
.header-profile-dropdown { position: relative; }
.header-action,
.header-profile {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #3a3f3d;
  color: #e4e8e4;
  cursor: pointer;
  text-decoration: none;
}
.header-action:hover,
.header-profile:hover { background: #4a514d; text-decoration: none; }
.header-action svg { width: 20px; height: 20px; }
.header-profile {
  border: 2px solid #738f7b;
  background: #d9e4d7;
  color: #244638;
  font-weight: 700;
  font-size: 16px;
  overflow: hidden;
  padding: 0;
}
.header-profile img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}
.topnav .header-dropdown .dropdown-content,
.topnav .header-profile-dropdown .dropdown-content {
  display: none;
  position: absolute;
  z-index: 100;
  top: 48px;
  right: 0;
  min-width: 180px;
  overflow: hidden;
  border: 1px solid #dce2d6;
  border-radius: 6px;
  background: #fffef9;
  box-shadow: 0 14px 30px rgba(13, 31, 23, 0.2);
}
.topnav .header-dropdown.open .dropdown-content,
.topnav .header-profile-dropdown.open .dropdown-content { display: block; }
.topnav .header-dropdown .dropdown-content a,
.topnav .header-profile-dropdown .dropdown-content a {
  display: block;
  padding: 11px 14px;
  color: #1b302c;
  font-size: 13px;
  text-decoration: none;
}
.topnav .header-dropdown .dropdown-content a:hover,
.topnav .header-profile-dropdown .dropdown-content a:hover { background: #edf1e8; }

@media (max-width: 900px) {
  .topnav {
    grid-template-columns: minmax(180px, 1fr) minmax(190px, 1.3fr) auto;
    gap: 12px;
    padding: 0 12px;
  }
  .header-left input { width: min(100%, 240px); }
  .topnav .nav-links { gap: 0; }
  .topnav .nav-links a { min-width: 52px; padding: 0 12px; }
  .header-tools { gap: 6px; }
}

@media (max-width: 640px) {
  .topnav {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 56px 48px;
    gap: 0 8px;
    min-height: 104px;
    padding: 0 10px;
  }
  .header-left { gap: 8px; }
  .topnav .brand,
  .brand-mark { width: 36px; height: 36px; }
  .topnav .brand { flex-basis: 36px; min-width: 36px; }
  .header-left input { width: 100%; height: 36px; font-size: 13px; }
  .topnav .nav-links {
    grid-column: 1 / -1;
    grid-row: 2;
    height: 48px;
    justify-content: space-evenly;
  }
  .topnav .nav-links a { width: 33.333%; max-width: 110px; min-width: 0; }
  .topnav .nav-links a svg { width: 21px; height: 21px; }
  .header-tools { grid-column: 2; grid-row: 1; }
  .header-action,
  .header-profile { width: 36px; height: 36px; flex-basis: 36px; }
}

@media (max-width: 380px) {
  .topnav { padding-right: 8px; padding-left: 8px; }
  .header-tools { gap: 4px; }
  .header-action,
  .header-profile { width: 33px; height: 33px; flex-basis: 33px; }
  .header-action svg { width: 18px; height: 18px; }
}

body.member-app .topnav {
  display: grid;
  grid-template-columns: minmax(330px, 1fr) minmax(250px, 540px) minmax(150px, 1fr);
  height: 62px;
  min-height: 62px;
  gap: 20px;
  padding: 0 16px;
  border: 0;
  border-bottom: 1px solid #3c4240;
  background: #242827;
  box-shadow: 0 2px 10px rgba(12, 24, 20, 0.16);
}
body.member-app .topnav .brand {
  width: 40px;
  min-width: 40px;
  height: 40px;
  flex: 0 0 40px;
  padding: 0;
}
body.member-app .topnav .nav-links {
  height: 62px;
  margin: 0;
  gap: 8px;
  justify-content: center;
}
body.member-app .topnav .nav-links a {
  display: grid;
  width: min(100%, 92px);
  min-width: 58px;
  height: 100%;
  padding: 0 16px;
  border-radius: 0;
  color: #b9bfbb;
  background: transparent;
}
body.member-app .topnav .nav-links a.active,
body.member-app .topnav .nav-links a:hover {
  color: #f7f8f5;
  background: transparent;
}
body.member-app .topnav .nav-links a.active::after {
  display: block;
  right: 6px;
  bottom: 0;
  left: 6px;
  height: 3px;
  background: #80ad91;
  box-shadow: none;
}
body.member-app .header-search {
  position: relative;
  display: flex;
  width: min(100%, 300px);
  height: 40px;
  align-items: center;
}
body.member-app .header-search .search-submit {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  display: grid;
  width: 38px;
  height: 100%;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #c0c6c1;
  cursor: pointer;
}
body.member-app .header-search .search-submit:hover { color: #fff; }
body.member-app .header-search .search-submit svg {
  position: static;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
body.member-app .header-search input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 38px;
  border: 0;
  border-radius: 22px;
  outline: 0;
  background: #3a3f3d;
  color: #f5f5f1;
  font: inherit;
  font-size: 14px;
}
body.member-app .header-search input::placeholder { color: #c0c6c1; }
body.member-app .header-search input:focus { box-shadow: 0 0 0 2px #7aa18e; }

@media (max-width: 900px) {
  body.member-app .topnav {
    grid-template-columns: minmax(220px, 1fr) minmax(200px, 1.2fr) auto;
    gap: 12px;
    padding: 0 12px;
  }
  body.member-app .header-search { width: min(100%, 240px); }
  body.member-app .topnav .nav-links { gap: 0; }
  body.member-app .topnav .nav-links a { min-width: 52px; padding: 0 12px; }
}

@media (max-width: 640px) {
  body.member-app .topnav {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 56px 48px;
    gap: 0 8px;
    height: 104px;
    min-height: 104px;
    padding: 0 10px;
  }
  body.member-app .topnav .brand,
  body.member-app .brand-mark { width: 36px; height: 36px; }
  body.member-app .topnav .brand { flex-basis: 36px; min-width: 36px; }
  body.member-app .header-search { width: 100%; height: 36px; }
  body.member-app .header-search input { height: 36px; font-size: 13px; }
  body.member-app .topnav .nav-links {
    grid-column: 1 / -1;
    grid-row: 2;
    height: 48px;
    justify-content: space-evenly;
  }
  body.member-app .topnav .nav-links a { width: 33.333%; max-width: 110px; min-width: 0; }
  body.member-app .topnav .nav-links a svg { width: 21px; height: 21px; }
  body.member-app .header-tools { grid-column: 2; grid-row: 1; }
  body.member-app .header-action,
  body.member-app .header-profile { width: 36px; height: 36px; flex-basis: 36px; }
}

@media (max-width: 380px) {
  body.member-app .topnav { padding-right: 8px; padding-left: 8px; }
  body.member-app .header-tools { gap: 4px; }
  body.member-app .header-action,
  body.member-app .header-profile { width: 33px; height: 33px; flex-basis: 33px; }
}

.search-page {
  width: min(100%, 1120px);
  min-height: calc(100vh - 140px);
  margin: 36px auto 56px;
  padding: 0 28px;
  color: var(--text);
}
.search-page-heading {
  margin-bottom: 24px;
  padding: 12px 0 20px;
  border-bottom: 1px solid var(--border);
}
.search-page-heading h1 {
  margin: 7px 0 5px;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.search-page-heading p { margin: 0; color: var(--text-muted); font-size: 13px; }
.search-result-section { margin: 0 0 28px; }
.search-result-section > h2 {
  margin: 0 0 13px;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
}
.search-post-list { display: grid; gap: 12px; }
.search-post-result,
.search-product-result {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-strong);
  box-shadow: 0 6px 20px rgba(28, 62, 70, 0.06);
}
.search-post-result { padding: 17px 19px; }
.search-result-copy > span { color: var(--text-muted); font-size: 11px; font-weight: 700; }
.search-result-copy h3 { margin: 8px 0; color: var(--text); font-size: 17px; }
.search-result-copy p { margin: 9px 0 12px; color: var(--text); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.search-result-copy a { color: var(--primary); font-size: 12px; font-weight: 700; }
.search-result-copy a:hover { color: var(--secondary); }
.search-product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.search-result-media { aspect-ratio: 16 / 9; overflow: hidden; background: linear-gradient(135deg, #dff2f1, #fff0e9); }
.search-result-media img,
.search-result-media video { display: block; width: 100%; height: 100%; object-fit: cover; }
.search-product-result .search-result-copy { padding: 13px 15px 15px; }
.search-empty {
  margin: 0;
  padding: 22px;
  border: 1px dashed #b9d3d6;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}
body.member-app .search-page { color: #20363d; }
body.member-app .search-page-heading h1,
body.member-app .search-result-section > h2,
body.member-app .search-result-copy h3 { color: #20363d; }
body.member-app .search-post-result,
body.member-app .search-product-result { border-color: #dbe5e7; background: #fff; }
body.member-app .search-result-copy a { color: #176b76; }
body.member-app .search-result-copy a:hover { color: #e46f4f; }
.header-search {
  position: relative;
  display: flex;
  flex: 0 1 300px;
  width: min(100%, 300px);
  height: 40px;
  align-items: center;
}
.header-search .search-submit {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  display: grid;
  width: 38px;
  height: 100%;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #c0c6c1;
  cursor: pointer;
}
.header-search .search-submit:hover { color: #fff; }
.header-search .search-submit svg {
  position: static;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.header-search input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 38px;
  border: 0;
  border-radius: 22px;
  outline: 0;
  background: #3a3f3d;
  color: #f5f5f1;
  font: inherit;
  font-size: 14px;
}
.header-search input::placeholder { color: #c0c6c1; }
.header-search input:focus { box-shadow: 0 0 0 2px #7aa18e; }
@media (max-width: 640px) {
  .header-search { width: 100%; height: 36px; }
  .header-search input { height: 36px; font-size: 13px; }
  .search-page { margin-top: 24px; padding: 0 15px; }
  .search-page-heading h1 { font-size: 25px; }
  .search-post-result { padding: 14px; }
  .search-product-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Responsive post presentation ---------- */
body.member-app .post-card,
body.member-app .post-card-modern {
  min-width: 0;
  overflow: hidden;
}

body.member-app .post-header .who,
body.member-app .who-modern {
  min-width: 0;
}

body.member-app .post-header .avatar {
  flex: 0 0 34px;
}

body.member-app .post-header .name,
body.member-app .name-modern,
body.member-app .post-header .meta,
body.member-app .meta-modern {
  overflow-wrap: anywhere;
}

body.member-app .post-content,
body.member-app .post-content-modern {
  overflow-wrap: anywhere;
  word-break: normal;
}

body.member-app .post-media,
body.member-app .post-media-modern {
  width: 100%;
  max-height: min(75vh, 720px);
  background: #101719;
}

body.member-app .post-media img,
body.member-app .post-media video,
body.member-app .post-media-modern img,
body.member-app .post-media-modern video {
  width: 100%;
  height: auto;
  max-height: min(75vh, 720px);
  object-fit: contain;
}

body.member-app .post-actions button {
  min-width: 0;
  min-height: 44px;
}

body.member-app .comment-bubble {
  min-width: 0;
  overflow-wrap: anywhere;
}

body.member-app .comment-form input {
  min-width: 0;
  min-height: 44px;
}

body.member-app .comment-form .btn {
  min-height: 44px;
}

@media (max-width: 600px) {
  body.member-app .social-shell {
    margin-top: 14px;
    padding-right: 12px;
    padding-left: 12px;
  }

  body.member-app .post-card-modern {
    padding: 15px 14px;
    border-radius: 10px;
  }

  body.member-app .post-header-modern {
    flex-wrap: wrap;
    gap: 9px;
  }

  body.member-app .privacy-badge {
    margin-left: auto;
  }

  body.member-app .post-media,
  body.member-app .post-media-modern {
    max-height: 70vh;
    border-radius: 8px;
  }

  body.member-app .post-media img,
  body.member-app .post-media video,
  body.member-app .post-media-modern img,
  body.member-app .post-media-modern video {
    max-height: 70vh;
  }

  body.member-app .post-actions button {
    padding: 8px 4px;
    font-size: 12px;
  }
}

@media (max-width: 380px) {
  body.member-app .post-card,
  body.member-app .post-card-modern {
    padding: 12px;
  }

  body.member-app .post-header .meta,
  body.member-app .meta-modern {
    font-size: 11px;
  }

  body.member-app .privacy-badge {
    padding: 6px 8px;
    font-size: 10px;
  }

  body.member-app .comment-form {
    align-items: stretch;
    gap: 6px;
  }

  body.member-app .comment-form .btn {
    padding: 6px 9px;
  }
}
