:root {
  --lol-plum: #32123a;
  --lol-plum-2: #4f1e59;
  --lol-plum-3: #6b2f71;
  --lol-gold: #d0a64f;
  --lol-gold-light: #efd899;
  --lol-cream: #fbf7f1;
  --lol-cream-2: #f3e9df;
  --lol-ink: #271b29;
  --lol-muted: #6d606b;
  --lol-line: rgba(50, 18, 58, .12);
  --lol-shadow: 0 18px 46px rgba(50, 18, 58, .10);
}

/* Shared platform canvas */
body.lol-platform-page,
body.buddypress,
body.directory {
  background: #f6f1f7;
}

body.lol-platform-page .site-content,
body.buddypress .site-content,
body.directory .site-content,
body.lol-platform-page #content,
body.buddypress #content,
body.directory #content {
  background:
    radial-gradient(circle at 90% 10%, rgba(208,166,79,.10), transparent 20%),
    linear-gradient(180deg, #f8f4f8 0%, #f5eff6 100%);
}

/* Do not repeat the ordinary WordPress page title on LOL shell pages. */
body.lol-platform-page .entry-header,
body.lol-platform-page .page-header,
body.lol-platform-page .entry-title {
  display: none !important;
}

.lol-page-shell,
.lol-bp-intro {
  color: var(--lol-ink);
}

/* Branded page hero used on WordPress shell pages. */
.lol-page-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 18%, rgba(239,216,153,.18), transparent 25%),
    linear-gradient(135deg, #24102d 0%, var(--lol-plum) 56%, var(--lol-plum-2) 100%);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 28px;
  padding: clamp(34px, 5vw, 62px);
  margin: 22px 0 24px;
  box-shadow: var(--lol-shadow);
}

.lol-page-hero::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--lol-gold), transparent);
}

.lol-page-hero h1 {
  margin: 8px 0 12px;
  color: #fff !important;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(2.4rem, 5vw, 4.7rem);
  line-height: 1.02;
  letter-spacing: -.025em;
}

.lol-page-hero p {
  max-width: 850px;
  margin: 0;
  color: #eee5ef !important;
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  line-height: 1.65;
}

.lol-eyebrow {
  color: var(--lol-gold-light) !important;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: .76rem;
}

/* BuddyPress directory intro: compact, purple, useful. */
.lol-bp-intro {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 90% 10%, rgba(239,216,153,.17), transparent 24%),
    linear-gradient(135deg, #281131, #4a1d55);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 24px;
  padding: clamp(24px, 4vw, 38px);
  margin: 20px 0 26px;
  box-shadow: var(--lol-shadow);
}

.lol-bp-intro p {
  max-width: 820px;
  margin: 10px 0 0;
  color: #f2ebf3 !important;
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  line-height: 1.6;
}

/* Functional navigation inside LOL shell pages. */
.lol-member-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 4px 0 20px;
  margin: 0 0 12px;
  overflow: visible;
}

.lol-member-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  color: var(--lol-plum) !important;
  border: 1px solid rgba(50,18,58,.12);
  background: #fff !important;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 750;
  line-height: 1.1;
  box-shadow: 0 6px 18px rgba(50,18,58,.05);
}

.lol-member-links a:hover,
.lol-member-links a:focus {
  background: var(--lol-plum) !important;
  color: #fff !important;
  border-color: var(--lol-plum);
}

/* Cards for community dashboard and future secure modules. */
.lol-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 24px 0 32px;
}

.lol-card {
  display: block;
  text-decoration: none !important;
  background: #fff;
  border: 1px solid var(--lol-line);
  border-radius: 22px;
  padding: 26px;
  box-shadow: var(--lol-shadow);
}

.lol-card:hover {
  transform: translateY(-2px);
  border-color: rgba(208,166,79,.55);
}

.lol-card strong {
  display: block;
  color: var(--lol-plum);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.35rem;
  margin-bottom: 8px;
}

.lol-card span {
  color: var(--lol-muted);
  line-height: 1.55;
}

.lol-module-wrap {
  width: 100%;
  margin: 24px 0;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--lol-shadow);
  background: #fff;
}

