/* RC8: restore the compact v0.9.6.1 reading proportions for Notes and Skills only. */
#app .detail-panel.editorial-detail.note-skill-reading{
  padding:var(--space-5);border:1px solid var(--line);
  border-radius:var(--radius-xl);background:var(--panel);box-shadow:none;
}
#app .note-skill-reading .detail-head{
  gap:var(--space-4);padding-bottom:var(--space-3);
}
#app .note-skill-reading h1{
  font-size:calc(var(--text-section-title) + var(--space-2));line-height:var(--leading-heading);
  margin:var(--space-2) 0 var(--space-3);
}
#app .note-skill-reading .detail-description{
  max-width:78ch;line-height:var(--leading-longform);
}
#app .note-skill-reading .filter-bar{
  max-width:none;margin-top:var(--space-3);padding-bottom:0;border-bottom:0;
}
#app .note-skill-reading .detail-content{
  width:100%;max-width:none;min-width:0;
  margin-top:var(--space-4);padding:var(--space-5);
  border:1px solid var(--line);border-radius:var(--radius-lg);
  background:var(--panel-2);box-shadow:none;
  line-height:var(--leading-longform);
}
#app .note-skill-reading .detail-content :is(pre,.rich-table-scroll){
  max-width:100%;overflow-x:auto;
}
#app .note-skill-reading .detail-content :is(table,code){max-width:100%}

/* Routine: a lighter operational card, with title ahead of the count. */
#app:has(>.routines-operational) .routine-grid{
  grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--space-4);
}
#app:has(>.routines-operational) .routine-panel{
  padding:var(--space-4);border:1px solid var(--line);
  border-radius:var(--radius-xl);background:var(--panel);box-shadow:none;
}
#app:has(>.routines-operational) .routine-panel>.section-head{
  align-items:start;gap:var(--space-3);margin-bottom:var(--space-3);
}
#app:has(>.routines-operational) .routine-panel>.section-head h2{
  min-width:0;font-size:var(--text-card-title);line-height:var(--leading-heading);
}
#app:has(>.routines-operational) .routine-panel>.section-head>span{
  flex:none;font-size:var(--text-section-title);line-height:var(--leading-heading);
  font-weight:600;color:var(--muted);font-variant-numeric:tabular-nums;
}
#app:has(>.routines-operational) progress{height:var(--space-2)}
#app:has(>.routines-operational) .routine-items{margin-block:var(--space-3)}
#app:has(>.routines-operational) .checklist-view{
  padding-block:var(--space-2);font-size:var(--text-body);line-height:var(--leading-body);
}
#app:has(>.routines-operational) .routine-actions{
  gap:var(--space-2);padding-top:var(--space-3);
}

/* The credit detail scrolls within a shorter desktop dialog. */
.credit-card-detail{max-height:75vh;max-height:75dvh;overflow-y:auto}
.credit-card-detail .modal-header{
  position:sticky;top:0;z-index:1;background:var(--panel);
}

@media(max-width:1180px){
  #app:has(>.routines-operational) .routine-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media(max-width:780px){
  #app:has(>.routines-operational) .routine-grid{grid-template-columns:minmax(0,1fr)}
  #app .detail-panel.editorial-detail.note-skill-reading{padding:var(--space-4)}
  #app .note-skill-reading .detail-content{padding:var(--space-4)}
  .credit-card-detail{
    max-height:calc(100dvh - var(--space-6) - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }
}
