:root{--ink:#18161a;--aub:#35263d;--purple:#69477a;--paper:#f5f1f6;--line:#e6dfe8;--muted:#8c8290}*{box-sizing:border-box}html,body{margin:0;font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--ink);background:var(--paper)}button,input{font:inherit}button{cursor:pointer}.eyebrow{font-size:10px;letter-spacing:.16em;font-weight:900;color:#8f7899}.primary,.secondary{border:0;border-radius:14px;padding:13px 16px;font-weight:850}.primary{background:var(--purple);color:#fff}.secondary{background:#f4eff5;color:var(--aub);border:1px solid var(--line)}.wide{width:100%;margin-top:10px}.auth-body{min-height:100vh;background:linear-gradient(135deg,#18161a,#38283f 55%,#684779);display:grid;place-items:center;padding:22px}.auth-shell{width:min(440px,100%)}.auth-logo{display:block;width:150px;height:86px;object-fit:cover;margin:0 auto 16px;border-radius:20px}.auth-card{background:#fff;border-radius:26px;padding:28px;box-shadow:0 25px 70px #0005}.auth-card h1{font-size:32px;margin:6px 0}.auth-card p{color:var(--muted)}label{display:grid;gap:7px;font-size:12px;font-weight:800;margin:14px 0}input{border:1px solid var(--line);background:#faf8fb;border-radius:13px;padding:13px;outline:0}input:focus{border-color:var(--purple)}label small{color:var(--muted);font-weight:500}.form-error,.error{color:#a22;font-size:12px;min-height:18px;margin-top:6px}.auth-foot{text-align:center;font-size:13px}.auth-foot a{color:var(--purple);font-weight:800}.app{min-height:100dvh;padding-bottom:74px}.topbar{height:76px;display:grid;grid-template-columns:70px 1fr 44px;align-items:center;padding:8px 15px;background:linear-gradient(110deg,#18161a,#35263d 60%,#613f71);color:#fff}.mini-logo{width:58px;height:52px;object-fit:cover;border-radius:14px}.group-title{background:transparent;border:0;color:#fff;text-align:left}.group-title small{display:block;font-size:9px;letter-spacing:.14em;opacity:.65}.group-title strong{font-size:18px}.gear{width:40px;height:40px;border-radius:50%;border:1px solid #ffffff22;background:#ffffff12;color:#fff}.members{background:#fff;padding:10px 14px;border-bottom:1px solid var(--line)}.members-head{display:flex;justify-content:space-between;font-size:12px}.members-head button{border:0;background:transparent;color:var(--purple);font-weight:800}.member-row{display:flex;gap:15px;overflow:auto;margin-top:8px}.member{min-width:62px;text-align:center}.avatar{width:48px;height:48px;margin:auto;border-radius:50%;display:grid;place-items:center;background:linear-gradient(145deg,#251d29,#755188);color:#fff;font-weight:900;position:relative}.avatar i{position:absolute;right:-7px;bottom:-4px;width:24px;height:24px;border-radius:50%;background:#fff;display:grid;place-items:center;font-style:normal;font-size:12px;box-shadow:0 2px 9px #0003}.member span,.member small{display:block;font-size:10px;margin-top:4px}.member small{color:var(--muted)}.empty-inline{padding:12px;color:var(--muted);font-size:12px}.map-wrap{height:calc(100dvh - 76px - 91px - 74px);min-height:430px;position:relative}#map{position:absolute;inset:0}.map-buttons{position:absolute;z-index:400;right:15px;top:15px}.map-buttons button{width:46px;height:46px;border:0;border-radius:50%;background:#fff;font-size:24px;box-shadow:0 10px 30px #0003}.location-card{position:absolute;z-index:400;left:14px;right:14px;bottom:64px;background:#18161aee;color:#fff;border-radius:18px;padding:13px 14px;display:flex;justify-content:space-between;align-items:center}.location-card small{display:block;color:#cfc5d2;margin-top:4px}.location-card button{border:0;background:var(--purple);color:#fff;border-radius:12px;padding:10px 13px;font-weight:800}.ad{position:absolute;z-index:390;bottom:0;left:0;right:0;height:54px;background:#fff;display:grid;place-items:center;border-top:1px solid var(--line);font-size:10px;color:#777}nav{position:fixed;z-index:700;bottom:0;left:0;right:0;height:74px;background:#fff;display:grid;grid-template-columns:repeat(4,1fr);border-top:1px solid var(--line)}nav button{border:0;background:transparent;color:#938899;font-size:22px;display:grid;place-items:center;align-content:center}nav button small{font-size:10px;font-weight:750}nav button.active{color:var(--purple)}.shade{position:fixed;inset:0;background:#0007;z-index:800;opacity:0;pointer-events:none;transition:.2s}.shade.on{opacity:1;pointer-events:auto}.sheet{position:fixed;z-index:810;left:50%;bottom:0;transform:translate(-50%,105%);width:min(560px,100%);background:#fff;border-radius:26px 26px 0 0;padding:24px 20px 30px;transition:.25s;max-height:82vh;overflow:auto}.sheet.on{transform:translate(-50%,0)}.sheet .x{position:absolute;right:18px;top:17px;border:0;background:#f2edf4;width:35px;height:35px;border-radius:50%;font-size:20px}.sheet h2{margin:3px 45px 18px 0}.option{display:block;text-decoration:none;color:inherit;border:1px solid var(--line);border-radius:14px;padding:14px;margin:8px 0}.option small{display:block;color:var(--muted);margin-top:4px}.code{text-align:center;font-size:34px;font-weight:900;letter-spacing:.16em;background:#f4eef6;border-radius:18px;padding:20px;color:var(--aub)}.muted{color:var(--muted);line-height:1.5}.plan{display:inline-block;background:var(--aub);color:#fff;border-radius:999px;padding:7px 12px;font-size:11px;font-weight:900;margin-bottom:14px}@media(min-width:700px){.app{max-width:520px;margin:auto;box-shadow:0 0 60px #0002;background:#fff}nav{left:50%;right:auto;width:520px;transform:translateX(-50%)}}
.avatar img{width:100%;height:100%;object-fit:cover;border-radius:50%}.profileline{display:flex;align-items:center;gap:12px;margin:8px 0 18px}.profileline img,.avatar.big{width:58px;height:58px;border-radius:50%;object-fit:cover}.profileline small{display:block;color:var(--muted);margin-top:3px}.optionbtn,.danger{width:100%;text-align:left;border:0;background:#fff;border-bottom:1px solid var(--line);padding:15px 5px;font-weight:750}.danger{color:#b22}.clean{height:calc(100dvh - 76px - 91px - 74px)}hr{border:0;border-top:1px solid var(--line);margin:12px 0}.leaflet-control-attribution{font-size:8px!important;opacity:.72}


/* =========================================================
   TUUBI V2.2
   ========================================================= */

.menu-btn{
  width:42px;
  height:42px;
  border:0;
  border-radius:14px;
  background:#ffffff12;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:7px;
  padding:0;
}
.menu-btn span{
  display:block;
  width:20px;
  height:2px;
  border-radius:100px;
  background:#fff;
}

/* Foto de integrante: siempre recortada y centrada dentro del círculo */
.avatar > img{
  position:absolute !important;
  inset:0 !important;
  width:100% !important;
  height:100% !important;
  max-width:none !important;
  object-fit:cover !important;
  object-position:center center !important;
  border-radius:50% !important;
  clip-path:circle(50% at 50% 50%);
}

/* Foto grande del perfil dentro del menú */
.profile-photo{
  width:58px !important;
  height:58px !important;
  min-width:58px;
  border-radius:50% !important;
  object-fit:cover !important;
  object-position:center center !important;
}

.menu-profile{
  display:flex;
  align-items:center;
  gap:13px;
  padding:4px 2px 18px;
}
.menu-profile small{
  display:block;
  margin-top:4px;
  color:var(--muted);
}
.menu-list{
  border-top:1px solid var(--line);
}
.menu-list form{
  margin:0;
}
.menu-item{
  width:100%;
  border:0;
  border-bottom:1px solid var(--line);
  background:#fff;
  padding:16px 4px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  text-align:left;
  color:var(--ink);
  font-weight:760;
}
.menu-item b{
  font-size:22px;
  font-weight:400;
  line-height:1;
  color:#aaa0ad;
}
.menu-danger{
  margin-top:22px;
  padding:14px;
  border:0;
  border-radius:14px;
  text-align:center;
  background:#fff3f3;
}

/* La marca propia de Leaflet se elimina. Solo queda la atribución mínima de OSM. */
.leaflet-control-attribution{
  display:none !important;
}
.osm-credit{
  position:absolute;
  z-index:390;
  left:6px;
  bottom:6px;
  padding:2px 5px;
  border-radius:5px;
  background:rgba(255,255,255,.76);
  color:#655d68;
  font-size:7px;
  line-height:1.15;
  pointer-events:none;
}

/* El panel siempre queda por encima del mapa y de la atribución */
.shade{z-index:900 !important}
.sheet{z-index:910 !important}

@media(max-width:560px){
  .osm-credit{
    left:4px;
    bottom:4px;
    font-size:6.5px;
  }
}


/* =========================================================
   TUUBI V2.3 - MENU + INTEGRANTES
   ========================================================= */

/* Botón tipo FIBI: recuadro blanco redondeado con SOLO 2 rayas */
.menu-btn{
  width:46px !important;
  height:46px !important;
  border:1px solid rgba(0,0,0,.08) !important;
  border-radius:15px !important;
  background:#fff !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;
  gap:7px !important;
  padding:0 !important;
  box-shadow:0 5px 16px rgba(0,0,0,.10);
}
.menu-btn .menu-line{
  display:block !important;
  width:21px !important;
  height:2.5px !important;
  border-radius:999px !important;
  background:#1c2027 !important;
}

/* Integrantes: nada puede crecer al tamaño de la foto original */
.member-row{
  display:flex !important;
  align-items:flex-start !important;
  gap:16px !important;
  min-height:82px !important;
  max-height:96px !important;
  overflow-x:auto !important;
  overflow-y:hidden !important;
  padding:2px 2px 5px !important;
}
.member-card{
  flex:0 0 62px !important;
  width:62px !important;
  min-width:62px !important;
  max-width:62px !important;
  text-align:center !important;
  overflow:visible !important;
}
.member-avatar-shell{
  position:relative !important;
  width:52px !important;
  height:52px !important;
  margin:0 auto !important;
  flex:0 0 52px !important;
}
.member-avatar{
  position:relative !important;
  width:52px !important;
  height:52px !important;
  min-width:52px !important;
  min-height:52px !important;
  max-width:52px !important;
  max-height:52px !important;
  border-radius:50% !important;
  overflow:hidden !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  background:linear-gradient(145deg,#251d29,#755188) !important;
  color:#fff !important;
  font-weight:900 !important;
  font-size:18px !important;
}
.member-photo{
  position:absolute !important;
  inset:0 !important;
  display:block !important;
  width:52px !important;
  height:52px !important;
  min-width:52px !important;
  min-height:52px !important;
  max-width:52px !important;
  max-height:52px !important;
  object-fit:cover !important;
  object-position:50% 50% !important;
  border:0 !important;
  border-radius:50% !important;
  margin:0 !important;
  padding:0 !important;
}
.member-initial{
  display:block !important;
  line-height:1 !important;
}
.activity-badge{
  position:absolute !important;
  z-index:3 !important;
  right:-5px !important;
  bottom:-3px !important;
  width:22px !important;
  height:22px !important;
  border-radius:50% !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  background:#fff !important;
  color:#222 !important;
  font-size:11px !important;
  box-shadow:0 2px 8px rgba(0,0,0,.22) !important;
}
.member-name{
  display:block !important;
  margin-top:6px !important;
  font-size:10px !important;
  line-height:1.1 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}
.member-battery{
  display:block !important;
  margin-top:2px !important;
  color:var(--muted) !important;
  font-size:9px !important;
}

/* Anula por completo las clases antiguas para que no deformen las fotos */
.members .avatar,
.members .member{
  all:unset;
}

/* Menú real: foto pequeña + todas las opciones debajo */
.settings-title{
  font-size:24px;
  font-weight:850;
  margin:2px 44px 18px 0;
}
.menu-profile-row{
  display:flex !important;
  align-items:center !important;
  gap:13px !important;
  padding:0 0 18px !important;
}
.menu-avatar{
  position:relative !important;
  width:58px !important;
  height:58px !important;
  min-width:58px !important;
  max-width:58px !important;
  border-radius:50% !important;
  overflow:hidden !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  background:linear-gradient(145deg,#251d29,#755188) !important;
  color:#fff !important;
  font-size:20px !important;
  font-weight:900 !important;
}
.menu-avatar img{
  position:absolute !important;
  inset:0 !important;
  width:58px !important;
  height:58px !important;
  min-width:58px !important;
  max-width:58px !important;
  object-fit:cover !important;
  object-position:center !important;
  border-radius:50% !important;
  margin:0 !important;
  padding:0 !important;
}
.menu-profile-text{
  min-width:0 !important;
}
.menu-profile-text b{
  display:block;
  font-size:16px;
}
.menu-profile-text small{
  display:block;
  margin-top:4px;
  color:var(--muted);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* El panel no puede quedar detrás del mapa */
.shade{z-index:10000 !important}
.sheet{z-index:10001 !important}


/* =========================================================
   TUUBI V2.4 - SWITCH DE UBICACIÓN
   ========================================================= */

.location-toggle-row{
  cursor:default !important;
}
.location-toggle-row > div{
  display:flex;
  flex-direction:column;
  gap:3px;
}
.location-toggle-row small{
  color:var(--muted);
  font-size:10px;
  font-weight:600;
}

.switch{
  position:relative;
  display:inline-block;
  width:48px;
  height:28px;
  margin:0;
  flex:0 0 48px;
}
.switch input{
  position:absolute;
  opacity:0;
  width:0;
  height:0;
}
.switch-slider{
  position:absolute;
  inset:0;
  border-radius:999px;
  background:#d8d2da;
  transition:.2s ease;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.05);
}
.switch-slider:before{
  content:"";
  position:absolute;
  width:22px;
  height:22px;
  left:3px;
  top:3px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 2px 7px rgba(0,0,0,.25);
  transition:.2s ease;
}
.switch input:checked + .switch-slider{
  background:var(--purple);
}
.switch input:checked + .switch-slider:before{
  transform:translateX(20px);
}
.switch input:disabled + .switch-slider{
  opacity:.6;
}


/* =========================================================
   TUUBI V2.5 - UBICACIÓN ENTRE INTEGRANTES
   ========================================================= */

.group-members-title{
  margin:20px 0 8px;
  font-size:12px;
  font-weight:850;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.08em;
}

.manage-member{
  display:flex;
  align-items:center;
  gap:11px;
  padding:10px 0;
  border-bottom:1px solid var(--line);
}
.manage-member-avatar{
  position:relative;
  width:42px;
  height:42px;
  min-width:42px;
  border-radius:50%;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(145deg,#251d29,#755188);
  color:#fff;
  font-weight:900;
}
.manage-member-avatar img{
  position:absolute;
  inset:0;
  width:42px !important;
  height:42px !important;
  object-fit:cover !important;
  object-position:center !important;
  border-radius:50% !important;
}
.manage-member-info{
  flex:1;
  min-width:0;
}
.manage-member-info b,
.manage-member-info small{
  display:block;
}
.manage-member-info small{
  margin-top:2px;
  color:var(--muted);
  font-size:10px;
}
.remove-member{
  border:0;
  background:#fff1f1;
  color:#a22525;
  border-radius:10px;
  padding:8px 10px;
  font-size:10px;
  font-weight:800;
}
.loading-line{
  padding:12px 0;
  color:var(--muted);
  font-size:12px;
}

/* Leaflet div icon */
.tuubi-div-icon{
  background:transparent !important;
  border:0 !important;
}
.tuubi-person-marker{
  position:relative;
  width:64px;
  height:64px;
}
.map-avatar{
  position:absolute;
  z-index:3;
  left:7px;
  top:7px;
  width:50px;
  height:50px;
  border-radius:50%;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(145deg,#665f67,#8d8790);
  color:#fff;
  font-size:19px;
  font-weight:900;
  border:3px solid #fff;
  box-shadow:0 3px 12px rgba(0,0,0,.33);
}
.map-avatar img{
  position:absolute;
  inset:0;
  width:50px !important;
  height:50px !important;
  max-width:50px !important;
  max-height:50px !important;
  object-fit:cover !important;
  object-position:center !important;
  border-radius:50% !important;
  margin:0 !important;
  padding:0 !important;
}
.direction-wrap{
  position:absolute;
  z-index:1;
  left:0;
  top:0;
  width:64px;
  height:64px;
  transform-origin:32px 32px;
  pointer-events:none;
}
.direction-cone{
  position:absolute;
  left:22px;
  top:-30px;
  width:20px;
  height:44px;
  background:linear-gradient(to top,rgba(105,71,122,.05),rgba(105,71,122,.62));
  clip-path:polygon(50% 0,100% 100%,0 100%);
  filter:drop-shadow(0 2px 3px rgba(0,0,0,.10));
}
.member-popup{
  min-width:155px;
  font-size:12px;
}
.member-popup b{
  display:block;
  font-size:14px;
  margin-bottom:6px;
}
.member-popup-status{
  margin-bottom:5px;
  color:var(--aub);
  font-weight:800;
}
.leaflet-popup-content{
  margin:12px 14px !important;
}
