/* Shalom · mejoras UX de primera fase para las cuatro experiencias publicas.
 * No redefine la identidad visual ni los permisos. Se carga despues de los estilos existentes. */
:root {
  --shalom-touch-target: 48px;
  --shalom-text-body: 1rem;
  --shalom-text-support: .9375rem;
  --shalom-text-nav: .875rem;
}
body[data-shalom-space] { font-size: var(--shalom-text-body); }
body[data-shalom-space] :is(button, input, select, textarea, a) { touch-action: manipulation; }
body[data-shalom-space] :is(input, select, textarea) { font-size: 1rem; }
body[data-shalom-space] :is(button, a, input, select, textarea):focus-visible {
  outline-width:2px;
  outline-style: solid;
  outline-offset:2px;
}
body[data-shalom-space="main"] .nav-link { font-size: 1rem; min-height: var(--shalom-touch-target); }
body[data-shalom-space="main"] :is(.lead, .announcement-body p, .tile p) { font-size: var(--shalom-text-support); }
body[data-shalom-space="main"] .tile h3 { font-size: 1rem; }
body[data-shalom-space="main"] .announcement-meta { font-size: .875rem; letter-spacing: .02em; }
body[data-shalom-space="main"] :is(.btn, .tiny-btn) { min-height: var(--shalom-touch-target); }
body[data-shalom-space="cafe"] :is(.lead, .note, .product .pprice, .order-line strong, .ticket-line strong, .list-row strong) { font-size: var(--shalom-text-support); }
body[data-shalom-space="cafe"] :is(.product .pname, .field label, .checkline) { font-size: 1rem; }
body[data-shalom-space="cafe"] :is(.product .psub, .order-line .details, .input-hint, .stat small, .stat .meta, .ticket-line small, .section-title small) { font-size: .875rem; }
body[data-shalom-space="cafe"] :is(.btn, .outline, .chip, .qty button, .icon-btn) { min-height: var(--shalom-touch-target); }
body[data-shalom-space="cafe"] .qty button { min-width: var(--shalom-touch-target); }
body[data-shalom-space="cafe"] .product { min-height: 164px; }
body[data-shalom-space="cafe"] .mobile-return { display: none; }
body[data-shalom-space="comms"] :is(.card p, .demo-note, .notice, .help, .error, .success) { font-size: var(--shalom-text-support); }
body[data-shalom-space="comms"] :is(label, legend) { font-size: 1rem; }
body[data-shalom-space="comms"] :is(.meta, .breadcrumb, .overline) { font-size: .875rem; }
body[data-shalom-space="kids"] :is(.module-toolbar p, .teacher-role, .meeting-summary) { font-size: var(--shalom-text-support) !important; }
body[data-shalom-space="kids"] header nav a { font-size: var(--shalom-text-nav); min-height: var(--shalom-touch-target); }
@media (max-width: 850px) {
  body[data-shalom-space="cafe"] .mobile-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body[data-shalom-space="cafe"] .mobile-nav button {
    min-height: 58px; font-size: var(--shalom-text-nav); line-height: 1.2; gap: 4px;
  }
  body[data-shalom-space="cafe"] .mobile-return {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: var(--shalom-touch-target); padding: 9px 10px;
    font-size: var(--shalom-text-nav); text-decoration: underline;
    text-underline-offset: 3px;
  }
  body[data-shalom-space="comms"] .mobile-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body[data-shalom-space="comms"] .mobile-nav a {
    min-height: 58px; display: flex; justify-content: center; align-items: center;
    font-size: var(--shalom-text-nav); line-height: 1.25;
  }
  body[data-shalom-space="kids"] header nav a { font-size: var(--shalom-text-nav); }
}
@media (max-width: 540px) {
  body[data-shalom-space="main"] .tile h3 { font-size: 1rem; }
  body[data-shalom-space="main"] .tile p { font-size: var(--shalom-text-support); }
  body[data-shalom-space="cafe"] .product { min-height: 175px; }
  body[data-shalom-space="cafe"] .top-actions .outline { min-height: var(--shalom-touch-target); font-size: .875rem; }
  body[data-shalom-space="comms"] .demo-note { font-size: var(--shalom-text-support); }
}
@media (prefers-reduced-motion: reduce) {
  body[data-shalom-space] *, body[data-shalom-space] *::before, body[data-shalom-space] *::after {
    animation-duration: .01ms !important; transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Cierre compacto en los diálogos de Comunicaciones, con nombre accesible. */
body[data-shalom-space="comms"] #dialog .dialog-dismiss {
  position:absolute;top:12px;right:12px;display:inline-flex;align-items:center;justify-content:center;
  min-width:44px;width:44px;min-height:44px;height:44px;padding:0;
  background:transparent;color:inherit;border:1px solid var(--border);border-radius:16px;
  font:400 28px/1 Inter,Arial,sans-serif;cursor:pointer;
}
body[data-shalom-space="comms"] #dialog-content>h2:first-child {padding-right:54px;}

/* SPARK: escala tipográfica, separación y jerarquía de tareas. */
:root {
  --shalom-space-1:8px;
  --shalom-space-2:12px;
  --shalom-space-3:16px;
  --shalom-space-4:24px;
  --shalom-space-5:32px;
  --shalom-card-title:1.125rem;
}
body[data-shalom-space="main"] :is(.lead,.announcement-body p,.feature p){font-size:1rem;line-height:1.6}
body[data-shalom-space="main"] .tile h3{font-size:var(--shalom-card-title);line-height:1.35}
body[data-shalom-space="main"] .tile p{font-size:.875rem;line-height:1.55}
body[data-shalom-space="main"] :is(.label,.tiny,.form-help,.announcement-meta){font-size:.875rem;line-height:1.5}
body[data-shalom-space="main"] :is(.tile,.priority-grid .tile){min-height:144px;padding:var(--shalom-space-4)}
body[data-shalom-space="main"] .home-welcome{margin-bottom:var(--shalom-space-5)}
body[data-shalom-space="main"] .home-priorities{margin-bottom:var(--shalom-space-5)}
body[data-shalom-space="main"] .priority-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:var(--shalom-space-3)}
@media(max-width:1100px){body[data-shalom-space="main"] .priority-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
body[data-shalom-space="main"] .priority-grid .tile{
  border-color:var(--borderstrong);background:var(--surface2);
}
body[data-shalom-space="main"] .home-services{margin-top:var(--shalom-space-5)}
body[data-shalom-space="main"] .service-grid .tile{min-height:140px}
body[data-shalom-space="main"] .feature-action .btn{min-height:48px;font-size:1rem}
body[data-shalom-space="main"] :is(.btn,.tiny-btn,.pill-select button,.tab-row button){min-height:44px}
body[data-shalom-space="main"] .family-confirmation .family-confirmation-list{
  padding-left:24px;margin:14px 0;line-height:1.7;
}
body[data-shalom-space="main"] .family-confirmation .family-confirmation-list li{font-size:1rem;padding:4px 0}
@media(max-width:540px){
  body[data-shalom-space="main"] .service-grid{grid-template-columns:minmax(0,1fr)}
  body[data-shalom-space="main"] :is(.tile,.priority-grid .tile){min-height:auto;padding:18px}
  body[data-shalom-space="main"] .tile h3{font-size:var(--shalom-card-title)}
  body[data-shalom-space="main"] .tile p{font-size:.875rem}
  body[data-shalom-space="main"] .home-priorities{margin-bottom:24px}
}
