:root {
  --ink: #1E1630;
  --muted: #5C5470;
  --paper: #FFF3D6;
  --card: #FFFDF8;
  --line: #1E1630;
  --hover: #FFE58A;
  --accent: #FF5A3C;
  --accent-dark: #E03E24;
  --accent-soft: #FFE1D8;
  --gold: #FFC93C;
  --sky: #4C9BFF;
  --mint: #2EC4B6;
  --violet: #7B61FF;
  --danger: #FF3B5C;
  --text: var(--ink);
  --blue: var(--sky);
  --blue-dark: #2E74E8;
  --blue-soft: #DCECFF;
  --green: var(--mint);
  --green-soft: #D4F6F2;
  --bg: var(--paper);
  --border: var(--line);
  --shadow: 5px 5px 0 var(--ink);
  --radius: 22px 16px 24px 18px / 18px 24px 16px 22px;
  --topbar: 58px;
  --side: 268px;
}

* { box-sizing: border-box; }
html { overflow-x: clip; }
body.majd-body {
  margin: 0;
  font-family: "IBM Plex Sans Arabic", Tahoma, sans-serif;
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 8% 12%, rgba(255, 90, 60, .16) 0 140px, transparent 141px),
    radial-gradient(circle at 92% 6%, rgba(76, 155, 255, .16) 0 160px, transparent 161px),
    radial-gradient(circle at 78% 88%, rgba(46, 196, 182, .14) 0 180px, transparent 181px),
    radial-gradient(circle at 16% 78%, rgba(255, 201, 60, .2) 0 120px, transparent 121px);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: clip;
}
h1, h2, h3, .majd-brand strong, .landing-hero h1, .landing-head h2, .landing-final h2, .landing-split h3, .page-hero h1 {
  font-family: "Baloo Bhaijaan 2", Amiri, "IBM Plex Sans Arabic", sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: 16px; max-width: 100%; }
img { max-width: 100%; height: auto; display: block; }
svg { width: 20px; height: 20px; display: block; }

a, button { touch-action: manipulation; }
.majd-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: auto;
  background: #FFFDF8;
  border-bottom: 3px solid var(--ink);
  padding-top: env(safe-area-inset-top);
}
.admin-bar .majd-topbar { top: 32px; }
.majd-topbar-inner {
  height: var(--topbar);
  min-height: var(--topbar);
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.majd-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 200px;
}
.majd-brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}
.majd-brand img {
  animation: majd-wiggle 3.6s ease-in-out infinite;
}
.majd-brand strong {
  display: block;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--ink);
}
.majd-brand small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.majd-search {
  flex: 1;
  max-width: 460px;
  position: relative;
}
.majd-search input {
  width: 100%;
  border: 2.5px solid var(--ink);
  background: #fff;
  border-radius: 999px;
  padding: 9px 40px 9px 14px;
  font-size: 14px;
  outline: none;
  box-shadow: 3px 3px 0 var(--ink);
}
.majd-search input:focus { border-color: var(--accent); background: #fff; }
.majd-search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.majd-top-actions {
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}
.majd-icon-btn {
  width: 38px;
  height: 38px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
  transition: transform .18s ease, background .18s ease, color .18s ease;
}
.majd-icon-btn.is-active,
.majd-icon-btn:hover {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--ink);
  transform: rotate(-6deg) scale(1.06);
}
.majd-badge {
  position: absolute;
  top: 2px;
  left: 2px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-style: normal;
  min-width: 15px;
  height: 15px;
  border-radius: 99px;
  display: grid;
  place-items: center;
  padding: 0 4px;
}

