*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

.bsg__wrap {
  font-family: 'Segoe UI', system-ui, sans-serif;
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  padding: 24px;
  background: #f0f2f7;
  color: #1e2235;
  min-height: 100vh;
  max-width: 1050px;
  margin: 0 auto;
}

/* ── Panel ── */
.bsg__panel {
  background: #fff;
  border: 1px solid #dde1ef;
  border-radius: 16px;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: fit-content;
}
.bsg__section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #8b93b8;
  margin-bottom: 2px;
}

/* ── Presets ── */
.bsg__presets {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.bsg__preset-btn {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid #dde1ef;
  background: #f5f6fb;
  color: #4a5280;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.bsg__preset-btn:hover { background: #1847f0; color: #fff; border-color: #1847f0; }

/* ── Layer list ── */
.bsg__shadow-list { display: flex; flex-direction: column; gap: 7px; }
.bsg__shadow-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f5f6fb;
  border: 1.5px solid #dde1ef;
  border-radius: 9px;
  padding: 7px 10px;
  cursor: pointer;
  transition: border-color .15s;
  font-size: 12px;
  color: #6b7399;
}
.bsg__shadow-item.bsg--selected { border-color: #1847f0; background: #f0f1ff; color: #1e2235; }
.bsg__shadow-dot { width: 13px; height: 13px; border-radius: 50%; flex-shrink: 0; border: 1px solid #ccc; }
.bsg__shadow-label { flex: 1; font-family: monospace; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bsg__icon-btn { background: none; border: none; cursor: pointer; color: #c0c5dc; padding: 2px 4px; border-radius: 4px; font-size: 14px; line-height: 1; transition: color .15s; }
.bsg__icon-btn:hover { color: #ef4444; }
.bsg__add-btn { width: 100%; padding: 8px; border-radius: 9px; border: 1.5px dashed #c8cde6; background: transparent; color: #8b93b8; font-size: 13px; cursor: pointer; transition: all .15s; }
.bsg__add-btn:hover { border-color: #1847f0; color: #1847f0; }

/* ── Divider ── */
.bsg__divider { border: none; border-top: 1px solid #edf0f9; }

/* ── Toggle row ── */
.bsg__toggle-row { display: flex; gap: 8px; }
.bsg__toggle-btn { flex: 1; padding: 7px 6px; border-radius: 8px; border: 1.5px solid #dde1ef; background: #f5f6fb; color: #8b93b8; font-size: 12px; font-weight: 600; cursor: pointer; transition: all .15s; }
.bsg__toggle-btn.bsg--active { background: #1847f0; border-color: #1847f0; color: #fff; box-shadow: 0 2px 8px #1847f040; }

/* ── Sliders ── */
.bsg__row { display: flex; flex-direction: column; gap: 6px; }
.bsg__label-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: #4a5280; }
.bsg__label-left { display: flex; align-items: center; gap: 5px; }
.bsg__val-badge { font-size: 11px; font-weight: 700; color: #1847f0; background: #eef0ff; padding: 2px 8px; border-radius: 6px; }

/* Tooltip */
.bsg__tip-wrap { position: relative; display: inline-flex; align-items: center; }
.bsg__tip-icon { width: 15px; height: 15px; border-radius: 50%; background: #e8eaf5; color: #8b93b8; font-size: 9px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; cursor: default; user-select: none; flex-shrink: 0; }
.bsg__tip-box { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); background: #1e2235; color: #e8eaf5; font-size: 11px; line-height: 1.5; padding: 7px 10px; border-radius: 8px; width: 180px; pointer-events: none; opacity: 0; transition: opacity .15s; z-index: 99; white-space: normal; }
.bsg__tip-wrap:hover .bsg__tip-box { opacity: 1; }

/* Slider */
.bsg__slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 10px;
  background: #e8eaf5;
  outline: none;
  cursor: pointer;
}
.bsg__slider::-webkit-slider-thumb { -webkit-appearance: none; width: 17px; height: 17px; border-radius: 50%; background: #1847f0; border: 2px solid #fff; cursor: pointer; box-shadow: 0 1px 6px #1847f060; }
.bsg__slider::-moz-range-thumb { width: 17px; height: 17px; border-radius: 50%; background: #1847f0; border: 2px solid #fff; cursor: pointer; }

/* ── Color ── */
.bsg__color-row { display: flex; align-items: center; gap: 10px; }
.bsg__color-swatch { width: 38px; height: 38px; border-radius: 8px; border: 1.5px solid #dde1ef; cursor: pointer; flex-shrink: 0; overflow: hidden; position: relative; }
.bsg__color-swatch input[type="color"] { position: absolute; inset: -4px; width: calc(100% + 8px); height: calc(100% + 8px); opacity: 0; cursor: pointer; border: none; }
.bsg__color-swatch-preview { width: 100%; height: 100%; pointer-events: none; }
.bsg__hex-input { flex: 1; background: #f5f6fb; border: 1.5px solid #dde1ef; border-radius: 8px; color: #1e2235; font-size: 13px; padding: 8px 10px; outline: none; font-family: monospace; letter-spacing: .06em; }
.bsg__hex-input:focus { border-color: #1847f0; }

/* ── Preview area ── */
.bsg__preview-area { display: flex; flex-direction: column; gap: 18px; }
.bsg__canvas {
  flex: 1;
  background: #e8eaf5;
  border: 1px solid #dde1ef;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  position: relative;
  overflow: hidden;
  transition: background .3s;
}
.bsg__canvas-bg { position: absolute; inset: 0; background-image: radial-gradient(circle, #b0b8d8 1px, transparent 1px); background-size: 22px 22px; opacity: .35; }

/* Shape bar */
.bsg__shape-bar { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; z-index: 2; background: #ffffffcc; backdrop-filter: blur(6px); border: 1px solid #dde1ef; border-radius: 30px; padding: 5px 10px; }
.bsg__shape-btn { background: none; border: none; cursor: pointer; font-size: 16px; padding: 2px 5px; border-radius: 6px; opacity: .5; transition: all .15s; }
.bsg__shape-btn.bsg--active { opacity: 1; background: #eef0ff; }

/* Box color bar */
.bsg__box-color-wrap { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 7px; z-index: 2; background: #ffffffcc; backdrop-filter: blur(6px); border: 1px solid #dde1ef; border-radius: 30px; padding: 6px 12px; align-items: center; }
.bsg__box-color-label { font-size: 11px; color: #8b93b8; font-weight: 600; white-space: nowrap; }
.bsg__bg-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: transform .15s; flex-shrink: 0; }
.bsg__bg-dot:hover, .bsg__bg-dot.bsg--active { transform: scale(1.3); border-color: #1847f0; }

/* Box color swatch */
.bsg__box-color-swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #dde1ef; overflow: hidden; position: relative; cursor: pointer; }
.bsg__box-color-swatch input[type="color"] { position: absolute; inset: -4px; width: calc(100% + 8px); height: calc(100% + 8px); opacity: 0; cursor: pointer; }
.bsg__box-color-swatch-preview { width: 100%; height: 100%; pointer-events: none; }

/* Preview box */
.bsg__preview-box { width: 130px; height: 130px; background: #ffffff; border-radius: 14px; position: relative; z-index: 1; transition: box-shadow .2s, border-radius .2s, background .3s; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #8b93b8; font-weight: 500; user-select: none; }

/* ── Output card ── */
.bsg__output-card { background: #fff; border: 1px solid #dde1ef; border-radius: 16px; padding: 18px 20px; }
.bsg__output-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.bsg__output-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.bsg__out-tab { padding: 5px 12px; border-radius: 20px; border: 1.5px solid #dde1ef; background: #f5f6fb; color: #8b93b8; font-size: 12px; font-weight: 600; cursor: pointer; transition: all .15s; }
.bsg__out-tab.bsg--active { background: #1847f0; border-color: #1847f0; color: #fff; }
.bsg__output-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bsg__toggle-small { display: flex; align-items: center; gap: 5px; font-size: 11px; color: #8b93b8; font-weight: 600; cursor: pointer; user-select: none; }
.bsg__toggle-small input[type="checkbox"] { accent-color: #1847f0; width: 14px; height: 14px; cursor: pointer; }
.bsg__copy-btn { background: #eef0ff; border: 1.5px solid #c5c9f7; color: #1847f0; border-radius: 8px; padding: 6px 16px; font-size: 12px; font-weight: 700; cursor: pointer; transition: all .15s; }
.bsg__copy-btn:hover { background: #1847f0; color: #fff; }
.bsg__copy-btn.bsg--copied { background: #dcfce7; border-color: #86efac; color: #16a34a; }
.bsg__code { background: #f8f9fd; border: 1px solid #edf0f9; border-radius: 10px; padding: 14px 16px; font-family: 'Fira Code', 'Cascadia Code', monospace; font-size: 12.5px; color: #2d3460; word-break: break-all; line-height: 1.7; white-space: pre-wrap; }
.bsg__prop { color: #8b93b8; }
.bsg__val-hl { color: #e05c2a; }
.bsg__kw { color: #1847f0; }

/* ── Responsive ── */
@media (max-width: 720px) {
  .bsg__wrap { grid-template-columns: 1fr; }
}