:root{
  --radius:12px;
  --maxw:1100px;
  --accent:#3ea0ff;
  --danger:#e05a4f;
  --muted-dark:#9fb1c8;
  --muted-light:#5b6c7b;
  --bg1: #071124; /* page background (solid) */
  --card: #0b1724; /* card background solid */
  --text:#eaf6ff;
  --muted:#9fb1c8;
  --safe-padding:18px;
  --sidebar-bg: #071124;
  --sidebar-text: #ffffff;
  --glass: rgba(255,255,255,0.02);
  --shadow-strong: 0 12px 32px rgba(0,0,0,0.25);
  --toast-bg: rgba(0,0,0,0.7);

  --hamburger-line-color: var(--text);
  --hamburger-bg: transparent;
  --sidebar-scrollbar-thumb: rgba(0,0,0,0.12);
  --sidebar-scrollbar-track: transparent;
}

/* Base & reset */
* { box-sizing: border-box; }
html, body { height:100%; margin:0; padding:0; font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial; -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale; background: var(--bg1); color:var(--text); line-height:1.45; transition: background 0.2s ease, color 0.18s ease; -webkit-font-smoothing:antialiased; }
img, video { max-width:100%; height:auto; display:block; }

/* Wrapper */
.wrapper { max-width:var(--maxw); margin:0 auto; padding:var(--safe-padding); width:100%; }
@media (max-width:860px) { .wrapper { padding:12px; } }

/* Header */
.header { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:10px 0; margin-bottom:14px; }
.brand { display:flex; gap:12px; align-items:center; }
.site-title h1 { margin:0; font-family:"Playfair Display", serif; font-size:1.15rem; letter-spacing:0.2px; color:var(--text); }
.site-title p { margin:0; color:var(--muted); font-size:0.92rem; }

/* Top actions */
.top-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.top-actions .note { color:var(--muted); font-size:0.9rem; }
#statusSmall, #visitorSmall { background: var(--card); padding:6px 10px; border-radius:999px; font-weight:600; display:inline-flex; gap:8px; align-items:center; border:1px solid rgba(0,0,0,0.06); color:var(--text); }
#onlineStatus { font-weight:700; }

/* Buttons */
.btn { background:var(--accent); color:#fff; padding:8px 12px; border-radius:10px; border:none; cursor:pointer; font-weight:600; transition:transform .12s ease, box-shadow .12s ease, opacity .12s ease; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0,0,0,0.12); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background:transparent; border:1px solid rgba(0,0,0,0.06); color:var(--muted); }

/* Card - solid background, no transparency/gradient */
.card { background: var(--card); border-radius:var(--radius); padding:16px; margin-bottom:16px; border:1px solid rgba(0,0,0,0.06); box-shadow:0 8px 24px rgba(0,0,0,0.08); transition: transform .12s ease, box-shadow .12s ease; }
.card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(0,0,0,0.10); }
.hero { display:flex; gap:18px; align-items:flex-start; }
@media (max-width:860px) { .hero { flex-direction:column; align-items:center; text-align:center; } .hero .meta { width:100%; } }

/* Avatar */
.avatar { width:120px; height:120px; border-radius:14px; overflow:hidden; border:1px solid rgba(0,0,0,0.06); background: var(--card); flex-shrink:0; }
.avatar img { width:100%; height:100%; object-fit:cover; display:block; transition: transform .18s ease; }
.avatar img:hover { transform: scale(1.02); }

/* Meta */
.meta .name { font-family:"Playfair Display", serif; font-size:1.25rem; margin:0; color:var(--text); }
.meta .role { margin-top:6px; color:var(--muted); font-size:0.95rem; }
.meta .bio { margin-top:10px; color:var(--text); font-weight:300; }

/* Tags */
.tags { display:flex; gap:8px; flex-wrap:wrap; margin-top:12px; justify-content:flex-start; }
.tag { padding:6px 10px; border-radius:999px; border:1px solid rgba(0,0,0,0.06); color:var(--muted); font-size:0.86rem; background:transparent; transition: background .12s ease, transform .12s ease; }
.tag:hover { transform: translateY(-3px); background: rgba(0,0,0,0.02); }

/* Lists/layout */
.row { display:flex; gap:16px; align-items:flex-start; }
.row .left{ flex:2; } .row .right{ flex:1; min-width:240px; }
@media (max-width:860px) { .row { flex-direction:column; } .row .right { min-width:unset; } }