.majd-dropdown {
  display: none;
  position: absolute;
  top: 50px;
  left: 0;
  width: 340px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  z-index: 60;
}
.majd-dropdown.open { display: block; }
.majd-dropdown.user { width: 250px; }
.majd-dropdown-head,
.majd-drop-profile {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.majd-drop-profile { gap: 10px; justify-content: flex-start; }
.majd-dropdown.user a {
  display: block;
  padding: 11px 16px;
}
.majd-dropdown.user a:hover { background: var(--hover); }
.majd-drop-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.majd-drop-item.unread { background: var(--accent-soft); }
.majd-drop-item small { color: var(--muted); }
.majd-drop-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.majd-drop-copy em {
  font-style: normal;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.majd-dropdown-list { max-height: 380px; overflow: auto; }
.majd-drop-foot {
  display: block;
  text-align: center;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  font-weight: 700;
  color: var(--accent);
  font-size: 13px;
}
.majd-drop-foot:hover { background: var(--hover); }
.majd-empty-mini { padding: 20px; color: var(--muted); margin: 0; }
.majd-dropdown-list.page { max-height: none; }
.majd-dropdown-list.page .majd-drop-item:last-child { border: 0; }

.majd-userchip {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
}

.majd-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 22px 18px 40px;
  display: grid;
  grid-template-columns: var(--side) minmax(0, 640px) var(--side);
  justify-content: center;
  gap: 22px;
  align-items: start;
}
.majd-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.majd-feed {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.majd-sidebar { position: sticky; top: 78px; display: flex; flex-direction: column; gap: 14px; }
.admin-bar .majd-sidebar { top: 110px; }

.majd-card {
  background: var(--card);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: visible;
  transition: transform .2s ease, box-shadow .2s ease;
}
.majd-feed .majd-card:nth-child(3n+1),
.groups-grid .majd-card:nth-child(3n+1),
.resources-grid .majd-card:nth-child(3n+1) {
  border-radius: 26px 14px 22px 18px / 16px 24px 14px 22px;
}
.majd-feed .majd-card:nth-child(3n+2),
.groups-grid .majd-card:nth-child(3n+2),
.resources-grid .majd-card:nth-child(3n+2) {
  border-radius: 16px 28px 18px 24px / 22px 14px 26px 16px;
}
.majd-feed .post-card:hover,
.groups-grid .majd-card:hover,
.resources-grid .majd-card:hover,
.landing .majd-card:hover,
.landing-fake-card:hover {
  transform: translate(-3px, -4px) rotate(-0.6deg);
  box-shadow: 8px 8px 0 var(--ink);
}
.majd-card.pad { padding: 16px 18px; }
.majd-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.majd-card-head h3,
.page-hero h1,
.auth-card h2 { margin: 0 0 6px; font-size: 18px; font-weight: 700; }
.majd-card-head a,
.majd-text-btn {
  color: var(--accent);
  background: none;
  border: 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}

.majd-mini-profile,
.majd-group-row,
.majd-side-nav a,
.majd-shortcuts a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 8px;
}
.majd-mini-profile:hover,
.majd-side-nav a:hover,
.majd-shortcuts a:hover,
.majd-group-row:hover { background: var(--hover); }
.majd-side-nav a.is-active {
  background: var(--gold);
  color: var(--ink);
  font-weight: 800;
}
.majd-nav-ico {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  color: var(--accent);
  display: grid;
  place-items: center;
}
.majd-side-nav a.is-active .majd-nav-ico { background: transparent; }
.majd-shortcuts h4 {
  margin: 10px 8px 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.dot.lg { width: 14px; height: 14px; }

.majd-avatar-link { display: block; flex: 0 0 auto; }
.majd-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--avatar, var(--accent));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  flex: 0 0 auto;
  overflow: hidden;
  position: relative;
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}
.majd-avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.majd-avatar.xl { width: 88px; height: 88px; font-size: 28px; }
.majd-avatar.has-photo { background: #D9D0C3; }
.majd-avatar.has-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.majd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 2.5px solid var(--ink);
  border-radius: 14px 18px 12px 16px / 16px 12px 18px 14px;
  padding: 9px 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.majd-btn.primary { background: var(--accent); color: #fff; }
.majd-btn.primary:hover { background: #ff6f52; transform: translate(-1px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.majd-btn.primary:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.majd-btn.ghost {
  background: #fff;
  color: var(--ink);
}
.majd-btn.ghost:hover { background: var(--gold); transform: translate(-1px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.majd-btn.sm { padding: 7px 12px; font-size: 13px; }
.majd-btn.lg { padding: 12px 22px; font-size: 16px; }
.majd-btn.danger { background: var(--danger); color: #fff; }
.majd-btn.danger:hover { background: #e22748; }
.majd-btn.block { width: 100%; }
.majd-btn svg { width: 16px; height: 16px; }

.composer { border-color: #d8cbb6; }
.composer-row, .composer-guest {
  display: flex;
  gap: 10px;
  padding: 14px 16px 10px;
}
.majd-composer textarea,
.composer-fake {
  flex: 1;
  border: 2px dashed var(--ink);
  background: #FFF8E8;
  border-radius: 16px 22px 14px 20px / 20px 14px 22px 16px;
  padding: 10px 14px;
  resize: none;
  outline: none;
  font-size: 15px;
  line-height: 1.7;
}
.composer-fake { color: var(--muted); display: flex; align-items: center; }
.composer-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 14px;
  border-top: 1px dashed var(--line);
}
.composer-tools .tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  padding: 7px 9px;
  border-radius: 8px;
}
.composer-tools .tool:hover { background: var(--hover); color: var(--ink); }
.composer-tools select {
  border: 2px solid var(--ink);
  background: #fff;
  border-radius: 12px;
  padding: 7px 10px;
  box-shadow: 2px 2px 0 var(--ink);
}
.composer-preview {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 16px 8px;
  padding: 8px 12px;
  background: var(--accent-soft);
  border-radius: 8px;
  color: var(--accent);
}
.composer-tools .majd-btn { margin-inline-start: auto; }

.attach-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 16px 10px;
}
.attach-item {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px;
  background: #F7F2EA;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.attach-item img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  flex: 0 0 auto;
}
.attach-pdf {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  background: #F4E4DC;
  color: var(--danger);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 auto;
}
.attach-meta { min-width: 0; flex: 1; }
.attach-meta strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attach-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 4px;
}
.attach-actions select {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 12px;
}

.majd-crop {
  position: fixed;
  inset: 0;
  background: rgba(26, 35, 50, .55);
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 16px;
}
.majd-crop[hidden] { display: none !important; }
.majd-crop-panel {
  width: min(92vw, 580px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.majd-crop-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.majd-crop-stage {
  position: relative;
  height: min(64vh, 480px);
  background: #1A2332;
  display: grid;
  place-items: center;
  overflow: hidden;
  user-select: none;
  touch-action: none;
}
.majd-crop-media {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  line-height: 0;
}
.majd-crop-stage img {
  max-width: 100%;
  max-height: min(64vh, 480px);
  display: block;
  pointer-events: none;
}
.majd-crop-box {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid #E8C56B;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .48);
  cursor: grab;
  touch-action: none;
  will-change: left, top, width, height;
}
.majd-crop-box.is-drag { cursor: grabbing; }
.majd-crop-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, transparent 33.2%, rgba(255,255,255,.4) 33.2%, rgba(255,255,255,.4) 33.55%, transparent 33.55%, transparent 66.45%, rgba(255,255,255,.4) 66.45%, rgba(255,255,255,.4) 66.8%, transparent 66.8%),
    linear-gradient(to bottom, transparent 33.2%, rgba(255,255,255,.4) 33.2%, rgba(255,255,255,.4) 33.55%, transparent 33.55%, transparent 66.45%, rgba(255,255,255,.4) 66.45%, rgba(255,255,255,.4) 66.8%, transparent 66.8%);
}
.majd-crop-box i {
  position: absolute;
  width: 18px;
  height: 18px;
  background: #fff;
  border: 2px solid #C4A15A;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  z-index: 2;
}
.majd-crop-box i::after {
  content: "";
  position: absolute;
  inset: -14px;
}
.majd-crop-box i[data-handle="nw"] { top: -9px; left: -9px; cursor: nwse-resize; }
.majd-crop-box i[data-handle="ne"] { top: -9px; right: -9px; cursor: nesw-resize; }
.majd-crop-box i[data-handle="sw"] { bottom: -9px; left: -9px; cursor: nesw-resize; }
.majd-crop-box i[data-handle="se"] { bottom: -9px; right: -9px; cursor: nwse-resize; }
.majd-crop-box i[data-handle="n"],
.majd-crop-box i[data-handle="s"] {
  width: 44px;
  height: 10px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 999px;
  cursor: ns-resize;
}
.majd-crop-box i[data-handle="n"] { top: -6px; }
.majd-crop-box i[data-handle="s"] { bottom: -6px; }
.majd-crop-box i[data-handle="w"],
.majd-crop-box i[data-handle="e"] {
  width: 10px;
  height: 44px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 999px;
  cursor: ew-resize;
}
.majd-crop-box i[data-handle="w"] { left: -6px; }
.majd-crop-box i[data-handle="e"] { right: -6px; }
.majd-crop-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--line);
}
.majd-crop-hint {
  flex: 1 0 100%;
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.majd-crop-size {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  min-width: 180px;
}
.majd-crop-zoom-label { min-width: 100%; }
.majd-crop-size input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
  height: 22px;
  cursor: pointer;
}
.majd-crop.is-square #majd-crop-size-wrap,
.majd-crop.is-square i[data-handle="n"],
.majd-crop.is-square i[data-handle="s"],
.majd-crop.is-square i[data-handle="e"],
.majd-crop.is-square i[data-handle="w"] { display: none; }

.post-gallery {
  display: grid;
  gap: 4px;
  margin: 12px -16px 0;
  overflow: hidden;
}
.post-gallery.count-1 { grid-template-columns: 1fr; }
.post-gallery.count-2,
.post-gallery.count-4 { grid-template-columns: 1fr 1fr; }
.post-gallery.count-3 { grid-template-columns: 1fr 1fr; }
.post-gallery.count-3 .post-image:first-child { grid-column: 1 / -1; }
.post-image { display: block; }
.post-gallery .post-image img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  display: block;
}
.post-gallery.count-1 .post-image img {
  height: auto;
  max-height: 420px;
  object-fit: contain;
  background: #FFF3D6;
}
.feed-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 8px;
}
.feed-filters a {
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  box-shadow: 2px 2px 0 var(--ink);
}
.feed-filters a.is-on,
.feed-filters a:hover {
  background: var(--gold);
  color: var(--ink);
}

