/* JoyJoy V521 — Shieldy UI reliability: media privacy, timer controls, compact reactions, stable polls. */

/* Internal uploaded media is a system value, never a public URL in the editor. */
body[data-account-page="bots"] :is(#welcome-banner,#farewell-banner).is-internal-media{
  color:var(--account-muted,#6e7781)!important;
  font-style:italic;
  background:color-mix(in srgb,#2da44e 7%,var(--account-surface,#fff))!important;
  border-color:color-mix(in srgb,#2da44e 34%,var(--account-line,#d8dee4))!important;
  text-overflow:ellipsis;
}

/* Welcome/farewell preview must remain a separate, aligned current preview. */
body[data-account-page="bots"] :is(#shieldy-welcome-form,#shieldy-farewell-form).v520-welcome-preview-layout{
  grid-template-columns:minmax(0,1fr) minmax(360px,440px)!important;
  align-items:start!important;
  gap:24px!important;
}
body[data-account-page="bots"] :is(#shieldy-welcome-form,#shieldy-farewell-form).v520-welcome-preview-layout>.welcome-inline-preview{
  min-width:0!important;
  padding:0!important;
  isolation:isolate;
}
body[data-account-page="bots"] :is(#shieldy-welcome-form,#shieldy-farewell-form).v520-welcome-preview-layout .welcome-preview-card{
  min-width:0!important;
  overflow:hidden!important;
}
body[data-account-page="bots"] :is(#shieldy-welcome-form,#shieldy-farewell-form).v520-welcome-preview-layout .welcome-preview-card-slot,
body[data-account-page="bots"] :is(#shieldy-welcome-form,#shieldy-farewell-form).v520-welcome-preview-layout [data-preview-primary-card-slot],
body[data-account-page="bots"] :is(#shieldy-welcome-form,#shieldy-farewell-form).v520-welcome-preview-layout [data-preview-secondary-card-slot]{
  min-width:0!important;
  max-width:100%!important;
}
body[data-account-page="bots"] :is(#shieldy-welcome-form,#shieldy-farewell-form).v520-welcome-preview-layout .welcome-banner-preview.has-custom-banner{
  display:block!important;
  min-height:112px!important;
}

/* Timer: legacy card overflow clipped the calendar, so only this card may overflow. */
body[data-account-page="bots"] #panel-bot-control [data-module-panel="sh-other"] .shieldy-message-timer-card,
body[data-account-page="bots"] #panel-bot-control [data-module-panel="sh-other"] .shieldy-message-timer-body,
body[data-account-page="bots"] #panel-bot-control [data-module-panel="sh-other"] .shieldy-message-timer-editor{
  overflow:visible!important;
}
body[data-account-page="bots"] #panel-bot-control [data-module-panel="sh-other"] .shieldy-message-timer-card{
  position:relative;
  z-index:4;
}
body[data-account-page="bots"] #custom-delivery-datepicker{
  position:relative!important;
  z-index:40!important;
}
body[data-account-page="bots"] #custom-delivery-at-popover{
  z-index:10050!important;
  box-shadow:0 18px 48px rgba(31,45,61,.2)!important;
}
body[data-account-page="bots"] #custom-delivery-at-popover:not([hidden]){
  display:block!important;
}

/* Timer role dropdowns are the interface; native ID textareas stay data sources only. */
body[data-account-page="bots"] :is(#custom-target-role-ids,#custom-excluded-role-ids).jj-entity-native-v513{
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  margin:0!important;
  padding:0!important;
  opacity:0!important;
  pointer-events:none!important;
  clip:rect(0 0 0 0)!important;
}
body[data-account-page="bots"] .custom-delivery-grid .jj-entity-picker-v513{
  min-width:0;
  margin-top:0!important;
}
body[data-account-page="bots"] .custom-delivery-grid .jj-entity-trigger-v513{
  min-height:46px!important;
}

/* Random reactions: compact three-column filters and aligned range cards. */
body[data-account-page="bots"] #panel-bot-control [data-module-panel="sh-other"] .shieldy-random-reaction-layout{
  grid-template-columns:minmax(0,1fr) 248px!important;
  gap:14px!important;
  align-items:start!important;
}
body[data-account-page="bots"] #panel-bot-control [data-module-panel="sh-other"] .shieldy-random-reaction-editor{
  display:grid!important;
  gap:12px!important;
  min-width:0!important;
}
body[data-account-page="bots"] #panel-bot-control [data-module-panel="sh-other"] :is(.shieldy-reaction-emoji-row,.shieldy-reaction-token-input){
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  gap:10px!important;
  align-items:end!important;
}
body[data-account-page="bots"] #panel-bot-control [data-module-panel="sh-other"] .shieldy-reaction-token-list{
  min-height:0!important;
  margin:0!important;
}

