:root {
  --primary: #0e9cef;
  --primary-dark: #0b7cc0;
  --bg: #f3f6fb;
  --text: #1f2933;
  --panel: #ffffff;
  --muted: #52606d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

.app {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #0b1320;
  color: #ffffff;
  padding: 20px 16px;
  display: grid;
  gap: 20px;
  z-index: 2;
  overflow-y: auto;
}

.brand img {
  max-width: 160px;
}

.panel details {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

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

.panel-body {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}

.sidebar .shape-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.sidebar .shape-btn.active {
  border-color: #ffffff;
  color: #ffffff;
}

.sidebar .tutorial-hint {
  color: #9fb3c8;
}

.sidebar .tutorial-field label,
.sidebar .tutorial-shape-group summary {
  color: #e4e7eb;
}

.sidebar .tutorial-shape-form {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.main {
  display: grid;
  grid-template-rows: auto auto 1fr;
  padding: 20px;
  gap: 16px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--panel);
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.08);
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
}

.mode-tabs {
  display: flex;
  gap: 10px;
}

.mode-tab {
  border: 1px solid transparent;
  background: #ffffff;
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.mode-tab.active {
  background: var(--primary);
  color: #ffffff;
}

.top-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.primary {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

.file-button input {
  display: none;
}

.workspace {
  display: grid;
  grid-template-columns: 1fr 430px;
  gap: 16px;
}

.workflow-preview-panel {
  margin-top: 16px;
}

.mode-panel {
  display: none;
}

.mode-panel.active {
  display: block;
}

.tutorial-editor {
  background: var(--panel);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.08);
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 12px;
}

.mode-panel.active.tutorial-editor {
  display: grid;
}

.tutorial-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tutorial-shape-form {
  display: grid;
  gap: 8px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #f9fbfe;
}

.tutorial-library-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.block-storage-indicator {
  color: #1f2933;
  background: rgba(15, 23, 42, 0.05);
  border: 1px solid rgba(15, 23, 42, 0.2);
}

.sidebar-title {
  margin: 0;
  font-size: 14px;
}

.tutorial-shape-library {
  display: grid;
  gap: 8px;
}

#tutorial-shape-sidebar.locked {
  opacity: 0.45;
  pointer-events: none;
}

.tutorial-shape-group {
  display: grid;
  gap: 6px;
}

.tutorial-shape-group details {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 6px 8px;
  background: transparent;
}

.tutorial-shape-group summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: #1f2933;
}

.tutorial-shape-items {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 6px;
}

.tutorial-shape-item {
  display: grid;
  gap: 6px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}

.tutorial-shape-item .shape-preview {
  min-width: 100%;
  min-height: 54px;
  height: 54px;
  padding: 6px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 600;
  color: #ffffff;
  white-space: pre-line;
}

.tutorial-shape-item .shape-preview.image-preview {
  height: 46px;
  min-height: 46px;
  min-width: 0;
  padding: 0;
  justify-self: center;
}

.tutorial-shape-item .shape-preview.diamond {
  border-radius: 12px;
  min-width: 0;
  width: 54px;
  height: 54px;
  margin: 0 auto;
  padding: 0;
  transform: rotate(45deg);
}

.tutorial-shape-item .shape-preview.diamond .shape-preview-text {
  transform: rotate(-45deg);
}

.tutorial-shape-item .shape-preview.circle {
  border-radius: 50%;
  min-width: 0;
  width: 54px;
  height: 54px;
  margin: 0 auto;
  padding: 0;
}

.tutorial-shape-item .shape-preview.ellipse {
  border-radius: 50%;
  min-width: 0;
  width: 70px;
  height: 42px;
  margin: 0 auto;
  padding: 0;
}

.tutorial-shape-item .shape-preview.round {
  border-radius: 999px;
  height: 36px;
}

.tutorial-shape-item.active {
  border-color: rgba(14, 156, 239, 0.8);
  box-shadow: 0 0 0 2px rgba(14, 156, 239, 0.2);
}

.tutorial-shape-caption {
  font-size: 11px;
  color: #ffffff;
  text-align: center;
  width: 100%;
  justify-self: stretch;
  padding: 2px 6px;
  border-radius: 8px;
  background: transparent;
}

