/* Hay Juntada! · desktop shell
   Se carga después de los estilos mobile para que PC tenga una experiencia
   propia sin cambiar el comportamiento de Android/iPhone. */
.desktop-nav-brand,
.desktop-nav-foot{display:none}

@media (min-width:900px){
  body.app-main-mode{
    padding:24px;
    align-items:center;
    justify-content:center;
    background:
      radial-gradient(circle at 12% 0%,rgba(107,78,255,.16),transparent 38%),
      radial-gradient(circle at 100% 8%,rgba(255,90,54,.14),transparent 34%),
      #eee7eb;
  }

  body.app-main-mode #app{
    width:min(1240px,calc(100vw - 48px));
    max-width:none;
    height:min(900px,calc(100vh - 48px));
    min-height:620px;
    border-radius:32px;
    border:1px solid rgba(92,70,102,.13);
    box-shadow:0 28px 80px rgba(52,35,60,.20);
    background:var(--md-surface);
  }

  body.app-main-mode .bottom-nav{
    position:absolute;
    top:0;
    bottom:0;
    left:0;
    right:auto;
    width:218px;
    height:100%;
    padding:24px 14px 18px;
    flex-direction:column;
    align-items:stretch;
    justify-content:flex-start;
    gap:7px;
    background:linear-gradient(180deg,#fffaf7 0%,#f8edf2 100%);
    border-top:0;
    border-right:1px solid var(--md-outline-variant);
    transform:none;
    border-radius:32px 0 0 32px;
  }

  body.app-main-mode .desktop-nav-brand{
    display:flex;
    align-items:center;
    gap:11px;
    padding:4px 8px 22px;
    margin-bottom:8px;
    border-bottom:1px solid var(--md-outline-variant);
  }
  .desktop-nav-mark{
    width:44px;
    height:44px;
    flex:0 0 auto;
    border-radius:14px;
    display:grid;
    place-items:center;
    background:#dff45d;
    color:#30245f;
    font-family:var(--fd);
    font-weight:900;
    font-size:14px;
    letter-spacing:-.6px;
    box-shadow:0 7px 18px rgba(76,65,28,.11);
  }
  .desktop-nav-brand-copy{min-width:0}
  .desktop-nav-brand-copy strong{
    display:block;
    font-family:var(--fd);
    font-size:15px;
    line-height:1.15;
    color:var(--md-on-surface);
    white-space:nowrap;
  }
  .desktop-nav-brand-copy span{
    display:block;
    margin-top:4px;
    font-family:var(--fm);
    font-size:8px;
    letter-spacing:.7px;
    color:var(--md-on-surface-variant);
  }

  body.app-main-mode .nav-item{
    position:relative;
    width:100%;
    max-width:none;
    flex:0 0 auto;
    min-height:52px;
    padding:6px 10px;
    flex-direction:row;
    justify-content:flex-start;
    gap:11px;
    border-radius:16px;
    color:var(--md-on-surface-variant);
    transition:background .16s,color .16s,transform .08s;
  }
  body.app-main-mode .nav-item:hover{
    background:var(--md-surface-container-high);
    color:var(--md-on-surface);
  }
  body.app-main-mode .nav-item:active{transform:scale(.985)}
  body.app-main-mode .nav-item .nav-icon{
    width:38px;
    height:38px;
    flex:0 0 auto;
    border-radius:12px;
    font-size:19px;
  }
  body.app-main-mode .nav-item.active{
    background:var(--md-secondary-container);
    color:var(--md-on-secondary-container);
  }
  body.app-main-mode .nav-item.active .nav-icon{
    background:rgba(255,255,255,.62);
    color:var(--md-on-secondary-container);
  }
  body.app-main-mode .nav-label{
    font-size:13px;
    letter-spacing:0;
    line-height:1.2;
  }
  body.app-main-mode .nav-badge{
    top:8px;
    right:10px;
    border-color:var(--md-secondary-container);
  }

  body.app-main-mode .desktop-nav-foot{
    display:block;
    margin-top:auto;
    padding:15px 12px 4px;
    border-top:1px solid var(--md-outline-variant);
    color:var(--md-on-surface-variant);
    font-size:11px;
    line-height:1.45;
  }
  body.app-main-mode .desktop-nav-foot strong{
    display:block;
    color:var(--md-on-surface);
    font-family:var(--fd);
    font-size:11px;
  }

  body.app-main-mode .screen{
    left:218px;
    right:0;
    width:auto;
    max-width:none;
    border-radius:0 32px 32px 0;
  }

  body.app-main-mode .content{
    padding:28px 32px 34px;
    padding-bottom:34px;
  }

  body.app-main-mode .topbar{
    min-height:76px;
    padding:18px 28px 10px;
  }
  body.app-main-mode .topbar h1{
    font-size:27px;
    font-weight:700;
    letter-spacing:-.5px;
  }

  /* Home: hero completo y tarjetas de asados en dos columnas. */
  body.app-main-mode #home-content{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:14px;
    align-content:start;
  }
  body.app-main-mode #home-content > *{margin-bottom:0}
  body.app-main-mode #home-content > .home-hero-unified,
  body.app-main-mode #home-content > .bf-row,
  body.app-main-mode #home-content > .section-label,
  body.app-main-mode #home-content > .quick-actions,
  body.app-main-mode #home-content > .empty,
  body.app-main-mode #home-content > .loader{
    grid-column:1/-1;
  }
  body.app-main-mode #home-content > .home-hero-unified{
    min-height:190px;
    padding:30px;
    border-radius:28px;
  }
  body.app-main-mode #home-content .ig-av{width:104px!important;height:104px!important}
  body.app-main-mode #home-content .ig-name{font-size:27px!important}
  body.app-main-mode #home-content .ig-stats-row{max-width:560px}
  body.app-main-mode #home-content .quick-actions{
    grid-template-columns:repeat(2,minmax(0,220px));
    justify-content:start;
    margin-bottom:4px;
  }
  body.app-main-mode #home-content .asado-card{
    min-height:132px;
    margin:0;
    padding:19px;
  }

  /* Amigos y notificaciones: listas densas en dos columnas. */
  body.app-main-mode #friends-content,
  body.app-main-mode #notifs-content{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px 14px;
    align-content:start;
  }
  body.app-main-mode #friends-content > *,
  body.app-main-mode #notifs-content > *{margin-bottom:0}
  body.app-main-mode #friends-content > .friends-hero-v2,
  body.app-main-mode #friends-content > .section-label,
  body.app-main-mode #friends-content > .empty,
  body.app-main-mode #friends-content > .loader,
  body.app-main-mode #notifs-content > .empty,
  body.app-main-mode #notifs-content > .loader{
    grid-column:1/-1;
  }
  body.app-main-mode #friends-content .friends-hero-v2{
    padding:26px!important;
    min-height:164px;
  }
  body.app-main-mode #friends-content .friend-card{
    min-height:86px;
    margin:0;
  }
  body.app-main-mode #notifs-content .notif-item{
    min-height:92px;
    margin:0;
    padding:16px;
  }

  /* Balance: resumen amplio y transferencias en dos columnas. */
  body.app-main-mode #balance-content{max-width:none}
  body.app-main-mode #balance-content .balance-hero-v2{
    padding:26px!important;
    min-height:170px;
  }
  body.app-main-mode #balance-content .global-balance-list{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:14px;
  }
  body.app-main-mode #balance-content .global-balance-card{
    margin:0;
    min-height:100%;
  }

  /* Perfil: más aire y editor legible sin estirar demasiado los campos. */
  body.app-main-mode #screen-profile .profile-hero{
    padding:32px 38px 28px;
    gap:28px;
  }
  body.app-main-mode #screen-profile .ig-av{width:110px!important;height:110px!important}
  body.app-main-mode #screen-profile .ig-name{font-size:28px!important}
  body.app-main-mode #screen-profile .ig-meta-col{max-width:720px}
  body.app-main-mode #profile-content{
    width:min(820px,100%);
    margin:0 auto;
    padding-top:28px;
  }
  body.app-main-mode #profile-content .profile-edit-card{padding:24px}
  body.app-main-mode #profile-content .profile-inline-actions{
    grid-template-columns:minmax(0,220px) minmax(0,220px);
    justify-content:start;
  }

  /* FABs dejan de competir con la navegación lateral. */
  body.app-main-mode .fab{
    right:30px;
    bottom:28px;
  }

  /* Sheets centrados sobre el shell desktop. */
  body.app-main-mode .sheet{
    left:50%;
    right:auto;
    width:min(620px,calc(100% - 64px));
    transform:translate(-50%,100%);
    border-radius:28px 28px 0 0;
  }
  body.app-main-mode .sheet.open{transform:translate(-50%,0)}
  body.app-main-mode .sheet-overlay{border-radius:32px}

  /* Detalles/chat: se amplían, pero no al ancho completo de dashboard. */
  body.app-subpage-mode{
    padding:24px;
    align-items:center;
    justify-content:center;
  }
  body.app-subpage-mode #app{
    width:min(900px,calc(100vw - 48px));
    max-width:none;
    height:min(900px,calc(100vh - 48px));
    min-height:620px;
    border-radius:32px;
    border:1px solid rgba(92,70,102,.13);
    box-shadow:0 28px 80px rgba(52,35,60,.18);
  }
  body.app-subpage-mode .screen{border-radius:32px}
  body.app-subpage-mode .content{
    padding:24px 28px 34px;
    padding-bottom:34px;
  }
  body.app-subpage-mode .topbar{padding-left:22px;padding-right:22px}
  body.app-subpage-mode .chat-messages{padding:22px 28px}
  body.app-subpage-mode .chat-input{padding-left:28px;padding-right:28px}
}

