/**
 * editor-variables.css — CSS Custom Properties (Theming)
 * 
 * Содержит:
 * - Все CSS переменные из прототипа
 * - Цветовые схемы
 * - Размеры
 * - Тени
 * - Переходы
 * - Breakpoints
 */

:root {
  /* ===== Core Colors ===== */
  --tc-bg: #f1f3f4;
  --tc-chrome: #ffffff;
  --tc-toolbar: #edf2f7;
  --tc-paper: #ffffff;
  --tc-line: #dadce0;
  --tc-text: #202124;
  --tc-muted: #5f6368;
  --tc-muted-light: #7b8188;
  
  /* ===== Accent Colors ===== */
  --tc-blue: #1a73e8;
  --tc-blue2: #e8f0fe;
  --tc-blue-hover: #d7e6fb;
  --tc-blue-active: #174ea6;
  --tc-danger: #c5221f;
  --tc-success: #34a853;
  --tc-warning: #f9ab00;
  
  /* ===== Document Dimensions ===== */
  --tc-doc-width: 816px;
  --tc-doc-pad-x: 86px;
  --tc-doc-pad-y: 72px;
  --tc-doc-font: Arial, Helvetica, sans-serif;
  --tc-doc-size: 15px;
  --tc-doc-line: 1.55;
  
  /* ===== Panel Sizes ===== */
  --tc-left-panel: 260px;
  --tc-right-inspector: 320px;
  
  /* ===== Heights ===== */
  --tc-head-height: 74px;
  --tc-toolbar-height: 42px;
  --tc-ruler-height: 30px;
  --tc-statusbar-height: 28px;
  
  /* ===== Shadows ===== */
  --tc-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --tc-shadow-md: 0 2px 8px rgba(0, 0, 0, 0.1);
  --tc-shadow-lg: 0 8px 28px rgba(60, 64, 67, 0.24);
  --tc-shadow-xl: 0 18px 55px rgba(0, 0, 0, 0.3);
  
  /* ===== Border Radius ===== */
  --tc-radius-sm: 4px;
  --tc-radius-md: 7px;
  --tc-radius-lg: 12px;
  
  /* ===== Transitions ===== */
  --tc-transition-fast: 0.08s ease;
  --tc-transition-normal: 0.16s ease;
  --tc-transition-slow: 0.2s ease;
  
  /* ===== Brand Themes ===== */
  --tc-brand-accent: #1a73e8;
  --tc-brand-page: #ffffff;
  --tc-brand-text: #202124;
  --tc-brand-heading: #17365d;
  --tc-brand-font: Inter;
}

/* ===== True Creator Theme ===== */
[data-theme="true-creator"] {
  --tc-brand-accent: #1a73e8;
  --tc-brand-page: #ffffff;
  --tc-brand-text: #202124;
  --tc-brand-heading: #17365d;
  --tc-brand-font: Inter;
}

/* ===== KALINA RECORDS Theme ===== */
[data-theme="kalina-records"] {
  --tc-brand-accent: #7b3f58;
  --tc-brand-page: #fffdfb;
  --tc-brand-text: #251f22;
  --tc-brand-heading: #4f2738;
  --tc-brand-font: Manrope;
}

/* ===== TRUE VISUAL Theme ===== */
[data-theme="true-visual"] {
  --tc-brand-accent: #cc4f2d;
  --tc-brand-page: #fffdf9;
  --tc-brand-text: #262321;
  --tc-brand-heading: #6b2f20;
  --tc-brand-font: Manrope;
}

/* ===== OPREX Theme ===== */
[data-theme="oprex"] {
  --tc-brand-accent: #2e6b57;
  --tc-brand-page: #fcfefd;
  --tc-brand-text: #202724;
  --tc-brand-heading: #204d40;
  --tc-brand-font: Inter;
}

/* ===== Breakpoints ===== */
:root {
  --tc-breakpoint-mobile: 768px;
  --tc-breakpoint-tablet: 1024px;
  --tc-breakpoint-desktop: 1440px;
}
/**
 * editor-toolbar.css — Стили тулбара и кнопок
 * 
 * Содержит:
 * - Toolbar buttons (basic, icon, select)
 * - Button groups
 * - Dividers
 * - Add button
 * - Popups
 * - Selects
 * - Color picker
 * - Zoom button
 * - Style/Font/Size selects
 */

/* ===== Toolbar Base ===== */
.tc-toolbar {
  background: var(--tc-toolbar);
  margin: 0 14px;
  border-radius: 22px;
  height: var(--tc-toolbar-height);
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 10px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  z-index: 18;
  scrollbar-width: none;
}

.tc-toolbar::-webkit-scrollbar {
  display: none;
}

/* ===== Toolbar Button (Basic) ===== */
.tc-toolbar-btn {
  height: 30px;
  min-width: 30px;
  border: 0;
  background: transparent;
  border-radius: 6px;
  padding: 0 8px;
  cursor: pointer;
  color: #303134;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 14px;
  transition: background var(--tc-transition-fast);
}

.tc-toolbar-btn:hover {
  background: #dfe6ee;
}

.tc-toolbar-btn.active {
  background: #d7e6fb;
  color: var(--tc-blue-active);
}

.tc-toolbar-btn:disabled {
  opacity: 0.35;
  cursor: default;
  background: transparent;
}

/* ===== Toolbar Button (Icon) ===== */
.tc-toolbar-btn.icon {
  font-size: 17px;
  min-width: 28px;
}

/* ===== Toolbar Button (Compact) ===== */
.tc-toolbar-btn.compact {
  font-size: 18px;
  min-width: 26px;
  padding: 0 5px;
}

/* ===== Toolbar Button (Select) ===== */
.tc-toolbar-btn.select {
  background: var(--tc-chrome);
  border: 1px solid #d8dee6;
  justify-content: space-between;
  min-width: 105px;
  padding: 0 8px;
  font-size: 13px;
}

.tc-toolbar-btn.select.small-select {
  min-width: 72px;
}

.tc-toolbar-btn.select.font-select {
  min-width: 118px;
}

.tc-toolbar-btn.select.size-select {
  min-width: 58px;
}

.tc-toolbar-btn.select.zoom-btn {
  min-width: 96px;
}

/* ===== Toolbar Button (Color) ===== */
.tc-toolbar-btn.color-btn {
  position: relative;
  min-width: 30px;
}

.tc-toolbar-btn.color-btn .color-dot {
  width: 18px;
  height: 4px;
  background: var(--tc-text);
  border-radius: 2px;
  position: absolute;
  bottom: 3px;
}

/* ===== Toolbar Button Group ===== */
.tc-toolbar-group {
  display: flex;
  align-items: center;
  gap: 2px;
}

/* ===== Toolbar Divider ===== */
.tc-toolbar-divider {
  width: 1px;
  height: 22px;
  background: #cbd2da;
  margin: 0 4px;
  flex: none;
}

/* ===== Toolbar Add Button ===== */
.tc-toolbar-add-btn {
  height: 30px;
  width: 30px;
  border: 0;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  color: var(--tc-text);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tc-toolbar-add-btn:hover {
  background: #dfe6ee;
}

/* ===== Toolbar Popup ===== */
.tc-toolbar-popup {
  position: absolute;
  z-index: 50;
  background: var(--tc-chrome);
  border: 1px solid #d8dde4;
  border-radius: 8px;
  box-shadow: var(--tc-shadow-lg);
  padding: 6px 0;
  min-width: 200px;
  max-height: 74vh;
  overflow-y: auto;
}

/* ===== Toolbar Popup Item ===== */
.tc-toolbar-popup-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  min-height: 34px;
}

.tc-toolbar-popup-item:hover {
  background: #f1f3f4;
}

.tc-toolbar-popup-item.disabled {
  color: #b1b5ba;
  pointer-events: none;
}

.tc-toolbar-popup-item.checked::before {
  content: '✓';
  width: 14px;
  color: #333;
}

.tc-toolbar-popup-item:not(.checked)::before {
  content: '';
  width: 14px;
}

.tc-toolbar-popup-item .shortcut {
  margin-left: auto;
  color: #8a8f95;
  font-size: 12px;
}

.tc-toolbar-popup-item .arrow {
  margin-left: auto;
  color: #70757a;
  font-size: 18px;
}

.tc-toolbar-popup-divider {
  height: 1px;
  background: #e3e6ea;
  margin: 5px 0;
}

/* ===== Submenu ===== */
.tc-submenu {
  position: fixed;
  z-index: 90;
  background: var(--tc-chrome);
  border: 1px solid #dadce0;
  border-radius: 8px;
  box-shadow: var(--tc-shadow-lg);
  min-width: 260px;
  padding: 6px 0;
  max-height: 72vh;
  overflow: auto;
}

/* ===== Zoom Controls ===== */
.tc-zoom-control {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tc-zoom-btn {
  width: 24px;
  height: 24px;
  border: 1px solid #dee2e6;
  background: var(--tc-chrome);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #495057;
  padding: 0;
}

.tc-zoom-btn:hover {
  background: #e9ecef;
}

.tc-zoom-slider {
  width: 80px;
  height: 4px;
}

.tc-zoom-value {
  font-weight: 500;
  min-width: 40px;
  text-align: center;
  font-size: 13px;
}

/* ===== Font Browser Popup ===== */
.tc-font-browser {
  width: 320px;
  max-height: 400px;
  overflow: auto;
}

.tc-font-browser-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 12px;
}

.tc-font-browser-item {
  padding: 12px;
  border: 1px solid #d8dde4;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--tc-transition-fast);
}

.tc-font-browser-item:hover {
  background: #f7f9fb;
}

.tc-font-browser-item-name {
  font-size: 12px;
  color: var(--tc-muted);
  margin-bottom: 4px;
}

.tc-font-browser-item-preview {
  font-size: 18px;
  color: var(--tc-text);
}

/* ===== Style Manager Popup ===== */
.tc-style-manager {
  width: 600px;
  max-height: 80vh;
  overflow: auto;
}

.tc-style-manager-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 12px;
}

.tc-style-card {
  border: 1px solid #d8dde4;
  border-radius: 9px;
  padding: 12px;
  cursor: pointer;
}

.tc-style-card:hover {
  background: #f7f9fb;
}

.tc-style-card-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}

.tc-style-card-preview {
  padding: 13px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: var(--tc-chrome);
}

/* ===== Button Group in Inspector ===== */
.tc-button-group {
  display: flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0;
  padding: 3px;
}