.tutorial-shape-item img {
  width: 100%;
  height: 54px;
  object-fit: contain;
  background: transparent;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tutorial-preview {
  border-left: 1px solid rgba(15, 23, 42, 0.08);
  padding-left: 12px;
  display: grid;
  gap: 10px;
  align-content: start;
  position: sticky;
  top: 12px;
  align-self: start;
}

.tutorial-text-props {
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #ffffff;
  position: sticky;
  top: 12px;
  align-self: start;
}

.tutorial-text-props h4 {
  margin: 0;
  font-size: 13px;
}

.tutorial-text-props label {
  font-size: 12px;
  color: var(--muted);
}

.tutorial-text-props input {
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.2);
  padding: 6px 8px;
  font-family: inherit;
}

.tutorial-preview h3 {
  margin: 0;
  font-size: 15px;
}

.tutorial-preview-frame {
  min-height: 110px;
  border-radius: 14px;
  background: #f5f8fc;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.tutorial-preview-frame .shape-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 600;
  color: #ffffff;
  border-radius: 8px;
  padding: 10px 12px;
  min-width: 120px;
  min-height: 60px;
  box-sizing: border-box;
  white-space: pre-line;
}

.tutorial-preview-frame .shape-preview.diamond {
  border-radius: 12px;
  min-width: 0;
  width: 90px;
  height: 90px;
  padding: 0;
  transform: rotate(45deg);
}

.tutorial-preview-frame .shape-preview.diamond .shape-preview-text {
  transform: rotate(-45deg);
}

.tutorial-preview-frame .shape-preview.circle {
  border-radius: 50%;
  min-width: 0;
  width: 80px;
  height: 80px;
  padding: 0;
}

.tutorial-preview-frame .shape-preview.ellipse {
  border-radius: 50%;
  min-width: 0;
  width: 120px;
  height: 60px;
  padding: 0;
}

.tutorial-preview-frame .shape-preview.round {
  border-radius: 999px;
  min-width: 0;
  width: 140px;
  height: 60px;
  padding: 0;
}

.shape-preview.link {
  background: transparent;
  border: 1px dashed rgba(15, 23, 42, 0.25);
  position: relative;
}

.shape-preview.link::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 16%;
  top: 50%;
  height: 2px;
  background: currentColor;
  transform: translateY(-50%);
}

.shape-preview.link::after {
  content: "";
  position: absolute;
  right: 12%;
  top: 50%;
  margin-top: -5px;
  border-left: 10px solid currentColor;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

.shape-preview.link .shape-preview-text {
  position: relative;
  z-index: 1;
  background: #ffffff;
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.tutorial-preview-frame .shape-preview.group-box {
  background: rgba(14, 156, 239, 0.1);
  border: 2px dashed rgba(14, 156, 239, 0.5);
  color: #1f2933;
}

.tutorial-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 2px;
  min-height: 100px;
}

.tutorial-toolbar-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tutorial-toolbar-left h3 {
  margin: 0;
  font-size: 16px;
}

.tutorial-toolbar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.compact-select {
  min-width: 140px;
  max-width: 180px;
}

.compact-input {
  min-width: 160px;
  max-width: 220px;
  border: 1px solid rgba(15, 23, 42, 0.2);
  border-radius: 10px;
  padding: 6px 10px;
  font-weight: 600;
}

.tutorial-fields {
  display: grid;
  gap: 4px;
  margin-top: 0;
}

.block-save-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.tutorial-field.inline {
  display: grid;
  grid-template-columns: 60px 1fr;
  align-items: center;
  gap: 6px;
}

.compact-textarea {
  min-height: 32px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.2);
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
}

.tutorial-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-panel {
  padding: 6px 0;
}

.tutorial-toolbar select {
  min-width: 260px;
  border: 1px solid rgba(15, 23, 42, 0.2);
  border-radius: 10px;
  padding: 6px 10px;
  font-weight: 600;
}

.tutorial-hint {
  font-size: 12px;
  color: var(--muted);
}

.tutorial-fields {
  display: grid;
  gap: 6px;
}

.tutorial-field {
  display: grid;
  gap: 6px;
}

.tutorial-field label {
  font-size: 12px;
  color: var(--muted);
}

.tutorial-field input,
.tutorial-field textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 5px 8px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.2);
}

