/* Content-sized cards: keep breathing room without stretching short text. */
:root { --card-bottom-space: 24px; }
.card { height: auto; min-height: 0; padding-bottom: var(--card-bottom-space); align-self: start; }
.today-layout > .card { height: auto; }
:is(.grid, .life-mosaic, .learning-grid, .explore-groups, .cycle-guidance,
    .routinegrid, .stretchroutinegrid, .stretchbrowsegrid, .combinedweek) {
  align-items: start;
}
.life-tile { min-height: 0; height: auto; }
:is(.life-tile, .care-note, .learning-category) { padding-bottom: var(--card-bottom-space); }
.life-tile-status, .care-note small { margin-top: 0; }
.learning-category-meta { margin-top: 0; }
/* Terminal margins otherwise add a second gap on top of the card padding.
   Includes a trailing form/wrapper so saved and editable cards stay consistent. */
:is(.card, .care-note, .life-tile, .learning-category) > :last-child,
.card > :is(form, section, div):last-child > :is(p, ul, ol, dl, .actions, .hint, .muted):last-child {
  margin-bottom: 0 !important;
}
.card > .empty:last-child { padding-bottom: 0; }
.card > details:last-child:not(.nutrient-explainer):not(.more-nutrients) { padding-bottom: 0; }
@media (max-width: 620px) {
  :root { --card-bottom-space: 20px; }
}
@media (max-width: 480px) {
  :root { --card-bottom-space: 18px; }
}

/* One-pixel grid tracks let short cards occupy only their own height. */
@media (min-width: 681px) {
  .today-layout.masonry-ready { grid-auto-rows: 1px; row-gap: 0; grid-auto-flow: row dense; }
  .today-layout.masonry-ready > .card { margin: 0; }
}

/* Use one spacing token for both axes, including content-packed My Day cards. */
:root { --card-gap: 16px; }
:is(.today-layout,.combinedweek,.routinegrid,.stretchroutinegrid,.stretchbrowsegrid,.learning-grid,.explore-groups,.life-mosaic) { gap: var(--card-gap); }
:is(.routinegrid,.stretchroutinegrid,.stretchbrowsegrid,.learning-grid,.explore-groups) > .card { margin-bottom: 0; }
@media (min-width:681px) { .today-layout.masonry-ready { row-gap:0; column-gap:var(--card-gap); } }
.combinedweek.weekly-agenda { grid-template-columns:minmax(0,1fr); }
.weekly-agenda .weekly-day { display:grid;grid-template-columns:110px minmax(0,1fr) auto;align-items:center;gap:20px;padding:20px;margin:0;border-radius:18px; }
.weekly-date { display:flex;flex-direction:column;align-items:flex-start;gap:5px; }
.weekly-date .dayheading { padding:0;font-size:16px;text-align:left; }
.weekly-date small { font-size:12px; }
.weekly-content { min-width:0; }
.weekly-activities { display:grid;gap:12px; }
.weekly-activity { display:grid;grid-template-columns:76px minmax(0,1fr);gap:12px;align-items:baseline; }
.weekly-kind { color:var(--muted);font-size:10px;letter-spacing:.5px;text-transform:uppercase;font-weight:700; }
.weekly-activity b { font-size:14px;font-weight:600;overflow-wrap:anywhere; }
.weekly-activity small { display:inline-block;margin-left:8px;font-size:12px; }
.weekly-rest { margin:0;font-size:14px; }
.weekly-logged { margin:12px 0 0;font-size:11px;color:var(--muted); }
.weekly-open { white-space:nowrap;font-size:12px;padding:10px 12px; }
@media(max-width:600px) {
 .weekly-agenda .weekly-day { grid-template-columns:minmax(0,1fr) auto;gap:14px;padding:16px; }
 .weekly-date { flex-direction:row;align-items:baseline;gap:8px;flex-wrap:wrap; }
 .weekly-open { grid-column:2;grid-row:1; }
 .weekly-content { grid-column:1/-1; }
 .weekly-activity { grid-template-columns:72px minmax(0,1fr);gap:10px; }
 .weekly-activity small { display:block;margin:3px 0 0; }
 .weekly-agenda .is-rest { row-gap:8px; }
}

.session-completed-tick{display:inline-flex;align-items:center;justify-content:center;margin-left:8px;color:var(--ink);font-size:16px;font-weight:700;vertical-align:middle}
.other-category-tabs{display:flex;gap:8px;flex-wrap:wrap}.other-category-tabs button{flex:1;min-width:120px}.other-category-tabs small{display:block;font-size:10px;margin-top:5px;color:inherit;opacity:.8}
.other-library{margin-top:20px}.other-exercise{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 0;border-top:1px solid var(--line)}
.other-exercise-name{display:block;min-width:0;text-align:left;background:transparent!important;color:var(--ink)!important;padding:6px 0;font-weight:400}.other-exercise-name b{font-size:14px}.other-exercise-name:hover b{text-decoration:underline}.other-exercise-name small{display:block;font-size:12px;margin-top:6px;line-height:1.5}
.other-exercise>.ghost{flex-shrink:0}.other-guide-title{margin:22px 0 16px}.other-video-placeholder{aspect-ratio:16/9;max-height:260px;border:1px dashed var(--line);border-radius:16px;background:var(--soft,#f1f4ea);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;margin-bottom:24px;color:var(--ink)}.other-video-placeholder>span{font-size:32px}.other-video-placeholder small{font-size:12px}
.other-session-exercise{display:flex;gap:14px;align-items:center;border-top:1px solid var(--line);padding:14px 0}.other-session-exercise input{width:22px;height:22px;flex-shrink:0;accent-color:var(--ink)}.calendar-other{background:var(--accent-alt,#b87964)}
@media(max-width:480px){.other-category-tabs button{min-width:90px;padding:12px 8px;font-size:12px}.other-picked .row{flex-wrap:wrap}}

/* Site-wide card rhythm; grid gaps replace margins inside card collections. */
.card{margin-bottom:var(--card-gap)}
:is(.grid,.hourly-layout,.lab-focus-grid,.cycle-guidance,.savings-grid,.theme-options){gap:var(--card-gap);align-items:start}
:is(.grid,.hourly-layout,.lab-focus-grid,.cycle-guidance,.savings-grid,.theme-options)>.card{margin-bottom:0}
.grid,.hourly-layout{margin-bottom:var(--card-gap)}
.card>.grid:last-child,.card>.hourly-layout:last-child{margin-bottom:0}
.card-pack{grid-auto-rows:1px;grid-auto-flow:row dense;row-gap:0!important;column-gap:var(--card-gap)!important;align-items:start}
.card-pack>*{align-self:start;height:auto;margin-bottom:0!important}

/* Filled disclosures keep equal breathing room above and below their title. */
.card > :is(.nutrient-explainer,.more-nutrients){padding:16px;line-height:1.5}
:is(.nutrient-explainer,.more-nutrients)>summary{margin:0;line-height:1.5}
:is(.nutrient-explainer,.more-nutrients)>p{margin:12px 0 0}
