/* =========================================================
   IZLEK — PAGES V2
   Single-column shell / premium route-culture layout
   ========================================================= */

/* ---------- Base page flow ---------- */

.page{
  width:100%;
  height:100%;
  min-height:0;
  display:grid;
  gap:14px;
  overflow:hidden;
}

.stack-list{
  display:grid;
  gap:10px;
  min-width:0;
}

/* ---------- Home ---------- */

.home-page{
  height:100%;
  min-height:0;
  display:grid;
  grid-template-rows:minmax(0,1.15fr) minmax(0,.85fr);
  gap:14px;
  overflow:hidden;
}

.hero{
  position:relative;
  overflow:hidden;
  border:1px solid rgba(20,20,20,.08);
  border-radius:34px;
  background:
    radial-gradient(circle at 88% 12%, rgba(197,138,82,.20), transparent 32%),
    radial-gradient(circle at 12% 0%, rgba(30,79,75,.13), transparent 36%),
    linear-gradient(135deg,#fffdf8,#eee9df);
  box-shadow:none !important;
  padding:clamp(26px,4vw,58px);
  min-height:0;
}

.hero:after{
  content:"";
  position:absolute;
  right:-160px;
  bottom:-190px;
  width:520px;
  height:520px;
  border-radius:50%;
  background:radial-gradient(circle,rgba(20,20,20,.08),transparent 62%);
  pointer-events:none;
}

.hero-inner{
  position:relative;
  z-index:1;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:26px;
  align-items:start;
}

.hero .lead{
  max-width:760px;
  font-size:15px;
}

.hero-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:9px;
  flex-wrap:wrap;
}

.home-lower{
  min-height:0;
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(360px,.72fr);
  gap:14px;
  overflow:hidden;
}

.home-lower > .card{
  min-height:0;
  overflow:hidden;
}

.home-lower .stack-list{
  min-height:0;
  overflow:auto;
  padding-right:4px;
}

/* ---------- Community listing ---------- */

.communities-page{
  grid-template-rows:auto minmax(0,1fr);
}

.community-grid{
  height:100%;
  min-height:0;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  grid-auto-rows:minmax(0,1fr);
  gap:14px;
  overflow:auto;
  padding-right:4px;
}

.community-grid::-webkit-scrollbar{
  width:6px;
}

.community-grid::-webkit-scrollbar-thumb{
  background:rgba(30,79,75,.18);
  border-radius:999px;
}

.community-card{
  min-height:0;
  overflow:hidden;
  display:grid;
  grid-template-rows:minmax(110px,.9fr) minmax(0,1fr);
  border:1px solid rgba(20,20,20,.08);
  border-radius:24px;
  background:#fffdf8;
  box-shadow:none !important;
}