.tutorial-steps {
  display: grid;
  gap: 6px;
}

.tutorial-steps-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tutorial-steps-header h2 {
  margin: 0;
  font-size: 16px;
}

.tutorial-actions {
  display: flex;
  gap: 8px;
}

.tutorial-steps-list {
  display: grid;
  gap: 6px;
}

.tutorial-step {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 14px;
  padding: 8px;
  background: #f9fbfe;
  display: grid;
  gap: 6px;
}

.tutorial-step.collapsed .tutorial-step-body {
  display: none;
}

.tutorial-step-body {
  display: grid;
  gap: 6px;
}

.tutorial-substeps {
  margin-left: 18px;
  padding-left: 12px;
  border-left: 2px dashed rgba(14, 156, 239, 0.35);
  display: grid;
  gap: 6px;
}

.tutorial-step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tutorial-step-title {
  flex: 1;
  margin-right: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.2);
  font-weight: 600;
}

.tutorial-step-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tutorial-step-items {
  display: grid;
  gap: 6px;
}

.tutorial-item {
  display: grid;
  gap: 4px;
  padding: 5px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.tutorial-step-toolbar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tutorial-step-toolbar button,
.tutorial-step-toolbar select,
.tutorial-step-toolbar input[type="color"] {
  border: 1px solid rgba(15, 23, 42, 0.2);
  border-radius: 8px;
  background: #ffffff;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
}

.toggle-step {
  min-width: 36px;
  font-size: 14px;
}

.crop-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.crop-card {
  width: min(90vw, 720px);
  background: #ffffff;
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 12px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
}

.crop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.crop-header h3 {
  margin: 0;
  font-size: 18px;
}

.crop-body {
  background: #f6f8fb;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  justify-content: center;
}

.crop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

#crop-canvas {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.tutorial-textarea {
  min-height: 52px;
  padding: 5px 8px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.15);
  background: #ffffff;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
}

.tutorial-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(14, 156, 239, 0.2);
}

.tutorial-image-box {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  background: #ffffff;
  border-radius: 12px;
  border: 1px dashed rgba(15, 23, 42, 0.2);
  min-height: 180px;
}

.tutorial-image-box.dragging {
  border-color: var(--primary);
  background: #eef7ff;
}

.tutorial-image-frame {
  position: relative;
  display: flex;
  justify-content: center;
}

.tutorial-image-box img {
  display: block;
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  position: relative;
  z-index: 1;
}

.tutorial-image-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 8px;
}

.overlay-layer {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  z-index: 2;
  touch-action: none;
}

.overlay-item {
  position: absolute;
  border: 2px solid #ff3b30;
  border-radius: 6px;
  pointer-events: auto;
  z-index: 3;
  cursor: move;
}

.overlay-item.circle {
  border-radius: 999px;
}

.overlay-item.pointer {
  border-radius: 0;
  clip-path: polygon(0 50%, 70% 0, 70% 30%, 100% 30%, 100% 70%, 70% 70%, 70% 100%);
}

.overlay-item.arrow {
  border: none;
  background: transparent;
}

.overlay-item.arrow::before,
.overlay-item.arrow::after {
  display: none;
}

.overlay-arrow-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  margin-top: -5px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #ff3b30;
  cursor: pointer;
  z-index: 4;
}

.overlay-arrow-head-wrap {
  position: absolute;
  transform: translate(0, -50%);
  pointer-events: none;
  z-index: 5;
}

.overlay-arrow-head {
  position: absolute;
  width: 12px;
  height: 10px;
  background: #ff3b30;
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
  pointer-events: none;
  z-index: 6;
}

.overlay-item.text {
  border: 1px solid currentColor;
  background: rgba(255, 255, 255, 0.85);
  color: currentColor;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2px 4px;
  box-sizing: border-box;
}

.overlay-item.selected {
  box-shadow: 0 0 0 2px rgba(14, 156, 239, 0.35);
}

.overlay-resize {
  position: absolute;
  width: 10px;
  height: 10px;
  right: -6px;
  bottom: -6px;
  background: #ffffff;
  border: 1px solid #1f2933;
  border-radius: 3px;
  cursor: se-resize;
  z-index: 4;
}