.lol-private-placeholder {
  border: 1px solid rgba(208,166,79,.45);
  background: linear-gradient(135deg, #fffdf9, var(--lol-cream));
  border-radius: 22px;
  padding: 30px;
  margin-top: 28px;
  color: var(--lol-ink);
}

.lol-private-placeholder h2 {
  color: var(--lol-plum) !important;
  font-family: Georgia, 'Times New Roman', serif;
  margin-top: 0;
}

/* BuddyPress functional content: retain native behavior, brand the surfaces. */
.buddypress-wrap,
#buddypress {
  color: var(--lol-ink);
}

.buddypress-wrap .item-list-tabs,
.buddypress-wrap .bp-navs,
.buddypress-wrap .subnav-filters,
.buddypress-wrap .bp-list,
.buddypress-wrap .members-list,
.buddypress-wrap .groups-list {
  border-color: var(--lol-line);
}

.buddypress-wrap .members-list > li,
.buddypress-wrap .groups-list > li,
.buddypress-wrap .activity-list > li,
.buddypress-wrap .grid > li,
.buddypress-wrap .item-entry {
  background: #fff;
  border-color: var(--lol-line) !important;
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(50,18,58,.05);
}

.buddypress-wrap input[type='text'],
.buddypress-wrap input[type='search'],
.buddypress-wrap input[type='email'],
.buddypress-wrap input[type='password'],
.buddypress-wrap textarea,
.buddypress-wrap select {
  background: #fff !important;
  color: var(--lol-ink) !important;
  border: 1px solid rgba(50,18,58,.14) !important;
  border-radius: 12px !important;
}

.buddypress-wrap .button,
.buddypress-wrap button,
.buddypress-wrap input[type='submit'] {
  background: var(--lol-plum) !important;
  color: #fff !important;
  border: 1px solid var(--lol-plum) !important;
  border-radius: 999px !important;
}

.buddypress-wrap a {
  color: var(--lol-plum-2);
}

/* Admin cards */
.lol-admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.lol-admin-card {
  background: #fff;
  border: 1px solid #dcdcde;
  border-radius: 12px;
  padding: 22px;
}

@media (max-width: 782px) {
  .lol-card-grid,
  .lol-admin-grid {
    grid-template-columns: 1fr;
  }
  .lol-page-hero,
  .lol-bp-intro {
    border-radius: 20px;
  }
  .lol-member-links a {
    width: auto;
  }
}

/* =========================================================
   v0.3 Member App Bar + Facebook-style social hub
   ========================================================= */
body.lol-app-active #masthead,
body.lol-app-active header.site-header,
body.lol-app-active .site-header {
  display:none !important;
}

