/* Labyrinth layout v3 — a structural redesign, not a reskin. */
:root{--shell-width:1680px;--side-width:244px;--layout-gap:18px}

/* Shared application-shell rhythm */
.lf-dashboard,.member-shell{max-width:var(--shell-width)}

/* Dashboard desktop: navigation rail + workspace + live status column */
@media(min-width:1181px){
  .lf-dashboard{width:min(var(--shell-width),100%);margin:0 auto;padding:20px;display:grid;grid-template-columns:var(--side-width) minmax(0,1fr);gap:var(--layout-gap)}
  .lf-topbar{grid-column:1;position:sticky;top:20px;height:calc(100vh - 40px);min-height:690px;padding:26px 16px 18px;display:flex;flex-direction:column;align-items:stretch;gap:0;border:1px solid var(--pro-line)!important;border-top-color:var(--pro-line-strong)!important;background:linear-gradient(180deg,#0f0d0b,#080807)!important;box-shadow:var(--pro-shadow)!important}
  .lf-brand,.lf-nav,.lf-bell,.lf-user{position:relative;inset:auto;width:auto;height:auto;opacity:1}
  .lf-brand{min-width:0;display:flex;flex-direction:column;gap:11px;text-align:center;white-space:normal;font-size:.92rem;letter-spacing:.14em}.lf-brand img{width:88px;height:88px;margin:0 auto}.lf-brand small{font-size:.43rem;letter-spacing:.34em}
  .lf-nav{order:0;flex:0 0 auto;width:100%;height:auto;margin-top:34px;display:grid;gap:5px;overflow:visible;border:0}
  .lf-nav a{max-width:none;min-width:0;width:100%;height:auto;display:grid;grid-template-columns:30px 1fr;place-items:center start;gap:12px;padding:12px 13px;border:0!important;border-left:2px solid transparent!important;text-align:left;background:transparent}
  .lf-nav a::before{width:24px;height:24px;margin:0}.lf-nav a span{font:500 .62rem Cinzel,serif;letter-spacing:.05em}.lf-nav a:hover,.lf-nav a.active{border-left-color:var(--pro-red)!important;background:linear-gradient(90deg,rgba(136,41,33,.17),transparent)}
  .lf-nav a.active::after{display:none}.lf-bell{order:2;margin:auto auto 13px;width:42px;height:42px;align-self:center;border:1px solid var(--pro-line);border-radius:50%}.lf-bell::before{width:23px;height:23px}
  .lf-user{order:3;min-width:0;width:100%;padding:13px 12px;display:grid;grid-template-columns:42px minmax(0,1fr) auto;gap:10px}.mini-avatar{width:42px;height:42px}.lf-user b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.lf-user i{align-self:center}

  .dashboard-grid{grid-column:2;width:100%;margin:0;display:grid;grid-template-columns:minmax(0,1fr) 316px;grid-template-rows:auto;gap:var(--layout-gap);align-items:start;transform:none}
  .profile-card{grid-column:1/-1;grid-row:auto;position:relative;top:auto;min-height:148px;padding:20px 22px;display:grid;grid-template-columns:108px minmax(190px,.85fr) minmax(430px,1.55fr) 150px;grid-template-rows:auto auto;gap:5px 22px;align-items:center;text-align:left}
  .portrait{grid-column:1;grid-row:1/3;width:96px;height:96px;margin:0}.profile-card h1{grid-column:2;grid-row:1;align-self:end;margin:0;font:500 1.45rem/1.1 Cinzel,serif}.member-quote{grid-column:2;grid-row:2;align-self:start;margin:2px 0 0;text-align:left;font-size:.94rem}
  .profile-details{grid-column:3;grid-row:1/3;margin:0;display:grid;grid-template-columns:1fr 1fr;border:0;gap:0 20px}.profile-details div{min-width:0;padding:9px 4px 8px 34px}.profile-details div::before{left:2px;top:8px;width:24px;height:24px}.profile-details dt{font-size:.5rem;letter-spacing:.05em}.profile-details dd{font-size:.82rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .profile-card .gold-button{grid-column:4;grid-row:1/3;width:100%;min-height:42px}
  .dashboard-center{grid-column:1;grid-row:2;display:grid;gap:var(--layout-gap);min-width:0}.dashboard-right{grid-column:2;grid-row:2;position:sticky;top:20px;display:grid;grid-template-columns:1fr;grid-template-rows:none;gap:var(--layout-gap)}
  .welcome-banner{min-height:210px;padding:38px 44px}.welcome-banner h2{font-size:clamp(2.5rem,3.4vw,3.55rem)}
  .feature-grid{display:grid;grid-template-columns:minmax(300px,.8fr) minmax(420px,1.2fr);gap:var(--layout-gap)}.upcoming,.crystal-card{min-height:275px}
  .path-panel{padding:17px 12px}.bottom-grid{display:grid;grid-template-columns:minmax(0,1.18fr) minmax(270px,.82fr);gap:var(--layout-gap)}.badge-panel{grid-row:span 2}.leaderboard-panel{grid-column:2}
  .wallet,.challenges,.notifications{width:100%}.wallet{min-height:286px}.wallet-row{height:101px}.challenges{min-height:0}.notifications{min-height:92px}
}

/* Member subpages use the same navigation rail and a calmer content canvas. */
@media(min-width:1181px){
  .member-shell{width:min(var(--shell-width),100%);margin:0 auto;padding:20px;display:grid;grid-template-columns:var(--side-width) minmax(0,1fr);gap:var(--layout-gap)}
  .member-header{grid-column:1;position:sticky;top:20px;height:calc(100vh - 40px);min-height:690px;padding:26px 16px 18px;display:flex;flex-direction:column;align-items:stretch;gap:0;background:linear-gradient(180deg,#0f0d0b,#080807)}
  .member-brand,.member-nav,.member-account{position:relative;inset:auto;width:auto;height:auto;opacity:1}
  .member-brand{min-width:0;display:flex;flex-direction:column;gap:11px;text-align:center;white-space:normal;font-size:.9rem;letter-spacing:.14em}.member-brand img{width:88px;height:88px;margin:0 auto}.member-brand span{display:grid}.member-brand span::after{content:"MEMBER PORTAL";margin-top:5px;color:#a98443;font-size:.44rem;letter-spacing:.32em}
  .member-nav{flex:0 0 auto;width:100%;height:auto;margin-top:34px;display:grid;gap:5px;overflow:visible;border:0}.member-nav a,.member-nav a:nth-child(7){width:100%;height:auto;display:grid;grid-template-columns:30px 1fr;place-items:center start;gap:12px;padding:12px 13px;border:0!important;border-left:2px solid transparent!important;text-align:left}.member-nav a::before{position:relative;inset:auto;transform:none;width:24px;text-align:center}.member-nav a:hover,.member-nav a.active{border-left-color:var(--pro-red)!important;background:linear-gradient(90deg,rgba(136,41,33,.17),transparent)}.member-nav a.active::after{display:none}
  .member-account{margin-top:auto;min-width:0;width:100%;padding:14px 12px 14px 42px}.member-content{grid-column:2;margin:0;min-width:0}
  .member-dashboard-layout{width:100%;display:grid;grid-template-columns:270px minmax(0,1fr);gap:var(--layout-gap);align-items:start}.member-rail{position:sticky;top:20px}.member-page-main{display:grid;gap:var(--layout-gap)}.member-page-main .member-hero{min-height:210px;padding:38px 44px}.member-page-main .member-hero h1{font-size:clamp(2.35rem,3.4vw,3.35rem)}.member-page-main .member-grid{gap:var(--layout-gap)}
}

/* Public home: a more editorial, less template-like composition. */
@media(min-width:951px){
  body>.site-header{padding-left:max(38px,calc((100vw - 1500px)/2));padding-right:max(38px,calc((100vw - 1500px)/2))}
  .hero{grid-template-columns:minmax(0,1.28fr) minmax(360px,.72fr);padding-left:max(48px,calc((100vw - 1500px)/2));padding-right:max(48px,calc((100vw - 1500px)/2));min-height:760px}.hero-copy{align-self:center}.hero-art{align-self:stretch}.crest-large{width:min(22vw,280px)}
  .intro-grid{grid-template-columns:.72fr 1.28fr}.section-heading{grid-template-columns:.82fr 1.18fr}.section-heading>p{justify-self:end}
  .path-grid{grid-template-columns:repeat(12,1fr)}.path-grid article{grid-column:span 3}.path-grid article:nth-child(1),.path-grid article:nth-child(4){transform:translateY(22px)}.path-grid article:hover{transform:translateY(-3px)}.path-grid article:nth-child(1):hover,.path-grid article:nth-child(4):hover{transform:translateY(18px)}
  .reward-grid{grid-template-columns:1.1fr .9fr .9fr}.reward-grid article:first-child{grid-row:span 2;min-height:468px;display:flex;flex-direction:column;justify-content:flex-end}.reward-grid article:first-child>span{font-size:3rem}
}

/* Account layout gets a stronger editorial split. */
@media(min-width:901px){.account-layout{grid-template-columns:minmax(0,1.2fr) minmax(430px,.8fr);gap:clamp(42px,6vw,88px)}.account-story{min-height:640px}.account-frame{max-width:510px;width:100%;justify-self:end}}

/* Staff console: wider operational grid and fixed command header. */
@media(min-width:1101px){.staff-shell{width:min(1560px,calc(100% - 36px))}.staff-shell .site-header{position:sticky;top:12px;z-index:20}.staff-grid{grid-template-columns:repeat(12,minmax(0,1fr))}.staff-grid>.panel{grid-column:span 6}.staff-grid>.panel:nth-child(5n){grid-column:span 12}.summary-grid{grid-template-columns:repeat(5,1fr)}}

/* Tablet: top navigation, single main workspace, status cards below. */
@media(min-width:721px) and (max-width:1180px){
  .lf-dashboard,.member-shell{width:min(100% - 18px,1050px);display:block;padding:0;margin:9px auto 40px}.lf-topbar,.member-header{position:sticky;top:7px;height:auto;min-height:0}.dashboard-grid{grid-template-columns:1fr;margin-top:16px}.profile-card{position:relative;top:auto}.dashboard-right{grid-column:auto;grid-template-columns:repeat(3,minmax(0,1fr));position:relative;top:auto}.member-content{margin-top:16px}.member-dashboard-layout{grid-template-columns:1fr}.member-rail{position:relative;top:auto}
}

/* Phone: card stack and touch-friendly horizontal navigation. */
@media(max-width:720px){
  .lf-dashboard,.member-shell{width:calc(100% - 10px);display:block;padding:0;margin:5px auto 30px}.lf-topbar,.member-header{position:sticky;top:3px;height:auto;min-height:0}.dashboard-grid{display:grid;grid-template-columns:1fr;margin-top:10px}.profile-card{position:relative;top:auto}.dashboard-center,.dashboard-right{grid-column:auto;grid-row:auto}.dashboard-right{grid-template-columns:1fr}.member-content{margin-top:10px}.member-dashboard-layout{grid-template-columns:1fr}.member-rail{position:relative;top:auto}.profile-card{padding:22px 18px}.path-panel{grid-template-columns:1fr 1fr}.feature-grid,.bottom-grid{grid-template-columns:1fr}
}