.tc-button-group[data-direction="vertical"] {
  flex-direction: column;
  align-items: stretch;
}

.tc-button-group[data-align="center"] {
  margin-left: auto;
  margin-right: auto;
}

.tc-button-group[data-align="right"] {
  margin-left: auto;
  margin-right: 0;
}

.tc-button-group-item {
  min-height: 36px;
  padding: 8px 15px;
  border-radius: 8px;
  font-size: 14px;
  white-space: nowrap;
}

.tc-button-group.size-small .tc-button-group-item {
  min-height: 30px;
  padding: 6px 11px;
  font-size: 12px;
}

.tc-button-group.size-large .tc-button-group-item {
  min-height: 42px;
  padding: 10px 19px;
  font-size: 16px;
}

.tc-button-primary {
  background: var(--tc-blue);
  color: var(--tc-chrome);
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
}

.tc-button-primary:hover {
  filter: brightness(0.95);
}

.tc-button-secondary {
  background: var(--tc-chrome);
  color: var(--tc-blue);
  border: 1px solid var(--tc-blue);
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
}

.tc-button-secondary:hover {
  background: #f0f6ff;
}

.tc-button-ghost {
  background: transparent;
  color: var(--tc-blue);
  border: none;
  padding: 8px 16px;
  cursor: pointer;
}

/* ===== Range Line (in inspector) ===== */
.tc-range-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 10px;
  align-items: center;
}

.tc-range-line output {
  height: 28px;
  border: 1px solid #d8dde3;
  border-radius: 7px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #505861;
}

/* ===== Button Rows (in inspector) ===== */
.tc-button-rows {
  display: grid;
  gap: 8px;
}

.tc-button-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 108px 30px;
  gap: 6px;
  align-items: center;
}

.tc-button-row input,
.tc-button-row select {
  width: 100%;
  height: 34px;
  border: 1px solid #d8dde3;
  border-radius: 7px;
  padding: 0 8px;
  background: var(--tc-chrome);
}

.tc-icon-mini {
  width: 30px;
  height: 30px;
  border: 1px solid #d8dde3;
  background: var(--tc-chrome);
  border-radius: 7px;
  cursor: pointer;
}

.tc-icon-mini:hover {
  background: #f2f5f8;
}

/* ===== Inspector Actions ===== */
.tc-inspector-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
/**
 * editor-blocks.css — Стили блоков контента
 * 
 * Содержит:
 * - Block wrapper
 * - Block drag handle
 * - Block index
 * - Block actions
 * - Block selected/focused states
 * - All block types (paragraph, heading, lists, quote, image, gallery, table, code, divider, callout, link, button, source, related, audio, pricing, before-after, carousel, chart, testimonial)
 */

/* ===== Block Wrapper ===== */
.tc-block {
  position: relative;
  margin: 0;
  transition: all var(--tc-transition-fast);
}

.tc-block:hover {
  background: rgba(26, 115, 232, 0.03);
}

/* ===== Block Drag Handle ===== */
.tc-block-drag-handle {
  position: absolute;
  left: -28px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  cursor: grab;
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tc-muted);
  font-size: 16px;
  border-radius: 4px;
  transition: opacity var(--tc-transition-fast);
}

.tc-block:hover .tc-block-drag-handle {
  opacity: 1;
}

.tc-block-drag-handle:active {
  cursor: grabbing;
}

/* ===== Block Index ===== */
.tc-block-index {
  position: absolute;
  left: -40px;
  top: 0;
  font-size: 11px;
  color: var(--tc-muted-light);
  opacity: 0;
  transition: opacity var(--tc-transition-fast);
}

.tc-block:hover .tc-block-index {
  opacity: 1;
}

/* ===== Block Actions ===== */
.tc-block-actions {
  position: absolute;
  right: -32px;
  top: 0;
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity var(--tc-transition-fast);
}

.tc-block:hover .tc-block-actions {
  opacity: 1;
}

.tc-block-action-btn {
  width: 24px;
  height: 24px;
  border: 0;
  background: var(--tc-chrome);
  border: 1px solid var(--tc-line);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--tc-muted);
}

.tc-block-action-btn:hover {
  background: #f1f3f4;
}

/* ===== Block Selected ===== */
.tc-block.selected {
  outline: 2px solid #6aa5f8;
  outline-offset: 2px;
  border-radius: 4px;
}

.tc-block.selected .component-tag {
  display: block;
}

/* ===== Block Focused ===== */
.tc-block.focused {
  outline: 2px solid var(--tc-blue);
  outline-offset: 2px;
}

/* ===== Component Tag ===== */
.component-tag {
  position: absolute;
  top: -11px;
  left: 10px;
  background: #e8f0fe;
  color: var(--tc-blue-active);
  border: 1px solid #c9dcfa;
  font: 11px Arial;
  padding: 2px 7px;
  border-radius: 10px;
  display: none;
  z-index: 2;
  white-space: nowrap;
}

.tc-block:hover > .component-tag,
.tc-block.selected > .component-tag {
  display: block;
}

/* ===== Lock Badge ===== */
.lock-badge {
  position: absolute;
  right: 9px;
  top: 9px;
  font: 11px Arial;
  color: var(--tc-muted);
  background: var(--tc-chrome);
  border: 1px solid #d8dde4;
  border-radius: 10px;
  padding: 2px 6px;
  z-index: 2;
}

/* ===== Paragraph ===== */
.tc-paragraph {
  margin: 0.5em 0;
  line-height: 1.6;
  font-size: 16px;
  color: #1a1a1a;
}

.tc-paragraph.is-editor-empty::before {
  content: attr(data-placeholder);
  float: left;
  color: #adb5bd;
  pointer-events: none;
  height: 0;
}

/* ===== Headings ===== */
.tc-heading {
  font-weight: 700;
  color: #17365d;
  margin-top: 1em;
  margin-bottom: 0.5em;
}

.tc-heading-1 {
  font-size: 34px;
  line-height: 1.16;
  margin-bottom: 22px;
  color: #17365d;
}

.tc-heading-2 {
  font-size: 23px;
  line-height: 1.28;
  margin-top: 28px;
  margin-bottom: 10px;
  color: #356daf;
}

.tc-heading-3 {
  font-size: 19px;
  line-height: 1.3;
  margin-top: 22px;
  margin-bottom: 8px;
  color: #202124;
}

/* ===== Lists ===== */
.tc-list {
  margin: 0 0 14px;
  padding-left: 28px;
}

.tc-list-item {
  margin: 4px 0;
  line-height: 1.6;
}

.tc-list-bullet {
  margin-right: 8px;
}

.tc-list-number {
  margin-right: 8px;
  color: var(--tc-text);
}

/* ===== Blockquote ===== */
.tc-quote {
  margin: 22px 0;
  padding: 12px 18px;
  border-left: 4px solid #7ba7df;
  background: #f6f9fd;
  color: #3c4043;
  font-style: italic;
}

/* ===== Image Block ===== */
.tc-image-block {
  position: relative;
  margin: 22px 0;
  border: 1px solid transparent;
  border-radius: 10px;
}

.tc-image-block:hover {
  border-color: #d4dfef;
}

.tc-image-block img {
  width: 100%;
  display: block;
  border-radius: 8px;
  max-height: 420px;
  object-fit: cover;
}

.tc-image-caption {
  font-size: 12px;
  color: #666;
  margin-top: 6px;
  text-align: center;
}

/* ===== Image Focal Preview ===== */
.tc-image-focal-preview {
  height: 110px;
  border: 1px solid #d9dee5;
  border-radius: 8px;
  background: linear-gradient(135deg, #edf2f7, #dce7f5);
  position: relative;
}

.tc-image-focal-preview::after {
  content: '+';
  position: absolute;
  left: var(--fx, 50%);
  top: var(--fy, 50%);
  transform: translate(-50%, -50%);
  color: var(--tc-blue-active);
  font-size: 24px;
  font-weight: 700;
}

/* ===== Gallery ===== */
.tc-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 22px 0;
}

.tc-gallery-grid img {
  width: 100%;
  border-radius: 8px;
  max-height: 420px;
  object-fit: cover;
}

/* ===== Table ===== */
.tc-table-wrap {
  position: relative;
  margin: 18px 0;
  overflow: auto;
}

.tc-table {
  width: 100%;
  border-collapse: collapse;
}

.tc-table th,
.tc-table td {
  border: 1px solid #cfd4da;
  padding: 9px 10px;
  min-width: 70px;
  vertical-align: top;
}

.tc-table th {
  background: #f2f4f7;
  font-weight: 700;
}

.tc-table td:focus,
.tc-table th:focus {
  outline: 2px solid var(--tc-blue);
  outline-offset: -2px;
}

.tc-table.zebra tbody tr:nth-child(even) {
  background: #f8fafc;
}

.tc-table.dark-header th {
  background: #263238;
  color: #fff;
}

.tc-table.minimal th,
.tc-table.minimal td {
  border-width: 0 0 1px;
}

/* ===== Code Block ===== */
.tc-code-block {
  background: #f6f8fa;
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  padding: 16px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: auto;
  margin: 22px 0;
}

/* ===== Divider ===== */
.tc-divider {
  border: 0;
  border-top: 1px solid #cfd4da;
  margin: 28px 0;
}

/* ===== Callout ===== */
.tc-callout {
  padding: 16px 18px;
  border-radius: 10px;
  background: #f2f6fb;
  border-left: 4px solid #5b8fd5;
  margin: 22px 0;
}

.tc-callout.warning {
  background: #fff7e6;
  border-color: #f29900;
}

.tc-callout.success {
  background: #ecf8f0;
  border-color: #34a853;
}

/* ===== Link Block ===== */
.tc-link {
  color: #1967d2;
  text-decoration: underline;
}

/* ===== Button Block ===== */
.tc-button-block {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--tc-blue);
  color: #fff !important;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  border: none;
  transition: filter var(--tc-transition-fast);
}

