/* Bosque 9.5 — navegación compacta, árbol plegable, lectura y móvil. */
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.navigation-more,.mobile-view-switch,.mobile-actions,.mobile-filter-trigger{display:none}
.navigation-more select,.mobile-view-switch select{background:var(--cream);border:1px solid var(--edge);color:var(--ink);padding:10px 12px;border-radius:11px;font-size:14px;font-weight:750;max-width:100%}
/* Mantener solamente Mes/Semana/Día en las pestañas; el resto permanece en Más áreas. */
.view-tabs .view-tab:nth-child(n+4){display:none}
.navigation-more{display:block}
.view-tabs{flex-wrap:nowrap!important}
.topbar{grid-template-columns:minmax(0,max-content) minmax(148px,1fr) auto!important;align-items:center!important;gap:10px}
.header-actions{justify-self:end}
.calendar-toolbar{align-items:center}
/* Tipografía secundaria más legible en ambas paletas. */
.helper,.fineprint,.notice,.tree-meta,.tree-hours,.tree-session,.project-client,.report-intro p,.report-table small,.detail-body small,.pending-main small,.drag-tip,.subtle,.tree-group-head small,.forest-project-head small{font-size:12.5px!important;line-height:1.5}
.brand p,.sidebar-hint,.hero p,.filter label{font-size:12px}
/* Árbol: clientes, proyectos y sesiones a demanda; no mostrar cientos de filas de golpe. */
.tree-group,.forest-project{min-width:0;min-height:0}
.tree-group>summary,.forest-project>summary,.tree-session-fold>summary{list-style:none;cursor:pointer;user-select:none}
.tree-group>summary::-webkit-details-marker,.forest-project>summary::-webkit-details-marker,.tree-session-fold>summary::-webkit-details-marker{display:none}
.tree-group>summary::after,.forest-project>summary::after{content:'▸';margin-left:auto;color:var(--muted);font-size:19px}
.tree-group[open]>summary::after,.forest-project[open]>summary::after{content:'▾'}
.tree-group:not([open]){min-height:0}
.tree-group:not([open]) .tree-group-head{border-bottom:0;padding-bottom:0;margin-bottom:0}
.forest-project:not([open]) .forest-project-head{margin-bottom:0}
.tree-session-fold{margin-top:8px;border-top:1px solid var(--edge);padding-top:5px}
.tree-session-fold>summary{font-size:12px;color:var(--forest-dark);font-weight:750;padding:4px 0}
.tree-session-fold>summary:hover,.tree-group>summary:hover,.forest-project>summary:hover{filter:brightness(.93)}
.tree-groups{grid-template-columns:repeat(auto-fill,minmax(min(100%,300px),1fr));gap:12px}
.tree-container{padding:20px 16px}
.tree-session{min-height:34px}
:root[data-theme="dark"] .tree-session-fold>summary{color:#c9e9bc}
/* Fechas y controles fáciles de tocar */
.field input[type=date]{min-height:41px}
@media(max-width:1120px){
 .topbar{grid-template-columns:minmax(135px,1fr) auto!important}
 .topbar .view-tabs{display:none}
 .navigation-more{display:none}
 .mobile-view-switch{display:block;min-width:0}
 .mobile-view-switch select{width:100%}
 .header-actions{justify-self:end;min-width:0}
}
@media(max-width:760px){
 html{scroll-padding-top:16px}
 body{padding-bottom:calc(78px + env(safe-area-inset-bottom,0px))}
 .app-layout{display:flex;flex-direction:column;gap:9px;padding:9px}
 .workspace{order:1;gap:9px}
 .sidebar{order:2;display:none;padding:14px;border-radius:15px}
 body.mobile-menu-open .sidebar{display:flex;position:fixed;left:9px;right:9px;bottom:calc(75px + env(safe-area-inset-bottom,0px));max-height:calc(100dvh - 100px);overflow-y:auto;z-index:31;box-shadow:0 20px 65px #0007}
 .forest-art{display:none!important}
 .topbar{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;padding:9px;gap:7px}
 .header-actions{width:auto!important;gap:6px;justify-self:end}
 .sync-pill{display:none}
 .profile-trigger{padding:4px 6px;min-width:52px}
 .profile-trigger .stamp-avatar{width:30px;height:35px}
 .theme-toggle{min-height:37px;min-width:37px}
 .mobile-view-switch select{font-size:14px;min-height:42px}
 .hero{padding:11px 14px;gap:8px;border-radius:14px;min-height:0}
 .hero .eyebrow{display:none}
 .hero h2{font-size:16px;line-height:1.3;margin:0 0 3px}
 .hero p{font-size:12px}
 .hero-right{gap:5px}
 .pet{font-size:28px}
 .hero-progress{min-width:60px;width:70px}
 .hero-progress b{font-size:19px}
 .hero-progress small{display:none}
 .mobile-actions{display:grid;grid-template-columns:1fr 1.2fr 1fr;gap:7px;position:fixed;bottom:0;left:0;right:0;z-index:28;background:var(--cream);padding:8px 10px calc(8px + env(safe-area-inset-bottom,0px));border-top:1px solid var(--edge);box-shadow:0 -9px 28px #00000018}
 .mobile-actions .btn{font-size:12px;min-width:0;padding:10px 6px;min-height:43px}
 .mobile-actions .btn[hidden]{display:none}
 .mobile-actions:has(#mobileWord[hidden]){grid-template-columns:1fr 1.6fr}
 .mobile-filter-trigger{display:flex!important;align-self:flex-start;justify-content:center;font-size:13px;min-height:36px;align-items:center;width:100%}
 .tools-row{display:none;align-items:stretch;gap:8px;padding:10px;border:1px solid var(--edge);background:var(--cream);border-radius:12px}
 body.mobile-filters-open .tools-row{display:flex}
 .tools-row .filters{display:grid;grid-template-columns:75px minmax(0,1fr);width:100%;gap:8px}
 .filters label{align-self:center;font-size:13px}
 .filters select{max-width:none;width:100%;min-height:39px;font-size:13px}
 .drag-tip{display:none!important}
 .calendar-toolbar{display:grid!important;grid-template-columns:1fr auto;align-items:center;padding:0 3px;gap:4px}
 .calendar-eyebrow{display:none}
 .calendar-toolbar h2{font-size:19px;margin:0}
 .calendar-toolbar .month-navigation{justify-self:end;gap:4px}
 .month-navigation .btn{min-width:36px!important;padding:7px 9px;font-size:12px}
 .calendar-card{border-radius:13px;overflow:hidden}
 .calendar-stage{min-width:0}
 .weeknames span{font-size:11px!important}
 .daycell{min-width:0;min-height:64px;padding:4px 3px}
 .dayhead{gap:0}
 .daynum{font-size:12px}
 /* Los títulos de eventos no caben en 7 columnas: usar contador y abrir el día para el detalle. */
 .month-grid .daycell .event{display:none!important}
 .month-grid .daycell .more-label{display:block!important;font-size:10px;color:var(--forest-dark);padding:3px 0;line-height:1.3}
 .dayadd{display:none!important}
 .day-view-head h3{font-size:18px}
 .hour-drop .btn{min-height:33px}
 .week-columns{grid-template-columns:repeat(2,minmax(0,1fr));overflow-x:auto}
 .bottom-grid{display:flex;flex-direction:column;gap:10px}
 .bottom-grid .card{padding:13px}
 .tree-container{padding:12px 10px}
 .tree-intro h3{font-size:20px}
 .tree-groups{grid-template-columns:minmax(0,1fr)}
 .tree-group{padding:11px}
 .tree-task{padding:8px}
 .tree-task-title{font-size:14px}
 .report-table-wrap{max-width:100%;overflow-x:auto}
 .report-filters{grid-template-columns:1fr 1fr}
 .report-filters label{font-size:13px}
 .report-intro h3{font-size:20px}
 .modal{max-height:calc(100dvh - 20px);padding:14px;border-radius:15px}
 .modal-heading h2{font-size:19px}
 .form-grid{display:grid;grid-template-columns:1fr}
 .script-field textarea{min-height:180px}
 .profile-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .profiles-popover{max-width:calc(100vw - 20px);right:0;z-index:35}
 #toast{bottom:80px}
}
@media(max-width:370px){
 .hero p{display:none}
 .topbar{grid-template-columns:minmax(0,1fr) auto}
 .profile-trigger .stamp-avatar{width:25px;height:29px}
 .mobile-actions .btn{font-size:11px}
 .calendar-toolbar h2{font-size:16px}
}

/* Día compacto: las franjas ocultas siguen disponibles con el botón de las 24 horas. */
.mobile-hours-toggle{display:none}
@media(max-width:760px){
 .mobile-hours-toggle{display:block;margin:8px 10px 10px auto;font-size:13px;min-height:38px}
 .day-hours-compact .hour-line:not(.has-activity):not(.sample-hour){display:none}
 .day-hours-compact .hour-line{min-height:58px}
 .day-hours-compact .hour-drop .btn{opacity:1}
}

/* Reparación de contraste del modo oscuro en los botones móviles. */
:root[data-theme="dark"] .mobile-actions .btn.secondary,
:root[data-theme="dark"] .mobile-filter-trigger{background:#263b32!important;color:#eef3e8!important;border-color:#647e68!important}
:root[data-theme="dark"] .mobile-actions{background:#202d29!important;border-top-color:#526b58!important}
:root[data-theme="dark"] .all-day{background:#263b32;color:#edf1e6}
:root[data-theme="dark"] .tree-container{background:transparent}
:root[data-theme="dark"] .report-table td:first-child{background:#263b32}