@media (min-width:900px) and (max-width:1100px){
  body.app-main-mode #app{width:calc(100vw - 32px)}
  body.app-main-mode .bottom-nav{width:188px;padding-left:10px;padding-right:10px}
  body.app-main-mode .screen{left:188px}
  body.app-main-mode .desktop-nav-brand-copy span{display:none}
  body.app-main-mode .content{padding-left:24px;padding-right:24px}
}

@media (min-width:900px) and (max-height:700px){
  body.app-main-mode,
  body.app-subpage-mode{padding:12px}
  body.app-main-mode #app,
  body.app-subpage-mode #app{height:calc(100vh - 24px);min-height:0}
  body.app-main-mode .content{padding-top:20px;padding-bottom:24px}
}

/* Detail, chat y formularios en desktop */
@media (min-width:900px){
  body.app-subpage-mode #screen-detail .topbar{
    min-height:72px;
    padding:16px 24px 10px;
  }
  body.app-subpage-mode #detail-content{
    padding:26px 30px 32px;
  }
  body.app-subpage-mode #detail-content .detail-stats-row{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:12px;
    margin-bottom:22px;
  }
  body.app-subpage-mode #detail-content .stat{
    min-height:92px;
    padding:18px;
    border-radius:20px;
  }
  body.app-subpage-mode #detail-content .stat-val{
    font-size:24px;
  }
  body.app-subpage-mode #detail-content .detail-desktop-grid{
    display:grid;
    grid-template-columns:minmax(0,1.08fr) minmax(330px,.92fr);
    gap:22px;
    align-items:start;
  }

  body.app-subpage-mode #detail-content .detail-desktop-col{
    display:block;
    min-width:0;
  }
  body.app-subpage-mode #detail-content .detail-people-col,
  body.app-subpage-mode #detail-content .detail-money-col{
    padding:18px;
    border:1px solid var(--md-outline-variant);
    border-radius:24px;
    background:var(--md-surface-container-lowest);
  }
  body.app-subpage-mode #detail-content .section-label{
    margin-top:0;
    margin-bottom:12px;
  }
  body.app-subpage-mode #detail-content .comensal-card{
    margin-bottom:10px;
    padding:15px;
    border-radius:18px;
  }
  body.app-subpage-mode #detail-content .comensal-actions{
    gap:7px;
    flex-wrap:wrap;
  }
  body.app-subpage-mode #detail-content .pago-item,
  body.app-subpage-mode #detail-content .balance-line{
    border-radius:18px;
    padding:14px;
  }

  body.app-subpage-mode #detail-content .balance-panel{
    margin-top:16px;
    border-radius:22px;
    padding:18px;
  }
  body.app-subpage-mode #detail-content .detail-actions-row{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
    margin-top:18px;
  }
  body.app-subpage-mode #detail-content .detail-action-flex{
    width:100%;
    min-height:44px;
  }
  body.app-subpage-mode #detail-content .asado-delete-btn{
    margin-top:10px;
  }

  body.app-subpage-mode #screen-chat .topbar{
    min-height:72px;
    padding:14px 24px;
  }
  body.app-subpage-mode #screen-chat .chat-messages{
    padding:26px 34px;
    gap:13px;
    background:linear-gradient(180deg,#f9f4f6 0%,#f4edf1 100%);
  }

  body.app-subpage-mode #screen-chat .msg-col{
    max-width:min(68%,620px);
  }
  body.app-subpage-mode #screen-chat .msg-av{
    width:40px;
    height:40px;
    font-size:13px;
  }
  body.app-subpage-mode #screen-chat .msg-bubble{
    padding:12px 15px;
    border-radius:18px;
    font-size:14px;
    line-height:1.55;
    box-shadow:0 3px 10px rgba(58,38,75,.06);
  }
  body.app-subpage-mode #screen-chat .chat-img-grid{
    max-width:420px;
    gap:8px;
  }
  body.app-subpage-mode #screen-chat .chat-input{
    gap:10px;
    padding:14px 30px 18px;
    background:#fffaf7;
  }
  body.app-subpage-mode #screen-chat .chat-input textarea{
    min-height:52px;
    max-height:160px;
    padding:14px 18px;
    border-radius:20px;
  }

  body.app-subpage-mode #screen-chat .chat-send,
  body.app-subpage-mode #screen-chat .chat-attach{
    width:52px;
    height:52px;
  }

  body.app-main-mode .sheet,
  body.app-subpage-mode .sheet{
    top:50%;
    bottom:auto;
    left:50%;
    right:auto;
    width:min(640px,calc(100% - 72px));
    max-height:min(82vh,760px);
    padding-bottom:0;
    border-radius:28px;
    opacity:0;
    visibility:hidden;
    pointer-events:none;
    transform:translate(-50%,calc(-50% + 24px)) scale(.98);
    transition:transform .2s ease,opacity .18s ease,visibility 0s linear .2s;
    box-shadow:0 28px 80px rgba(35,22,42,.28);
  }
  body.app-main-mode .sheet.open,
  body.app-subpage-mode .sheet.open{
    opacity:1;
    visibility:visible;
    pointer-events:auto;
    transform:translate(-50%,-50%) scale(1);
    transition-delay:0s;
  }

  body.app-main-mode .sheet-handle,
  body.app-subpage-mode .sheet-handle{display:none}

  body.app-main-mode .sheet-title,
  body.app-subpage-mode .sheet-title{
    padding:24px 28px 16px;
    font-size:23px;
    border-bottom:1px solid var(--md-outline-variant);
    background:var(--md-surface-container-lowest);
    flex:0 0 auto;
  }
  body.app-main-mode .sheet-content,
  body.app-subpage-mode .sheet-content{
    padding:20px 28px 24px;
    overflow-y:auto;
  }
  body.app-main-mode .sheet-actions,
  body.app-subpage-mode .sheet-actions{
    padding:14px 28px 22px;
    border-top:1px solid var(--md-outline-variant);
    background:var(--md-surface-container-lowest);
  }
  body.app-main-mode .sheet .input-group,
  body.app-subpage-mode .sheet .input-group{
    margin-bottom:16px;
  }
  body.app-main-mode .sheet .input-field,
  body.app-subpage-mode .sheet .input-field,

  body.app-main-mode .sheet textarea,
  body.app-subpage-mode .sheet textarea,
  body.app-main-mode .sheet select,
  body.app-subpage-mode .sheet select{
    min-height:48px;
    font-size:14px;
  }
  body.app-main-mode .sheet .btn,
  body.app-subpage-mode .sheet .btn{
    min-height:46px;
  }
  body.app-main-mode .app-confirm-card,
  body.app-subpage-mode .app-confirm-card{
    width:min(440px,100%);
    border-radius:26px;
  }
  body.app-main-mode .app-confirm-head,
  body.app-subpage-mode .app-confirm-head{
    padding:28px 30px 0;
  }
  body.app-main-mode .app-confirm-actions,
  body.app-subpage-mode .app-confirm-actions{
    padding:18px 24px 24px;
  }
}