.tc-button-block:hover {
  filter: brightness(0.9);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.tc-button-block.secondary {
  background: var(--tc-chrome);
  color: var(--tc-blue) !important;
  border: 1px solid var(--tc-blue);
}

.tc-button-block.ghost {
  background: transparent;
  color: var(--tc-blue) !important;
}

.tc-button-block.large {
  padding: 13px 20px;
  font-size: 16px;
}

.tc-button-block.small {
  padding: 7px 12px;
  font-size: 12px;
}

.tc-button-block.state-disabled-preview {
  opacity: 0.45;
  pointer-events: none;
}

/* ===== Source Card ===== */
.tc-source-card {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #cbd6e3;
  background: #f6f9fd;
  border-radius: 8px;
  padding: 8px 10px;
  color: #335d8c;
  margin: 10px 0;
}

/* ===== Related Links ===== */
.tc-related-links {
  margin: 22px 0;
}

.tc-related-card {
  border: 1px solid #d7dde5;
  border-radius: 10px;
  padding: 14px;
  background: var(--tc-chrome);
  margin-bottom: 12px;
}

/* ===== Audio Block ===== */
.tc-audio-block {
  margin: 22px 0;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 10px;
  border: 1px solid var(--tc-line);
}

/* ===== Pricing Block ===== */
.tc-pricing-block {
  margin: 22px 0;
}

.tc-pricing-card {
  border: 1px solid #d7dde5;
  border-radius: 12px;
  padding: 18px;
  background: var(--tc-chrome);
  text-align: center;
}

.tc-pricing-card.featured {
  border-color: var(--tc-blue);
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.15);
}

/* ===== Before-After Block ===== */
.tc-before-after {
  position: relative;
  height: 260px;
  overflow: hidden;
  border-radius: 10px;
  background: #dfe6ee;
  margin: 22px 0;
}

.tc-before-after .before {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: bold;
  background: #cbd8e8;
}

.tc-before-after .after {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: bold;
  background: #8eb0db;
  color: #fff;
  clip-path: inset(0 50% 0 0);
}

.tc-before-after input[type="range"] {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 14px;
  width: 84%;
  z-index: 3;
}

/* ===== Carousel Block ===== */
.tc-carousel {
  overflow: hidden;
  border: 1px solid #d9dee5;
  border-radius: 10px;
  margin: 22px 0;
}

.tc-carousel-viewport {
  position: relative;
  min-height: 180px;
}

.tc-carousel-slide {
  display: none;
  padding: 28px;
  background: #f8fafc;
}

.tc-carousel-slide.active {
  display: block;
}

.tc-carousel-controls {
  display: flex;
  justify-content: space-between;
  padding: 8px;
  border-top: 1px solid var(--tc-line);
}

.tc-carousel-controls button {
  border: 1px solid #d5dae1;
  background: var(--tc-chrome);
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
}

/* ===== Chart Block ===== */
.tc-chart-block {
  margin: 22px 0;
  padding: 20px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid var(--tc-line);
}

/* ===== Testimonial Block ===== */
.tc-testimonial-block {
  padding: 20px;
  background: #f8fafc;
  border-radius: 10px;
  border-left: 4px solid var(--tc-blue);
  margin: 22px 0;
}

/* ===== Section Block ===== */
.tc-section {
  padding: 28px;
  background: #f8fafc;
  border-radius: 10px;
  margin: 22px 0;
  border: 1px solid transparent;
}

.tc-section:hover {
  border-color: #d4dfef;
}

.tc-section[data-bg="blue"] {
  background: #edf5ff;
}

.tc-section[data-bg="dark"] {
  background: #20242a;
  color: #fff;
}

.tc-section[data-bg="dark"] h2 {
  color: #fff;
}

/* ===== Columns Layout ===== */
.tc-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.tc-columns.ratio-40-60 {
  grid-template-columns: 2fr 3fr;
}

.tc-columns.ratio-60-40 {
  grid-template-columns: 3fr 2fr;
}

.tc-column {
  min-width: 0;
}

.tc-column > [contenteditable="true"] {
  outline: none;
}

/* ===== Grid Layout ===== */
.tc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

/* ===== Card ===== */
.tc-card {
  border: 1px solid #d7dde5;
  border-radius: 12px;
  padding: 18px;
  background: var(--tc-chrome);
}

/* ===== Stats ===== */
.tc-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 22px 0;
}

.tc-stat {
  padding: 18px;
  border-radius: 10px;
  background: #f7f9fc;
  text-align: center;
}

.tc-stat strong {
  display: block;
  font-size: 28px;
  color: var(--tc-blue);
}

/* ===== Steps ===== */
.tc-steps {
  counter-reset: step;
  margin: 22px 0;
}

.tc-step {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  margin: 14px 0;
}

.tc-step::before {
  counter-increment: step;
  content: counter(step);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--tc-blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: bold;
}

/* ===== Timeline ===== */
.tc-timeline {
  border-left: 2px solid #8ab4f8;
  padding-left: 18px;
  margin: 22px 0;
}

.tc-timeline-item {
  margin: 14px 0;
}

/* ===== Comparison ===== */
.tc-comparison {
  margin: 22px 0;
}

/* ===== Tabs ===== */
.tc-tabs-nav {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #d8dde4;
  margin: 22px 0;
}

.tc-tab-btn {
  border: 0;
  background: transparent;
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.tc-tab-btn.active {
  color: var(--tc-blue);
  border-bottom-color: var(--tc-blue);
}

.tc-tab-panel {
  padding: 14px 2px;
}

/* ===== Accordion ===== */
.tc-accordion details {
  border: 1px solid #d9dee5;
  border-radius: 8px;
  margin: 8px 0;
  padding: 10px 12px;
}

.tc-accordion summary {
  font-weight: 600;
  cursor: pointer;
}

/* ===== Structured Block ===== */
.tc-structured-block {
  border: 1px solid #d9dee5;
  border-radius: 12px;
  padding: 18px;
  background: #fbfcfe;
  margin: 22px 0;
}

.tc-structured-title {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 12px;
}

.tc-structured-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  border-top: 1px solid #e3e6eb;
}

.tc-structured-grid > div {
  padding: 9px;
  border-bottom: 1px solid #e3e6eb;
}

.tc-structured-grid > div:nth-child(odd) {
  color: #667085;
  font-size: 13px;
}

/* ===== Variable ===== */
.tc-variable {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 10px;
  background: #efe7ff;
  color: #5e35b1;
  border: 1px solid #d9c8fb;
  font-size: 0.92em;
  white-space: nowrap;
}

/* ===== Claim Source ===== */
.claim-source {
  background: linear-gradient(transparent 68%, #dcecff 68%);
  border-bottom: 1px dotted #4c83c3;
  cursor: pointer;
}

.claim-source sup {
  color: var(--tc-blue);
  font-weight: 700;
  margin-left: 2px;
}

/* ===== Bookmark ===== */
.bookmark {
  display: inline-block;
  border-left: 4px solid #fbbc04;
  padding-left: 9px;
  color: #795b00;
  margin: 10px 0;
}

.bookmark-item {
  padding: 8px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  color: #4d5156;
}

.bookmark-item:hover {
  background: #edf1f5;
}

/* ===== Smart Table Badge ===== */
.smart-table-badge {
  display: inline-block;
  font-size: 10px;
  padding: 2px 6px;
  background: #edf3fc;
  color: #315d92;
  border-radius: 8px;
  margin-bottom: 5px;
}

/* ===== Image Placeholder ===== */
.img-placeholder {
  height: 180px;
  border-radius: 8px;
  background: linear-gradient(135deg, #dce7f8, #eef3fa);
  display: grid;
  place-items: center;
  color: var(--tc-muted);
}

/* ===== Design Mode Overrides ===== */
body.mode-design .tc-component,
body.mode-design .tc-layout,
body.mode-design .tc-table-wrap {
  border-color: #cbd9ec;
}

body.mode-design .component-tag {
  display: block !important;
}

body.mode-edit .component-tag {
  display: none !important;
}

body.mode-preview .component-tag,
body.mode-preview .contextual-toolbar-2 {
  display: none !important;
}

/* ===== Formatting Marks ===== */
.show-marks p::after,
.show-marks h1::after,
.show-marks h2::after,
.show-marks h3::after,
.show-marks blockquote::after,
.show-marks li::after {
  content: " ¶";
  color: #7c8ba0;
  font-family: Arial;
  font-weight: 400;
  font-size: 0.78em;
  opacity: 0.75;
}

/* ===== Comment Anchor ===== */
.tc-comment-anchor {
  background: #fff1a8;
  border-bottom: 2px solid #e6b800;
  cursor: pointer;
}

.comments-hidden .tc-comment-anchor {
  background: transparent;
  border-bottom-color: transparent;
}

.review-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fbbc04;
  margin-left: 5px;
}

/* ===== Move Flash Animation ===== */
.move-flash {
  animation: moveFlash 0.42s ease;
}

@keyframes moveFlash {
  0% {
    box-shadow: 0 0 0 3px rgba(106, 165, 248, 0.33);
  }
  100% {
    box-shadow: none;
  }
}
/**
 * editor-interactions.css — Hover/Active/Focus/Disabled состояния
 * 
 * Содержит:
 * - 40+ hover/active/focus/disabled states из прототипа
 * - Transitions
 * - Animations
 * - Pseudo-elements (::before, ::after)
 * - Body state classes (focus-mode, mode-design, mode-edit, mode-preview)
 */

/* ===== Menu Bar Interactions ===== */
.tc-menubar-btn:hover {
  background: #e8eaed;
}

.tc-menubar-btn.active {
  background: #e8eaed;
}

/* ===== Menu Popup ===== */
.tc-toolbar-popup-item:hover {
  background: #f1f3f4;
}

.tc-toolbar-popup-item.disabled {
  opacity: 0.42;
  pointer-events: none;
}

.tc-toolbar-popup-item.checked .mi-icon {
  color: var(--tc-blue);
}

.tc-toolbar-popup-item.checked .mi-icon::before {
  content: '✓';
}

.tc-toolbar-popup-item:not(.checked) .mi-icon::before {
  content: '';
}

/* Menu animation */
.tc-toolbar-popup.show,
.tc-submenu.show {
  animation: menuIn 0.11s ease-out;
}

@keyframes menuIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ===== Toolbar Button Interactions ===== */
.tc-toolbar-btn:hover {
  background: #dfe6ee;
}

.tc-toolbar-btn.active {
  background: #d7e6fb;
  color: var(--tc-blue-active);
}

.tc-toolbar-btn:disabled {
  opacity: 0.35;
  cursor: default;
  background: transparent;
}

.tc-toolbar-btn.select {
  background: var(--tc-chrome);
  border: 1px solid #d8dee6;
}

/* ===== Work Mode Buttons ===== */
.tc-mode-btn:hover {
  background: #e4e8ed;
}

.tc-mode-btn.active {
  background: var(--tc-chrome);
  color: var(--tc-blue-active);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.13);
  font-weight: 600;
}

