/* Task editor: responsive overrides */

@media (max-width: 900px) {
  body.theme-material .right-panel-slot {
    flex: 0 0 0;
    width: 0;
    min-width: 0;
    overflow: visible;
  }
  body.theme-material .right-panel-watermark {
    display: none;
  }
  body.theme-material .right-panel {
    position: fixed;
    right: -100%;
    top: 0;
    height: 100%;
    width: 100%;
    width: 100dvw;
    max-width: none;
    box-sizing: border-box;
    z-index: 2000;
    padding-left: 16px;
    padding-right: 16px;
    padding-top: env(safe-area-inset-top, 0px);
    overflow-x: hidden;
    overscroll-behavior-x: none;
  }
  body.theme-material .right-panel.open {
    right: 0;
    transform: none;
  }
  body.theme-material .right-panel-header {
    width: calc(100% + 32px) !important;
    max-width: none !important;
    margin-left: -16px !important;
    margin-right: -16px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  body.theme-material .right-panel {
    padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  body.theme-material .right-panel-header,
  body.theme-material .right-panel-tabs,
  body.theme-material .panel-section,
  body.theme-material .panel-title-row,
  body.theme-material .panel-title-meta,
  body.theme-material .field-with-prefix,
  body.theme-material .address-row,
  body.theme-material .switch-row {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  body.theme-material .right-panel-tabs {
    width: calc(100% + 32px) !important;
    max-width: none !important;
    margin-left: -16px !important;
    margin-right: -16px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    overflow-x: hidden;
    overscroll-behavior-x: none;
  }
  body.theme-material .right-panel-tab {
    min-width: 0;
    width: 100%;
    padding-left: 6px;
    padding-right: 6px;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  body.theme-material .right-panel input,
  body.theme-material .right-panel textarea,
  body.theme-material .right-panel select,
  body.theme-material .right-panel button {
    max-width: 100%;
  }
  body.theme-material .right-panel .panel-section {
    overflow-x: hidden;
  }
  body.theme-material .right-panel .switch-row {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    width: 100%;
  }
  body.theme-material .right-panel .switch-row input,
  body.theme-material .right-panel #addr-street,
  body.theme-material .right-panel #addr-house,
  body.theme-material .right-panel #addr-apartment,
  body.theme-material .right-panel #addr-entrance,
  body.theme-material .right-panel #addr-line,
  body.theme-material .right-panel #addr-comment,
  body.theme-material .right-panel #subscriber-login,
  body.theme-material .right-panel #subscriber-mac,
  body.theme-material .right-panel #task-comment-input,
  body.theme-material .right-panel #task-desc-input,
  body.theme-material .right-panel #switch-config-text {
    min-width: 0;
    font-size: 16px !important;
  }
  body.theme-material .right-panel #panel-checklist-section .personal-checklist-wrap,
  body.theme-material .right-panel #panel-checklist-section .personal-checklist-list,
  body.theme-material .right-panel #panel-checklist-section .personal-checklist-row {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  body.theme-material .right-panel #panel-checklist-section .personal-checklist-wrap {
    padding: 10px 0;
    overflow: hidden;
  }
  body.theme-material .right-panel #panel-checklist-section .personal-checklist-row {
    grid-template-columns: 28px minmax(0, 1fr) 40px;
    min-height: 48px;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 0;
  }
  body.theme-material .right-panel #panel-checklist-section .personal-checklist-row + .personal-checklist-row {
    margin-top: 0;
    padding-top: 4px;
  }
  body.theme-material .right-panel #panel-checklist-section .personal-checklist-add-btn {
    margin-left: 10px;
  }
  body.theme-material .right-panel #panel-checklist-section .personal-checklist-toggle {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
    padding: 0 !important;
    justify-self: center;
  }
  body.theme-material .right-panel #panel-checklist-section .personal-checklist-text {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 8px 0 !important;
    font-size: 16px !important;
  }
  body.theme-material .right-panel #panel-checklist-section .personal-checklist-remove {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    font-size: 22px;
    justify-self: end;
  }
  body.theme-material .right-panel #panel-checklist-section .personal-checklist-add-btn {
    min-height: 44px;
    padding: 8px 0;
    font-size: 16px;
  }
  body.theme-material .panel-section {
    margin-bottom: 20px;
  }
  body.theme-material .panel-section input,
  body.theme-material .panel-section textarea,
  body.theme-material .panel-section select {
    padding: 14px;
    font-size: 16px !important;
    min-height: 44px;
  }
  body.theme-material .right-panel .field-with-prefix input,
  body.theme-material .right-panel .address-row .field-with-prefix input,
  body.theme-material .right-panel .switch-row input {
    font-size: 16px !important;
  }
  body.theme-material .right-panel input,
  body.theme-material .right-panel textarea,
  body.theme-material .right-panel select,
  body.theme-material .right-panel .assignee-select,
  body.theme-material .right-panel .task-tags-select,
  body.theme-material .right-panel .modal-input,
  body.theme-material .right-panel .ui-input,
  body.theme-material .right-panel .ui-select,
  body.theme-material .right-panel .ui-textarea,
  body.theme-material .right-panel #addr-comment,
  body.theme-material .right-panel #switch-zabbix-value,
  body.theme-material .right-panel #switch-config-text,
  body.theme-material .right-panel .task-comment-compose textarea {
    font-size: 16px !important;
    line-height: 1.35;
  }
  body.theme-material .panel-header-actions {
    flex-wrap: nowrap;
    gap: 6px;
  }
  body.theme-material .task-autosave-status {
    position: static !important;
    right: auto;
    top: auto;
    gap: 6px !important;
    height: 32px !important;
    min-width: 110px !important;
    max-width: 124px !important;
    padding: 0 10px !important;
    font-size: 12px !important;
    z-index: auto;
  }
  body.theme-material .task-autosave-status::before {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
  }
  body.theme-material .right-panel-tabs {
    top: 118px;
  }
  body.theme-material .panel-header-btn {
    min-height: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0 12px;
    font-size: var(--text-md);
    -webkit-tap-highlight-color: transparent;
  }
  body.theme-material .panel-header-btn-done,
  body.theme-material .panel-header-btn-reopen,
  body.theme-material .panel-header-btn-save,
  body.theme-material .panel-header-btn-icon-only {
    width: 44px;
    min-width: 44px;
  }
  body.theme-material .panel-header-btn-icon {
    width: 20px;
    height: 20px;
  }
  body.theme-material .panel-back-btn {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    -webkit-tap-highlight-color: transparent;
  }
  body.theme-material .panel-title {
    font-size: 16px;
    font-weight: var(--font-weight-semibold);
  }

  body.theme-material .right-panel.is-comments-tab {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: hidden !important;
    padding-bottom: 0;
  }

  body.theme-material .right-panel.is-comments-tab .right-panel-header,
  body.theme-material .right-panel.is-comments-tab .right-panel-tabs {
    position: static !important;
    top: auto !important;
    flex: 0 0 auto;
  }

  body.theme-material .right-panel.is-comments-tab .right-panel-tabs {
    margin-bottom: 2px !important;
  }

  body.theme-material .right-panel #panel-comments-section {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    margin-top: 0;
    margin-left: -16px;
    margin-right: -16px;
    width: calc(100% + 32px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  body.theme-material .right-panel #panel-comments-section .task-comments-scroll-area {
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 0;
    padding: 0 12px 14px 16px;
    overflow-y: auto;
    overflow-x: hidden;
  }

  body.theme-material .right-panel #panel-comments-section .task-comments-list {
    gap: 14px;
    padding-top: 0;
  }

  body.theme-material .right-panel #panel-comments-section .task-comment-item {
    padding: 12px;
  }

  body.theme-material .right-panel #panel-comments-section .task-comment-compose {
    flex: 0 0 auto;
    padding: 14px 16px max(14px, env(safe-area-inset-bottom, 0px));
    gap: 10px;
    background: var(--color-bg-surface);
  }

  body.theme-material .right-panel #panel-comments-section .task-comment-input-shell {
    min-height: 76px;
    display: flex;
    flex-direction: column;
  }

  body.theme-material .right-panel #panel-comments-section .task-comment-compose textarea {
    min-height: 24px !important;
    height: 24px;
    max-height: 112px;
    padding: 0 10px 0 0 !important;
    line-height: 24px !important;
    overflow-y: hidden;
  }

  body.theme-material .right-panel #panel-comments-section .task-comment-compose-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    margin-top: auto;
  }

  body.theme-material .right-panel #panel-comments-section .task-comment-compose-actions-left,
  body.theme-material .right-panel #panel-comments-section .task-comment-compose-actions-right {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }

  body.theme-material .right-panel #panel-comments-section .task-comment-compose-actions-right {
    margin-left: auto;
  }

  body.theme-material .right-panel #panel-comments-section .task-comment-add-btn,
  body.theme-material .right-panel #panel-comments-section .task-comment-attach-btn,
  body.theme-material .right-panel #panel-comments-section .task-comment-emoji-btn,
  body.theme-material .right-panel #panel-comments-section .task-comment-voice-btn {
    flex: 0 0 auto;
  }

  body.theme-material .right-panel #panel-comments-section .task-comment-char-counter {
    min-width: 62px;
    font-size: 14px;
  }
}
