.bkm-root {
  color: #111827;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
}

.bkm-header {
  margin-bottom: 16px;
}

.bkm-title {
  font-size: 24px;
  line-height: 1.25;
  margin: 0 0 4px 0;
}

.bkm-subtitle {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
}

.bkm-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  align-items: start;
}

.bkm-panel {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  background: #fff;
}

.bkm-section {
  margin-bottom: 16px;
}

.bkm-section-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 8px 0;
}

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

.bkm-template {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 8px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.bkm-template:hover {
  border-color: #c7d2fe;
  box-shadow: 0 6px 16px rgba(17, 24, 39, 0.08);
}

.bkm-template.is-active {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.bkm-template-img {
  width: 100%;
  height: 92px;
  object-fit: cover;
  border-radius: 8px;
  background: #f3f4f6;
  display: block;
}

.bkm-template-label {
  margin-top: 6px;
  font-size: 12px;
  color: #374151;
  font-weight: 600;
  line-height: 1.3;
  word-break: break-word;
}

.bkm-file {
  display: block;
  width: 100%;
}

.bkm-file-meta {
  margin-top: 6px;
  font-size: 12px;
  color: #6b7280;
}

.bkm-bg-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bkm-select {
  width: 100%;
  max-width: 220px;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  color: #111827;
}

.bkm-color {
  width: 44px;
  height: 36px;
  padding: 0;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
}

.bkm-slider {
  width: 100%;
}

.bkm-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.bkm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  transition: transform 80ms ease, box-shadow 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.bkm-btn:active {
  transform: translateY(1px);
}

.bkm-btn-primary {
  background: #2563eb;
  color: #fff;
}

.bkm-btn-primary:hover {
  background: #1d4ed8;
}

.bkm-btn-secondary {
  background: #fff;
  color: #111827;
  border-color: #d1d5db;
}

.bkm-btn-secondary:hover {
  background: #f3f4f6;
}

.bkm-hint {
  margin-top: 10px;
  color: #6b7280;
  font-size: 12px;
}

.bkm-error {
  margin-top: 12px;
  padding: 10px 12px;
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: 10px;
  font-size: 13px;
}

.bkm-preview {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  background: #fff;
}

.bkm-canvas-wrap {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.bkm-canvas {
  width: 100%;
  height: auto;
  display: block;
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}

.bkm-preview-note {
  margin-top: 12px;
  text-align: center;
  font-size: 12px;
  color: #6b7280;
}

.bkm-empty {
  padding: 12px;
  border-radius: 10px;
  background: #f3f4f6;
  color: #374151;
  font-size: 14px;
}

.bkm-hidden {
  display: none !important;
}

@media (max-width: 768px) {
  .bkm-layout {
    grid-template-columns: 1fr;
  }
  .bkm-preview {
    order: -1;
  }
}