/* ===== Left Panel - Outline/Blocks ===== */
.tc-outline-item:hover,
.tc-block-item:hover {
  background: #edf1f5;
}

.tc-outline-item.active,
.tc-block-item.active {
  color: var(--tc-blue);
  border-color: var(--tc-blue);
  background: #eaf2ff;
}

.tc-outline-item[draggable="true"] {
  cursor: grab;
}

.tc-outline-item.dragging {
  opacity: 0.35;
}

.tc-outline-item.drop-target {
  background: #dcecff;
  border-top: 2px solid var(--tc-blue);
}

.tc-tabs .tc-tab.on {
  background: var(--tc-chrome);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

/* ===== Canvas Block Interactions ===== */
.tc-component:hover,
.tc-layout:hover {
  border-color: #d4dfef;
}

.tc-component.selected,
.tc-layout.selected,
.tc-table-wrap.selected {
  outline: 2px solid #6aa5f8;
  outline-offset: 2px;
}

/* ===== Contextual Toolbar ===== */
.tc-contextual-toolbar-2 {
  transition: opacity var(--tc-transition-fast);
}

.tc-contextual-toolbar-2-btn:hover {
  background: #eef3f8;
}

.tc-contextual-toolbar-2-btn.danger {
  color: var(--tc-danger);
}

/* ===== Inspector Controls ===== */
.tc-inspector-btn:hover {
  background: #f3f5f7;
}

.tc-inspector-input:focus,
.tc-inspector-select:focus,
.tc-inspector-textarea:focus {
  outline: 2px solid #c6dafc;
  border-color: #6f9fe8;
}

.tc-inspector-device-btn.active {
  background: var(--tc-chrome);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.13);
  color: var(--tc-blue-active);
}

/* ===== Dialog States ===== */
.tc-dialog-overlay.show {
  display: flex;
}

.tc-dialog {
  width: min(640px, 92vw);
  max-height: 82vh;
  overflow: auto;
  background: var(--tc-chrome);
  border-radius: 12px;
  box-shadow: var(--tc-shadow-xl);
  border: 1px solid #d5dae1;
}

.tc-list-card:hover {
  background: #f7f9fb;
}

.tc-template-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.13);
}

/* ===== Command Search ===== */
.tc-command-search .tc-result:hover,
.tc-command-search .tc-result.active {
  background: #f1f3f4;
}

/* ===== Preview Device Lab ===== */
.tc-device-btn:hover {
  background: #edf2f8;
}

.tc-device-btn.active {
  background: var(--tc-chrome);
  color: var(--tc-blue-active);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.13);
}

.tc-preview-tool-btn:hover {
  background: #f5f7fa;
}

.tc-preview-device-shell {
  transform-origin: top center;
  transition: transform var(--tc-transition-normal);
}

/* ===== Table Cells ===== */
.tc-table td:focus,
.tc-table th:focus {
  outline: 2px solid var(--tc-blue);
  outline-offset: -2px;
}

/* ===== Ruler Interactions ===== */
.tc-ruler-marker {
  cursor: ew-resize;
}

.tc-ruler-tab {
  cursor: pointer;
}

.tc-table-col-mark {
  cursor: ew-resize;
}

.tc-ruler-margin-shade {
  background: #e9edf2;
}

/* ===== Brand/Interactive Components ===== */
.tc-brand-chip:hover {
  background: #f6f8fb;
}

.claim-source {
  background: linear-gradient(transparent 68%, #dcecff 68%);
  border-bottom: 1px dotted #4c83c3;
  cursor: pointer;
}

.bookmark-item:hover {
  background: #edf1f5;
}

/* ===== Button States ===== */
.tc-button-block.state-hover-preview {
  filter: brightness(0.9);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.tc-button-block.state-disabled-preview {
  opacity: 0.45;
  pointer-events: none;
}

/* ===== Tab Buttons ===== */
.tc-tab-btn.active {
  color: var(--tc-blue);
  border-bottom-color: var(--tc-blue);
}

/* ===== Toast Notification ===== */
.tc-toast {
  position: fixed;
  z-index: 140;
  right: 18px;
  bottom: 18px;
  background: #2d3035;
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: var(--tc-shadow-lg);
  font-size: 13px;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
}

.tc-toast.show {
  opacity: 1;
  transform: none;
}

/* ===== Transitions ===== */
.tc-paper {
  transition: width var(--tc-transition-slow), padding var(--tc-transition-slow), box-shadow var(--tc-transition-slow);
}

.tc-workspace {
  transition: grid-template-columns var(--tc-transition-normal);
}

.tc-device-frame {
  transition: width var(--tc-transition-slow);
}

/* ===== Pseudo-elements ===== */

/* Checkmark in menu items */
.tc-toolbar-popup-item.checked .mi-icon::before {
  content: '✓';
  width: 14px;
  color: #333;
}

/* Step numbers */
.tc-step::before {
  counter-increment: step;
  content: counter(step);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--tc-blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: bold;
}

/* Formatting marks (pilcrow) */
.show-marks p::after,
.show-marks h1::after,
.show-marks h2::after,
.show-marks h3::after,
.show-marks blockquote::after,
.show-marks li::after {
  content: " ¶";
  color: #7c8ba0;
  font-family: Arial;
  font-weight: 400;
  font-size: 0.78em;
  opacity: 0.75;
}

/* Page break label */
.tc-page-break::after {
  content: "Разрыв страницы";
  background: var(--tc-chrome);
  border: 1px solid var(--tc-line);
  border-radius: 10px;
  padding: 2px 8px;
  position: absolute;
  top: -11px;
}

/* Image focal point indicator */
.tc-image-focal-preview::after {
  content: '+';
  position: absolute;
  left: var(--fx, 50%);
  top: var(--fy, 50%);
  transform: translate(-50%, -50%);
  color: var(--tc-blue-active);
  font-size: 24px;
  font-weight: 700;
}

/* Article cover watermark */
.public-article-viewpoint .cover-art::after {
  content: "TRUE CREATOR";
  position: absolute;
  left: 5%;
  bottom: 9%;
  font-size: clamp(18px, 3cqw, 46px);
  font-weight: 900;
  color: white;
  letter-spacing: -0.04em;
}

/* ===== Body State Classes ===== */

/* Focus Mode */
body.focus-mode .tc-head,
body.focus-mode .tc-toolbar,
body.focus-mode .tc-ruler,
body.focus-mode .tc-left-panel,
body.focus-mode .tc-inspector {
  display: none !important;
}

body.focus-mode .tc-app-grid {
  grid-template-rows: 0 0 0 1fr 0;
}

body.focus-mode .tc-workspace,
body.focus-mode .tc-workspace.inspector-open,
body.focus-mode .tc-workspace.left-closed {
  grid-template-columns: 1fr;
}

body.focus-mode .tc-canvas-wrap {
  padding-top: 38px;
}

/* Focus Exit Button */
.focus-exit {
  display: none;
  position: fixed;
  right: 18px;
  top: 14px;
  z-index: 180;
  border: 1px solid #d8dde4;
  background: var(--tc-chrome);
  border-radius: 8px;
  padding: 7px 10px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.13);
}

body.focus-mode .focus-exit {
  display: block;
}

/* Design Mode */
body.mode-design .tc-component,
body.mode-design .tc-layout,
body.mode-design .tc-table-wrap {
  border-color: #cbd9ec;
}

body.mode-design .component-tag {
  display: block !important;
}

/* Edit Mode */
body.mode-edit .component-tag {
  display: none !important;
}

body.mode-edit .tc-component:not(.selected),
body.mode-edit .tc-layout:not(.selected),
body.mode-edit .tc-table-wrap:not(.selected) {
  outline: none;
}

/* Preview Mode */
body.mode-preview .tc-component,
body.mode-preview .tc-layout {
  border-color: transparent;
}

body.mode-preview .component-tag,
body.mode-preview .contextual-toolbar-2 {
  display: none !important;
}

body.mode-preview .tc-toolbar,
body.mode-preview .tc-ruler {
  opacity: 0.72;
}

/* Preview Lab Active */
body.preview-lab-active .tc-toolbar {
  justify-content: center;
  background: #eef2f7;
  margin-left: 14px;
  margin-right: 14px;
}

body.preview-lab-active .tc-toolbar > :not(#previewDeviceBar) {
  display: none !important;
}

body.preview-lab-active .tc-ruler {
  display: none !important;
}

body.preview-lab-active .tc-app-grid {
  grid-template-rows: 74px 42px 0 1fr;
}

body.preview-lab-active .tc-workspace {
  display: block !important;
  position: relative;
}

body.preview-lab-active #left-panel,
body.preview-lab-active #canvas-wrap,
body.preview-lab-active #inspector {
  display: none !important;
}

body.preview-lab-active .tc-preview-lab {
  display: block !important;
}

/* ===== Hover States for Interactive Elements ===== */
a:hover {
  opacity: 0.85;
}

button:hover {
  cursor: pointer;
}

input[type="range"]:hover {
  cursor: pointer;
}

[contenteditable="true"]:focus {
  outline: none;
}

/* ===== Selection Styles =====
::selection {
  background: rgba(26, 115, 232, 0.2);
}

/* ===== Drag States ===== */
[draggable="true"] {
  cursor: grab;
}

[draggable="true"]:dragging {
  opacity: 0.5;
}

/* ===== Loading States ===== */
.tc-loading {
  opacity: 0.6;
  pointer-events: none;
}

/* ===== Error States ===== */
.tc-error {
  color: var(--tc-danger);
  border-color: var(--tc-danger);
}

/* ===== Success States ===== */
.tc-success {
  color: var(--tc-success);
}

/* ===== Warning States ===== */
.tc-warning {
  color: var(--tc-warning);
}

/* ===== Disabled States ===== */
.tc-disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