.canvas {
  position: relative;
  background: var(--panel);
  border-radius: 18px;
  min-height: 520px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08),
    0 12px 22px rgba(15, 23, 42, 0.08);
  overflow: auto;
}

.connections {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
}

.connections path {
  pointer-events: stroke;
  cursor: pointer;
}

.connections .connection-hit {
  stroke: transparent;
  stroke-width: 12;
  fill: none;
}

.connections text {
  font-size: 12px;
  fill: #1f2933;
  text-anchor: middle;
  user-select: none;
  pointer-events: none;
}

.connections .connection-label {
  cursor: move;
  pointer-events: all;
  user-select: none;
}

.connections .connection-label rect {
  opacity: 1;
}

.connections .connection-label text {
  pointer-events: none;
}

.snap-guide {
  position: absolute;
  background: rgba(14, 156, 239, 0.65);
  pointer-events: none;
  z-index: 6;
}

.snap-guide-x {
  top: 0;
  bottom: 0;
  width: 1px;
  transform: translateX(-0.5px);
}

.snap-guide-y {
  left: 0;
  right: 0;
  height: 1px;
  transform: translateY(-0.5px);
}

.shape {
  position: absolute;
  min-width: 50px;
  min-height: 50px;
  padding: 8px 10px;
  box-sizing: border-box;
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
  text-align: center;
  border-radius: 8px;
  cursor: move;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

.shape.round {
  border-radius: 999px;
}

.shape.circle {
  border-radius: 50%;
}

.shape.ellipse {
  border-radius: 50%;
}

.shape.diamond {
  border-radius: 12px;
  transform: rotate(45deg);
}

.shape.diamond .shape-text-inner {
  transform: none;
}

.shape-text {
  white-space: pre-line;
  line-height: 1.2;
}

.shape.selected {
  outline: 2px solid var(--primary-dark);
}

.shape .anchor {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--primary);
  cursor: pointer;
  z-index: 4;
  transform: translate(-50%, -50%);
}

.shape .anchor.active {
  background: var(--primary);
}

.conn-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--primary);
  cursor: pointer;
  z-index: 5;
  z-index: 4;
  transform: translate(-50%, -50%);
}

.connection-selected {
  stroke-width: 3;
}

.hidden {
  display: none !important;
}

.shape.group-box {
  background: rgba(14, 156, 239, 0.1);
  border: 2px dashed rgba(14, 156, 239, 0.5);
  color: #1f2933;
  font-weight: 600;
  z-index: 0;
  position: absolute;
}

.shape.group-box .shape-text {
  pointer-events: none;
  position: absolute;
  top: 6px;
  right: 10px;
  text-align: right;
}

.shape.logo {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  color: #1f2933;
  padding: 0;
}

.shape.logo .shape-image {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 6px;
  background: #ffffff;
}

.text-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--primary);
  cursor: move;
  z-index: 5;
}

.resize-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #ffffff;
  border: 1px solid #1f2933;
  border-radius: 3px;
  cursor: nwse-resize;
  z-index: 3;
}

.resize-handle.br {
  right: -5px;
  bottom: -5px;
}

.resize-handle.bl {
  left: -5px;
  bottom: -5px;
  cursor: nesw-resize;
}

.resize-handle.tr {
  right: -5px;
  top: -5px;
  cursor: nesw-resize;
}

.resize-handle.tl {
  left: -5px;
  top: -5px;
  cursor: nwse-resize;
}

.properties {
  background: var(--panel);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.08);
}

.properties h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.prop-group {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.prop-group label {
  font-size: 12px;
  color: var(--muted);
}

.prop-group textarea {
  font-family: inherit;
  font-size: 13px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.2);
  resize: vertical;
}

.prop-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.prop-actions {
  margin-top: 12px;
}

.danger {
  background: #ef4444;
  color: #ffffff;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.block-panel {
  margin-top: 4px;
  display: grid;
  gap: 8px;
}

.block-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.block-sections {
  display: grid;
  gap: 10px;
}

.block-section {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 10px 12px;
}

.block-section summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
}

.block-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.block-item {
  display: grid;
  gap: 6px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  cursor: pointer;
}

.block-item .shape-preview {
  min-width: 100%;
  min-height: 54px;
  height: 54px;
  padding: 6px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 600;
  color: #ffffff;
  white-space: pre-line;
}

