/* ===== Каркас приложения ===== */
.app-container { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }

.md-top-app-bar {
  min-height: 60px;
  background-color: var(--md-sys-color-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  z-index: 10;
}
.md-top-app-bar .brand { display: flex; align-items: center; gap: 10px; }
.md-top-app-bar .brand .icon { font-size: 26px; color: var(--md-sys-color-primary); }
.md-top-app-bar .brand .title { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.version-tag {
  font-size: 11px;
  background: var(--md-sys-color-surface-container-highest);
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--md-sys-color-primary);
}
.md-top-app-bar .actions { display: flex; align-items: center; gap: 8px; }

.main-workspace { display: flex; flex: 1; min-height: 0; overflow: hidden; }

.controls-panel {
  flex: 0 0 clamp(320px, 27vw, 400px);
  width: clamp(320px, 27vw, 400px);
  min-width: 0;
  background-color: var(--md-sys-color-surface-container-low);
  border-right: 1px solid var(--md-sys-color-outline-variant);
  display: flex;
  flex-direction: column;
}
.panel-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.control-section {
  background-color: var(--md-sys-color-surface-container);
  border-radius: var(--md-sys-shape-corner-medium);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--md-sys-color-primary);
}
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panel-footer {
  padding: 12px 16px;
  background-color: var(--md-sys-color-surface-container);
  border-top: 1px solid var(--md-sys-color-outline-variant);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preview-stage {
  flex: 1;
  min-width: 0;
  min-height: 0;
  position: relative;
  background-color: var(--md-sys-color-surface-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 20px 84px;
  overflow: hidden;
}
.preview-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--md-sys-shape-corner-large);
  box-shadow: var(--md-sys-elevation-3);
  overflow: hidden;
  border: 1px solid var(--md-sys-color-outline-variant);
  background: #000;
  max-width: 100%;
  max-height: 100%;
}
#previewCanvas { display: block; }

.stage-floating-bar {
  position: absolute;
  bottom: 24px;
  right: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100% - 32px);
}
.info-badge {
  background: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface);
  padding: 6px 12px;
  border-radius: var(--md-sys-shape-corner-full);
  font-size: 12px;
  font-weight: 500;
}
.preview-expand-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, .5);
  backdrop-filter: blur(8px);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}