/* Shared interaction/accessibility contract for all EDRO services. Load after feature styles. */
:root {
  --page-gutter: 24px;
  --edro-blue: var(--md-primary);
  --edro-blue-soft: var(--md-primary-container);
  --edro-ink: var(--md-on-surface);
  --edro-muted: var(--md-on-surface-variant);
  --edro-line: var(--md-outline-variant);
}
button, [role="button"] {
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  touch-action: manipulation;
}
button:disabled { cursor: wait; opacity: .58; }
button[aria-busy="true"] { cursor: progress; }
body :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea),
body .dossier-dialog button, body a.repost-source {
  min-height: var(--touch-min);
}
button .material-symbols-rounded, a .material-symbols-rounded { flex-shrink: 0; }
:is(.edro-iconbtn,.icon-button,.systems-icon-button,.icon-close,.post-popup-close,
.contact-search button,.channel-row button,.calendar-manager-item button,.manage-row-actions button) {
  width: var(--touch-min);
  height: var(--touch-min);
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  display: inline-grid;
  place-items: center;
  padding: 0;
  flex-shrink: 0;
}
:is(.button,.primary,.secondary,.danger,.btn,.primary-button,.secondary-button,.danger-button,.systems-primary-button,.access-state a,
.today-button,.load-more,.progressive-more,.post-expand,.post-open,a.post-popup-open) {
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  padding: 12px 20px;
  line-height: 1.4;
}
:is(.event-action,.card-actions .event-action) {
  width: var(--touch-min); height: var(--touch-min);
  min-width: var(--touch-min); min-height: var(--touch-min);
  flex-basis: var(--touch-min); padding: 0;
}
:is(.filter-chip,.calendar-chip,.period-presets button,.people-modes .segment,
.analytics-tabs .page-item,.view-switch button,.day-button,.text-button,.week-event) {
  min-height: var(--touch-min);
  min-width: var(--touch-min);
}
:is(.participant-access-toggle,.participant-permission,.calendar-scope-option,.multi-option,
.segmented label span) { min-height: var(--touch-min); }
:is(.participant-table select,.access-matrix .participant-access select,
.participant-table input:not([type=checkbox]),.date-range input,.view-controls select) { min-height: var(--touch-min); }
:is(.card-actions,.form-actions,.sheet-actions,.directory-actions,.week-navigation,
.period-nav,.period-presets,.manage-row-actions,.view-controls,.post-actions,.edro-topbar__actions) { gap: 8px; }
:is(.sheet-dialog,.sheet,.person-dialog) { max-width: calc(100vw - 32px); }
:is(.sheet-dialog header,.event-preview-head,.person-form header,.drawer-header,.post-popup-header)>div { min-width: 0; }
:is(.sheet-dialog header,.event-preview-head,.person-form header,.drawer-header,.post-popup-header)>button { flex-shrink: 0; }
:is(.sheet-content,.post-popup-text,.detail-row,.person-detail-row,.summary dd) { line-height: 1.5; }
:is(.sheet-content p,.post-popup-text p,.summary p) { margin-block: 0 1em; }
:is(.post-popup-text,.detail-section,.event-preview-dialog .summary) { max-width: 75ch; }
:is(.calendar-shell,.contacts-shell,.workspace,.shell,.systems-content,.people-page,.person-form) { min-width: 0; }
:is(.calendar-filters,.filter-strip,.channel-filterbar) { scroll-padding-inline: 16px; }
:is(.sheet-dialog article,.drawer,.person-dialog,.sheet form) {
  scroll-padding-block: 80px 24px;
  overscroll-behavior: contain;
}
:is(.repeatable-contact,.channel-row,.calendar-manager-item,.form-grid,.date-range)>input { min-width: 0; }
.edro-topbar { padding-top: env(safe-area-inset-top,0px); }
.edro-topbar__inner { min-height: 68px; }
.edro-topbar__actions .edro-topbar__avatar:has(~button:not([hidden])),
.edro-topbar__actions:has(>button:not([hidden])) .edro-topbar__avatar,
.edro-topbar__actions:has(>a:not([hidden])) .edro-topbar__avatar { flex-shrink: 0; }
:is(.calendar-manager-list,.manage-list) { padding-bottom: max(20px,env(safe-area-inset-bottom)); }
.check-row, .multi-option { cursor: pointer; }
.button.compact, .access-matrix td:last-child .button { min-height:var(--touch-min); padding:12px 20px; }
.search-field input, .contact-search input { min-height:var(--touch-min); }
:where(button,a,input,select,textarea):focus-visible { outline: 3px solid var(--md-primary); outline-offset: 3px; }
@media (hover:hover) {
  :is(.fab-button,.primary-button,.secondary-button,.danger-button,.today-button,.calendar-chip,
  .day-button,.text-button,.event-card,.contact-card,.person-card):hover { filter: brightness(.96); }
}
:is(.fab-button,.primary-button,.secondary-button,.danger-button,.calendar-chip,.day-button,
.text-button,.event-card,.contact-card,.person-card):active { transform: scale(.98); }
@media (max-width:720px) {
  :root { --page-gutter: 16px; }
  .edro-topbar__inner { min-height: 60px; padding-inline: max(16px,env(safe-area-inset-left)); }
  .edro-topbar__actions:has(>button:not([hidden])) .edro-topbar__avatar,
  .edro-topbar__actions:has(>a:not([hidden])) .edro-topbar__avatar { display: none; }
  :is(.contacts-shell,.calendar-shell,.workspace,.shell) {
    padding-left: max(16px,env(safe-area-inset-left));
    padding-right: max(16px,env(safe-area-inset-right));
    padding-bottom: max(32px,env(safe-area-inset-bottom));
  }
  :is(.sheet-dialog,.sheet,.person-dialog) { max-width: 100vw; }
  :is(.sheet-content,.person-form,.sheet form,.post-popup-body,.drawer) {
    padding-bottom: max(24px,env(safe-area-inset-bottom));
  }
  .channel-stats { padding-left: 0; }
  .calendar-create { grid-template-columns: 1fr; }
  .form-actions { flex-wrap: wrap; }
  .calendar-manager-item { grid-template-columns:minmax(0,1fr) var(--touch-min) var(--touch-min); }
  .contacts-shell .channel-row { grid-template-columns:minmax(0,1fr) var(--touch-min); }
  .post-popup-close { width:var(--touch-min); height:var(--touch-min); }
  .action-label { display:none; }
  .compact-action {
    width:var(--touch-min);
    height:var(--touch-min);
    min-width:var(--touch-min);
    min-height:var(--touch-min);
    padding:0;
    flex-shrink:0;
  }
  .edro-topbar__title { align-self:center; }
  .tabs>.compact-action { justify-self:center; }
  .period-presets { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
  .period-presets button { min-width:0; padding:10px 8px; white-space:nowrap; }
  #customPeriod { grid-column:span 2; }
  .post-popup-shell { width:100%; max-width:100%; }
  .post-popup { max-width:100%; min-width:0; }
}
@media (prefers-reduced-motion:reduce) {
  button:active, a:active { transform:none!important; }
}
