/* Compact booking editor + Messages tab (dense) */
.booking-create-dialog.bf-dialog.re-edit-dialog{
  padding:8px 12px 0!important;
  max-height:calc(100dvh - 16px)!important;
}
.re-edit-dialog .re-edit-header{
  padding-bottom:4px!important;
  margin-bottom:4px!important;
  border-bottom:1px solid #e8edf3!important;
}
.re-edit-dialog .re-edit-header h2{
  font-size:17px!important;
  line-height:1.2!important;
  margin:0!important;
}
.re-edit-dialog .re-edit-header button{
  font-size:22px!important;
  line-height:1!important;
  padding:0 4px!important;
}
.re-edit-dialog .bf-object{
  padding:0 0 4px!important;
  gap:6px!important;
  margin:0!important;
}
.re-edit-dialog .bf-tabs{
  margin-bottom:4px!important;
  gap:0!important;
}
.re-edit-dialog .bf-tabs .re-tab,
.re-edit-dialog .bf-tabs button,
.re-edit-dialog .bf-tabs>span{
  padding:5px 8px!important;
  font-size:13px!important;
}
.re-edit-dialog .re-footer,
.re-edit-dialog .bf-footer{
  margin-top:6px!important;
  padding:6px 0!important;
}

/* Messages tab */
.re-form .hr-messages,
.re-edit-dialog .hr-messages,
:is(.re-form,.reservation-page) .hr-messages{
  padding:4px 0 0!important;
  margin:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
}
.re-form .hm-heading,
.re-edit-dialog .hm-heading,
:is(.re-form,.reservation-page) .hm-heading{
  display:flex!important;
  flex-direction:row!important;
  flex-wrap:wrap!important;
  align-items:flex-start!important;
  justify-content:flex-start!important;
  gap:6px 14px!important;
  margin:0 0 6px!important;
}
.re-form .hm-heading>div,
.re-edit-dialog .hm-heading>div{
  flex:0 1 auto!important;
  min-width:0!important;
}
.re-form .hm-heading h2,
.re-edit-dialog .hm-heading h2{
  font-size:15px!important;
  margin:0!important;
  line-height:1.25!important;
}
.re-form .hm-heading p,
.re-edit-dialog .hm-heading p{
  margin:1px 0 0!important;
  font-size:12px!important;
  line-height:1.3!important;
}
.re-form .hm-heading a,
.re-edit-dialog .hm-heading a{
  font-size:12px!important;
  white-space:nowrap!important;
  margin-left:0!important;
  align-self:center!important;
}

:is(.re-form,.reservation-page) .hr-messages .hm-unified-layout{
  gap:10px!important;
}
:is(.re-form,.reservation-page) .hm-unified-layout>.hm-compose,
:is(.re-form,.reservation-page) .hm-unified-layout>.hm-history{
  padding:0!important;
}
:is(.re-form,.reservation-page) .hm-unified-layout>.hm-history{
  padding:0 0 0 10px!important;
  border-left:1px solid #e6ecf3!important;
}
:is(.re-form,.reservation-page) .hm-unified-layout .hm-thread{
  max-height:clamp(140px,28dvh,280px)!important;
  padding:4px 0!important;
  gap:8px!important;
}

.re-form .hr-messages .hm-channel-cards,
.re-edit-dialog .hr-messages .hm-channel-cards{
  margin:4px 0 6px!important;
  gap:6px!important;
}
.re-form .hr-messages .hm-channel-cards .hm-channel,
.re-edit-dialog .hr-messages .hm-channel-cards .hm-channel{
  min-height:48px!important;
  padding:6px 8px!important;
}
.re-form .hm-template-row,
.re-edit-dialog .hm-template-row{
  margin-bottom:6px!important;
  gap:6px!important;
}
.re-form .hm-composer-tools,
.re-edit-dialog .hm-composer-tools{
  margin:4px 0!important;
  gap:6px!important;
}
.re-form .hm-message-label textarea,
.re-edit-dialog .hm-message-label textarea,
.re-form .hr-messages textarea,
.re-edit-dialog .hr-messages textarea,
.re-form .hm-message-label textarea{
  min-height:64px!important;
  height:auto!important;
  padding:6px 8px!important;
}
.re-form .hr-messages h3,
.re-edit-dialog .hr-messages h3{
  font-size:13px!important;
  margin:0 0 4px!important;
}
.re-form .hm-history-heading,
.re-edit-dialog .hm-history-heading{
  gap:6px!important;
  margin-bottom:4px!important;
}
.re-form .hm-history-note,
.re-edit-dialog .hm-history-note{
  margin:0 0 4px!important;
  font-size:11px!important;
}
.re-form .hm-empty,
.re-edit-dialog .hm-empty{
  padding:14px 10px!important;
  margin:0!important;
  font-size:13px!important;
}
.re-form .hr-messages button,
.re-edit-dialog .hr-messages button{
  padding:5px 8px!important;
  font-size:12px!important;
}
.re-form .hr-messages label,
.re-edit-dialog .hr-messages label{
  gap:3px!important;
  font-size:12px!important;
}
.re-form .hm-read-controls,
.re-edit-dialog .hm-read-controls{
  margin:4px 0!important;
  gap:6px!important;
}