/* Reports, perfiles públicos, lightbox y estados vacíos en desktop */
@media (min-width:900px){
  body.app-main-mode #balance-content .balance-report-box{
    margin-top:22px;
    padding:22px;
    border-radius:24px;
    background:linear-gradient(180deg,#fffdfb 0%,#fff8f4 100%);
  }
  body.app-main-mode #balance-content .balance-report-head{
    margin-bottom:18px;
    padding-bottom:14px;
    border-bottom:1px solid var(--md-outline-variant);
  }
  body.app-main-mode #balance-content .balance-report-head h3{
    font-size:20px;
  }
  body.app-main-mode #balance-content .balance-report-head p{
    font-size:13px;
  }
  body.app-main-mode #balance-content .balance-report-grid{
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:12px;
    margin:0 0 18px;
  }
  body.app-main-mode #balance-content .balance-report-stat{
    min-height:92px;
    padding:16px;
    border-radius:18px;
  }

  body.app-main-mode #balance-content .balance-report-stat strong{
    font-size:23px;
  }
  body.app-main-mode #balance-content .balance-report-section{
    margin-top:16px;
    padding:18px;
    border:1px solid var(--md-outline-variant);
    border-radius:20px;
    background:var(--md-surface-container-lowest);
  }
  body.app-main-mode #balance-content .balance-report-section h4{
    font-size:14px;
    margin-bottom:14px;
  }
  body.app-main-mode #balance-content .balance-report-row{
    grid-template-columns:120px 1fr 90px;
    gap:12px;
    margin:11px 0;
  }
  body.app-main-mode #balance-content .balance-report-list{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
  }
  body.app-main-mode #balance-content .balance-report-item{
    min-height:72px;
    border-radius:16px;
    padding:13px 14px;
    transition:transform .12s ease,box-shadow .12s ease,background .12s ease;
  }

  body.app-main-mode #balance-content .balance-report-item.clickable:hover{
    transform:translateY(-1px);
    background:#fff;
    box-shadow:0 8px 20px rgba(58,38,75,.07);
  }

  body.app-main-mode .sheet .pub-profile-hero,
  body.app-subpage-mode .sheet .pub-profile-hero{
    padding:24px 28px;
    gap:20px;
    background:linear-gradient(145deg,#f7f0ff 0%,#fff5f0 100%);
  }
  body.app-main-mode .sheet .pub-av,
  body.app-subpage-mode .sheet .pub-av{
    width:96px;
    height:96px;
    font-size:30px;
    border:4px solid #fff;
    box-shadow:0 10px 28px rgba(61,40,78,.12);
  }
  body.app-main-mode .sheet .pub-name,
  body.app-subpage-mode .sheet .pub-name{
    font-size:23px;
  }
  body.app-main-mode .sheet .pub-nick,
  body.app-subpage-mode .sheet .pub-nick{
    font-size:13px;
  }

  body.app-main-mode .sheet .pub-bio,
  body.app-subpage-mode .sheet .pub-bio{
    max-width:420px;
    font-size:14px;
    line-height:1.55;
  }
  body.app-main-mode .sheet .pub-stats,
  body.app-subpage-mode .sheet .pub-stats{
    margin:18px 28px 22px;
    border-radius:18px;
  }
  body.app-main-mode .sheet .pub-stat,
  body.app-subpage-mode .sheet .pub-stat{
    padding:16px 8px;
  }
  body.app-main-mode .sheet .pub-stat strong,
  body.app-subpage-mode .sheet .pub-stat strong{
    font-size:20px;
  }

  .chat-lightbox{
    padding:34px 86px;
    background:rgba(14,8,20,.94);
    backdrop-filter:blur(12px);
  }
  .chat-lightbox img{
    max-width:min(1180px,86vw);
    max-height:86vh;
    border-radius:20px;
    box-shadow:0 30px 90px rgba(0,0,0,.48);
  }
  .chat-lightbox-btn{
    width:56px;
    height:56px;
    background:rgba(255,255,255,.14);
    border:1px solid rgba(255,255,255,.16);
  }

  .chat-lightbox-close{top:26px;right:28px}
  .chat-lightbox-prev{left:28px}
  .chat-lightbox-next{right:28px}
  .chat-lightbox-count{
    bottom:26px;
    padding:9px 16px;
    backdrop-filter:blur(10px);
  }

  body.app-main-mode .empty,
  body.app-subpage-mode .empty{
    width:min(560px,100%);
    min-height:260px;
    margin:28px auto;
    padding:38px 34px;
    border:1px dashed var(--md-outline-variant);
    border-radius:26px;
    background:linear-gradient(180deg,var(--md-surface-container-lowest),var(--md-surface-container-low));
  }
  body.app-main-mode .empty-emoji,
  body.app-subpage-mode .empty-emoji{
    width:78px;
    height:78px;
    display:grid;
    place-items:center;
    border-radius:24px;
    background:var(--md-secondary-container);
    font-size:38px;
  }
  body.app-main-mode .empty-title,
  body.app-subpage-mode .empty-title{
    font-size:22px;
  }

  body.app-main-mode .empty-sub,
  body.app-subpage-mode .empty-sub{
    max-width:420px;
  }

  body.app-main-mode .asado-card,
  body.app-main-mode .friend-card,
  body.app-main-mode .notif-item,
  body.app-main-mode .global-balance-card{
    transition:transform .14s ease,box-shadow .14s ease,background .14s ease;
  }
  body.app-main-mode .asado-card:hover,
  body.app-main-mode .friend-card:hover,
  body.app-main-mode .notif-item:hover,
  body.app-main-mode .global-balance-card:hover{
    transform:translateY(-2px);
    box-shadow:0 10px 26px rgba(58,38,75,.08);
    background:#fff;
  }

  body.app-main-mode button:focus-visible,
  body.app-subpage-mode button:focus-visible,
  body.auth-mode button:focus-visible,
  body.app-main-mode a:focus-visible,
  body.app-subpage-mode a:focus-visible,
  body.auth-mode a:focus-visible{
    outline:3px solid rgba(107,78,255,.28);
    outline-offset:3px;
  }
}

@media (min-width:900px){
  body.app-subpage-mode #detail-content .detail-actions-row{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
  body.app-subpage-mode #detail-content .detail-actions-row>.detail-action-flex:last-child{
    grid-column:auto;
  }
  body.app-main-mode #sheet-invite-asado .invite-share-textarea,
  body.app-subpage-mode #sheet-invite-asado .invite-share-textarea{
    min-height:210px;
  }
}
