/* Узкая компактная нижняя полоска инструментов в расширенном редакторе на ПК (max-width: 440px) и модальное окно очистки */
.tma-fs-editor-sheet {
  position: absolute; inset: 0; z-index: 38;
  background: #ffffff; opacity: 0; pointer-events: none;
  transform: translateY(38%) scale(0.96); border-radius: 28px;
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1), opacity 250ms ease, border-radius 320ms ease;
  display: flex; flex-direction: column; align-items: center; overflow: hidden;
}
.tma-chat-room.is-fullscreen-editor .tma-fs-editor-sheet {
  opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); border-radius: 0;
}

.tma-ed-blocks-scroll {
  flex: 1; min-height: 0; width: 100%; max-width: 780px; overflow-y: auto; padding: 68px 18px 92px;
  display: flex; flex-direction: column; justify-content: flex-start; gap: 2px;
  outline: 0; user-select: text; -webkit-user-select: text;
}
.tma-ed-block-row {
  position: relative; width: 100%; padding: 2px 4px; border-radius: 10px;
  background: transparent; display: flex; align-items: baseline; gap: 8px;
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 200ms ease, background 180ms ease, color 180ms ease;
}
.tma-ed-block-row.is-table-row, .tma-ed-block-row.is-image-row { display: block; padding: 4px 0; }
.tma-ed-block-row.is-dragging-block {
  z-index: 60; background: #ffffff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
  transition: box-shadow 200ms ease, background 180ms ease !important;
}
.tma-ed-block-row.is-danger-touch {
  background: rgba(255, 59, 48, 0.12) !important; color: #ff3b30 !important;
  box-shadow: 0 10px 28px rgba(255, 59, 48, 0.25) !important;
}