.post-card { background: #FFFcf7; overflow: visible; }
.post-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 0;
}
.post-more { position: relative; flex: 0 0 auto; }
.post-more-btn {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.post-more-btn svg { width: 18px; height: 18px; }
.post-more-btn:hover { background: var(--hover); color: var(--ink); }
.majd-dropdown.post-menu {
  width: 148px;
  top: 34px;
  left: auto;
  right: auto;
  inset-inline-end: 0;
}
.post-menu button {
  display: block;
  width: 100%;
  text-align: inherit;
  border: 0;
  background: none;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}
.post-menu button:hover { background: var(--hover); }
.post-menu .is-danger { color: var(--danger); }
.inline-edit {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.inline-edit textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  min-height: 90px;
  resize: vertical;
  background: #fff;
}
.inline-edit-actions { display: flex; gap: 8px; }
.post-meta { flex: 1; min-width: 0; }
.post-meta strong { font-weight: 600; }
.post-meta small, .post-meta small a { color: var(--muted); }
.post-body { padding: 10px 16px 14px; }
.post-title { font-size: 16.5px; margin: 0 0 8px; font-weight: 700; line-height: 1.45; }
.post-content { color: #2A322C; line-height: 1.85; white-space: pre-wrap; font-size: 15px; }

.majd-chip {
  background: var(--chip, var(--gold));
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 2px 2px 0 var(--ink);
}
.majd-chip.xs { font-size: 11px; }

.file-card {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #FBF7F0;
}
.file-ico {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #F4E4DC;
  color: var(--danger);
  display: grid;
  place-items: center;
}
.file-card div { flex: 1; }
.file-card small { color: var(--muted); }

.post-stats {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  padding: 4px 16px 10px;
}
.post-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
}
.post-actions .act {
  border: 0;
  background: none;
  padding: 11px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  border-radius: 0;
  font-size: 13px;
}
.post-actions .act:hover { background: var(--hover); color: var(--ink); }
.post-actions .act.is-on { color: var(--accent); }
.post-actions .act.is-pop { animation: majd-pop .38s ease; }
.bookmark-btn.is-on { color: #d97706; }

.post-card:not(.comments-open) .post-comments { display: none; }
.post-comments {
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #FFF8E8;
  border-top: 2px dashed var(--ink);
}
.majd-comment { display: flex; gap: 8px; }
.majd-comment-body { flex: 1; min-width: 0; }
.majd-comment-top { display: flex; align-items: flex-start; gap: 4px; }
.majd-comment-bubble {
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 16px 20px 18px 8px / 18px 14px 16px 12px;
  padding: 8px 12px;
  flex: 1;
  min-width: 0;
  box-shadow: 2px 2px 0 var(--ink);
}
.majd-comment-bubble p { margin: 4px 0 0; }
.majd-comment-meta {
  display: flex;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  padding: 2px 8px;
}
.majd-reply-btn { border: 0; background: none; color: var(--muted); cursor: pointer; font-weight: 700; }
.comment-form {
  display: flex;
  gap: 8px;
  align-items: center;
}
.comment-form input[type="text"] {
  flex: 1;
  border: 2px dashed var(--ink);
  background: #fff;
  border-radius: 16px 20px 14px 18px / 18px 14px 20px 16px;
  padding: 9px 12px;
  outline: none;
}

.majd-trend-list { list-style: none; margin: 0; padding: 0; }
.majd-trend-list li + li { border-top: 1px solid var(--line); }
.majd-trend-list a { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; }
.majd-trend-list small, .majd-muted { color: var(--muted); }
.majd-card.tip {
  background: var(--gold);
  border-color: var(--ink);
}
.tip-kicker {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .03em;
  color: var(--ink);
}
.majd-card.tip p { margin: 0; line-height: 1.75; color: var(--ink); }
.group-badge, .group-card .group-banner > span {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.resources-grid, .groups-grid, .subjects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.resource-card, .group-card { display: flex; flex-direction: column; }
.resource-cover, .group-banner {
  height: 104px;
  display: grid;
  place-items: center;
  color: #fff;
  position: relative;
  overflow: hidden;
  border-bottom: 2.5px solid var(--ink);
}
.resource-cover { background: var(--c, var(--accent)); }
.resource-cover em {
  position: absolute;
  bottom: 8px;
  right: 10px;
  font-style: normal;
  font-size: 12px;
  background: rgba(0,0,0,.22);
  padding: 3px 8px;
  border-radius: 6px;
}
.resource-cover svg { width: 32px; height: 32px; }
.resource-body, .group-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.resource-body h3, .group-body h3 { margin: 0; font-size: 15px; }
.resource-meta { display: flex; gap: 8px; flex-wrap: wrap; padding: 0; margin: 0; color: var(--muted); font-size: 12px; }
.resource-meta li { list-style: none; }
.resource-foot, .group-foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.group-banner { height: 88px; font-size: 26px; font-weight: 700; }
.group-hero {
  overflow: hidden;
}
.group-hero::before {
  content: "";
  display: block;
  height: 8px;
  background: var(--group, var(--accent));
}
.group-hero-inner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px 18px;
  flex-wrap: wrap;
}
.group-hero-mark {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 16px;
  background: var(--group, var(--accent));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 22px;
  border: 2.5px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}
.group-hero-main {
  flex: 1 1 180px;
  min-width: 0;
}
.group-hero-main h1 {
  margin: 0 0 4px;
  font-size: 22px;
  line-height: 1.35;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.group-hero-main p {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.7;
}
.group-hero-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.group-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-inline-start: auto;
}

.subject-tile-wrap {
  position: relative;
  display: flex;
  min-width: 0;
}
.subject-tile {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  width: 100%;
}
.subject-tile:hover { background: #FBF7F0; }
.subject-delete {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
}
.subject-tile-wrap:has(.subject-delete) .subject-tile {
  padding-left: 72px;
}
.page-hero p { margin: 0; color: var(--muted); line-height: 1.7; }
.page-hero.has-actions {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.majd-comment { scroll-margin-top: 80px; }
.teacher-panel { margin-bottom: 14px; }
.teacher-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.teacher-panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  font-weight: 400;
}
.teacher-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.teacher-form[hidden] { display: none !important; }
.teacher-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.teacher-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  font-size: 13px;
}
.teacher-form input,
.teacher-form select,
.teacher-form textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  background: #fff;
  font-family: inherit;
}
.teacher-form textarea { resize: vertical; min-height: 72px; }
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.filter-bar select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
}
.profile-head { display: flex; align-items: center; gap: 14px; }
.profile-id { min-width: 0; }
.profile-id h1 { margin: 0 0 4px; }
.profile-id p { margin: 0; }
.profile-name-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.profile-name-form[hidden] { display: none !important; }
.profile-name-form input {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 15px;
  min-width: 180px;
  background: #fff;
}
.profile-avatar-wrap { position: relative; flex: 0 0 auto; }
.profile-avatar-cam {
  position: absolute;
  inset-inline-end: 0;
  bottom: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  border: 2px solid var(--card);
  box-shadow: 0 1px 4px rgba(26, 35, 50, .18);
}
.profile-avatar-cam svg { width: 14px; height: 14px; display: block; }
.profile-avatar-cam:hover { background: var(--accent-dark); }
.profile-head .majd-text-btn { margin-top: 6px; font-size: 13px; padding: 0; }
.profile-msg-btn { margin-top: 10px; }