.block-item .shape-preview.image-preview {
  height: 46px;
  min-height: 46px;
  min-width: 0;
  padding: 0;
  justify-self: center;
}

.block-item .shape-preview.diamond {
  border-radius: 12px;
  min-width: 0;
  width: 54px;
  height: 54px;
  margin: 0 auto;
  padding: 0;
  transform: rotate(45deg);
}

.block-item .shape-preview.diamond .shape-preview-text {
  transform: rotate(-45deg);
}

.block-item .shape-preview.circle {
  border-radius: 50%;
  min-width: 0;
  width: 54px;
  height: 54px;
  margin: 0 auto;
  padding: 0;
}

.block-item .shape-preview.ellipse {
  border-radius: 50%;
  min-width: 0;
  width: 70px;
  height: 42px;
  margin: 0 auto;
  padding: 0;
}

.block-item .shape-preview.round {
  border-radius: 999px;
  height: 36px;
}

.block-item-actions {
  display: none;
}

.brick-panel {
  background: #ffffff;
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

.brick-panel h3 {
  margin: 0 0 8px;
}

.brick-note {
  color: #52606d;
  margin: 6px 0 0;
}

.brick-tutorial {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.brick-step,
.brick-substep {
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  border: 1px solid #e4e9f0;
}

.brick-step summary,
.brick-substep summary {
  cursor: pointer;
  font-weight: 600;
  padding: 14px 16px;
  list-style: none;
  background: rgba(14, 156, 239, 0.12);
}

.brick-step summary::-webkit-details-marker,
.brick-substep summary::-webkit-details-marker {
  display: none;
}

.brick-step summary::after,
.brick-substep summary::after {
  content: "+";
  float: right;
  font-size: 18px;
  color: var(--primary-dark);
}

.brick-step[open] summary::after,
.brick-substep[open] summary::after {
  content: "–";
}

.brick-step-body {
  padding: 10px 16px 14px;
  color: #334e68;
  display: grid;
  gap: 8px;
}

.brick-step-text {
  color: #334e68;
  line-height: 1.5;
}

.brick-step-image {
  position: relative;
  margin: 0 auto;
}

.brick-substeps {
  margin-top: 8px;
  padding-left: 12px;
  border-left: 2px dashed rgba(14, 156, 239, 0.35);
  display: grid;
  gap: 8px;
}

.brick-step-image img {
  width: 100%;
  display: block;
  border-radius: 10px;
  border: 1px solid #e0e6ed;
}

.brick-overlay-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.brick-overlay {
  position: absolute;
  border: 2px solid #ff3b30;
  border-radius: 6px;
  background: rgba(255, 59, 48, 0.05);
}

.brick-overlay.circle {
  border-radius: 999px;
}

.brick-overlay.pointer {
  border-radius: 0;
  clip-path: polygon(0 50%, 70% 0, 70% 30%, 100% 30%, 100% 70%, 70% 70%, 70% 100%);
  background: transparent;
}

.brick-overlay.arrow {
  border: none;
  background: transparent;
}

.brick-overlay.arrow::before {
  content: "";
  position: absolute;
  left: 0;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border-top: 2px solid currentColor;
}

.brick-overlay.arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 8px solid currentColor;
}

.brick-overlay.text {
  border: 1px solid currentColor;
  background: rgba(255, 255, 255, 0.85);
  color: currentColor;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2px 4px;
  box-sizing: border-box;
}

.block-item strong {
  font-size: 12px;
  color: #ffffff;
}

.block-item span {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
}

.shape-btn {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 600;
}

.shape-btn.active {
  border-color: var(--primary);
  color: var(--primary);
}

.hint {
  font-size: 12px;
  color: var(--muted);
}

.group-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.group-actions input {
  flex: 1;
}

.group-list {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.sidebar .group-list {
  color: rgba(255, 255, 255, 0.7);
}

.sidebar .group-actions label {
  color: rgba(255, 255, 255, 0.7);
}

.logo-list {
  display: grid;
  gap: 8px;
}


.logo-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  padding: 6px 8px;
  border-radius: 8px;
}

.logo-item img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 6px;
  padding: 2px;
}

.logo-item span {
  color: rgba(255, 255, 255, 0.85);
}
