:root {
  --bg-main: #f4f5fb;
  --accent-soft: #fef9c3;
  --accent: #a3e635;
  --accent-strong: #84cc16;
  --text-main: #111827;
  --text-muted: #6b7280;
  --nav-bg: linear-gradient(180deg, #0e172a 0%, #101827 100%);
  --border-subtle: #e5e7eb;
  --card-radius: 16px;

  /* shadows (from your second :root) */
  --shadow-1: 0 6px 18px rgba(15, 23, 42, 0.10);
  --shadow-2: 0 12px 28px rgba(15, 23, 42, 0.18);
  --shadow-3: 0 18px 42px rgba(15, 23, 42, 0.25);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: radial-gradient(circle at 20% 20%, #fefce8 0%, #f4f5fb 35%, #eef2ff 70%, #e0e7ff 100%);
  color: var(--text-main);
}

.app {
  display: grid;
  grid-template-columns: 230px minmax(280px, 360px) minmax(0, 1fr);
  grid-template-areas: "sidebar right main";
  min-height: 100vh;
}

@media (max-width: 960px) {
  .app {
    grid-template-columns: 70px minmax(0, 1fr);
    grid-template-rows: auto auto;
    grid-template-areas: "sidebar main";
  }
  .right-panel { display: none; }
}

@media (max-width: 720px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-areas: "main";
  }
}

/* Mobile refinements */
@media (max-width: 720px) {
  body { background: #f8fafc; }
  .main { padding: 12px 12px 16px; gap: 10px; }
  .top-bar-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .top-bar { gap: 4px; }
  .search-wrapper { width: 100%; }
  .right-panel { width: 100%; grid-column: 1 / -1; }
  .profile-card,
  #activityPanel,
  .card {
    box-shadow: var(--shadow-1);
    border-radius: 14px;
    margin-top: 8px;
  }
  .profile-actions { flex-direction: column; }
  .profile-actions .btn-outline,
  .profile-actions .btn-danger { width: 100%; }
  #activityTabs { gap: 6px; }
  .actTab {
    flex: 1 1 calc(50% - 6px);
    text-align: center;
    font-size: 12px;
    padding: 6px 8px;
  }
  .activity-list { margin-top: 8px; }
  .activity-item { padding: 10px; }
  .activity-title { font-size: 14px; }
  .activity-desc,
  .activity-text { font-size: 12px; }
  .activity-meta { font-size: 11px; gap: 6px; }
  .activity-count { padding: 2px 6px; }
}

/* Sidebar */
.sidebar {
  grid-area: sidebar;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  background: var(--nav-bg);
  color: #e5e7eb;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sidebar-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.sidebar-actions { display: flex; flex-direction: column; gap: 8px; padding: 4px 0 6px; }
.sidebar-actions .btn-outline,
.sidebar-actions .btn-danger { width: 100%; }

.logo {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #f9fafb;
  padding: 6px 4px;
}

.nav { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 999px; font-size: 14px; cursor: pointer;
  color: #e5e7eb; border: none; background: transparent; text-align: left;
}

.nav-item span.icon { width: 20px; text-align: center; font-size: 14px; }

.nav-item.active { background: #facc15; color: #111827; font-weight: 600; }
.nav-item:hover:not(.active) { background: rgba(249, 250, 251, 0.07); }

.sidebar-footer { margin-top: 6px; font-size: 11px; color: #9ca3af; padding: 0 4px; }

/* Main */
.main {
  grid-area: main;
  padding: 16px 18px 20px;
  display: flex; flex-direction: column; gap: 14px;
  background: linear-gradient(135deg, #fefce8 0%, #f4f5fb 40%, #eef2ff 100%);
  border-left: 1px solid var(--border-subtle);
}

.top-bar { display: flex; flex-direction: column; gap: 6px; position: relative; }
.top-bar-row { display: flex; align-items: center; gap: 14px; }
.search-bar-group { display: flex; align-items: center; gap: 10px; width: 100%; }

.top-logo-mobile { display: none; font-size: 16px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: #4b5563; }
@media (max-width: 720px) { .top-logo-mobile { display: block; } }
.mobile-scrim { display: none; }
.mobile-menu-btn {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  box-shadow: none;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-direction: column;
  padding: 6px 4px;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.mobile-menu-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background: #0f172a;
  border-radius: 999px;
}
.mobile-menu-btn:active { transform: none; box-shadow: none; }
@media (max-width: 720px) {
  .mobile-menu-btn { display: inline-flex; }
}

.search-wrapper { flex: 1; position: relative; min-width: 0; }
.search-input {
  width: 100%; padding: 9px 38px 9px 14px; border-radius: 999px;
  border: 1px solid #d1d5db; background: rgba(249, 250, 251, 0.9);
  font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
.search-input:focus { border-color: #4f46e5; background: #ffffff; box-shadow: 0 0 0 1px rgba(79,70,229,.1); }
.search-icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 15px; color: #9ca3af; }
.search-icon svg { display: block; width: 16px; height: 16px; }

.search-status { font-size: 12px; color: var(--text-muted); padding-left: 4px; }
.search-status.valid { color: #15803d; }
.search-status.new { color: #a16207; }

.suggestions {
  position: absolute; top: 38px; left: 0; right: 0; margin-top: 4px;
  background: #ffffff; border-radius: 12px; border: 1px solid rgba(209,213,219,.7);
  box-shadow: 0 16px 30px rgba(15,23,42,.18);
  max-height: 60vh; min-height: 240px;
  overflow-y: auto; overscroll-behavior: contain;
  z-index: 10; font-size: 13px;
}
.suggestion-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 11px; cursor: pointer; }
.suggestion-item:not(:last-child) { border-bottom: 1px solid #f3f4f6; }
.suggestion-item:hover { background: #f9fafb; }
.suggestion-label { display: flex; align-items: center; gap: 6px; }
.suggestion-tag { font-size: 10px; padding: 2px 6px; border-radius: 999px; background: #eef2ff; color: #4f46e5; text-transform: uppercase; letter-spacing: .04em; }
.suggestion-icon { font-size: 13px; }

/* >>> Enhanced: "Create new subject" row — subtle highlight matching your palette */
.suggestion-create {
  background: linear-gradient(90deg, #fff, #fefce8 60%);
}
.suggestion-create .suggestion-label span:first-child { font-weight: 600; }

@media (max-width: 960px) {
  .suggestions {
    left: 0; right: 0; width: 100%; min-width: 0; transform: none;
  }
}
.suggestion-create:hover {
  background: #fef9c3; /* your --accent-soft */
  box-shadow: inset 0 0 0 1px rgba(250, 204, 21, .25);
}

.top-profile-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #cdd7e5;
  background: linear-gradient(135deg, #ffffff 0%, #eef2ff 55%, #e0f2fe 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(15,23,42,.16), inset 0 1px 0 rgba(255,255,255,.75);
  transition: background .18s, box-shadow .18s, transform .12s, border-color .18s;
  flex-shrink: 0;
}
.top-profile-btn:hover { background: linear-gradient(135deg, #ffffff 0%, #e6edff 55%, #dbeafe 100%); box-shadow: 0 12px 26px rgba(15,23,42,.2); transform: translateY(-1px); border-color: #b9c8e2; }
.top-profile-btn:active { transform: translateY(0); }
.top-profile-icon {
  font-weight: 800;
  color: #0f172a;
  font-size: 14px;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 0 rgba(255,255,255,.95), 0 6px 12px rgba(0,0,0,.12);
}

/* Subject view / feed */
.feed { margin-top: 8px; }

.feed-placeholder {
  padding: 14px 16px; border-radius: var(--card-radius);
  background: rgba(255,255,255,.9); border: 1px dashed rgba(148,163,184,.7);
  font-size: 13px; color: #6b7280;
}

.subject-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 18px 20px 16px;
  border: 1px solid #e2e8f0;
  margin-bottom: 16px;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.12);
  transition: box-shadow 140ms ease, transform 140ms ease, border-color 140ms ease;
}
.subject-card:hover {
  box-shadow: var(--shadow-2);
  transform: translateY(-2px);
  border-color: #cbd5e1;
}

.subject-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}
.subject-title-block { display: flex; flex-direction: column; gap: 6px; }
.subject-name { font-size: 21px; font-weight: 800; letter-spacing: 0.01em; }
.subject-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #94a3b8;
  letter-spacing: .01em;
  text-transform: uppercase;
}
.subject-desc {
  color: #475569;
  font-size: 13.5px;
  font-style: italic;
  letter-spacing: 0.01em;
}

.subject-layout { display: flex; flex-direction: column; max-height: calc(100vh - 140px); }
.subject-scroll { flex: 1; overflow-y: auto; padding-right: 6px; padding-bottom: 10px; }
.sticky-header { position: sticky; top: 0; z-index: 3; background: #fff; padding-bottom: 6px; box-shadow: 0 8px 12px rgba(17,24,39,.08); }
.write-footer { position: sticky; bottom: 0; z-index: 2; background: #fff; padding: 10px 0 6px; box-shadow: 0 -8px 18px rgba(17,24,39,.08); }
.write-footer .write-review-card { margin-top: 8px; }
.subject-scroll { scrollbar-width: thin; scrollbar-color: transparent transparent; }
.subject-scroll:hover { scrollbar-color: rgba(148,163,184,.6) transparent; }
.subject-scroll::-webkit-scrollbar { width: 8px; }
.subject-scroll::-webkit-scrollbar-thumb { background-color: transparent; border-radius: 999px; }
.subject-scroll:hover::-webkit-scrollbar-thumb { background-color: rgba(148,163,184,.6); }

.badge-verified {
  padding: 3px 8px; border-radius: 999px; background: #ecfdf3; color: #16a34a;
  font-weight: 500; font-size: 11px; display: inline-flex; align-items: center; gap: 4px;
}
.badge-unverified {
  padding: 3px 8px; border-radius: 999px; background: #fef3c7; color: #92400e;
  font-weight: 500; font-size: 11px; display: inline-flex; align-items: center; gap: 4px;
}

/* ---------- Verified Tick (green circle) – used everywhere ---------- */
.wiki-icon{
  display:inline-flex;
  width:16px;
  height:16px;
  margin-left:4px;
  border-radius:50%;
  background:#ecfdf5;              /* soft green */
  border:1px solid #a7f3d0;         /* light green border */
  align-items:center;
  justify-content:center;
  vertical-align:middle;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}
.wiki-icon::after{
  content:"✓";
  font-size:11px;
  font-weight:800;
  line-height:1;
  color:#059669;                    /* green check */
  transform: translateY(-0.5px);    /* nudge up a touch */
}
/* slightly smaller icon for list rows */
.wiki-icon.sm{ width:14px; height:14px; }
.wiki-icon.sm::after{ font-size:10px; }

/* keep name + tick on one baseline */
.subject-name,
.name-with-verified { display:inline-flex; align-items:center; gap:4px; }

/* Stars */
.subject-stars { color: #fbbf24; font-size: 18px; display:flex; align-items:center; gap:6px; }
.subject-stars .star.small { font-size: 18px; color: #d1d5db; }
.subject-stars .star.small.filled { color: #fbbf24; }
.stars-only { display:inline-flex; gap: 1px; align-items:center; }
.star-number {
  color: #6b7280;
  font-weight: 600;
  font-size: 13px;
  margin-left: 6px;
  display: inline-flex;
  align-items: center;
  line-height: 1;
  vertical-align: middle;
}

.validation-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.btn-validate {
  padding: 6px 10px; border-radius: 999px; border: 1px solid #f59e0b;
  background: #fef3c7; color: #92400e; font-size: 12px; cursor: pointer; font-weight: 500;
}
.btn-validate:hover { background: #fbbf24; color: #78350f; }
.validation-msg { font-size: 11px; color: #6b7280; max-width: 220px; text-align: right; }
.rating-summary { font-weight: 500; }

/* Reviews list */
.reviews-section-title { font-size: 13px; font-weight: 600; margin: 4px 2px 10px; color: #4b5563; letter-spacing: .01em; }
.review-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; padding-bottom: 60px; }

.review-card {
  padding: 8px 12px;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  font-size: 13px;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
  transition: box-shadow 140ms ease, transform 140ms ease, border-color 140ms ease;
}
.review-card:hover {
  box-shadow: var(--shadow-2);
  transform: translateY(-2px);
  border-color: #cbd5e1;
}
.review-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
  padding-bottom: 2px;
  font-size: 11px;
  color: #6b7280;
  border-bottom: 1px solid #e2e8f0;
}

.review-stars { color: #fbbf24; font-size: 13px; display: inline-flex; gap: 1px; align-items:center; }
.review-stars .star.small { font-size: 13px; color: #d1d5db; }
.review-stars .star.small.filled { color: #fbbf24; }
.review-stars .star-number { color: #6b7280; font-size: 12px; margin-left: 6px; font-weight: 600; vertical-align: middle; }

.mini-stars .stars-only { gap:1px; }
.mini-stars .star-number { font-size: 12px; margin-left: 4px; font-weight: 600; color:#6b7280; }

.review-text {
  font-size: 13px;
  color: #0f172a;
  line-height: 1.3;
  margin: 0;
  white-space: pre-line;
  position: relative;
}
.review-text-truncate {
  display: block;
  white-space: pre-wrap;
}
.review-text-truncate.clamp-5 {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.review-text.expanded .review-text-truncate { overflow: visible; -webkit-line-clamp: unset; }
.review-expand-btn {
  display: inline;
  background: transparent;
  border: none;
  color: #2563eb;
  cursor: pointer;
  font-size: 12px;
  padding: 0;
  margin-left: 6px;
}
.review-expand-btn:hover { text-decoration: underline; }
.review-empty { font-size: 12px; color: #9ca3af; padding: 6px 2px 10px; }

/* Write review */
.write-review-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; border: 1px solid #facc15;
  background: transparent;
  color: #0f172a;
  font-size: 13px; cursor: pointer; font-weight: 600; margin: 4px 0 6px;
  box-shadow: none;
}
.write-review-toggle:hover {
  background: #fde68a;
  color: #0f172a;
  box-shadow: none;
}

.write-review-card {
  margin-top: 4px; padding: 16px 18px 14px; border-radius: 18px; background: #ffffff;
  border: 1px solid #e5e7eb; box-shadow: 0 12px 28px rgba(15,23,42,.15); display: none;
}

.write-stars-row { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 8px; }
#starContainer { display: inline-flex; gap: 4px; }
.star { font-size: 22px; color: #d1d5db; cursor: pointer; transition: color .1s, transform .1s; }
.star.filled { color: #fbbf24; }
.star:hover { transform: translateY(-1px); }
.rating-value { font-size: 13px; color: #4b5563; font-weight: 500; }

.rating-slider-wrapper { display: flex; justify-content: center; margin-bottom: 10px; }
.rating-slider { width: 180px; }

.write-textarea-wrapper { background: #f5f5f6; border-radius: 18px; padding: 14px 18px 10px; margin-bottom: 8px; }
.write-textarea {
  width: 100%; border: none; resize: vertical; min-height: 90px; max-height: 220px; outline: none;
  font-family: inherit; font-size: 14px; color: #111827; background: transparent;
}

.write-toolbar-row { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.write-toolbar { display: flex; gap: 10px; font-size: 13px; color: #9ca3af; }
.write-toolbar span { cursor: pointer; user-select: none; }
.write-toolbar span:hover { color: #4b5563; }

/* Flag modal */
.flag-modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,.35); z-index: 9999; padding: 12px; }
.flag-modal-content { background: #fff; border-radius: 16px; width: 420px; max-width: 96vw; box-shadow: 0 20px 48px rgba(15,23,42,.25); padding: 18px 18px 14px; border: 1px solid rgba(209,213,219,.7); }
.flag-modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.flag-modal-header h3 { margin: 0; font-size: 17px; }
.flag-close { background: none; border: none; font-size: 20px; cursor: pointer; color: #9ca3af; }
.flag-subtext { margin: 0 0 10px; color: #6b7280; font-size: 13px; }
.flag-reasons { display: grid; gap: 8px; margin-bottom: 10px; font-size: 13px; color: #111827; }
.flag-reasons label { display: flex; gap: 8px; align-items: center; cursor: pointer; padding: 6px 8px; border-radius: 10px; border: 1px solid transparent; }
.flag-reasons label:hover { background: #f8fafc; border-color: #e5e7eb; }
.flag-reasons input { accent-color: #f97316; }
.flag-notes { width: 100%; min-height: 60px; border: 1px solid #e5e7eb; border-radius: 12px; padding: 8px 10px; font-family: inherit; font-size: 13px; margin-bottom: 12px; }
.flag-actions { display: flex; justify-content: flex-end; gap: 8px; }
.flag-btn { border-radius: 10px; padding: 8px 14px; border: none; cursor: pointer; font-weight: 600; font-size: 13px; }
.flag-btn.ghost { background: #f3f4f6; color: #374151; }
.flag-btn.ghost:hover { background: #e5e7eb; }
.flag-btn.danger { background: #ef4444; color: #fff; box-shadow: 0 8px 20px rgba(239,68,68,.35); }
.flag-btn.danger:hover { background: #dc2626; }

.write-post-btn {
  padding: 8px 18px; border-radius: 999px; border: 1px solid #facc15; background: transparent; color: #0f172a;
  font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: none;
}
.write-post-btn:hover { background: #fde68a; box-shadow: none; }
.write-error { font-size: 12px; color: #b91c1c; margin-top: 6px; }

/* Notifications */
.notif-hint { font-size: 11px; color: #9ca3af; }
.notification-list { display: flex; flex-direction: column; gap: 8px; }
.notification-item {
  display: block;
  padding: 10px 12px;
}
.notification-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
}
.notification-actor { font-weight: 700; color: #111827; }
.notification-type { color: #2563eb; font-weight: 600; }
.notification-time { margin-left: auto; font-size: 11px; color: #9ca3af; }
.notification-title { font-weight: 600; color: #111827; font-size: 13px; }
.notification-body { font-size: 12px; color: #4b5563; margin-top: 4px; white-space: pre-line; }
.notification-dot { color: #d1d5db; }

/* Right panel */
.right-panel { grid-area: right; padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; background: #f9fafb; }
.profile-card {
  background: #ffffff; border-radius: var(--card-radius); padding: 14px 14px 12px;
  box-shadow: 0 10px 24px rgba(15,23,42,.1); border: 1px solid rgba(209,213,219,.8);
}
.profile-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.avatar {
  width: 34px; height: 34px; border-radius: 999px; background: #f97316;
  display: flex; align-items: center; justify-content: center; color: #ffffff; font-size: 17px; font-weight: 600;
}
.profile-main { display: flex; flex-direction: column; gap: 2px; }
.profile-name { font-size: 14px; font-weight: 600; }
.profile-email { font-size: 12px; color: #6b7280; word-break: break-all; }

.profile-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }

.btn-outline, .btn-danger {
  width: 100%; padding: 7px 0; border-radius: 999px; font-size: 13px; cursor: pointer;
  border: 1px solid #d1d5db; background: #f9fafb; color: #111827; font-weight: 500;
  transition: background .15s, color .15s, box-shadow .12s;
}
.btn-outline:hover { background: #111827; color: #f9fafb; box-shadow: 0 8px 18px rgba(15,23,42,.4); }

.btn-danger { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }
.btn-danger:hover { background: #b91c1c; color: #fff; box-shadow: 0 8px 18px rgba(185,28,28,.45); }

.right-caption { font-size: 11px; color: #6b7280; margin-top: 4px; }

.review-author-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #4b5563;
  margin-bottom: 2px;
}
.review-author { font-weight: 600; }
.review-time-dot { font-size: 10px; }
.review-rating-text { font-size: 11px; color: #6b7280; margin-left: 6px; }
.review-stars-inline {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  line-height: 1;
}
.review-stars-inline .star.small {
  font-size: 12px;
  line-height: 1;
}
.review-stars-inline .star-number {
  font-size: 12px;
  margin-left: 4px;
  line-height: 1;
}

.review-actions-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip-btn {
  border-radius: 999px; border: 1px solid #e5e7eb; background: #f9fafb; padding: 4px 10px;
  font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
}
.chip-btn:hover { background: #111827; color: #f9fafb; }

.review-actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 2px;
  padding-top: 4px;
  border-top: 1px solid #e2e8f0;
}
.review-actions-row .chip-btn {
  background: transparent;
  border: none;
  box-shadow: none;
  justify-content: flex-start;
  font-weight: 600;
  color: #475569;
  padding: 4px 2px;
  gap: 6px;
}
.review-actions-row .chip-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-radius: 10px;
}

.review-replies { margin-top: 8px; border-left: 2px solid #e5e7eb; padding-left: 10px; }
.reply-item { font-size: 12px; color: #374151; margin-bottom: 4px; }
.reply-meta { font-size: 11px; color: #9ca3af; }

.review-reply-box { margin-top: 6px; }
.review-reply-input {
  width: 100%; min-height: 50px; max-height: 120px; resize: vertical; font-size: 12px;
  border-radius: 10px; border: 1px solid #e5e7eb; padding: 6px 8px; font-family: inherit;
}
.review-reply-post-btn { margin-top: 4px; padding: 5px 12px; border-radius: 999px; border: none; background: #4f46e5; color: #ffffff; font-size: 12px; cursor: pointer; }
.review-reply-post-btn:hover { background: #4338ca; }

/* Activity tabs */
.actTab { padding: 6px 12px; border-radius: 999px; border: 1px solid #d1d5db; background: #f9fafb; font-size: 12px; cursor: pointer; }
.actTab:hover { background: #111827; color: #f9fafb; }
.actTab.active { background: #facc15; color: #111827; border-color: #facc15; }

/* Activity list styling */
.activity-list { display:grid; gap:10px; margin-top:12px; }
.activity-item {
  display:block;
  padding:10px 12px;
  border:1px solid #e5e7eb;
  border-radius:12px;
  background:#fff;
  box-shadow:0 1px 2px rgba(17,24,39,0.06);
  text-decoration:none;
  color:inherit;
  transition:transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}
.activity-item:hover {
  transform:translateY(-1px);
  border-color:#c7cdd4;
  box-shadow:0 6px 12px rgba(17,24,39,0.08);
}
.activity-title {
  display:flex; align-items:center; gap:6px;
  font-weight:700; color:#111827; line-height:1.2;
}
.activity-desc {
  margin-top:2px;
  color:#6b7280;
  font-size:13px;
  line-height:1.3;
}
.activity-text {
  margin-top:4px;
  color:#4b5563;
  font-size:13px;
}
.activity-meta {
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  margin-top:6px;
  color:#6b7280;
  font-size:12px;
}
.activity-count {
  padding:2px 8px;
  border-radius:999px;
  background:#f3f4f6;
  border:1px solid #e5e7eb;
}
.activity-date { color:#9ca3af; }
.mini-stars .star.small { font-size:13px; }

/* Cards / pills / buttons / hr utilities */
.card {
  background: #ffffff; border-radius: var(--card-radius); border: 1px solid rgba(209,213,219,.8);
  box-shadow: var(--shadow-1); transition: box-shadow 140ms ease, transform 140ms ease;
}
.card:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px;
  background: #f3f4f6; border: 1px solid #e5e7eb; font-size: 12px; color: #374151;
}
.pill.good { background:#ecfdf5; color:#065f46; border-color:#a7f3d0; }
.pill.warn { background:#fef3c7; color:#7c2d12; border-color:#fcd34d; }
.pill.info { background:#eef2ff; color:#3730a3; border-color:#c7d2fe; }

.btn {
  padding: 8px 14px; border-radius: 999px; border: 1px solid #d1d5db; background: #111827; color: #f9fafb;
  font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: 0 8px 18px rgba(15,23,42,.25);
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.btn.light { background:#f9fafb; color:#111827; }
.btn.ghost { background:transparent; border-color:#e5e7eb; color:#111827; }

.hr { height: 1px; background: linear-gradient(90deg, transparent, #e5e7eb, transparent); margin: 10px 0; }

.star.filled { text-shadow: 0 0 0 rgba(0,0,0,0); filter: drop-shadow(0 1px 0 rgba(0,0,0,.06)); }

/* Make anchor buttons look exactly like our outline buttons */
.btn-uniform {
  display: block;
  width: 100%;
  text-align: center;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle, #e5e7eb);
  background: #fff;
  color: var(--text-main, #111827);
  text-decoration: none;
  line-height: 1.2;
  font-weight: 500;
}

/* Keep spacing tidy in the profile action stack */
.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}


/* Skeleton loader */
@keyframes shimmer { 0% { background-position: -400px 0 } 100% { background-position: 400px 0 } }
.skeleton { position: relative; overflow: hidden; background: #f3f4f6; border-radius: 10px; height: 12px; }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.6), rgba(255,255,255,0));
  background-size: 400px 100%; animation: shimmer 1.2s infinite;
}
.skel-row { display:flex; flex-direction:column; gap:8px; }
.skel-lg { height: 18px; }
.skel-sm { height: 10px; width: 60%; }

/* Toast */
#toast { position: fixed; right: 16px; top: 16px; z-index: 999; display: grid; gap: 8px; }
.toast-item {
  background: #111827; color: #f9fafb; padding: 10px 12px; border-radius: 12px; box-shadow: var(--shadow-2);
  font-size: 13px; border: 1px solid #1f2937; opacity: 0; transform: translateY(-6px); animation: toastIn 160ms ease forwards;
}
@keyframes toastIn { to { opacity: 1; transform: translateY(0); } }
.toast-item.good { background:#065f46; border-color:#064e3b; }
.toast-item.warn { background:#7c2d12; border-color:#7c2d12; }
.toast-item.info { background:#3730a3; border-color:#312e81; }

/* Tick mark (legacy text ✓) — kept for safety if referenced somewhere else */
.tick-mark { color: #22c55e; font-weight: 700; margin-left: 6px; }

/* Wiki suggestion content */
.suggestion-content { display: flex; flex-direction: column; }
.suggestion-title { font-weight: 700; line-height: 1.2; }
.suggestion-desc { font-style: italic; font-size: 12px; color: var(--text-muted); line-height: 1.2; margin-top: 2px; }

/* Short subtitle under subject title */
.subject-desc {
  font-style: italic;
  font-size: 13.5px;
  color: #475569;
  margin-top: 2px;
  letter-spacing: 0.01em;
}

/* Modal (Subject Creation) */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(17, 24, 39, 0.45);
  display: none; align-items: center; justify-content: center;
  z-index: 60;
  padding: 16px;
}
.modal {
  width: min(560px, 92vw);
  background: #fff; border-radius: 16px;
  box-shadow: 0 18px 44px rgba(2, 6, 23, 0.22);
  overflow: hidden;
  transform: translateY(6px) scale(.98);
  opacity: .98;
  transition: transform 120ms ease, opacity 120ms ease;
}
.modal-backdrop[style*="display: flex"] .modal,
.modal-backdrop[style*="display:flex"] .modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid #e5e7eb;
}
.modal-header h3 { margin: 0; font-size: 18px; }
.modal-close {
  border: 0; background: transparent; font-size: 20px; line-height: 1;
  cursor: pointer; padding: 6px 8px; border-radius: 10px; color:#374151;
}
.modal-close:hover { background: #f3f4f6; }
.modal-body { padding: 14px 16px; display: grid; gap: 10px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 12px 16px; border-top: 1px solid #e5e7eb; background: #fafafa;
}
.modal-label { display:block; font-size: 13px; color:#6b7280; margin-bottom: 6px; }
.modal-input, .modal-textarea {
  width: 100%; border: 1px solid #e5e7eb; border-radius: 12px;
  padding: 10px 12px; font-size: 14px; outline: none; background:#fff;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.modal-input[readonly] { background:#f9fafb; }
.modal-input:focus, .modal-textarea:focus {
  border-color:#94a3b8;
  box-shadow: 0 0 0 3px rgba(148,163,184,.22);
}
.modal-textarea { min-height: 96px; resize: vertical; }

/* Buttons inside the Create Subject modal only */
.modal .btn-primary {
  background:#111827; color:#fff; border:0; border-radius:12px;
  padding:10px 14px; cursor:pointer; font-weight:600;
}
.modal .btn-primary:hover { opacity:.95; }

.modal .btn-outline {
  background:#fff; color:#111827; border:1px solid #e5e7eb;
  border-radius:12px; padding:10px 14px; cursor:pointer; font-weight:600;
}
.modal .btn-outline:hover { background:#f9fafb; }
.profile-card .btn-outline:hover { background:#111827; color:#f9fafb; }
.profile-actions .btn-outline#showActivityBtn { display:block; }

/* tiny vertical tweak if needed near titles */
.subject-name .wiki-icon { vertical-align: middle; }

/* Mobile overrides: stack layout and remove nested scroll on phones */
@media (max-width: 720px) {
  .app {
    display: flex;
    flex-direction: column;
    grid-auto-rows: auto;
    row-gap: 12px;
  }
  body { overflow-x: hidden; }
  body.mobile-lock { overflow: hidden; }
  .main { padding: 12px 12px 16px; border-right: none; order: 1; }
  .feed { margin-top: 0; }

  .right-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    grid-column: 1 / -1;
    padding: 0 12px 12px;
    order: 2;
  }

  .subject-card { padding: 14px 14px 12px; }
  .subject-header-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .validation-actions {
    width: 100%;
    align-items: flex-start;
    gap: 8px;
  }
  .validation-actions .subject-stars { width: 100%; }
  .validation-actions .chip-btn,
  .validation-actions .btn-validate {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .subject-layout { max-height: none; }
  .subject-scroll {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
  .sticky-header,
  .write-footer {
    position: static;
    box-shadow: none;
  }

.top-bar-row {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}
.search-bar-group { grid-column: 2 / 4; }
.top-logo-mobile { margin-left: 0; display: inline-flex; align-items: center; gap: 6px; }
  .search-wrapper { width: 100%; }
  .search-input { padding-left: 14px; }

  .write-review-card,
  .review-card {
    padding: 12px 12px 10px;
  }
  .review-card {
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    box-shadow: var(--shadow-1);
  }
  .review-actions-row {
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-top: 10px;
    border-top: 1px solid #f1f5f9;
    padding-top: 6px;
  }
  .review-actions-row .chip-btn {
    flex: 0 0 auto;
    min-width: 0;
    justify-content: flex-start;
    padding: 4px 2px;
    font-size: 11px;
    background: transparent;
    border: none;
    color: #475569;
  }
  .review-actions-row .chip-btn:hover {
    background: #eef2ff;
    color: #111827;
    border-radius: 8px;
  }
  .review-text { font-size: 13px; line-height: 1.45; }
  .review-card-header { margin-bottom: 6px; }

  .write-review-toggle,
  .write-post-btn {
    width: 100%;
    text-align: center;
  }

  #toast {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(92vw, 380px);
    top: 12px;
  }

  /* Off-canvas sidebar */
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    max-width: 82vw;
    transform: translateX(-110%);
    transition: transform 160ms ease, box-shadow 160ms ease;
    z-index: 130;
    height: 100vh;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.45);
    overflow-y: auto;
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease;
    z-index: 120;
  }
  .mobile-scrim.active {
    opacity: 1;
    pointer-events: auto;
  }
  .app { min-height: 100vh; }
}