/* ===== Focus Visible (Accessibility) ===== */
*:focus-visible {
  outline: 2px solid var(--tc-blue);
  outline-offset: 2px;
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/**
 * editor-components.css — Стили интерактивных компонентов
 * 
 * Содержит:
 * - Button
 * - Accordion
 * - Tabs
 * - Carousel
 * - Before/After
 * - Chart
 * - Stats
 * - Steps
 * - Timeline
 * - Comparison
 * - Pricing
 * - Download
 * - Gallery
 * - FAQ
 * - Cards grid
 */

/* ===== Accordion ===== */
.tc-accordion {
  margin: 22px 0;
}

.tc-accordion details {
  border: 1px solid #d9dee5;
  border-radius: 8px;
  margin: 8px 0;
  padding: 10px 12px;
  transition: background var(--tc-transition-fast);
}

.tc-accordion details:hover {
  background: #f8f9fa;
}

.tc-accordion details[open] {
  background: #fafbfc;
}

.tc-accordion summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tc-accordion summary::-webkit-details-marker {
  display: none;
}

.tc-accordion summary::before {
  content: '▶';
  display: inline-block;
  transition: transform 0.2s ease;
  font-size: 12px;
  color: var(--tc-muted);
}

.tc-accordion details[open] summary::before {
  transform: rotate(90deg);
}

.tc-accordion .accordion-content {
  padding: 12px 0 4px;
  color: var(--tc-text);
}

/* ===== Tabs ===== */
.tc-tabs {
  margin: 22px 0;
}

.tc-tabs-nav {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #d8dde4;
  margin-bottom: 0;
}

.tc-tab-btn {
  border: 0;
  background: transparent;
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  color: var(--tc-text);
  font-size: 14px;
  transition: color var(--tc-transition-fast), border-color var(--tc-transition-fast);
}

.tc-tab-btn:hover {
  color: var(--tc-blue);
}

.tc-tab-btn.active {
  color: var(--tc-blue);
  border-bottom-color: var(--tc-blue);
  font-weight: 500;
}

.tc-tab-panel {
  padding: 14px 2px;
  min-height: 100px;
}

.tc-tab-panel.hidden {
  display: none;
}

/* ===== Carousel ===== */
.tc-carousel {
  overflow: hidden;
  border: 1px solid #d9dee5;
  border-radius: 10px;
  margin: 22px 0;
}

.tc-carousel-viewport {
  position: relative;
  min-height: 180px;
  background: #f8fafc;
}

.tc-carousel-slide {
  display: none;
  padding: 28px;
  background: #f8fafc;
  transition: opacity 0.3s ease;
}

.tc-carousel-slide.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.tc-carousel-controls {
  display: flex;
  justify-content: space-between;
  padding: 8px;
  border-top: 1px solid var(--tc-line);
  background: #fafbfc;
}

.tc-carousel-controls button {
  border: 1px solid #d5dae1;
  background: var(--tc-chrome);
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  color: var(--tc-text);
  transition: background var(--tc-transition-fast);
}

.tc-carousel-controls button:hover {
  background: #f1f3f4;
}

.tc-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 12px;
}

.tc-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d0d5db;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background var(--tc-transition-fast);
}

.tc-carousel-dot.active {
  background: var(--tc-blue);
}

/* ===== Before/After ===== */
.tc-before-after {
  position: relative;
  height: 260px;
  overflow: hidden;
  border-radius: 10px;
  background: #dfe6ee;
  margin: 22px 0;
}

.tc-before-after .before,
.tc-before-after .after {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: bold;
  transition: clip-path 0.1s ease;
}

.tc-before-after .before {
  background: #cbd8e8;
  color: var(--tc-text);
}

.tc-before-after .after {
  background: #8eb0db;
  color: #fff;
  clip-path: inset(0 50% 0 0);
}

.tc-before-after input[type="range"] {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 14px;
  width: 84%;
  z-index: 3;
  cursor: pointer;
}

/* ===== Chart ===== */
.tc-chart-block {
  margin: 22px 0;
  padding: 20px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid var(--tc-line);
}

.tc-chart-placeholder {
  height: 200px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  padding: 20px;
}

.tc-chart-bar {
  width: 40px;
  background: var(--tc-blue);
  border-radius: 4px 4px 0 0;
  transition: height 0.3s ease, background var(--tc-transition-fast);
}

.tc-chart-bar:hover {
  filter: brightness(0.9);
}

/* ===== Stats ===== */
.tc-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 22px 0;
}

.tc-stat {
  padding: 18px;
  border-radius: 10px;
  background: #f7f9fc;
  text-align: center;
  transition: box-shadow var(--tc-transition-fast);
}

.tc-stat:hover {
  box-shadow: var(--tc-shadow-sm);
}

.tc-stat strong {
  display: block;
  font-size: 28px;
  color: var(--tc-blue);
  margin-bottom: 4px;
}

.tc-stat span {
  font-size: 13px;
  color: var(--tc-muted);
}

/* ===== Steps ===== */
.tc-steps {
  counter-reset: step;
  margin: 22px 0;
}

.tc-step {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  margin: 14px 0;
  align-items: start;
}

.tc-step::before {
  counter-increment: step;
  content: counter(step);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--tc-blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: bold;
  font-size: 14px;
}

.tc-step-content h4 {
  margin: 0 0 4px;
  font-size: 16px;
}

.tc-step-content p {
  margin: 0;
  color: var(--tc-muted);
  font-size: 14px;
}

/* ===== Timeline ===== */
.tc-timeline {
  border-left: 2px solid #8ab4f8;
  padding-left: 18px;
  margin: 22px 0;
}

.tc-timeline-item {
  position: relative;
  margin: 14px 0;
  padding-left: 16px;
}

.tc-timeline-item::before {
  content: '';
  position: absolute;
  left: -23px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--tc-blue);
  border: 2px solid var(--tc-chrome);
}

.tc-timeline-date {
  font-size: 12px;
  color: var(--tc-muted);
  margin-bottom: 2px;
}

.tc-timeline-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px;
}

.tc-timeline-desc {
  font-size: 14px;
  color: var(--tc-text);
  margin: 0;
}

/* ===== Comparison ===== */
.tc-comparison {
  margin: 22px 0;
}

.tc-comparison-grid {
  display: grid;
  grid-template-columns: 1fr 34px 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.tc-comparison-panel {
  border: 1px solid #deded9;
  border-radius: 11px;
  padding: 15px;
  background: #f8f8f5;
  min-height: 110px;
}

.tc-comparison-vs {
  text-align: center;
  font-weight: 700;
  color: var(--tc-muted);
  font-size: 14px;
}

/* ===== Pricing ===== */
.tc-pricing {
  margin: 22px 0;
}

.tc-pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.tc-pricing-card {
  border: 1px solid #d7dde5;
  border-radius: 12px;
  padding: 18px;
  background: var(--tc-chrome);
  text-align: center;
  transition: box-shadow var(--tc-transition-fast), transform var(--tc-transition-fast);
}

.tc-pricing-card:hover {
  box-shadow: var(--tc-shadow-md);
  transform: translateY(-2px);
}

.tc-pricing-card.featured {
  border-color: var(--tc-blue);
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.15);
}

.tc-pricing-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.tc-pricing-price {
  font-size: 32px;
  font-weight: 700;
  color: var(--tc-blue);
  margin-bottom: 8px;
}

.tc-pricing-desc {
  font-size: 14px;
  color: var(--tc-muted);
  margin-bottom: 16px;
}

.tc-pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  text-align: left;
}

.tc-pricing-features li {
  padding: 6px 0;
  font-size: 14px;
  border-bottom: 1px solid #f0f0f0;
}

.tc-pricing-features li::before {
  content: '✓';
  color: var(--tc-success);
  margin-right: 8px;
  font-weight: 700;
}

/* ===== Download ===== */
.tc-download {
  margin: 22px 0;
}

.tc-download-card {
  border: 1px solid #d7dde5;
  border-radius: 10px;
  padding: 14px;
  background: var(--tc-chrome);
  display: flex;
  align-items: center;
  gap: 12px;
}

.tc-download-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #f0f6ff;
  display: grid;
  place-items: center;
  color: var(--tc-blue);
  font-size: 20px;
  flex-shrink: 0;
}

.tc-download-info {
  flex: 1;
}

.tc-download-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
}

.tc-download-desc {
  font-size: 12px;
  color: var(--tc-muted);
  margin-bottom: 8px;
}

.tc-download-meta {
  font-size: 11px;
  color: var(--tc-muted-light);
}

/* ===== Gallery ===== */
.tc-gallery {
  margin: 22px 0;
}

.tc-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.tc-gallery-grid img,
.tc-image {
  width: 100%;
  border-radius: 8px;
  max-height: 420px;
  object-fit: cover;
  transition: transform var(--tc-transition-fast);
}

.tc-gallery-grid img:hover,
.tc-image:hover {
  transform: scale(1.02);
}

/* ===== FAQ ===== */
.tc-faq {
  margin: 22px 0;
}

.tc-faq h3 {
  font-size: 20px;
  margin-bottom: 12px;
}

/* ===== Cards Grid ===== */
.tc-cards {
  margin: 22px 0;
}

.tc-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.tc-card {
  border: 1px solid #d7dde5;
  border-radius: 12px;
  padding: 18px;
  background: var(--tc-chrome);
  transition: box-shadow var(--tc-transition-fast);
}

.tc-card:hover {
  box-shadow: var(--tc-shadow-sm);
}

.tc-card h3 {
  font-size: 16px;
  margin: 0 0 8px;
}

.tc-card p {
  font-size: 14px;
  color: var(--tc-muted);
  margin: 0 0 12px;
}

/* ===== Journal Modules ===== */
.tc-journal-toolkit {
  margin: 34px 0;
  padding: 22px;
  border: 1px solid var(--tc-line);
  border-radius: 16px;
  background: #f0f0ec;
}

.tc-journal-toolkit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.tc-journal-toolkit-item {
  background: var(--tc-chrome);
  border: 1px solid #deded8;
  border-radius: 11px;
  padding: 12px;
  min-height: 95px;
}

.tc-journal-toolkit-item span {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #85888d;
}

.tc-journal-toolkit-item strong {
  display: block;
  font-size: 13px;
  margin-top: 10px;
}

/* ===== Calculator ===== */
.tc-calc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 14px;
}

.tc-calc-grid label {
  border: 1px solid #e0e0db;
  border-radius: 10px;
  background: #f8f8f5;
  padding: 11px;
}

.tc-calc-grid label span {
  display: block;
  font-size: 10px;
  color: #73767b;
  margin-bottom: 7px;
}

.tc-calc-grid input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #cbccc7;
  background: transparent;
  font-size: 17px;
  font-weight: 750;
  padding: 4px 0;
}

.tc-calc-result {
  grid-column: 1 / -1;
  background: #17191c;
  color: #fff;
  border-radius: 11px;
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr auto;
}