.community-cover{
  position:relative;
  background:
    linear-gradient(135deg,#1e4f4b,#c58a52);
}

.community-cover:after{
  content:"";
  position:absolute;
  inset:0;
  background:
    radial-gradient(circle at 72% 24%, rgba(255,255,255,.28), transparent 34%),
    linear-gradient(180deg,transparent,rgba(0,0,0,.18));
}

.community-cover.moto{
  background:linear-gradient(135deg,#151515,#9f5f2e);
}

.community-cover.bike{
  background:linear-gradient(135deg,#1e4f4b,#7aa374);
}

.community-cover.walk{
  background:linear-gradient(135deg,#7c4a24,#c58a52);
}

.community-cover.car{
  background:linear-gradient(135deg,#18181b,#475569);
}

.community-body{
  padding:16px;
  display:flex;
  flex-direction:column;
  min-height:0;
}

.community-body h3{
  font-size:21px;
}

.community-meta{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  margin-top:10px;
}

.card-bottom{
  margin-top:auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding-top:14px;
}

.avatar-stack{
  display:flex;
}

.avatar-stack span{
  width:28px;
  height:28px;
  margin-left:-7px;
  border:2px solid #fffdf8;
  border-radius:999px;
  background:#1e4f4b;
  color:#fff;
  display:grid;
  place-items:center;
  font-size:10px;
  font-weight:900;
}

.avatar-stack span:first-child{
  margin-left:0;
}

/* ---------- Detail pages ---------- */

.detail-page{
  display:grid;
  grid-template-columns:330px minmax(0,1fr);
  gap:18px;
  align-items:start;
  height:100%;
  min-height:0;
  align-items:start;
}

.detail-side,
.detail-main{
  min-width:0;
  border:1px solid rgba(20,20,20,.08);
  border-radius:28px;
  background:rgba(255,253,248,.82);
  box-shadow:none !important;
  overflow:hidden;
}

.detail-side{
  position:sticky;
  top:0;
  align-self:start;
}

.detail-head{
  padding:18px;
  border-bottom:1px solid rgba(20,20,20,.08);
  background:
    radial-gradient(circle at 0% 0%, rgba(197,138,82,.13), transparent 48%),
    rgba(255,253,248,.86);
}

.detail-backbar{
  margin-bottom:14px;
}

.detail-eyebrow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:10px;
}

.detail-title{
  margin:12px 0 10px;
  font-size:34px;
  line-height:.96;
}

.detail-body{
  padding:18px;
  min-width:0;
}

.detail-body.scrollable{
  max-height:calc(100vh - 230px);
  overflow:auto;
  padding-right:12px;
}

.detail-body.scrollable::-webkit-scrollbar,
.detail-content-scroll::-webkit-scrollbar{
  width:6px;
}

.detail-body.scrollable::-webkit-scrollbar-thumb,
.detail-content-scroll::-webkit-scrollbar-thumb{
  border-radius:999px;
  background:rgba(30,79,75,.18);
}

.detail-main{
  display:grid;
  grid-template-rows:auto minmax(0,1fr);
  height:100%;
  min-height:0;
}

.detail-main .detail-body{
  min-height:520px;
}

.tabs{
  display:flex;
  gap:7px;
  padding:13px 15px;
  border-bottom:1px solid rgba(20,20,20,.08);
  background:rgba(255,253,248,.66);
  overflow-x:auto;
}

.tabs button{
  height:36px;
  border:1px solid transparent;
  border-radius:999px;
  padding:0 12px;
  background:transparent;
  color:var(--muted);
  font-size:12px;
  font-weight:850;
  white-space:nowrap;
  cursor:pointer;
}

.tabs button.active{
  color:#1e4f4b;
  background:rgba(30,79,75,.09);
  border-color:rgba(30,79,75,.16);
  box-shadow:0 8px 18px rgba(30,79,75,.07);
}

.detail-dashboard{
  display:grid;
  grid-template-columns:minmax(0,.95fr) minmax(0,1.05fr);
  gap:16px;
}

.detail-dashboard .card{
  min-height:0;
}

.detail-mini-meta{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  margin-top:14px;
}

.mini-stat,
.detail-mini-meta .mini-stat{
  border:1px solid rgba(20,20,20,.08);
  border-radius:16px;
  background:rgba(255,255,255,.58);
  padding:11px;
}

.mini-stat b,
.detail-mini-meta .mini-stat b{
  display:block;
  color:var(--ink);
  font-size:21px;
  line-height:1;
  font-weight:920;
  letter-spacing:-.045em;
}

.mini-stat span,
.detail-mini-meta .mini-stat span{
  display:block;
  margin-top:4px;
  color:var(--muted);
  font-size:11px;
  font-weight:740;
}

.detail-content-scroll{
  max-height:calc(100vh - 230px);
  overflow:auto;
  padding-right:8px;
}

.panel-fill{
  min-height:540px;
}

.timeline{
  display:grid;
  gap:10px;
  margin-top:14px;
}

.tl{
  display:grid;
  grid-template-columns:36px minmax(0,1fr);
  gap:10px;
}

.tl-dot{
  width:36px;
  height:36px;
  border-radius:14px;
  background:rgba(30,79,75,.10);
  color:#1e4f4b;
  display:grid;
  place-items:center;
  font-weight:900;
}

.tl-box{
  border:1px solid rgba(20,20,20,.08);
  border-radius:16px;
  background:rgba(255,255,255,.62);
  padding:11px;
}

.tl-box b{
  font-size:12px;
  font-weight:900;
}

.tl-box p{
  margin:5px 0 0;
  color:var(--muted);
  font-size:12px;
  line-height:1.4;
  font-weight:640;
}

.role-list{
  display:grid;
  gap:9px;
  margin-top:12px;
}

.role-row{
  border:1px solid rgba(20,20,20,.08);
  border-radius:16px;
  background:rgba(255,255,255,.62);
  padding:11px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.role-row b{
  display:block;
  color:var(--ink);
  font-size:12px;
  font-weight:900;
}

.role-row span{
  display:block;
  margin-top:3px;
  color:var(--muted);
  font-size:11px;
  font-weight:720;
}

.route-memory-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
}

/* ---------- Events / Routes listing ---------- */

.events-page,
.routes-page{
  grid-template-rows:auto minmax(0,1fr);
}

.split-main{
  height:100%;
  min-height:0;
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap:16px;
  overflow:hidden;
}

.split-main > .card,
.split-main > .mapbox,
.split-main > .leaflet-map{
  height:100%;
  min-height:0;
}

/* ---------- Builder ---------- */

.builder-layout{
  display:grid;
  grid-template-columns:350px minmax(0,1fr);
  gap:18px;
  align-items:stretch;
}

.builder-side{
  max-height:calc(100vh - 174px);
  overflow:auto;
}

.builder-map{
  min-height:680px;
}

/* ---------- Discover / After ---------- */

.after-page,
.discover-page{
  grid-template-rows:minmax(0,.9fr) minmax(0,1fr);
}

.placeholder-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:16px;
}

/* ---------- Login / account legacy blocks ---------- */

.login-card{
  background:
    radial-gradient(circle at 0% 0%, rgba(197,138,82,.13), transparent 40%),
    #fffdf8;
}

.login-switch{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:7px;
  margin:12px 0;
}

.login-switch button{
  height:36px;
  border:1px solid rgba(20,20,20,.08);
  border-radius:999px;
  background:rgba(255,255,255,.62);
  color:var(--muted);
  font-weight:850;
}

.login-switch button.active{
  color:#fff;
  background:#151515;
  border-color:#151515;
}

.account-mini{
  display:grid;
  grid-template-columns:42px 1fr;
  gap:10px;
  align-items:center;
  margin-top:12px;
  padding:11px;
  border-radius:16px;
  background:rgba(255,255,255,.56);
  border:1px solid rgba(20,20,20,.08);
}

/* ---------- Home V2 additions ---------- */

.izlek-hero{
  padding:clamp(30px,4.5vw,64px);
}

.hero-copy{
  max-width:780px;
}

.hero-copy h1{
  max-width:840px;
}

.hero-copy .lead{
  max-width:720px;
}

.hero-panel{
  width:min(520px,34vw);
  min-width:420px;
  border:1px solid rgba(20,20,20,.09);
  border-radius:30px;
  background:rgba(255,255,255,.62);
  box-shadow:0 24px 70px rgba(25,20,14,.075);
  padding:14px;
}

.hero-panel-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}

.hero-route-card{
  border:1px solid rgba(20,20,20,.08);
  border-radius:20px;
  background:#fffdf8;
  padding:12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}

.hero-route-card strong{
  display:block;
  font-size:14px;
  font-weight:900;
}

.hero-route-card span{
  display:block;
  margin-top:4px;
  color:var(--muted);
  font-size:12px;
  font-weight:650;
}

.hero-map-shell{
  height:360px;
  overflow:hidden;
  border-radius:24px;
}

.hero-map-shell .leaflet-map{
  min-height:360px;
}

.editorial-metric{
  min-height:150px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}

.editorial-metric p{
  margin:18px 0 0;
  color:var(--ink);
  font-size:15px;
  line-height:1.45;
  font-weight:760;
  letter-spacing:-.02em;
}

@media(max-width:1180px){
  .hero-inner{
    grid-template-columns:1fr;
  }

  .hero-panel{
    width:100%;
    min-width:0;
  }
}

.table-wrap{
  height:100%;
  min-height:0;
  overflow:auto;
}

.table-wrap::-webkit-scrollbar{
  width:6px;
}

.table-wrap::-webkit-scrollbar-thumb{
  background:rgba(30,79,75,.18);
  border-radius:999px;
}

.real-map,
.leaflet-map{
  width:100%;
  height:100%;
  min-height:0;
  border-radius:24px;
  overflow:hidden;
}

.map-card{
  height:100%;
  min-height:0;
  display:grid;
  grid-template-rows:auto minmax(0,1fr);
}

.map-card .leaflet-map,
.map-card .real-map{
  min-height:0;
}

.events-page > .card.table-wrap{
  height:100%;
  min-height:0;
}

.hero-panel{
  align-self:stretch;
  max-height:100%;
}
/* ---------- Responsive ---------- */

@media(max-width:1320px){
  .community-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  .home-lower{
    grid-template-columns:1fr;
  }

  .split-main{
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  }
}

@media(max-width:1080px){
  .detail-page{
    grid-template-columns:1fr;
  }

  .detail-side{
    position:relative;
    top:auto;
  }

  .detail-body.scrollable,
  .detail-content-scroll{
    max-height:none;
    overflow:visible;
  }

  .detail-dashboard{
    grid-template-columns:1fr;
  }

  .builder-layout{
    grid-template-columns:1fr;
  }

  .builder-side{
    max-height:none;
  }

  .builder-map{
    min-height:560px;
  }
}

@media(max-width:860px){
  .hero-inner{
    grid-template-columns:1fr;
  }

  .hero-actions{
    justify-content:flex-start;
  }

  .community-grid,
  .placeholder-grid,
  .route-memory-grid{
    grid-template-columns:1fr;
  }

  .cols-4,
  .cols-3,
  .cols-2,
  .cols-even{
    grid-template-columns:1fr;
  }

  .detail-mini-meta{
    grid-template-columns:1fr 1fr;
  }
}

@media(max-width:620px){
  .hero{
    border-radius:26px;
    padding:24px;
  }

  .community-card{
    grid-template-rows:126px minmax(0,1fr);
  }

  .detail-side,
  .detail-main{
    border-radius:24px;
  }

  .detail-title{
    font-size:30px;
  }

  .detail-main .detail-body{
    min-height:auto;
  }

  .builder-map{
    min-height:460px;
  }
}

.account-page{
  height:100%;
  min-height:0;
  overflow:hidden;
}

.account-shell{
  height:100%;
  min-height:0;
  display:grid;
  gap:14px;
  grid-template-rows:auto minmax(0,1fr);
  overflow:hidden;
}

.account-hero{
  padding:24px;
}

.account-hero h1{
  margin-top:10px;
  font-size:clamp(32px,3vw,52px);
}

.account-grid{
  min-height:0;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  overflow:hidden;
}

.account-list{
  min-height:0;
  overflow:auto;
}

@media(max-width:1080px){
  .account-grid{
    grid-template-columns:1fr;
  }
}

/* =========================================================
   PROFILE PAGE V2
   ========================================================= */

.profile-page{
  height:100%;
  min-height:0;
  overflow:hidden;
}

.profile-shell{
  height:100%;
  min-height:0;
  display:grid;
  grid-template-rows:auto minmax(0,1fr);
  gap:16px;
  overflow:hidden;
}

.profile-top{
  border:1px solid rgba(20,20,20,.07);
  border-radius:30px;
  background:
    radial-gradient(circle at 88% 12%, rgba(197,138,82,.18), transparent 34%),
    radial-gradient(circle at 12% 0%, rgba(30,79,75,.11), transparent 38%),
    linear-gradient(135deg, rgba(255,253,248,.92), rgba(238,233,223,.86));
  padding:24px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
}

.profile-avatar-block{
  display:flex;
  align-items:center;
  gap:18px;
  min-width:0;
}

.profile-avatar-xl{
  width:72px;
  height:72px;
  flex:0 0 72px;
  border-radius:24px;
  display:grid;
  place-items:center;
  background:linear-gradient(135deg,#0f2f2c,#1e4f4b);
  color:#fff;
  font-size:28px;
  font-weight:950;
  box-shadow:none;
}

.profile-title{
  margin:10px 0 0;
  font-size:clamp(38px,4vw,66px);
  line-height:.9;
  letter-spacing:-.075em;
}

.profile-sections{
  min-height:0;
  overflow:auto;
  display:grid;
  gap:10px;
  padding-right:6px;
}

.profile-sections::-webkit-scrollbar{
  width:6px;
}

.profile-sections::-webkit-scrollbar-thumb{
  background:rgba(30,79,75,.18);
  border-radius:999px;
}

.profile-collapse{
  border:1px solid rgba(20,20,20,.07);
  border-radius:24px;
  background:rgba(255,253,248,.72);
  overflow:hidden;
}

.profile-collapse-head{
  width:100%;
  min-height:66px;
  padding:14px 18px;
  border:0;
  background:
    radial-gradient(circle at 94% 0%, rgba(197,138,82,.12), transparent 36%),
    rgba(255,253,248,.80);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  cursor:pointer;
  text-align:left;
}

.profile-collapse-head > div{
  display:flex;
  align-items:center;
  gap:12px;
}

.profile-collapse-head h3{
  font-size:20px;
  letter-spacing:-.045em;
}

.profile-collapse-head > span{
  width:32px;
  height:32px;
  border-radius:999px;
  display:grid;
  place-items:center;
  background:rgba(30,79,75,.08);
  color:#1e4f4b;
  font-size:18px;
  font-weight:950;
  transition:.16s ease;
}

.profile-collapse.active .profile-collapse-head > span{
  transform:rotate(180deg);
}

.profile-collapse-body{
  display:none;
  padding:0 18px 18px;
}

.profile-collapse.active .profile-collapse-body{
  display:grid;
  gap:14px;
}

.profile-collapse .field input,
.profile-collapse .field select,
.profile-collapse .field textarea{
  background:rgba(255,255,255,.78);
}

.profile-collapse .field textarea{
  min-height:110px;
}

.profile-collapse .grid{
  gap:12px;
}

.profile-collapse .cols-2{
  grid-template-columns:1fr 1fr;
}

.profile-collapse .cols-3{
  grid-template-columns:repeat(3,minmax(0,1fr));
}

@media(max-width:900px){
  .profile-top{
    flex-direction:column;
  }

  .profile-avatar-block{
    align-items:flex-start;
  }

  .profile-collapse .cols-2,
  .profile-collapse .cols-3{
    grid-template-columns:1fr;
  }
}

.profile-avatar-upload{
  width:72px;
  height:72px;
  flex:0 0 72px;
  border-radius:24px;
  overflow:hidden;
  display:grid;
  place-items:center;
  background:linear-gradient(135deg,#0f2f2c,#1e4f4b);
  color:#fff;
  cursor:pointer;
  position:relative;
}

.profile-avatar-upload img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.profile-avatar-upload span{
  font-size:28px;
  font-weight:950;
}

.profile-avatar-upload input{
  display:none;
}

.profile-avatar-upload{
  width:72px;
  height:72px;
  flex:0 0 72px;
  border-radius:24px;
  overflow:hidden;
  display:grid;
  place-items:center;
  background:linear-gradient(135deg,#0f2f2c,#1e4f4b);
  color:#fff;
  cursor:pointer;
  position:relative;
}

.profile-avatar-upload img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.profile-avatar-upload span{
  font-size:28px;
  font-weight:950;
}

.profile-avatar-upload input{
  display:none;
}