body[data-account-page="bots"] #panel-bot-control [data-module-panel="sh-other"] .shieldy-reaction-range-grid{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:10px!important;
  align-items:stretch!important;
}
body[data-account-page="bots"] #panel-bot-control [data-module-panel="sh-other"] .shieldy-reaction-range-grid>.field{
  display:flex!important;
  flex-direction:column!important;
  min-height:126px!important;
  margin:0!important;
  padding:12px!important;
}
body[data-account-page="bots"] #panel-bot-control [data-module-panel="sh-other"] .shieldy-reaction-range-grid>.field>input[type="range"]{
  margin-top:auto!important;
}
body[data-account-page="bots"] #panel-bot-control [data-module-panel="sh-other"] .shieldy-reaction-filter-grid{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:10px!important;
  align-items:start!important;
  margin:0!important;
}
body[data-account-page="bots"] #panel-bot-control [data-module-panel="sh-other"] .shieldy-reaction-filter-grid>.field{
  min-width:0!important;
  margin:0!important;
}
body[data-account-page="bots"] #panel-bot-control [data-module-panel="sh-other"] .shieldy-reaction-toggle-grid{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:8px!important;
  margin:0!important;
}
body[data-account-page="bots"] #panel-bot-control [data-module-panel="sh-other"] .shieldy-reaction-toggle-grid>label{
  min-height:58px!important;
  padding:9px 11px!important;
}
body[data-account-page="bots"] #panel-bot-control [data-module-panel="sh-other"] :is(.shieldy-random-reaction-example,.shieldy-random-reaction-preview){
  position:sticky!important;
  top:18px!important;
  min-width:0!important;
  padding:12px!important;
  align-self:start!important;
}


/* Poll editor: options always occupy their own rows and Premium frame cannot cut through them. */
body[data-account-page="bots"] #panel-bot-control [data-module-panel="sh-other"] .shieldy-poll-options-field{
  position:relative!important;
  z-index:2!important;
  gap:10px!important;
  margin:0 0 14px!important;
  padding:0!important;
  overflow:visible!important;
  border:0!important;
  background:transparent!important;
}
body[data-account-page="bots"] #panel-bot-control [data-module-panel="sh-other"] .shieldy-poll-option-list{
  display:grid!important;
  gap:8px!important;
  min-height:0!important;
}
body[data-account-page="bots"] #panel-bot-control [data-module-panel="sh-other"] .shieldy-poll-option-row{
  display:grid!important;
  grid-template-columns:34px minmax(0,1fr) auto!important;
  gap:8px!important;
  align-items:center!important;
  min-width:0!important;
}
body[data-account-page="bots"] #panel-bot-control [data-module-panel="sh-other"] .shieldy-poll-options-footer{
  position:static!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:10px!important;
  margin:2px 0 0!important;
  transform:none!important;
}
body[data-account-page="bots"] #panel-bot-control [data-module-panel="sh-other"] .shieldy-poll-customization{
  position:relative!important;
  z-index:1!important;
  clear:both!important;
  width:100%!important;
  max-width:100%!important;
  margin:0!important;
  padding:14px!important;
  overflow:hidden!important;
  border:1px solid color-mix(in srgb,#8250df 34%,var(--account-line,#d8dee4))!important;
  border-radius:13px!important;
  background:var(--account-surface,#fff)!important;
  box-shadow:none!important;
  box-sizing:border-box!important;
  isolation:isolate!important;
}
body[data-account-page="bots"] #panel-bot-control [data-module-panel="sh-other"] .shieldy-poll-customization::before,
body[data-account-page="bots"] #panel-bot-control [data-module-panel="sh-other"] .shieldy-poll-customization::after{
  display:none!important;
  content:none!important;
}
body[data-account-page="bots"] #panel-bot-control [data-module-panel="sh-other"] #shieldy-poll-preview-options:empty::before{
  content:'Варианты ответа загружаются…';
  display:block;
  padding:9px 10px;
  border:1px dashed var(--account-line,#d8dee4);
  border-radius:7px;
  color:var(--account-muted,#718096);
  font-size:11px;
}

@media(max-width:1180px){
  body[data-account-page="bots"] #panel-bot-control [data-module-panel="sh-other"] .shieldy-random-reaction-layout{
    grid-template-columns:1fr!important;
  }
  body[data-account-page="bots"] #panel-bot-control [data-module-panel="sh-other"] :is(.shieldy-random-reaction-example,.shieldy-random-reaction-preview){
    position:static!important;
  }
}
@media(max-width:1080px){
  body[data-account-page="bots"] :is(#shieldy-welcome-form,#shieldy-farewell-form).v520-welcome-preview-layout{
    grid-template-columns:1fr!important;
  }
}
@media(max-width:900px){
  body[data-account-page="bots"] #panel-bot-control [data-module-panel="sh-other"] .shieldy-reaction-filter-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
}
@media(max-width:640px){
  body[data-account-page="bots"] #panel-bot-control [data-module-panel="sh-other"] :is(.shieldy-reaction-range-grid,.shieldy-reaction-filter-grid,.shieldy-reaction-toggle-grid){
    grid-template-columns:1fr!important;
  }
  body[data-account-page="bots"] #panel-bot-control [data-module-panel="sh-other"] .shieldy-poll-option-row{
    grid-template-columns:30px minmax(0,1fr)!important;
  }
  body[data-account-page="bots"] #panel-bot-control [data-module-panel="sh-other"] .shieldy-poll-option-remove{
    grid-column:2!important;
    width:100%!important;
  }
}