body.is-messages .majd-shell {
  max-width: 1280px;
  grid-template-columns: var(--side) minmax(0, 1fr);
}
body.is-messages .majd-main { min-height: calc(100vh - 118px); }
.majd-chat {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: calc(100vh - 130px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.majd-chat-list {
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #FBF7F0;
}
.majd-chat-list-head {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--line);
}
.majd-chat-list-head h1 { margin: 0 0 10px; font-size: 20px; }
.majd-chat-list-head input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  font: inherit;
}
.majd-chat-convos,
.majd-chat-search-results {
  overflow: auto;
  flex: 1;
}
.majd-chat-search-results { border-bottom: 1px solid var(--line); max-height: 46%; }
.majd-chat-convo {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  text-align: right;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.majd-chat-convo:hover,
.majd-chat-convo.is-active { background: var(--accent-soft); }
.majd-chat-convo.has-unread strong { color: var(--ink); }
.majd-chat-convo-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.majd-chat-convo-meta small {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.majd-chat-convo-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
}
.majd-chat-convo-side .majd-badge { position: static; }
.majd-chat-thread {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: #FFF8E8;
}
.majd-chat-peer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  min-height: 58px;
  background: var(--card);
}
.majd-chat-peer a { color: inherit; }
.majd-chat-peer small { display: block; color: var(--muted); }
.majd-chat-back {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--ink);
  display: none;
  place-items: center;
  cursor: pointer;
  border-radius: 8px;
  flex: 0 0 auto;
}
.majd-chat-back:hover { background: var(--accent-soft); }
.majd-chat-back svg { width: 18px; height: 18px; }
.majd-chat-msgs {
  flex: 1;
  overflow: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.majd-chat-empty {
  margin: auto;
  text-align: center;
  color: var(--muted);
  padding: 40px 16px;
  max-width: 280px;
}
.majd-chat-empty[hidden] { display: none !important; }
.majd-chat-bubble {
  max-width: 78%;
  padding: 8px 12px;
  border-radius: 14px;
}
.majd-chat-bubble p { margin: 0; white-space: pre-wrap; word-break: break-word; }
.majd-chat-bubble small { display: block; margin-top: 4px; font-size: 11px; opacity: .72; }
.majd-chat-bubble.mine {
  align-self: flex-start;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.majd-chat-bubble.theirs {
  align-self: flex-end;
  background: #fff;
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}
.majd-chat-form {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
  background: var(--card);
  align-items: flex-end;
}
.majd-chat-form[hidden] { display: none !important; }
.majd-chat-form textarea {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  resize: none;
  min-height: 42px;
  max-height: 120px;
  font: inherit;
  background: #fff;
}
.majd-chat-form .majd-btn {
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.majd-chat-form .majd-btn svg { width: 18px; height: 18px; }
.majd-bottom-ico { position: relative; display: grid; place-items: center; }
.majd-bottom-ico .majd-badge { top: -4px; left: -8px; }
.majd-icon-btn svg { width: 20px; height: 20px; display: block; }
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.section-title { margin: 8px 4px; }

.auth-wrap {
  max-width: 880px;
  width: 100%;
  margin: 48px auto;
  padding: 0 16px 80px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: center;
}
@media (min-width: 1101px) {
  .auth-wrap { grid-template-columns: 1.05fr .95fr; }
}
.auth-hero h1 {
  color: var(--ink);
  font-size: 38px;
  margin: 12px 0;
}
.auth-hero p { color: var(--muted); font-size: 16px; line-height: 1.85; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
.auth-form label.inline { flex-direction: row; align-items: center; font-weight: 500; color: var(--muted); }
.auth-form input, .auth-form select {
  width: 100%;
  border: 2.5px solid var(--ink);
  border-radius: 14px 18px 12px 16px / 16px 12px 18px 14px;
  padding: 12px;
  font-size: 16px;
  background: #fff;
  box-shadow: 3px 3px 0 var(--ink);
}
.majd-pass-wrap {
  position: relative;
  display: block;
}
.majd-pass-wrap input {
  width: 100%;
  box-sizing: border-box;
  padding-inline-end: 46px;
}
.majd-pass-toggle {
  position: absolute;
  inset-inline-end: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  border-radius: 8px;
}
.majd-pass-toggle:hover { color: var(--accent); background: var(--accent-soft); }
.majd-pass-toggle svg { width: 20px; height: 20px; display: block; }
.auth-switch { text-align: center; color: var(--muted); }
.auth-switch a { color: var(--accent); font-weight: 700; }
.empty-feed { text-align: center; color: var(--muted); padding: 40px 20px; }
.group-lock h2 { margin: 0 0 8px; }
.group-lock p { margin: 0 0 14px; color: var(--muted); line-height: 1.75; }
.group-requests h2 { margin: 0 0 12px; font-size: 18px; }
.group-request-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.group-request-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: #fff;
}
.group-request-row div { flex: 1; min-width: 120px; }
.group-request-row strong { display: block; }
.group-request-row small { color: var(--muted); }
.join-card p { color: var(--muted); margin: 0 0 12px; line-height: 1.7; }

.majd-bottom-nav { display: none; }
.majd-dialog {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
}
.majd-dialog[hidden] { display: none !important; }
.majd-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 35, 50, .52);
}
.majd-dialog-panel {
  position: relative;
  width: min(92vw, 400px);
  background: var(--card);
  border: 2.5px solid var(--ink);
  border-radius: 22px 16px 26px 18px / 18px 24px 16px 22px;
  padding: 20px 20px 16px;
  box-shadow: 8px 8px 0 var(--ink);
  animation: majd-in .28s ease;
}
.majd-dialog-panel h2 {
  margin: 0 0 8px;
  font-size: 20px;
}
.majd-dialog-panel h2[hidden] { display: none !important; }
.majd-dialog-panel p {
  margin: 0;
  color: var(--ink);
  line-height: 1.7;
  white-space: pre-wrap;
}
.majd-dialog-actions {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 18px;
}
body.majd-dialog-open { overflow: hidden; }
.majd-pagination { display: flex; justify-content: center; gap: 6px; padding: 4px 0 8px; }
.majd-pagination a, .majd-pagination span {
  background: var(--card);
  border: 2px solid var(--ink);
  padding: 6px 10px;
  border-radius: 12px;
  box-shadow: 2px 2px 0 var(--ink);
  font-weight: 700;
}
.pad-sm { padding: 8px 0 0; }

body.is-landing {
  background-image:
    radial-gradient(circle at 10% 8%, rgba(255, 90, 60, .2) 0 180px, transparent 181px),
    radial-gradient(circle at 90% 12%, rgba(76, 155, 255, .18) 0 200px, transparent 201px),
    radial-gradient(circle at 70% 90%, rgba(255, 201, 60, .28) 0 220px, transparent 221px);
  background-color: #FFF3D6;
}
body.is-landing .majd-search,
body.is-landing .majd-icon-btn,
body.is-landing .majd-notif-toggle,
body.is-landing .majd-bottom-nav,
body.page-template-template-login .majd-search,
body.page-template-template-register .majd-search { display: none !important; }
body.is-landing .majd-topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 252, 247, .92);
  backdrop-filter: blur(10px);
}