@media (max-width:760px){
  .booking-create-dialog.bf-dialog.re-edit-dialog{
    padding:6px 8px 0!important;
  }
  :is(.re-form,.reservation-page) .hm-unified-layout>.hm-history{
    padding:8px 0 0!important;
    border-left:0!important;
    border-top:1px solid #e6ecf3!important;
  }
}
.hm-media-pdf{width:min(100%,420px);height:min(70vh,560px);border:0;border-radius:12px;background:#fff}

/* Hide composer "account not connected" strips; keep settings <section class="hm-connection"> */
.hr-messages div.hm-connection,
.hm-layout form div.hm-connection,
.hm-thread ~ div.hm-connection,
div.hm-connection:not(.hm-connections div.hm-connection){
  display:none!important;
}
/* was: revert connection guides — removed so instructions stay hidden */

/* Photo zoom */
img.hm-media-image{cursor:zoom-in;}
.hr-photo-zoom{position:fixed;inset:0;z-index:10050;background:#0b1728e6;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:16px;box-sizing:border-box;}
.hr-photo-zoom-stage{flex:1;min-height:0;width:100%;display:grid;place-items:center;overflow:hidden;cursor:zoom-out;}
.hr-photo-zoom-stage img{max-width:min(96vw,1400px);max-height:78vh;object-fit:contain;transform-origin:center center;transition:transform .08s linear;user-select:none;-webkit-user-drag:none;cursor:grab;background:#0000;}
.hr-photo-zoom-bar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:center;background:#13253dd9;border:1px solid #3a5577;border-radius:14px;padding:10px 12px;color:#e8f1ff;}
.hr-photo-zoom-btn,.hr-photo-zoom-close,.hr-photo-zoom-select{min-width:42px;min-height:42px;border-radius:10px;border:1px solid #6f8eb3;background:#1d3a5f;color:#fff;font:600 18px/1 system-ui;cursor:pointer;padding:0 12px;}
.hr-photo-zoom-select{font-size:14px;}
.hr-photo-zoom-label{min-width:54px;text-align:center;font:600 14px system-ui;}
.hr-photo-zoom-close{font-size:24px;}

.hr-messages div.hm-connection{display:none!important;}

/* hide-account-not-connected-note */
.hm-compact-warning,
p.hm-compact-warning,
.hr-messages .hm-compact-warning,
.hm-layout .hm-compact-warning,
.hm-composer .hm-compact-warning,
form .hm-compact-warning{
  display:none!important;
}

/* route-channel-select */
.hm-compact-route{
  flex-wrap:wrap;
  gap:8px!important;
  align-items:center!important;
}
.hr-messages .hm-compact-route select,
.hm-compact-route select.hm-route-select,
.hm-reply-recipient select{
  border:1px solid #c9d7ef!important;
  background:#fff!important;
  color:#172b45!important;
  border-radius:8px!important;
  padding:5px 28px 5px 10px!important;
  max-width:min(560px, calc(100% - 96px))!important;
  min-width:220px;
  appearance:auto!important;
  -webkit-appearance:menulist!important;
  cursor:pointer!important;
  font-size:12px!important;
  font-weight:600!important;
}
.hm-compact-route button.hm-email-route,
.hm-compact-route button[class*="hm-email"]{
  background:#eef4ff!important;
  color:#2157c4!important;
  border:1px solid #c9d7ef!important;
  border-radius:8px!important;
  padding:5px 12px!important;
  font-size:12px!important;
  font-weight:700!important;
  white-space:nowrap;
}
.hm-reply-recipient{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
  margin:0 0 8px;
  font-size:12px;
  color:#506b89;
}


/* hide-telegram-automation-help */
section.hm-connection.hm-telegram-automation,
.hm-connection.hm-telegram-automation,
.hr-messages .hm-telegram-automation,
.hm-layout .hm-telegram-automation,
.re-edit-dialog .hm-telegram-automation,
.reservation-page .hm-telegram-automation{
  display:none!important;
}

/* booking-link-actions-right */
.re-form .hm-heading,
.re-edit-dialog .hm-heading,
:is(.re-form,.reservation-page) .hm-heading{
  justify-content:flex-start!important;
  align-items:center!important;
}
.hm-heading-actions,
.re-form .hm-heading-actions,
.re-edit-dialog .hm-heading-actions{
  display:inline-flex!important;
  flex-wrap:wrap!important;
  align-items:center!important;
  gap:8px!important;
  margin-left:auto!important;
  order:50!important;
  justify-content:flex-end!important;
}
.hm-heading-actions .hm-booking-link{
  background:#3478f6!important;color:#fff!important;border-color:#3478f6!important;
}
.hm-heading-actions .hm-open-instruction{
  background:#5b7ea8!important;color:#fff!important;border-color:#5b7ea8!important;
}


/* route-select-visible-20261004c */
.hr-messages .hm-compact-route select,
.hm-compact-route select.hm-route-select,
.hm-reply-recipient select{
  min-width:min(100%,280px)!important;
  max-width:100%!important;
  border:2px solid #2d6ce4!important;
  background:#f7faff!important;
  padding:8px 32px 8px 12px!important;
  font-size:13px!important;
}
.hm-reply-recipient{font-weight:700!important;color:#173a63!important}
.hm-email-mode{display:flex;gap:8px;margin:0 0 10px}
.hm-email-mode button{flex:1;min-height:40px;border-radius:10px;border:1px solid #c9d7ef;background:#fff;font-weight:700}
.hm-email-mode button[aria-pressed="true"]{background:#eef4ff;border-color:#2d6ce4;color:#2157c4}

/* inbox-fast-no-welcome-20261004d */
.hm-welcome:not(.hm-welcome-loading){display:none!important}
.hm-welcome-loading{padding:48px 24px!important;text-align:center;color:#5e718c;font-size:14px}
.hm-welcome-loading p{margin:0}
.hr-messenger-center.hm-inbox > main:empty,
.hr-messenger-center.hm-inbox > main > .hm-welcome-loading{min-height:240px}


/* hide-all-messenger-instructions-20261004 */
section.hm-connection.hm-telegram-automation,
.hm-connection.hm-telegram-automation,
.hm-telegram-automation,
details.hm-connection-guide,
.hm-connection-guide,
.hm-guide-content,
.hm-guide-actions,
.hr-messages .hm-connection,
.re-edit-dialog .hm-connection,
.re-form .hm-connection,
.reservation-page .hm-connection,
.hm-layout .hm-connection:not(.hm-connections .hm-connection),
[aria-label*="Инструкция подключения"],
[aria-label*="через автоматизацию"]{
  display:none!important;
  visibility:hidden!important;
  height:0!important;
  max-height:0!important;
  overflow:hidden!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
}

/* Booking Messages: keep guest actions and sender on the same compact row. */
:is(.re-form,.re-edit-dialog,.reservation-page) .hr-messages > .hm-guest-actions {
  display:inline-flex!important;
  vertical-align:top!important;
  align-items:center!important;
  gap:8px!important;
  max-width:100%!important;
  min-height:32px!important;
  padding:0!important;
  margin:0 8px 8px 0!important;
  background:transparent!important;
  border:0!important;
  box-sizing:border-box!important;
}
:is(.re-form,.re-edit-dialog,.reservation-page) .hr-messages > .hm-guest-actions > button {
  min-height:32px!important;
  padding:5px 8px!important;
  white-space:nowrap!important;
}
:is(.re-form,.re-edit-dialog,.reservation-page) .hr-messages > .hm-unified-sender {
  display:inline-flex!important;
  vertical-align:top!important;
  flex-direction:row!important;
  align-items:center!important;
  position:relative!important;
  width:auto!important;
  max-width:100%!important;
  min-height:32px!important;
  padding:0!important;
  margin:0 0 8px!important;
  background:transparent!important;
  border:0!important;
  border-radius:0!important;
  box-sizing:border-box!important;
}
:is(.re-form,.re-edit-dialog,.reservation-page) .hr-messages > .hm-unified-sender > label {
  display:inline-flex!important;
  flex-direction:row!important;
  flex-wrap:nowrap!important;
  align-items:center!important;
  gap:8px!important;
  min-width:0!important;
  max-width:100%!important;
  margin:0!important;
  font-size:12px!important;
  line-height:18px!important;
  white-space:nowrap!important;
}
:is(.re-form,.re-edit-dialog,.reservation-page) .hr-messages > .hm-unified-sender select {
  flex:0 1 270px!important;
  width:270px!important;
  min-width:0!important;
  max-width:calc(100vw - 160px)!important;
  height:32px!important;
  min-height:32px!important;
  padding:4px 26px 4px 8px!important;
  font-size:12px!important;
  line-height:20px!important;
  box-sizing:border-box!important;
}
/* Retain the existing explanations for assistive technology without tall strips. */
:is(.re-form,.re-edit-dialog,.reservation-page) .hr-messages > .hm-unified-sender > small {
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  padding:0!important;
  margin:-1px!important;
  overflow:hidden!important;
  clip-path:inset(50%)!important;
  white-space:nowrap!important;
  border:0!important;
}

/* Booking sender: light-blue account selector. */
:is(.re-form,.re-edit-dialog,.reservation-page) .hr-messages > .hm-unified-sender select {
  background:#e8f2ff!important;
  border-color:#aacbf3!important;
  color:#173c69!important;
}