.lol-app-bar {
  position: sticky;
  top: 0;
  z-index: 999;
  background: rgba(251,247,241,.98);
  border-bottom: 1px solid var(--lol-line);
  box-shadow: 0 8px 26px rgba(50,18,58,.06);
  backdrop-filter: blur(14px);
}
.admin-bar .lol-app-bar { top: 32px; }
.lol-app-bar-inner {
  width:min(1440px, calc(100% - 28px));
  min-height:68px;
  margin:0 auto;
  display:grid;
  grid-template-columns:auto minmax(240px, 560px) auto;
  align-items:center;
  gap:22px;
}
.lol-app-brand { display:flex; align-items:center; gap:10px; color:var(--lol-plum)!important; text-decoration:none!important; font-family:Georgia,'Times New Roman',serif; font-weight:800; letter-spacing:.03em; white-space:nowrap; }
.lol-app-mark { width:34px; height:34px; border:1px solid rgba(208,166,79,.7); display:grid; place-items:center; transform:rotate(45deg); border-radius:8px; color:var(--lol-gold); }
.lol-app-mark + span { transform:none; }
.lol-app-search input { width:100%; border:1px solid rgba(50,18,58,.13)!important; border-radius:999px!important; background:#fff!important; padding:11px 16px!important; color:var(--lol-ink)!important; }
.lol-app-actions { display:flex; align-items:center; justify-content:flex-end; gap:14px; }
.lol-app-actions a { color:var(--lol-plum)!important; font-weight:750; text-decoration:none!important; font-size:.9rem; }
.lol-app-profile { display:flex!important; align-items:center; gap:8px; }
.lol-app-profile img { border-radius:50%; }
.lol-join-disabled { display:inline-flex; align-items:center; padding:9px 13px; border-radius:999px; background:var(--lol-gold); color:var(--lol-plum); font-weight:800; opacity:.7; cursor:not-allowed; }

.lol-social-hub {
  width:min(1440px, calc(100% - 28px));
  margin:22px auto 50px;
  display:grid;
  grid-template-columns:240px minmax(0, 1fr) 300px;
  gap:22px;
  align-items:start;
}
.lol-hub-left,.lol-hub-right { position:sticky; top:92px; display:grid; gap:14px; }
.admin-bar .lol-hub-left,.admin-bar .lol-hub-right { top:124px; }
.lol-hub-center { min-width:0; display:grid; gap:16px; }
.lol-side-card,.lol-feed-welcome,.lol-dashboard-panel,.lol-metric-card,.lol-opportunity-form-card,.lol-opportunity-card,.lol-empty-card {
  background:#fff;
  border:1px solid var(--lol-line);
  border-radius:20px;
  box-shadow:0 10px 28px rgba(50,18,58,.055);
}
.lol-side-card { padding:18px; }
.lol-member-mini { display:flex; align-items:center; gap:12px; }
.lol-member-mini img { border-radius:50%; }
.lol-member-mini strong,.lol-member-mini span { display:block; }
.lol-member-mini span { margin-top:3px; color:var(--lol-muted); font-size:.82rem; }
.lol-hub-nav { padding:8px; display:grid; gap:2px; }
.lol-hub-nav a { padding:10px 12px; border-radius:12px; color:var(--lol-ink)!important; text-decoration:none!important; font-weight:700; }
.lol-hub-nav a:hover { background:var(--lol-cream); color:var(--lol-plum)!important; }
.lol-side-kicker { color:var(--lol-gold); text-transform:uppercase; letter-spacing:.12em; font-weight:850; font-size:.69rem; margin-bottom:7px; }
.lol-side-card>strong { color:var(--lol-plum); display:block; }
.lol-side-card p { color:var(--lol-muted); line-height:1.5; font-size:.9rem; }
.lol-copy-link,.lol-primary-button { border:0!important; border-radius:999px!important; background:var(--lol-plum)!important; color:#fff!important; padding:10px 14px!important; font-weight:800!important; cursor:pointer; text-decoration:none!important; display:inline-flex; align-items:center; justify-content:center; }
.lol-feed-welcome { padding:24px 26px; background:linear-gradient(135deg,#fff,var(--lol-cream)); }
.lol-feed-welcome h1 { color:var(--lol-plum)!important; font-family:Georgia,'Times New Roman',serif; font-size:clamp(1.6rem,3vw,2.4rem); line-height:1.08; margin:7px 0 14px; }
.lol-feed-prompts { display:flex; flex-wrap:wrap; gap:8px; }
.lol-feed-prompts span { background:#fff; border:1px solid var(--lol-line); border-radius:999px; padding:8px 11px; color:var(--lol-muted); font-weight:700; font-size:.79rem; }
.lol-native-feed .activity-update-form,.lol-native-feed #whats-new-form,.lol-native-feed .activity-list>li { background:#fff!important; border:1px solid var(--lol-line)!important; border-radius:20px!important; box-shadow:0 10px 28px rgba(50,18,58,.05)!important; }
.lol-native-feed .activity-update-form,.lol-native-feed #whats-new-form { padding:18px!important; margin-bottom:16px!important; }
.lol-native-feed .activity-list { display:grid; gap:14px; }
.lol-stat-row { display:flex; justify-content:space-between; gap:12px; padding:10px 0; border-bottom:1px solid var(--lol-line); font-size:.87rem; }
.lol-stat-row span { color:var(--lol-muted); }
.lol-stat-row strong { color:var(--lol-plum); text-align:right; }
.lol-stat-total { border-bottom:0; padding-bottom:0; }
.lol-text-link { display:inline-block; margin-top:12px; color:var(--lol-plum-2)!important; text-decoration:none!important; font-weight:800; font-size:.86rem; }
.lol-mini-list { display:grid; gap:7px; margin-top:10px; }
.lol-mini-list a { color:var(--lol-ink)!important; text-decoration:none!important; font-size:.86rem; font-weight:700; }
.lol-small-muted { color:var(--lol-muted); font-size:.85rem; }

/* Opportunities */
.lol-opportunity-layout { display:grid; grid-template-columns:minmax(280px, .8fr) minmax(0,1.4fr); gap:22px; align-items:start; margin:24px 0 40px; }
.lol-opportunity-form-card { padding:26px; position:sticky; top:96px; }
.admin-bar .lol-opportunity-form-card { top:128px; }
.lol-opportunity-form-card h2,.lol-section-heading h2,.lol-dashboard-panel h2 { margin:6px 0 10px; color:var(--lol-plum)!important; font-family:Georgia,'Times New Roman',serif; }
.lol-opportunity-form-card label { display:grid; gap:6px; margin:13px 0; color:var(--lol-ink); font-weight:700; font-size:.88rem; }
.lol-opportunity-form-card input,.lol-opportunity-form-card textarea,.lol-opportunity-form-card select,.lol-invite-box input { width:100%; background:#fff!important; color:var(--lol-ink)!important; border:1px solid rgba(50,18,58,.15)!important; border-radius:12px!important; padding:10px 12px!important; }
.lol-form-two { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.lol-opportunity-board { display:grid; gap:14px; }
.lol-opportunity-card { padding:22px; }
.lol-opportunity-card h3 { color:var(--lol-plum)!important; margin:8px 0; }
.lol-opportunity-meta { display:flex; justify-content:space-between; gap:10px; color:var(--lol-gold); text-transform:uppercase; letter-spacing:.08em; font-weight:800; font-size:.69rem; }
.lol-opportunity-location,.lol-opportunity-author { color:var(--lol-muted); font-size:.83rem; }

/* My Legacy */
.lol-legacy-dashboard { display:grid; gap:20px; margin:26px 0 44px; }
.lol-dashboard-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.lol-metric-card { padding:20px; }
.lol-metric-card span,.lol-metric-card strong,.lol-metric-card small { display:block; }
.lol-metric-card span { color:var(--lol-muted); font-size:.8rem; font-weight:750; }
.lol-metric-card strong { color:var(--lol-plum); font-family:Georgia,'Times New Roman',serif; font-size:1.65rem; margin:7px 0 4px; }
.lol-metric-card small { color:var(--lol-muted); line-height:1.4; }
.lol-dashboard-two { display:grid; grid-template-columns:1.2fr .8fr; gap:18px; }
.lol-dashboard-panel { padding:26px; }
.lol-level-list { display:grid; gap:0; margin-top:14px; }
.lol-level-list>div { display:grid; grid-template-columns:1fr auto auto; gap:14px; align-items:center; padding:11px 0; border-bottom:1px solid var(--lol-line); }
.lol-level-list em { color:var(--lol-muted); font-size:.78rem; font-style:normal; }
.lol-invite-box { display:grid; gap:8px; margin-top:18px; }
.lol-comp-table { display:grid; gap:0; margin-top:14px; }
.lol-comp-table>div { display:flex; justify-content:space-between; gap:18px; padding:13px 0; border-bottom:1px solid var(--lol-line); }
.lol-comp-total { border-bottom:0!important; font-size:1.08rem; color:var(--lol-plum); }

@media(max-width:1100px){
  .lol-app-bar-inner{grid-template-columns:auto 1fr}.lol-app-actions{grid-column:1/-1;justify-content:flex-end;padding-bottom:10px}
  .lol-social-hub{grid-template-columns:210px minmax(0,1fr)}.lol-hub-right{display:none}
  .lol-dashboard-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:782px){
  .admin-bar .lol-app-bar{top:46px}
  .lol-app-bar{position:relative;top:0}.lol-app-bar-inner{grid-template-columns:1fr;padding:12px 0;gap:10px}.lol-app-actions{grid-column:auto;justify-content:flex-start;flex-wrap:wrap;padding:0}.lol-app-search{order:3}
  .lol-social-hub{grid-template-columns:1fr;margin-top:14px}.lol-hub-left,.lol-hub-right{position:static}.lol-hub-left{display:block}.lol-member-mini,.lol-invite-card{display:none}.lol-hub-nav{display:flex;overflow:auto;gap:6px;white-space:nowrap;margin-bottom:12px}.lol-hub-nav a{flex:0 0 auto}
  .lol-opportunity-layout,.lol-dashboard-two{grid-template-columns:1fr}.lol-opportunity-form-card{position:static}.lol-dashboard-summary{grid-template-columns:1fr 1fr}.lol-form-two{grid-template-columns:1fr}
}
@media(max-width:520px){.lol-dashboard-summary{grid-template-columns:1fr}.lol-feed-welcome{padding:20px}.lol-social-hub{width:min(100% - 16px,1440px)}}

/* =========================================================
   v0.3.1 Layout Rescue
   Full-width BuddyX/BuddyPress normalization + responsive hub
   ========================================================= */

/* Everything the Platform Kit owns uses predictable sizing. */
body.lol-app-active .lol-app-bar,
body.lol-app-active .lol-app-bar *,
body.lol-app-active .lol-social-hub,
body.lol-app-active .lol-social-hub *,
body.lol-app-active .lol-page-shell,
body.lol-app-active .lol-page-shell *,
body.lol-app-active .lol-bp-intro,
body.lol-app-active .lol-bp-intro * {
  box-sizing: border-box;
}

/* BuddyX may wrap pages in a narrow content column and reserve a theme sidebar.
   On Ladies of Legacy internal pages, the Platform Kit owns the page width. */
body.lol-app-active #page,
body.lol-app-active .site,
body.lol-app-active .site-content,
body.lol-app-active #content,
body.lol-app-active .site-content > .container,
body.lol-app-active #content > .container,
body.lol-app-active .content-wrapper,
body.lol-app-active .content-area,
body.lol-app-active #primary,
body.lol-app-active .site-main,
body.lol-app-active main.site-main,
body.lol-app-active article,
body.lol-app-active .entry-content {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
}

body.lol-app-active .content-area,
body.lol-app-active #primary {
  float: none !important;
  flex: 1 1 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Remove the theme's conventional blog sidebar on the member platform. */
body.lol-app-active #secondary,
body.lol-app-active aside.widget-area,
body.lol-app-active .widget-area:not(.lol-hub-left):not(.lol-hub-right),
body.lol-app-active .site-sidebar,
body.lol-app-active .sidebar-right,
body.lol-app-active .sidebar-left {
  display: none !important;
}

/* Avoid parent-theme negative margins and constrained Gutenberg widths. */
body.lol-app-active .entry-content,
body.lol-app-active .page-content {
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  overflow: visible !important;
}

body.lol-app-active .entry-content > *,
body.lol-app-active .page-content > * {
  max-width: none !important;
}

/* Shared non-hub pages stay centered and comfortably wide. */
body.lol-platform-page .lol-page-shell,
body.lol-app-active .lol-bp-intro,
body.lol-app-active #buddypress,
body.lol-app-active .buddypress-wrap {
  width: min(1180px, calc(100% - 32px)) !important;
  max-width: 1180px !important;
  min-width: 0 !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* The Community Hub itself gets its own wider canvas. */
body.lol-platform-community .lol-page-shell {
  width: 100% !important;
  max-width: none !important;
}

body.lol-platform-community .lol-page-hero,
body.lol-platform-community .lol-member-links {
  width: min(1280px, calc(100% - 32px));
  margin-left: auto;
  margin-right: auto;
}

/* Header: flex is more forgiving than the previous 3-column grid. */
.lol-app-bar-inner {
  width: min(1280px, calc(100% - 32px));
  max-width: 1280px;
  min-width: 0;
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
}

.lol-app-brand {
  flex: 0 0 auto;
  min-width: 0;
}

.lol-app-search {
  flex: 1 1 320px;
  min-width: 180px;
  max-width: 560px;
}

.lol-app-actions {
  flex: 0 1 auto;
  min-width: 0;
  margin-left: auto;
  flex-wrap: wrap;
}

/* Three-column desktop social layout with safer, narrower side rails. */
.lol-social-hub {
  width: min(1280px, calc(100% - 32px));
  max-width: 1280px;
  min-width: 0;
  margin: 20px auto 50px;
  display: grid;
  grid-template-columns: minmax(190px, 220px) minmax(0, 1fr) minmax(230px, 270px);
  gap: 18px;
  align-items: start;
}

.lol-hub-left,
.lol-hub-center,
.lol-hub-right,
.lol-side-card,
.lol-native-feed,
.lol-feed-welcome {
  min-width: 0;
  max-width: 100%;
}

/* BuddyPress has several elements that otherwise insist on their own width. */
.lol-native-feed #buddypress,
.lol-native-feed .buddypress-wrap,
.lol-native-feed .activity-update-form,
.lol-native-feed #whats-new-form,
.lol-native-feed .activity-list,
.lol-native-feed .activity-list > li,
.lol-native-feed .activity-content,
.lol-native-feed .activity-inner,
.lol-native-feed textarea,
.lol-native-feed input,
.lol-native-feed select,
body.lol-app-active img,
body.lol-app-active iframe,
body.lol-app-active video {
  max-width: 100% !important;
}

body.lol-app-active img,
body.lol-app-active video {
  height: auto;
}

.lol-native-feed,
.lol-native-feed .activity-content,
.lol-native-feed .activity-inner,
.lol-side-card,
.lol-dashboard-panel,
.lol-opportunity-card {
  overflow-wrap: anywhere;
  word-break: normal;
}

.lol-native-feed .activity-list,
.lol-native-feed ul.activity-list {
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Forms and dashboards cannot force the page wider than the viewport. */
.lol-opportunity-layout,
.lol-dashboard-two,
.lol-dashboard-summary,
.lol-card-grid,
.lol-form-two,
.lol-level-list,
.lol-comp-table {
  min-width: 0;
  max-width: 100%;
}

.lol-opportunity-form-card input,
.lol-opportunity-form-card textarea,
.lol-opportunity-form-card select,
.lol-invite-box input,
.lol-app-search input {
  min-width: 0 !important;
  max-width: 100% !important;
}

/* Medium desktop/laptop: two columns, with the right rail placed under feed. */
@media (max-width: 1180px) {
  .lol-social-hub {
    grid-template-columns: minmax(180px, 210px) minmax(0, 1fr);
  }
  .lol-hub-right {
    position: static;
    grid-column: 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .lol-hub-right > *:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

/* Tablet: one-column feed; navigation becomes a horizontal tray. */
@media (max-width: 900px) {
  .lol-app-bar-inner {
    flex-wrap: wrap;
    padding: 10px 0;
  }
  .lol-app-search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }
  .lol-app-actions {
    margin-left: auto;
  }
  .lol-social-hub {
    grid-template-columns: minmax(0, 1fr);
    width: min(100% - 20px, 900px);
  }
  .lol-hub-left,
  .lol-hub-right {
    position: static;
  }
  .lol-hub-left {
    display: block;
  }
  .lol-member-mini,
  .lol-invite-card {
    display: none;
  }
  .lol-hub-nav {
    display: flex;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    gap: 6px;
    white-space: nowrap;
    margin-bottom: 12px;
    scrollbar-width: thin;
  }
  .lol-hub-nav a {
    flex: 0 0 auto;
  }
  .lol-hub-right {
    grid-column: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .lol-opportunity-layout,
  .lol-dashboard-two {
    grid-template-columns: 1fr;
  }
  .lol-opportunity-form-card {
    position: static;
  }
  .lol-dashboard-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Phone: everything stacks cleanly. */
@media (max-width: 620px) {
  body.lol-platform-page .lol-page-shell,
  body.lol-app-active .lol-bp-intro,
  body.lol-app-active #buddypress,
  body.lol-app-active .buddypress-wrap,
  body.lol-platform-community .lol-page-hero,
  body.lol-platform-community .lol-member-links {
    width: calc(100% - 20px) !important;
  }
  .lol-app-bar-inner {
    width: calc(100% - 20px);
  }
  .lol-app-brand {
    width: 100%;
  }
  .lol-app-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }
  .lol-social-hub {
    width: calc(100% - 12px);
    gap: 12px;
  }
  .lol-hub-right,
  .lol-dashboard-summary,
  .lol-form-two {
    grid-template-columns: 1fr;
  }
  .lol-feed-welcome,
  .lol-side-card,
  .lol-dashboard-panel,
  .lol-opportunity-card,
  .lol-opportunity-form-card {
    border-radius: 16px;
  }
  .lol-feed-welcome,
  .lol-dashboard-panel,
  .lol-opportunity-card,
  .lol-opportunity-form-card {
    padding: 18px;
  }
}

/* =========================================================
   v0.3.2 Hard Containment Fix
   Prevent side rails/cards from escaping their grid tracks.
   Also ensure the Platform Kit owns the internal member header.
   ========================================================= */

/* Earlier BuddyX child-theme experiments can still render a shell even when
   their callbacks are removed late. On internal platform pages, hide those
   old wrappers decisively and let .lol-app-bar be the only member header. */
body.lol-app-active .lol-shell-header,
body.lol-app-active .lol-shell-footer,
body.lol-app-active .lol-global-header-widgets,
body.lol-app-active .lol-global-footer-widgets {
  display: none !important;
}

body.lol-app-active .lol-app-bar {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
}

/* The hub grid itself is the sizing authority. */
body.lol-platform-community .lol-social-hub {
  grid-template-columns: 220px minmax(0, 1fr) 280px !important;
  column-gap: 20px !important;
  row-gap: 20px !important;
  align-items: start !important;
  overflow: visible !important;
}

/* Never allow a rail or center column to grow wider than its assigned track. */
body.lol-platform-community .lol-social-hub > .lol-hub-left,
body.lol-platform-community .lol-social-hub > .lol-hub-center,
body.lol-platform-community .lol-social-hub > .lol-hub-right {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
}

/* Cards must fit INSIDE their grid track, including padding and borders. */
body.lol-platform-community .lol-hub-left > *,
body.lol-platform-community .lol-hub-right > *,
body.lol-platform-community .lol-hub-center > *,
body.lol-platform-community .lol-side-card,
body.lol-platform-community .lol-feed-welcome,
body.lol-platform-community .lol-native-feed {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box !important;
}

/* Long account names were forcing the left rail wider than its grid column. */
body.lol-platform-community .lol-member-mini {
  overflow: hidden !important;
}
body.lol-platform-community .lol-member-mini > div {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
}
body.lol-platform-community .lol-member-mini strong {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
body.lol-platform-community .lol-member-mini span {
  overflow-wrap: anywhere !important;
}

/* Keep navigation labels inside the rail. */
body.lol-platform-community .lol-hub-nav,
body.lol-platform-community .lol-hub-nav a {
  min-width: 0 !important;
  max-width: 100% !important;
}
body.lol-platform-community .lol-hub-nav a {
  overflow-wrap: anywhere !important;
}

/* BuddyPress feed pieces sometimes carry theme widths/floats. Reset them. */
body.lol-platform-community .lol-native-feed #buddypress,
body.lol-platform-community .lol-native-feed .buddypress-wrap,
body.lol-platform-community .lol-native-feed form,
body.lol-platform-community .lol-native-feed #whats-new-form,
body.lol-platform-community .lol-native-feed .activity-update-form,
body.lol-platform-community .lol-native-feed .activity-list,
body.lol-platform-community .lol-native-feed .activity-list > li,
body.lol-platform-community .lol-native-feed .activity-content,
body.lol-platform-community .lol-native-feed .activity-inner {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  float: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box !important;
}

/* Keep the center heading and prompts within the center column. */
body.lol-platform-community .lol-feed-welcome {
  overflow: hidden !important;
}
body.lol-platform-community .lol-feed-welcome h1,
body.lol-platform-community .lol-feed-welcome p,
body.lol-platform-community .lol-feed-prompts {
  max-width: 100% !important;
  overflow-wrap: anywhere !important;
}

/* A normal 1366-ish laptop still gets all three columns. Below this point,
   move the right rail beneath the feed rather than squeezing the center. */
@media (max-width: 1240px) {
  body.lol-platform-community .lol-social-hub {
    grid-template-columns: 210px minmax(0, 1fr) !important;
  }
  body.lol-platform-community .lol-hub-right {
    grid-column: 2 !important;
    position: static !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
  }
  body.lol-platform-community .lol-hub-right > *:last-child:nth-child(odd) {
    grid-column: 1 / -1 !important;
  }
}

@media (max-width: 900px) {
  body.lol-platform-community .lol-social-hub {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  body.lol-platform-community .lol-hub-left,
  body.lol-platform-community .lol-hub-right {
    grid-column: 1 !important;
    position: static !important;
  }
  body.lol-platform-community .lol-hub-left {
    display: block !important;
  }
  body.lol-platform-community .lol-hub-right {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 620px) {
  body.lol-platform-community .lol-hub-right {
    grid-template-columns: 1fr !important;
  }
}