.landing {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}
.landing-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
  padding: 28px 0 20px;
}
@media (min-width: 1101px) {
  .landing-hero { grid-template-columns: 1.1fr .9fr; }
}
.landing-kicker {
  display: inline-block;
  margin: 0 0 14px;
  background: var(--gold);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 5px 12px;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 3px 3px 0 var(--ink);
}
.landing-hero h1 {
  font-size: clamp(32px, 4.6vw, 52px);
  line-height: 1.22;
  margin: 0 0 14px;
  color: var(--ink);
}
.landing-lead {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.85;
  max-width: 36em;
}
.landing-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.landing-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.landing-pills li {
  background: #fff;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 2px 2px 0 var(--ink);
}
.landing-preview { position: relative; min-height: 280px; }
.landing-fake-card {
  background: var(--card);
  border: 2.5px solid var(--ink);
  border-radius: 22px 16px 26px 18px / 18px 24px 16px 22px;
  padding: 16px;
  box-shadow: 6px 6px 0 var(--ink);
  --tilt: 0deg;
  animation: majd-float 4.5s ease-in-out infinite;
}
.landing-fake-card header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.landing-fake-card header div { flex: 1; }
.landing-fake-card strong { display: block; font-size: 14px; }
.landing-fake-card small { color: var(--muted); font-size: 12px; }
.landing-fake-card p { margin: 0; line-height: 1.7; color: var(--ink); }
.landing-fake-card.tilt-a { --tilt: -3deg; }
.landing-fake-card.tilt-b {
  --tilt: 3.5deg;
  margin-top: -28px;
  margin-right: 36px;
  animation-delay: .6s;
}
.landing-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 28px 0 8px;
}
.landing-stats div {
  background: var(--card);
  border: 2.5px solid var(--ink);
  border-radius: 18px 24px 16px 22px / 22px 16px 24px 18px;
  padding: 18px 14px;
  text-align: center;
  box-shadow: 4px 4px 0 var(--ink);
}
.landing-stats div:nth-child(1) { background: #FFE1D8; }
.landing-stats div:nth-child(2) { background: #DCECFF; }
.landing-stats div:nth-child(3) { background: #D4F6F2; }
.landing-stats div:nth-child(4) { background: #FFE58A; }
.landing-stats strong {
  display: block;
  font-family: "Baloo Bhaijaan 2", Amiri, serif;
  font-size: 30px;
  color: var(--ink);
}
.landing-stats span { color: var(--ink); font-size: 13px; font-weight: 700; opacity: .75; }
.landing-block { padding: 42px 0 8px; }
.landing-head { text-align: center; margin-bottom: 22px; }
.landing-head h2,
.landing-final h2 {
  font-size: 34px;
  margin: 0 0 8px;
}
.landing-head p { margin: 0; color: var(--muted); }
.landing-live-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.landing-group-tile {
  display: flex;
  align-items: center;
  gap: 12px;
}
.landing-group-tile strong { display: block; }
.landing-group-tile small { color: var(--muted); }
.landing-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.landing-features article {
  background: var(--card);
  border: 2.5px solid var(--ink);
  border-radius: 20px 14px 24px 18px / 16px 22px 14px 20px;
  box-shadow: 4px 4px 0 var(--ink);
  padding: 18px 16px;
}
.landing-features h3 { margin: 0 0 8px; font-size: 17px; }
.landing-features p { margin: 0; color: var(--muted); line-height: 1.7; }
.landing-ico {
  width: 44px;
  height: 44px;
  border-radius: 14px 18px 12px 16px / 16px 12px 18px 14px;
  background: var(--gold);
  color: var(--ink);
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  animation: majd-wiggle 2.8s ease-in-out infinite;
}
.landing-features article:nth-child(2) .landing-ico { background: #DCECFF; animation-delay: .15s; }
.landing-features article:nth-child(3) .landing-ico { background: #D4F6F2; animation-delay: .3s; }
.landing-features article:nth-child(4) .landing-ico { background: #FFE1D8; animation-delay: .45s; }
.landing-features article:nth-child(5) .landing-ico { background: #E8E0FF; animation-delay: .6s; }
.landing-features article:nth-child(6) .landing-ico { background: #FFE58A; animation-delay: .75s; }
.landing-ico svg { width: 20px; height: 20px; }
.landing-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.landing-steps li {
  display: flex;
  gap: 12px;
  background: var(--card);
  border: 2.5px solid var(--ink);
  border-radius: 20px 14px 22px 16px / 16px 22px 14px 20px;
  padding: 18px 16px;
  box-shadow: 4px 4px 0 var(--ink);
}
.landing-steps em {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-style: normal;
  font-weight: 800;
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}
.landing-steps strong { display: block; margin-bottom: 4px; }
.landing-steps p { margin: 0; color: var(--muted); line-height: 1.7; }
.landing-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 28px 0;
}
.landing-split small {
  color: var(--gold);
  font-weight: 700;
  font-size: 12px;
}
.landing-split h3 { margin: 6px 0 8px; font-size: 26px; }
.landing-split p { color: var(--muted); line-height: 1.75; margin: 0 0 14px; }
.landing-teacher { background: var(--violet); color: #fff; }
.landing-teacher small { color: var(--gold); }
.landing-teacher p { color: rgba(255,255,255,.9); }
.landing-teacher .majd-btn.ghost {
  color: var(--ink);
  background: #fff;
}
.landing-teacher .majd-btn.ghost:hover { background: var(--gold); }
.landing-final {
  text-align: center;
  background: var(--gold);
  border: 2.5px solid var(--ink);
  border-radius: 28px 20px 32px 22px / 22px 30px 18px 26px;
  padding: 36px 20px;
  margin: 10px 0 28px;
  box-shadow: 6px 6px 0 var(--ink);
}
.landing-final p { color: var(--ink); margin: 0 0 18px; font-weight: 600; }
.landing-final .landing-cta-row { justify-content: center; }
.landing-foot {
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
  padding-top: 8px;
  color: var(--muted);
}
.landing-foot div {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}
.landing-foot img { width: 32px; height: 32px; border-radius: 8px; }
.landing-foot nav { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.landing-foot nav a { font-weight: 600; color: var(--accent); }

@media (max-width: 1200px) {
  .majd-shell { grid-template-columns: var(--side) minmax(0, 1fr); }
  .majd-sidebar.end { display: none; }
}
@media screen and (max-width: 782px) {
  .admin-bar .majd-topbar { top: 46px; }
  .admin-bar .majd-sidebar { top: 124px; }
}

@media (hover: none), (pointer: coarse) {
  .majd-feed .post-card:hover,
  .groups-grid .majd-card:hover,
  .resources-grid .majd-card:hover,
  .landing .majd-card:hover,
  .landing-fake-card:hover {
    transform: none;
    box-shadow: var(--shadow);
  }
  .majd-icon-btn.is-active,
  .majd-icon-btn:hover {
    transform: none;
  }
  .majd-btn.primary:hover,
  .majd-btn.ghost:hover {
    transform: none;
    box-shadow: 3px 3px 0 var(--ink);
  }
}

@media (max-width: 1100px) {
  :root { --shadow: 3px 3px 0 var(--ink); --bottom-nav: 62px; }
  body.majd-body { min-height: 100dvh; }
  .majd-topbar-inner {
    height: auto;
    min-height: var(--topbar);
    flex-wrap: wrap;
    padding: 8px 12px;
    gap: 8px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  .majd-brand {
    min-width: 0;
    flex: 1 1 auto;
    gap: 8px;
  }
  .majd-brand img { width: 32px; height: 32px; }
  .majd-brand strong { font-size: 16px; }
  .majd-brand span small { display: none; }
  .is-desktop-nav,
  .is-desktop-cta { display: none !important; }
  .majd-search {
    display: block;
    order: 3;
    flex: 1 1 100%;
    max-width: none;
    width: 100%;
  }
  .majd-search input {
    font-size: 16px;
    padding: 10px 40px 10px 14px;
    box-shadow: 2px 2px 0 var(--ink);
  }
  .majd-top-actions {
    margin-right: 0;
    gap: 4px;
    flex: 0 0 auto;
  }
  .majd-icon-btn,
  .majd-userchip .majd-avatar {
    width: 40px;
    height: 40px;
  }
  .majd-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: auto;
    width: min(340px, calc(100vw - 20px));
    max-height: min(70dvh, 420px);
    overflow: auto;
    z-index: 70;
  }
  .majd-dropdown.user { width: min(250px, calc(100vw - 20px)); }
  .majd-dropdown-list { max-height: min(52dvh, 320px); }
  .majd-dropdown.post-menu {
    width: 148px;
    left: auto;
    right: auto;
    inset-inline-end: 0;
    max-height: none;
    overflow: visible;
  }

  .majd-shell {
    grid-template-columns: 1fr;
    padding: 12px 10px calc(var(--bottom-nav) + env(safe-area-inset-bottom) + 16px);
    gap: 12px;
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }
  .majd-feed { gap: 12px; }
  .majd-sidebar.start { display: none; }
  .majd-card.pad { padding: 14px; }
  .majd-comment { scroll-margin-top: calc(var(--topbar) + env(safe-area-inset-top) + 12px); }

  .resources-grid,
  .groups-grid,
  .subjects-grid,
  .auth-wrap,
  .teacher-grid { grid-template-columns: 1fr; }
  .attach-preview { grid-template-columns: 1fr; }
  .post-actions .act {
    min-height: 44px;
    padding: 10px 4px;
  }
  .post-actions .act span { display: none; }

  .post-head { flex-wrap: wrap; padding: 14px 12px 0; }
  .post-body { padding: 10px 12px 12px; }
  .post-stats { padding: 4px 12px 10px; }
  .post-comments { padding: 12px; }
  .post-title { font-size: 16px; overflow-wrap: anywhere; }
  .post-content { overflow-wrap: anywhere; }
  .majd-chip {
    max-width: min(160px, 46vw);
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .file-card {
    flex-wrap: wrap;
    padding: 10px;
  }
  .file-card .majd-btn { width: 100%; }
  .post-gallery { margin-inline: -12px; }
  .post-gallery .post-image img { height: 180px; }
  .post-gallery.count-1 .post-image img { max-height: 320px; }

  .composer-row, .composer-guest { padding: 12px 12px 8px; }
  .majd-composer textarea,
  .composer-fake,
  .comment-form input[type="text"],
  .inline-edit textarea,
  .filter-bar select,
  .teacher-form input,
  .teacher-form select,
  .teacher-form textarea,
  .profile-name-form input,
  .auth-form input,
  .auth-form select,
  .majd-chat-list-head input,
  .majd-chat-form textarea {
    font-size: 16px;
  }
  .composer-tools {
    flex-wrap: wrap;
    padding: 8px 12px 12px;
  }
  .composer-tools .tool { font-size: 12px; padding: 8px; min-height: 44px; }
  .composer-tools select { font-size: 16px; max-width: 100%; }
  .composer-tools .majd-btn {
    margin-inline-start: 0;
    flex: 1 1 100%;
    min-height: 44px;
  }
  .composer-preview { margin-inline: 12px; }
  .attach-preview { margin-inline: 12px; }

  .page-hero.has-actions,
  .teacher-panel-head {
    flex-direction: column;
    align-items: stretch;
  }
  .page-hero.has-actions .majd-btn,
  .teacher-panel-head .majd-btn { width: 100%; min-height: 44px; }
  .filter-bar select {
    flex: 1 1 140px;
    min-width: 0;
    min-height: 44px;
  }
  .filter-bar .majd-btn { flex: 1 1 100%; min-height: 44px; }
  .teacher-form .majd-btn { width: 100%; min-height: 44px; }
  .profile-head { flex-wrap: wrap; align-items: flex-start; }
  .profile-id { flex: 1 1 160px; }
  .profile-id h1 { font-size: 22px; overflow-wrap: anywhere; }
  .profile-name-form { width: 100%; }
  .profile-name-form input { min-width: 0; width: 100%; }
  .profile-name-form .majd-btn { flex: 1; min-height: 44px; }
  .profile-msg-btn { width: 100%; min-height: 44px; }
  .majd-avatar.xl { width: 72px; height: 72px; font-size: 24px; }

  .group-hero-inner { padding: 14px; }
  .group-hero-main h1 { font-size: 20px; }
  .group-hero-actions {
    width: 100%;
    margin-inline-start: 0;
  }
  .group-hero-actions .majd-btn { flex: 1; min-height: 44px; }
  .resource-foot, .group-foot { gap: 10px; }
  .resource-foot .majd-btn, .group-foot .majd-btn { min-height: 40px; }

  .comment-form { align-items: stretch; }
  .comment-form input[type="text"] { min-width: 0; }
  .comment-form .majd-btn { min-height: 44px; flex: 0 0 auto; }

  .feed-filters {
    margin-inline: -2px;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .feed-filters::-webkit-scrollbar { display: none; }
  .feed-filters a { min-height: 40px; display: inline-flex; align-items: center; }

  .majd-bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    background: #FFFDF8;
    border-top: 3px solid var(--ink);
    z-index: 40;
    min-height: var(--bottom-nav);
    padding: 6px 0 max(8px, env(safe-area-inset-bottom));
    padding-inline: env(safe-area-inset-right) env(safe-area-inset-left);
  }
  .majd-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--muted);
    font-size: 11px;
    min-height: 48px;
    min-width: 0;
    font-weight: 700;
  }
  .majd-bottom-nav a span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .majd-bottom-nav a.is-active { color: var(--accent); }

  body.is-messages .majd-shell {
    grid-template-columns: 1fr;
    padding-top: 10px;
    padding-bottom: calc(var(--bottom-nav) + env(safe-area-inset-bottom) + 8px);
  }
  body.is-messages .majd-main {
    min-height: calc(100dvh - var(--topbar) - env(safe-area-inset-top) - var(--bottom-nav) - env(safe-area-inset-bottom) - 28px);
  }
  .majd-chat {
    grid-template-columns: 1fr;
    min-height: calc(100dvh - var(--topbar) - env(safe-area-inset-top) - var(--bottom-nav) - env(safe-area-inset-bottom) - 28px);
    border-radius: 16px;
  }
  .majd-chat-thread { display: none; }
  .majd-chat.thread-open .majd-chat-list { display: none; }
  .majd-chat.thread-open .majd-chat-thread { display: flex; }
  .majd-chat-back { display: grid; }
  .majd-chat-bubble { max-width: 86%; }
  .majd-chat-form { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .majd-chat-form textarea { min-height: 44px; }
  .majd-chat-form .majd-btn { width: 44px; height: 44px; }

  .auth-wrap {
    margin: 16px auto;
    padding: 0 12px calc(var(--bottom-nav) + env(safe-area-inset-bottom) + 24px);
    gap: 16px;
  }
  .auth-hero { text-align: center; }
  .auth-hero img { margin-inline: auto; width: 56px; height: 56px; }
  .auth-hero h1 { font-size: 28px; }
  .auth-hero p { font-size: 15px; }
  .auth-form .majd-btn { min-height: 48px; }

  .majd-dialog {
    padding: 12px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    align-items: end;
  }
  .majd-dialog-panel {
    width: 100%;
    max-width: none;
    box-shadow: 4px 4px 0 var(--ink);
  }
  .majd-dialog-actions { flex-wrap: wrap; }
  .majd-dialog-actions .majd-btn { flex: 1; min-height: 44px; }

  .majd-crop {
    padding: 0;
    place-items: stretch;
  }
  .majd-crop-panel {
    width: 100%;
    min-height: 100dvh;
    border-radius: 0;
    display: flex;
    flex-direction: column;
  }
  .majd-crop-stage,
  .majd-crop-stage img { height: min(48dvh, 360px); max-height: min(48dvh, 360px); }
  .majd-crop-tools { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .majd-crop-tools .majd-btn { flex: 1 1 46%; min-height: 44px; }
  .majd-crop-size { min-width: 0; width: 100%; }

  .majd-pagination { flex-wrap: wrap; }
  .empty-feed { padding: 28px 14px; }
  .empty-feed .majd-btn { width: 100%; min-height: 44px; }

  .landing {
    padding: 12px 14px calc(24px + env(safe-area-inset-bottom));
  }
  .landing-hero,
  .landing-features,
  .landing-live-groups,
  .landing-steps,
  .landing-split { grid-template-columns: 1fr; }
  .landing-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .landing-stats strong { font-size: 24px; }
  .landing-stats div { padding: 14px 10px; }
  .landing-preview { min-height: 0; }
  .landing-fake-card.tilt-a,
  .landing-fake-card.tilt-b { --tilt: 0deg; margin: 0 0 10px; }
  .landing-fake-card header { flex-wrap: wrap; }
  .landing-hero { padding: 12px 0 8px; gap: 18px; }
  .landing-hero h1 { font-size: clamp(26px, 8vw, 32px); }
  .landing-lead { font-size: 15px; margin-bottom: 16px; }
  .landing-cta-row { flex-direction: column; }
  .landing-cta-row .majd-btn { width: 100%; min-height: 48px; }
  .landing-head h2, .landing-final h2, .landing-split h3 { font-size: 24px; }
  .landing-block { padding: 28px 0 8px; }
  .landing-final { padding: 24px 14px; }
  .landing-pills { gap: 6px; }
  .landing-pills li { font-size: 12px; padding: 5px 10px; }
}

@media (max-width: 480px) {
  .majd-brand strong { font-size: 15px; }
  .majd-shell { padding-inline: 8px; }
  .subjects-grid,
  .resources-grid,
  .groups-grid { gap: 10px; }
  .landing { padding-inline: 12px; }
  .landing-stats span { font-size: 12px; }
  .post-gallery.count-2,
  .post-gallery.count-3,
  .post-gallery.count-4 { grid-template-columns: 1fr; }
  .post-gallery.count-3 .post-image:first-child { grid-column: auto; }
  .post-gallery .post-image img { height: 200px; }
  .composer-tools .tool svg { width: 18px; height: 18px; }
  .majd-bottom-nav a { font-size: 10px; }
}

@media (max-width: 400px) {
  .majd-brand span { display: none; }
  .landing-stats strong { font-size: 20px; }
  .auth-hero h1 { font-size: 24px; }
  .majd-chat-bubble { max-width: 92%; }
  .group-hero-main h1 { font-size: 18px; }
}

@media (max-width: 360px) {
  .landing-hero h1 { font-size: 22px; }
  .landing-kicker { font-size: 12px; }
  .comment-form { flex-wrap: wrap; }
  .comment-form .majd-btn { width: 100%; }
  .majd-bottom-nav a span { font-size: 9px; }
}

@media (max-width: 1100px) and (max-height: 500px) {
  .landing { padding-top: 6px; }
  .landing-hero { padding-top: 4px; }
  .landing-preview { display: none; }
  .majd-crop-stage,
  .majd-crop-stage img { height: min(38dvh, 220px); max-height: min(38dvh, 220px); }
  .majd-chat { min-height: calc(100dvh - 118px); }
  .majd-bottom-nav a { min-height: 40px; gap: 0; }
}

.majd-feed .post-card {
  animation: majd-in .4s ease both;
}
.empty-feed h1 { margin: 0 0 8px; }
.empty-feed p { margin: 0 0 16px; }

@keyframes majd-float {
  0%, 100% { transform: translateY(0) rotate(var(--tilt, 0deg)); }
  50% { transform: translateY(-10px) rotate(var(--tilt, 0deg)); }
}
@keyframes majd-wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-7deg); }
  75% { transform: rotate(7deg); }
}
@keyframes majd-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.28) rotate(-8deg); }
  100% { transform: scale(1) rotate(0); }
}
@keyframes majd-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .landing-fake-card,
  .landing-ico,
  .majd-brand img,
  .post-actions .act.is-pop,
  .majd-feed .post-card,
  .majd-dialog-panel {
    animation: none !important;
  }
  .majd-btn,
  .majd-card,
  .majd-icon-btn,
  .majd-feed .post-card:hover,
  .groups-grid .majd-card:hover,
  .resources-grid .majd-card:hover {
    transition: none !important;
  }
}