/* Reviews area */
.avg-score { font-family:"Playfair Display", serif; font-size:2rem; font-weight:700; color:#ffd166; }
.stars { display:flex; gap:6px; align-items:center; }
.star { font-size:1.2rem; color:rgba(0,0,0,0.1); cursor:pointer; transition:color .12s ease; user-select:none; }
.star.active { color:#ffd166; }

/* Posts */
.section-title { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; }
.post-list { display:flex; flex-direction:column; gap:12px; margin-top:12px; }
.post { display:flex; gap:12px; align-items:flex-start; padding:12px; border-radius:10px; background:var(--card); border:1px solid rgba(0,0,0,0.06); cursor:pointer; transition: transform .12s ease, box-shadow .12s ease; }
.post:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(0,0,0,0.08); }
.post-thumb { width:120px; height:84px; border-radius:8px; overflow:hidden; flex-shrink:0; background:#111; display:flex; align-items:center; justify-content:center; }
.post-thumb img { width:100%; height:100%; object-fit:cover; }
.post-body h4 { margin:0 0 6px 0; font-size:1rem; color:var(--text); }
.post-body p { margin:0; color:var(--muted); font-size:0.95rem; }

/* empty state styling */
.note-empty { color:var(--muted); padding:18px; border-radius:8px; background: var(--card); text-align:center; }

/* Modal */
.modal { position:fixed; inset:0; display:none; align-items:center; justify-content:center; background: rgba(0,0,0,0.35); z-index:1200; padding:20px; }
.modal.show { display:flex; }
.modal .dialog { width:100%; max-width:900px; background:var(--card); border-radius:12px; padding:18px; max-height:90vh; overflow:auto; box-shadow:var(--shadow-strong); }

/* Editor toolbar & panel */
.editor-toolbar { position:sticky; top:72px; z-index:1000; display:none; gap:8px; align-items:center; padding:10px; border-radius:10px; background: var(--card); border:1px solid rgba(0,0,0,0.06); box-shadow:0 8px 24px rgba(0,0,0,0.08); margin-bottom:12px; transition: transform .18s ease, opacity .18s ease; }
.editor-toolbar.show { display:flex; transform: translateY(0); opacity:1; }

/* Panel/Editor content */
.panel { width:100%; max-width:760px; background:var(--card); padding:16px; border-radius:12px; box-shadow:var(--shadow-strong); }
.editor-grid { display:flex; gap:16px; align-items:flex-start; flex-wrap:wrap; }
.editor-avatar { min-width:160px; }
.editor-fields input, .editor-fields textarea, input[type="text"], textarea { width:100%; padding:10px; border-radius:8px; border:1px solid rgba(0,0,0,0.06); background:transparent; color:var(--text); }

/* About modal specific */
.about-dialog { background:var(--card); padding:20px; border-radius:14px; max-width:520px; width:94%; text-align:left; }
.about-top { text-align:center; margin-bottom:8px; }
.about-avatar-wrap { width:120px; height:120px; margin:0 auto 8px auto; border-radius:14px; overflow:hidden; border:1px solid rgba(0,0,0,0.06); }
.about-avatar-wrap img { width:100%; height:100%; object-fit:cover; display:block; }

/* Toast (moved to top-right, subtle) */
#toastContainer { position:fixed; right:18px; top:72px; z-index:9000; display:flex; flex-direction:column; gap:10px; align-items:flex-end; pointer-events:none; }
.toast { background: var(--toast-bg); color:#fff; padding:8px 12px; border-radius:10px; box-shadow:0 8px 24px rgba(0,0,0,0.18); min-width:180px; max-width:320px; pointer-events:auto; font-size:13px; opacity:0.98; }

/* Hamburger & sidebar (updated shape & visibility) */
.hamburger {
  position: fixed;
  top: 40px;
  left: 18px;
  z-index: 1060;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border-radius: 12px;
  background: var(--hamburger-bg);
  transition: background 0.12s, transform 0.12s, opacity 0.12s;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}
.hamburger:hover { background: rgba(0,0,0,0.03); }

/* Replace three thin lines with pill-shaped bars that adapt to theme */
.hamburger span {
  display: block;
  width: 26px;
  height: 4px;
  background: var(--hamburger-line-color);
  border-radius: 6px;
  transition: transform 0.18s ease, opacity 0.12s ease, background 0.12s ease;
  box-shadow: 0 1px 0 rgba(0,0,0,0.06);
}

/* stacked positions */
.hamburger span:nth-child(1) { transform: translateY(-8px); }
.hamburger span:nth-child(2) { transform: translateY(0); }
.hamburger span:nth-child(3) { transform: translateY(8px); }

/* When active: form X by rotating 1 & 3, hide middle (opacity 0) */
.hamburger.active span:nth-child(1) { transform: translateY(0) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; transform: translateY(0) scaleX(0.9); }
.hamburger.active span:nth-child(3) { transform: translateY(0) rotate(-45deg); }

.hamburger.hidden { opacity: 0; pointer-events: none; }

/* Sidebar */
.side-menu { position:fixed; top:0; left:0; width:240px; height:100vh; background:var(--sidebar-bg); box-shadow:2px 0 32px rgba(0,0,0,0.12); z-index:1030; transform:translateX(-260px); transition:transform 0.22s ease; border-right:1px solid rgba(0,0,0,0.06); }
.side-menu.show { transform:translateX(0); }
.side-menu-content { padding: 90px 18px 18px 18px; }
.side-menu ul { list-style:none; padding:0; margin:0; }
.side-menu ul li { margin-bottom:14px; position:relative; }
.side-menu ul li a { color:var(--sidebar-text); text-decoration:none; font-size:1.12rem; font-weight:600; display:flex; align-items:center; gap:10px; padding:8px; border-radius:8px; }
.side-menu ul li a:hover { background: rgba(255,255,255,0.02); color:var(--sidebar-text); }

/* submenu */
.contact-submenu {
  display: none; /* default hidden */
  margin-top: 8px;
  padding-left: 6px;
  box-sizing: border-box;
  /* make scroll UX smooth on touch devices */
  -webkit-overflow-scrolling: touch;
  overflow-y: auto; /* will be enabled when shown; max-height dynamically set by JS */
  max-height: 0; /* JS will set a usable max-height when showing */
}
.contact-submenu.show {
  display: flex;
  flex-direction: column;
  gap: 6px;
  /* fallback if JS didn't set height: limit to 50vh (best-effort) */
  max-height: 50vh;
  overflow-y: auto;
  padding-right: 8px; /* room for scrollbar */
}

.contact-submenu a {
  white-space: normal;
  line-height: 1.25;
  padding: 8px;
}
.contact-submenu::-webkit-scrollbar {
  width: 10px;
}
.contact-submenu::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.12);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.contact-submenu::-webkit-scrollbar-track { background: transparent; }

.contact-submenu a:hover { background: rgba(255,255,255,0.02); color:var(--sidebar-text); }

/* Form and comment */
.comment-form input, .comment-form textarea { padding:10px; border-radius:8px; border:1px solid rgba(0,0,0,0.06); background:var(--card); color:var(--text); width:100%; }
.inline-comments { margin-top:12px; display:flex; flex-direction:column; gap:8px; }
.inline-comments .citem { padding:8px; border-radius:8px; background:var(--card); border:1px solid rgba(0,0,0,0.04); }

/* Small responsive tweaks */
@media (max-width:520px) {
  .hamburger { top: 18px; left: 12px; width:40px; height:40px; padding:6px; }
  .hamburger span { width:20px; height:3.6px; }
  .side-menu-content { padding: 76px 14px 14px 14px; }
}

/* Accessibility */
[aria-hidden="true"] { pointer-events:none; opacity:0; transition: opacity .12s ease; }

/* Utility */
.hidden { display:none !important; }

/* Scrollable areas */
.scroll-area {
  max-height: 320px;
  overflow-y: auto;
  padding-right: 6px;
  -webkit-overflow-scrolling: touch;
}
.scroll-area::-webkit-scrollbar { width: 10px; }
.scroll-area::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }

/* small fade in */
.fade-in { animation: fadeIn .28s ease both; }
@keyframes fadeIn { from { opacity:0; transform: translateY(6px) } to { opacity:1; transform: translateY(0) } }
/* Live badge styles (add to your style/main.css, near header/top-actions section) */
.live-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  margin-left: 8px;
  opacity: 0.9;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

/* Active state (flash/pulse) */
.live-badge--active {
  transform: scale(1.06);
  background: linear-gradient(90deg, rgba(62,160,255,0.14), rgba(255, 213, 102, 0.12));
  box-shadow: 0 10px 30px rgba(62,160,255,0.12);
  color: var(--text);
}

/* Small dot inside */
.live-badge::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff6b6b;
  box-shadow: 0 0 8px rgba(255,107,107,0.35);
  transform: translateY(-1px);
}

/* Make sure badge is unobtrusive on small screens */
@media (max-width:520px) {
  .live-badge { display:none; } /* optional: hide on small screens to avoid crowding */
}

/* mini tooltip styling */
#miniTooltip { pointer-events:none; z-index:99999; border-radius:8px; font-size:12px; padding:8px 10px; }

/* make sure images in post-preview are not selectable */
.post-thumb img, .avatar img, .about-avatar-wrap img { -webkit-user-drag: none; user-select: none; }