/* ===== Case Compare ===== */
.tc-case-compare {
  display: grid;
  grid-template-columns: 1fr 34px 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.tc-case-compare > div {
  border: 1px solid #deded9;
  border-radius: 11px;
  padding: 15px;
  background: #f8f8f5;
  min-height: 110px;
}

/* ===== Experiment Metrics ===== */
.tc-experiment-metrics {
  display: grid;
  grid-template-columns: 2fr 0.7fr 1.2fr;
  border: 1px solid #dfdfda;
  border-radius: 11px;
  overflow: hidden;
  margin-top: 14px;
}

.tc-experiment-metrics > div {
  padding: 14px;
  background: #f8f8f5;
  border-right: 1px solid #dfdfda;
}

/* ===== Template Preview ===== */
.tc-template-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid #e2e2dd;
  border-radius: 12px;
  overflow: hidden;
  background: #f7f7f4;
  margin-top: 16px;
}

.tc-template-preview > div {
  padding: 13px;
  min-height: 100px;
  border-right: 1px solid #e2e2dd;
  border-bottom: 1px solid #e2e2dd;
}

.tc-template-preview > div:nth-child(2n) {
  border-right: 0;
}

/* ===== Responsive Component Grids ===== */
@media (max-width: 900px) {
  .tc-stats,
  .tc-pricing-grid,
  .tc-cards-grid,
  .tc-journal-toolkit-grid,
  .tc-calc-grid {
    grid-template-columns: 1fr;
  }
  
  .tc-gallery-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .tc-comparison-grid,
  .tc-case-compare {
    grid-template-columns: 1fr;
  }
  
  .tc-experiment-metrics {
    grid-template-columns: 1fr;
  }
  
  .tc-template-preview {
    grid-template-columns: 1fr;
  }
}
/**
 * editor-dialogs.css — Стили диалогов
 * 
 * Содержит:
 * - Dialog overlay
 * - Link dialog
 * - Table dialog
 * - Video dialog
 * - Find/Replace dialog
 * - Version history dialog
 * - Document settings dialog
 * - Template dialog
 * - Stats dialog
 * - Shortcuts dialog
 * - Confirm/Alert dialogs
 * - Command search overlay
 * - Theme manager
 * - Reusable manager
 * - Document variables
 * - Linked object dialog
 * - Document check dialog
 * - Block add menu
 */

/* ===== Dialog Overlay ===== */
.tc-dialog-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(32, 33, 36, 0.22);
  z-index: 100;
  align-items: flex-start;
  justify-content: center;
  padding-top: 78px;
}

.tc-dialog-overlay.show {
  display: flex;
}

/* ===== Dialog Base ===== */
.tc-dialog {
  width: min(640px, 92vw);
  max-height: 82vh;
  overflow: auto;
  background: var(--tc-chrome);
  border-radius: 12px;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.3);
  border: 1px solid #d5dae1;
}

.tc-dialog.wide {
  width: min(900px, 94vw);
}

.tc-dialog-head {
  display: flex;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid #e5e8eb;
}

.tc-dialog-head strong {
  font-size: 17px;
}

.tc-dialog-close {
  margin-left: auto;
  border: 0;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  color: var(--tc-muted);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.tc-dialog-close:hover {
  background: #f1f3f4;
}

.tc-dialog-body {
  padding: 18px;
}

.tc-dialog-foot {
  padding: 12px 18px;
  border-top: 1px solid #e5e8eb;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ===== Dialog Fields ===== */
.tc-dialog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.tc-dialog-field {
  margin-bottom: 12px;
}

.tc-dialog-field label {
  display: block;
  font-size: 12px;
  color: var(--tc-muted);
  margin-bottom: 5px;
}

.tc-dialog-field input,
.tc-dialog-field select,
.tc-dialog-field textarea {
  width: 100%;
  padding: 8px 9px;
  border: 1px solid #ccd3dc;
  border-radius: 7px;
  background: var(--tc-chrome);
  font-size: 14px;
}

.tc-dialog-field input:focus,
.tc-dialog-field select:focus,
.tc-dialog-field textarea:focus {
  outline: 2px solid #c6dafc;
  border-color: #6f9fe8;
}

.tc-dialog-field textarea {
  resize: vertical;
  min-height: 80px;
}

/* ===== Dialog Check ===== */
.tc-dialog-check {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

/* ===== Dialog Buttons ===== */
.tc-dialog-btn {
  border: 1px solid #d5dae2;
  background: var(--tc-chrome);
  border-radius: 7px;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 14px;
  color: var(--tc-text);
  transition: background var(--tc-transition-fast);
}

.tc-dialog-btn:hover {
  background: #f3f5f7;
}

.tc-dialog-btn.primary {
  background: var(--tc-blue);
  color: var(--tc-chrome);
  border-color: var(--tc-blue);
}

.tc-dialog-btn.primary:hover {
  filter: brightness(0.95);
}

/* ===== List Card ===== */
.tc-list-card {
  border: 1px solid #d8dde4;
  border-radius: 9px;
  padding: 12px;
  cursor: pointer;
  transition: background var(--tc-transition-fast);
}

.tc-list-card:hover {
  background: #f7f9fb;
}

.tc-list-card b {
  font-size: 14px;
  display: block;
  margin-bottom: 4px;
}

.tc-list-card small {
  color: var(--tc-muted);
  font-size: 12px;
}

/* ===== Style Preview ===== */
.tc-style-preview {
  padding: 13px;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-top: 6px;
  background: var(--tc-chrome);
}

/* ===== Template Grid ===== */
.tc-template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.tc-template-card {
  border: 1px solid #d8dde4;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: var(--tc-chrome);
  transition: box-shadow var(--tc-transition-fast);
}

.tc-template-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.13);
}

.tc-template-thumb {
  height: 110px;
  background: #f5f7fa;
  padding: 14px;
  font-size: 11px;
}

.tc-template-name {
  padding: 10px;
  font-weight: 600;
  font-size: 13px;
}

/* ===== Command Search Overlay ===== */
.tc-command-search {
  display: none;
  position: fixed;
  z-index: 120;
  top: 74px;
  left: 50%;
  transform: translateX(-50%);
  width: min(650px, 92vw);
  background: var(--tc-chrome);
  border-radius: 12px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.26);
  border: 1px solid #d7dce2;
  padding: 10px;
}

.tc-command-search.show {
  display: block;
}

.tc-command-search input {
  width: 100%;
  font-size: 17px;
  padding: 12px;
  border: 0;
  outline: none;
}

.tc-command-result {
  padding: 10px;
  border-radius: 7px;
  cursor: pointer;
}

.tc-command-result:hover,
.tc-command-result.active {
  background: #f1f3f4;
}

.tc-command-result b {
  display: block;
  font-size: 14px;
}

.tc-command-result small {
  color: #777;
  font-size: 12px;
}

/* ===== Toast ===== */
.tc-toast {
  position: fixed;
  z-index: 140;
  right: 18px;
  bottom: 18px;
  background: #2d3035;
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: var(--tc-shadow-lg);
  font-size: 13px;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
}

.tc-toast.show {
  opacity: 1;
  transform: none;
}

/* ===== Context Menu ===== */
.tc-context-menu {
  position: fixed;
  z-index: 95;
  background: var(--tc-chrome);
  border: 1px solid #dadce0;
  border-radius: 8px;
  box-shadow: var(--tc-shadow-lg);
  padding: 6px 0;
  min-width: 220px;
}

/* ===== Confirm Dialog ===== */
.tc-confirm-dialog .tc-dialog {
  width: min(400px, 90vw);
}

.tc-confirm-message {
  font-size: 15px;
  line-height: 1.5;
  color: var(--tc-text);
}

/* ===== Alert Dialog ===== */
.tc-alert-dialog .tc-dialog {
  width: min(450px, 90vw);
}

.tc-alert-message {
  font-size: 15px;
  line-height: 1.5;
  color: var(--tc-text);
}

/* ===== Stats Dialog ===== */
.tc-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.tc-stats-card {
  padding: 18px;
  border: 1px solid #d8dde4;
  border-radius: 9px;
  text-align: center;
  background: #fafbfc;
}

.tc-stats-card b {
  display: block;
  font-size: 24px;
  color: var(--tc-blue);
  margin-bottom: 4px;
}

.tc-stats-card small {
  color: var(--tc-muted);
  font-size: 12px;
}

/* ===== Shortcuts Table ===== */
.tc-shortcuts-table {
  width: 100%;
  border-collapse: collapse;
}

.tc-shortcuts-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #f0f0f0;
}

.tc-shortcuts-table td:last-child code {
  background: #f1f3f4;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: monospace;
}

/* ===== Version History ===== */
.tc-version-item {
  padding: 12px;
  border: 1px solid #d8dde4;
  border-radius: 9px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background var(--tc-transition-fast);
}

.tc-version-item:hover {
  background: #f7f9fb;
}

.tc-version-label {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
}

.tc-version-date {
  font-size: 12px;
  color: var(--tc-muted);
}

/* ===== Document Settings ===== */
.tc-doc-settings-section {
  margin-bottom: 20px;
}

.tc-doc-settings-section h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--tc-text);
}

/* ===== Theme Manager ===== */
.tc-theme-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid #d9dee5;
  border-radius: 9px;
  margin: 4px;
  cursor: pointer;
  transition: background var(--tc-transition-fast);
}

.tc-theme-chip:hover {
  background: #f6f8fb;
}

.tc-theme-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

/* ===== Reusable Manager ===== */
.tc-reusable-item {
  padding: 12px;
  border: 1px solid #d8dde4;
  border-radius: 9px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background var(--tc-transition-fast);
}

.tc-reusable-item:hover {
  background: #f7f9fb;
}

/* ===== Document Variables ===== */
.tc-var-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.tc-var-row .tc-dialog-field {
  margin-bottom: 0;
}

/* ===== Linked Object ===== */
.tc-linked-object-type {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tc-muted);
  display: block;
  margin-bottom: 4px;
}

/* ===== Document Check ===== */
.tc-check-ok {
  color: #188038;
}

.tc-check-warn {
  color: #b06000;
}

.tc-check-error {
  color: #b3261e;
}

.tc-check-item {
  padding: 10px;
  border: 1px solid #d8dde4;
  border-radius: 7px;
  margin-bottom: 6px;
  font-size: 14px;
}

/* ===== Block Add Menu ===== */
.tc-block-add-menu {
  position: fixed;
  z-index: 110;
  background: var(--tc-chrome);
  border: 1px solid #dadce0;
  border-radius: 12px;
  box-shadow: var(--tc-shadow-xl);
  padding: 8px;
  width: min(320px, 90vw);
  max-height: 70vh;
  overflow-y: auto;
}