.tma-ed-list-prefix { color: #18181b; font-weight: 700; font-size: 17px; line-height: 23px; flex-shrink: 0; user-select: none; }
.tma-ed-chk-prefix { width: 18px; height: 18px; border-radius: 5px; border: 1.8px solid #007aff; background: transparent; flex-shrink: 0; cursor: pointer; transform: translateY(2px); }
.tma-ed-chk-prefix.is-checked { background: #007aff; }

.tma-ed-block-content { display: inline-block; max-width: 100%; min-width: 12px; min-height: 23px; outline: 0; font-size: 17px; line-height: 23px; color: #000; white-space: pre-wrap; word-break: break-word; }
.tma-ed-block-content:empty::before { content: attr(data-placeholder); color: rgba(60, 60, 67, 0.34); pointer-events: none; }
.tma-ed-block-content.is-type-h1 { font-size: 25px; font-weight: 800; line-height: 30px; }
.tma-ed-block-content.is-type-h2 { font-size: 22px; font-weight: 700; line-height: 27px; }
.tma-ed-block-content.is-type-h3 { font-size: 19.5px; font-weight: 700; }
.tma-ed-block-content.is-type-quote, .tma-md-quote { display: block; width: 100%; background: rgba(0, 122, 255, 0.09); padding: 8px 12px; border-radius: 11px; border: 0; margin: 2px 0; }
.tma-ed-block-content.is-type-callout, .tma-md-callout { display: block; width: 100%; background: rgba(43, 138, 62, 0.1); padding: 8px 12px; border-radius: 11px; margin: 2px 0; }
.tma-ed-block-content.is-type-code, .tma-md-pre { display: block; width: 100%; font-family: monospace; font-size: 14.5px; background: #f2f3f7; color: #18181b; padding: 8px 12px; border-radius: 10px; margin: 2px 0; }
.tma-ed-block-content.is-type-small, .tma-md-small { font-size: 13.5px; color: #6e6e77; }
.tma-md-inline-img { margin: 4px 0; width: 220px; }

#tma-fs-bottom-slot { position: relative; pointer-events: auto; display: none; flex-direction: column; align-items: center; width: 100%; }
.tma-chat-room.is-fullscreen-editor #tma-fs-bottom-slot { display: flex; }

.tma-fs-bottom-row { display: flex; align-items: center; gap: 8px; width: 100%; max-width: 440px; margin: 0 auto; transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1), opacity 200ms ease; }
.tma-fs-toolbar-island { flex: 1; height: 46px; border-radius: 23px; background: rgba(242, 243, 247, 0.92); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); padding: 0 8px; display: flex; align-items: center; justify-content: space-between; }
.tma-fmt-tools-stage { position: relative; flex: 1; height: 38px; display: flex; align-items: center; overflow: hidden; }
.tma-fmt-group { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-around; gap: 4px; transition: opacity 220ms cubic-bezier(0.22, 1, 0.36, 1), transform 220ms cubic-bezier(0.22, 1, 0.36, 1); }
.tma-fmt-group.is-block-tools { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.tma-fmt-group.is-inline-tools { opacity: 0; transform: translateY(10px) scale(0.9); pointer-events: none; }
.tma-fs-toolbar-island.has-text-selection .tma-fmt-group.is-block-tools { opacity: 0; transform: translateY(-10px) scale(0.9); pointer-events: none; }
.tma-fs-toolbar-island.has-text-selection .tma-fmt-group.is-inline-tools { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.tma-fmt-ico-btn { width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent; color: #1c1c1e; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.tma-fmt-ico-btn:active { background: rgba(0, 0, 0, 0.08); }

.tma-chat-room.is-dragging-block-mode .tma-fs-bottom-row { transform: translateY(56px); opacity: 0; pointer-events: none; }
.tma-block-trash-zone { position: fixed; bottom: 14px; left: 50%; transform: translate(-50%, 42px) scale(0.8); z-index: 80; width: 48px; height: 48px; border-radius: 50%; background: rgba(242, 243, 247, 0.96); backdrop-filter: blur(20px); color: #1c1c1e; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1), opacity 200ms ease, background 180ms ease, color 180ms ease; }
.tma-chat-room.is-dragging-block-mode .tma-block-trash-zone { opacity: 1; transform: translate(-50%, 0) scale(1); }
.tma-block-trash-zone.is-hot-danger { background: #ff3b30; color: #ffffff; transform: translate(-50%, -4px) scale(1.14); }

.tma-draft-modal-backdrop { position: fixed; inset: 0; z-index: 520; background: rgba(15, 23, 42, 0.38); backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center; padding: 18px; }
.tma-draft-modal-card { width: min(320px, 92vw); background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(24px); border-radius: 20px; padding: 20px 18px 16px; text-align: center; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18); }
.tma-draft-modal-card strong { font-size: 17px; color: #000; }
.tma-draft-modal-card p { font-size: 13.5px; color: #6e6e77; line-height: 18px; }
.tma-draft-modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.tma-draft-btn { height: 40px; border: 0; border-radius: 12px; background: #f2f3f7; color: #18181b; font-size: 15px; font-weight: 600; cursor: pointer; }
.tma-draft-btn.is-danger { background: #ff3b30; color: #ffffff; }

.tma-ed-table-wrap, .tma-msg-table-block { position: relative; padding: 6px 0 26px 24px; display: flex; flex-direction: column; gap: 6px; }
.tma-msg-table-block { padding: 4px 0; }
.tma-tbl-caption { text-align: center; font-size: 15.5px; font-weight: 700; color: #000; outline: 0; min-height: 20px; }
.tma-tbl-caption:empty::before { content: attr(data-placeholder); color: rgba(60, 60, 67, 0.38); }
.tma-tbl-grid-shell { position: relative; width: 100%; }
.tma-tbl-border-box { border: 0.5px solid rgba(60, 60, 67, 0.28); border-radius: 12px; overflow: hidden; background: #ffffff; }
.tma-ed-live-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.tma-ed-td { border-right: 0.5px solid rgba(60, 60, 67, 0.28); border-bottom: 0.5px solid rgba(60, 60, 67, 0.28); padding: 7px 10px; min-width: 64px; outline: 0; font-size: 14.5px; color: #000; background: transparent; }
.tma-ed-live-table tr td:last-child { border-right: 0; } .tma-ed-live-table tr:last-child td { border-bottom: 0; }
.tma-ed-td.is-shaded { background: rgba(0, 122, 255, 0.08); }
.tma-ed-td.align-h-left { text-align: left; } .tma-ed-td.align-h-center { text-align: center; } .tma-ed-td.align-h-right { text-align: right; }
.tma-ed-td.align-v-top { vertical-align: top; } .tma-ed-td.align-v-middle { vertical-align: middle; } .tma-ed-td.align-v-bottom { vertical-align: bottom; }
.tma-tbl-selection-frame { position: absolute; pointer-events: none; border: 1.8px solid #007aff; background: transparent !important; z-index: 8; opacity: 0; transition: opacity 180ms ease, top 180ms ease, left 180ms ease, width 180ms ease, height 180ms ease; }
.tma-tbl-selection-frame.is-visible { opacity: 1; }
.tma-tbl-row-handle, .tma-tbl-col-handle { position: absolute; border: 0; background: transparent !important; color: rgba(60, 60, 67, 0.55); cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transform: scale(0.8); transition: opacity 180ms ease, transform 180ms ease; }
.tma-tbl-row-handle { left: -22px; width: 20px; height: 24px; } .tma-tbl-col-handle { bottom: -22px; width: 28px; height: 20px; }
.tma-ed-table-wrap.is-cell-focused .tma-tbl-row-handle, .tma-ed-table-wrap.is-cell-focused .tma-tbl-col-handle { opacity: 1; pointer-events: auto; transform: scale(1); }
.tma-tbl-inspector, .tma-fmt-popover { position: fixed; z-index: 75; width: 236px; background: rgba(250, 250, 252, 0.96); backdrop-filter: blur(26px); -webkit-backdrop-filter: blur(26px); border-radius: 16px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14); overflow: hidden; display: flex; flex-direction: column; opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(8px) scale(0.92); transition: opacity 220ms cubic-bezier(0.22, 1, 0.36, 1), transform 240ms cubic-bezier(0.22, 1, 0.36, 1), visibility 220ms; }
.tma-tbl-inspector.is-open, .tma-fmt-popover.is-open { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0) scale(1); }
.tma-fmt-popover { position: absolute; bottom: 56px; left: calc(50% - 190px); width: 246px; }
.tma-fmt-popover.is-sub-open { width: 264px; }
.tma-fmt-pop-track { display: flex; width: 200%; transition: transform 250ms cubic-bezier(0.22, 1, 0.36, 1); }
.tma-fmt-popover.is-sub-open .tma-fmt-pop-track { transform: translateX(-50%); }
.tma-fmt-pop-page { width: 50%; display: flex; flex-direction: column; }
.tma-tbl-align-bar { display: flex; align-items: center; justify-content: space-around; padding: 6px 8px; border-bottom: 0.5px solid rgba(60, 60, 67, 0.15); }
.tma-tbl-ico-btn { width: 30px; height: 30px; border: 0; border-radius: 7px; background: transparent; color: #1c1c1e; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.tma-tbl-vsep { width: 1px; height: 18px; background: rgba(60, 60, 67, 0.15); }
.tma-pop-item { height: 42px; padding: 0 14px; border: 0; border-bottom: 0.5px solid rgba(60, 60, 67, 0.14); background: transparent; font-size: 15.5px; color: #000; display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.tma-pop-item.is-back-row { color: #007aff; font-weight: 600; justify-content: flex-start; gap: 6px; }
.tma-pop-item.is-danger-item { color: #ff3b30; border-bottom: 0; }

