/* Shared app surfaces use the same profile palette and sizing as the Home feed. */
.calm-shell {
  --section-radius: 20px;
  --section-gap: clamp(10px, 1.6vw, 16px);
  --section-padding: clamp(14px, 2vw, 22px);
  --section-title: clamp(1.1rem, 2.4vw, 1.32rem);
}

/* Destination groups sit above the active screen. Keep visible labels and icons. */
.calm-shell :is(.organize-sections, .profile-sections, .family-tabs) {
  align-items: stretch;
  gap: 4px;
  margin: 0 0 var(--section-gap);
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface-2);
}
.calm-shell :is(.organize-sections, .profile-sections, .family-tabs) > button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 44px;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}
.calm-shell :is(.organize-sections, .profile-sections, .family-tabs) > button > svg {
  display: block;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}
.calm-shell :is(.organize-sections, .profile-sections, .family-tabs) > [aria-current="page"] {
  border-color: var(--border);
  background: var(--surface);
  color: var(--accent-strong);
  font-weight: 700;
  box-shadow: none;
}

/* A choice stays recognizable as selected across filters, time scales and tools. */
.calm-shell :is(.well-tabs, .cycle-tabs, .life-tabs, .growth-tabs, .family-switch, .schedule-view-tabs, .general-tool-niches, .organizer-views) > button {
  min-height: 44px;
  border-radius: 12px;
  font-size: .82rem;
  line-height: 1.25;
}
.calm-shell :is(.well-tabs, .cycle-tabs, .life-tabs, .growth-tabs, .family-switch, .schedule-view-tabs, .general-tool-niches, .organizer-views) > :is([aria-current="page"], [aria-pressed="true"]) {
  color: var(--accent-strong);
  background: var(--soft);
  box-shadow: inset 0 0 0 1.5px var(--accent-strong);
  font-weight: 700;
}
.calm-shell :is(.family-switch, .growth-tabs) {
  gap: 6px;
  margin-block: var(--section-gap);
}
.calm-shell .general-tool-niches [data-niche="Arquitectura"] {
  margin-inline-start: 0;
}

/* Independent cards share geometry. Status, privacy and cycle colors retain meaning. */
.calm-shell :is(.shop-filters, .growth-section, .family-card, .well-grid > .well-card, .well-space > .well-card, .calm-fold, .tool-library) {
  border-radius: var(--section-radius);
  box-shadow: none;
}
.calm-shell :is(.shop-filters, .growth-section, .well-grid > .well-card, .well-space > .well-card) {
  padding: var(--section-padding);
  border-color: var(--border);
  background: var(--surface);
}
.calm-shell :is(.well-section-head, .schedule-section-head, .growth-section, .shop-filters, .tool-workspace-header) > :is(h2, h3),
.calm-shell .tool-workspace-header > div > h2 {
  color: var(--ink);
  font-size: var(--section-title);
  line-height: 1.25;
  letter-spacing: -.025em;
}
.calm-shell .settings-home > :is(a,button) {
  border-radius: var(--section-radius);
  min-width: 0;
  text-align: start;
}
.calm-shell .settings-home > :is(a,button) > .ui-icon {
  box-sizing: border-box;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  padding: 9px;
  border-radius: 12px;
  background: var(--soft);
  color: var(--accent-strong);
}
.calm-shell :is(.organize-sections, .profile-sections, .family-tabs, .well-tabs, .cycle-tabs, .life-tabs, .growth-tabs, .family-switch, .schedule-view-tabs, .general-tool-niches, .organizer-views, .settings-home) > :focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: -2px;
}
body:has(.calm-shell) dialog .dialog-heading > button {
  min-inline-size: 44px;
  min-block-size: 44px;
  flex-shrink: 0;
}
@media (max-width: 760px) {
  .calm-shell :is(.organize-sections, .profile-sections, .family-tabs) > button {
    gap: 3px;
    padding: 5px 3px;
    flex-direction: column;
    font-size: .79rem;
  }
  .calm-shell .well-space .well-tabs {
    gap: 5px;
    margin-block-end: var(--section-gap);
    padding-block: 0;
  }
  .calm-shell .well-space .well-tabs button {
    padding: 7px 4px;
    gap: 4px;
    min-height: 54px;
  }
  .calm-shell :is(.growth-tabs, .general-tool-niches) > button {
    padding: 7px 10px;
    font-size: .8rem;
  }
  .calm-shell .settings-home > :is(a,button) {
    gap: 12px;
    padding: 14px;
  }
}
@media (max-width: 360px) {
  .calm-shell .well-space .well-tabs button {
    padding-inline: 2px;
    font-size: .76rem;
  }
}
/* Longer translations can move the date controls to a second line. */
.calm-shell .schedule-calendar .schedule-view-bar {
  flex-wrap: wrap;
}
.calm-shell .schedule-calendar .schedule-navigation {
  margin-inline-start: auto;
}