.tc-block-add-category {
  margin-bottom: 12px;
}

.tc-block-add-category-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tc-muted);
  padding: 4px 8px;
  font-weight: 700;
}

.tc-block-add-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: background var(--tc-transition-fast);
}

.tc-block-add-item:hover {
  background: #f1f3f4;
}

.tc-block-add-item-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #f1f3f4;
  display: grid;
  place-items: center;
  font-size: 14px;
  color: var(--tc-muted);
  flex-shrink: 0;
}

.tc-block-add-item-label {
  font-weight: 500;
}

.tc-block-add-item-desc {
  font-size: 12px;
  color: var(--tc-muted);
}

/* ===== Responsive Dialogs ===== */
@media (max-width: 650px) {
  .tc-dialog-grid {
    grid-template-columns: 1fr;
  }
  
  .tc-template-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .tc-stats-grid {
    grid-template-columns: 1fr;
  }
  
  .tc-var-row {
    grid-template-columns: 1fr;
  }
}

/* ===== Source Badge ===== */
.tc-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #cbd6e3;
  background: #f6f9fd;
  border-radius: 8px;
  padding: 8px 10px;
  color: #335d8c;
  font-size: 13px;
}

/* ===== Related Card ===== */
.tc-related-card {
  border: 1px solid #d7dde5;
  border-radius: 10px;
  padding: 14px;
  background: var(--tc-chrome);
  margin-bottom: 12px;
}

.tc-related-card b {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.tc-related-card small {
  color: var(--tc-muted);
  font-size: 12px;
}

/* ===== Journal Toolkit ===== */
.tc-journal-module-type {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #85888d;
}

/* ===== Bookmark ===== */
.tc-bookmark {
  display: inline-block;
  border-left: 4px solid #fbbc04;
  padding-left: 9px;
  color: #795b00;
  margin: 10px 0;
}

/* ===== Smart Table Badge ===== */
.tc-smart-table-badge {
  display: inline-block;
  font-size: 10px;
  padding: 2px 6px;
  background: #edf3fc;
  color: #315d92;
  border-radius: 8px;
  margin-bottom: 5px;
}

/* ===== Image Placeholder ===== */
.tc-image-placeholder {
  height: 180px;
  border-radius: 8px;
  background: linear-gradient(135deg, #dce7f8, #eef3fa);
  display: grid;
  place-items: center;
  color: var(--tc-muted);
  font-size: 14px;
}

/* ===== Range Line ===== */
.tc-range-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 10px;
  align-items: center;
}

.tc-range-line output {
  height: 28px;
  border: 1px solid #d8dde3;
  border-radius: 7px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #505861;
}

/* ===== Button Rows ===== */
.tc-button-rows {
  display: grid;
  gap: 8px;
}

.tc-button-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 108px 30px;
  gap: 6px;
  align-items: center;
}

.tc-button-row input,
.tc-button-row select {
  width: 100%;
  height: 34px;
  border: 1px solid #d8dde3;
  border-radius: 7px;
  padding: 0 8px;
  background: var(--tc-chrome);
}

/* ===== Inspector Actions ===== */
.tc-inspector-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ===== Spacing Help ===== */
.tc-spacing-help {
  font-size: 11px;
  color: #777;
  margin-top: 4px;
}
/* === Prototype CSS — extracted from prototype/index.html === */
/* Точная копия стилей из прототипа для React EditorShell */

:root {
  --bg: #f1f3f4;
  --chrome: #fff;
  --toolbar: #edf2f7;
  --paper: #fff;
  --line: #dadce0;
  --text: #202124;
  --muted: #5f6368;
  --blue: #1a73e8;
  --blue2: #e8f0fe;
  --hover: #f1f3f4;
  --danger: #c5221f;
  --shadow: 0 8px 28px rgba(60,64,67,.24);
  --doc-width: 816px;
  --doc-pad-x: 86px;
  --doc-pad-y: 72px;
  --doc-font: Arial, Helvetica, sans-serif;
  --doc-size: 15px;
  --doc-line: 1.55;
  font-family: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

.app {
  height: 100vh;
  display: grid;
  grid-template-rows: 74px 42px 28px 1fr;
  background: var(--bg);
}

/* === Header === */
.head {
  background: var(--chrome);
  padding: 8px 16px 0;
  z-index: 20;
}

.titleRow {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 36px;
  height: 36px;
  border-radius: 7px;
  background: #4285f4;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  box-shadow: inset 0 -8px 0 #2f6fda;
}

.docTitle {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 5px;
  padding: 3px 6px;
  font-size: 20px;
  min-width: 300px;
  max-width: 60vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.docTitle:hover, .docTitle:focus {
  border-color: #dadce0;
  background: #fff;
  outline: none;
}

.saveState {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34a853;
}

/* === Work Modes === */
.workModes {
  display: flex;
  gap: 2px;
  background: #f1f3f4;
  padding: 3px;
  border-radius: 9px;
}

.modeBtn {
  border: 0;
  background: transparent;
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 12px;
  color: #5f6368;
  cursor: pointer;
}

.modeBtn:hover { background: #e4e8ed; }
.modeBtn.active {
  background: #fff;
  color: #174ea6;
  box-shadow: 0 1px 4px #0002;
  font-weight: 600;
}

/* === Menu Bar === */
.menubar {
  height: 30px;
  display: flex;
  align-items: end;
  gap: 2px;
  margin-left: 46px;
}

.menuBtn {
  border: 0;
  background: transparent;
  padding: 5px 10px;
  border-radius: 5px 5px 0 0;
  font-size: 14px;
  cursor: pointer;
}

.menuBtn:hover, .menuBtn.active { background: #e8eaed; }

/* === Menu Dropdown === */
.menu {
  display: none;
  position: absolute;
  z-index: 100;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 12px;
  box-shadow: 0 10px 34px rgba(32,36,40,.20);
  min-width: 310px;
  padding: 7px;
  max-height: 74vh;
  overflow: auto;
  animation: menuIn .11s ease-out;
}

@keyframes menuIn {
  from { opacity: 0; transform: translateY(-4px) scale(.985); }
  to { opacity: 1; transform: none; }
}

.menu.show { display: block; }

.mi {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  font-size: 14px;
  cursor: pointer;
  min-height: 38px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
}

.mi:hover { background: #edf1f5; }

.miIcon {
  width: 22px;
  flex: 0 0 22px;
  text-align: center;
  color: #4d5156;
  font-size: 16px;
}

.miLabel {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shortcut {
  padding-left: 20px;
  color: #8a8f95;
  margin-left: auto;
}

.arrow {
  margin-left: auto;
  color: #70757a;
  font-size: 18px;
}

.divider {
  height: 1px;
  background: #e3e7eb;
  margin: 6px 8px;
  border: 0;
  padding: 0;
  min-height: auto;
  flex: none;
}

.submenu {
  position: absolute;
  z-index: 110;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 12px;
  box-shadow: 0 10px 34px rgba(32,36,40,.20);
  min-width: 260px;
  padding: 7px;
  max-height: 72vh;
  overflow: auto;
  display: none;
}

/* === Toolbar === */
.toolbar {
  background: var(--toolbar);
  margin: 0 14px;
  border-radius: 20px;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 9px;
  overflow-x: auto;
  overflow-y: visible;
  white-space: nowrap;
  z-index: 18;
}

.tb {
  height: 30px;
  min-width: 28px;
  border: 0;
  background: transparent;
  border-radius: 7px;
  padding: 0 7px;
  cursor: pointer;
  color: #303134;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.tb:hover { background: #dfe6ee; }
.tb.active { background: #d7e6fb; color: #174ea6; }
.tb:disabled { opacity: .35; cursor: default; background: transparent; }

.tb.select {
  background: #fff;
  border: 1px solid #d8dee6;
  justify-content: space-between;
  min-width: 96px;
}

.tb.fontSelect { min-width: 118px; }
.tb.sizeSelect { min-width: 58px; }
.tb.icon { font-size: 17px; }

.sep {
  width: 1px;
  height: 22px;
  background: #cbd2da;
  margin: 0 4px;
  flex: none;
}

/* === Ruler === */
.ruler {
  position: relative;
  display: block;
  overflow: hidden;
  background: #f9fafb;
  height: 30px;
  border-bottom: 1px solid #dfe3e7;
  z-index: 15;
}

.rulerTrack {
  position: absolute;
  top: 0;
  height: 30px;
  overflow: visible;
  border-left: 1px solid #cfd5dd;
  border-right: 1px solid #cfd5dd;
  background: #fff;
}

.rulerMarginShade {
  position: absolute;
  top: 0;
  bottom: 0;
  background: #e9edf2;
  z-index: 0;
}

.rulerMarginShade.left { left: 0; }
.rulerMarginShade.right { right: 0; }

.rulerTicks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* === Workspace === */
.workspace {
  position: relative;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 0;
  min-height: 0;
}

.workspace.inspectorOpen {
  grid-template-columns: 260px minmax(0, 1fr) 0 !important;
}

.workspace.leftClosed {
  grid-template-columns: 0 minmax(0, 1fr) 0;
}

/* === Left Panel === */
.left {
  border-right: 1px solid var(--line);
  background: #f8f9fa;
  overflow: auto;
  padding: 12px 9px;
  min-width: 0;
}

.leftHead {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 0 3px;
}

.leftHead strong { font-size: 12px; }

.leftClose {
  margin-left: auto;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #666;
}

.tabs {
  display: inline-flex;
  width: auto;
  max-width: 100%;
  gap: 2px;
  padding: 2px;
  border-radius: 8px;
  margin: 0 0 12px;
  background: #e9eef5;
}

.tabs button {
  flex: none;
  padding: 5px 8px;
  min-height: 27px;
  border: 0;
  background: transparent;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.tabs button.on {
  background: #fff;
  box-shadow: 0 1px 3px #0001;
}

.outlineItem, .blockItem {
  min-height: 27px;
  padding-top: 5px;
  padding-bottom: 5px;
  font-size: 12px;
  border-left: 2px solid transparent;
  color: #4d5156;
  cursor: pointer;
  border-radius: 0 6px 6px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.outlineItem:hover, .blockItem:hover { background: #edf1f5; }
.outlineItem.active, .blockItem.active {
  color: var(--blue);
  border-color: var(--blue);
  background: #eaf2ff;
}

.depth1 { padding-left: 18px; }
.depth2 { padding-left: 30px; }
.depth3 { padding-left: 42px; }

/* === Canvas === */
.canvasWrap {
  overflow: auto;
  padding: 16px 36px 100px 0;
  position: relative;
}

.deviceFrame {
  margin: 0;
  transition: width .2s;
  max-width: 100%;
  position: relative;
}

.deviceFrame.desktop { width: auto; }
.deviceFrame.tablet { width: 900px; max-width: 95%; }
.deviceFrame.mobile { width: 430px; max-width: 95%; }

.paper {
  width: min(var(--doc-width), 95%);
  min-height: 1056px;
  background: var(--paper);
  margin: 0 auto;
  border: 1px solid #dadce0;
  box-shadow: 0 1px 3px #0002;
  padding: var(--doc-pad-y) var(--doc-pad-x);
  font-family: var(--doc-font);
  font-size: var(--doc-size);
  line-height: var(--doc-line);
  outline: none;
}

/* Paper placeholder */
.paper[contenteditable="true"]:empty::before {
  content: 'Начните писать...';
  color: #999;
  font-style: italic;
  pointer-events: none;
}

.paper[contenteditable="true"] {
  cursor: text;
}

/* === Inspector === */
.inspector {
  position: absolute !important;
  right: 0;
  top: 0;
  bottom: 0;
  width: 320px;
  z-index: 45;
  display: none;
  box-shadow: -8px 0 24px rgba(32,33,36,.08);
  background: #fff;
}

.workspace.inspectorOpen .inspector { display: block; }

.inspectorHeader {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 4;
  padding: 13px 15px;
  margin: 0;
  border-bottom: 1px solid #e2e6ea;
  display: flex;
  align-items: center;
}

.inspectorHeader strong { font-size: 14px; }
.inspectorHeader button {
  margin-left: auto;
  border: 0;
  background: transparent;
  cursor: pointer;
}

/* === Status Bar === */
.statusbar {
  position: fixed;
  left: 275px;
  bottom: 6px;
  color: #7b8188;
  font-size: 11px;
  pointer-events: none;
}

.workspace.leftClosed ~ .statusbar { left: 16px; }

/* === Toast === */
.toast {
  position: fixed;
  z-index: 140;
  right: 18px;
  bottom: 18px;
  background: #2d3035;
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-size: 13px;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: .18s;
}

.toast.show {
  opacity: 1;
  transform: none;
}

/* === ProseMirror (TipTap) — MAX SPECIFICITY === */
/* Override TipTap 3.x built-in styles with maximum specificity */
body .app .ProseMirror {
  width: min(var(--doc-width), 95%) !important;
  min-height: 1056px !important;
  background: var(--paper) !important;
  margin: 0 !important;
  border: 1px solid #dadce0 !important;
  box-shadow: 0 1px 3px #0002 !important;
  padding: var(--doc-pad-y) var(--doc-pad-x) !important;
  font-family: var(--doc-font) !important;
  font-size: var(--doc-size) !important;
  line-height: var(--doc-line) !important;
  outline: none !important;
  color: #202124 !important;
  cursor: text !important;
  overflow-wrap: break-word !important;
  word-break: break-word !important;
}

body .app .ProseMirror:focus {
  outline: none !important;
}

body .app .ProseMirror > * {
  margin-bottom: 1em !important;
}
body .app .ProseMirror > *:last-child {
  margin-bottom: 0 !important;
}

body .app .ProseMirror h1 {
  font-size: 34px !important;
  line-height: 1.16 !important;
  margin: 0 0 22px !important;
  color: #17365d !important;
  font-weight: 700 !important;
}

body .app .ProseMirror h2 {
  font-size: 23px !important;
  line-height: 1.28 !important;
  margin: 28px 0 10px !important;
  color: #356daf !important;
  font-weight: 700 !important;
}

body .app .ProseMirror h3 {
  font-size: 19px !important;
  margin: 22px 0 8px !important;
  font-weight: 600 !important;
}

body .app .ProseMirror p {
  margin: 0 0 13px !important;
  font-size: 15px !important;
  line-height: 1.55 !important;
  color: #202124 !important;
}

body .app .ProseMirror blockquote {
  margin: 22px 0 !important;
  padding: 12px 18px !important;
  border-left: 4px solid #7ba7df !important;
  background: #f6f9fd !important;
  color: #3c4043 !important;
  font-style: italic !important;
}

body .app .ProseMirror a {
  color: #1967d2 !important;
  text-decoration: underline !important;
}

body .app .ProseMirror hr {
  border: 0 !important;
  border-top: 1px solid #cfd4da !important;
  margin: 28px 0 !important;
}

body .app .ProseMirror ul,
body .app .ProseMirror ol {
  margin: 0 0 14px !important;
  padding-left: 28px !important;
}

body .app .ProseMirror ul {
  list-style: disc !important;
}

body .app .ProseMirror ol {
  list-style: decimal !important;
}

body .app .ProseMirror li {
  margin-bottom: 4px !important;
}

body .app .ProseMirror img {
  max-width: 100% !important;
  border-radius: 8px !important;
}

body .app .ProseMirror pre {
  background: #f6f8fa !important;
  border-radius: 8px !important;
  padding: 16px !important;
  overflow-x: auto !important;
  font-family: 'Courier New', monospace !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
}

body .app .ProseMirror code {
  background: #f6f8fa !important;
  border-radius: 4px !important;
  padding: 2px 6px !important;
  font-family: 'Courier New', monospace !important;
  font-size: 14px !important;
}

body .app .ProseMirror .tableWrapper > table {
  border-collapse: collapse !important;
  width: 100% !important;
}

body .app .ProseMirror table {
  border-collapse: collapse !important;
  width: 100% !important;
}

body .app .ProseMirror td,
body .app .ProseMirror th {
  border: 1px solid #cfd5dc !important;
  padding: 9px 10px !important;
  min-width: 70px !important;
  vertical-align: top !important;
}

body .app .ProseMirror th {
  background: #f2f4f7 !important;
  font-weight: 700 !important;
}

body .app .ProseMirror td:focus,
body .app .ProseMirror th:focus {
  outline: 2px solid #1a73e8 !important;
  outline-offset: -2px !important;
}

/* Placeholder */
body .app .ProseMirror p.is-editor-empty:first-child::before {
  content: 'Начните писать...' !important;
  color: #999 !important;
  font-style: italic !important;
  pointer-events: none !important;
  float: left !important;
  height: 0 !important;
}

/* Selection */
body .app .ProseMirror .selection {
  outline: none !important;
}

body .app .ProseMirror .selection::after {
  background: rgba(26, 115, 232, 0.2) !important;
}

/* Code blocks */
body .app .ProseMirror pre {
  background: #f6f8fa !important;
  border: 1px solid #e1e5e9 !important;
}

body .app .ProseMirror pre code {
  background: none !important;
  padding: 0 !important;
  color: inherit !important;
}

/* === Overlay / Dialog === */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(32,33,36,.22);
  z-index: 100;
  align-items: flex-start;
  justify-content: center;
  padding-top: 78px;
}

.overlay.show { display: flex; }

.dialog {
  width: min(640px, 92vw);
  max-height: 82vh;
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 18px 55px rgba(0,0,0,.3);
  border: 1px solid #d5dae1;
}

.dialog.wide { width: min(900px, 94vw); }

.dialogHead {
  display: flex;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid #e5e8eb;
}

.dialogHead strong { font-size: 17px; }
.dialogHead button {
  margin-left: auto;
  border: 0;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
}

.dialogBody { padding: 18px; }

.dialogFoot {
  padding: 12px 18px;
  border-top: 1px solid #e5e8eb;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.primary {
  background: #1a73e8 !important;
  color: #fff !important;
  border-color: #1a73e8 !important;
}

.dialogGrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

.fieldRow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.designHint {
  font-size: 11px;
  color: #7b8188;
  margin-top: 4px;
  margin-bottom: 10px;
}

/* === Template Grid (for component dialog) === */
.templateGrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.templateCard {
  border: 1px solid #d8dde4;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: #fff;
}

.templateCard:hover {
  box-shadow: 0 4px 14px #0002;
}

.templateThumb {
  height: 110px;
  background: #f5f7fa;
  padding: 14px;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* === Outline / Blocks list === */
.outlineList { display: flex; flex-direction: column; gap: 1px; }
.blocksList { display: flex; flex-direction: column; gap: 1px; }

/* === TC Components in ProseMirror === */
.tc-carousel,
.tc-chart,
.tc-stats,
.tc-accordion,
.tc-pricing,
.tc-columns,
.tc-callout,
.tc-testimonial,
.tc-video {
  margin: 22px 0;
  border: 1px solid transparent;
  border-radius: 10px;
  transition: border-color .15s;
}

.tc-carousel {
  border-color: #d4dfef;
  overflow: hidden;
}

.tc-chart svg {
  display: block;
  margin: 0 auto;
}

.tc-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.tc-stat {
  padding: 18px;
  border-radius: 10px;
  background: #f7f9fc;
  text-align: center;
}

.tc-stat strong {
  display: block;
  font-size: 28px;
  color: #1a73e8;
}

.tc-callout {
  padding: 16px 18px;
  border-radius: 10px;
  background: #f2f6fb;
  border-left: 4px solid #5b8fd5;
}

.tc-callout.warning {
  background: #fff7e6;
  border-color: #f29900;
}

.tc-callout.success {
  background: #ecf8f0;
  border-color: #34a853;
}

.tc-accordion details {
  border: 1px solid #d9dee5;
  border-radius: 8px;
  margin: 8px 0;
  padding: 10px 12px;
}

.tc-accordion summary {
  font-weight: 600;
  cursor: pointer;
}

.tc-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.tc-column {
  min-width: 0;
}

.tc-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1a73e8;
  color: #fff !important;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  border: 0;
  font: inherit;
}

.tc-button.secondary {
  background: #fff;
  color: #1a73e8 !important;
  border: 1px solid #1a73e8;
}

.tc-tabs-nav {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #d8dde4;
}

.tc-tab-btn {
  border: 0;
  background: transparent;
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.tc-tab-btn.active {
  color: #1a73e8;
  border-bottom-color: #1a73e8;
}

/* === Responsive === */
@media (max-width: 950px) {
  .workspace, .workspace.inspectorOpen {
    grid-template-columns: 0 minmax(0, 1fr) 0;
  }
  .left, .inspector { display: none; }
  .paper { padding: 50px 42px; }
  .statusbar { left: 14px; }
  .menubar { margin-left: 0; }
  .docTitle { max-width: 55vw; }
}
